@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
package/dist/avl/index.js
CHANGED
|
@@ -12563,6 +12563,12 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
12563
12563
|
for (let i = 1; i < points.length; i++) ctx.lineTo(points[i].x, points[i].y);
|
|
12564
12564
|
if (closed) ctx.closePath();
|
|
12565
12565
|
};
|
|
12566
|
+
const toCanvasStyle = (style) => {
|
|
12567
|
+
if (typeof style === "string") return style;
|
|
12568
|
+
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);
|
|
12569
|
+
for (const stop of style.stops) g.addColorStop(stop.offset, stop.color);
|
|
12570
|
+
return g;
|
|
12571
|
+
};
|
|
12566
12572
|
return {
|
|
12567
12573
|
setViewport(width, height, dpr) {
|
|
12568
12574
|
vw = width;
|
|
@@ -12616,47 +12622,47 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
12616
12622
|
ctx.drawImage(img, dest.x, dest.y, dw, dh);
|
|
12617
12623
|
}
|
|
12618
12624
|
},
|
|
12619
|
-
fillRect(x, y, w, h,
|
|
12620
|
-
ctx.fillStyle =
|
|
12625
|
+
fillRect(x, y, w, h, style) {
|
|
12626
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
12621
12627
|
ctx.fillRect(x, y, w, h);
|
|
12622
12628
|
},
|
|
12623
|
-
strokeRect(x, y, w, h,
|
|
12624
|
-
ctx.strokeStyle =
|
|
12629
|
+
strokeRect(x, y, w, h, style, lineWidth = 1) {
|
|
12630
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
12625
12631
|
ctx.lineWidth = lineWidth;
|
|
12626
12632
|
ctx.strokeRect(x, y, w, h);
|
|
12627
12633
|
},
|
|
12628
|
-
fillPoly(points,
|
|
12634
|
+
fillPoly(points, style) {
|
|
12629
12635
|
if (points.length === 0) return;
|
|
12630
12636
|
tracePoly(points, true);
|
|
12631
|
-
ctx.fillStyle =
|
|
12637
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
12632
12638
|
ctx.fill();
|
|
12633
12639
|
},
|
|
12634
|
-
strokePoly(points,
|
|
12640
|
+
strokePoly(points, style, lineWidth = 1, closed = false) {
|
|
12635
12641
|
if (points.length === 0) return;
|
|
12636
12642
|
tracePoly(points, closed);
|
|
12637
|
-
ctx.strokeStyle =
|
|
12643
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
12638
12644
|
ctx.lineWidth = lineWidth;
|
|
12639
12645
|
ctx.stroke();
|
|
12640
12646
|
},
|
|
12641
|
-
fillEllipse(cx, cy, rx, ry,
|
|
12647
|
+
fillEllipse(cx, cy, rx, ry, style) {
|
|
12642
12648
|
ctx.beginPath();
|
|
12643
12649
|
ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
|
|
12644
|
-
ctx.fillStyle =
|
|
12650
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
12645
12651
|
ctx.fill();
|
|
12646
12652
|
},
|
|
12647
|
-
strokeEllipse(cx, cy, rx, ry,
|
|
12653
|
+
strokeEllipse(cx, cy, rx, ry, style, lineWidth = 1) {
|
|
12648
12654
|
ctx.beginPath();
|
|
12649
12655
|
ctx.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2);
|
|
12650
|
-
ctx.strokeStyle =
|
|
12656
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
12651
12657
|
ctx.lineWidth = lineWidth;
|
|
12652
12658
|
ctx.stroke();
|
|
12653
12659
|
},
|
|
12654
|
-
fillPath(d,
|
|
12655
|
-
ctx.fillStyle =
|
|
12660
|
+
fillPath(d, style) {
|
|
12661
|
+
ctx.fillStyle = toCanvasStyle(style);
|
|
12656
12662
|
ctx.fill(new Path2D(d));
|
|
12657
12663
|
},
|
|
12658
|
-
strokePath(d,
|
|
12659
|
-
ctx.strokeStyle =
|
|
12664
|
+
strokePath(d, style, lineWidth = 1) {
|
|
12665
|
+
ctx.strokeStyle = toCanvasStyle(style);
|
|
12660
12666
|
ctx.lineWidth = lineWidth;
|
|
12661
12667
|
ctx.stroke(new Path2D(d));
|
|
12662
12668
|
},
|
|
@@ -12831,6 +12837,84 @@ var init_registry = __esm({
|
|
|
12831
12837
|
DrawableRegistryContext = createContext(null);
|
|
12832
12838
|
}
|
|
12833
12839
|
});
|
|
12840
|
+
function isAnimatedShape(node) {
|
|
12841
|
+
return Boolean(node.animation && node.animation.durationMs > 0 && node.animation.keyframes.length > 0);
|
|
12842
|
+
}
|
|
12843
|
+
function applyShapeAnimation(node, timeMs) {
|
|
12844
|
+
const anim = node.animation;
|
|
12845
|
+
if (!anim || !(anim.durationMs > 0) || anim.keyframes.length === 0) return node;
|
|
12846
|
+
const frames = [...anim.keyframes].sort((a, b) => a.at - b.at);
|
|
12847
|
+
const cycle = timeMs / anim.durationMs;
|
|
12848
|
+
const t = anim.loop === false ? Math.min(cycle, 1) : cycle - Math.floor(cycle);
|
|
12849
|
+
const out = { ...node };
|
|
12850
|
+
const trackValue = (key) => {
|
|
12851
|
+
const defined = frames.filter((f3) => f3[key] !== void 0);
|
|
12852
|
+
if (defined.length === 0) return void 0;
|
|
12853
|
+
let prev;
|
|
12854
|
+
let next;
|
|
12855
|
+
for (const f3 of defined) {
|
|
12856
|
+
if (f3.at <= t) prev = f3;
|
|
12857
|
+
else if (!next) next = f3;
|
|
12858
|
+
}
|
|
12859
|
+
if (!prev) return defined[0][key];
|
|
12860
|
+
if (!next) return prev[key];
|
|
12861
|
+
const span = next.at - prev.at;
|
|
12862
|
+
const k = span > 0 ? (t - prev.at) / span : 1;
|
|
12863
|
+
const a = prev[key];
|
|
12864
|
+
const b = next[key];
|
|
12865
|
+
if (typeof a === "number" && typeof b === "number") return lerp(a, b, k);
|
|
12866
|
+
return a;
|
|
12867
|
+
};
|
|
12868
|
+
for (const key of NUMERIC_TRACKS) {
|
|
12869
|
+
const v = trackValue(key);
|
|
12870
|
+
if (v !== void 0) out[key] = v;
|
|
12871
|
+
}
|
|
12872
|
+
const fill = trackValue("fill");
|
|
12873
|
+
if (fill !== void 0) out.fill = fill;
|
|
12874
|
+
const stroke = trackValue("stroke");
|
|
12875
|
+
if (stroke !== void 0) out.stroke = stroke;
|
|
12876
|
+
const shadowFrames = frames.filter((f3) => f3.shadow !== void 0);
|
|
12877
|
+
if (shadowFrames.length > 0) {
|
|
12878
|
+
const sh = trackValue("shadow");
|
|
12879
|
+
if (sh !== void 0) {
|
|
12880
|
+
let prevSh;
|
|
12881
|
+
let nextSh;
|
|
12882
|
+
for (const f3 of shadowFrames) {
|
|
12883
|
+
if (f3.at <= t) prevSh = f3;
|
|
12884
|
+
else if (!nextSh) nextSh = f3;
|
|
12885
|
+
}
|
|
12886
|
+
if (prevSh?.shadow && nextSh?.shadow) {
|
|
12887
|
+
const span = nextSh.at - prevSh.at;
|
|
12888
|
+
const k = span > 0 ? (t - prevSh.at) / span : 1;
|
|
12889
|
+
out.shadow = { color: prevSh.shadow.color, blur: lerp(prevSh.shadow.blur, nextSh.shadow.blur, k) };
|
|
12890
|
+
} else {
|
|
12891
|
+
out.shadow = sh;
|
|
12892
|
+
}
|
|
12893
|
+
}
|
|
12894
|
+
}
|
|
12895
|
+
return out;
|
|
12896
|
+
}
|
|
12897
|
+
function gradientStyle(g, ox, oy, scale) {
|
|
12898
|
+
if (g.kind === "linear") {
|
|
12899
|
+
if (!g.from || !g.to) return void 0;
|
|
12900
|
+
return {
|
|
12901
|
+
kind: "linear",
|
|
12902
|
+
x1: ox + g.from.x * scale,
|
|
12903
|
+
y1: oy + g.from.y * scale,
|
|
12904
|
+
x2: ox + g.to.x * scale,
|
|
12905
|
+
y2: oy + g.to.y * scale,
|
|
12906
|
+
stops: g.stops
|
|
12907
|
+
};
|
|
12908
|
+
}
|
|
12909
|
+
if (!g.center || g.radius === void 0) return void 0;
|
|
12910
|
+
return {
|
|
12911
|
+
kind: "radial",
|
|
12912
|
+
cx: ox + g.center.x * scale,
|
|
12913
|
+
cy: oy + g.center.y * scale,
|
|
12914
|
+
r: g.radius * scale,
|
|
12915
|
+
stops: g.stops
|
|
12916
|
+
};
|
|
12917
|
+
}
|
|
12834
12918
|
function DrawShape(props) {
|
|
12835
12919
|
const register = useContext(DrawableRegistryContext);
|
|
12836
12920
|
if (register) {
|
|
@@ -12841,25 +12925,51 @@ function DrawShape(props) {
|
|
|
12841
12925
|
...opacity !== void 0 && opacity > 0 ? { opacity } : {}
|
|
12842
12926
|
};
|
|
12843
12927
|
register(node);
|
|
12844
|
-
return /* @__PURE__ */ jsx("div", { "data-draw-shape-debug": "", style: { position: "absolute", width: 4, height: 4, background: "red", zIndex: 9999 } });
|
|
12845
12928
|
}
|
|
12846
12929
|
return null;
|
|
12847
12930
|
}
|
|
12848
|
-
var paintShape;
|
|
12931
|
+
var NUMERIC_TRACKS, lerp, paintShape;
|
|
12849
12932
|
var init_DrawShape = __esm({
|
|
12850
12933
|
"components/game/atoms/DrawShape.tsx"() {
|
|
12851
12934
|
"use client";
|
|
12852
12935
|
init_contract();
|
|
12853
12936
|
init_registry();
|
|
12854
|
-
|
|
12937
|
+
NUMERIC_TRACKS = [
|
|
12938
|
+
"offsetX",
|
|
12939
|
+
"offsetY",
|
|
12940
|
+
"rotate",
|
|
12941
|
+
"opacity",
|
|
12942
|
+
"radiusX",
|
|
12943
|
+
"radiusY",
|
|
12944
|
+
"width",
|
|
12945
|
+
"height",
|
|
12946
|
+
"strokeWidth"
|
|
12947
|
+
];
|
|
12948
|
+
lerp = (a, b, k) => a + (b - a) * k;
|
|
12949
|
+
paintShape = (painter, rawNode, dctx) => {
|
|
12950
|
+
const node = dctx.time > 0 ? applyShapeAnimation(rawNode, dctx.time) : rawNode;
|
|
12855
12951
|
if (!isValidScenePos(node.position)) return;
|
|
12856
12952
|
painter.save();
|
|
12857
12953
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
12954
|
+
const origin = dctx.projector.project(node.position);
|
|
12955
|
+
const tileWidth = dctx.projector.tileWidth;
|
|
12956
|
+
if (node.rotate) {
|
|
12957
|
+
const pivot = node.pivot ?? { x: 0.5, y: 0.5 };
|
|
12958
|
+
const px = origin.x + pivot.x * tileWidth;
|
|
12959
|
+
const py = origin.y + pivot.y * tileWidth;
|
|
12960
|
+
painter.translate(px, py);
|
|
12961
|
+
painter.rotate(node.rotate);
|
|
12962
|
+
painter.translate(-px, -py);
|
|
12963
|
+
}
|
|
12964
|
+
if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth });
|
|
12965
|
+
const fill = node.fill === "none" ? void 0 : node.fill;
|
|
12966
|
+
const stroke = node.stroke === "none" ? void 0 : node.stroke;
|
|
12967
|
+
const pxFill = node.gradient ? gradientStyle(node.gradient, origin.x, origin.y, tileWidth) ?? fill : fill;
|
|
12858
12968
|
switch (node.shape) {
|
|
12859
12969
|
case "cell": {
|
|
12860
12970
|
const pts = dctx.projector.cellPath(node.position);
|
|
12861
|
-
if (
|
|
12862
|
-
if (
|
|
12971
|
+
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
12972
|
+
if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
|
|
12863
12973
|
break;
|
|
12864
12974
|
}
|
|
12865
12975
|
case "rect": {
|
|
@@ -12869,8 +12979,8 @@ var init_DrawShape = __esm({
|
|
|
12869
12979
|
const y = p.y + (node.offsetY ?? 0) * tw;
|
|
12870
12980
|
const w = (node.width ?? 0) * tw;
|
|
12871
12981
|
const h = (node.height ?? 0) * tw;
|
|
12872
|
-
if (
|
|
12873
|
-
if (
|
|
12982
|
+
if (pxFill) painter.fillRect(x, y, w, h, pxFill);
|
|
12983
|
+
if (stroke) painter.strokeRect(x, y, w, h, stroke, node.strokeWidth ?? 1);
|
|
12874
12984
|
break;
|
|
12875
12985
|
}
|
|
12876
12986
|
case "ellipse": {
|
|
@@ -12880,26 +12990,26 @@ var init_DrawShape = __esm({
|
|
|
12880
12990
|
const cy = p.y + (node.offsetY ?? 0) * tw;
|
|
12881
12991
|
const rx = (node.radiusX ?? 0) * tw;
|
|
12882
12992
|
const ry = (node.radiusY ?? rx) * tw;
|
|
12883
|
-
if (
|
|
12884
|
-
if (
|
|
12993
|
+
if (pxFill) painter.fillEllipse(cx, cy, rx, ry, pxFill);
|
|
12994
|
+
if (stroke) painter.strokeEllipse(cx, cy, rx, ry, stroke, node.strokeWidth ?? 1);
|
|
12885
12995
|
break;
|
|
12886
12996
|
}
|
|
12887
12997
|
case "poly": {
|
|
12888
|
-
const
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
if (
|
|
12998
|
+
const pts = (node.points ?? []).map((pt) => ({
|
|
12999
|
+
x: origin.x + ((node.offsetX ?? 0) + pt.x) * tileWidth,
|
|
13000
|
+
y: origin.y + ((node.offsetY ?? 0) + pt.y) * tileWidth
|
|
13001
|
+
}));
|
|
13002
|
+
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
13003
|
+
if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
|
|
12893
13004
|
break;
|
|
12894
13005
|
}
|
|
12895
13006
|
case "path": {
|
|
12896
13007
|
if (!node.d) break;
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
painter.
|
|
12901
|
-
if (
|
|
12902
|
-
if (node.stroke) painter.strokePath(node.d, node.stroke, (node.strokeWidth ?? 1) / tw);
|
|
13008
|
+
painter.translate(origin.x + (node.offsetX ?? 0) * tileWidth, origin.y + (node.offsetY ?? 0) * tileWidth);
|
|
13009
|
+
painter.scale(tileWidth, tileWidth);
|
|
13010
|
+
const localFill = node.gradient ? gradientStyle(node.gradient, 0, 0, 1) ?? fill : fill;
|
|
13011
|
+
if (localFill) painter.fillPath(node.d, localFill);
|
|
13012
|
+
if (stroke) painter.strokePath(node.d, stroke, (node.strokeWidth ?? 1) / tileWidth);
|
|
12903
13013
|
break;
|
|
12904
13014
|
}
|
|
12905
13015
|
}
|
|
@@ -13111,7 +13221,6 @@ function Canvas2D({
|
|
|
13111
13221
|
childDrawablesRef.current.push(node);
|
|
13112
13222
|
}, []);
|
|
13113
13223
|
const hasJsxChildren = React93.Children.count(children) > 0;
|
|
13114
|
-
drawables && drawables.length > 0 ? drawables : childDrawablesRef.current;
|
|
13115
13224
|
function isDrawableLayer(node) {
|
|
13116
13225
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
13117
13226
|
}
|
|
@@ -13260,11 +13369,24 @@ function Canvas2D({
|
|
|
13260
13369
|
}, [showMinimap, scenePositions]);
|
|
13261
13370
|
const miniMapWidth = gridExtent.width || 10;
|
|
13262
13371
|
const miniMapHeight = gridExtent.height || 10;
|
|
13263
|
-
const
|
|
13372
|
+
const drawableIsAnimated = (node) => {
|
|
13373
|
+
if (node.type === "draw-shape") return isAnimatedShape(node);
|
|
13374
|
+
if (node.type === "draw-group") return Array.isArray(node.items) && node.items.some(drawableIsAnimated);
|
|
13375
|
+
if (node.type === "draw-shape-layer") return Array.isArray(node.items) && node.items.some(isAnimatedShape);
|
|
13376
|
+
return false;
|
|
13377
|
+
};
|
|
13378
|
+
const animRafRef = useRef(0);
|
|
13379
|
+
const drawTimeRef = useRef(() => void 0);
|
|
13380
|
+
const draw = useCallback((timeMs = 0) => {
|
|
13264
13381
|
const canvas = canvasRef.current;
|
|
13265
13382
|
if (!canvas) return;
|
|
13266
13383
|
const ctx = canvas.getContext("2d");
|
|
13267
13384
|
if (!ctx) return;
|
|
13385
|
+
const scheduleAnimation = (nodes) => {
|
|
13386
|
+
if (!nodes.some(drawableIsAnimated)) return;
|
|
13387
|
+
cancelAnimationFrame(animRafRef.current);
|
|
13388
|
+
animRafRef.current = requestAnimationFrame(() => drawTimeRef.current(performance.now()));
|
|
13389
|
+
};
|
|
13268
13390
|
const dpr = window.devicePixelRatio || 1;
|
|
13269
13391
|
canvas.width = viewportSize.width * dpr;
|
|
13270
13392
|
canvas.height = viewportSize.height * dpr;
|
|
@@ -13297,14 +13419,24 @@ function Canvas2D({
|
|
|
13297
13419
|
if (!drawables || drawables.length === 0) {
|
|
13298
13420
|
const childDrawables = childDrawablesRef.current;
|
|
13299
13421
|
if (childDrawables.length === 0) return;
|
|
13422
|
+
const cam0 = cameraRef.current;
|
|
13423
|
+
if (camera !== "follow" && dragDistance() === 0) {
|
|
13424
|
+
const focus = cameraPos ?? defaultGridFocus;
|
|
13425
|
+
if (focus) {
|
|
13426
|
+
const p = projector.anchorPoint(focus, "center");
|
|
13427
|
+
cam0.x = p.x - viewportSize.width / 2;
|
|
13428
|
+
cam0.y = p.y - viewportSize.height / 2;
|
|
13429
|
+
}
|
|
13430
|
+
}
|
|
13300
13431
|
const painter0 = createWebPainter(ctx, bumpAtlas);
|
|
13301
13432
|
painter0.save();
|
|
13302
13433
|
painter0.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
13303
|
-
painter0.scale(
|
|
13304
|
-
painter0.translate(-viewportSize.width / 2, -viewportSize.height / 2);
|
|
13305
|
-
const dctx0 = { projector, time:
|
|
13434
|
+
painter0.scale(cam0.zoom, cam0.zoom);
|
|
13435
|
+
painter0.translate(-viewportSize.width / 2 - cam0.x, -viewportSize.height / 2 - cam0.y);
|
|
13436
|
+
const dctx0 = { projector, time: timeMs, invalidate: bumpAtlas };
|
|
13306
13437
|
for (const node of childDrawables) paintDrawable(painter0, node, dctx0);
|
|
13307
13438
|
painter0.restore();
|
|
13439
|
+
scheduleAnimation(childDrawables);
|
|
13308
13440
|
return;
|
|
13309
13441
|
}
|
|
13310
13442
|
const cam = cameraRef.current;
|
|
@@ -13324,10 +13456,15 @@ function Canvas2D({
|
|
|
13324
13456
|
painter.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
13325
13457
|
painter.scale(cam.zoom, cam.zoom);
|
|
13326
13458
|
painter.translate(-viewportSize.width / 2 - cam.x, -viewportSize.height / 2 - cam.y);
|
|
13327
|
-
const dctx = { projector, time:
|
|
13459
|
+
const dctx = { projector, time: timeMs, invalidate: bumpAtlas };
|
|
13328
13460
|
for (const node of drawables) paintDrawable(painter, node, dctx);
|
|
13329
13461
|
painter.restore();
|
|
13462
|
+
scheduleAnimation(drawables);
|
|
13330
13463
|
}, [viewportSize, backgroundImage, bgColor, drawables, projector, cameraRef, bumpAtlas, getImage, cameraPos, defaultGridFocus, camera, dragDistance]);
|
|
13464
|
+
useEffect(() => {
|
|
13465
|
+
drawTimeRef.current = draw;
|
|
13466
|
+
}, [draw]);
|
|
13467
|
+
useEffect(() => () => cancelAnimationFrame(animRafRef.current), []);
|
|
13331
13468
|
useEffect(() => {
|
|
13332
13469
|
if (camera !== "follow" || !followTarget) return;
|
|
13333
13470
|
const p = projector.anchorPoint(followTarget, "center");
|
|
@@ -13550,15 +13687,7 @@ function Canvas2D({
|
|
|
13550
13687
|
mapHeight: miniMapHeight
|
|
13551
13688
|
}
|
|
13552
13689
|
) }),
|
|
13553
|
-
hasJsxChildren && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children })
|
|
13554
|
-
/* @__PURE__ */ jsxs("div", { "data-debug": "", style: { position: "absolute", top: 0, left: 0, background: "yellow", color: "black", zIndex: 9999, fontSize: 24, padding: 8 }, children: [
|
|
13555
|
-
"C=",
|
|
13556
|
-
React93.Children.count(children),
|
|
13557
|
-
" J=",
|
|
13558
|
-
String(hasJsxChildren),
|
|
13559
|
-
" D=",
|
|
13560
|
-
drawables?.length ?? -1
|
|
13561
|
-
] })
|
|
13690
|
+
hasJsxChildren && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children })
|
|
13562
13691
|
]
|
|
13563
13692
|
}
|
|
13564
13693
|
) });
|
|
@@ -13583,6 +13712,7 @@ var init_Canvas2D = __esm({
|
|
|
13583
13712
|
init_webPainter2d();
|
|
13584
13713
|
init_projector();
|
|
13585
13714
|
init_paintDispatch();
|
|
13715
|
+
init_DrawShape();
|
|
13586
13716
|
init_registry();
|
|
13587
13717
|
init_hitTest();
|
|
13588
13718
|
init_isometric();
|
|
@@ -47487,8 +47617,13 @@ function SlotContentRenderer({
|
|
|
47487
47617
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
47488
47618
|
const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
|
|
47489
47619
|
const isDrawHost = isDrawHostPattern(content.pattern);
|
|
47620
|
+
const arr = Array.isArray(childrenConfig) ? childrenConfig : childrenConfig ? [childrenConfig] : [];
|
|
47621
|
+
const hasTraitChildren = arr.some(
|
|
47622
|
+
(c) => typeof c === "string" && TRAIT_BINDING_RE.test(c)
|
|
47623
|
+
);
|
|
47624
|
+
const drawHostUsesReactChildren = isDrawHost && hasTraitChildren;
|
|
47490
47625
|
const myPath = patternPath ?? "root";
|
|
47491
|
-
const renderedChildren = hasChildren && !isDrawHost ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
47626
|
+
const renderedChildren = hasChildren && (!isDrawHost || drawHostUsesReactChildren) ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
47492
47627
|
slot: content.slot,
|
|
47493
47628
|
transitionEvent: content.transitionEvent,
|
|
47494
47629
|
fromState: content.fromState,
|
|
@@ -47549,7 +47684,7 @@ function SlotContentRenderer({
|
|
|
47549
47684
|
for (const [k, v] of Object.entries(nodeSlotOverrides)) {
|
|
47550
47685
|
finalProps[k] = v;
|
|
47551
47686
|
}
|
|
47552
|
-
if (isDrawHost && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
|
|
47687
|
+
if (isDrawHost && !drawHostUsesReactChildren && Array.isArray(childrenConfig) && childrenConfig.length > 0) {
|
|
47553
47688
|
finalProps.drawables = toDrawableNodes(childrenConfig);
|
|
47554
47689
|
}
|
|
47555
47690
|
const entityVal = finalProps.entity;
|
|
@@ -47728,6 +47863,8 @@ var init_UISlotRenderer = __esm({
|
|
|
47728
47863
|
"vstack",
|
|
47729
47864
|
"hstack",
|
|
47730
47865
|
"box",
|
|
47866
|
+
"canvas",
|
|
47867
|
+
"canvas-2d",
|
|
47731
47868
|
"grid",
|
|
47732
47869
|
"center",
|
|
47733
47870
|
"card",
|
|
@@ -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-B5pPeSEp.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-B5pPeSEp.js';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
|
|
5
5
|
/**
|