@almadar/ui 5.139.0 → 5.140.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 +190 -53
- package/dist/avl/index.js +190 -53
- package/dist/{cn-CL0kdshO.d.cts → cn-DkGYzPOg.d.cts} +1 -1
- package/dist/{cn-CCaph5o9.d.ts → cn-Do5Ra3l3.d.ts} +1 -1
- package/dist/components/index.cjs +190 -53
- package/dist/components/index.d.cts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +190 -53
- package/dist/lib/drawable/three/index.d.cts +1 -1
- package/dist/lib/drawable/three/index.d.ts +1 -1
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/{paintDispatch-DXygiK7M.d.cts → paintDispatch-B5pPeSEp.d.cts} +74 -1
- package/dist/{paintDispatch-DXygiK7M.d.ts → paintDispatch-B5pPeSEp.d.ts} +74 -1
- package/dist/providers/index.cjs +190 -53
- package/dist/providers/index.js +190 -53
- package/dist/runtime/index.cjs +190 -53
- package/dist/runtime/index.js +190 -53
- package/package.json +3 -3
|
@@ -15707,6 +15707,12 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
15707
15707
|
for (let i = 1; i < points.length; i++) ctx.lineTo(points[i].x, points[i].y);
|
|
15708
15708
|
if (closed) ctx.closePath();
|
|
15709
15709
|
};
|
|
15710
|
+
const toCanvasStyle = (style) => {
|
|
15711
|
+
if (typeof style === "string") return style;
|
|
15712
|
+
const g = style.kind === "linear" ? ctx.createLinearGradient(style.x1, style.y1, style.x2, style.y2) : ctx.createRadialGradient(style.cx, style.cy, 0, style.cx, style.cy, style.r);
|
|
15713
|
+
for (const stop of style.stops) g.addColorStop(stop.offset, stop.color);
|
|
15714
|
+
return g;
|
|
15715
|
+
};
|
|
15710
15716
|
return {
|
|
15711
15717
|
setViewport(width, height, dpr) {
|
|
15712
15718
|
vw = width;
|
|
@@ -15760,47 +15766,47 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
15760
15766
|
ctx.drawImage(img, dest.x, dest.y, dw, dh);
|
|
15761
15767
|
}
|
|
15762
15768
|
},
|
|
15763
|
-
fillRect(x, y, w, h,
|
|
15764
|
-
ctx.fillStyle =
|
|
15769
|
+
fillRect(x, y, w, h, style) {
|
|
15770
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
15765
15771
|
ctx.fillRect(x, y, w, h);
|
|
15766
15772
|
},
|
|
15767
|
-
strokeRect(x, y, w, h,
|
|
15768
|
-
ctx.strokeStyle =
|
|
15773
|
+
strokeRect(x, y, w, h, style, lineWidth = 1) {
|
|
15774
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
15769
15775
|
ctx.lineWidth = lineWidth;
|
|
15770
15776
|
ctx.strokeRect(x, y, w, h);
|
|
15771
15777
|
},
|
|
15772
|
-
fillPoly(points,
|
|
15778
|
+
fillPoly(points, style) {
|
|
15773
15779
|
if (points.length === 0) return;
|
|
15774
15780
|
tracePoly(points, true);
|
|
15775
|
-
ctx.fillStyle =
|
|
15781
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
15776
15782
|
ctx.fill();
|
|
15777
15783
|
},
|
|
15778
|
-
strokePoly(points,
|
|
15784
|
+
strokePoly(points, style, lineWidth = 1, closed = false) {
|
|
15779
15785
|
if (points.length === 0) return;
|
|
15780
15786
|
tracePoly(points, closed);
|
|
15781
|
-
ctx.strokeStyle =
|
|
15787
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
15782
15788
|
ctx.lineWidth = lineWidth;
|
|
15783
15789
|
ctx.stroke();
|
|
15784
15790
|
},
|
|
15785
|
-
fillEllipse(cx, cy, rx, ry,
|
|
15791
|
+
fillEllipse(cx, cy, rx, ry, style) {
|
|
15786
15792
|
ctx.beginPath();
|
|
15787
15793
|
ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
|
|
15788
|
-
ctx.fillStyle =
|
|
15794
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
15789
15795
|
ctx.fill();
|
|
15790
15796
|
},
|
|
15791
|
-
strokeEllipse(cx, cy, rx, ry,
|
|
15797
|
+
strokeEllipse(cx, cy, rx, ry, style, lineWidth = 1) {
|
|
15792
15798
|
ctx.beginPath();
|
|
15793
15799
|
ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
|
|
15794
|
-
ctx.strokeStyle =
|
|
15800
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
15795
15801
|
ctx.lineWidth = lineWidth;
|
|
15796
15802
|
ctx.stroke();
|
|
15797
15803
|
},
|
|
15798
|
-
fillPath(d,
|
|
15799
|
-
ctx.fillStyle =
|
|
15804
|
+
fillPath(d, style) {
|
|
15805
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
15800
15806
|
ctx.fill(new Path2D(d));
|
|
15801
15807
|
},
|
|
15802
|
-
strokePath(d,
|
|
15803
|
-
ctx.strokeStyle =
|
|
15808
|
+
strokePath(d, style, lineWidth = 1) {
|
|
15809
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
15804
15810
|
ctx.lineWidth = lineWidth;
|
|
15805
15811
|
ctx.stroke(new Path2D(d));
|
|
15806
15812
|
},
|
|
@@ -16037,6 +16043,84 @@ var init_registry = __esm({
|
|
|
16037
16043
|
DrawableRegistryContext = React76.createContext(null);
|
|
16038
16044
|
}
|
|
16039
16045
|
});
|
|
16046
|
+
function isAnimatedShape(node) {
|
|
16047
|
+
return Boolean(node.animation && node.animation.durationMs > 0 && node.animation.keyframes.length > 0);
|
|
16048
|
+
}
|
|
16049
|
+
function applyShapeAnimation(node, timeMs) {
|
|
16050
|
+
const anim = node.animation;
|
|
16051
|
+
if (!anim || !(anim.durationMs > 0) || anim.keyframes.length === 0) return node;
|
|
16052
|
+
const frames = [...anim.keyframes].sort((a, b) => a.at - b.at);
|
|
16053
|
+
const cycle = timeMs / anim.durationMs;
|
|
16054
|
+
const t = anim.loop === false ? Math.min(cycle, 1) : cycle - Math.floor(cycle);
|
|
16055
|
+
const out = { ...node };
|
|
16056
|
+
const trackValue = (key) => {
|
|
16057
|
+
const defined = frames.filter((f3) => f3[key] !== void 0);
|
|
16058
|
+
if (defined.length === 0) return void 0;
|
|
16059
|
+
let prev;
|
|
16060
|
+
let next;
|
|
16061
|
+
for (const f3 of defined) {
|
|
16062
|
+
if (f3.at <= t) prev = f3;
|
|
16063
|
+
else if (!next) next = f3;
|
|
16064
|
+
}
|
|
16065
|
+
if (!prev) return defined[0][key];
|
|
16066
|
+
if (!next) return prev[key];
|
|
16067
|
+
const span = next.at - prev.at;
|
|
16068
|
+
const k = span > 0 ? (t - prev.at) / span : 1;
|
|
16069
|
+
const a = prev[key];
|
|
16070
|
+
const b = next[key];
|
|
16071
|
+
if (typeof a === "number" && typeof b === "number") return lerp(a, b, k);
|
|
16072
|
+
return a;
|
|
16073
|
+
};
|
|
16074
|
+
for (const key of NUMERIC_TRACKS) {
|
|
16075
|
+
const v = trackValue(key);
|
|
16076
|
+
if (v !== void 0) out[key] = v;
|
|
16077
|
+
}
|
|
16078
|
+
const fill = trackValue("fill");
|
|
16079
|
+
if (fill !== void 0) out.fill = fill;
|
|
16080
|
+
const stroke = trackValue("stroke");
|
|
16081
|
+
if (stroke !== void 0) out.stroke = stroke;
|
|
16082
|
+
const shadowFrames = frames.filter((f3) => f3.shadow !== void 0);
|
|
16083
|
+
if (shadowFrames.length > 0) {
|
|
16084
|
+
const sh = trackValue("shadow");
|
|
16085
|
+
if (sh !== void 0) {
|
|
16086
|
+
let prevSh;
|
|
16087
|
+
let nextSh;
|
|
16088
|
+
for (const f3 of shadowFrames) {
|
|
16089
|
+
if (f3.at <= t) prevSh = f3;
|
|
16090
|
+
else if (!nextSh) nextSh = f3;
|
|
16091
|
+
}
|
|
16092
|
+
if (prevSh?.shadow && nextSh?.shadow) {
|
|
16093
|
+
const span = nextSh.at - prevSh.at;
|
|
16094
|
+
const k = span > 0 ? (t - prevSh.at) / span : 1;
|
|
16095
|
+
out.shadow = { color: prevSh.shadow.color, blur: lerp(prevSh.shadow.blur, nextSh.shadow.blur, k) };
|
|
16096
|
+
} else {
|
|
16097
|
+
out.shadow = sh;
|
|
16098
|
+
}
|
|
16099
|
+
}
|
|
16100
|
+
}
|
|
16101
|
+
return out;
|
|
16102
|
+
}
|
|
16103
|
+
function gradientStyle(g, ox, oy, scale) {
|
|
16104
|
+
if (g.kind === "linear") {
|
|
16105
|
+
if (!g.from || !g.to) return void 0;
|
|
16106
|
+
return {
|
|
16107
|
+
kind: "linear",
|
|
16108
|
+
x1: ox + g.from.x * scale,
|
|
16109
|
+
y1: oy + g.from.y * scale,
|
|
16110
|
+
x2: ox + g.to.x * scale,
|
|
16111
|
+
y2: oy + g.to.y * scale,
|
|
16112
|
+
stops: g.stops
|
|
16113
|
+
};
|
|
16114
|
+
}
|
|
16115
|
+
if (!g.center || g.radius === void 0) return void 0;
|
|
16116
|
+
return {
|
|
16117
|
+
kind: "radial",
|
|
16118
|
+
cx: ox + g.center.x * scale,
|
|
16119
|
+
cy: oy + g.center.y * scale,
|
|
16120
|
+
r: g.radius * scale,
|
|
16121
|
+
stops: g.stops
|
|
16122
|
+
};
|
|
16123
|
+
}
|
|
16040
16124
|
function DrawShape(props) {
|
|
16041
16125
|
const register = React76.useContext(DrawableRegistryContext);
|
|
16042
16126
|
if (register) {
|
|
@@ -16047,25 +16131,51 @@ function DrawShape(props) {
|
|
|
16047
16131
|
...opacity !== void 0 && opacity > 0 ? { opacity } : {}
|
|
16048
16132
|
};
|
|
16049
16133
|
register(node);
|
|
16050
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-draw-shape-debug": "", style: { position: "absolute", width: 4, height: 4, background: "red", zIndex: 9999 } });
|
|
16051
16134
|
}
|
|
16052
16135
|
return null;
|
|
16053
16136
|
}
|
|
16054
|
-
var paintShape;
|
|
16137
|
+
var NUMERIC_TRACKS, lerp, paintShape;
|
|
16055
16138
|
var init_DrawShape = __esm({
|
|
16056
16139
|
"components/game/atoms/DrawShape.tsx"() {
|
|
16057
16140
|
"use client";
|
|
16058
16141
|
init_contract();
|
|
16059
16142
|
init_registry();
|
|
16060
|
-
|
|
16143
|
+
NUMERIC_TRACKS = [
|
|
16144
|
+
"offsetX",
|
|
16145
|
+
"offsetY",
|
|
16146
|
+
"rotate",
|
|
16147
|
+
"opacity",
|
|
16148
|
+
"radiusX",
|
|
16149
|
+
"radiusY",
|
|
16150
|
+
"width",
|
|
16151
|
+
"height",
|
|
16152
|
+
"strokeWidth"
|
|
16153
|
+
];
|
|
16154
|
+
lerp = (a, b, k) => a + (b - a) * k;
|
|
16155
|
+
paintShape = (painter, rawNode, dctx) => {
|
|
16156
|
+
const node = dctx.time > 0 ? applyShapeAnimation(rawNode, dctx.time) : rawNode;
|
|
16061
16157
|
if (!isValidScenePos(node.position)) return;
|
|
16062
16158
|
painter.save();
|
|
16063
16159
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
16160
|
+
const origin = dctx.projector.project(node.position);
|
|
16161
|
+
const tileWidth = dctx.projector.tileWidth;
|
|
16162
|
+
if (node.rotate) {
|
|
16163
|
+
const pivot = node.pivot ?? { x: 0.5, y: 0.5 };
|
|
16164
|
+
const px = origin.x + pivot.x * tileWidth;
|
|
16165
|
+
const py = origin.y + pivot.y * tileWidth;
|
|
16166
|
+
painter.translate(px, py);
|
|
16167
|
+
painter.rotate(node.rotate);
|
|
16168
|
+
painter.translate(-px, -py);
|
|
16169
|
+
}
|
|
16170
|
+
if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth });
|
|
16171
|
+
const fill = node.fill === "none" ? void 0 : node.fill;
|
|
16172
|
+
const stroke = node.stroke === "none" ? void 0 : node.stroke;
|
|
16173
|
+
const pxFill = node.gradient ? gradientStyle(node.gradient, origin.x, origin.y, tileWidth) ?? fill : fill;
|
|
16064
16174
|
switch (node.shape) {
|
|
16065
16175
|
case "cell": {
|
|
16066
16176
|
const pts = dctx.projector.cellPath(node.position);
|
|
16067
|
-
if (
|
|
16068
|
-
if (
|
|
16177
|
+
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
16178
|
+
if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
|
|
16069
16179
|
break;
|
|
16070
16180
|
}
|
|
16071
16181
|
case "rect": {
|
|
@@ -16075,8 +16185,8 @@ var init_DrawShape = __esm({
|
|
|
16075
16185
|
const y = p.y + (node.offsetY ?? 0) * tw;
|
|
16076
16186
|
const w = (node.width ?? 0) * tw;
|
|
16077
16187
|
const h = (node.height ?? 0) * tw;
|
|
16078
|
-
if (
|
|
16079
|
-
if (
|
|
16188
|
+
if (pxFill) painter.fillRect(x, y, w, h, pxFill);
|
|
16189
|
+
if (stroke) painter.strokeRect(x, y, w, h, stroke, node.strokeWidth ?? 1);
|
|
16080
16190
|
break;
|
|
16081
16191
|
}
|
|
16082
16192
|
case "ellipse": {
|
|
@@ -16086,26 +16196,26 @@ var init_DrawShape = __esm({
|
|
|
16086
16196
|
const cy = p.y + (node.offsetY ?? 0) * tw;
|
|
16087
16197
|
const rx = (node.radiusX ?? 0) * tw;
|
|
16088
16198
|
const ry = (node.radiusY ?? rx) * tw;
|
|
16089
|
-
if (
|
|
16090
|
-
if (
|
|
16199
|
+
if (pxFill) painter.fillEllipse(cx, cy, rx, ry, pxFill);
|
|
16200
|
+
if (stroke) painter.strokeEllipse(cx, cy, rx, ry, stroke, node.strokeWidth ?? 1);
|
|
16091
16201
|
break;
|
|
16092
16202
|
}
|
|
16093
16203
|
case "poly": {
|
|
16094
|
-
const
|
|
16095
|
-
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
if (
|
|
16204
|
+
const pts = (node.points ?? []).map((pt) => ({
|
|
16205
|
+
x: origin.x + ((node.offsetX ?? 0) + pt.x) * tileWidth,
|
|
16206
|
+
y: origin.y + ((node.offsetY ?? 0) + pt.y) * tileWidth
|
|
16207
|
+
}));
|
|
16208
|
+
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
16209
|
+
if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
|
|
16099
16210
|
break;
|
|
16100
16211
|
}
|
|
16101
16212
|
case "path": {
|
|
16102
16213
|
if (!node.d) break;
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
painter.
|
|
16107
|
-
if (
|
|
16108
|
-
if (node.stroke) painter.strokePath(node.d, node.stroke, (node.strokeWidth ?? 1) / tw);
|
|
16214
|
+
painter.translate(origin.x + (node.offsetX ?? 0) * tileWidth, origin.y + (node.offsetY ?? 0) * tileWidth);
|
|
16215
|
+
painter.scale(tileWidth, tileWidth);
|
|
16216
|
+
const localFill = node.gradient ? gradientStyle(node.gradient, 0, 0, 1) ?? fill : fill;
|
|
16217
|
+
if (localFill) painter.fillPath(node.d, localFill);
|
|
16218
|
+
if (stroke) painter.strokePath(node.d, stroke, (node.strokeWidth ?? 1) / tileWidth);
|
|
16109
16219
|
break;
|
|
16110
16220
|
}
|
|
16111
16221
|
}
|
|
@@ -16317,7 +16427,6 @@ function Canvas2D({
|
|
|
16317
16427
|
childDrawablesRef.current.push(node);
|
|
16318
16428
|
}, []);
|
|
16319
16429
|
const hasJsxChildren = React76__namespace.Children.count(children) > 0;
|
|
16320
|
-
drawables && drawables.length > 0 ? drawables : childDrawablesRef.current;
|
|
16321
16430
|
function isDrawableLayer(node) {
|
|
16322
16431
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
16323
16432
|
}
|
|
@@ -16466,11 +16575,24 @@ function Canvas2D({
|
|
|
16466
16575
|
}, [showMinimap, scenePositions]);
|
|
16467
16576
|
const miniMapWidth = gridExtent.width || 10;
|
|
16468
16577
|
const miniMapHeight = gridExtent.height || 10;
|
|
16469
|
-
const
|
|
16578
|
+
const drawableIsAnimated = (node) => {
|
|
16579
|
+
if (node.type === "draw-shape") return isAnimatedShape(node);
|
|
16580
|
+
if (node.type === "draw-group") return Array.isArray(node.items) && node.items.some(drawableIsAnimated);
|
|
16581
|
+
if (node.type === "draw-shape-layer") return Array.isArray(node.items) && node.items.some(isAnimatedShape);
|
|
16582
|
+
return false;
|
|
16583
|
+
};
|
|
16584
|
+
const animRafRef = React76.useRef(0);
|
|
16585
|
+
const drawTimeRef = React76.useRef(() => void 0);
|
|
16586
|
+
const draw = React76.useCallback((timeMs = 0) => {
|
|
16470
16587
|
const canvas = canvasRef.current;
|
|
16471
16588
|
if (!canvas) return;
|
|
16472
16589
|
const ctx = canvas.getContext("2d");
|
|
16473
16590
|
if (!ctx) return;
|
|
16591
|
+
const scheduleAnimation = (nodes) => {
|
|
16592
|
+
if (!nodes.some(drawableIsAnimated)) return;
|
|
16593
|
+
cancelAnimationFrame(animRafRef.current);
|
|
16594
|
+
animRafRef.current = requestAnimationFrame(() => drawTimeRef.current(performance.now()));
|
|
16595
|
+
};
|
|
16474
16596
|
const dpr = window.devicePixelRatio || 1;
|
|
16475
16597
|
canvas.width = viewportSize.width * dpr;
|
|
16476
16598
|
canvas.height = viewportSize.height * dpr;
|
|
@@ -16503,14 +16625,24 @@ function Canvas2D({
|
|
|
16503
16625
|
if (!drawables || drawables.length === 0) {
|
|
16504
16626
|
const childDrawables = childDrawablesRef.current;
|
|
16505
16627
|
if (childDrawables.length === 0) return;
|
|
16628
|
+
const cam0 = cameraRef.current;
|
|
16629
|
+
if (camera !== "follow" && dragDistance() === 0) {
|
|
16630
|
+
const focus = cameraPos ?? defaultGridFocus;
|
|
16631
|
+
if (focus) {
|
|
16632
|
+
const p = projector.anchorPoint(focus, "center");
|
|
16633
|
+
cam0.x = p.x - viewportSize.width / 2;
|
|
16634
|
+
cam0.y = p.y - viewportSize.height / 2;
|
|
16635
|
+
}
|
|
16636
|
+
}
|
|
16506
16637
|
const painter0 = createWebPainter(ctx, bumpAtlas);
|
|
16507
16638
|
painter0.save();
|
|
16508
16639
|
painter0.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
16509
|
-
painter0.scale(
|
|
16510
|
-
painter0.translate(-viewportSize.width / 2, -viewportSize.height / 2);
|
|
16511
|
-
const dctx0 = { projector, time:
|
|
16640
|
+
painter0.scale(cam0.zoom, cam0.zoom);
|
|
16641
|
+
painter0.translate(-viewportSize.width / 2 - cam0.x, -viewportSize.height / 2 - cam0.y);
|
|
16642
|
+
const dctx0 = { projector, time: timeMs, invalidate: bumpAtlas };
|
|
16512
16643
|
for (const node of childDrawables) paintDrawable(painter0, node, dctx0);
|
|
16513
16644
|
painter0.restore();
|
|
16645
|
+
scheduleAnimation(childDrawables);
|
|
16514
16646
|
return;
|
|
16515
16647
|
}
|
|
16516
16648
|
const cam = cameraRef.current;
|
|
@@ -16530,10 +16662,15 @@ function Canvas2D({
|
|
|
16530
16662
|
painter.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
16531
16663
|
painter.scale(cam.zoom, cam.zoom);
|
|
16532
16664
|
painter.translate(-viewportSize.width / 2 - cam.x, -viewportSize.height / 2 - cam.y);
|
|
16533
|
-
const dctx = { projector, time:
|
|
16665
|
+
const dctx = { projector, time: timeMs, invalidate: bumpAtlas };
|
|
16534
16666
|
for (const node of drawables) paintDrawable(painter, node, dctx);
|
|
16535
16667
|
painter.restore();
|
|
16668
|
+
scheduleAnimation(drawables);
|
|
16536
16669
|
}, [viewportSize, backgroundImage, bgColor, drawables, projector, cameraRef, bumpAtlas, getImage, cameraPos, defaultGridFocus, camera, dragDistance]);
|
|
16670
|
+
React76.useEffect(() => {
|
|
16671
|
+
drawTimeRef.current = draw;
|
|
16672
|
+
}, [draw]);
|
|
16673
|
+
React76.useEffect(() => () => cancelAnimationFrame(animRafRef.current), []);
|
|
16537
16674
|
React76.useEffect(() => {
|
|
16538
16675
|
if (camera !== "follow" || !followTarget) return;
|
|
16539
16676
|
const p = projector.anchorPoint(followTarget, "center");
|
|
@@ -16756,15 +16893,7 @@ function Canvas2D({
|
|
|
16756
16893
|
mapHeight: miniMapHeight
|
|
16757
16894
|
}
|
|
16758
16895
|
) }),
|
|
16759
|
-
hasJsxChildren && /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children })
|
|
16760
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-debug": "", style: { position: "absolute", top: 0, left: 0, background: "yellow", color: "black", zIndex: 9999, fontSize: 24, padding: 8 }, children: [
|
|
16761
|
-
"C=",
|
|
16762
|
-
React76__namespace.Children.count(children),
|
|
16763
|
-
" J=",
|
|
16764
|
-
String(hasJsxChildren),
|
|
16765
|
-
" D=",
|
|
16766
|
-
drawables?.length ?? -1
|
|
16767
|
-
] })
|
|
16896
|
+
hasJsxChildren && /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children })
|
|
16768
16897
|
]
|
|
16769
16898
|
}
|
|
16770
16899
|
) });
|
|
@@ -16789,6 +16918,7 @@ var init_Canvas2D = __esm({
|
|
|
16789
16918
|
init_webPainter2d();
|
|
16790
16919
|
init_projector();
|
|
16791
16920
|
init_paintDispatch();
|
|
16921
|
+
init_DrawShape();
|
|
16792
16922
|
init_registry();
|
|
16793
16923
|
init_hitTest();
|
|
16794
16924
|
init_isometric();
|
|
@@ -46969,8 +47099,13 @@ function SlotContentRenderer({
|
|
|
46969
47099
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
46970
47100
|
const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
|
|
46971
47101
|
const isDrawHost = patterns.isDrawHostPattern(content.pattern);
|
|
47102
|
+
const arr = Array.isArray(childrenConfig) ? childrenConfig : childrenConfig ? [childrenConfig] : [];
|
|
47103
|
+
const hasTraitChildren = arr.some(
|
|
47104
|
+
(c) => typeof c === "string" && TRAIT_BINDING_RE.test(c)
|
|
47105
|
+
);
|
|
47106
|
+
const drawHostUsesReactChildren = isDrawHost && hasTraitChildren;
|
|
46972
47107
|
const myPath = patternPath ?? "root";
|
|
46973
|
-
const renderedChildren = hasChildren && !isDrawHost ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
47108
|
+
const renderedChildren = hasChildren && (!isDrawHost || drawHostUsesReactChildren) ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
46974
47109
|
slot: content.slot,
|
|
46975
47110
|
transitionEvent: content.transitionEvent,
|
|
46976
47111
|
fromState: content.fromState,
|
|
@@ -47031,7 +47166,7 @@ function SlotContentRenderer({
|
|
|
47031
47166
|
for (const [k, v] of Object.entries(nodeSlotOverrides)) {
|
|
47032
47167
|
finalProps[k] = v;
|
|
47033
47168
|
}
|
|
47034
|
-
if (isDrawHost && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
|
|
47169
|
+
if (isDrawHost && !drawHostUsesReactChildren && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
|
|
47035
47170
|
finalProps.drawables = toDrawableNodes(childrenConfig);
|
|
47036
47171
|
}
|
|
47037
47172
|
const entityVal = finalProps.entity;
|
|
@@ -47210,6 +47345,8 @@ var init_UISlotRenderer = __esm({
|
|
|
47210
47345
|
"vstack",
|
|
47211
47346
|
"hstack",
|
|
47212
47347
|
"box",
|
|
47348
|
+
"canvas",
|
|
47349
|
+
"canvas-2d",
|
|
47213
47350
|
"grid",
|
|
47214
47351
|
"center",
|
|
47215
47352
|
"card",
|
|
@@ -8,9 +8,9 @@ export { A as AudioManifest, G as GameAudioContext, a as GameAudioContextValue,
|
|
|
8
8
|
import { SExpr } from '@almadar/evaluator';
|
|
9
9
|
import { U as UnitAnimationState, F as FacingDirection, S as SpriteSheetUrls, d as SpriteFrameDims, R as ResolvedFrame, a as IsometricUnit, C as CameraState, e as FieldInfo, f as OrbitalTraitInfo, g as OrbitalPageInfo, T as TraitLevelData, E as ExternalLink } from '../avl-schema-parser-B8Onmfsu.cjs';
|
|
10
10
|
export { B as BoardTile, G as GameAction, h as GamePhase, i as GameState, j as GameUnit, b as IsometricFeature, I as IsometricTile, P as Position, k as UnitTrait, l as calculateAttackTargets, m as calculateValidMoves, n as createInitialGameState } from '../avl-schema-parser-B8Onmfsu.cjs';
|
|
11
|
-
import { D as DrawableNode } from '../paintDispatch-
|
|
12
|
-
import { C as ContentSegment, b as DomLayoutData, d as DomStateNode, V as VisualizerConfig, e as DomTransitionLabel } from '../cn-
|
|
13
|
-
export { n as cn } from '../cn-
|
|
11
|
+
import { D as DrawableNode } from '../paintDispatch-B5pPeSEp.cjs';
|
|
12
|
+
import { C as ContentSegment, b as DomLayoutData, d as DomStateNode, V as VisualizerConfig, e as DomTransitionLabel } from '../cn-DkGYzPOg.cjs';
|
|
13
|
+
export { n as cn } from '../cn-DkGYzPOg.cjs';
|
|
14
14
|
import { b as SlotContent } from '../useUISlots-BesZYMks.cjs';
|
|
15
15
|
export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BesZYMks.cjs';
|
|
16
16
|
export { ALMADAR_DND_MIME, AuthContextValue, AuthUser, CanvasGestureCallbacks, CanvasGestureHandlers, CompileResult, CompileStage, DragReorderResult, DraggablePayload, Extension, ExtensionManifest, FileSystemFile, FileSystemStatus, GitHubRepo, GitHubStatus, HistoryChangeSummary, HistoryTimelineItem, I18nContextValue, I18nProvider, InfiniteScrollOptions, InfiniteScrollResult, LongPressHandlers, LongPressOptions, OpenFile, Positioned, PullToRefreshOptions, PullToRefreshResult, QuerySingletonEntity, QuerySingletonResult, QuerySingletonState, QueryState, RenderInterpolationHandle, RenderInterpolationOptions, RevertResult, SelectedFile, SharedEntityStore, SharedEntityStoreContext, SharedEntitySubscriber, SharedEntityWriter, SwipeGestureOptions, SwipeGestureResult, SwipeHandlers, TapRevealOptions, TapRevealResult, TraitListenSpec, TranslateFunction, UseCanvasGesturesOptions, UseCompileResult, UseDraggableOptions, UseDraggableResult, UseDropZoneOptions, UseDropZoneResult, UseExtensionsOptions, UseExtensionsResult, UseFileEditorOptions, UseFileEditorResult, UseFileSystemResult, UseOrbitalHistoryOptions, UseOrbitalHistoryResult, createSharedEntityStore, createTranslate, parseQueryBinding, runTickFrame, useAgentChat, useAuthContext, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInfiniteScroll, useLongPress, useMediaQuery, useOrbitalHistory, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate, useUIEvents, useValidation } from '../hooks/index.cjs';
|
|
@@ -8,9 +8,9 @@ export { A as AudioManifest, G as GameAudioContext, a as GameAudioContextValue,
|
|
|
8
8
|
import { SExpr } from '@almadar/evaluator';
|
|
9
9
|
import { U as UnitAnimationState, F as FacingDirection, S as SpriteSheetUrls, d as SpriteFrameDims, R as ResolvedFrame, a as IsometricUnit, C as CameraState, e as FieldInfo, f as OrbitalTraitInfo, g as OrbitalPageInfo, T as TraitLevelData, E as ExternalLink } from '../avl-schema-parser-B8Onmfsu.js';
|
|
10
10
|
export { B as BoardTile, G as GameAction, h as GamePhase, i as GameState, j as GameUnit, b as IsometricFeature, I as IsometricTile, P as Position, k as UnitTrait, l as calculateAttackTargets, m as calculateValidMoves, n as createInitialGameState } from '../avl-schema-parser-B8Onmfsu.js';
|
|
11
|
-
import { D as DrawableNode } from '../paintDispatch-
|
|
12
|
-
import { C as ContentSegment, b as DomLayoutData, d as DomStateNode, V as VisualizerConfig, e as DomTransitionLabel } from '../cn-
|
|
13
|
-
export { n as cn } from '../cn-
|
|
11
|
+
import { D as DrawableNode } from '../paintDispatch-B5pPeSEp.js';
|
|
12
|
+
import { C as ContentSegment, b as DomLayoutData, d as DomStateNode, V as VisualizerConfig, e as DomTransitionLabel } from '../cn-Do5Ra3l3.js';
|
|
13
|
+
export { n as cn } from '../cn-Do5Ra3l3.js';
|
|
14
14
|
import { b as SlotContent } from '../useUISlots-BesZYMks.js';
|
|
15
15
|
export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BesZYMks.js';
|
|
16
16
|
export { ALMADAR_DND_MIME, AuthContextValue, AuthUser, CanvasGestureCallbacks, CanvasGestureHandlers, CompileResult, CompileStage, DragReorderResult, DraggablePayload, Extension, ExtensionManifest, FileSystemFile, FileSystemStatus, GitHubRepo, GitHubStatus, HistoryChangeSummary, HistoryTimelineItem, I18nContextValue, I18nProvider, InfiniteScrollOptions, InfiniteScrollResult, LongPressHandlers, LongPressOptions, OpenFile, Positioned, PullToRefreshOptions, PullToRefreshResult, QuerySingletonEntity, QuerySingletonResult, QuerySingletonState, QueryState, RenderInterpolationHandle, RenderInterpolationOptions, RevertResult, SelectedFile, SharedEntityStore, SharedEntityStoreContext, SharedEntitySubscriber, SharedEntityWriter, SwipeGestureOptions, SwipeGestureResult, SwipeHandlers, TapRevealOptions, TapRevealResult, TraitListenSpec, TranslateFunction, UseCanvasGesturesOptions, UseCompileResult, UseDraggableOptions, UseDraggableResult, UseDropZoneOptions, UseDropZoneResult, UseExtensionsOptions, UseExtensionsResult, UseFileEditorOptions, UseFileEditorResult, UseFileSystemResult, UseOrbitalHistoryOptions, UseOrbitalHistoryResult, createSharedEntityStore, createTranslate, parseQueryBinding, runTickFrame, useAgentChat, useAuthContext, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInfiniteScroll, useLongPress, useMediaQuery, useOrbitalHistory, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate, useUIEvents, useValidation } from '../hooks/index.js';
|