@almadar/ui 5.134.0 → 5.135.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 +1262 -1419
- package/dist/avl/index.js +317 -474
- package/dist/{cn-D3H9UzCW.d.cts → cn-B8GXqrtp.d.cts} +1 -1
- package/dist/{cn-Dm0VrLRG.d.ts → cn-CZq0uJLA.d.ts} +1 -1
- package/dist/components/index.cjs +93 -260
- package/dist/components/index.d.cts +20 -194
- package/dist/components/index.d.ts +20 -194
- package/dist/components/index.js +94 -256
- package/dist/lib/drawable/three/index.cjs +15 -0
- package/dist/lib/drawable/three/index.d.cts +1 -1
- package/dist/lib/drawable/three/index.d.ts +1 -1
- package/dist/lib/drawable/three/index.js +15 -0
- package/dist/lib/index.cjs +28 -0
- package/dist/lib/index.d.cts +21 -3
- package/dist/lib/index.d.ts +21 -3
- package/dist/lib/index.js +27 -1
- package/dist/{paintDispatch-BXJgISot.d.cts → paintDispatch-Bl2sfRFb.d.cts} +37 -8
- package/dist/{paintDispatch-BXJgISot.d.ts → paintDispatch-Bl2sfRFb.d.ts} +37 -8
- package/dist/providers/index.cjs +1144 -1301
- package/dist/providers/index.js +293 -450
- package/dist/runtime/index.cjs +1123 -1280
- package/dist/runtime/index.js +297 -454
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrbitalSchema, SExpr, Effect, OrbitalVerificationAPI, TraitStateSnapshot, EventPayload, BusEvent, VerificationCheck, BridgeHealth, VerificationSnapshot, VerificationSummary, TransitionTrace, ServerResponseTrace, CheckStatus, AssetLoadStatus } from '@almadar/core';
|
|
2
|
-
import { D as DrawableNode } from './paintDispatch-
|
|
2
|
+
import { D as DrawableNode } from './paintDispatch-Bl2sfRFb.cjs';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrbitalSchema, SExpr, Effect, OrbitalVerificationAPI, TraitStateSnapshot, EventPayload, BusEvent, VerificationCheck, BridgeHealth, VerificationSnapshot, VerificationSummary, TransitionTrace, ServerResponseTrace, CheckStatus, AssetLoadStatus } from '@almadar/core';
|
|
2
|
-
import { D as DrawableNode } from './paintDispatch-
|
|
2
|
+
import { D as DrawableNode } from './paintDispatch-Bl2sfRFb.js';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -4030,6 +4030,32 @@ function formatValue(value, format) {
|
|
|
4030
4030
|
return String(value);
|
|
4031
4031
|
}
|
|
4032
4032
|
}
|
|
4033
|
+
function compareCellValues(a, b) {
|
|
4034
|
+
const aEmpty = a === null || a === void 0 || a === "";
|
|
4035
|
+
const bEmpty = b === null || b === void 0 || b === "";
|
|
4036
|
+
if (aEmpty || bEmpty) return aEmpty && bEmpty ? 0 : aEmpty ? 1 : -1;
|
|
4037
|
+
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
4038
|
+
if (typeof a === "boolean" && typeof b === "boolean") return Number(a) - Number(b);
|
|
4039
|
+
const aNum = Number(a);
|
|
4040
|
+
const bNum = Number(b);
|
|
4041
|
+
if (Number.isFinite(aNum) && Number.isFinite(bNum)) return aNum - bNum;
|
|
4042
|
+
const aTime = dateLikeTime(a);
|
|
4043
|
+
const bTime = dateLikeTime(b);
|
|
4044
|
+
if (aTime !== null && bTime !== null) return aTime - bTime;
|
|
4045
|
+
return String(a).localeCompare(String(b));
|
|
4046
|
+
}
|
|
4047
|
+
function dateLikeTime(value) {
|
|
4048
|
+
if (value instanceof Date) return value.getTime();
|
|
4049
|
+
const text = String(value);
|
|
4050
|
+
if (!/\d/.test(text) || !/[-/:T]/.test(text)) return null;
|
|
4051
|
+
const time = Date.parse(text);
|
|
4052
|
+
return Number.isNaN(time) ? null : time;
|
|
4053
|
+
}
|
|
4054
|
+
function sortRows(rows2, field, direction = "asc") {
|
|
4055
|
+
if (!field) return rows2;
|
|
4056
|
+
const dir = direction === "desc" ? -1 : 1;
|
|
4057
|
+
return [...rows2].sort((a, b) => dir * compareCellValues(a?.[field], b?.[field]));
|
|
4058
|
+
}
|
|
4033
4059
|
var init_format = __esm({
|
|
4034
4060
|
"lib/format.ts"() {
|
|
4035
4061
|
}
|
|
@@ -15655,6 +15681,15 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
15655
15681
|
ctx.lineWidth = lineWidth;
|
|
15656
15682
|
ctx.stroke();
|
|
15657
15683
|
},
|
|
15684
|
+
fillPath(d, color) {
|
|
15685
|
+
ctx.fillStyle = color;
|
|
15686
|
+
ctx.fill(new Path2D(d));
|
|
15687
|
+
},
|
|
15688
|
+
strokePath(d, color, lineWidth = 1) {
|
|
15689
|
+
ctx.strokeStyle = color;
|
|
15690
|
+
ctx.lineWidth = lineWidth;
|
|
15691
|
+
ctx.stroke(new Path2D(d));
|
|
15692
|
+
},
|
|
15658
15693
|
text(str2, x, y, style) {
|
|
15659
15694
|
if (style.font) ctx.font = style.font;
|
|
15660
15695
|
ctx.fillStyle = style.color;
|
|
@@ -15892,6 +15927,16 @@ var init_DrawShape = __esm({
|
|
|
15892
15927
|
if (node.stroke) painter.strokePoly(pts, node.stroke, node.strokeWidth ?? 1, true);
|
|
15893
15928
|
break;
|
|
15894
15929
|
}
|
|
15930
|
+
case "path": {
|
|
15931
|
+
if (!node.d) break;
|
|
15932
|
+
const base = dctx.projector.project(node.position);
|
|
15933
|
+
const tw = dctx.projector.tileWidth;
|
|
15934
|
+
painter.translate(base.x, base.y);
|
|
15935
|
+
painter.scale(tw, tw);
|
|
15936
|
+
if (node.fill) painter.fillPath(node.d, node.fill);
|
|
15937
|
+
if (node.stroke) painter.strokePath(node.d, node.stroke, (node.strokeWidth ?? 1) / tw);
|
|
15938
|
+
break;
|
|
15939
|
+
}
|
|
15895
15940
|
}
|
|
15896
15941
|
painter.restore();
|
|
15897
15942
|
};
|
|
@@ -15983,6 +16028,19 @@ function paintDrawable(painter, node, dctx) {
|
|
|
15983
16028
|
case "draw-text":
|
|
15984
16029
|
paintText(painter, node, dctx);
|
|
15985
16030
|
break;
|
|
16031
|
+
case "draw-group": {
|
|
16032
|
+
if (!isValidScenePos(node.position)) break;
|
|
16033
|
+
if (!Array.isArray(node.items)) break;
|
|
16034
|
+
const p = dctx.projector.project(node.position);
|
|
16035
|
+
painter.save();
|
|
16036
|
+
painter.translate(p.x, p.y);
|
|
16037
|
+
if (node.scale !== void 0) painter.scale(node.scale, node.scale);
|
|
16038
|
+
if (node.rotate !== void 0) painter.rotate(node.rotate);
|
|
16039
|
+
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
16040
|
+
for (const item of node.items) paintDrawable(painter, item, dctx);
|
|
16041
|
+
painter.restore();
|
|
16042
|
+
break;
|
|
16043
|
+
}
|
|
15986
16044
|
case "draw-sprite-layer":
|
|
15987
16045
|
paintSpriteLayer(painter, node, dctx);
|
|
15988
16046
|
break;
|
|
@@ -15996,6 +16054,7 @@ function paintDrawable(painter, node, dctx) {
|
|
|
15996
16054
|
}
|
|
15997
16055
|
var init_paintDispatch = __esm({
|
|
15998
16056
|
"lib/drawable/paintDispatch.ts"() {
|
|
16057
|
+
init_contract();
|
|
15999
16058
|
init_DrawSprite();
|
|
16000
16059
|
init_DrawShape();
|
|
16001
16060
|
init_DrawText();
|
|
@@ -16013,6 +16072,7 @@ function collectDrawnItems(nodes) {
|
|
|
16013
16072
|
case "draw-sprite":
|
|
16014
16073
|
case "draw-shape":
|
|
16015
16074
|
case "draw-text":
|
|
16075
|
+
case "draw-group":
|
|
16016
16076
|
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
|
|
16017
16077
|
break;
|
|
16018
16078
|
case "draw-sprite-layer":
|
|
@@ -21228,6 +21288,8 @@ function DataList({
|
|
|
21228
21288
|
hasMore,
|
|
21229
21289
|
children,
|
|
21230
21290
|
pageSize = 5,
|
|
21291
|
+
sortBy,
|
|
21292
|
+
sortDirection,
|
|
21231
21293
|
renderItem: schemaRenderItem,
|
|
21232
21294
|
dragGroup,
|
|
21233
21295
|
accepts,
|
|
@@ -21256,7 +21318,11 @@ function DataList({
|
|
|
21256
21318
|
dndItemIdField,
|
|
21257
21319
|
dndRoot
|
|
21258
21320
|
});
|
|
21259
|
-
const
|
|
21321
|
+
const orderedData = dnd.orderedItems;
|
|
21322
|
+
const allData = React74__namespace.default.useMemo(
|
|
21323
|
+
() => sortRows(orderedData, sortBy, sortDirection),
|
|
21324
|
+
[orderedData, sortBy, sortDirection]
|
|
21325
|
+
);
|
|
21260
21326
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
21261
21327
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
21262
21328
|
const hasRenderProp = typeof children === "function";
|
|
@@ -21293,7 +21359,7 @@ function DataList({
|
|
|
21293
21359
|
};
|
|
21294
21360
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
21295
21361
|
};
|
|
21296
|
-
const renderItemActions = (itemData) => {
|
|
21362
|
+
const renderItemActions = (itemData, onPrimary = false) => {
|
|
21297
21363
|
if (!itemActions || itemActions.length === 0) return null;
|
|
21298
21364
|
const inline = maxInlineActions != null ? itemActions.slice(0, maxInlineActions) : itemActions;
|
|
21299
21365
|
const overflow = maxInlineActions != null ? itemActions.slice(maxInlineActions) : [];
|
|
@@ -21306,7 +21372,12 @@ function DataList({
|
|
|
21306
21372
|
onClick: handleActionClick(action, itemData),
|
|
21307
21373
|
"data-testid": `action-${action.event}`,
|
|
21308
21374
|
"data-row-id": String(itemData.id),
|
|
21309
|
-
className: cn(
|
|
21375
|
+
className: cn(
|
|
21376
|
+
action.variant === "danger" && "text-error hover:bg-error/10",
|
|
21377
|
+
// Must sit on the Button itself: the variant's own text colour
|
|
21378
|
+
// beats an inherited one from the row wrapper.
|
|
21379
|
+
onPrimary && "!text-primary-foreground hover:bg-primary-foreground/15"
|
|
21380
|
+
),
|
|
21310
21381
|
children: [
|
|
21311
21382
|
action.icon && renderIconInput2(action.icon, { size: "xs", className: "mr-1" }),
|
|
21312
21383
|
action.label
|
|
@@ -21425,7 +21496,7 @@ function DataList({
|
|
|
21425
21496
|
children: formatDate(timestamp)
|
|
21426
21497
|
}
|
|
21427
21498
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
21428
|
-
renderItemActions(itemData)
|
|
21499
|
+
renderItemActions(itemData, isSent)
|
|
21429
21500
|
] })
|
|
21430
21501
|
]
|
|
21431
21502
|
}
|
|
@@ -26193,210 +26264,6 @@ var init_DialogueBubble = __esm({
|
|
|
26193
26264
|
DialogueBubble.displayName = "DialogueBubble";
|
|
26194
26265
|
}
|
|
26195
26266
|
});
|
|
26196
|
-
function SvgStage({
|
|
26197
|
-
cols,
|
|
26198
|
-
rows: rows2,
|
|
26199
|
-
tileSize = 32,
|
|
26200
|
-
background = "var(--color-background)",
|
|
26201
|
-
tileClickEvent,
|
|
26202
|
-
tileHoverEvent,
|
|
26203
|
-
tileLeaveEvent,
|
|
26204
|
-
keyMap,
|
|
26205
|
-
keyUpMap,
|
|
26206
|
-
className,
|
|
26207
|
-
children
|
|
26208
|
-
}) {
|
|
26209
|
-
const eventBus = useEventBus();
|
|
26210
|
-
const svgRef = React74.useRef(null);
|
|
26211
|
-
const pointerDownRef = React74.useRef(null);
|
|
26212
|
-
const cellFromClient = React74.useCallback((clientX, clientY) => {
|
|
26213
|
-
const svg = svgRef.current;
|
|
26214
|
-
if (!svg) return null;
|
|
26215
|
-
const rect = svg.getBoundingClientRect();
|
|
26216
|
-
if (rect.width === 0 || rect.height === 0) return null;
|
|
26217
|
-
const vbW = cols * tileSize;
|
|
26218
|
-
const vbH = rows2 * tileSize;
|
|
26219
|
-
const meet = Math.min(rect.width / vbW, rect.height / vbH);
|
|
26220
|
-
const offsetX = (rect.width - vbW * meet) / 2;
|
|
26221
|
-
const offsetY = (rect.height - vbH * meet) / 2;
|
|
26222
|
-
const svgX = (clientX - rect.left - offsetX) / meet;
|
|
26223
|
-
const svgY = (clientY - rect.top - offsetY) / meet;
|
|
26224
|
-
return {
|
|
26225
|
-
x: Math.min(Math.max(Math.floor(svgX / tileSize), 0), cols - 1),
|
|
26226
|
-
y: Math.min(Math.max(Math.floor(svgY / tileSize), 0), rows2 - 1)
|
|
26227
|
-
};
|
|
26228
|
-
}, [cols, rows2, tileSize]);
|
|
26229
|
-
const handlePointerDown = React74.useCallback((e) => {
|
|
26230
|
-
pointerDownRef.current = { clientX: e.clientX, clientY: e.clientY };
|
|
26231
|
-
}, []);
|
|
26232
|
-
const handlePointerUp = React74.useCallback((e) => {
|
|
26233
|
-
const down = pointerDownRef.current;
|
|
26234
|
-
pointerDownRef.current = null;
|
|
26235
|
-
if (!tileClickEvent) return;
|
|
26236
|
-
if (down && Math.hypot(e.clientX - down.clientX, e.clientY - down.clientY) > 5) return;
|
|
26237
|
-
const cell = cellFromClient(e.clientX, e.clientY);
|
|
26238
|
-
if (cell) eventBus.emit(`UI:${tileClickEvent}`, cell);
|
|
26239
|
-
}, [cellFromClient, tileClickEvent, eventBus]);
|
|
26240
|
-
const handlePointerMove = React74.useCallback((e) => {
|
|
26241
|
-
if (!tileHoverEvent) return;
|
|
26242
|
-
const cell = cellFromClient(e.clientX, e.clientY);
|
|
26243
|
-
if (cell) eventBus.emit(`UI:${tileHoverEvent}`, cell);
|
|
26244
|
-
}, [cellFromClient, tileHoverEvent, eventBus]);
|
|
26245
|
-
const handlePointerLeave = React74.useCallback(() => {
|
|
26246
|
-
pointerDownRef.current = null;
|
|
26247
|
-
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
26248
|
-
}, [tileLeaveEvent, eventBus]);
|
|
26249
|
-
React74.useEffect(() => {
|
|
26250
|
-
if (!keyMap && !keyUpMap) return;
|
|
26251
|
-
const onDown = (e) => {
|
|
26252
|
-
const ev = keyMap?.[e.code];
|
|
26253
|
-
if (ev) {
|
|
26254
|
-
eventBus.emit(`UI:${ev}`, {});
|
|
26255
|
-
e.preventDefault();
|
|
26256
|
-
}
|
|
26257
|
-
};
|
|
26258
|
-
const onUp = (e) => {
|
|
26259
|
-
const ev = keyUpMap?.[e.code];
|
|
26260
|
-
if (ev) eventBus.emit(`UI:${ev}`, {});
|
|
26261
|
-
};
|
|
26262
|
-
window.addEventListener("keydown", onDown);
|
|
26263
|
-
window.addEventListener("keyup", onUp);
|
|
26264
|
-
return () => {
|
|
26265
|
-
window.removeEventListener("keydown", onDown);
|
|
26266
|
-
window.removeEventListener("keyup", onUp);
|
|
26267
|
-
};
|
|
26268
|
-
}, [keyMap, keyUpMap, eventBus]);
|
|
26269
|
-
React74.useEffect(() => {
|
|
26270
|
-
if (!keyMap && !keyUpMap) return;
|
|
26271
|
-
svgRef.current?.focus();
|
|
26272
|
-
}, [keyMap, keyUpMap]);
|
|
26273
|
-
const stageContext = React74.useMemo(() => ({ tileSize }), [tileSize]);
|
|
26274
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
26275
|
-
"svg",
|
|
26276
|
-
{
|
|
26277
|
-
ref: svgRef,
|
|
26278
|
-
"data-testid": "svg-stage",
|
|
26279
|
-
viewBox: `0 0 ${cols * tileSize} ${rows2 * tileSize}`,
|
|
26280
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
26281
|
-
className: cn("block h-full w-full", className),
|
|
26282
|
-
tabIndex: keyMap || keyUpMap ? 0 : void 0,
|
|
26283
|
-
onPointerDown: handlePointerDown,
|
|
26284
|
-
onPointerMove: handlePointerMove,
|
|
26285
|
-
onPointerUp: handlePointerUp,
|
|
26286
|
-
onPointerLeave: handlePointerLeave,
|
|
26287
|
-
children: [
|
|
26288
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: cols * tileSize, height: rows2 * tileSize, fill: background }),
|
|
26289
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.SvgStageContext.Provider, { value: stageContext, children })
|
|
26290
|
-
]
|
|
26291
|
-
}
|
|
26292
|
-
);
|
|
26293
|
-
}
|
|
26294
|
-
exports.SvgStageContext = void 0;
|
|
26295
|
-
var init_SvgStage = __esm({
|
|
26296
|
-
"components/game/molecules/SvgStage.tsx"() {
|
|
26297
|
-
"use client";
|
|
26298
|
-
init_cn();
|
|
26299
|
-
init_useEventBus();
|
|
26300
|
-
exports.SvgStageContext = React74__namespace.createContext({ tileSize: 1 });
|
|
26301
|
-
SvgStage.displayName = "SvgStage";
|
|
26302
|
-
}
|
|
26303
|
-
});
|
|
26304
|
-
function SvgDrawShape({
|
|
26305
|
-
shape,
|
|
26306
|
-
x,
|
|
26307
|
-
y,
|
|
26308
|
-
width,
|
|
26309
|
-
height,
|
|
26310
|
-
radius,
|
|
26311
|
-
radiusY,
|
|
26312
|
-
points,
|
|
26313
|
-
d,
|
|
26314
|
-
x2,
|
|
26315
|
-
y2,
|
|
26316
|
-
fill,
|
|
26317
|
-
stroke,
|
|
26318
|
-
strokeWidth,
|
|
26319
|
-
opacity,
|
|
26320
|
-
className
|
|
26321
|
-
}) {
|
|
26322
|
-
const { tileSize } = React74.useContext(exports.SvgStageContext);
|
|
26323
|
-
const cell = (v) => v === void 0 ? void 0 : v * tileSize;
|
|
26324
|
-
const paint = {
|
|
26325
|
-
fill: fill ?? (stroke === void 0 ? "var(--color-primary)" : "none"),
|
|
26326
|
-
stroke,
|
|
26327
|
-
strokeWidth,
|
|
26328
|
-
opacity,
|
|
26329
|
-
className
|
|
26330
|
-
};
|
|
26331
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x * tileSize} ${y * tileSize})`, children: [
|
|
26332
|
-
shape === "rect" && /* @__PURE__ */ jsxRuntime.jsx("rect", { width: cell(width), height: cell(height), ...paint }),
|
|
26333
|
-
shape === "circle" && /* @__PURE__ */ jsxRuntime.jsx("circle", { r: cell(radius), ...paint }),
|
|
26334
|
-
shape === "ellipse" && /* @__PURE__ */ jsxRuntime.jsx("ellipse", { rx: cell(radius), ry: cell(radiusY ?? radius), ...paint }),
|
|
26335
|
-
shape === "polygon" && /* @__PURE__ */ jsxRuntime.jsx("polygon", { points, ...paint }),
|
|
26336
|
-
shape === "polyline" && /* @__PURE__ */ jsxRuntime.jsx("polyline", { points, ...paint }),
|
|
26337
|
-
shape === "path" && /* @__PURE__ */ jsxRuntime.jsx("path", { d, ...paint }),
|
|
26338
|
-
shape === "line" && /* @__PURE__ */ jsxRuntime.jsx("line", { x2: cell(x2), y2: cell(y2), ...paint })
|
|
26339
|
-
] });
|
|
26340
|
-
}
|
|
26341
|
-
var init_SvgDrawShape = __esm({
|
|
26342
|
-
"components/game/atoms/SvgDrawShape.tsx"() {
|
|
26343
|
-
"use client";
|
|
26344
|
-
init_SvgStage();
|
|
26345
|
-
SvgDrawShape.displayName = "SvgDrawShape";
|
|
26346
|
-
}
|
|
26347
|
-
});
|
|
26348
|
-
function SvgDrawGroup({
|
|
26349
|
-
x = 0,
|
|
26350
|
-
y = 0,
|
|
26351
|
-
scale,
|
|
26352
|
-
rotate,
|
|
26353
|
-
opacity,
|
|
26354
|
-
className,
|
|
26355
|
-
children
|
|
26356
|
-
}) {
|
|
26357
|
-
const { tileSize } = React74.useContext(exports.SvgStageContext);
|
|
26358
|
-
const transforms = [`translate(${x * tileSize} ${y * tileSize})`];
|
|
26359
|
-
if (rotate !== void 0) transforms.push(`rotate(${rotate})`);
|
|
26360
|
-
if (scale !== void 0) transforms.push(`scale(${scale})`);
|
|
26361
|
-
return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: transforms.join(" "), opacity, className, children });
|
|
26362
|
-
}
|
|
26363
|
-
var init_SvgDrawGroup = __esm({
|
|
26364
|
-
"components/game/atoms/SvgDrawGroup.tsx"() {
|
|
26365
|
-
"use client";
|
|
26366
|
-
init_SvgStage();
|
|
26367
|
-
SvgDrawGroup.displayName = "SvgDrawGroup";
|
|
26368
|
-
}
|
|
26369
|
-
});
|
|
26370
|
-
function SvgDrawText({
|
|
26371
|
-
x,
|
|
26372
|
-
y,
|
|
26373
|
-
text,
|
|
26374
|
-
size = 12,
|
|
26375
|
-
fill = "var(--color-foreground)",
|
|
26376
|
-
anchor = "middle",
|
|
26377
|
-
className
|
|
26378
|
-
}) {
|
|
26379
|
-
const { tileSize } = React74.useContext(exports.SvgStageContext);
|
|
26380
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26381
|
-
"text",
|
|
26382
|
-
{
|
|
26383
|
-
x: x * tileSize,
|
|
26384
|
-
y: y * tileSize,
|
|
26385
|
-
fontSize: size,
|
|
26386
|
-
fill,
|
|
26387
|
-
textAnchor: anchor,
|
|
26388
|
-
className,
|
|
26389
|
-
children: text
|
|
26390
|
-
}
|
|
26391
|
-
);
|
|
26392
|
-
}
|
|
26393
|
-
var init_SvgDrawText = __esm({
|
|
26394
|
-
"components/game/atoms/SvgDrawText.tsx"() {
|
|
26395
|
-
"use client";
|
|
26396
|
-
init_SvgStage();
|
|
26397
|
-
SvgDrawText.displayName = "SvgDrawText";
|
|
26398
|
-
}
|
|
26399
|
-
});
|
|
26400
26267
|
function StatBadge({
|
|
26401
26268
|
assetUrl,
|
|
26402
26269
|
iconUrl,
|
|
@@ -26887,32 +26754,6 @@ var init_StateGraph = __esm({
|
|
|
26887
26754
|
init_TransitionArrow();
|
|
26888
26755
|
}
|
|
26889
26756
|
});
|
|
26890
|
-
function SvgDrawShapeLayer({
|
|
26891
|
-
items,
|
|
26892
|
-
fill,
|
|
26893
|
-
stroke,
|
|
26894
|
-
strokeWidth,
|
|
26895
|
-
opacity
|
|
26896
|
-
}) {
|
|
26897
|
-
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: items.map(({ id, ...shape }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
26898
|
-
SvgDrawShape,
|
|
26899
|
-
{
|
|
26900
|
-
...shape,
|
|
26901
|
-
fill: shape.fill ?? fill,
|
|
26902
|
-
stroke: shape.stroke ?? stroke,
|
|
26903
|
-
strokeWidth: shape.strokeWidth ?? strokeWidth,
|
|
26904
|
-
opacity: shape.opacity ?? opacity
|
|
26905
|
-
},
|
|
26906
|
-
id
|
|
26907
|
-
)) });
|
|
26908
|
-
}
|
|
26909
|
-
var init_SvgDrawShapeLayer = __esm({
|
|
26910
|
-
"components/game/molecules/SvgDrawShapeLayer.tsx"() {
|
|
26911
|
-
"use client";
|
|
26912
|
-
init_SvgDrawShape();
|
|
26913
|
-
SvgDrawShapeLayer.displayName = "SvgDrawShapeLayer";
|
|
26914
|
-
}
|
|
26915
|
-
});
|
|
26916
26757
|
function unitAtlasUrl(unit) {
|
|
26917
26758
|
return unit.spriteSheet?.url ?? null;
|
|
26918
26759
|
}
|
|
@@ -28380,9 +28221,6 @@ var init_molecules = __esm({
|
|
|
28380
28221
|
init_TimerDisplay();
|
|
28381
28222
|
init_DialogueBubble();
|
|
28382
28223
|
init_ChoiceButton();
|
|
28383
|
-
init_SvgDrawShape();
|
|
28384
|
-
init_SvgDrawGroup();
|
|
28385
|
-
init_SvgDrawText();
|
|
28386
28224
|
init_ControlGrid();
|
|
28387
28225
|
init_StatBadge();
|
|
28388
28226
|
init_GameHud();
|
|
@@ -28390,8 +28228,6 @@ var init_molecules = __esm({
|
|
|
28390
28228
|
init_StateGraph();
|
|
28391
28229
|
init_Canvas2D();
|
|
28392
28230
|
init_Canvas();
|
|
28393
|
-
init_SvgDrawShapeLayer();
|
|
28394
|
-
init_SvgStage();
|
|
28395
28231
|
init_useUnitSpriteAtlas();
|
|
28396
28232
|
init_GameAudioToggle();
|
|
28397
28233
|
init_useGameAudio();
|
|
@@ -29009,13 +28845,13 @@ var init_MapView = __esm({
|
|
|
29009
28845
|
shadowSize: [41, 41]
|
|
29010
28846
|
});
|
|
29011
28847
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29012
|
-
const { useEffect:
|
|
28848
|
+
const { useEffect: useEffect65, useRef: useRef63, useCallback: useCallback106, useState: useState102 } = React74__namespace.default;
|
|
29013
28849
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29014
28850
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29015
28851
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
29016
28852
|
const map = useMap();
|
|
29017
|
-
const prevRef =
|
|
29018
|
-
|
|
28853
|
+
const prevRef = useRef63({ centerLat, centerLng, zoom });
|
|
28854
|
+
useEffect65(() => {
|
|
29019
28855
|
const prev = prevRef.current;
|
|
29020
28856
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
29021
28857
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -29026,7 +28862,7 @@ var init_MapView = __esm({
|
|
|
29026
28862
|
}
|
|
29027
28863
|
function MapClickHandler({ onMapClick }) {
|
|
29028
28864
|
const map = useMap();
|
|
29029
|
-
|
|
28865
|
+
useEffect65(() => {
|
|
29030
28866
|
if (!onMapClick) return;
|
|
29031
28867
|
const handler = (e) => {
|
|
29032
28868
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -29055,7 +28891,7 @@ var init_MapView = __esm({
|
|
|
29055
28891
|
}) {
|
|
29056
28892
|
const eventBus = useEventBus2();
|
|
29057
28893
|
const [clickedPosition, setClickedPosition] = useState102(null);
|
|
29058
|
-
const handleMapClick =
|
|
28894
|
+
const handleMapClick = useCallback106((lat, lng) => {
|
|
29059
28895
|
if (showClickedPin) {
|
|
29060
28896
|
setClickedPosition({ lat, lng });
|
|
29061
28897
|
}
|
|
@@ -29064,7 +28900,7 @@ var init_MapView = __esm({
|
|
|
29064
28900
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
29065
28901
|
}
|
|
29066
28902
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
29067
|
-
const handleMarkerClick =
|
|
28903
|
+
const handleMarkerClick = useCallback106((marker) => {
|
|
29068
28904
|
onMarkerClick?.(marker);
|
|
29069
28905
|
if (markerClickEvent) {
|
|
29070
28906
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -39839,6 +39675,16 @@ var init_DetailPanel = __esm({
|
|
|
39839
39675
|
exports.DetailPanel.displayName = "DetailPanel";
|
|
39840
39676
|
}
|
|
39841
39677
|
});
|
|
39678
|
+
|
|
39679
|
+
// components/game/atoms/DrawGroup.tsx
|
|
39680
|
+
function DrawGroup(_props) {
|
|
39681
|
+
return null;
|
|
39682
|
+
}
|
|
39683
|
+
var init_DrawGroup = __esm({
|
|
39684
|
+
"components/game/atoms/DrawGroup.tsx"() {
|
|
39685
|
+
"use client";
|
|
39686
|
+
}
|
|
39687
|
+
});
|
|
39842
39688
|
function extractTitle(children) {
|
|
39843
39689
|
if (!React74__namespace.default.isValidElement(children)) return void 0;
|
|
39844
39690
|
const props = children.props;
|
|
@@ -45542,6 +45388,7 @@ var init_component_registry_generated = __esm({
|
|
|
45542
45388
|
init_DocSidebar();
|
|
45543
45389
|
init_DocTOC();
|
|
45544
45390
|
init_DocumentViewer();
|
|
45391
|
+
init_DrawGroup();
|
|
45545
45392
|
init_DrawShape();
|
|
45546
45393
|
init_DrawShapeLayer();
|
|
45547
45394
|
init_DrawSprite();
|
|
@@ -45685,10 +45532,6 @@ var init_component_registry_generated = __esm({
|
|
|
45685
45532
|
init_SubagentTracePanel();
|
|
45686
45533
|
init_SvgBranch();
|
|
45687
45534
|
init_SvgConnection();
|
|
45688
|
-
init_SvgDrawGroup();
|
|
45689
|
-
init_SvgDrawShape();
|
|
45690
|
-
init_SvgDrawShapeLayer();
|
|
45691
|
-
init_SvgDrawText();
|
|
45692
45535
|
init_SvgFlow();
|
|
45693
45536
|
init_SvgGrid();
|
|
45694
45537
|
init_SvgLobe();
|
|
@@ -45699,7 +45542,6 @@ var init_component_registry_generated = __esm({
|
|
|
45699
45542
|
init_SvgRing();
|
|
45700
45543
|
init_SvgShield();
|
|
45701
45544
|
init_SvgStack();
|
|
45702
|
-
init_SvgStage();
|
|
45703
45545
|
init_SwipeableRow();
|
|
45704
45546
|
init_Switch();
|
|
45705
45547
|
init_TabbedContainer();
|
|
@@ -45813,6 +45655,7 @@ var init_component_registry_generated = __esm({
|
|
|
45813
45655
|
"DocSidebar": exports.DocSidebar,
|
|
45814
45656
|
"DocTOC": exports.DocTOC,
|
|
45815
45657
|
"DocumentViewer": exports.DocumentViewer,
|
|
45658
|
+
"DrawGroup": DrawGroup,
|
|
45816
45659
|
"DrawShape": DrawShape,
|
|
45817
45660
|
"DrawShapeLayer": DrawShapeLayer,
|
|
45818
45661
|
"DrawSprite": DrawSprite,
|
|
@@ -45961,10 +45804,6 @@ var init_component_registry_generated = __esm({
|
|
|
45961
45804
|
"SubagentTracePanel": exports.SubagentTracePanel,
|
|
45962
45805
|
"SvgBranch": exports.SvgBranch,
|
|
45963
45806
|
"SvgConnection": exports.SvgConnection,
|
|
45964
|
-
"SvgDrawGroup": SvgDrawGroup,
|
|
45965
|
-
"SvgDrawShape": SvgDrawShape,
|
|
45966
|
-
"SvgDrawShapeLayer": SvgDrawShapeLayer,
|
|
45967
|
-
"SvgDrawText": SvgDrawText,
|
|
45968
45807
|
"SvgFlow": exports.SvgFlow,
|
|
45969
45808
|
"SvgGrid": exports.SvgGrid,
|
|
45970
45809
|
"SvgLobe": exports.SvgLobe,
|
|
@@ -45975,7 +45814,6 @@ var init_component_registry_generated = __esm({
|
|
|
45975
45814
|
"SvgRing": exports.SvgRing,
|
|
45976
45815
|
"SvgShield": exports.SvgShield,
|
|
45977
45816
|
"SvgStack": exports.SvgStack,
|
|
45978
|
-
"SvgStage": SvgStage,
|
|
45979
45817
|
"SwipeableRow": exports.SwipeableRow,
|
|
45980
45818
|
"Switch": exports.Switch,
|
|
45981
45819
|
"TabbedContainer": exports.TabbedContainer,
|
|
@@ -49492,11 +49330,6 @@ exports.StateGraph = StateGraph;
|
|
|
49492
49330
|
exports.StateJsonView = StateJsonView;
|
|
49493
49331
|
exports.StateNode = StateNode2;
|
|
49494
49332
|
exports.StatusBar = StatusBar;
|
|
49495
|
-
exports.SvgDrawGroup = SvgDrawGroup;
|
|
49496
|
-
exports.SvgDrawShape = SvgDrawShape;
|
|
49497
|
-
exports.SvgDrawShapeLayer = SvgDrawShapeLayer;
|
|
49498
|
-
exports.SvgDrawText = SvgDrawText;
|
|
49499
|
-
exports.SvgStage = SvgStage;
|
|
49500
49333
|
exports.TableView = TableView;
|
|
49501
49334
|
exports.TerrainPalette = TerrainPalette;
|
|
49502
49335
|
exports.TimeSlotCell = TimeSlotCell;
|