@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/avl/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React105 from 'react';
|
|
3
|
+
import React105__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
|
|
4
4
|
import { getAllPages, OrbitalProvider, EventBusContext, useTraitScope, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, useEntitySchema, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
6
6
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
@@ -3174,7 +3174,7 @@ var init_Typography = __esm({
|
|
|
3174
3174
|
}) => {
|
|
3175
3175
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
3176
3176
|
const Component = as || defaultElements[variant];
|
|
3177
|
-
return
|
|
3177
|
+
return React105__default.createElement(
|
|
3178
3178
|
Component,
|
|
3179
3179
|
{
|
|
3180
3180
|
id,
|
|
@@ -3511,7 +3511,7 @@ var init_Box = __esm({
|
|
|
3511
3511
|
fixed: "fixed",
|
|
3512
3512
|
sticky: "sticky"
|
|
3513
3513
|
};
|
|
3514
|
-
Box =
|
|
3514
|
+
Box = React105__default.forwardRef(
|
|
3515
3515
|
({
|
|
3516
3516
|
padding,
|
|
3517
3517
|
paddingX,
|
|
@@ -3576,7 +3576,7 @@ var init_Box = __esm({
|
|
|
3576
3576
|
onPointerDown?.(e);
|
|
3577
3577
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
3578
3578
|
const isClickable = action || onClick;
|
|
3579
|
-
return
|
|
3579
|
+
return React105__default.createElement(
|
|
3580
3580
|
Component,
|
|
3581
3581
|
{
|
|
3582
3582
|
ref,
|
|
@@ -3672,7 +3672,7 @@ var init_Stack = __esm({
|
|
|
3672
3672
|
};
|
|
3673
3673
|
const isHorizontal = direction === "horizontal";
|
|
3674
3674
|
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";
|
|
3675
|
-
return
|
|
3675
|
+
return React105__default.createElement(
|
|
3676
3676
|
Component,
|
|
3677
3677
|
{
|
|
3678
3678
|
className: cn(
|
|
@@ -4164,7 +4164,7 @@ var init_MiniStateMachine = __esm({
|
|
|
4164
4164
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
4165
4165
|
const tc = transitionCounts[s.name] ?? 0;
|
|
4166
4166
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
4167
|
-
return /* @__PURE__ */ jsxs(
|
|
4167
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
4168
4168
|
/* @__PURE__ */ jsx(
|
|
4169
4169
|
AvlState,
|
|
4170
4170
|
{
|
|
@@ -4494,7 +4494,7 @@ function loadLib(key, importer) {
|
|
|
4494
4494
|
return p;
|
|
4495
4495
|
}
|
|
4496
4496
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
4497
|
-
const Lazy =
|
|
4497
|
+
const Lazy = React105__default.lazy(async () => {
|
|
4498
4498
|
const lib = await loadLib(libKey, importer);
|
|
4499
4499
|
const Comp = pick(lib);
|
|
4500
4500
|
if (!Comp) {
|
|
@@ -4504,7 +4504,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
4504
4504
|
return { default: Comp };
|
|
4505
4505
|
});
|
|
4506
4506
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
4507
|
-
|
|
4507
|
+
React105__default.Suspense,
|
|
4508
4508
|
{
|
|
4509
4509
|
fallback: /* @__PURE__ */ jsx(
|
|
4510
4510
|
"span",
|
|
@@ -5235,7 +5235,7 @@ var init_Icon = __esm({
|
|
|
5235
5235
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
5236
5236
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
5237
5237
|
const family = useIconFamily();
|
|
5238
|
-
const RenderedComponent =
|
|
5238
|
+
const RenderedComponent = React105__default.useMemo(() => {
|
|
5239
5239
|
if (directIcon) return null;
|
|
5240
5240
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
5241
5241
|
}, [directIcon, effectiveName, family]);
|
|
@@ -5285,6 +5285,210 @@ var init_Icon = __esm({
|
|
|
5285
5285
|
Icon.displayName = "Icon";
|
|
5286
5286
|
}
|
|
5287
5287
|
});
|
|
5288
|
+
|
|
5289
|
+
// lib/atlasSlice.ts
|
|
5290
|
+
function isTilesheet(a) {
|
|
5291
|
+
return typeof a.tileWidth === "number";
|
|
5292
|
+
}
|
|
5293
|
+
function getAtlas(url, onReady) {
|
|
5294
|
+
if (atlasCache.has(url)) return atlasCache.get(url) ?? void 0;
|
|
5295
|
+
atlasCache.set(url, void 0);
|
|
5296
|
+
fetch(url).then((r2) => r2.json()).then((json) => {
|
|
5297
|
+
atlasCache.set(url, json);
|
|
5298
|
+
onReady();
|
|
5299
|
+
}).catch(() => {
|
|
5300
|
+
atlasCache.set(url, null);
|
|
5301
|
+
});
|
|
5302
|
+
return void 0;
|
|
5303
|
+
}
|
|
5304
|
+
function subRectFor(atlas, sprite) {
|
|
5305
|
+
if (isTilesheet(atlas)) {
|
|
5306
|
+
let col;
|
|
5307
|
+
let row;
|
|
5308
|
+
if (sprite.includes(",")) {
|
|
5309
|
+
const [c, r2] = sprite.split(",").map((n) => Number(n.trim()));
|
|
5310
|
+
col = c;
|
|
5311
|
+
row = r2;
|
|
5312
|
+
} else {
|
|
5313
|
+
const i = Number(sprite);
|
|
5314
|
+
if (!Number.isFinite(i)) return null;
|
|
5315
|
+
col = i % atlas.columns;
|
|
5316
|
+
row = Math.floor(i / atlas.columns);
|
|
5317
|
+
}
|
|
5318
|
+
if (!Number.isFinite(col) || !Number.isFinite(row) || col < 0 || row < 0 || col >= atlas.columns || row >= atlas.rows) return null;
|
|
5319
|
+
const margin = atlas.margin ?? 0;
|
|
5320
|
+
const spacing = atlas.spacing ?? 0;
|
|
5321
|
+
return {
|
|
5322
|
+
sx: margin + col * (atlas.tileWidth + spacing),
|
|
5323
|
+
sy: margin + row * (atlas.tileHeight + spacing),
|
|
5324
|
+
sw: atlas.tileWidth,
|
|
5325
|
+
sh: atlas.tileHeight
|
|
5326
|
+
};
|
|
5327
|
+
}
|
|
5328
|
+
const st = atlas.subTextures[sprite];
|
|
5329
|
+
if (!st) return null;
|
|
5330
|
+
return { sx: st.x, sy: st.y, sw: st.width, sh: st.height };
|
|
5331
|
+
}
|
|
5332
|
+
function isAtlasAsset(asset) {
|
|
5333
|
+
return !!asset && typeof asset.atlas === "string" && typeof asset.sprite === "string";
|
|
5334
|
+
}
|
|
5335
|
+
function resolveAssetSource(img, asset, onReady) {
|
|
5336
|
+
if (isAtlasAsset(asset)) {
|
|
5337
|
+
const atlas = getAtlas(asset.atlas, onReady);
|
|
5338
|
+
if (!atlas) return null;
|
|
5339
|
+
const rect = subRectFor(atlas, asset.sprite);
|
|
5340
|
+
if (!rect) return null;
|
|
5341
|
+
return { img, rect, aspect: rect.sw / rect.sh };
|
|
5342
|
+
}
|
|
5343
|
+
const natW = img.naturalWidth || 1;
|
|
5344
|
+
const natH = img.naturalHeight || 1;
|
|
5345
|
+
return { img, rect: null, aspect: natW / natH };
|
|
5346
|
+
}
|
|
5347
|
+
function blit(ctx, src, dx, dy, dw, dh) {
|
|
5348
|
+
if (src.rect) ctx.drawImage(src.img, src.rect.sx, src.rect.sy, src.rect.sw, src.rect.sh, dx, dy, dw, dh);
|
|
5349
|
+
else ctx.drawImage(src.img, dx, dy, dw, dh);
|
|
5350
|
+
}
|
|
5351
|
+
var atlasCache;
|
|
5352
|
+
var init_atlasSlice = __esm({
|
|
5353
|
+
"lib/atlasSlice.ts"() {
|
|
5354
|
+
"use client";
|
|
5355
|
+
atlasCache = /* @__PURE__ */ new Map();
|
|
5356
|
+
}
|
|
5357
|
+
});
|
|
5358
|
+
function useAtlasSliceDataUrl(asset) {
|
|
5359
|
+
const [, bump] = React105.useReducer((x) => x + 1, 0);
|
|
5360
|
+
if (!isAtlasAsset(asset)) return void 0;
|
|
5361
|
+
const key = `${asset.atlas}#${asset.sprite}`;
|
|
5362
|
+
const cached = sliceDataUrlCache.get(key);
|
|
5363
|
+
if (cached) return cached;
|
|
5364
|
+
const atlas = getAtlas(asset.atlas, bump);
|
|
5365
|
+
const img = asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
5366
|
+
if (!atlas || !img) return void 0;
|
|
5367
|
+
const rect = subRectFor(atlas, asset.sprite);
|
|
5368
|
+
if (!rect) return void 0;
|
|
5369
|
+
const canvas = document.createElement("canvas");
|
|
5370
|
+
canvas.width = rect.sw;
|
|
5371
|
+
canvas.height = rect.sh;
|
|
5372
|
+
const ctx = canvas.getContext("2d");
|
|
5373
|
+
if (!ctx) return void 0;
|
|
5374
|
+
ctx.imageSmoothingEnabled = false;
|
|
5375
|
+
ctx.drawImage(img, rect.sx, rect.sy, rect.sw, rect.sh, 0, 0, rect.sw, rect.sh);
|
|
5376
|
+
const url = canvas.toDataURL();
|
|
5377
|
+
sliceDataUrlCache.set(key, url);
|
|
5378
|
+
return url;
|
|
5379
|
+
}
|
|
5380
|
+
function AtlasPanel({ asset, borderSlice = 16, borderWidth = 16, mode = "nineSlice", className, style, children, "aria-hidden": ariaHidden }) {
|
|
5381
|
+
const dataUrl = useAtlasSliceDataUrl(asset);
|
|
5382
|
+
const skin = !dataUrl ? {} : mode === "repeat" ? { backgroundImage: `url(${dataUrl})`, backgroundRepeat: "repeat" } : {
|
|
5383
|
+
borderStyle: "solid",
|
|
5384
|
+
borderWidth,
|
|
5385
|
+
borderImageSource: `url(${dataUrl})`,
|
|
5386
|
+
borderImageSlice: `${borderSlice} fill`,
|
|
5387
|
+
borderImageWidth: borderWidth,
|
|
5388
|
+
borderImageRepeat: "stretch",
|
|
5389
|
+
imageRendering: "pixelated"
|
|
5390
|
+
};
|
|
5391
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": ariaHidden, className: cn("inline-block", className), style: { ...skin, ...style }, children });
|
|
5392
|
+
}
|
|
5393
|
+
function getSheetImage(url, onReady) {
|
|
5394
|
+
const cached = imageCache.get(url);
|
|
5395
|
+
if (cached) return cached;
|
|
5396
|
+
(imageWaiters.get(url) ?? imageWaiters.set(url, /* @__PURE__ */ new Set()).get(url)).add(onReady);
|
|
5397
|
+
if (!imageCache.has(url)) {
|
|
5398
|
+
imageCache.set(url, null);
|
|
5399
|
+
const img = new Image();
|
|
5400
|
+
img.crossOrigin = "anonymous";
|
|
5401
|
+
img.onload = () => {
|
|
5402
|
+
imageCache.set(url, img);
|
|
5403
|
+
imageWaiters.get(url)?.forEach((fn) => fn());
|
|
5404
|
+
imageWaiters.delete(url);
|
|
5405
|
+
};
|
|
5406
|
+
img.src = url;
|
|
5407
|
+
}
|
|
5408
|
+
return null;
|
|
5409
|
+
}
|
|
5410
|
+
function AtlasImage({
|
|
5411
|
+
asset,
|
|
5412
|
+
size,
|
|
5413
|
+
width,
|
|
5414
|
+
height,
|
|
5415
|
+
fill = false,
|
|
5416
|
+
fit = "contain",
|
|
5417
|
+
alt,
|
|
5418
|
+
className,
|
|
5419
|
+
style,
|
|
5420
|
+
"aria-hidden": ariaHidden
|
|
5421
|
+
}) {
|
|
5422
|
+
const [, bump] = React105.useReducer((x) => x + 1, 0);
|
|
5423
|
+
const canvasRef = React105.useRef(null);
|
|
5424
|
+
const sliced = isAtlasAsset(asset);
|
|
5425
|
+
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
5426
|
+
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
5427
|
+
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
5428
|
+
React105.useEffect(() => {
|
|
5429
|
+
const canvas = canvasRef.current;
|
|
5430
|
+
if (!canvas || !img || !rect) return;
|
|
5431
|
+
canvas.width = rect.sw;
|
|
5432
|
+
canvas.height = rect.sh;
|
|
5433
|
+
const ctx = canvas.getContext("2d");
|
|
5434
|
+
if (!ctx) return;
|
|
5435
|
+
ctx.imageSmoothingEnabled = false;
|
|
5436
|
+
ctx.clearRect(0, 0, rect.sw, rect.sh);
|
|
5437
|
+
ctx.drawImage(img, rect.sx, rect.sy, rect.sw, rect.sh, 0, 0, rect.sw, rect.sh);
|
|
5438
|
+
}, [img, rect?.sx, rect?.sy, rect?.sw, rect?.sh]);
|
|
5439
|
+
const w = fill ? "100%" : width ?? size;
|
|
5440
|
+
const h = fill ? "100%" : height ?? size;
|
|
5441
|
+
const boxStyle = {
|
|
5442
|
+
...fill ? { position: "absolute", inset: 0 } : {},
|
|
5443
|
+
width: w,
|
|
5444
|
+
height: h,
|
|
5445
|
+
objectFit: fit,
|
|
5446
|
+
imageRendering: "pixelated",
|
|
5447
|
+
...style
|
|
5448
|
+
};
|
|
5449
|
+
if (!asset?.url) return null;
|
|
5450
|
+
if (sliced) {
|
|
5451
|
+
if (!rect || !img) {
|
|
5452
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("inline-block flex-shrink-0", className), style: { ...boxStyle, objectFit: void 0 } });
|
|
5453
|
+
}
|
|
5454
|
+
return /* @__PURE__ */ jsx(
|
|
5455
|
+
"canvas",
|
|
5456
|
+
{
|
|
5457
|
+
ref: canvasRef,
|
|
5458
|
+
role: ariaHidden ? void 0 : "img",
|
|
5459
|
+
"aria-hidden": ariaHidden,
|
|
5460
|
+
"aria-label": ariaHidden ? void 0 : alt ?? asset.name ?? asset.category ?? "",
|
|
5461
|
+
className: cn("flex-shrink-0", className),
|
|
5462
|
+
style: boxStyle
|
|
5463
|
+
}
|
|
5464
|
+
);
|
|
5465
|
+
}
|
|
5466
|
+
return /* @__PURE__ */ jsx(
|
|
5467
|
+
"img",
|
|
5468
|
+
{
|
|
5469
|
+
src: asset.url,
|
|
5470
|
+
alt: alt ?? asset.name ?? asset.category ?? "",
|
|
5471
|
+
"aria-hidden": ariaHidden,
|
|
5472
|
+
...typeof w === "number" ? { width: w } : {},
|
|
5473
|
+
...typeof h === "number" ? { height: h } : {},
|
|
5474
|
+
className: cn("flex-shrink-0", className),
|
|
5475
|
+
style: boxStyle
|
|
5476
|
+
}
|
|
5477
|
+
);
|
|
5478
|
+
}
|
|
5479
|
+
var sliceDataUrlCache, imageCache, imageWaiters;
|
|
5480
|
+
var init_AtlasImage = __esm({
|
|
5481
|
+
"components/core/atoms/AtlasImage.tsx"() {
|
|
5482
|
+
"use client";
|
|
5483
|
+
init_atlasSlice();
|
|
5484
|
+
init_cn();
|
|
5485
|
+
sliceDataUrlCache = /* @__PURE__ */ new Map();
|
|
5486
|
+
AtlasPanel.displayName = "AtlasPanel";
|
|
5487
|
+
imageCache = /* @__PURE__ */ new Map();
|
|
5488
|
+
imageWaiters = /* @__PURE__ */ new Map();
|
|
5489
|
+
AtlasImage.displayName = "AtlasImage";
|
|
5490
|
+
}
|
|
5491
|
+
});
|
|
5288
5492
|
function isIconLike(v) {
|
|
5289
5493
|
return typeof v.render === "function";
|
|
5290
5494
|
}
|
|
@@ -5297,7 +5501,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
5297
5501
|
const IconComp = value;
|
|
5298
5502
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
5299
5503
|
}
|
|
5300
|
-
if (
|
|
5504
|
+
if (React105__default.isValidElement(value)) {
|
|
5301
5505
|
return value;
|
|
5302
5506
|
}
|
|
5303
5507
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -5313,6 +5517,7 @@ var init_Button = __esm({
|
|
|
5313
5517
|
init_cn();
|
|
5314
5518
|
init_useEventBus();
|
|
5315
5519
|
init_Icon();
|
|
5520
|
+
init_AtlasImage();
|
|
5316
5521
|
variantStyles2 = {
|
|
5317
5522
|
primary: [
|
|
5318
5523
|
"bg-primary text-primary-foreground",
|
|
@@ -5373,7 +5578,7 @@ var init_Button = __esm({
|
|
|
5373
5578
|
md: "h-icon-default w-icon-default",
|
|
5374
5579
|
lg: "h-icon-default w-icon-default"
|
|
5375
5580
|
};
|
|
5376
|
-
Button =
|
|
5581
|
+
Button = React105__default.forwardRef(
|
|
5377
5582
|
({
|
|
5378
5583
|
className,
|
|
5379
5584
|
variant = "primary",
|
|
@@ -5397,7 +5602,7 @@ var init_Button = __esm({
|
|
|
5397
5602
|
const leftIconValue = leftIcon || iconProp;
|
|
5398
5603
|
const rightIconValue = rightIcon || iconRightProp;
|
|
5399
5604
|
const px = size === "sm" ? 16 : size === "lg" ? 20 : 16;
|
|
5400
|
-
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsx(
|
|
5605
|
+
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsx(AtlasImage, { asset: iconAsset, size: px, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : resolveIconProp(leftIconValue, iconSizeStyles[size]);
|
|
5401
5606
|
const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
|
|
5402
5607
|
const handleClick = (e) => {
|
|
5403
5608
|
if (action) {
|
|
@@ -5441,7 +5646,7 @@ var Dialog;
|
|
|
5441
5646
|
var init_Dialog = __esm({
|
|
5442
5647
|
"components/core/atoms/Dialog.tsx"() {
|
|
5443
5648
|
init_cn();
|
|
5444
|
-
Dialog =
|
|
5649
|
+
Dialog = React105__default.forwardRef(
|
|
5445
5650
|
({
|
|
5446
5651
|
role = "dialog",
|
|
5447
5652
|
"aria-modal": ariaModal = true,
|
|
@@ -5899,6 +6104,7 @@ var init_Badge = __esm({
|
|
|
5899
6104
|
"components/core/atoms/Badge.tsx"() {
|
|
5900
6105
|
init_cn();
|
|
5901
6106
|
init_Icon();
|
|
6107
|
+
init_AtlasImage();
|
|
5902
6108
|
variantStyles3 = {
|
|
5903
6109
|
default: [
|
|
5904
6110
|
"bg-muted text-foreground",
|
|
@@ -5936,7 +6142,7 @@ var init_Badge = __esm({
|
|
|
5936
6142
|
md: "px-2.5 py-1 text-sm",
|
|
5937
6143
|
lg: "px-3 py-1.5 text-base"
|
|
5938
6144
|
};
|
|
5939
|
-
Badge =
|
|
6145
|
+
Badge = React105__default.forwardRef(
|
|
5940
6146
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
5941
6147
|
const iconSizes3 = {
|
|
5942
6148
|
sm: "h-icon-default w-icon-default",
|
|
@@ -5944,7 +6150,7 @@ var init_Badge = __esm({
|
|
|
5944
6150
|
lg: "h-icon-default w-icon-default"
|
|
5945
6151
|
};
|
|
5946
6152
|
const iconPx = size === "lg" ? 20 : 16;
|
|
5947
|
-
const resolvedIcon = iconAsset?.url ? /* @__PURE__ */ jsx(
|
|
6153
|
+
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;
|
|
5948
6154
|
return /* @__PURE__ */ jsxs(
|
|
5949
6155
|
"span",
|
|
5950
6156
|
{
|
|
@@ -6273,7 +6479,7 @@ var init_SvgFlow = __esm({
|
|
|
6273
6479
|
width = 100,
|
|
6274
6480
|
height = 100
|
|
6275
6481
|
}) => {
|
|
6276
|
-
const markerId =
|
|
6482
|
+
const markerId = React105__default.useMemo(() => {
|
|
6277
6483
|
flowIdCounter += 1;
|
|
6278
6484
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
6279
6485
|
}, []);
|
|
@@ -6866,7 +7072,7 @@ var init_SvgRing = __esm({
|
|
|
6866
7072
|
width = 100,
|
|
6867
7073
|
height = 100
|
|
6868
7074
|
}) => {
|
|
6869
|
-
const gradientId =
|
|
7075
|
+
const gradientId = React105__default.useMemo(() => {
|
|
6870
7076
|
ringIdCounter += 1;
|
|
6871
7077
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
6872
7078
|
}, []);
|
|
@@ -7047,7 +7253,7 @@ var init_Input = __esm({
|
|
|
7047
7253
|
init_cn();
|
|
7048
7254
|
init_Icon();
|
|
7049
7255
|
init_useEventBus();
|
|
7050
|
-
Input =
|
|
7256
|
+
Input = React105__default.forwardRef(
|
|
7051
7257
|
({
|
|
7052
7258
|
className,
|
|
7053
7259
|
inputType,
|
|
@@ -7207,7 +7413,7 @@ var Label;
|
|
|
7207
7413
|
var init_Label = __esm({
|
|
7208
7414
|
"components/core/atoms/Label.tsx"() {
|
|
7209
7415
|
init_cn();
|
|
7210
|
-
Label =
|
|
7416
|
+
Label = React105__default.forwardRef(
|
|
7211
7417
|
({ className, required, children, ...props }, ref) => {
|
|
7212
7418
|
return /* @__PURE__ */ jsxs(
|
|
7213
7419
|
"label",
|
|
@@ -7234,7 +7440,7 @@ var init_Textarea = __esm({
|
|
|
7234
7440
|
"components/core/atoms/Textarea.tsx"() {
|
|
7235
7441
|
init_cn();
|
|
7236
7442
|
init_useEventBus();
|
|
7237
|
-
Textarea =
|
|
7443
|
+
Textarea = React105__default.forwardRef(
|
|
7238
7444
|
({ className, error, onChange, ...props }, ref) => {
|
|
7239
7445
|
const eventBus = useEventBus();
|
|
7240
7446
|
const handleChange = (e) => {
|
|
@@ -7473,7 +7679,7 @@ var init_Select = __esm({
|
|
|
7473
7679
|
init_cn();
|
|
7474
7680
|
init_Icon();
|
|
7475
7681
|
init_useEventBus();
|
|
7476
|
-
Select =
|
|
7682
|
+
Select = React105__default.forwardRef(
|
|
7477
7683
|
(props, _ref) => {
|
|
7478
7684
|
const { multiple, searchable, clearable } = props;
|
|
7479
7685
|
if (multiple || searchable || clearable) {
|
|
@@ -7490,7 +7696,7 @@ var init_Checkbox = __esm({
|
|
|
7490
7696
|
"components/core/atoms/Checkbox.tsx"() {
|
|
7491
7697
|
init_cn();
|
|
7492
7698
|
init_useEventBus();
|
|
7493
|
-
Checkbox =
|
|
7699
|
+
Checkbox = React105__default.forwardRef(
|
|
7494
7700
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
7495
7701
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
7496
7702
|
const eventBus = useEventBus();
|
|
@@ -7544,7 +7750,7 @@ var init_Spinner = __esm({
|
|
|
7544
7750
|
md: "h-6 w-6",
|
|
7545
7751
|
lg: "h-8 w-8"
|
|
7546
7752
|
};
|
|
7547
|
-
Spinner =
|
|
7753
|
+
Spinner = React105__default.forwardRef(
|
|
7548
7754
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
7549
7755
|
if (overlay) {
|
|
7550
7756
|
return /* @__PURE__ */ jsx(
|
|
@@ -7634,7 +7840,7 @@ var init_Card = __esm({
|
|
|
7634
7840
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
7635
7841
|
"tile-image-first": "p-0 overflow-hidden"
|
|
7636
7842
|
};
|
|
7637
|
-
Card =
|
|
7843
|
+
Card = React105__default.forwardRef(
|
|
7638
7844
|
({
|
|
7639
7845
|
className,
|
|
7640
7846
|
variant = "bordered",
|
|
@@ -7682,9 +7888,9 @@ var init_Card = __esm({
|
|
|
7682
7888
|
}
|
|
7683
7889
|
);
|
|
7684
7890
|
Card.displayName = "Card";
|
|
7685
|
-
CardHeader =
|
|
7891
|
+
CardHeader = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
7686
7892
|
CardHeader.displayName = "CardHeader";
|
|
7687
|
-
CardTitle =
|
|
7893
|
+
CardTitle = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7688
7894
|
"h3",
|
|
7689
7895
|
{
|
|
7690
7896
|
ref,
|
|
@@ -7697,11 +7903,11 @@ var init_Card = __esm({
|
|
|
7697
7903
|
}
|
|
7698
7904
|
));
|
|
7699
7905
|
CardTitle.displayName = "CardTitle";
|
|
7700
|
-
CardContent =
|
|
7906
|
+
CardContent = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
7701
7907
|
CardContent.displayName = "CardContent";
|
|
7702
7908
|
CardBody = CardContent;
|
|
7703
7909
|
CardBody.displayName = "CardBody";
|
|
7704
|
-
CardFooter =
|
|
7910
|
+
CardFooter = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7705
7911
|
"div",
|
|
7706
7912
|
{
|
|
7707
7913
|
ref,
|
|
@@ -7756,7 +7962,7 @@ var init_FilterPill = __esm({
|
|
|
7756
7962
|
md: "w-3.5 h-3.5",
|
|
7757
7963
|
lg: "w-4 h-4"
|
|
7758
7964
|
};
|
|
7759
|
-
FilterPill =
|
|
7965
|
+
FilterPill = React105__default.forwardRef(
|
|
7760
7966
|
({
|
|
7761
7967
|
className,
|
|
7762
7968
|
variant = "default",
|
|
@@ -7885,8 +8091,8 @@ var init_Avatar = __esm({
|
|
|
7885
8091
|
actionPayload
|
|
7886
8092
|
}) => {
|
|
7887
8093
|
const eventBus = useEventBus();
|
|
7888
|
-
const [imgFailed, setImgFailed] =
|
|
7889
|
-
|
|
8094
|
+
const [imgFailed, setImgFailed] = React105__default.useState(false);
|
|
8095
|
+
React105__default.useEffect(() => {
|
|
7890
8096
|
setImgFailed(false);
|
|
7891
8097
|
}, [src]);
|
|
7892
8098
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -7999,7 +8205,7 @@ var init_Center = __esm({
|
|
|
7999
8205
|
as: Component = "div"
|
|
8000
8206
|
}) => {
|
|
8001
8207
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
8002
|
-
return
|
|
8208
|
+
return React105__default.createElement(Component, {
|
|
8003
8209
|
className: cn(
|
|
8004
8210
|
inline ? "inline-flex" : "flex",
|
|
8005
8211
|
horizontal && "justify-center",
|
|
@@ -8267,7 +8473,7 @@ var init_Radio = __esm({
|
|
|
8267
8473
|
md: "w-2.5 h-2.5",
|
|
8268
8474
|
lg: "w-3 h-3"
|
|
8269
8475
|
};
|
|
8270
|
-
Radio =
|
|
8476
|
+
Radio = React105__default.forwardRef(
|
|
8271
8477
|
({
|
|
8272
8478
|
label,
|
|
8273
8479
|
helperText,
|
|
@@ -8284,12 +8490,12 @@ var init_Radio = __esm({
|
|
|
8284
8490
|
onChange,
|
|
8285
8491
|
...props
|
|
8286
8492
|
}, ref) => {
|
|
8287
|
-
const reactId =
|
|
8493
|
+
const reactId = React105__default.useId();
|
|
8288
8494
|
const baseId = id || `radio-${reactId}`;
|
|
8289
8495
|
const hasError = !!error;
|
|
8290
8496
|
const eventBus = useEventBus();
|
|
8291
|
-
const [selected, setSelected] =
|
|
8292
|
-
|
|
8497
|
+
const [selected, setSelected] = React105__default.useState(value);
|
|
8498
|
+
React105__default.useEffect(() => {
|
|
8293
8499
|
if (value !== void 0) setSelected(value);
|
|
8294
8500
|
}, [value]);
|
|
8295
8501
|
const pick = (next, e) => {
|
|
@@ -8471,7 +8677,7 @@ var init_Switch = __esm({
|
|
|
8471
8677
|
"components/core/atoms/Switch.tsx"() {
|
|
8472
8678
|
"use client";
|
|
8473
8679
|
init_cn();
|
|
8474
|
-
Switch =
|
|
8680
|
+
Switch = React105.forwardRef(
|
|
8475
8681
|
({
|
|
8476
8682
|
checked,
|
|
8477
8683
|
defaultChecked = false,
|
|
@@ -8482,10 +8688,10 @@ var init_Switch = __esm({
|
|
|
8482
8688
|
name,
|
|
8483
8689
|
className
|
|
8484
8690
|
}, ref) => {
|
|
8485
|
-
const [isChecked, setIsChecked] =
|
|
8691
|
+
const [isChecked, setIsChecked] = React105.useState(
|
|
8486
8692
|
checked !== void 0 ? checked : defaultChecked
|
|
8487
8693
|
);
|
|
8488
|
-
|
|
8694
|
+
React105.useEffect(() => {
|
|
8489
8695
|
if (checked !== void 0) {
|
|
8490
8696
|
setIsChecked(checked);
|
|
8491
8697
|
}
|
|
@@ -8763,7 +8969,7 @@ var Aside;
|
|
|
8763
8969
|
var init_Aside = __esm({
|
|
8764
8970
|
"components/core/atoms/Aside.tsx"() {
|
|
8765
8971
|
init_cn();
|
|
8766
|
-
Aside =
|
|
8972
|
+
Aside = React105__default.forwardRef(
|
|
8767
8973
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
8768
8974
|
);
|
|
8769
8975
|
Aside.displayName = "Aside";
|
|
@@ -8842,9 +9048,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8842
9048
|
className
|
|
8843
9049
|
}) => {
|
|
8844
9050
|
const { t } = useTranslate();
|
|
8845
|
-
const [isVisible, setIsVisible] =
|
|
8846
|
-
const timeoutRef =
|
|
8847
|
-
const triggerRef =
|
|
9051
|
+
const [isVisible, setIsVisible] = React105__default.useState(false);
|
|
9052
|
+
const timeoutRef = React105__default.useRef(null);
|
|
9053
|
+
const triggerRef = React105__default.useRef(null);
|
|
8848
9054
|
const handleMouseEnter = () => {
|
|
8849
9055
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8850
9056
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -8855,7 +9061,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8855
9061
|
};
|
|
8856
9062
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
8857
9063
|
const open = isVisible || revealed;
|
|
8858
|
-
|
|
9064
|
+
React105__default.useEffect(() => {
|
|
8859
9065
|
return () => {
|
|
8860
9066
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8861
9067
|
};
|
|
@@ -9065,7 +9271,7 @@ var init_StatusDot = __esm({
|
|
|
9065
9271
|
md: "w-2.5 h-2.5",
|
|
9066
9272
|
lg: "w-3 h-3"
|
|
9067
9273
|
};
|
|
9068
|
-
StatusDot =
|
|
9274
|
+
StatusDot = React105__default.forwardRef(
|
|
9069
9275
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
9070
9276
|
return /* @__PURE__ */ jsx(
|
|
9071
9277
|
"span",
|
|
@@ -9119,7 +9325,7 @@ var init_TrendIndicator = __esm({
|
|
|
9119
9325
|
down: "trending-down",
|
|
9120
9326
|
flat: "arrow-right"
|
|
9121
9327
|
};
|
|
9122
|
-
TrendIndicator =
|
|
9328
|
+
TrendIndicator = React105__default.forwardRef(
|
|
9123
9329
|
({
|
|
9124
9330
|
className,
|
|
9125
9331
|
value,
|
|
@@ -9186,7 +9392,7 @@ var init_RangeSlider = __esm({
|
|
|
9186
9392
|
md: "w-4 h-4",
|
|
9187
9393
|
lg: "w-5 h-5"
|
|
9188
9394
|
};
|
|
9189
|
-
RangeSlider =
|
|
9395
|
+
RangeSlider = React105__default.forwardRef(
|
|
9190
9396
|
({
|
|
9191
9397
|
className,
|
|
9192
9398
|
min = 0,
|
|
@@ -9780,7 +9986,7 @@ var init_ContentSection = __esm({
|
|
|
9780
9986
|
md: "py-16",
|
|
9781
9987
|
lg: "py-24"
|
|
9782
9988
|
};
|
|
9783
|
-
ContentSection =
|
|
9989
|
+
ContentSection = React105__default.forwardRef(
|
|
9784
9990
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
9785
9991
|
return /* @__PURE__ */ jsx(
|
|
9786
9992
|
Box,
|
|
@@ -10314,7 +10520,7 @@ var init_AnimatedReveal = __esm({
|
|
|
10314
10520
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
10315
10521
|
"none": {}
|
|
10316
10522
|
};
|
|
10317
|
-
AnimatedReveal =
|
|
10523
|
+
AnimatedReveal = React105__default.forwardRef(
|
|
10318
10524
|
({
|
|
10319
10525
|
trigger = "scroll",
|
|
10320
10526
|
animation = "fade-up",
|
|
@@ -10474,7 +10680,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10474
10680
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
10475
10681
|
"use client";
|
|
10476
10682
|
init_cn();
|
|
10477
|
-
AnimatedGraphic =
|
|
10683
|
+
AnimatedGraphic = React105__default.forwardRef(
|
|
10478
10684
|
({
|
|
10479
10685
|
src,
|
|
10480
10686
|
svgContent,
|
|
@@ -10497,7 +10703,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10497
10703
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
10498
10704
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
10499
10705
|
const prevAnimateRef = useRef(animate);
|
|
10500
|
-
const setRef =
|
|
10706
|
+
const setRef = React105__default.useCallback(
|
|
10501
10707
|
(node) => {
|
|
10502
10708
|
containerRef.current = node;
|
|
10503
10709
|
if (typeof ref === "function") ref(node);
|
|
@@ -10969,7 +11175,7 @@ function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
|
|
|
10969
11175
|
}
|
|
10970
11176
|
if (layout === "flat") {
|
|
10971
11177
|
const screenX2 = tileX * scaledTileWidth + baseOffsetX;
|
|
10972
|
-
const screenY2 = tileY *
|
|
11178
|
+
const screenY2 = tileY * scaledTileWidth;
|
|
10973
11179
|
return { x: screenX2, y: screenY2 };
|
|
10974
11180
|
}
|
|
10975
11181
|
const screenX = (tileX - tileY) * (scaledTileWidth / 2) + baseOffsetX;
|
|
@@ -10986,7 +11192,7 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
|
|
|
10986
11192
|
}
|
|
10987
11193
|
if (layout === "flat") {
|
|
10988
11194
|
const col = Math.round((screenX - baseOffsetX) / scaledTileWidth);
|
|
10989
|
-
const row = Math.round(screenY /
|
|
11195
|
+
const row = Math.round(screenY / scaledTileWidth);
|
|
10990
11196
|
return { x: col, y: row };
|
|
10991
11197
|
}
|
|
10992
11198
|
const adjustedX = screenX - baseOffsetX;
|
|
@@ -11060,13 +11266,11 @@ function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
|
11060
11266
|
const px = typeof size === "number" ? size : sizeMap[size];
|
|
11061
11267
|
if (assetUrl?.url) {
|
|
11062
11268
|
return /* @__PURE__ */ jsx(
|
|
11063
|
-
|
|
11269
|
+
AtlasImage,
|
|
11064
11270
|
{
|
|
11065
|
-
|
|
11271
|
+
asset: assetUrl,
|
|
11272
|
+
size: px,
|
|
11066
11273
|
alt: alt ?? assetUrl.category ?? "",
|
|
11067
|
-
width: px,
|
|
11068
|
-
height: px,
|
|
11069
|
-
style: { imageRendering: "pixelated", objectFit: "contain", width: px, height: px },
|
|
11070
11274
|
className: cn("flex-shrink-0", className)
|
|
11071
11275
|
}
|
|
11072
11276
|
);
|
|
@@ -11080,6 +11284,7 @@ var init_GameIcon = __esm({
|
|
|
11080
11284
|
"use client";
|
|
11081
11285
|
init_cn();
|
|
11082
11286
|
init_Icon();
|
|
11287
|
+
init_AtlasImage();
|
|
11083
11288
|
sizeMap = {
|
|
11084
11289
|
sm: 16,
|
|
11085
11290
|
md: 24,
|
|
@@ -11105,13 +11310,12 @@ function GameCard({
|
|
|
11105
11310
|
className
|
|
11106
11311
|
}) {
|
|
11107
11312
|
const eventBus = useEventBus();
|
|
11108
|
-
const handleClick =
|
|
11313
|
+
const handleClick = React105.useCallback(() => {
|
|
11109
11314
|
if (disabled) return;
|
|
11110
11315
|
onClick?.(id);
|
|
11111
11316
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
11112
11317
|
}, [disabled, id, onClick, clickEvent, eventBus]);
|
|
11113
11318
|
const artPx = artPxMap[size];
|
|
11114
|
-
const frameStyle = frameAsset?.url ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%", backgroundRepeat: "no-repeat" } : {};
|
|
11115
11319
|
return /* @__PURE__ */ jsxs(
|
|
11116
11320
|
Button,
|
|
11117
11321
|
{
|
|
@@ -11119,11 +11323,10 @@ function GameCard({
|
|
|
11119
11323
|
onClick: handleClick,
|
|
11120
11324
|
disabled,
|
|
11121
11325
|
title: name,
|
|
11122
|
-
style: frameStyle,
|
|
11123
11326
|
className: cn(
|
|
11124
|
-
"relative flex flex-col items-center rounded-interactive",
|
|
11125
|
-
"
|
|
11126
|
-
frameAsset?.url ? "border-0" : "border-2",
|
|
11327
|
+
"relative isolate flex flex-col items-center rounded-interactive",
|
|
11328
|
+
"px-1.5 pt-1.5 pb-1 transition-all duration-150",
|
|
11329
|
+
frameAsset?.url ? "border-0" : "border-2 bg-card/90",
|
|
11127
11330
|
cardSizeMap[size],
|
|
11128
11331
|
disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
|
|
11129
11332
|
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
|
|
@@ -11131,6 +11334,7 @@ function GameCard({
|
|
|
11131
11334
|
className
|
|
11132
11335
|
),
|
|
11133
11336
|
children: [
|
|
11337
|
+
frameAsset?.url && /* @__PURE__ */ jsx(AtlasImage, { asset: frameAsset, fill: true, fit: "fill", "aria-hidden": true, style: { zIndex: -1 } }),
|
|
11134
11338
|
cost != null && /* @__PURE__ */ jsx(
|
|
11135
11339
|
Typography,
|
|
11136
11340
|
{
|
|
@@ -11169,6 +11373,7 @@ var init_GameCard = __esm({
|
|
|
11169
11373
|
init_Box();
|
|
11170
11374
|
init_Button();
|
|
11171
11375
|
init_Typography();
|
|
11376
|
+
init_AtlasImage();
|
|
11172
11377
|
init_GameIcon();
|
|
11173
11378
|
cardSizeMap = {
|
|
11174
11379
|
sm: "w-16 h-24",
|
|
@@ -11329,7 +11534,7 @@ var init_HealthBar = __esm({
|
|
|
11329
11534
|
}
|
|
11330
11535
|
});
|
|
11331
11536
|
function ScoreDisplay({
|
|
11332
|
-
assetUrl
|
|
11537
|
+
assetUrl,
|
|
11333
11538
|
value,
|
|
11334
11539
|
score,
|
|
11335
11540
|
label,
|
|
@@ -11356,7 +11561,7 @@ function ScoreDisplay({
|
|
|
11356
11561
|
}
|
|
11357
11562
|
);
|
|
11358
11563
|
}
|
|
11359
|
-
var sizeMap3
|
|
11564
|
+
var sizeMap3;
|
|
11360
11565
|
var init_ScoreDisplay = __esm({
|
|
11361
11566
|
"components/game/2d/atoms/ScoreDisplay.tsx"() {
|
|
11362
11567
|
init_cn();
|
|
@@ -11370,16 +11575,11 @@ var init_ScoreDisplay = __esm({
|
|
|
11370
11575
|
lg: "text-2xl",
|
|
11371
11576
|
xl: "text-4xl"
|
|
11372
11577
|
};
|
|
11373
|
-
DEFAULT_ASSET_URL = {
|
|
11374
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/star_01.png",
|
|
11375
|
-
role: "effect",
|
|
11376
|
-
category: "effect"
|
|
11377
|
-
};
|
|
11378
11578
|
ScoreDisplay.displayName = "ScoreDisplay";
|
|
11379
11579
|
}
|
|
11380
11580
|
});
|
|
11381
11581
|
function ControlButton({
|
|
11382
|
-
assetUrl =
|
|
11582
|
+
assetUrl = DEFAULT_ASSET_URL,
|
|
11383
11583
|
label,
|
|
11384
11584
|
icon,
|
|
11385
11585
|
size = "md",
|
|
@@ -11394,9 +11594,9 @@ function ControlButton({
|
|
|
11394
11594
|
className
|
|
11395
11595
|
}) {
|
|
11396
11596
|
const eventBus = useEventBus();
|
|
11397
|
-
const [isPressed, setIsPressed] =
|
|
11597
|
+
const [isPressed, setIsPressed] = React105.useState(false);
|
|
11398
11598
|
const actualPressed = pressed ?? isPressed;
|
|
11399
|
-
const handlePointerDown =
|
|
11599
|
+
const handlePointerDown = React105.useCallback(
|
|
11400
11600
|
(e) => {
|
|
11401
11601
|
e.preventDefault();
|
|
11402
11602
|
if (disabled) return;
|
|
@@ -11406,7 +11606,7 @@ function ControlButton({
|
|
|
11406
11606
|
},
|
|
11407
11607
|
[disabled, pressEvent, eventBus, onPress]
|
|
11408
11608
|
);
|
|
11409
|
-
const handlePointerUp =
|
|
11609
|
+
const handlePointerUp = React105.useCallback(
|
|
11410
11610
|
(e) => {
|
|
11411
11611
|
e.preventDefault();
|
|
11412
11612
|
if (disabled) return;
|
|
@@ -11416,7 +11616,7 @@ function ControlButton({
|
|
|
11416
11616
|
},
|
|
11417
11617
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
11418
11618
|
);
|
|
11419
|
-
const handlePointerLeave =
|
|
11619
|
+
const handlePointerLeave = React105.useCallback(
|
|
11420
11620
|
(e) => {
|
|
11421
11621
|
if (isPressed) {
|
|
11422
11622
|
setIsPressed(false);
|
|
@@ -11457,7 +11657,7 @@ function ControlButton({
|
|
|
11457
11657
|
}
|
|
11458
11658
|
);
|
|
11459
11659
|
}
|
|
11460
|
-
var sizeMap4, shapeMap, variantMap,
|
|
11660
|
+
var sizeMap4, shapeMap, variantMap, DEFAULT_ASSET_URL;
|
|
11461
11661
|
var init_ControlButton = __esm({
|
|
11462
11662
|
"components/game/2d/atoms/ControlButton.tsx"() {
|
|
11463
11663
|
"use client";
|
|
@@ -11484,7 +11684,7 @@ var init_ControlButton = __esm({
|
|
|
11484
11684
|
secondary: "bg-secondary text-secondary-foreground border-border hover:bg-secondary-hover",
|
|
11485
11685
|
ghost: "bg-transparent text-foreground border-border hover:bg-muted"
|
|
11486
11686
|
};
|
|
11487
|
-
|
|
11687
|
+
DEFAULT_ASSET_URL = {
|
|
11488
11688
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/circle_01.png",
|
|
11489
11689
|
role: "ui",
|
|
11490
11690
|
category: "control"
|
|
@@ -11577,7 +11777,7 @@ function isKnownState(s) {
|
|
|
11577
11777
|
return s in DEFAULT_STATE_STYLES;
|
|
11578
11778
|
}
|
|
11579
11779
|
function StateIndicator({
|
|
11580
|
-
assetUrl =
|
|
11780
|
+
assetUrl = DEFAULT_ASSET_URL2,
|
|
11581
11781
|
state = "idle",
|
|
11582
11782
|
label,
|
|
11583
11783
|
size = "md",
|
|
@@ -11607,14 +11807,14 @@ function StateIndicator({
|
|
|
11607
11807
|
}
|
|
11608
11808
|
);
|
|
11609
11809
|
}
|
|
11610
|
-
var
|
|
11810
|
+
var DEFAULT_ASSET_URL2, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
|
|
11611
11811
|
var init_StateIndicator = __esm({
|
|
11612
11812
|
"components/game/2d/atoms/StateIndicator.tsx"() {
|
|
11613
11813
|
init_Box();
|
|
11614
11814
|
init_Icon();
|
|
11615
11815
|
init_cn();
|
|
11616
11816
|
init_GameIcon();
|
|
11617
|
-
|
|
11817
|
+
DEFAULT_ASSET_URL2 = {
|
|
11618
11818
|
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
11619
11819
|
role: "ui",
|
|
11620
11820
|
category: "state"
|
|
@@ -11700,7 +11900,7 @@ var init_TimerDisplay = __esm({
|
|
|
11700
11900
|
}
|
|
11701
11901
|
});
|
|
11702
11902
|
function ResourceCounter({
|
|
11703
|
-
assetUrl =
|
|
11903
|
+
assetUrl = DEFAULT_ASSET_URL3,
|
|
11704
11904
|
icon,
|
|
11705
11905
|
label = "Gold",
|
|
11706
11906
|
value = 250,
|
|
@@ -11733,7 +11933,7 @@ function ResourceCounter({
|
|
|
11733
11933
|
}
|
|
11734
11934
|
);
|
|
11735
11935
|
}
|
|
11736
|
-
var colorTokenClasses2,
|
|
11936
|
+
var colorTokenClasses2, DEFAULT_ASSET_URL3, sizeMap6;
|
|
11737
11937
|
var init_ResourceCounter = __esm({
|
|
11738
11938
|
"components/game/2d/atoms/ResourceCounter.tsx"() {
|
|
11739
11939
|
init_cn();
|
|
@@ -11749,7 +11949,7 @@ var init_ResourceCounter = __esm({
|
|
|
11749
11949
|
error: "text-error",
|
|
11750
11950
|
muted: "text-muted-foreground"
|
|
11751
11951
|
};
|
|
11752
|
-
|
|
11952
|
+
DEFAULT_ASSET_URL3 = {
|
|
11753
11953
|
url: "https://almadar-kflow-assets.web.app/shared/world-map/gold_mine.png",
|
|
11754
11954
|
role: "ui",
|
|
11755
11955
|
category: "coin"
|
|
@@ -11763,7 +11963,7 @@ var init_ResourceCounter = __esm({
|
|
|
11763
11963
|
}
|
|
11764
11964
|
});
|
|
11765
11965
|
function ItemSlot({
|
|
11766
|
-
assetUrl =
|
|
11966
|
+
assetUrl = DEFAULT_ASSET_URL4,
|
|
11767
11967
|
icon = "sword",
|
|
11768
11968
|
label = "Iron Sword",
|
|
11769
11969
|
quantity,
|
|
@@ -11818,7 +12018,7 @@ function ItemSlot({
|
|
|
11818
12018
|
}
|
|
11819
12019
|
);
|
|
11820
12020
|
}
|
|
11821
|
-
var sizeMap7, rarityBorderMap, rarityGlowMap,
|
|
12021
|
+
var sizeMap7, rarityBorderMap, rarityGlowMap, DEFAULT_ASSET_URL4, assetSizeMap;
|
|
11822
12022
|
var init_ItemSlot = __esm({
|
|
11823
12023
|
"components/game/2d/atoms/ItemSlot.tsx"() {
|
|
11824
12024
|
"use client";
|
|
@@ -11848,7 +12048,7 @@ var init_ItemSlot = __esm({
|
|
|
11848
12048
|
epic: "shadow-lg",
|
|
11849
12049
|
legendary: "shadow-lg"
|
|
11850
12050
|
};
|
|
11851
|
-
|
|
12051
|
+
DEFAULT_ASSET_URL4 = {
|
|
11852
12052
|
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
11853
12053
|
role: "item",
|
|
11854
12054
|
category: "item"
|
|
@@ -11862,7 +12062,7 @@ var init_ItemSlot = __esm({
|
|
|
11862
12062
|
}
|
|
11863
12063
|
});
|
|
11864
12064
|
function TurnIndicator({
|
|
11865
|
-
assetUrl =
|
|
12065
|
+
assetUrl = DEFAULT_ASSET_URL5,
|
|
11866
12066
|
currentTurn = 1,
|
|
11867
12067
|
maxTurns,
|
|
11868
12068
|
activeTeam,
|
|
@@ -11902,7 +12102,7 @@ function TurnIndicator({
|
|
|
11902
12102
|
}
|
|
11903
12103
|
);
|
|
11904
12104
|
}
|
|
11905
|
-
var sizeMap8,
|
|
12105
|
+
var sizeMap8, DEFAULT_ASSET_URL5;
|
|
11906
12106
|
var init_TurnIndicator = __esm({
|
|
11907
12107
|
"components/game/2d/atoms/TurnIndicator.tsx"() {
|
|
11908
12108
|
init_cn();
|
|
@@ -11914,7 +12114,7 @@ var init_TurnIndicator = __esm({
|
|
|
11914
12114
|
md: { wrapper: "text-sm gap-2 px-3 py-1", dot: "w-2 h-2" },
|
|
11915
12115
|
lg: { wrapper: "text-base gap-2.5 px-4 py-1.5", dot: "w-2.5 h-2.5" }
|
|
11916
12116
|
};
|
|
11917
|
-
|
|
12117
|
+
DEFAULT_ASSET_URL5 = {
|
|
11918
12118
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/symbol_01.png",
|
|
11919
12119
|
role: "ui",
|
|
11920
12120
|
category: "turn"
|
|
@@ -11934,7 +12134,7 @@ function getComboScale(combo) {
|
|
|
11934
12134
|
return "";
|
|
11935
12135
|
}
|
|
11936
12136
|
function ComboCounter({
|
|
11937
|
-
assetUrl =
|
|
12137
|
+
assetUrl = DEFAULT_ASSET_URL6,
|
|
11938
12138
|
combo = 5,
|
|
11939
12139
|
multiplier,
|
|
11940
12140
|
streak,
|
|
@@ -11969,14 +12169,14 @@ function ComboCounter({
|
|
|
11969
12169
|
}
|
|
11970
12170
|
);
|
|
11971
12171
|
}
|
|
11972
|
-
var
|
|
12172
|
+
var DEFAULT_ASSET_URL6, sizeMap9;
|
|
11973
12173
|
var init_ComboCounter = __esm({
|
|
11974
12174
|
"components/game/2d/atoms/ComboCounter.tsx"() {
|
|
11975
12175
|
init_cn();
|
|
11976
12176
|
init_Box();
|
|
11977
12177
|
init_Typography();
|
|
11978
12178
|
init_GameIcon();
|
|
11979
|
-
|
|
12179
|
+
DEFAULT_ASSET_URL6 = {
|
|
11980
12180
|
url: "https://almadar-kflow-assets.web.app/shared/effects/flash/flash00.png",
|
|
11981
12181
|
role: "effect",
|
|
11982
12182
|
category: "effect"
|
|
@@ -11990,7 +12190,7 @@ var init_ComboCounter = __esm({
|
|
|
11990
12190
|
}
|
|
11991
12191
|
});
|
|
11992
12192
|
function WaypointMarker({
|
|
11993
|
-
assetUrl =
|
|
12193
|
+
assetUrl = DEFAULT_ASSET_URL7,
|
|
11994
12194
|
label,
|
|
11995
12195
|
icon,
|
|
11996
12196
|
active = true,
|
|
@@ -12050,7 +12250,7 @@ function WaypointMarker({
|
|
|
12050
12250
|
)
|
|
12051
12251
|
] });
|
|
12052
12252
|
}
|
|
12053
|
-
var
|
|
12253
|
+
var DEFAULT_ASSET_URL7, sizeMap10, checkIcon;
|
|
12054
12254
|
var init_WaypointMarker = __esm({
|
|
12055
12255
|
"components/game/2d/atoms/WaypointMarker.tsx"() {
|
|
12056
12256
|
init_cn();
|
|
@@ -12058,7 +12258,7 @@ var init_WaypointMarker = __esm({
|
|
|
12058
12258
|
init_Box();
|
|
12059
12259
|
init_Typography();
|
|
12060
12260
|
init_GameIcon();
|
|
12061
|
-
|
|
12261
|
+
DEFAULT_ASSET_URL7 = {
|
|
12062
12262
|
url: "https://almadar-kflow-assets.web.app/shared/world-map/battle_marker.png",
|
|
12063
12263
|
role: "ui",
|
|
12064
12264
|
category: "waypoint"
|
|
@@ -12079,7 +12279,7 @@ function formatDuration(seconds) {
|
|
|
12079
12279
|
return `${Math.round(seconds)}s`;
|
|
12080
12280
|
}
|
|
12081
12281
|
function StatusEffect({
|
|
12082
|
-
assetUrl =
|
|
12282
|
+
assetUrl = DEFAULT_ASSET_URL8,
|
|
12083
12283
|
icon,
|
|
12084
12284
|
label = "Shield",
|
|
12085
12285
|
duration = 30,
|
|
@@ -12130,7 +12330,7 @@ function StatusEffect({
|
|
|
12130
12330
|
label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-xs text-muted-foreground mt-0.5 text-center whitespace-nowrap", children: label })
|
|
12131
12331
|
] });
|
|
12132
12332
|
}
|
|
12133
|
-
var
|
|
12333
|
+
var DEFAULT_ASSET_URL8, sizeMap11, variantStyles7;
|
|
12134
12334
|
var init_StatusEffect = __esm({
|
|
12135
12335
|
"components/game/2d/atoms/StatusEffect.tsx"() {
|
|
12136
12336
|
init_cn();
|
|
@@ -12138,7 +12338,7 @@ var init_StatusEffect = __esm({
|
|
|
12138
12338
|
init_Box();
|
|
12139
12339
|
init_Typography();
|
|
12140
12340
|
init_GameIcon();
|
|
12141
|
-
|
|
12341
|
+
DEFAULT_ASSET_URL8 = {
|
|
12142
12342
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/flame_01.png",
|
|
12143
12343
|
role: "ui",
|
|
12144
12344
|
category: "effect"
|
|
@@ -12157,7 +12357,7 @@ var init_StatusEffect = __esm({
|
|
|
12157
12357
|
}
|
|
12158
12358
|
});
|
|
12159
12359
|
function DamageNumber({
|
|
12160
|
-
assetUrl =
|
|
12360
|
+
assetUrl = DEFAULT_ASSET_URL9,
|
|
12161
12361
|
value = 42,
|
|
12162
12362
|
type = "damage",
|
|
12163
12363
|
size = "md",
|
|
@@ -12185,7 +12385,7 @@ function DamageNumber({
|
|
|
12185
12385
|
)
|
|
12186
12386
|
] });
|
|
12187
12387
|
}
|
|
12188
|
-
var sizeMap12, typeStyles, floatKeyframes,
|
|
12388
|
+
var sizeMap12, typeStyles, floatKeyframes, DEFAULT_ASSET_URL9;
|
|
12189
12389
|
var init_DamageNumber = __esm({
|
|
12190
12390
|
"components/game/2d/atoms/DamageNumber.tsx"() {
|
|
12191
12391
|
init_cn();
|
|
@@ -12209,7 +12409,7 @@ var init_DamageNumber = __esm({
|
|
|
12209
12409
|
100% { opacity: 0; transform: translateY(-32px) scale(0.8); }
|
|
12210
12410
|
}
|
|
12211
12411
|
`;
|
|
12212
|
-
|
|
12412
|
+
DEFAULT_ASSET_URL9 = {
|
|
12213
12413
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/spark_01.png",
|
|
12214
12414
|
role: "effect",
|
|
12215
12415
|
category: "effect"
|
|
@@ -12335,7 +12535,7 @@ var init_ChoiceButton = __esm({
|
|
|
12335
12535
|
}
|
|
12336
12536
|
});
|
|
12337
12537
|
function ActionButton({
|
|
12338
|
-
assetUrl =
|
|
12538
|
+
assetUrl = DEFAULT_ASSET_URL10,
|
|
12339
12539
|
label = "Attack",
|
|
12340
12540
|
icon,
|
|
12341
12541
|
cooldown = 0,
|
|
@@ -12404,7 +12604,7 @@ function ActionButton({
|
|
|
12404
12604
|
}
|
|
12405
12605
|
);
|
|
12406
12606
|
}
|
|
12407
|
-
var sizeMap13, variantStyles8,
|
|
12607
|
+
var sizeMap13, variantStyles8, DEFAULT_ASSET_URL10;
|
|
12408
12608
|
var init_ActionButton = __esm({
|
|
12409
12609
|
"components/game/2d/atoms/ActionButton.tsx"() {
|
|
12410
12610
|
init_cn();
|
|
@@ -12424,7 +12624,7 @@ var init_ActionButton = __esm({
|
|
|
12424
12624
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
|
|
12425
12625
|
danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
|
|
12426
12626
|
};
|
|
12427
|
-
|
|
12627
|
+
DEFAULT_ASSET_URL10 = {
|
|
12428
12628
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/slash_01.png",
|
|
12429
12629
|
role: "ui",
|
|
12430
12630
|
category: "action"
|
|
@@ -12444,8 +12644,8 @@ function MiniMap({
|
|
|
12444
12644
|
tileAssets,
|
|
12445
12645
|
unitAssets
|
|
12446
12646
|
}) {
|
|
12447
|
-
const canvasRef =
|
|
12448
|
-
const imgCacheRef =
|
|
12647
|
+
const canvasRef = React105.useRef(null);
|
|
12648
|
+
const imgCacheRef = React105.useRef(/* @__PURE__ */ new Map());
|
|
12449
12649
|
function loadImg(url) {
|
|
12450
12650
|
const cached = imgCacheRef.current.get(url);
|
|
12451
12651
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -12460,7 +12660,7 @@ function MiniMap({
|
|
|
12460
12660
|
imgCacheRef.current.set(url, img);
|
|
12461
12661
|
return null;
|
|
12462
12662
|
}
|
|
12463
|
-
|
|
12663
|
+
React105.useEffect(() => {
|
|
12464
12664
|
const canvas = canvasRef.current;
|
|
12465
12665
|
if (!canvas) return;
|
|
12466
12666
|
const ctx = canvas.getContext("2d");
|
|
@@ -12595,8 +12795,8 @@ function ControlGrid({
|
|
|
12595
12795
|
className
|
|
12596
12796
|
}) {
|
|
12597
12797
|
const eventBus = useEventBus();
|
|
12598
|
-
const [active, setActive] =
|
|
12599
|
-
const handlePress =
|
|
12798
|
+
const [active, setActive] = React105.useState(/* @__PURE__ */ new Set());
|
|
12799
|
+
const handlePress = React105.useCallback(
|
|
12600
12800
|
(id) => {
|
|
12601
12801
|
setActive((prev) => new Set(prev).add(id));
|
|
12602
12802
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -12610,7 +12810,7 @@ function ControlGrid({
|
|
|
12610
12810
|
},
|
|
12611
12811
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
12612
12812
|
);
|
|
12613
|
-
const handleRelease =
|
|
12813
|
+
const handleRelease = React105.useCallback(
|
|
12614
12814
|
(id) => {
|
|
12615
12815
|
setActive((prev) => {
|
|
12616
12816
|
const next = new Set(prev);
|
|
@@ -12868,7 +13068,7 @@ function InventoryGrid({
|
|
|
12868
13068
|
const eventBus = useEventBus();
|
|
12869
13069
|
const slotCount = totalSlots ?? items.length;
|
|
12870
13070
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
12871
|
-
const handleSelect =
|
|
13071
|
+
const handleSelect = React105.useCallback(
|
|
12872
13072
|
(id) => {
|
|
12873
13073
|
onSelect?.(id);
|
|
12874
13074
|
if (selectEvent) {
|
|
@@ -13085,7 +13285,7 @@ function GameMenu({
|
|
|
13085
13285
|
}) {
|
|
13086
13286
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
13087
13287
|
const eventBus = useEventBus();
|
|
13088
|
-
const handleOptionClick =
|
|
13288
|
+
const handleOptionClick = React105.useCallback(
|
|
13089
13289
|
(option) => {
|
|
13090
13290
|
if (option.event) {
|
|
13091
13291
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -13311,7 +13511,7 @@ function StateGraph({
|
|
|
13311
13511
|
}) {
|
|
13312
13512
|
const eventBus = useEventBus();
|
|
13313
13513
|
const nodes = states ?? [];
|
|
13314
|
-
const positions =
|
|
13514
|
+
const positions = React105.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
13315
13515
|
return /* @__PURE__ */ jsxs(
|
|
13316
13516
|
Box,
|
|
13317
13517
|
{
|
|
@@ -13370,76 +13570,6 @@ var init_StateGraph = __esm({
|
|
|
13370
13570
|
init_TransitionArrow();
|
|
13371
13571
|
}
|
|
13372
13572
|
});
|
|
13373
|
-
|
|
13374
|
-
// components/game/shared/atlasSlice.ts
|
|
13375
|
-
function isTilesheet(a) {
|
|
13376
|
-
return typeof a.tileWidth === "number";
|
|
13377
|
-
}
|
|
13378
|
-
function getAtlas(url, onReady) {
|
|
13379
|
-
if (atlasCache.has(url)) return atlasCache.get(url) ?? void 0;
|
|
13380
|
-
atlasCache.set(url, void 0);
|
|
13381
|
-
fetch(url).then((r2) => r2.json()).then((json) => {
|
|
13382
|
-
atlasCache.set(url, json);
|
|
13383
|
-
onReady();
|
|
13384
|
-
}).catch(() => {
|
|
13385
|
-
atlasCache.set(url, null);
|
|
13386
|
-
});
|
|
13387
|
-
return void 0;
|
|
13388
|
-
}
|
|
13389
|
-
function subRectFor(atlas, sprite) {
|
|
13390
|
-
if (isTilesheet(atlas)) {
|
|
13391
|
-
let col;
|
|
13392
|
-
let row;
|
|
13393
|
-
if (sprite.includes(",")) {
|
|
13394
|
-
const [c, r2] = sprite.split(",").map((n) => Number(n.trim()));
|
|
13395
|
-
col = c;
|
|
13396
|
-
row = r2;
|
|
13397
|
-
} else {
|
|
13398
|
-
const i = Number(sprite);
|
|
13399
|
-
if (!Number.isFinite(i)) return null;
|
|
13400
|
-
col = i % atlas.columns;
|
|
13401
|
-
row = Math.floor(i / atlas.columns);
|
|
13402
|
-
}
|
|
13403
|
-
if (!Number.isFinite(col) || !Number.isFinite(row) || col < 0 || row < 0 || col >= atlas.columns || row >= atlas.rows) return null;
|
|
13404
|
-
const margin = atlas.margin ?? 0;
|
|
13405
|
-
const spacing = atlas.spacing ?? 0;
|
|
13406
|
-
return {
|
|
13407
|
-
sx: margin + col * (atlas.tileWidth + spacing),
|
|
13408
|
-
sy: margin + row * (atlas.tileHeight + spacing),
|
|
13409
|
-
sw: atlas.tileWidth,
|
|
13410
|
-
sh: atlas.tileHeight
|
|
13411
|
-
};
|
|
13412
|
-
}
|
|
13413
|
-
const st = atlas.subTextures[sprite];
|
|
13414
|
-
if (!st) return null;
|
|
13415
|
-
return { sx: st.x, sy: st.y, sw: st.width, sh: st.height };
|
|
13416
|
-
}
|
|
13417
|
-
function isAtlasAsset(asset) {
|
|
13418
|
-
return !!asset && typeof asset.atlas === "string" && typeof asset.sprite === "string";
|
|
13419
|
-
}
|
|
13420
|
-
function resolveAssetSource(img, asset, onReady) {
|
|
13421
|
-
if (isAtlasAsset(asset)) {
|
|
13422
|
-
const atlas = getAtlas(asset.atlas, onReady);
|
|
13423
|
-
if (!atlas) return null;
|
|
13424
|
-
const rect = subRectFor(atlas, asset.sprite);
|
|
13425
|
-
if (!rect) return null;
|
|
13426
|
-
return { img, rect, aspect: rect.sw / rect.sh };
|
|
13427
|
-
}
|
|
13428
|
-
const natW = img.naturalWidth || 1;
|
|
13429
|
-
const natH = img.naturalHeight || 1;
|
|
13430
|
-
return { img, rect: null, aspect: natW / natH };
|
|
13431
|
-
}
|
|
13432
|
-
function blit(ctx, src, dx, dy, dw, dh) {
|
|
13433
|
-
if (src.rect) ctx.drawImage(src.img, src.rect.sx, src.rect.sy, src.rect.sw, src.rect.sh, dx, dy, dw, dh);
|
|
13434
|
-
else ctx.drawImage(src.img, dx, dy, dw, dh);
|
|
13435
|
-
}
|
|
13436
|
-
var atlasCache;
|
|
13437
|
-
var init_atlasSlice = __esm({
|
|
13438
|
-
"components/game/shared/atlasSlice.ts"() {
|
|
13439
|
-
"use client";
|
|
13440
|
-
atlasCache = /* @__PURE__ */ new Map();
|
|
13441
|
-
}
|
|
13442
|
-
});
|
|
13443
13573
|
function useCamera() {
|
|
13444
13574
|
const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
|
|
13445
13575
|
const targetCameraRef = useRef(null);
|
|
@@ -13847,11 +13977,11 @@ function SideView({
|
|
|
13847
13977
|
const canvasRef = useRef(null);
|
|
13848
13978
|
const eventBus = useEventBus();
|
|
13849
13979
|
const keysRef = useRef(/* @__PURE__ */ new Set());
|
|
13850
|
-
const
|
|
13980
|
+
const imageCache2 = useRef(/* @__PURE__ */ new Map());
|
|
13851
13981
|
const [loadedImages, setLoadedImages] = useState(/* @__PURE__ */ new Set());
|
|
13852
13982
|
const loadImage = useCallback((url) => {
|
|
13853
13983
|
if (!url) return null;
|
|
13854
|
-
const cached =
|
|
13984
|
+
const cached = imageCache2.current.get(url);
|
|
13855
13985
|
if (cached?.complete && cached.naturalWidth > 0) {
|
|
13856
13986
|
if (!loadedImages.has(url)) setLoadedImages((prev) => new Set(prev).add(url));
|
|
13857
13987
|
return cached;
|
|
@@ -13861,7 +13991,7 @@ function SideView({
|
|
|
13861
13991
|
img.crossOrigin = "anonymous";
|
|
13862
13992
|
img.src = url;
|
|
13863
13993
|
img.onload = () => setLoadedImages((prev) => new Set(prev).add(url));
|
|
13864
|
-
|
|
13994
|
+
imageCache2.current.set(url, img);
|
|
13865
13995
|
}
|
|
13866
13996
|
return null;
|
|
13867
13997
|
}, [loadedImages]);
|
|
@@ -13978,7 +14108,10 @@ function SideView({
|
|
|
13978
14108
|
camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
|
|
13979
14109
|
}
|
|
13980
14110
|
const bgImage = bgImg ? loadImage(bgImg.url) : null;
|
|
13981
|
-
|
|
14111
|
+
const bgSrc = bgImage ? resolveAssetSource(bgImage, bgImg, NOOP) : null;
|
|
14112
|
+
if (bgSrc) {
|
|
14113
|
+
blit(ctx, bgSrc, 0, 0, cw, ch);
|
|
14114
|
+
} else if (bgImage) {
|
|
13982
14115
|
ctx.drawImage(bgImage, 0, 0, cw, ch);
|
|
13983
14116
|
} else if (bg) {
|
|
13984
14117
|
ctx.fillStyle = bg;
|
|
@@ -14176,6 +14309,7 @@ function Canvas2D({
|
|
|
14176
14309
|
const isSide = projection === "side";
|
|
14177
14310
|
const isFree = projection === "free";
|
|
14178
14311
|
const flatLike = projection === "hex" || projection === "flat" || isFree;
|
|
14312
|
+
const squareGrid = projection === "flat";
|
|
14179
14313
|
const tilesProp = Array.isArray(_tilesPropRaw) ? _tilesPropRaw : [];
|
|
14180
14314
|
const unitsProp = Array.isArray(_unitsPropRaw) ? _unitsPropRaw : [];
|
|
14181
14315
|
const featuresProp = Array.isArray(_featuresPropRaw) ? _featuresPropRaw : [];
|
|
@@ -14258,9 +14392,9 @@ function Canvas2D({
|
|
|
14258
14392
|
const effectiveDiamondTopY = diamondTopYProp ?? DIAMOND_TOP_Y;
|
|
14259
14393
|
const scaledDiamondTopY = effectiveDiamondTopY * scale;
|
|
14260
14394
|
const baseOffsetX = useMemo(() => {
|
|
14261
|
-
if (isFree) return 0;
|
|
14395
|
+
if (isFree || projection === "flat") return 0;
|
|
14262
14396
|
return (gridHeight - 1) * (scaledTileWidth / 2);
|
|
14263
|
-
}, [isFree, gridHeight, scaledTileWidth]);
|
|
14397
|
+
}, [isFree, projection, gridHeight, scaledTileWidth]);
|
|
14264
14398
|
const validMoveSet = useMemo(() => new Set(validMoves.map((p) => `${p.x},${p.y}`)), [validMoves]);
|
|
14265
14399
|
const attackTargetSet = useMemo(() => new Set(attackTargets.map((p) => `${p.x},${p.y}`)), [attackTargets]);
|
|
14266
14400
|
const spriteUrls = useMemo(() => {
|
|
@@ -14381,7 +14515,13 @@ function Canvas2D({
|
|
|
14381
14515
|
ctx.clearRect(0, 0, viewportSize.width, viewportSize.height);
|
|
14382
14516
|
if (backgroundImage) {
|
|
14383
14517
|
const bgImg = getImage(backgroundImage.url);
|
|
14384
|
-
|
|
14518
|
+
const bgSrc = bgImg ? resolveAssetSource(bgImg, backgroundImage, bumpAtlas) : null;
|
|
14519
|
+
if (bgSrc?.rect) {
|
|
14520
|
+
const k = Math.max(viewportSize.width / bgSrc.rect.sw, viewportSize.height / bgSrc.rect.sh);
|
|
14521
|
+
const dw = bgSrc.rect.sw * k;
|
|
14522
|
+
const dh = bgSrc.rect.sh * k;
|
|
14523
|
+
blit(ctx, bgSrc, (viewportSize.width - dw) / 2, (viewportSize.height - dh) / 2, dw, dh);
|
|
14524
|
+
} else if (bgImg) {
|
|
14385
14525
|
const cam2 = cameraRef.current;
|
|
14386
14526
|
const patW = bgImg.naturalWidth;
|
|
14387
14527
|
const patH = bgImg.naturalHeight;
|
|
@@ -14417,12 +14557,18 @@ function Canvas2D({
|
|
|
14417
14557
|
const src = img ? resolveAssetSource(img, terrainAsset, bumpAtlas) : null;
|
|
14418
14558
|
if (src) {
|
|
14419
14559
|
const drawW = scaledTileWidth;
|
|
14420
|
-
const drawH = scaledTileWidth / src.aspect;
|
|
14560
|
+
const drawH = squareGrid ? scaledTileWidth : scaledTileWidth / src.aspect;
|
|
14421
14561
|
const drawX = pos.x;
|
|
14422
14562
|
const drawY = flatLike ? pos.y : pos.y + scaledTileHeight - drawH;
|
|
14423
14563
|
blit(ctx, src, drawX, drawY, drawW, drawH);
|
|
14424
14564
|
} else if (img && img.naturalWidth === 0) {
|
|
14425
14565
|
ctx.drawImage(img, pos.x, pos.y, scaledTileWidth, scaledTileHeight);
|
|
14566
|
+
} else if (squareGrid) {
|
|
14567
|
+
ctx.fillStyle = tile.terrain === "water" ? "#3b82f6" : tile.terrain === "mountain" ? "#78716c" : tile.terrain === "stone" ? "#9ca3af" : "#4ade80";
|
|
14568
|
+
ctx.fillRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
14569
|
+
ctx.strokeStyle = "rgba(0,0,0,0.2)";
|
|
14570
|
+
ctx.lineWidth = 1;
|
|
14571
|
+
ctx.strokeRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
14426
14572
|
} else {
|
|
14427
14573
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
14428
14574
|
const topY = pos.y + scaledDiamondTopY;
|
|
@@ -14439,9 +14585,13 @@ function Canvas2D({
|
|
|
14439
14585
|
ctx.stroke();
|
|
14440
14586
|
}
|
|
14441
14587
|
const drawHighlight = (color) => {
|
|
14588
|
+
ctx.fillStyle = color;
|
|
14589
|
+
if (squareGrid) {
|
|
14590
|
+
ctx.fillRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
14591
|
+
return;
|
|
14592
|
+
}
|
|
14442
14593
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
14443
14594
|
const topY = pos.y + scaledDiamondTopY;
|
|
14444
|
-
ctx.fillStyle = color;
|
|
14445
14595
|
ctx.beginPath();
|
|
14446
14596
|
ctx.moveTo(centerX, topY);
|
|
14447
14597
|
ctx.lineTo(pos.x + scaledTileWidth, topY + scaledFloorHeight / 2);
|
|
@@ -14458,7 +14608,7 @@ function Canvas2D({
|
|
|
14458
14608
|
if (attackTargetSet.has(tileKey)) drawHighlight("rgba(239, 68, 68, 0.35)");
|
|
14459
14609
|
if (debug2) {
|
|
14460
14610
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
14461
|
-
const centerY = pos.y + scaledFloorHeight / 2 + scaledDiamondTopY;
|
|
14611
|
+
const centerY = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledFloorHeight / 2 + scaledDiamondTopY;
|
|
14462
14612
|
ctx.fillStyle = "rgba(0, 0, 0, 0.7)";
|
|
14463
14613
|
ctx.font = `${12 * scale * 2}px monospace`;
|
|
14464
14614
|
ctx.textAlign = "center";
|
|
@@ -14480,9 +14630,9 @@ function Canvas2D({
|
|
|
14480
14630
|
const img = featureAsset?.url ? getImage(featureAsset.url) : null;
|
|
14481
14631
|
const src = img ? resolveAssetSource(img, featureAsset, bumpAtlas) : null;
|
|
14482
14632
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
14483
|
-
const featureGroundY = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14633
|
+
const featureGroundY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14484
14634
|
const isCastle = feature.type === "castle";
|
|
14485
|
-
const featureDrawH = isCastle ? scaledFloorHeight * 3.5 : scaledFloorHeight * 1.6;
|
|
14635
|
+
const featureDrawH = squareGrid ? isCastle ? scaledTileWidth * 1.4 : scaledTileWidth * 0.8 : isCastle ? scaledFloorHeight * 3.5 : scaledFloorHeight * 1.6;
|
|
14486
14636
|
const maxFeatureW = isCastle ? scaledTileWidth * 1.8 : scaledTileWidth * 0.7;
|
|
14487
14637
|
if (src) {
|
|
14488
14638
|
const ar = src.aspect;
|
|
@@ -14521,11 +14671,11 @@ function Canvas2D({
|
|
|
14521
14671
|
}
|
|
14522
14672
|
const isSelected = unit.id === selectedUnitId;
|
|
14523
14673
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
14524
|
-
const groundY = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14674
|
+
const groundY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14525
14675
|
const breatheOffset = 0;
|
|
14526
14676
|
const unitAsset = resolveUnitAsset(unit);
|
|
14527
14677
|
const img = unitAsset?.url ? getImage(unitAsset.url) : null;
|
|
14528
|
-
const unitDrawH = scaledFloorHeight * spriteHeightRatio * unitScale;
|
|
14678
|
+
const unitDrawH = squareGrid ? scaledTileWidth * 0.55 * spriteHeightRatio * unitScale : scaledFloorHeight * spriteHeightRatio * unitScale;
|
|
14529
14679
|
const maxUnitW = scaledTileWidth * spriteMaxWidthRatio * unitScale;
|
|
14530
14680
|
const unitIsSheet = unit.spriteSheet?.url !== void 0;
|
|
14531
14681
|
const unitSrc = img && !unitIsSheet ? resolveAssetSource(img, unitAsset, bumpAtlas) : null;
|
|
@@ -14544,7 +14694,7 @@ function Canvas2D({
|
|
|
14544
14694
|
if (unit.previousPosition && (unit.previousPosition.x !== unit.position.x || unit.previousPosition.y !== unit.position.y)) {
|
|
14545
14695
|
const ghostPos = project(unit.previousPosition.x, unit.previousPosition.y, baseOffsetX);
|
|
14546
14696
|
const ghostCenterX = ghostPos.x + scaledTileWidth / 2;
|
|
14547
|
-
const ghostGroundY = ghostPos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14697
|
+
const ghostGroundY = squareGrid ? ghostPos.y + scaledTileWidth * 0.92 : ghostPos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14548
14698
|
ctx.save();
|
|
14549
14699
|
ctx.globalAlpha = 0.25;
|
|
14550
14700
|
if (img) {
|
|
@@ -14627,17 +14777,24 @@ function Canvas2D({
|
|
|
14627
14777
|
}
|
|
14628
14778
|
}
|
|
14629
14779
|
for (const fx of effects) {
|
|
14630
|
-
const
|
|
14631
|
-
if (!
|
|
14632
|
-
const img = getImage(
|
|
14780
|
+
const fxAsset = assetManifest?.effects?.[fx.key];
|
|
14781
|
+
if (!fxAsset?.url) continue;
|
|
14782
|
+
const img = getImage(fxAsset.url);
|
|
14633
14783
|
if (!img) continue;
|
|
14784
|
+
const src = resolveAssetSource(img, fxAsset, bumpAtlas);
|
|
14634
14785
|
const pos = project(fx.x, fx.y, baseOffsetX);
|
|
14635
14786
|
const cx = pos.x + scaledTileWidth / 2;
|
|
14636
|
-
const cy = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14787
|
+
const cy = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14637
14788
|
const alpha = Math.min(1, fx.ttl / 4);
|
|
14638
14789
|
const prev = ctx.globalAlpha;
|
|
14639
14790
|
ctx.globalAlpha = alpha;
|
|
14640
|
-
|
|
14791
|
+
if (src?.rect) {
|
|
14792
|
+
const dw = scaledTileWidth;
|
|
14793
|
+
const dh = dw / src.aspect;
|
|
14794
|
+
blit(ctx, src, cx - dw / 2, cy - dh / 2, dw, dh);
|
|
14795
|
+
} else {
|
|
14796
|
+
ctx.drawImage(img, cx - img.naturalWidth / 2, cy - img.naturalHeight / 2);
|
|
14797
|
+
}
|
|
14641
14798
|
ctx.globalAlpha = prev;
|
|
14642
14799
|
}
|
|
14643
14800
|
onDrawEffects?.(ctx, 0, getImage);
|
|
@@ -14650,6 +14807,7 @@ function Canvas2D({
|
|
|
14650
14807
|
effects,
|
|
14651
14808
|
project,
|
|
14652
14809
|
flatLike,
|
|
14810
|
+
squareGrid,
|
|
14653
14811
|
scale,
|
|
14654
14812
|
debug2,
|
|
14655
14813
|
resolveTerrainAsset,
|
|
@@ -14683,12 +14841,12 @@ function Canvas2D({
|
|
|
14683
14841
|
if (!unit?.position) return;
|
|
14684
14842
|
const pos = project(unit.position.x, unit.position.y, baseOffsetX);
|
|
14685
14843
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
14686
|
-
const centerY = pos.y + scaledDiamondTopY + scaledFloorHeight / 2;
|
|
14844
|
+
const centerY = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledDiamondTopY + scaledFloorHeight / 2;
|
|
14687
14845
|
targetCameraRef.current = {
|
|
14688
14846
|
x: centerX - viewportSize.width / 2,
|
|
14689
14847
|
y: centerY - viewportSize.height / 2
|
|
14690
14848
|
};
|
|
14691
|
-
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
14849
|
+
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
14692
14850
|
useEffect(() => {
|
|
14693
14851
|
if (isSide || !interpolateUnits) return;
|
|
14694
14852
|
unitInterp.onSnapshot(
|
|
@@ -14759,11 +14917,11 @@ function Canvas2D({
|
|
|
14759
14917
|
if (!tileHoverEvent || !canvasRef.current) return;
|
|
14760
14918
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
14761
14919
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
14762
|
-
const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
14920
|
+
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
14763
14921
|
const isoPos = unproject(adjustedX, adjustedY, baseOffsetX);
|
|
14764
14922
|
const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
|
|
14765
14923
|
if (tileExists) eventBus.emit(`UI:${tileHoverEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
14766
|
-
}, [screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, tilesProp, tileHoverEvent, eventBus]);
|
|
14924
|
+
}, [screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, tilesProp, tileHoverEvent, eventBus]);
|
|
14767
14925
|
const handleCanvasPointerUp = useCallback((e) => {
|
|
14768
14926
|
singlePointerActiveRef.current = false;
|
|
14769
14927
|
if (enableCamera) handlePointerUp();
|
|
@@ -14771,7 +14929,7 @@ function Canvas2D({
|
|
|
14771
14929
|
if (!canvasRef.current) return;
|
|
14772
14930
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
14773
14931
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
14774
|
-
const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
14932
|
+
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
14775
14933
|
const isoPos = unproject(adjustedX, adjustedY, baseOffsetX);
|
|
14776
14934
|
const clickedUnit = units.find((u) => u.position?.x === isoPos.x && u.position?.y === isoPos.y);
|
|
14777
14935
|
if (clickedUnit && unitClickEvent) {
|
|
@@ -14780,7 +14938,7 @@ function Canvas2D({
|
|
|
14780
14938
|
const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
|
|
14781
14939
|
if (tileExists) eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
14782
14940
|
}
|
|
14783
|
-
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, units, tilesProp, unitClickEvent, tileClickEvent, eventBus]);
|
|
14941
|
+
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, units, tilesProp, unitClickEvent, tileClickEvent, eventBus]);
|
|
14784
14942
|
const handleCanvasPointerLeave = useCallback(() => {
|
|
14785
14943
|
handleMouseLeave();
|
|
14786
14944
|
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
@@ -14830,11 +14988,12 @@ function Canvas2D({
|
|
|
14830
14988
|
return units.filter((u) => !!u.position).map((u) => {
|
|
14831
14989
|
const pos = project(u.position.x, u.position.y, baseOffsetX);
|
|
14832
14990
|
const cam = cameraRef.current;
|
|
14991
|
+
const anchorY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
14833
14992
|
const screenX = (pos.x + scaledTileWidth / 2 - (cam.x + viewportSize.width / 2)) * cam.zoom + viewportSize.width / 2;
|
|
14834
|
-
const screenY = (
|
|
14993
|
+
const screenY = (anchorY - (cam.y + viewportSize.height / 2)) * cam.zoom + viewportSize.height / 2;
|
|
14835
14994
|
return { unit: u, screenX, screenY };
|
|
14836
14995
|
});
|
|
14837
|
-
}, [units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, cameraRef]);
|
|
14996
|
+
}, [units, project, baseOffsetX, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, viewportSize, cameraRef]);
|
|
14838
14997
|
if (error) {
|
|
14839
14998
|
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: [
|
|
14840
14999
|
/* @__PURE__ */ jsx(Icon, { name: "alert-circle", size: "xl" }),
|
|
@@ -15080,7 +15239,7 @@ function LinearView({
|
|
|
15080
15239
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
15081
15240
|
const isDone = i < currentIdx;
|
|
15082
15241
|
const isCurrent = i === currentIdx;
|
|
15083
|
-
return /* @__PURE__ */ jsxs(
|
|
15242
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
15084
15243
|
i > 0 && /* @__PURE__ */ jsx(
|
|
15085
15244
|
Typography,
|
|
15086
15245
|
{
|
|
@@ -15615,7 +15774,7 @@ function SequenceBar({
|
|
|
15615
15774
|
else onSlotRemove?.(index);
|
|
15616
15775
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
15617
15776
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
15618
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
15777
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
15619
15778
|
i > 0 && /* @__PURE__ */ jsx(
|
|
15620
15779
|
Typography,
|
|
15621
15780
|
{
|
|
@@ -17772,82 +17931,167 @@ var init_GameTemplate = __esm({
|
|
|
17772
17931
|
GameTemplate.displayName = "GameTemplate";
|
|
17773
17932
|
}
|
|
17774
17933
|
});
|
|
17775
|
-
var GameShell;
|
|
17934
|
+
var FONT_BASE, GAME_FONTS, FONT_FACES, GameShell;
|
|
17776
17935
|
var init_GameShell = __esm({
|
|
17777
17936
|
"components/game/2d/templates/GameShell.tsx"() {
|
|
17778
17937
|
init_cn();
|
|
17779
17938
|
init_Box();
|
|
17780
|
-
init_Stack();
|
|
17781
17939
|
init_Typography();
|
|
17940
|
+
init_AtlasImage();
|
|
17941
|
+
FONT_BASE = "https://almadar-kflow-assets.web.app/shared/_shared/kenney-fonts/fonts";
|
|
17942
|
+
GAME_FONTS = {
|
|
17943
|
+
future: "Kenney Future",
|
|
17944
|
+
"future-narrow": "Kenney Future Narrow",
|
|
17945
|
+
pixel: "Kenney Pixel",
|
|
17946
|
+
blocks: "Kenney Blocks",
|
|
17947
|
+
mini: "Kenney Mini"
|
|
17948
|
+
};
|
|
17949
|
+
FONT_FACES = `
|
|
17950
|
+
@font-face { font-family: 'Kenney Future'; src: url('${FONT_BASE}/Kenney%20Future.ttf') format('truetype'); font-display: swap; }
|
|
17951
|
+
@font-face { font-family: 'Kenney Future Narrow'; src: url('${FONT_BASE}/Kenney%20Future%20Narrow.ttf') format('truetype'); font-display: swap; }
|
|
17952
|
+
@font-face { font-family: 'Kenney Pixel'; src: url('${FONT_BASE}/Kenney%20Pixel.ttf') format('truetype'); font-display: swap; }
|
|
17953
|
+
@font-face { font-family: 'Kenney Blocks'; src: url('${FONT_BASE}/Kenney%20Blocks.ttf') format('truetype'); font-display: swap; }
|
|
17954
|
+
@font-face { font-family: 'Kenney Mini'; src: url('${FONT_BASE}/Kenney%20Mini.ttf') format('truetype'); font-display: swap; }
|
|
17955
|
+
.game-shell, .game-shell * { font-family: inherit; }
|
|
17956
|
+
`;
|
|
17782
17957
|
GameShell = ({
|
|
17783
17958
|
appName = "Game",
|
|
17784
17959
|
hud,
|
|
17960
|
+
addons,
|
|
17961
|
+
controls,
|
|
17962
|
+
overlay,
|
|
17785
17963
|
className,
|
|
17786
17964
|
showTopBar = true,
|
|
17787
17965
|
children,
|
|
17788
17966
|
backgroundAsset,
|
|
17789
|
-
hudBackgroundAsset
|
|
17967
|
+
hudBackgroundAsset,
|
|
17968
|
+
fontFamily = "future"
|
|
17790
17969
|
}) => {
|
|
17970
|
+
const font = GAME_FONTS[fontFamily] ?? fontFamily;
|
|
17791
17971
|
return /* @__PURE__ */ jsxs(
|
|
17792
17972
|
Box,
|
|
17793
17973
|
{
|
|
17794
|
-
|
|
17795
|
-
className: cn(
|
|
17796
|
-
"game-shell",
|
|
17797
|
-
"flex-col w-full h-screen overflow-hidden",
|
|
17798
|
-
className
|
|
17799
|
-
),
|
|
17974
|
+
className: cn("game-shell", className),
|
|
17800
17975
|
style: {
|
|
17976
|
+
position: "relative",
|
|
17801
17977
|
width: "100vw",
|
|
17802
17978
|
height: "100vh",
|
|
17803
17979
|
overflow: "hidden",
|
|
17804
|
-
background:
|
|
17805
|
-
color: "var(--color-text, #e0e0e0)"
|
|
17980
|
+
background: "var(--color-background, #0a0a0f)",
|
|
17981
|
+
color: "var(--color-text, #e0e0e0)",
|
|
17982
|
+
fontFamily: `'${font}', system-ui, sans-serif`
|
|
17806
17983
|
},
|
|
17807
17984
|
children: [
|
|
17808
|
-
|
|
17985
|
+
/* @__PURE__ */ jsx("style", { children: FONT_FACES }),
|
|
17986
|
+
backgroundAsset && /* @__PURE__ */ jsx(
|
|
17987
|
+
AtlasPanel,
|
|
17988
|
+
{
|
|
17989
|
+
asset: backgroundAsset,
|
|
17990
|
+
mode: "repeat",
|
|
17991
|
+
"aria-hidden": true,
|
|
17992
|
+
className: "game-shell__bg",
|
|
17993
|
+
style: { position: "absolute", inset: 0, opacity: 0.18, zIndex: 0, display: "block" }
|
|
17994
|
+
}
|
|
17995
|
+
),
|
|
17996
|
+
/* @__PURE__ */ jsx(Box, { className: "game-shell__content", style: { position: "absolute", inset: 0, zIndex: 1 }, children }),
|
|
17997
|
+
(showTopBar || hud) && /* @__PURE__ */ jsxs(
|
|
17809
17998
|
Box,
|
|
17810
17999
|
{
|
|
17811
|
-
className: "game-
|
|
18000
|
+
className: "game-shell__top pointer-events-none",
|
|
17812
18001
|
style: {
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
|
|
18002
|
+
position: "absolute",
|
|
18003
|
+
top: 12,
|
|
18004
|
+
left: 12,
|
|
18005
|
+
right: 12,
|
|
18006
|
+
zIndex: 2,
|
|
18007
|
+
display: "flex",
|
|
18008
|
+
alignItems: "flex-start",
|
|
18009
|
+
gap: 12
|
|
17816
18010
|
},
|
|
17817
18011
|
children: [
|
|
17818
|
-
/* @__PURE__ */ jsx(
|
|
17819
|
-
|
|
18012
|
+
showTopBar && /* @__PURE__ */ jsx(
|
|
18013
|
+
AtlasPanel,
|
|
17820
18014
|
{
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
18015
|
+
asset: hudBackgroundAsset,
|
|
18016
|
+
borderSlice: 12,
|
|
18017
|
+
borderWidth: 10,
|
|
18018
|
+
className: "game-shell__title pointer-events-auto",
|
|
18019
|
+
style: {
|
|
18020
|
+
padding: "6px 16px",
|
|
18021
|
+
background: hudBackgroundAsset ? void 0 : "rgba(18, 18, 31, 0.85)",
|
|
18022
|
+
borderRadius: hudBackgroundAsset ? void 0 : 10,
|
|
18023
|
+
boxShadow: "0 4px 14px rgba(0,0,0,0.45)",
|
|
18024
|
+
flexShrink: 0
|
|
18025
|
+
},
|
|
17824
18026
|
children: /* @__PURE__ */ jsx(
|
|
17825
18027
|
Typography,
|
|
17826
18028
|
{
|
|
17827
|
-
|
|
18029
|
+
as: "span",
|
|
17828
18030
|
style: {
|
|
17829
18031
|
fontWeight: 700,
|
|
17830
|
-
|
|
18032
|
+
fontSize: "1.05rem",
|
|
18033
|
+
letterSpacing: "0.06em",
|
|
18034
|
+
textShadow: "0 2px 0 rgba(0,0,0,0.5)",
|
|
18035
|
+
whiteSpace: "nowrap"
|
|
17831
18036
|
},
|
|
17832
18037
|
children: appName
|
|
17833
18038
|
}
|
|
17834
18039
|
)
|
|
17835
18040
|
}
|
|
17836
18041
|
),
|
|
17837
|
-
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: {
|
|
18042
|
+
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud pointer-events-auto", style: { flex: 1, minWidth: 0 }, children: hud })
|
|
17838
18043
|
]
|
|
17839
18044
|
}
|
|
17840
18045
|
),
|
|
17841
|
-
/* @__PURE__ */ jsx(
|
|
18046
|
+
controls && /* @__PURE__ */ jsx(
|
|
17842
18047
|
Box,
|
|
17843
18048
|
{
|
|
17844
|
-
className: "game-
|
|
18049
|
+
className: "game-shell__controls pointer-events-auto",
|
|
17845
18050
|
style: {
|
|
17846
|
-
|
|
17847
|
-
|
|
17848
|
-
|
|
18051
|
+
position: "absolute",
|
|
18052
|
+
left: 16,
|
|
18053
|
+
bottom: 16,
|
|
18054
|
+
zIndex: 2,
|
|
18055
|
+
display: "flex",
|
|
18056
|
+
flexDirection: "column",
|
|
18057
|
+
alignItems: "flex-start",
|
|
18058
|
+
gap: 10,
|
|
18059
|
+
filter: "drop-shadow(0 6px 12px rgba(0,0,0,0.5))"
|
|
17849
18060
|
},
|
|
17850
|
-
children
|
|
18061
|
+
children: controls
|
|
18062
|
+
}
|
|
18063
|
+
),
|
|
18064
|
+
addons && /* @__PURE__ */ jsx(
|
|
18065
|
+
Box,
|
|
18066
|
+
{
|
|
18067
|
+
className: "game-shell__actions pointer-events-auto",
|
|
18068
|
+
style: {
|
|
18069
|
+
position: "absolute",
|
|
18070
|
+
right: 16,
|
|
18071
|
+
bottom: 16,
|
|
18072
|
+
zIndex: 2,
|
|
18073
|
+
display: "flex",
|
|
18074
|
+
flexDirection: "column",
|
|
18075
|
+
alignItems: "flex-end",
|
|
18076
|
+
gap: 10,
|
|
18077
|
+
filter: "drop-shadow(0 6px 12px rgba(0,0,0,0.5))"
|
|
18078
|
+
},
|
|
18079
|
+
children: addons
|
|
18080
|
+
}
|
|
18081
|
+
),
|
|
18082
|
+
overlay && /* @__PURE__ */ jsx(
|
|
18083
|
+
Box,
|
|
18084
|
+
{
|
|
18085
|
+
className: "game-shell__overlay pointer-events-none",
|
|
18086
|
+
style: {
|
|
18087
|
+
position: "absolute",
|
|
18088
|
+
inset: 0,
|
|
18089
|
+
zIndex: 3,
|
|
18090
|
+
display: "flex",
|
|
18091
|
+
alignItems: "center",
|
|
18092
|
+
justifyContent: "center"
|
|
18093
|
+
},
|
|
18094
|
+
children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children: overlay })
|
|
17851
18095
|
}
|
|
17852
18096
|
)
|
|
17853
18097
|
]
|
|
@@ -18261,7 +18505,7 @@ var init_ErrorBoundary = __esm({
|
|
|
18261
18505
|
}
|
|
18262
18506
|
);
|
|
18263
18507
|
};
|
|
18264
|
-
ErrorBoundary = class extends
|
|
18508
|
+
ErrorBoundary = class extends React105__default.Component {
|
|
18265
18509
|
constructor(props) {
|
|
18266
18510
|
super(props);
|
|
18267
18511
|
__publicField(this, "reset", () => {
|
|
@@ -18543,7 +18787,7 @@ var init_Container = __esm({
|
|
|
18543
18787
|
as: Component = "div"
|
|
18544
18788
|
}) => {
|
|
18545
18789
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
18546
|
-
return
|
|
18790
|
+
return React105__default.createElement(
|
|
18547
18791
|
Component,
|
|
18548
18792
|
{
|
|
18549
18793
|
className: cn(
|
|
@@ -20531,7 +20775,7 @@ var init_CodeBlock = __esm({
|
|
|
20531
20775
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
20532
20776
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
20533
20777
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
20534
|
-
CodeBlock =
|
|
20778
|
+
CodeBlock = React105__default.memo(
|
|
20535
20779
|
({
|
|
20536
20780
|
code: rawCode,
|
|
20537
20781
|
language = "text",
|
|
@@ -21118,7 +21362,7 @@ var init_MarkdownContent = __esm({
|
|
|
21118
21362
|
init_Box();
|
|
21119
21363
|
init_CodeBlock();
|
|
21120
21364
|
init_cn();
|
|
21121
|
-
MarkdownContent =
|
|
21365
|
+
MarkdownContent = React105__default.memo(
|
|
21122
21366
|
({ content, direction = "ltr", className }) => {
|
|
21123
21367
|
const { t: _t } = useTranslate();
|
|
21124
21368
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -22445,7 +22689,7 @@ var init_StateMachineView = __esm({
|
|
|
22445
22689
|
style: { top: title ? 30 : 0 },
|
|
22446
22690
|
children: [
|
|
22447
22691
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
22448
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
22692
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React105__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
22449
22693
|
StateNode2,
|
|
22450
22694
|
{
|
|
22451
22695
|
state,
|
|
@@ -28083,8 +28327,8 @@ var init_Menu = __esm({
|
|
|
28083
28327
|
"bottom-end": "bottom-start"
|
|
28084
28328
|
};
|
|
28085
28329
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
28086
|
-
const triggerChild =
|
|
28087
|
-
const triggerElement =
|
|
28330
|
+
const triggerChild = React105__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
28331
|
+
const triggerElement = React105__default.cloneElement(
|
|
28088
28332
|
triggerChild,
|
|
28089
28333
|
{
|
|
28090
28334
|
ref: triggerRef,
|
|
@@ -28179,14 +28423,14 @@ function useDataDnd(args) {
|
|
|
28179
28423
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
28180
28424
|
const enabled = isZone || Boolean(dndRoot);
|
|
28181
28425
|
const eventBus = useEventBus();
|
|
28182
|
-
const parentRoot =
|
|
28426
|
+
const parentRoot = React105__default.useContext(RootCtx);
|
|
28183
28427
|
const isRoot = enabled && parentRoot === null;
|
|
28184
|
-
const zoneId =
|
|
28428
|
+
const zoneId = React105__default.useId();
|
|
28185
28429
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
28186
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
28187
|
-
const optimisticOrdersRef =
|
|
28430
|
+
const [optimisticOrders, setOptimisticOrders] = React105__default.useState(() => /* @__PURE__ */ new Map());
|
|
28431
|
+
const optimisticOrdersRef = React105__default.useRef(optimisticOrders);
|
|
28188
28432
|
optimisticOrdersRef.current = optimisticOrders;
|
|
28189
|
-
const clearOptimisticOrder =
|
|
28433
|
+
const clearOptimisticOrder = React105__default.useCallback((group) => {
|
|
28190
28434
|
setOptimisticOrders((prev) => {
|
|
28191
28435
|
if (!prev.has(group)) return prev;
|
|
28192
28436
|
const next = new Map(prev);
|
|
@@ -28211,7 +28455,7 @@ function useDataDnd(args) {
|
|
|
28211
28455
|
const raw = it[dndItemIdField];
|
|
28212
28456
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
28213
28457
|
}).join("|");
|
|
28214
|
-
const itemIds =
|
|
28458
|
+
const itemIds = React105__default.useMemo(
|
|
28215
28459
|
() => orderedItems.map((it, idx) => {
|
|
28216
28460
|
const raw = it[dndItemIdField];
|
|
28217
28461
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -28222,7 +28466,7 @@ function useDataDnd(args) {
|
|
|
28222
28466
|
const raw = it[dndItemIdField];
|
|
28223
28467
|
return raw != null ? String(raw) : `__${idx}`;
|
|
28224
28468
|
}).join("|");
|
|
28225
|
-
|
|
28469
|
+
React105__default.useEffect(() => {
|
|
28226
28470
|
const root = isRoot ? null : parentRoot;
|
|
28227
28471
|
if (root) {
|
|
28228
28472
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -28230,20 +28474,20 @@ function useDataDnd(args) {
|
|
|
28230
28474
|
clearOptimisticOrder(ownGroup);
|
|
28231
28475
|
}
|
|
28232
28476
|
}, [itemsContentSig, ownGroup]);
|
|
28233
|
-
const zonesRef =
|
|
28234
|
-
const registerZone =
|
|
28477
|
+
const zonesRef = React105__default.useRef(/* @__PURE__ */ new Map());
|
|
28478
|
+
const registerZone = React105__default.useCallback((zoneId2, meta2) => {
|
|
28235
28479
|
zonesRef.current.set(zoneId2, meta2);
|
|
28236
28480
|
}, []);
|
|
28237
|
-
const unregisterZone =
|
|
28481
|
+
const unregisterZone = React105__default.useCallback((zoneId2) => {
|
|
28238
28482
|
zonesRef.current.delete(zoneId2);
|
|
28239
28483
|
}, []);
|
|
28240
|
-
const [activeDrag, setActiveDrag] =
|
|
28241
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
28242
|
-
const meta =
|
|
28484
|
+
const [activeDrag, setActiveDrag] = React105__default.useState(null);
|
|
28485
|
+
const [overZoneGroup, setOverZoneGroup] = React105__default.useState(null);
|
|
28486
|
+
const meta = React105__default.useMemo(
|
|
28243
28487
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
28244
28488
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
28245
28489
|
);
|
|
28246
|
-
|
|
28490
|
+
React105__default.useEffect(() => {
|
|
28247
28491
|
const target = isRoot ? null : parentRoot;
|
|
28248
28492
|
if (!target) {
|
|
28249
28493
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -28262,7 +28506,7 @@ function useDataDnd(args) {
|
|
|
28262
28506
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
28263
28507
|
const sensors = useAlmadarDndSensors(true);
|
|
28264
28508
|
const collisionDetection = almadarDndCollisionDetection;
|
|
28265
|
-
const findZoneByItem =
|
|
28509
|
+
const findZoneByItem = React105__default.useCallback(
|
|
28266
28510
|
(id) => {
|
|
28267
28511
|
for (const z of zonesRef.current.values()) {
|
|
28268
28512
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -28271,7 +28515,7 @@ function useDataDnd(args) {
|
|
|
28271
28515
|
},
|
|
28272
28516
|
[]
|
|
28273
28517
|
);
|
|
28274
|
-
|
|
28518
|
+
React105__default.useCallback(
|
|
28275
28519
|
(group) => {
|
|
28276
28520
|
for (const z of zonesRef.current.values()) {
|
|
28277
28521
|
if (z.group === group) return z;
|
|
@@ -28280,7 +28524,7 @@ function useDataDnd(args) {
|
|
|
28280
28524
|
},
|
|
28281
28525
|
[]
|
|
28282
28526
|
);
|
|
28283
|
-
const handleDragEnd =
|
|
28527
|
+
const handleDragEnd = React105__default.useCallback(
|
|
28284
28528
|
(event) => {
|
|
28285
28529
|
const { active, over } = event;
|
|
28286
28530
|
const activeIdStr = String(active.id);
|
|
@@ -28371,8 +28615,8 @@ function useDataDnd(args) {
|
|
|
28371
28615
|
},
|
|
28372
28616
|
[eventBus]
|
|
28373
28617
|
);
|
|
28374
|
-
const sortableData =
|
|
28375
|
-
const SortableItem =
|
|
28618
|
+
const sortableData = React105__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
28619
|
+
const SortableItem = React105__default.useCallback(
|
|
28376
28620
|
({ id, children }) => {
|
|
28377
28621
|
const {
|
|
28378
28622
|
attributes,
|
|
@@ -28412,7 +28656,7 @@ function useDataDnd(args) {
|
|
|
28412
28656
|
id: droppableId,
|
|
28413
28657
|
data: sortableData
|
|
28414
28658
|
});
|
|
28415
|
-
const ctx =
|
|
28659
|
+
const ctx = React105__default.useContext(RootCtx);
|
|
28416
28660
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
28417
28661
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
28418
28662
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -28427,7 +28671,7 @@ function useDataDnd(args) {
|
|
|
28427
28671
|
showForeignPlaceholder,
|
|
28428
28672
|
ctxAvailable: ctx != null
|
|
28429
28673
|
});
|
|
28430
|
-
|
|
28674
|
+
React105__default.useEffect(() => {
|
|
28431
28675
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
28432
28676
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
28433
28677
|
return /* @__PURE__ */ jsx(
|
|
@@ -28441,11 +28685,11 @@ function useDataDnd(args) {
|
|
|
28441
28685
|
}
|
|
28442
28686
|
);
|
|
28443
28687
|
};
|
|
28444
|
-
const rootContextValue =
|
|
28688
|
+
const rootContextValue = React105__default.useMemo(
|
|
28445
28689
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
28446
28690
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
28447
28691
|
);
|
|
28448
|
-
const handleDragStart =
|
|
28692
|
+
const handleDragStart = React105__default.useCallback((event) => {
|
|
28449
28693
|
const sourceZone = findZoneByItem(event.active.id);
|
|
28450
28694
|
const rect = event.active.rect.current.initial;
|
|
28451
28695
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -28464,7 +28708,7 @@ function useDataDnd(args) {
|
|
|
28464
28708
|
isRoot
|
|
28465
28709
|
});
|
|
28466
28710
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
28467
|
-
const handleDragOver =
|
|
28711
|
+
const handleDragOver = React105__default.useCallback((event) => {
|
|
28468
28712
|
const { active, over } = event;
|
|
28469
28713
|
const overData = over?.data?.current;
|
|
28470
28714
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -28534,7 +28778,7 @@ function useDataDnd(args) {
|
|
|
28534
28778
|
return next;
|
|
28535
28779
|
});
|
|
28536
28780
|
}, []);
|
|
28537
|
-
const handleDragCancel =
|
|
28781
|
+
const handleDragCancel = React105__default.useCallback((event) => {
|
|
28538
28782
|
setActiveDrag(null);
|
|
28539
28783
|
setOverZoneGroup(null);
|
|
28540
28784
|
dndLog.warn("dragCancel", {
|
|
@@ -28542,12 +28786,12 @@ function useDataDnd(args) {
|
|
|
28542
28786
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
28543
28787
|
});
|
|
28544
28788
|
}, []);
|
|
28545
|
-
const handleDragEndWithCleanup =
|
|
28789
|
+
const handleDragEndWithCleanup = React105__default.useCallback((event) => {
|
|
28546
28790
|
handleDragEnd(event);
|
|
28547
28791
|
setActiveDrag(null);
|
|
28548
28792
|
setOverZoneGroup(null);
|
|
28549
28793
|
}, [handleDragEnd]);
|
|
28550
|
-
const wrapContainer =
|
|
28794
|
+
const wrapContainer = React105__default.useCallback(
|
|
28551
28795
|
(children) => {
|
|
28552
28796
|
if (!enabled) return children;
|
|
28553
28797
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -28601,7 +28845,7 @@ var init_useDataDnd = __esm({
|
|
|
28601
28845
|
init_useAlmadarDndCollision();
|
|
28602
28846
|
init_Box();
|
|
28603
28847
|
dndLog = createLogger("almadar:ui:dnd");
|
|
28604
|
-
RootCtx =
|
|
28848
|
+
RootCtx = React105__default.createContext(null);
|
|
28605
28849
|
}
|
|
28606
28850
|
});
|
|
28607
28851
|
function renderIconInput(icon, props) {
|
|
@@ -29127,7 +29371,7 @@ function DataList({
|
|
|
29127
29371
|
}) {
|
|
29128
29372
|
const eventBus = useEventBus();
|
|
29129
29373
|
const { t } = useTranslate();
|
|
29130
|
-
const [visibleCount, setVisibleCount] =
|
|
29374
|
+
const [visibleCount, setVisibleCount] = React105__default.useState(pageSize || Infinity);
|
|
29131
29375
|
const fieldDefs = fields ?? columns ?? [];
|
|
29132
29376
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29133
29377
|
const dnd = useDataDnd({
|
|
@@ -29146,7 +29390,7 @@ function DataList({
|
|
|
29146
29390
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
29147
29391
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
29148
29392
|
const hasRenderProp = typeof children === "function";
|
|
29149
|
-
|
|
29393
|
+
React105__default.useEffect(() => {
|
|
29150
29394
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
29151
29395
|
const childrenTypeOf = typeof children;
|
|
29152
29396
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -29250,7 +29494,7 @@ function DataList({
|
|
|
29250
29494
|
const items2 = [...data];
|
|
29251
29495
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
29252
29496
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
29253
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29497
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
29254
29498
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
29255
29499
|
group.items.map((itemData, index) => {
|
|
29256
29500
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -29391,7 +29635,7 @@ function DataList({
|
|
|
29391
29635
|
className
|
|
29392
29636
|
),
|
|
29393
29637
|
children: [
|
|
29394
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29638
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
29395
29639
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
29396
29640
|
group.items.map(
|
|
29397
29641
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -29476,7 +29720,7 @@ var init_FormSection = __esm({
|
|
|
29476
29720
|
columns = 1,
|
|
29477
29721
|
className
|
|
29478
29722
|
}) => {
|
|
29479
|
-
const [collapsed, setCollapsed] =
|
|
29723
|
+
const [collapsed, setCollapsed] = React105__default.useState(defaultCollapsed);
|
|
29480
29724
|
const { t } = useTranslate();
|
|
29481
29725
|
const eventBus = useEventBus();
|
|
29482
29726
|
const gridClass = {
|
|
@@ -29484,7 +29728,7 @@ var init_FormSection = __esm({
|
|
|
29484
29728
|
2: "grid-cols-1 md:grid-cols-2",
|
|
29485
29729
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
29486
29730
|
}[columns];
|
|
29487
|
-
|
|
29731
|
+
React105__default.useCallback(() => {
|
|
29488
29732
|
if (collapsible) {
|
|
29489
29733
|
setCollapsed((prev) => !prev);
|
|
29490
29734
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -30434,7 +30678,7 @@ var init_Flex = __esm({
|
|
|
30434
30678
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
30435
30679
|
}
|
|
30436
30680
|
}
|
|
30437
|
-
return
|
|
30681
|
+
return React105__default.createElement(Component, {
|
|
30438
30682
|
className: cn(
|
|
30439
30683
|
inline ? "inline-flex" : "flex",
|
|
30440
30684
|
directionStyles[direction],
|
|
@@ -30553,7 +30797,7 @@ var init_Grid = __esm({
|
|
|
30553
30797
|
as: Component = "div"
|
|
30554
30798
|
}) => {
|
|
30555
30799
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
30556
|
-
return
|
|
30800
|
+
return React105__default.createElement(
|
|
30557
30801
|
Component,
|
|
30558
30802
|
{
|
|
30559
30803
|
className: cn(
|
|
@@ -30749,9 +30993,9 @@ var init_Popover = __esm({
|
|
|
30749
30993
|
onMouseLeave: handleClose,
|
|
30750
30994
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
30751
30995
|
};
|
|
30752
|
-
const childElement =
|
|
30996
|
+
const childElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
30753
30997
|
const childPointerDown = childElement.props.onPointerDown;
|
|
30754
|
-
const triggerElement =
|
|
30998
|
+
const triggerElement = React105__default.cloneElement(
|
|
30755
30999
|
childElement,
|
|
30756
31000
|
{
|
|
30757
31001
|
ref: triggerRef,
|
|
@@ -31353,9 +31597,9 @@ var init_Tooltip = __esm({
|
|
|
31353
31597
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
31354
31598
|
};
|
|
31355
31599
|
}, []);
|
|
31356
|
-
const triggerElement =
|
|
31600
|
+
const triggerElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
31357
31601
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
31358
|
-
const trigger =
|
|
31602
|
+
const trigger = React105__default.cloneElement(triggerElement, {
|
|
31359
31603
|
ref: triggerRef,
|
|
31360
31604
|
onMouseEnter: handleMouseEnter,
|
|
31361
31605
|
onMouseLeave: handleMouseLeave,
|
|
@@ -31445,7 +31689,7 @@ var init_WizardProgress = __esm({
|
|
|
31445
31689
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
31446
31690
|
const isActive = index === currentStep;
|
|
31447
31691
|
const isCompleted = index < currentStep;
|
|
31448
|
-
return /* @__PURE__ */ jsxs(
|
|
31692
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
31449
31693
|
/* @__PURE__ */ jsx(
|
|
31450
31694
|
"button",
|
|
31451
31695
|
{
|
|
@@ -33005,13 +33249,13 @@ var init_MapView = __esm({
|
|
|
33005
33249
|
shadowSize: [41, 41]
|
|
33006
33250
|
});
|
|
33007
33251
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
33008
|
-
const { useEffect:
|
|
33252
|
+
const { useEffect: useEffect71, useRef: useRef67, useCallback: useCallback104, useState: useState105 } = React105__default;
|
|
33009
33253
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
33010
33254
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
33011
33255
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
33012
33256
|
const map = useMap();
|
|
33013
|
-
const prevRef =
|
|
33014
|
-
|
|
33257
|
+
const prevRef = useRef67({ centerLat, centerLng, zoom });
|
|
33258
|
+
useEffect71(() => {
|
|
33015
33259
|
const prev = prevRef.current;
|
|
33016
33260
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
33017
33261
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -33022,7 +33266,7 @@ var init_MapView = __esm({
|
|
|
33022
33266
|
}
|
|
33023
33267
|
function MapClickHandler({ onMapClick }) {
|
|
33024
33268
|
const map = useMap();
|
|
33025
|
-
|
|
33269
|
+
useEffect71(() => {
|
|
33026
33270
|
if (!onMapClick) return;
|
|
33027
33271
|
const handler = (e) => {
|
|
33028
33272
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -33920,8 +34164,8 @@ function TableView({
|
|
|
33920
34164
|
}) {
|
|
33921
34165
|
const eventBus = useEventBus();
|
|
33922
34166
|
const { t } = useTranslate();
|
|
33923
|
-
const [visibleCount, setVisibleCount] =
|
|
33924
|
-
const [localSelected, setLocalSelected] =
|
|
34167
|
+
const [visibleCount, setVisibleCount] = React105__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
34168
|
+
const [localSelected, setLocalSelected] = React105__default.useState(/* @__PURE__ */ new Set());
|
|
33925
34169
|
const colDefs = columns ?? fields ?? [];
|
|
33926
34170
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
33927
34171
|
const dnd = useDataDnd({
|
|
@@ -34116,12 +34360,12 @@ function TableView({
|
|
|
34116
34360
|
]
|
|
34117
34361
|
}
|
|
34118
34362
|
);
|
|
34119
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
34363
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React105__default.Fragment, { children: rowInner }, id);
|
|
34120
34364
|
};
|
|
34121
34365
|
const items = Array.from(data);
|
|
34122
34366
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
34123
34367
|
let runningIndex = 0;
|
|
34124
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
34368
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
34125
34369
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
34126
34370
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
34127
34371
|
] }, gi)) });
|
|
@@ -35478,7 +35722,7 @@ var init_StepFlow = __esm({
|
|
|
35478
35722
|
className
|
|
35479
35723
|
}) => {
|
|
35480
35724
|
if (orientation === "vertical") {
|
|
35481
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
35725
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React105__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
35482
35726
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
35483
35727
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
35484
35728
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -35489,7 +35733,7 @@ var init_StepFlow = __esm({
|
|
|
35489
35733
|
] })
|
|
35490
35734
|
] }) }, index)) });
|
|
35491
35735
|
}
|
|
35492
|
-
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(
|
|
35736
|
+
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(React105__default.Fragment, { children: [
|
|
35493
35737
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
35494
35738
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
35495
35739
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -36474,7 +36718,7 @@ var init_LikertScale = __esm({
|
|
|
36474
36718
|
md: "text-base",
|
|
36475
36719
|
lg: "text-lg"
|
|
36476
36720
|
};
|
|
36477
|
-
LikertScale =
|
|
36721
|
+
LikertScale = React105__default.forwardRef(
|
|
36478
36722
|
({
|
|
36479
36723
|
question,
|
|
36480
36724
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -36486,7 +36730,7 @@ var init_LikertScale = __esm({
|
|
|
36486
36730
|
variant = "radios",
|
|
36487
36731
|
className
|
|
36488
36732
|
}, ref) => {
|
|
36489
|
-
const groupId =
|
|
36733
|
+
const groupId = React105__default.useId();
|
|
36490
36734
|
const eventBus = useEventBus();
|
|
36491
36735
|
const handleSelect = useCallback(
|
|
36492
36736
|
(next) => {
|
|
@@ -38768,7 +39012,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
38768
39012
|
"aria-label": t("aria.breadcrumb"),
|
|
38769
39013
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
38770
39014
|
const isLast = idx === items.length - 1;
|
|
38771
|
-
return /* @__PURE__ */ jsxs(
|
|
39015
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
38772
39016
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
38773
39017
|
Icon,
|
|
38774
39018
|
{
|
|
@@ -39432,7 +39676,7 @@ var init_PageHeader = __esm({
|
|
|
39432
39676
|
info: "bg-info/10 text-info"
|
|
39433
39677
|
};
|
|
39434
39678
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
39435
|
-
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(
|
|
39679
|
+
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(React105__default.Fragment, { children: [
|
|
39436
39680
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
39437
39681
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
39438
39682
|
"a",
|
|
@@ -39790,7 +40034,7 @@ var init_Section = __esm({
|
|
|
39790
40034
|
as: Component = "section"
|
|
39791
40035
|
}) => {
|
|
39792
40036
|
const hasHeader = title || description || action;
|
|
39793
|
-
return
|
|
40037
|
+
return React105__default.createElement(
|
|
39794
40038
|
Component,
|
|
39795
40039
|
{
|
|
39796
40040
|
className: cn(
|
|
@@ -40164,7 +40408,7 @@ var init_WizardContainer = __esm({
|
|
|
40164
40408
|
const isCompleted = index < currentStep;
|
|
40165
40409
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
40166
40410
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
40167
|
-
return /* @__PURE__ */ jsxs(
|
|
40411
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
40168
40412
|
/* @__PURE__ */ jsx(
|
|
40169
40413
|
Button,
|
|
40170
40414
|
{
|
|
@@ -42597,7 +42841,7 @@ var init_DetailPanel = __esm({
|
|
|
42597
42841
|
}
|
|
42598
42842
|
});
|
|
42599
42843
|
function extractTitle(children) {
|
|
42600
|
-
if (!
|
|
42844
|
+
if (!React105__default.isValidElement(children)) return void 0;
|
|
42601
42845
|
const props = children.props;
|
|
42602
42846
|
if (typeof props.title === "string") {
|
|
42603
42847
|
return props.title;
|
|
@@ -42947,12 +43191,12 @@ var init_Form = __esm({
|
|
|
42947
43191
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
42948
43192
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
42949
43193
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
42950
|
-
const normalizedInitialData =
|
|
43194
|
+
const normalizedInitialData = React105__default.useMemo(() => {
|
|
42951
43195
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
42952
43196
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
42953
43197
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
42954
43198
|
}, [entity, initialData]);
|
|
42955
|
-
const entityDerivedFields =
|
|
43199
|
+
const entityDerivedFields = React105__default.useMemo(() => {
|
|
42956
43200
|
if (fields && fields.length > 0) return void 0;
|
|
42957
43201
|
if (!resolvedEntity) return void 0;
|
|
42958
43202
|
return resolvedEntity.fields.map(
|
|
@@ -42973,16 +43217,16 @@ var init_Form = __esm({
|
|
|
42973
43217
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42974
43218
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42975
43219
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42976
|
-
const [formData, setFormData] =
|
|
43220
|
+
const [formData, setFormData] = React105__default.useState(
|
|
42977
43221
|
normalizedInitialData
|
|
42978
43222
|
);
|
|
42979
|
-
const [collapsedSections, setCollapsedSections] =
|
|
43223
|
+
const [collapsedSections, setCollapsedSections] = React105__default.useState(
|
|
42980
43224
|
/* @__PURE__ */ new Set()
|
|
42981
43225
|
);
|
|
42982
|
-
const [submitError, setSubmitError] =
|
|
42983
|
-
const formRef =
|
|
43226
|
+
const [submitError, setSubmitError] = React105__default.useState(null);
|
|
43227
|
+
const formRef = React105__default.useRef(null);
|
|
42984
43228
|
const formMode = props.mode;
|
|
42985
|
-
const mountedRef =
|
|
43229
|
+
const mountedRef = React105__default.useRef(false);
|
|
42986
43230
|
if (!mountedRef.current) {
|
|
42987
43231
|
mountedRef.current = true;
|
|
42988
43232
|
debug("forms", "mount", {
|
|
@@ -42995,7 +43239,7 @@ var init_Form = __esm({
|
|
|
42995
43239
|
});
|
|
42996
43240
|
}
|
|
42997
43241
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42998
|
-
const evalContext =
|
|
43242
|
+
const evalContext = React105__default.useMemo(
|
|
42999
43243
|
() => ({
|
|
43000
43244
|
formValues: formData,
|
|
43001
43245
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -43004,7 +43248,7 @@ var init_Form = __esm({
|
|
|
43004
43248
|
}),
|
|
43005
43249
|
[formData, externalContext]
|
|
43006
43250
|
);
|
|
43007
|
-
|
|
43251
|
+
React105__default.useEffect(() => {
|
|
43008
43252
|
debug("forms", "initialData-sync", {
|
|
43009
43253
|
mode: formMode,
|
|
43010
43254
|
normalizedInitialData,
|
|
@@ -43015,7 +43259,7 @@ var init_Form = __esm({
|
|
|
43015
43259
|
setFormData(normalizedInitialData);
|
|
43016
43260
|
}
|
|
43017
43261
|
}, [normalizedInitialData]);
|
|
43018
|
-
const processCalculations =
|
|
43262
|
+
const processCalculations = React105__default.useCallback(
|
|
43019
43263
|
(changedFieldId, newFormData) => {
|
|
43020
43264
|
if (!hiddenCalculations.length) return;
|
|
43021
43265
|
const context = {
|
|
@@ -43040,7 +43284,7 @@ var init_Form = __esm({
|
|
|
43040
43284
|
},
|
|
43041
43285
|
[hiddenCalculations, externalContext, eventBus]
|
|
43042
43286
|
);
|
|
43043
|
-
const checkViolations =
|
|
43287
|
+
const checkViolations = React105__default.useCallback(
|
|
43044
43288
|
(changedFieldId, newFormData) => {
|
|
43045
43289
|
if (!violationTriggers.length) return;
|
|
43046
43290
|
const context = {
|
|
@@ -43078,7 +43322,7 @@ var init_Form = __esm({
|
|
|
43078
43322
|
processCalculations(name, newFormData);
|
|
43079
43323
|
checkViolations(name, newFormData);
|
|
43080
43324
|
};
|
|
43081
|
-
const isFieldVisible =
|
|
43325
|
+
const isFieldVisible = React105__default.useCallback(
|
|
43082
43326
|
(fieldName) => {
|
|
43083
43327
|
const condition = conditionalFields[fieldName];
|
|
43084
43328
|
if (!condition) return true;
|
|
@@ -43086,7 +43330,7 @@ var init_Form = __esm({
|
|
|
43086
43330
|
},
|
|
43087
43331
|
[conditionalFields, evalContext]
|
|
43088
43332
|
);
|
|
43089
|
-
const isSectionVisible =
|
|
43333
|
+
const isSectionVisible = React105__default.useCallback(
|
|
43090
43334
|
(section) => {
|
|
43091
43335
|
if (!section.condition) return true;
|
|
43092
43336
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -43162,7 +43406,7 @@ var init_Form = __esm({
|
|
|
43162
43406
|
eventBus.emit(`UI:${onCancel}`);
|
|
43163
43407
|
}
|
|
43164
43408
|
};
|
|
43165
|
-
const renderField =
|
|
43409
|
+
const renderField = React105__default.useCallback(
|
|
43166
43410
|
(field) => {
|
|
43167
43411
|
const fieldName = field.name || field.field;
|
|
43168
43412
|
if (!fieldName) return null;
|
|
@@ -43183,7 +43427,7 @@ var init_Form = __esm({
|
|
|
43183
43427
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
43184
43428
|
);
|
|
43185
43429
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
43186
|
-
const normalizedFields =
|
|
43430
|
+
const normalizedFields = React105__default.useMemo(() => {
|
|
43187
43431
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
43188
43432
|
return effectiveFields.map((field) => {
|
|
43189
43433
|
if (typeof field === "string") {
|
|
@@ -43207,7 +43451,7 @@ var init_Form = __esm({
|
|
|
43207
43451
|
return field;
|
|
43208
43452
|
});
|
|
43209
43453
|
}, [effectiveFields, resolvedEntity]);
|
|
43210
|
-
const schemaFields =
|
|
43454
|
+
const schemaFields = React105__default.useMemo(() => {
|
|
43211
43455
|
if (normalizedFields.length === 0) return null;
|
|
43212
43456
|
if (isDebugEnabled()) {
|
|
43213
43457
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -43217,7 +43461,7 @@ var init_Form = __esm({
|
|
|
43217
43461
|
}
|
|
43218
43462
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
43219
43463
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
43220
|
-
const sectionElements =
|
|
43464
|
+
const sectionElements = React105__default.useMemo(() => {
|
|
43221
43465
|
if (!sections || sections.length === 0) return null;
|
|
43222
43466
|
return sections.map((section) => {
|
|
43223
43467
|
if (!isSectionVisible(section)) {
|
|
@@ -43942,7 +44186,7 @@ var init_List = __esm({
|
|
|
43942
44186
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
43943
44187
|
return [];
|
|
43944
44188
|
}, [entity]);
|
|
43945
|
-
const getItemActions =
|
|
44189
|
+
const getItemActions = React105__default.useCallback(
|
|
43946
44190
|
(item) => {
|
|
43947
44191
|
if (!itemActions) return [];
|
|
43948
44192
|
if (typeof itemActions === "function") {
|
|
@@ -44417,7 +44661,7 @@ var init_MediaGallery = __esm({
|
|
|
44417
44661
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
44418
44662
|
);
|
|
44419
44663
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
44420
|
-
const items =
|
|
44664
|
+
const items = React105__default.useMemo(() => {
|
|
44421
44665
|
if (propItems) return propItems;
|
|
44422
44666
|
if (entityData.length === 0) return [];
|
|
44423
44667
|
return entityData.map((record, idx) => {
|
|
@@ -44580,7 +44824,7 @@ var init_MediaGallery = __esm({
|
|
|
44580
44824
|
}
|
|
44581
44825
|
});
|
|
44582
44826
|
function extractTitle2(children) {
|
|
44583
|
-
if (!
|
|
44827
|
+
if (!React105__default.isValidElement(children)) return void 0;
|
|
44584
44828
|
const props = children.props;
|
|
44585
44829
|
if (typeof props.title === "string") {
|
|
44586
44830
|
return props.title;
|
|
@@ -44854,7 +45098,7 @@ var init_debugRegistry = __esm({
|
|
|
44854
45098
|
}
|
|
44855
45099
|
});
|
|
44856
45100
|
function useDebugData() {
|
|
44857
|
-
const [data, setData] =
|
|
45101
|
+
const [data, setData] = React105.useState(() => ({
|
|
44858
45102
|
traits: [],
|
|
44859
45103
|
ticks: [],
|
|
44860
45104
|
guards: [],
|
|
@@ -44868,7 +45112,7 @@ function useDebugData() {
|
|
|
44868
45112
|
},
|
|
44869
45113
|
lastUpdate: Date.now()
|
|
44870
45114
|
}));
|
|
44871
|
-
|
|
45115
|
+
React105.useEffect(() => {
|
|
44872
45116
|
const updateData = () => {
|
|
44873
45117
|
setData({
|
|
44874
45118
|
traits: getAllTraits(),
|
|
@@ -44977,12 +45221,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
44977
45221
|
return positions;
|
|
44978
45222
|
}
|
|
44979
45223
|
function WalkMinimap() {
|
|
44980
|
-
const [walkStep, setWalkStep] =
|
|
44981
|
-
const [traits2, setTraits] =
|
|
44982
|
-
const [coveredEdges, setCoveredEdges] =
|
|
44983
|
-
const [completedTraits, setCompletedTraits] =
|
|
44984
|
-
const prevTraitRef =
|
|
44985
|
-
|
|
45224
|
+
const [walkStep, setWalkStep] = React105.useState(null);
|
|
45225
|
+
const [traits2, setTraits] = React105.useState([]);
|
|
45226
|
+
const [coveredEdges, setCoveredEdges] = React105.useState([]);
|
|
45227
|
+
const [completedTraits, setCompletedTraits] = React105.useState(/* @__PURE__ */ new Set());
|
|
45228
|
+
const prevTraitRef = React105.useRef(null);
|
|
45229
|
+
React105.useEffect(() => {
|
|
44986
45230
|
const interval = setInterval(() => {
|
|
44987
45231
|
const w = window;
|
|
44988
45232
|
const step = w.__orbitalWalkStep;
|
|
@@ -45418,15 +45662,15 @@ var init_EntitiesTab = __esm({
|
|
|
45418
45662
|
});
|
|
45419
45663
|
function EventFlowTab({ events: events2 }) {
|
|
45420
45664
|
const { t } = useTranslate();
|
|
45421
|
-
const [filter, setFilter] =
|
|
45422
|
-
const containerRef =
|
|
45423
|
-
const [autoScroll, setAutoScroll] =
|
|
45424
|
-
|
|
45665
|
+
const [filter, setFilter] = React105.useState("all");
|
|
45666
|
+
const containerRef = React105.useRef(null);
|
|
45667
|
+
const [autoScroll, setAutoScroll] = React105.useState(true);
|
|
45668
|
+
React105.useEffect(() => {
|
|
45425
45669
|
if (autoScroll && containerRef.current) {
|
|
45426
45670
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
45427
45671
|
}
|
|
45428
45672
|
}, [events2.length, autoScroll]);
|
|
45429
|
-
const filteredEvents =
|
|
45673
|
+
const filteredEvents = React105.useMemo(() => {
|
|
45430
45674
|
if (filter === "all") return events2;
|
|
45431
45675
|
return events2.filter((e) => e.type === filter);
|
|
45432
45676
|
}, [events2, filter]);
|
|
@@ -45542,7 +45786,7 @@ var init_EventFlowTab = __esm({
|
|
|
45542
45786
|
});
|
|
45543
45787
|
function GuardsPanel({ guards }) {
|
|
45544
45788
|
const { t } = useTranslate();
|
|
45545
|
-
const [filter, setFilter] =
|
|
45789
|
+
const [filter, setFilter] = React105.useState("all");
|
|
45546
45790
|
if (guards.length === 0) {
|
|
45547
45791
|
return /* @__PURE__ */ jsx(
|
|
45548
45792
|
EmptyState,
|
|
@@ -45555,7 +45799,7 @@ function GuardsPanel({ guards }) {
|
|
|
45555
45799
|
}
|
|
45556
45800
|
const passedCount = guards.filter((g) => g.result).length;
|
|
45557
45801
|
const failedCount = guards.length - passedCount;
|
|
45558
|
-
const filteredGuards =
|
|
45802
|
+
const filteredGuards = React105.useMemo(() => {
|
|
45559
45803
|
if (filter === "all") return guards;
|
|
45560
45804
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
45561
45805
|
return guards.filter((g) => !g.result);
|
|
@@ -45718,10 +45962,10 @@ function EffectBadge({ effect }) {
|
|
|
45718
45962
|
}
|
|
45719
45963
|
function TransitionTimeline({ transitions }) {
|
|
45720
45964
|
const { t } = useTranslate();
|
|
45721
|
-
const containerRef =
|
|
45722
|
-
const [autoScroll, setAutoScroll] =
|
|
45723
|
-
const [expandedId, setExpandedId] =
|
|
45724
|
-
|
|
45965
|
+
const containerRef = React105.useRef(null);
|
|
45966
|
+
const [autoScroll, setAutoScroll] = React105.useState(true);
|
|
45967
|
+
const [expandedId, setExpandedId] = React105.useState(null);
|
|
45968
|
+
React105.useEffect(() => {
|
|
45725
45969
|
if (autoScroll && containerRef.current) {
|
|
45726
45970
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
45727
45971
|
}
|
|
@@ -46001,9 +46245,9 @@ function getAllEvents(traits2) {
|
|
|
46001
46245
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
46002
46246
|
const eventBus = useEventBus();
|
|
46003
46247
|
const { t } = useTranslate();
|
|
46004
|
-
const [log11, setLog] =
|
|
46005
|
-
const prevStatesRef =
|
|
46006
|
-
|
|
46248
|
+
const [log11, setLog] = React105.useState([]);
|
|
46249
|
+
const prevStatesRef = React105.useRef(/* @__PURE__ */ new Map());
|
|
46250
|
+
React105.useEffect(() => {
|
|
46007
46251
|
for (const trait of traits2) {
|
|
46008
46252
|
const prev = prevStatesRef.current.get(trait.id);
|
|
46009
46253
|
if (prev && prev !== trait.currentState) {
|
|
@@ -46172,10 +46416,10 @@ function VerifyModePanel({
|
|
|
46172
46416
|
localCount
|
|
46173
46417
|
}) {
|
|
46174
46418
|
const { t } = useTranslate();
|
|
46175
|
-
const [expanded, setExpanded] =
|
|
46176
|
-
const scrollRef =
|
|
46177
|
-
const prevCountRef =
|
|
46178
|
-
|
|
46419
|
+
const [expanded, setExpanded] = React105.useState(true);
|
|
46420
|
+
const scrollRef = React105.useRef(null);
|
|
46421
|
+
const prevCountRef = React105.useRef(0);
|
|
46422
|
+
React105.useEffect(() => {
|
|
46179
46423
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
46180
46424
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
46181
46425
|
}
|
|
@@ -46232,10 +46476,10 @@ function RuntimeDebugger({
|
|
|
46232
46476
|
schema
|
|
46233
46477
|
}) {
|
|
46234
46478
|
const { t } = useTranslate();
|
|
46235
|
-
const [isCollapsed, setIsCollapsed] =
|
|
46236
|
-
const [isVisible, setIsVisible] =
|
|
46479
|
+
const [isCollapsed, setIsCollapsed] = React105.useState(mode === "verify" ? true : defaultCollapsed);
|
|
46480
|
+
const [isVisible, setIsVisible] = React105.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
46237
46481
|
const debugData = useDebugData();
|
|
46238
|
-
|
|
46482
|
+
React105.useEffect(() => {
|
|
46239
46483
|
if (mode === "inline") return;
|
|
46240
46484
|
return onDebugToggle((enabled) => {
|
|
46241
46485
|
setIsVisible(enabled);
|
|
@@ -46244,7 +46488,7 @@ function RuntimeDebugger({
|
|
|
46244
46488
|
}
|
|
46245
46489
|
});
|
|
46246
46490
|
}, [mode]);
|
|
46247
|
-
|
|
46491
|
+
React105.useEffect(() => {
|
|
46248
46492
|
if (mode === "inline") return;
|
|
46249
46493
|
const handleKeyDown = (e) => {
|
|
46250
46494
|
if (e.key === "`" && isVisible) {
|
|
@@ -46764,7 +47008,7 @@ var init_StatCard = __esm({
|
|
|
46764
47008
|
const labelToUse = propLabel ?? propTitle;
|
|
46765
47009
|
const eventBus = useEventBus();
|
|
46766
47010
|
const { t } = useTranslate();
|
|
46767
|
-
const handleActionClick =
|
|
47011
|
+
const handleActionClick = React105__default.useCallback(() => {
|
|
46768
47012
|
if (action?.event) {
|
|
46769
47013
|
eventBus.emit(`UI:${action.event}`, {});
|
|
46770
47014
|
}
|
|
@@ -46775,7 +47019,7 @@ var init_StatCard = __esm({
|
|
|
46775
47019
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
46776
47020
|
const isLoading = externalLoading ?? false;
|
|
46777
47021
|
const error = externalError;
|
|
46778
|
-
const computeMetricValue =
|
|
47022
|
+
const computeMetricValue = React105__default.useCallback(
|
|
46779
47023
|
(metric, items) => {
|
|
46780
47024
|
if (metric.value !== void 0) {
|
|
46781
47025
|
return metric.value;
|
|
@@ -46814,7 +47058,7 @@ var init_StatCard = __esm({
|
|
|
46814
47058
|
},
|
|
46815
47059
|
[]
|
|
46816
47060
|
);
|
|
46817
|
-
const schemaStats =
|
|
47061
|
+
const schemaStats = React105__default.useMemo(() => {
|
|
46818
47062
|
if (!metrics || metrics.length === 0) return null;
|
|
46819
47063
|
return metrics.map((metric) => ({
|
|
46820
47064
|
label: metric.label,
|
|
@@ -46822,7 +47066,7 @@ var init_StatCard = __esm({
|
|
|
46822
47066
|
format: metric.format
|
|
46823
47067
|
}));
|
|
46824
47068
|
}, [metrics, data, computeMetricValue]);
|
|
46825
|
-
const calculatedTrend =
|
|
47069
|
+
const calculatedTrend = React105__default.useMemo(() => {
|
|
46826
47070
|
if (manualTrend !== void 0) return manualTrend;
|
|
46827
47071
|
if (previousValue === void 0 || currentValue === void 0)
|
|
46828
47072
|
return void 0;
|
|
@@ -47462,8 +47706,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
47462
47706
|
] });
|
|
47463
47707
|
};
|
|
47464
47708
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
47465
|
-
const endRef =
|
|
47466
|
-
|
|
47709
|
+
const endRef = React105__default.useRef(null);
|
|
47710
|
+
React105__default.useEffect(() => {
|
|
47467
47711
|
if (!autoScroll) return;
|
|
47468
47712
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
47469
47713
|
}, [activities.length, autoScroll]);
|
|
@@ -47557,7 +47801,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
47557
47801
|
};
|
|
47558
47802
|
SubagentRichCard = ({ subagent }) => {
|
|
47559
47803
|
const { t } = useTranslate();
|
|
47560
|
-
const activities =
|
|
47804
|
+
const activities = React105__default.useMemo(
|
|
47561
47805
|
() => subagentMessagesToActivities(subagent.messages),
|
|
47562
47806
|
[subagent.messages]
|
|
47563
47807
|
);
|
|
@@ -47634,8 +47878,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
47634
47878
|
] });
|
|
47635
47879
|
};
|
|
47636
47880
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
47637
|
-
const endRef =
|
|
47638
|
-
|
|
47881
|
+
const endRef = React105__default.useRef(null);
|
|
47882
|
+
React105__default.useEffect(() => {
|
|
47639
47883
|
if (!autoScroll) return;
|
|
47640
47884
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
47641
47885
|
}, [messages.length, autoScroll]);
|
|
@@ -48065,7 +48309,7 @@ var init_Timeline = __esm({
|
|
|
48065
48309
|
}) => {
|
|
48066
48310
|
const { t } = useTranslate();
|
|
48067
48311
|
const entityData = entity ?? [];
|
|
48068
|
-
const items =
|
|
48312
|
+
const items = React105__default.useMemo(() => {
|
|
48069
48313
|
if (propItems) return propItems;
|
|
48070
48314
|
if (entityData.length === 0) return [];
|
|
48071
48315
|
return entityData.map((record, idx) => {
|
|
@@ -48167,7 +48411,7 @@ var init_Timeline = __esm({
|
|
|
48167
48411
|
}
|
|
48168
48412
|
});
|
|
48169
48413
|
function extractToastProps(children) {
|
|
48170
|
-
if (!
|
|
48414
|
+
if (!React105__default.isValidElement(children)) {
|
|
48171
48415
|
if (typeof children === "string") {
|
|
48172
48416
|
return { message: children };
|
|
48173
48417
|
}
|
|
@@ -48209,7 +48453,7 @@ var init_ToastSlot = __esm({
|
|
|
48209
48453
|
eventBus.emit(`${prefix}CLOSE`);
|
|
48210
48454
|
};
|
|
48211
48455
|
if (!isVisible) return null;
|
|
48212
|
-
const isCustomContent =
|
|
48456
|
+
const isCustomContent = React105__default.isValidElement(children) && !message;
|
|
48213
48457
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
48214
48458
|
Toast,
|
|
48215
48459
|
{
|
|
@@ -48226,7 +48470,7 @@ var init_ToastSlot = __esm({
|
|
|
48226
48470
|
}
|
|
48227
48471
|
});
|
|
48228
48472
|
function lazyThree(name, loader) {
|
|
48229
|
-
const Lazy =
|
|
48473
|
+
const Lazy = React105__default.lazy(
|
|
48230
48474
|
() => loader().then((m) => {
|
|
48231
48475
|
const Resolved = m[name];
|
|
48232
48476
|
if (!Resolved) {
|
|
@@ -48238,13 +48482,13 @@ function lazyThree(name, loader) {
|
|
|
48238
48482
|
})
|
|
48239
48483
|
);
|
|
48240
48484
|
function ThreeWrapper(props) {
|
|
48241
|
-
return
|
|
48485
|
+
return React105__default.createElement(
|
|
48242
48486
|
ThreeBoundary,
|
|
48243
48487
|
{ name },
|
|
48244
|
-
|
|
48245
|
-
|
|
48488
|
+
React105__default.createElement(
|
|
48489
|
+
React105__default.Suspense,
|
|
48246
48490
|
{ fallback: null },
|
|
48247
|
-
|
|
48491
|
+
React105__default.createElement(Lazy, props)
|
|
48248
48492
|
)
|
|
48249
48493
|
);
|
|
48250
48494
|
}
|
|
@@ -48267,6 +48511,7 @@ var init_component_registry_generated = __esm({
|
|
|
48267
48511
|
init_AnimatedReveal();
|
|
48268
48512
|
init_ArticleSection();
|
|
48269
48513
|
init_Aside();
|
|
48514
|
+
init_AtlasImage();
|
|
48270
48515
|
init_AuthLayout();
|
|
48271
48516
|
init_Avatar();
|
|
48272
48517
|
init_Badge();
|
|
@@ -48524,7 +48769,7 @@ var init_component_registry_generated = __esm({
|
|
|
48524
48769
|
init_WizardContainer();
|
|
48525
48770
|
init_WizardNavigation();
|
|
48526
48771
|
init_WizardProgress();
|
|
48527
|
-
ThreeBoundary = class extends
|
|
48772
|
+
ThreeBoundary = class extends React105__default.Component {
|
|
48528
48773
|
constructor() {
|
|
48529
48774
|
super(...arguments);
|
|
48530
48775
|
__publicField(this, "state", { failed: false });
|
|
@@ -48534,7 +48779,7 @@ var init_component_registry_generated = __esm({
|
|
|
48534
48779
|
}
|
|
48535
48780
|
render() {
|
|
48536
48781
|
if (this.state.failed) {
|
|
48537
|
-
return
|
|
48782
|
+
return React105__default.createElement(
|
|
48538
48783
|
"div",
|
|
48539
48784
|
{
|
|
48540
48785
|
"data-testid": "three-unavailable",
|
|
@@ -48566,6 +48811,8 @@ var init_component_registry_generated = __esm({
|
|
|
48566
48811
|
"AnimatedReveal": AnimatedReveal,
|
|
48567
48812
|
"ArticleSection": ArticleSection,
|
|
48568
48813
|
"Aside": Aside,
|
|
48814
|
+
"AtlasImage": AtlasImage,
|
|
48815
|
+
"AtlasPanel": AtlasPanel,
|
|
48569
48816
|
"AuthLayout": AuthLayout,
|
|
48570
48817
|
"Avatar": Avatar,
|
|
48571
48818
|
"Badge": Badge,
|
|
@@ -48858,7 +49105,7 @@ function SuspenseConfigProvider({
|
|
|
48858
49105
|
config,
|
|
48859
49106
|
children
|
|
48860
49107
|
}) {
|
|
48861
|
-
return
|
|
49108
|
+
return React105__default.createElement(
|
|
48862
49109
|
SuspenseConfigContext.Provider,
|
|
48863
49110
|
{ value: config },
|
|
48864
49111
|
children
|
|
@@ -48900,7 +49147,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
48900
49147
|
}
|
|
48901
49148
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
48902
49149
|
}
|
|
48903
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
49150
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React105__default.isValidElement(field) && !(field instanceof Date)) {
|
|
48904
49151
|
const obj = field;
|
|
48905
49152
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
48906
49153
|
if (!fieldName) return field;
|
|
@@ -49353,7 +49600,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
49353
49600
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
49354
49601
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
49355
49602
|
}
|
|
49356
|
-
return /* @__PURE__ */ jsx(
|
|
49603
|
+
return /* @__PURE__ */ jsx(React105__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
49357
49604
|
}
|
|
49358
49605
|
if (!child || typeof child !== "object") return null;
|
|
49359
49606
|
const childId = `${parentId}-${index}`;
|
|
@@ -49393,14 +49640,14 @@ function isPatternConfig(value) {
|
|
|
49393
49640
|
if (value === null || value === void 0) return false;
|
|
49394
49641
|
if (typeof value !== "object") return false;
|
|
49395
49642
|
if (Array.isArray(value)) return false;
|
|
49396
|
-
if (
|
|
49643
|
+
if (React105__default.isValidElement(value)) return false;
|
|
49397
49644
|
if (value instanceof Date) return false;
|
|
49398
49645
|
if (typeof value === "function") return false;
|
|
49399
49646
|
const record = value;
|
|
49400
49647
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
49401
49648
|
}
|
|
49402
49649
|
function isPlainConfigObject(value) {
|
|
49403
|
-
if (
|
|
49650
|
+
if (React105__default.isValidElement(value)) return false;
|
|
49404
49651
|
if (value instanceof Date) return false;
|
|
49405
49652
|
const proto = Object.getPrototypeOf(value);
|
|
49406
49653
|
return proto === Object.prototype || proto === null;
|
|
@@ -49526,7 +49773,7 @@ function SlotContentRenderer({
|
|
|
49526
49773
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
49527
49774
|
const slotVal = restProps[slotKey];
|
|
49528
49775
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
49529
|
-
if (
|
|
49776
|
+
if (React105__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
49530
49777
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
49531
49778
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
49532
49779
|
slotVal,
|
|
@@ -49575,7 +49822,7 @@ function SlotContentRenderer({
|
|
|
49575
49822
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
49576
49823
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
49577
49824
|
const sample = resolvedItems[0];
|
|
49578
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
49825
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React105__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
49579
49826
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
49580
49827
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
49581
49828
|
}
|
|
@@ -49736,7 +49983,9 @@ var init_UISlotRenderer = __esm({
|
|
|
49736
49983
|
"content",
|
|
49737
49984
|
"addons",
|
|
49738
49985
|
"hud",
|
|
49739
|
-
"fallback"
|
|
49986
|
+
"fallback",
|
|
49987
|
+
"controls",
|
|
49988
|
+
"overlay"
|
|
49740
49989
|
]);
|
|
49741
49990
|
PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
|
|
49742
49991
|
"stack",
|
|
@@ -49938,7 +50187,7 @@ var AvlTransition = ({
|
|
|
49938
50187
|
opacity = 1,
|
|
49939
50188
|
className
|
|
49940
50189
|
}) => {
|
|
49941
|
-
const ids =
|
|
50190
|
+
const ids = React105__default.useMemo(() => {
|
|
49942
50191
|
avlTransitionId += 1;
|
|
49943
50192
|
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
49944
50193
|
}, []);
|
|
@@ -50499,7 +50748,7 @@ var AvlStateMachine = ({
|
|
|
50499
50748
|
color = "var(--color-primary)",
|
|
50500
50749
|
animated = false
|
|
50501
50750
|
}) => {
|
|
50502
|
-
const ids =
|
|
50751
|
+
const ids = React105__default.useMemo(() => {
|
|
50503
50752
|
avlSmId += 1;
|
|
50504
50753
|
const base = `avl-sm-${avlSmId}`;
|
|
50505
50754
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -50698,7 +50947,7 @@ var AvlOrbitalUnit = ({
|
|
|
50698
50947
|
color = "var(--color-primary)",
|
|
50699
50948
|
animated = false
|
|
50700
50949
|
}) => {
|
|
50701
|
-
const ids =
|
|
50950
|
+
const ids = React105__default.useMemo(() => {
|
|
50702
50951
|
avlOuId += 1;
|
|
50703
50952
|
const base = `avl-ou-${avlOuId}`;
|
|
50704
50953
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -50794,7 +51043,7 @@ var AvlClosedCircuit = ({
|
|
|
50794
51043
|
color = "var(--color-primary)",
|
|
50795
51044
|
animated = false
|
|
50796
51045
|
}) => {
|
|
50797
|
-
const ids =
|
|
51046
|
+
const ids = React105__default.useMemo(() => {
|
|
50798
51047
|
avlCcId += 1;
|
|
50799
51048
|
const base = `avl-cc-${avlCcId}`;
|
|
50800
51049
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -50949,7 +51198,7 @@ var AvlEmitListen = ({
|
|
|
50949
51198
|
color = "var(--color-primary)",
|
|
50950
51199
|
animated = false
|
|
50951
51200
|
}) => {
|
|
50952
|
-
const ids =
|
|
51201
|
+
const ids = React105__default.useMemo(() => {
|
|
50953
51202
|
avlElId += 1;
|
|
50954
51203
|
const base = `avl-el-${avlElId}`;
|
|
50955
51204
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -51223,7 +51472,7 @@ function renderNode(node, color, glowId) {
|
|
|
51223
51472
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
51224
51473
|
const r2 = Math.max(baseR, labelLen * 3.5 + 6);
|
|
51225
51474
|
const nc = nodeColor(node.type, color);
|
|
51226
|
-
return /* @__PURE__ */ jsxs(
|
|
51475
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
51227
51476
|
node.children.map((child, i) => {
|
|
51228
51477
|
const childR = Math.max(
|
|
51229
51478
|
child.type === "operator" ? 20 : 16,
|
|
@@ -51280,7 +51529,7 @@ var AvlExprTree = ({
|
|
|
51280
51529
|
className,
|
|
51281
51530
|
color = "var(--color-primary)"
|
|
51282
51531
|
}) => {
|
|
51283
|
-
const ids =
|
|
51532
|
+
const ids = React105__default.useMemo(() => {
|
|
51284
51533
|
avlEtId += 1;
|
|
51285
51534
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
51286
51535
|
}, []);
|
|
@@ -52115,7 +52364,7 @@ var SystemNode = ({ data }) => {
|
|
|
52115
52364
|
stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
|
|
52116
52365
|
const tc = transitionCounts[s.name] ?? 0;
|
|
52117
52366
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
52118
|
-
return /* @__PURE__ */ jsxs(
|
|
52367
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
52119
52368
|
/* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
|
|
52120
52369
|
i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
|
|
52121
52370
|
] }, s.name);
|
|
@@ -53260,7 +53509,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
53260
53509
|
if (Array.isArray(body)) {
|
|
53261
53510
|
return body.map((b) => recur(b));
|
|
53262
53511
|
}
|
|
53263
|
-
if (body !== null && typeof body === "object" && !
|
|
53512
|
+
if (body !== null && typeof body === "object" && !React105__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
53264
53513
|
const out = {};
|
|
53265
53514
|
for (const [k, v] of Object.entries(body)) {
|
|
53266
53515
|
out[k] = recur(v);
|
|
@@ -53279,7 +53528,7 @@ function getSlotContentRenderer2() {
|
|
|
53279
53528
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
53280
53529
|
return (item, index) => {
|
|
53281
53530
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
53282
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
53531
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React105__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
53283
53532
|
return null;
|
|
53284
53533
|
}
|
|
53285
53534
|
const record = resolvedBody;
|
|
@@ -53298,7 +53547,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
53298
53547
|
props: childProps,
|
|
53299
53548
|
priority: 0
|
|
53300
53549
|
};
|
|
53301
|
-
return
|
|
53550
|
+
return React105__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
53302
53551
|
};
|
|
53303
53552
|
}
|
|
53304
53553
|
function convertNode(node, callerKey) {
|
|
@@ -53317,7 +53566,7 @@ function convertNode(node, callerKey) {
|
|
|
53317
53566
|
});
|
|
53318
53567
|
return anyChanged ? mapped : node;
|
|
53319
53568
|
}
|
|
53320
|
-
if (typeof node === "object" && !
|
|
53569
|
+
if (typeof node === "object" && !React105__default.isValidElement(node) && !(node instanceof Date)) {
|
|
53321
53570
|
return convertObjectProps(node);
|
|
53322
53571
|
}
|
|
53323
53572
|
return node;
|
|
@@ -54952,8 +55201,8 @@ function CanvasDndProvider({
|
|
|
54952
55201
|
}) {
|
|
54953
55202
|
const eventBus = useEventBus();
|
|
54954
55203
|
const sensors = useAlmadarDndSensors(false);
|
|
54955
|
-
const [activePayload, setActivePayload] =
|
|
54956
|
-
const handleDragStart =
|
|
55204
|
+
const [activePayload, setActivePayload] = React105__default.useState(null);
|
|
55205
|
+
const handleDragStart = React105__default.useCallback((e) => {
|
|
54957
55206
|
const data = e.active.data.current;
|
|
54958
55207
|
const payload = data?.payload;
|
|
54959
55208
|
if (payload) {
|
|
@@ -54964,7 +55213,7 @@ function CanvasDndProvider({
|
|
|
54964
55213
|
log9.warn("dragStart:missing-payload", { id: e.active.id });
|
|
54965
55214
|
}
|
|
54966
55215
|
}, [eventBus]);
|
|
54967
|
-
const handleDragEnd =
|
|
55216
|
+
const handleDragEnd = React105__default.useCallback((e) => {
|
|
54968
55217
|
setActivePayload(null);
|
|
54969
55218
|
const activeData = e.active.data.current;
|
|
54970
55219
|
const payload = activeData?.payload;
|
|
@@ -54993,7 +55242,7 @@ function CanvasDndProvider({
|
|
|
54993
55242
|
const suppressed = onDrop ? onDrop(drop) === true : false;
|
|
54994
55243
|
if (!suppressed) defaultEmit(eventBus, drop);
|
|
54995
55244
|
}, [eventBus, onDrop]);
|
|
54996
|
-
const handleDragCancel =
|
|
55245
|
+
const handleDragCancel = React105__default.useCallback(() => {
|
|
54997
55246
|
setActivePayload(null);
|
|
54998
55247
|
log9.info("dragCancel");
|
|
54999
55248
|
}, []);
|
|
@@ -55751,7 +56000,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
55751
56000
|
}
|
|
55752
56001
|
);
|
|
55753
56002
|
};
|
|
55754
|
-
var OrbPreviewNode =
|
|
56003
|
+
var OrbPreviewNode = React105__default.memo(OrbPreviewNodeInner);
|
|
55755
56004
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
55756
56005
|
orbPreviewLog.debug("export-resolved", () => ({
|
|
55757
56006
|
type: typeof OrbPreviewNode,
|
|
@@ -55856,7 +56105,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
55856
56105
|
) })
|
|
55857
56106
|
] });
|
|
55858
56107
|
};
|
|
55859
|
-
var EventFlowEdge =
|
|
56108
|
+
var EventFlowEdge = React105__default.memo(EventFlowEdgeInner);
|
|
55860
56109
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
55861
56110
|
|
|
55862
56111
|
// components/avl/molecules/BehaviorComposeNode.tsx
|
|
@@ -56003,7 +56252,7 @@ var BehaviorComposeNodeInner = (props) => {
|
|
|
56003
56252
|
}
|
|
56004
56253
|
);
|
|
56005
56254
|
};
|
|
56006
|
-
var BehaviorComposeNode =
|
|
56255
|
+
var BehaviorComposeNode = React105__default.memo(BehaviorComposeNodeInner);
|
|
56007
56256
|
BehaviorComposeNode.displayName = "BehaviorComposeNode";
|
|
56008
56257
|
|
|
56009
56258
|
// components/avl/lib/avl-behavior-compose-converter.ts
|
|
@@ -57029,7 +57278,7 @@ var TraitCardNodeInner = (props) => {
|
|
|
57029
57278
|
}
|
|
57030
57279
|
);
|
|
57031
57280
|
};
|
|
57032
|
-
var TraitCardNode =
|
|
57281
|
+
var TraitCardNode = React105__default.memo(TraitCardNodeInner);
|
|
57033
57282
|
TraitCardNode.displayName = "TraitCardNode";
|
|
57034
57283
|
|
|
57035
57284
|
// components/avl/organisms/FlowCanvas.tsx
|
|
@@ -57102,7 +57351,7 @@ function FlowCanvasInner({
|
|
|
57102
57351
|
initialOrbital
|
|
57103
57352
|
);
|
|
57104
57353
|
const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
|
|
57105
|
-
const screenSizeUserOverrideRef =
|
|
57354
|
+
const screenSizeUserOverrideRef = React105__default.useRef(false);
|
|
57106
57355
|
const [screenSize, setScreenSize] = useState(
|
|
57107
57356
|
() => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
|
|
57108
57357
|
);
|
|
@@ -57486,7 +57735,7 @@ var ZoomBreadcrumb = ({
|
|
|
57486
57735
|
if (eventName && band === "detail") {
|
|
57487
57736
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
57488
57737
|
}
|
|
57489
|
-
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(
|
|
57738
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
57490
57739
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
57491
57740
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
57492
57741
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -57827,7 +58076,7 @@ var EventWireOverlay = ({
|
|
|
57827
58076
|
containerW,
|
|
57828
58077
|
containerH
|
|
57829
58078
|
}) => {
|
|
57830
|
-
const ids =
|
|
58079
|
+
const ids = React105__default.useMemo(() => {
|
|
57831
58080
|
avlOczWireId += 1;
|
|
57832
58081
|
return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
|
|
57833
58082
|
}, []);
|
|
@@ -58194,7 +58443,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
58194
58443
|
borderRadius: 6,
|
|
58195
58444
|
border: `1px solid ${color}`
|
|
58196
58445
|
},
|
|
58197
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
58446
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
58198
58447
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
58199
58448
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
58200
58449
|
Box,
|