@almadar/ui 5.85.0 → 5.87.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 +139 -1415
- package/dist/avl/index.js +139 -1415
- package/dist/components/game/2d/molecules/index.d.ts +0 -2
- package/dist/components/game/shared/index.d.ts +0 -2
- package/dist/components/index.cjs +124 -1478
- package/dist/components/index.js +125 -1468
- package/dist/providers/index.cjs +109 -1385
- package/dist/providers/index.js +109 -1385
- package/dist/runtime/index.cjs +115 -1391
- package/dist/runtime/index.js +115 -1391
- package/package.json +1 -1
- package/dist/components/game/2d/organisms/CanvasEffect.d.ts +0 -70
- package/dist/components/game/shared/canvasEffects.d.ts +0 -50
- package/dist/components/game/shared/combatPresets.d.ts +0 -15
- package/dist/components/game/shared/hooks/useCanvasEffects.d.ts +0 -27
package/dist/runtime/index.js
CHANGED
|
@@ -772,13 +772,13 @@ function useRenderInterpolation(options = {}) {
|
|
|
772
772
|
const prevMap = /* @__PURE__ */ new Map();
|
|
773
773
|
for (const e of prev.entities) prevMap.set(e.id, e);
|
|
774
774
|
for (const c of curr.entities) {
|
|
775
|
-
const
|
|
776
|
-
if (!
|
|
775
|
+
const p = prevMap.get(c.id);
|
|
776
|
+
if (!p) {
|
|
777
777
|
out.set(c.id, { x: c.x, y: c.y });
|
|
778
778
|
} else {
|
|
779
779
|
out.set(c.id, {
|
|
780
|
-
x:
|
|
781
|
-
y:
|
|
780
|
+
x: p.x + (c.x - p.x) * alpha,
|
|
781
|
+
y: p.y + (c.y - p.y) * alpha
|
|
782
782
|
});
|
|
783
783
|
}
|
|
784
784
|
}
|
|
@@ -1090,12 +1090,12 @@ function kebabToPascal(name) {
|
|
|
1090
1090
|
}).join("");
|
|
1091
1091
|
}
|
|
1092
1092
|
function loadLib(key, importer) {
|
|
1093
|
-
let
|
|
1094
|
-
if (!
|
|
1095
|
-
|
|
1096
|
-
libPromises.set(key,
|
|
1093
|
+
let p = libPromises.get(key);
|
|
1094
|
+
if (!p) {
|
|
1095
|
+
p = importer();
|
|
1096
|
+
libPromises.set(key, p);
|
|
1097
1097
|
}
|
|
1098
|
-
return
|
|
1098
|
+
return p;
|
|
1099
1099
|
}
|
|
1100
1100
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
1101
1101
|
const Lazy = React95__default.lazy(async () => {
|
|
@@ -6349,28 +6349,28 @@ var init_ConfettiEffect = __esm({
|
|
|
6349
6349
|
),
|
|
6350
6350
|
"aria-hidden": "true",
|
|
6351
6351
|
children: [
|
|
6352
|
-
particles.map((
|
|
6353
|
-
const rad =
|
|
6354
|
-
const tx = Math.cos(rad) *
|
|
6355
|
-
const ty = Math.sin(rad) *
|
|
6352
|
+
particles.map((p) => {
|
|
6353
|
+
const rad = p.angle * Math.PI / 180;
|
|
6354
|
+
const tx = Math.cos(rad) * p.distance;
|
|
6355
|
+
const ty = Math.sin(rad) * p.distance - 20;
|
|
6356
6356
|
return /* @__PURE__ */ jsx(
|
|
6357
6357
|
Box,
|
|
6358
6358
|
{
|
|
6359
6359
|
className: "absolute rounded-sm",
|
|
6360
6360
|
style: {
|
|
6361
|
-
left: `${
|
|
6361
|
+
left: `${p.left}%`,
|
|
6362
6362
|
top: "50%",
|
|
6363
|
-
width:
|
|
6364
|
-
height:
|
|
6365
|
-
backgroundColor:
|
|
6366
|
-
animation: `confetti-burst ${duration -
|
|
6363
|
+
width: p.size,
|
|
6364
|
+
height: p.size,
|
|
6365
|
+
backgroundColor: p.color,
|
|
6366
|
+
animation: `confetti-burst ${duration - p.delay}ms ease-out ${p.delay}ms forwards`,
|
|
6367
6367
|
opacity: 0,
|
|
6368
6368
|
"--confetti-tx": `${tx}px`,
|
|
6369
6369
|
"--confetti-ty": `${ty}px`,
|
|
6370
|
-
"--confetti-rotate": `${
|
|
6370
|
+
"--confetti-rotate": `${p.rotation}deg`
|
|
6371
6371
|
}
|
|
6372
6372
|
},
|
|
6373
|
-
|
|
6373
|
+
p.id
|
|
6374
6374
|
);
|
|
6375
6375
|
}),
|
|
6376
6376
|
/* @__PURE__ */ jsx("style", { children: `
|
|
@@ -7281,8 +7281,8 @@ var init_AnimatedGraphic = __esm({
|
|
|
7281
7281
|
const el = containerRef.current;
|
|
7282
7282
|
if (!el || !strokeColor) return;
|
|
7283
7283
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
7284
|
-
paths.forEach((
|
|
7285
|
-
|
|
7284
|
+
paths.forEach((p) => {
|
|
7285
|
+
p.style.stroke = strokeColor;
|
|
7286
7286
|
});
|
|
7287
7287
|
}, [resolvedSvg, strokeColor]);
|
|
7288
7288
|
useEffect(() => {
|
|
@@ -7290,23 +7290,23 @@ var init_AnimatedGraphic = __esm({
|
|
|
7290
7290
|
if (!el || !resolvedSvg) return;
|
|
7291
7291
|
if (animation === "draw" || animation === "fill") {
|
|
7292
7292
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
7293
|
-
paths.forEach((
|
|
7294
|
-
if ("getTotalLength" in
|
|
7295
|
-
const len =
|
|
7296
|
-
|
|
7297
|
-
|
|
7293
|
+
paths.forEach((p) => {
|
|
7294
|
+
if ("getTotalLength" in p && typeof p.getTotalLength === "function") {
|
|
7295
|
+
const len = p.getTotalLength();
|
|
7296
|
+
p.style.strokeDasharray = `${len}`;
|
|
7297
|
+
p.style.strokeDashoffset = `${len}`;
|
|
7298
7298
|
}
|
|
7299
7299
|
if (animation === "fill") {
|
|
7300
|
-
|
|
7300
|
+
p.style.fillOpacity = "0";
|
|
7301
7301
|
}
|
|
7302
7302
|
});
|
|
7303
7303
|
}
|
|
7304
7304
|
if (animation === "morph") {
|
|
7305
7305
|
const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
7306
|
-
paths.forEach((
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7306
|
+
paths.forEach((p) => {
|
|
7307
|
+
p.style.transform = "scale(0)";
|
|
7308
|
+
p.style.transformOrigin = "center";
|
|
7309
|
+
p.style.opacity = "0";
|
|
7310
7310
|
});
|
|
7311
7311
|
}
|
|
7312
7312
|
}, [resolvedSvg, animation]);
|
|
@@ -7411,14 +7411,8 @@ var init_TraitFrame = __esm({
|
|
|
7411
7411
|
});
|
|
7412
7412
|
|
|
7413
7413
|
// components/game/shared/effects.ts
|
|
7414
|
-
var EMPTY_EFFECT_STATE;
|
|
7415
7414
|
var init_effects = __esm({
|
|
7416
7415
|
"components/game/shared/effects.ts"() {
|
|
7417
|
-
EMPTY_EFFECT_STATE = {
|
|
7418
|
-
particles: [],
|
|
7419
|
-
sequences: [],
|
|
7420
|
-
overlays: []
|
|
7421
|
-
};
|
|
7422
7416
|
}
|
|
7423
7417
|
});
|
|
7424
7418
|
|
|
@@ -7826,1021 +7820,12 @@ var init_spriteAnimation = __esm({
|
|
|
7826
7820
|
}
|
|
7827
7821
|
});
|
|
7828
7822
|
|
|
7829
|
-
// components/game/shared/combatPresets.ts
|
|
7830
|
-
function p(manifest, key) {
|
|
7831
|
-
const particles = manifest.particles;
|
|
7832
|
-
if (!particles) return [];
|
|
7833
|
-
const val = particles[key];
|
|
7834
|
-
if (Array.isArray(val)) return val.map((v) => `${manifest.baseUrl}/${v}`);
|
|
7835
|
-
if (typeof val === "string") return [`${manifest.baseUrl}/${val}`];
|
|
7836
|
-
return [];
|
|
7837
|
-
}
|
|
7838
|
-
function anim(manifest, key) {
|
|
7839
|
-
const animations = manifest.animations;
|
|
7840
|
-
if (!animations) return [];
|
|
7841
|
-
const val = animations[key];
|
|
7842
|
-
if (Array.isArray(val)) return val.map((v) => `${manifest.baseUrl}/${v}`);
|
|
7843
|
-
return [];
|
|
7844
|
-
}
|
|
7845
|
-
function createCombatPresets(manifest) {
|
|
7846
|
-
return {
|
|
7847
|
-
// =====================================================================
|
|
7848
|
-
// MELEE — slash (red) + dirt + scratch + flash sequence
|
|
7849
|
-
// =====================================================================
|
|
7850
|
-
melee: (originX, originY) => {
|
|
7851
|
-
const particles = [
|
|
7852
|
-
{
|
|
7853
|
-
spriteUrls: p(manifest, "slash"),
|
|
7854
|
-
count: 6,
|
|
7855
|
-
originX,
|
|
7856
|
-
originY,
|
|
7857
|
-
spread: 8,
|
|
7858
|
-
velocityMin: 40,
|
|
7859
|
-
velocityMax: 120,
|
|
7860
|
-
angleMin: -PI2 * 0.8,
|
|
7861
|
-
angleMax: -PI2 * 0.2,
|
|
7862
|
-
gravity: 0,
|
|
7863
|
-
tint: { r: 255, g: 60, b: 40 },
|
|
7864
|
-
scaleMin: 0.3,
|
|
7865
|
-
scaleMax: 0.6,
|
|
7866
|
-
lifetimeMin: 300,
|
|
7867
|
-
lifetimeMax: 500,
|
|
7868
|
-
fadeRate: -2.5
|
|
7869
|
-
},
|
|
7870
|
-
{
|
|
7871
|
-
spriteUrls: p(manifest, "dirt"),
|
|
7872
|
-
count: 4,
|
|
7873
|
-
originX,
|
|
7874
|
-
originY: originY + 10,
|
|
7875
|
-
spread: 12,
|
|
7876
|
-
velocityMin: 20,
|
|
7877
|
-
velocityMax: 60,
|
|
7878
|
-
angleMin: -PI2 * 0.9,
|
|
7879
|
-
angleMax: -PI2 * 0.1,
|
|
7880
|
-
gravity: 120,
|
|
7881
|
-
tint: { r: 180, g: 140, b: 90 },
|
|
7882
|
-
scaleMin: 0.15,
|
|
7883
|
-
scaleMax: 0.3,
|
|
7884
|
-
lifetimeMin: 400,
|
|
7885
|
-
lifetimeMax: 700,
|
|
7886
|
-
fadeRate: -1.8
|
|
7887
|
-
},
|
|
7888
|
-
{
|
|
7889
|
-
spriteUrls: p(manifest, "scratch"),
|
|
7890
|
-
count: 2,
|
|
7891
|
-
originX,
|
|
7892
|
-
originY,
|
|
7893
|
-
spread: 5,
|
|
7894
|
-
velocityMin: 10,
|
|
7895
|
-
velocityMax: 30,
|
|
7896
|
-
angleMin: -PI2 * 0.7,
|
|
7897
|
-
angleMax: -PI2 * 0.3,
|
|
7898
|
-
gravity: 0,
|
|
7899
|
-
tint: { r: 255, g: 200, b: 150 },
|
|
7900
|
-
scaleMin: 0.25,
|
|
7901
|
-
scaleMax: 0.4,
|
|
7902
|
-
lifetimeMin: 200,
|
|
7903
|
-
lifetimeMax: 400,
|
|
7904
|
-
fadeRate: -3
|
|
7905
|
-
}
|
|
7906
|
-
];
|
|
7907
|
-
const sequences = [];
|
|
7908
|
-
const flashFrames = anim(manifest, "flash");
|
|
7909
|
-
if (flashFrames.length > 0) {
|
|
7910
|
-
sequences.push({
|
|
7911
|
-
frameUrls: flashFrames,
|
|
7912
|
-
originX,
|
|
7913
|
-
originY,
|
|
7914
|
-
frameDuration: 35,
|
|
7915
|
-
scale: 0.4
|
|
7916
|
-
});
|
|
7917
|
-
}
|
|
7918
|
-
return {
|
|
7919
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
7920
|
-
sequences,
|
|
7921
|
-
overlays: [],
|
|
7922
|
-
screenShake: 4,
|
|
7923
|
-
screenFlash: null
|
|
7924
|
-
};
|
|
7925
|
-
},
|
|
7926
|
-
// =====================================================================
|
|
7927
|
-
// RANGED — muzzle + trace + smoke + explosion sequence
|
|
7928
|
-
// =====================================================================
|
|
7929
|
-
ranged: (originX, originY) => {
|
|
7930
|
-
const particles = [
|
|
7931
|
-
{
|
|
7932
|
-
spriteUrls: p(manifest, "muzzle"),
|
|
7933
|
-
count: 3,
|
|
7934
|
-
originX,
|
|
7935
|
-
originY,
|
|
7936
|
-
spread: 4,
|
|
7937
|
-
velocityMin: 60,
|
|
7938
|
-
velocityMax: 150,
|
|
7939
|
-
angleMin: -PI2 * 0.6,
|
|
7940
|
-
angleMax: -PI2 * 0.4,
|
|
7941
|
-
gravity: 0,
|
|
7942
|
-
tint: { r: 255, g: 220, b: 100 },
|
|
7943
|
-
scaleMin: 0.2,
|
|
7944
|
-
scaleMax: 0.4,
|
|
7945
|
-
lifetimeMin: 200,
|
|
7946
|
-
lifetimeMax: 400,
|
|
7947
|
-
fadeRate: -3
|
|
7948
|
-
},
|
|
7949
|
-
{
|
|
7950
|
-
spriteUrls: p(manifest, "trace"),
|
|
7951
|
-
count: 5,
|
|
7952
|
-
originX,
|
|
7953
|
-
originY,
|
|
7954
|
-
spread: 3,
|
|
7955
|
-
velocityMin: 100,
|
|
7956
|
-
velocityMax: 200,
|
|
7957
|
-
angleMin: -PI2 * 0.55,
|
|
7958
|
-
angleMax: -PI2 * 0.45,
|
|
7959
|
-
gravity: 0,
|
|
7960
|
-
tint: { r: 255, g: 200, b: 80 },
|
|
7961
|
-
scaleMin: 0.15,
|
|
7962
|
-
scaleMax: 0.3,
|
|
7963
|
-
lifetimeMin: 150,
|
|
7964
|
-
lifetimeMax: 300,
|
|
7965
|
-
fadeRate: -4
|
|
7966
|
-
},
|
|
7967
|
-
{
|
|
7968
|
-
spriteUrls: p(manifest, "smoke").slice(0, 3),
|
|
7969
|
-
count: 3,
|
|
7970
|
-
originX,
|
|
7971
|
-
originY: originY + 5,
|
|
7972
|
-
spread: 6,
|
|
7973
|
-
velocityMin: 10,
|
|
7974
|
-
velocityMax: 30,
|
|
7975
|
-
angleMin: -PI2 * 0.8,
|
|
7976
|
-
angleMax: -PI2 * 0.2,
|
|
7977
|
-
gravity: -20,
|
|
7978
|
-
tint: { r: 200, g: 200, b: 200 },
|
|
7979
|
-
scaleMin: 0.2,
|
|
7980
|
-
scaleMax: 0.35,
|
|
7981
|
-
lifetimeMin: 500,
|
|
7982
|
-
lifetimeMax: 800,
|
|
7983
|
-
fadeRate: -1.5
|
|
7984
|
-
}
|
|
7985
|
-
];
|
|
7986
|
-
const sequences = [];
|
|
7987
|
-
const explosionFrames = anim(manifest, "smokeExplosion");
|
|
7988
|
-
if (explosionFrames.length > 0) {
|
|
7989
|
-
sequences.push({
|
|
7990
|
-
frameUrls: explosionFrames,
|
|
7991
|
-
originX,
|
|
7992
|
-
originY,
|
|
7993
|
-
frameDuration: 50,
|
|
7994
|
-
scale: 0.35
|
|
7995
|
-
});
|
|
7996
|
-
}
|
|
7997
|
-
return {
|
|
7998
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
7999
|
-
sequences,
|
|
8000
|
-
overlays: [],
|
|
8001
|
-
screenShake: 2,
|
|
8002
|
-
screenFlash: null
|
|
8003
|
-
};
|
|
8004
|
-
},
|
|
8005
|
-
// =====================================================================
|
|
8006
|
-
// MAGIC — twirl (purple) + spark (purple) + star
|
|
8007
|
-
// =====================================================================
|
|
8008
|
-
magic: (originX, originY) => {
|
|
8009
|
-
const particles = [
|
|
8010
|
-
{
|
|
8011
|
-
spriteUrls: p(manifest, "twirl"),
|
|
8012
|
-
count: 5,
|
|
8013
|
-
originX,
|
|
8014
|
-
originY,
|
|
8015
|
-
spread: 15,
|
|
8016
|
-
velocityMin: 20,
|
|
8017
|
-
velocityMax: 80,
|
|
8018
|
-
angleMin: 0,
|
|
8019
|
-
angleMax: PI2 * 2,
|
|
8020
|
-
gravity: -30,
|
|
8021
|
-
tint: { r: 180, g: 80, b: 255 },
|
|
8022
|
-
scaleMin: 0.2,
|
|
8023
|
-
scaleMax: 0.5,
|
|
8024
|
-
lifetimeMin: 500,
|
|
8025
|
-
lifetimeMax: 900,
|
|
8026
|
-
fadeRate: -1.2,
|
|
8027
|
-
blendMode: "lighter",
|
|
8028
|
-
rotationSpeedMin: -4,
|
|
8029
|
-
rotationSpeedMax: 4
|
|
8030
|
-
},
|
|
8031
|
-
{
|
|
8032
|
-
spriteUrls: p(manifest, "spark"),
|
|
8033
|
-
count: 8,
|
|
8034
|
-
originX,
|
|
8035
|
-
originY,
|
|
8036
|
-
spread: 20,
|
|
8037
|
-
velocityMin: 30,
|
|
8038
|
-
velocityMax: 100,
|
|
8039
|
-
angleMin: 0,
|
|
8040
|
-
angleMax: PI2 * 2,
|
|
8041
|
-
gravity: -15,
|
|
8042
|
-
tint: { r: 200, g: 120, b: 255 },
|
|
8043
|
-
scaleMin: 0.1,
|
|
8044
|
-
scaleMax: 0.25,
|
|
8045
|
-
lifetimeMin: 300,
|
|
8046
|
-
lifetimeMax: 600,
|
|
8047
|
-
fadeRate: -2,
|
|
8048
|
-
blendMode: "lighter"
|
|
8049
|
-
},
|
|
8050
|
-
{
|
|
8051
|
-
spriteUrls: p(manifest, "star"),
|
|
8052
|
-
count: 4,
|
|
8053
|
-
originX,
|
|
8054
|
-
originY,
|
|
8055
|
-
spread: 10,
|
|
8056
|
-
velocityMin: 15,
|
|
8057
|
-
velocityMax: 50,
|
|
8058
|
-
angleMin: -PI2,
|
|
8059
|
-
angleMax: 0,
|
|
8060
|
-
gravity: -40,
|
|
8061
|
-
tint: { r: 220, g: 180, b: 255 },
|
|
8062
|
-
scaleMin: 0.15,
|
|
8063
|
-
scaleMax: 0.3,
|
|
8064
|
-
lifetimeMin: 600,
|
|
8065
|
-
lifetimeMax: 1e3,
|
|
8066
|
-
fadeRate: -1,
|
|
8067
|
-
blendMode: "lighter"
|
|
8068
|
-
}
|
|
8069
|
-
];
|
|
8070
|
-
const overlays = [];
|
|
8071
|
-
const circleUrls = p(manifest, "circle");
|
|
8072
|
-
if (circleUrls.length > 0) {
|
|
8073
|
-
overlays.push({
|
|
8074
|
-
spriteUrl: circleUrls[0],
|
|
8075
|
-
originX,
|
|
8076
|
-
originY,
|
|
8077
|
-
alpha: 0.5,
|
|
8078
|
-
fadeRate: -0.6,
|
|
8079
|
-
pulseAmplitude: 0.2,
|
|
8080
|
-
pulseFrequency: 3,
|
|
8081
|
-
scale: 0.5,
|
|
8082
|
-
blendMode: "lighter",
|
|
8083
|
-
lifetime: 1200
|
|
8084
|
-
});
|
|
8085
|
-
}
|
|
8086
|
-
return {
|
|
8087
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8088
|
-
sequences: [],
|
|
8089
|
-
overlays,
|
|
8090
|
-
screenShake: 0,
|
|
8091
|
-
screenFlash: null
|
|
8092
|
-
};
|
|
8093
|
-
},
|
|
8094
|
-
// =====================================================================
|
|
8095
|
-
// HEAL — circle (green) + star (green) + light (green, pulse)
|
|
8096
|
-
// =====================================================================
|
|
8097
|
-
heal: (originX, originY) => {
|
|
8098
|
-
const particles = [
|
|
8099
|
-
{
|
|
8100
|
-
spriteUrls: p(manifest, "circle"),
|
|
8101
|
-
count: 6,
|
|
8102
|
-
originX,
|
|
8103
|
-
originY,
|
|
8104
|
-
spread: 15,
|
|
8105
|
-
velocityMin: 10,
|
|
8106
|
-
velocityMax: 40,
|
|
8107
|
-
angleMin: -PI2,
|
|
8108
|
-
angleMax: -PI2 * 0.3,
|
|
8109
|
-
gravity: -50,
|
|
8110
|
-
tint: { r: 80, g: 255, b: 120 },
|
|
8111
|
-
scaleMin: 0.15,
|
|
8112
|
-
scaleMax: 0.35,
|
|
8113
|
-
lifetimeMin: 600,
|
|
8114
|
-
lifetimeMax: 1e3,
|
|
8115
|
-
fadeRate: -0.8,
|
|
8116
|
-
blendMode: "lighter"
|
|
8117
|
-
},
|
|
8118
|
-
{
|
|
8119
|
-
spriteUrls: p(manifest, "star"),
|
|
8120
|
-
count: 5,
|
|
8121
|
-
originX,
|
|
8122
|
-
originY,
|
|
8123
|
-
spread: 12,
|
|
8124
|
-
velocityMin: 15,
|
|
8125
|
-
velocityMax: 50,
|
|
8126
|
-
angleMin: -PI2 * 0.9,
|
|
8127
|
-
angleMax: -PI2 * 0.1,
|
|
8128
|
-
gravity: -60,
|
|
8129
|
-
tint: { r: 100, g: 255, b: 140 },
|
|
8130
|
-
scaleMin: 0.1,
|
|
8131
|
-
scaleMax: 0.2,
|
|
8132
|
-
lifetimeMin: 500,
|
|
8133
|
-
lifetimeMax: 800,
|
|
8134
|
-
fadeRate: -1.2,
|
|
8135
|
-
blendMode: "lighter"
|
|
8136
|
-
}
|
|
8137
|
-
];
|
|
8138
|
-
const overlays = [];
|
|
8139
|
-
const lightUrls = p(manifest, "light");
|
|
8140
|
-
if (lightUrls.length > 0) {
|
|
8141
|
-
overlays.push({
|
|
8142
|
-
spriteUrl: lightUrls[0],
|
|
8143
|
-
originX,
|
|
8144
|
-
originY,
|
|
8145
|
-
alpha: 0.6,
|
|
8146
|
-
fadeRate: -0.4,
|
|
8147
|
-
pulseAmplitude: 0.25,
|
|
8148
|
-
pulseFrequency: 2.5,
|
|
8149
|
-
scale: 0.6,
|
|
8150
|
-
blendMode: "lighter",
|
|
8151
|
-
lifetime: 1500
|
|
8152
|
-
});
|
|
8153
|
-
}
|
|
8154
|
-
return {
|
|
8155
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8156
|
-
sequences: [],
|
|
8157
|
-
overlays,
|
|
8158
|
-
screenShake: 0,
|
|
8159
|
-
screenFlash: null
|
|
8160
|
-
};
|
|
8161
|
-
},
|
|
8162
|
-
// =====================================================================
|
|
8163
|
-
// DEFEND / SHIELD — star (blue) + circle (blue, pulse)
|
|
8164
|
-
// =====================================================================
|
|
8165
|
-
defend: (originX, originY) => {
|
|
8166
|
-
const particles = [
|
|
8167
|
-
{
|
|
8168
|
-
spriteUrls: p(manifest, "star"),
|
|
8169
|
-
count: 8,
|
|
8170
|
-
originX,
|
|
8171
|
-
originY,
|
|
8172
|
-
spread: 18,
|
|
8173
|
-
velocityMin: 10,
|
|
8174
|
-
velocityMax: 35,
|
|
8175
|
-
angleMin: 0,
|
|
8176
|
-
angleMax: PI2 * 2,
|
|
8177
|
-
gravity: 0,
|
|
8178
|
-
tint: { r: 80, g: 160, b: 255 },
|
|
8179
|
-
scaleMin: 0.12,
|
|
8180
|
-
scaleMax: 0.25,
|
|
8181
|
-
lifetimeMin: 600,
|
|
8182
|
-
lifetimeMax: 1e3,
|
|
8183
|
-
fadeRate: -0.8,
|
|
8184
|
-
blendMode: "lighter",
|
|
8185
|
-
rotationSpeedMin: -1,
|
|
8186
|
-
rotationSpeedMax: 1
|
|
8187
|
-
}
|
|
8188
|
-
];
|
|
8189
|
-
const overlays = [];
|
|
8190
|
-
const circleUrls = p(manifest, "circle");
|
|
8191
|
-
if (circleUrls.length > 0) {
|
|
8192
|
-
overlays.push({
|
|
8193
|
-
spriteUrl: circleUrls[0],
|
|
8194
|
-
originX,
|
|
8195
|
-
originY,
|
|
8196
|
-
alpha: 0.6,
|
|
8197
|
-
fadeRate: -0.3,
|
|
8198
|
-
pulseAmplitude: 0.2,
|
|
8199
|
-
pulseFrequency: 2,
|
|
8200
|
-
scale: 0.6,
|
|
8201
|
-
blendMode: "lighter",
|
|
8202
|
-
lifetime: 1500
|
|
8203
|
-
});
|
|
8204
|
-
}
|
|
8205
|
-
return {
|
|
8206
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8207
|
-
sequences: [],
|
|
8208
|
-
overlays,
|
|
8209
|
-
screenShake: 0,
|
|
8210
|
-
screenFlash: null
|
|
8211
|
-
};
|
|
8212
|
-
},
|
|
8213
|
-
// shield aliases to defend
|
|
8214
|
-
shield: (originX, originY) => {
|
|
8215
|
-
const particles = [
|
|
8216
|
-
{
|
|
8217
|
-
spriteUrls: p(manifest, "star"),
|
|
8218
|
-
count: 10,
|
|
8219
|
-
originX,
|
|
8220
|
-
originY,
|
|
8221
|
-
spread: 20,
|
|
8222
|
-
velocityMin: 8,
|
|
8223
|
-
velocityMax: 30,
|
|
8224
|
-
angleMin: 0,
|
|
8225
|
-
angleMax: PI2 * 2,
|
|
8226
|
-
gravity: 0,
|
|
8227
|
-
tint: { r: 60, g: 180, b: 255 },
|
|
8228
|
-
scaleMin: 0.1,
|
|
8229
|
-
scaleMax: 0.22,
|
|
8230
|
-
lifetimeMin: 700,
|
|
8231
|
-
lifetimeMax: 1200,
|
|
8232
|
-
fadeRate: -0.7,
|
|
8233
|
-
blendMode: "lighter",
|
|
8234
|
-
rotationSpeedMin: -0.8,
|
|
8235
|
-
rotationSpeedMax: 0.8
|
|
8236
|
-
}
|
|
8237
|
-
];
|
|
8238
|
-
const overlays = [];
|
|
8239
|
-
const circleUrls = p(manifest, "circle");
|
|
8240
|
-
if (circleUrls.length > 0) {
|
|
8241
|
-
overlays.push({
|
|
8242
|
-
spriteUrl: circleUrls[0],
|
|
8243
|
-
originX,
|
|
8244
|
-
originY,
|
|
8245
|
-
alpha: 0.7,
|
|
8246
|
-
fadeRate: -0.25,
|
|
8247
|
-
pulseAmplitude: 0.25,
|
|
8248
|
-
pulseFrequency: 1.8,
|
|
8249
|
-
scale: 0.7,
|
|
8250
|
-
blendMode: "lighter",
|
|
8251
|
-
lifetime: 1800
|
|
8252
|
-
});
|
|
8253
|
-
}
|
|
8254
|
-
return {
|
|
8255
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8256
|
-
sequences: [],
|
|
8257
|
-
overlays,
|
|
8258
|
-
screenShake: 0,
|
|
8259
|
-
screenFlash: null
|
|
8260
|
-
};
|
|
8261
|
-
},
|
|
8262
|
-
// =====================================================================
|
|
8263
|
-
// HIT — spark (orange) + flash (5 frames) + screen shake/flash
|
|
8264
|
-
// =====================================================================
|
|
8265
|
-
hit: (originX, originY) => {
|
|
8266
|
-
const particles = [
|
|
8267
|
-
{
|
|
8268
|
-
spriteUrls: p(manifest, "spark"),
|
|
8269
|
-
count: 10,
|
|
8270
|
-
originX,
|
|
8271
|
-
originY,
|
|
8272
|
-
spread: 8,
|
|
8273
|
-
velocityMin: 50,
|
|
8274
|
-
velocityMax: 150,
|
|
8275
|
-
angleMin: 0,
|
|
8276
|
-
angleMax: PI2 * 2,
|
|
8277
|
-
gravity: 80,
|
|
8278
|
-
tint: { r: 255, g: 180, b: 50 },
|
|
8279
|
-
scaleMin: 0.08,
|
|
8280
|
-
scaleMax: 0.2,
|
|
8281
|
-
lifetimeMin: 200,
|
|
8282
|
-
lifetimeMax: 500,
|
|
8283
|
-
fadeRate: -2.5
|
|
8284
|
-
}
|
|
8285
|
-
];
|
|
8286
|
-
const sequences = [];
|
|
8287
|
-
const flashFrames = anim(manifest, "flash");
|
|
8288
|
-
if (flashFrames.length > 0) {
|
|
8289
|
-
sequences.push({
|
|
8290
|
-
frameUrls: flashFrames.slice(0, 5),
|
|
8291
|
-
originX,
|
|
8292
|
-
originY,
|
|
8293
|
-
frameDuration: 40,
|
|
8294
|
-
scale: 0.3
|
|
8295
|
-
});
|
|
8296
|
-
}
|
|
8297
|
-
return {
|
|
8298
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8299
|
-
sequences,
|
|
8300
|
-
overlays: [],
|
|
8301
|
-
screenShake: 3,
|
|
8302
|
-
screenFlash: { r: 255, g: 50, b: 50, duration: 150 }
|
|
8303
|
-
};
|
|
8304
|
-
},
|
|
8305
|
-
// critical aliases to hit with bigger shake
|
|
8306
|
-
critical: (originX, originY) => {
|
|
8307
|
-
const particles = [
|
|
8308
|
-
{
|
|
8309
|
-
spriteUrls: p(manifest, "flame"),
|
|
8310
|
-
count: 8,
|
|
8311
|
-
originX,
|
|
8312
|
-
originY,
|
|
8313
|
-
spread: 12,
|
|
8314
|
-
velocityMin: 60,
|
|
8315
|
-
velocityMax: 180,
|
|
8316
|
-
angleMin: 0,
|
|
8317
|
-
angleMax: PI2 * 2,
|
|
8318
|
-
gravity: 60,
|
|
8319
|
-
tint: { r: 255, g: 120, b: 30 },
|
|
8320
|
-
scaleMin: 0.15,
|
|
8321
|
-
scaleMax: 0.4,
|
|
8322
|
-
lifetimeMin: 300,
|
|
8323
|
-
lifetimeMax: 600,
|
|
8324
|
-
fadeRate: -2
|
|
8325
|
-
},
|
|
8326
|
-
{
|
|
8327
|
-
spriteUrls: p(manifest, "spark"),
|
|
8328
|
-
count: 12,
|
|
8329
|
-
originX,
|
|
8330
|
-
originY,
|
|
8331
|
-
spread: 10,
|
|
8332
|
-
velocityMin: 80,
|
|
8333
|
-
velocityMax: 200,
|
|
8334
|
-
angleMin: 0,
|
|
8335
|
-
angleMax: PI2 * 2,
|
|
8336
|
-
gravity: 100,
|
|
8337
|
-
tint: { r: 255, g: 200, b: 60 },
|
|
8338
|
-
scaleMin: 0.06,
|
|
8339
|
-
scaleMax: 0.18,
|
|
8340
|
-
lifetimeMin: 200,
|
|
8341
|
-
lifetimeMax: 400,
|
|
8342
|
-
fadeRate: -3
|
|
8343
|
-
}
|
|
8344
|
-
];
|
|
8345
|
-
const sequences = [];
|
|
8346
|
-
const flashFrames = anim(manifest, "flash");
|
|
8347
|
-
if (flashFrames.length > 0) {
|
|
8348
|
-
sequences.push({
|
|
8349
|
-
frameUrls: flashFrames,
|
|
8350
|
-
originX,
|
|
8351
|
-
originY,
|
|
8352
|
-
frameDuration: 30,
|
|
8353
|
-
scale: 0.5
|
|
8354
|
-
});
|
|
8355
|
-
}
|
|
8356
|
-
return {
|
|
8357
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8358
|
-
sequences,
|
|
8359
|
-
overlays: [],
|
|
8360
|
-
screenShake: 6,
|
|
8361
|
-
screenFlash: { r: 255, g: 80, b: 0, duration: 200 }
|
|
8362
|
-
};
|
|
8363
|
-
},
|
|
8364
|
-
// =====================================================================
|
|
8365
|
-
// DEATH — dirt (gray) + explosion + black smoke + scorch (ground)
|
|
8366
|
-
// =====================================================================
|
|
8367
|
-
death: (originX, originY) => {
|
|
8368
|
-
const particles = [
|
|
8369
|
-
{
|
|
8370
|
-
spriteUrls: p(manifest, "dirt"),
|
|
8371
|
-
count: 8,
|
|
8372
|
-
originX,
|
|
8373
|
-
originY,
|
|
8374
|
-
spread: 10,
|
|
8375
|
-
velocityMin: 30,
|
|
8376
|
-
velocityMax: 100,
|
|
8377
|
-
angleMin: 0,
|
|
8378
|
-
angleMax: PI2 * 2,
|
|
8379
|
-
gravity: 100,
|
|
8380
|
-
tint: { r: 140, g: 140, b: 140 },
|
|
8381
|
-
scaleMin: 0.15,
|
|
8382
|
-
scaleMax: 0.35,
|
|
8383
|
-
lifetimeMin: 500,
|
|
8384
|
-
lifetimeMax: 900,
|
|
8385
|
-
fadeRate: -1.2
|
|
8386
|
-
}
|
|
8387
|
-
];
|
|
8388
|
-
const sequences = [];
|
|
8389
|
-
const explosionFrames = anim(manifest, "explosion");
|
|
8390
|
-
if (explosionFrames.length > 0) {
|
|
8391
|
-
sequences.push({
|
|
8392
|
-
frameUrls: explosionFrames,
|
|
8393
|
-
originX,
|
|
8394
|
-
originY,
|
|
8395
|
-
frameDuration: 60,
|
|
8396
|
-
scale: 0.5
|
|
8397
|
-
});
|
|
8398
|
-
}
|
|
8399
|
-
const blackSmokeFrames = anim(manifest, "blackSmoke");
|
|
8400
|
-
if (blackSmokeFrames.length > 0) {
|
|
8401
|
-
sequences.push({
|
|
8402
|
-
frameUrls: blackSmokeFrames,
|
|
8403
|
-
originX,
|
|
8404
|
-
originY: originY - 10,
|
|
8405
|
-
frameDuration: 50,
|
|
8406
|
-
scale: 0.4,
|
|
8407
|
-
alpha: 0.7
|
|
8408
|
-
});
|
|
8409
|
-
}
|
|
8410
|
-
const overlays = [];
|
|
8411
|
-
const scorchUrls = p(manifest, "scorch");
|
|
8412
|
-
if (scorchUrls.length > 0) {
|
|
8413
|
-
overlays.push({
|
|
8414
|
-
spriteUrl: scorchUrls[0],
|
|
8415
|
-
originX,
|
|
8416
|
-
originY: originY + 10,
|
|
8417
|
-
alpha: 0.6,
|
|
8418
|
-
fadeRate: -0.15,
|
|
8419
|
-
scale: 0.4,
|
|
8420
|
-
lifetime: 4e3
|
|
8421
|
-
});
|
|
8422
|
-
}
|
|
8423
|
-
return {
|
|
8424
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8425
|
-
sequences,
|
|
8426
|
-
overlays,
|
|
8427
|
-
screenShake: 0,
|
|
8428
|
-
screenFlash: null
|
|
8429
|
-
};
|
|
8430
|
-
},
|
|
8431
|
-
// =====================================================================
|
|
8432
|
-
// BUFF — star (gold) + symbol + flare (gold, pulse)
|
|
8433
|
-
// =====================================================================
|
|
8434
|
-
buff: (originX, originY) => {
|
|
8435
|
-
const particles = [
|
|
8436
|
-
{
|
|
8437
|
-
spriteUrls: p(manifest, "star"),
|
|
8438
|
-
count: 6,
|
|
8439
|
-
originX,
|
|
8440
|
-
originY,
|
|
8441
|
-
spread: 15,
|
|
8442
|
-
velocityMin: 15,
|
|
8443
|
-
velocityMax: 50,
|
|
8444
|
-
angleMin: -PI2,
|
|
8445
|
-
angleMax: 0,
|
|
8446
|
-
gravity: -30,
|
|
8447
|
-
tint: { r: 255, g: 215, b: 50 },
|
|
8448
|
-
scaleMin: 0.12,
|
|
8449
|
-
scaleMax: 0.25,
|
|
8450
|
-
lifetimeMin: 600,
|
|
8451
|
-
lifetimeMax: 1e3,
|
|
8452
|
-
fadeRate: -0.8,
|
|
8453
|
-
blendMode: "lighter"
|
|
8454
|
-
},
|
|
8455
|
-
{
|
|
8456
|
-
spriteUrls: p(manifest, "symbol"),
|
|
8457
|
-
count: 2,
|
|
8458
|
-
originX,
|
|
8459
|
-
originY: originY - 10,
|
|
8460
|
-
spread: 8,
|
|
8461
|
-
velocityMin: 5,
|
|
8462
|
-
velocityMax: 20,
|
|
8463
|
-
angleMin: -PI2 * 0.7,
|
|
8464
|
-
angleMax: -PI2 * 0.3,
|
|
8465
|
-
gravity: -20,
|
|
8466
|
-
tint: { r: 255, g: 230, b: 100 },
|
|
8467
|
-
scaleMin: 0.2,
|
|
8468
|
-
scaleMax: 0.35,
|
|
8469
|
-
lifetimeMin: 800,
|
|
8470
|
-
lifetimeMax: 1200,
|
|
8471
|
-
fadeRate: -0.6,
|
|
8472
|
-
blendMode: "lighter"
|
|
8473
|
-
}
|
|
8474
|
-
];
|
|
8475
|
-
const overlays = [];
|
|
8476
|
-
const flareUrls = p(manifest, "flare");
|
|
8477
|
-
if (flareUrls.length > 0) {
|
|
8478
|
-
overlays.push({
|
|
8479
|
-
spriteUrl: flareUrls[0],
|
|
8480
|
-
originX,
|
|
8481
|
-
originY,
|
|
8482
|
-
alpha: 0.5,
|
|
8483
|
-
fadeRate: -0.3,
|
|
8484
|
-
pulseAmplitude: 0.3,
|
|
8485
|
-
pulseFrequency: 2,
|
|
8486
|
-
scale: 0.5,
|
|
8487
|
-
blendMode: "lighter",
|
|
8488
|
-
lifetime: 1500
|
|
8489
|
-
});
|
|
8490
|
-
}
|
|
8491
|
-
return {
|
|
8492
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8493
|
-
sequences: [],
|
|
8494
|
-
overlays,
|
|
8495
|
-
screenShake: 0,
|
|
8496
|
-
screenFlash: null
|
|
8497
|
-
};
|
|
8498
|
-
},
|
|
8499
|
-
// =====================================================================
|
|
8500
|
-
// DEBUFF — scorch (dark) + smoke (purple tint)
|
|
8501
|
-
// =====================================================================
|
|
8502
|
-
debuff: (originX, originY) => {
|
|
8503
|
-
const particles = [
|
|
8504
|
-
{
|
|
8505
|
-
spriteUrls: p(manifest, "scorch"),
|
|
8506
|
-
count: 4,
|
|
8507
|
-
originX,
|
|
8508
|
-
originY,
|
|
8509
|
-
spread: 12,
|
|
8510
|
-
velocityMin: 15,
|
|
8511
|
-
velocityMax: 40,
|
|
8512
|
-
angleMin: -PI2,
|
|
8513
|
-
angleMax: 0,
|
|
8514
|
-
gravity: -20,
|
|
8515
|
-
tint: { r: 120, g: 40, b: 160 },
|
|
8516
|
-
scaleMin: 0.15,
|
|
8517
|
-
scaleMax: 0.3,
|
|
8518
|
-
lifetimeMin: 500,
|
|
8519
|
-
lifetimeMax: 800,
|
|
8520
|
-
fadeRate: -1
|
|
8521
|
-
},
|
|
8522
|
-
{
|
|
8523
|
-
spriteUrls: p(manifest, "smoke").slice(0, 3),
|
|
8524
|
-
count: 3,
|
|
8525
|
-
originX,
|
|
8526
|
-
originY,
|
|
8527
|
-
spread: 10,
|
|
8528
|
-
velocityMin: 8,
|
|
8529
|
-
velocityMax: 25,
|
|
8530
|
-
angleMin: -PI2 * 0.8,
|
|
8531
|
-
angleMax: -PI2 * 0.2,
|
|
8532
|
-
gravity: -15,
|
|
8533
|
-
tint: { r: 100, g: 50, b: 140 },
|
|
8534
|
-
scaleMin: 0.2,
|
|
8535
|
-
scaleMax: 0.35,
|
|
8536
|
-
lifetimeMin: 600,
|
|
8537
|
-
lifetimeMax: 1e3,
|
|
8538
|
-
fadeRate: -0.8
|
|
8539
|
-
}
|
|
8540
|
-
];
|
|
8541
|
-
const overlays = [];
|
|
8542
|
-
const circleUrls = p(manifest, "circle");
|
|
8543
|
-
if (circleUrls.length > 0) {
|
|
8544
|
-
overlays.push({
|
|
8545
|
-
spriteUrl: circleUrls[0],
|
|
8546
|
-
originX,
|
|
8547
|
-
originY,
|
|
8548
|
-
alpha: 0.4,
|
|
8549
|
-
fadeRate: -0.4,
|
|
8550
|
-
pulseAmplitude: 0.15,
|
|
8551
|
-
pulseFrequency: 2,
|
|
8552
|
-
scale: 0.45,
|
|
8553
|
-
lifetime: 1200
|
|
8554
|
-
});
|
|
8555
|
-
}
|
|
8556
|
-
return {
|
|
8557
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8558
|
-
sequences: [],
|
|
8559
|
-
overlays,
|
|
8560
|
-
screenShake: 0,
|
|
8561
|
-
screenFlash: null
|
|
8562
|
-
};
|
|
8563
|
-
},
|
|
8564
|
-
// =====================================================================
|
|
8565
|
-
// AOE — explosion (large) + flame + spark (radial) + screen shake
|
|
8566
|
-
// =====================================================================
|
|
8567
|
-
aoe: (originX, originY) => {
|
|
8568
|
-
const particles = [
|
|
8569
|
-
{
|
|
8570
|
-
spriteUrls: p(manifest, "flame"),
|
|
8571
|
-
count: 10,
|
|
8572
|
-
originX,
|
|
8573
|
-
originY,
|
|
8574
|
-
spread: 20,
|
|
8575
|
-
velocityMin: 40,
|
|
8576
|
-
velocityMax: 140,
|
|
8577
|
-
angleMin: 0,
|
|
8578
|
-
angleMax: PI2 * 2,
|
|
8579
|
-
gravity: 40,
|
|
8580
|
-
tint: { r: 255, g: 140, b: 30 },
|
|
8581
|
-
scaleMin: 0.2,
|
|
8582
|
-
scaleMax: 0.5,
|
|
8583
|
-
lifetimeMin: 400,
|
|
8584
|
-
lifetimeMax: 800,
|
|
8585
|
-
fadeRate: -1.5
|
|
8586
|
-
},
|
|
8587
|
-
{
|
|
8588
|
-
spriteUrls: p(manifest, "spark"),
|
|
8589
|
-
count: 15,
|
|
8590
|
-
originX,
|
|
8591
|
-
originY,
|
|
8592
|
-
spread: 15,
|
|
8593
|
-
velocityMin: 60,
|
|
8594
|
-
velocityMax: 200,
|
|
8595
|
-
angleMin: 0,
|
|
8596
|
-
angleMax: PI2 * 2,
|
|
8597
|
-
gravity: 60,
|
|
8598
|
-
tint: { r: 255, g: 180, b: 60 },
|
|
8599
|
-
scaleMin: 0.06,
|
|
8600
|
-
scaleMax: 0.15,
|
|
8601
|
-
lifetimeMin: 200,
|
|
8602
|
-
lifetimeMax: 500,
|
|
8603
|
-
fadeRate: -2.5
|
|
8604
|
-
}
|
|
8605
|
-
];
|
|
8606
|
-
const sequences = [];
|
|
8607
|
-
const explosionFrames = anim(manifest, "explosion");
|
|
8608
|
-
if (explosionFrames.length > 0) {
|
|
8609
|
-
sequences.push({
|
|
8610
|
-
frameUrls: explosionFrames,
|
|
8611
|
-
originX,
|
|
8612
|
-
originY,
|
|
8613
|
-
frameDuration: 50,
|
|
8614
|
-
scale: 0.6
|
|
8615
|
-
});
|
|
8616
|
-
}
|
|
8617
|
-
return {
|
|
8618
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8619
|
-
sequences,
|
|
8620
|
-
overlays: [],
|
|
8621
|
-
screenShake: 5,
|
|
8622
|
-
screenFlash: { r: 255, g: 160, b: 0, duration: 180 }
|
|
8623
|
-
};
|
|
8624
|
-
}
|
|
8625
|
-
};
|
|
8626
|
-
}
|
|
8627
|
-
var PI2;
|
|
8628
|
-
var init_combatPresets = __esm({
|
|
8629
|
-
"components/game/shared/combatPresets.ts"() {
|
|
8630
|
-
PI2 = Math.PI;
|
|
8631
|
-
}
|
|
8632
|
-
});
|
|
8633
|
-
|
|
8634
|
-
// components/game/shared/canvasEffects.ts
|
|
8635
|
-
function getOffscreenCtx(w, h) {
|
|
8636
|
-
if (!_offscreen) {
|
|
8637
|
-
if (typeof OffscreenCanvas !== "undefined") {
|
|
8638
|
-
_offscreen = new OffscreenCanvas(w, h);
|
|
8639
|
-
} else {
|
|
8640
|
-
_offscreen = document.createElement("canvas");
|
|
8641
|
-
}
|
|
8642
|
-
}
|
|
8643
|
-
if (_offscreen.width < w) _offscreen.width = w;
|
|
8644
|
-
if (_offscreen.height < h) _offscreen.height = h;
|
|
8645
|
-
if (!_offCtx) {
|
|
8646
|
-
_offCtx = _offscreen.getContext("2d");
|
|
8647
|
-
}
|
|
8648
|
-
return _offCtx;
|
|
8649
|
-
}
|
|
8650
|
-
function drawTintedImage(ctx, img, x, y, w, h, tint, alpha, blendMode = "source-over") {
|
|
8651
|
-
if (w <= 0 || h <= 0) return;
|
|
8652
|
-
const oc = getOffscreenCtx(w, h);
|
|
8653
|
-
oc.clearRect(0, 0, w, h);
|
|
8654
|
-
oc.globalCompositeOperation = "source-over";
|
|
8655
|
-
oc.drawImage(img, 0, 0, w, h);
|
|
8656
|
-
oc.globalCompositeOperation = "source-atop";
|
|
8657
|
-
oc.fillStyle = `rgb(${tint.r}, ${tint.g}, ${tint.b})`;
|
|
8658
|
-
oc.fillRect(0, 0, w, h);
|
|
8659
|
-
const prevAlpha = ctx.globalAlpha;
|
|
8660
|
-
const prevBlend = ctx.globalCompositeOperation;
|
|
8661
|
-
ctx.globalAlpha = alpha;
|
|
8662
|
-
ctx.globalCompositeOperation = blendMode;
|
|
8663
|
-
ctx.drawImage(_offscreen, 0, 0, w, h, x, y, w, h);
|
|
8664
|
-
ctx.globalAlpha = prevAlpha;
|
|
8665
|
-
ctx.globalCompositeOperation = prevBlend;
|
|
8666
|
-
}
|
|
8667
|
-
function randRange(min, max) {
|
|
8668
|
-
return min + Math.random() * (max - min);
|
|
8669
|
-
}
|
|
8670
|
-
function spawnParticles(config, animTime) {
|
|
8671
|
-
const particles = [];
|
|
8672
|
-
for (let i = 0; i < config.count; i++) {
|
|
8673
|
-
const angle = randRange(config.angleMin, config.angleMax);
|
|
8674
|
-
const speed = randRange(config.velocityMin, config.velocityMax);
|
|
8675
|
-
const spriteUrl = config.spriteUrls[Math.floor(Math.random() * config.spriteUrls.length)];
|
|
8676
|
-
particles.push({
|
|
8677
|
-
spriteUrl,
|
|
8678
|
-
x: config.originX + randRange(-config.spread, config.spread),
|
|
8679
|
-
y: config.originY + randRange(-config.spread, config.spread),
|
|
8680
|
-
vx: Math.cos(angle) * speed,
|
|
8681
|
-
vy: Math.sin(angle) * speed,
|
|
8682
|
-
gravity: config.gravity,
|
|
8683
|
-
rotation: Math.random() * Math.PI * 2,
|
|
8684
|
-
rotationSpeed: randRange(config.rotationSpeedMin ?? -2, config.rotationSpeedMax ?? 2),
|
|
8685
|
-
scale: randRange(config.scaleMin, config.scaleMax),
|
|
8686
|
-
scaleSpeed: config.scaleSpeed ?? 0,
|
|
8687
|
-
alpha: config.alpha ?? 1,
|
|
8688
|
-
fadeRate: config.fadeRate ?? -1.5,
|
|
8689
|
-
tint: { ...config.tint },
|
|
8690
|
-
blendMode: config.blendMode ?? "source-over",
|
|
8691
|
-
spawnTime: animTime,
|
|
8692
|
-
lifetime: randRange(config.lifetimeMin, config.lifetimeMax)
|
|
8693
|
-
});
|
|
8694
|
-
}
|
|
8695
|
-
return particles;
|
|
8696
|
-
}
|
|
8697
|
-
function spawnSequence(config, animTime) {
|
|
8698
|
-
return {
|
|
8699
|
-
frameUrls: config.frameUrls,
|
|
8700
|
-
x: config.originX,
|
|
8701
|
-
y: config.originY,
|
|
8702
|
-
frameDuration: config.frameDuration,
|
|
8703
|
-
startTime: animTime,
|
|
8704
|
-
loop: config.loop ?? false,
|
|
8705
|
-
scale: config.scale ?? 1,
|
|
8706
|
-
tint: config.tint ?? null,
|
|
8707
|
-
alpha: config.alpha ?? 1,
|
|
8708
|
-
blendMode: config.blendMode ?? "source-over"
|
|
8709
|
-
};
|
|
8710
|
-
}
|
|
8711
|
-
function spawnOverlay(config, animTime) {
|
|
8712
|
-
return {
|
|
8713
|
-
spriteUrl: config.spriteUrl,
|
|
8714
|
-
x: config.originX,
|
|
8715
|
-
y: config.originY,
|
|
8716
|
-
alpha: config.alpha ?? 0.8,
|
|
8717
|
-
fadeRate: config.fadeRate ?? -0.5,
|
|
8718
|
-
pulseAmplitude: config.pulseAmplitude ?? 0,
|
|
8719
|
-
pulseFrequency: config.pulseFrequency ?? 2,
|
|
8720
|
-
scale: config.scale ?? 1,
|
|
8721
|
-
blendMode: config.blendMode ?? "source-over",
|
|
8722
|
-
spawnTime: animTime,
|
|
8723
|
-
lifetime: config.lifetime ?? 2e3
|
|
8724
|
-
};
|
|
8725
|
-
}
|
|
8726
|
-
function updateEffectState(state, animTime, deltaMs) {
|
|
8727
|
-
const dt = deltaMs / 1e3;
|
|
8728
|
-
const particles = state.particles.map((p2) => ({
|
|
8729
|
-
...p2,
|
|
8730
|
-
x: p2.x + p2.vx * dt,
|
|
8731
|
-
y: p2.y + p2.vy * dt,
|
|
8732
|
-
vy: p2.vy + p2.gravity * dt,
|
|
8733
|
-
rotation: p2.rotation + p2.rotationSpeed * dt,
|
|
8734
|
-
scale: Math.max(0, p2.scale + p2.scaleSpeed * dt),
|
|
8735
|
-
alpha: Math.max(0, p2.alpha + p2.fadeRate * dt)
|
|
8736
|
-
})).filter((p2) => p2.alpha > 0.01 && animTime - p2.spawnTime < p2.lifetime);
|
|
8737
|
-
const sequences = state.sequences.filter((s) => {
|
|
8738
|
-
const elapsed = animTime - s.startTime;
|
|
8739
|
-
const totalDuration = s.frameUrls.length * s.frameDuration;
|
|
8740
|
-
return s.loop || elapsed < totalDuration;
|
|
8741
|
-
});
|
|
8742
|
-
const overlays = state.overlays.map((o) => ({
|
|
8743
|
-
...o,
|
|
8744
|
-
alpha: Math.max(0, o.alpha + o.fadeRate * dt)
|
|
8745
|
-
})).filter((o) => o.alpha > 0.01 && animTime - o.spawnTime < o.lifetime);
|
|
8746
|
-
return { particles, sequences, overlays };
|
|
8747
|
-
}
|
|
8748
|
-
function drawEffectState(ctx, state, animTime, getImage) {
|
|
8749
|
-
for (const o of state.overlays) {
|
|
8750
|
-
const img = getImage(o.spriteUrl);
|
|
8751
|
-
if (!img) continue;
|
|
8752
|
-
let alpha = o.alpha;
|
|
8753
|
-
if (o.pulseAmplitude > 0) {
|
|
8754
|
-
const elapsed = (animTime - o.spawnTime) / 1e3;
|
|
8755
|
-
alpha += Math.sin(elapsed * o.pulseFrequency * Math.PI * 2) * o.pulseAmplitude;
|
|
8756
|
-
alpha = Math.max(0, Math.min(1, alpha));
|
|
8757
|
-
}
|
|
8758
|
-
const w = img.naturalWidth * o.scale;
|
|
8759
|
-
const h = img.naturalHeight * o.scale;
|
|
8760
|
-
const prevAlpha = ctx.globalAlpha;
|
|
8761
|
-
const prevBlend = ctx.globalCompositeOperation;
|
|
8762
|
-
ctx.globalAlpha = alpha;
|
|
8763
|
-
ctx.globalCompositeOperation = o.blendMode;
|
|
8764
|
-
ctx.drawImage(img, o.x - w / 2, o.y - h / 2, w, h);
|
|
8765
|
-
ctx.globalAlpha = prevAlpha;
|
|
8766
|
-
ctx.globalCompositeOperation = prevBlend;
|
|
8767
|
-
}
|
|
8768
|
-
for (const s of state.sequences) {
|
|
8769
|
-
const elapsed = animTime - s.startTime;
|
|
8770
|
-
let frameIndex = Math.floor(elapsed / s.frameDuration);
|
|
8771
|
-
if (s.loop) {
|
|
8772
|
-
frameIndex = frameIndex % s.frameUrls.length;
|
|
8773
|
-
} else if (frameIndex >= s.frameUrls.length) {
|
|
8774
|
-
continue;
|
|
8775
|
-
}
|
|
8776
|
-
const img = getImage(s.frameUrls[frameIndex]);
|
|
8777
|
-
if (!img) continue;
|
|
8778
|
-
const w = img.naturalWidth * s.scale;
|
|
8779
|
-
const h = img.naturalHeight * s.scale;
|
|
8780
|
-
if (s.tint) {
|
|
8781
|
-
drawTintedImage(ctx, img, s.x - w / 2, s.y - h / 2, w, h, s.tint, s.alpha, s.blendMode);
|
|
8782
|
-
} else {
|
|
8783
|
-
const prevAlpha = ctx.globalAlpha;
|
|
8784
|
-
const prevBlend = ctx.globalCompositeOperation;
|
|
8785
|
-
ctx.globalAlpha = s.alpha;
|
|
8786
|
-
ctx.globalCompositeOperation = s.blendMode;
|
|
8787
|
-
ctx.drawImage(img, s.x - w / 2, s.y - h / 2, w, h);
|
|
8788
|
-
ctx.globalAlpha = prevAlpha;
|
|
8789
|
-
ctx.globalCompositeOperation = prevBlend;
|
|
8790
|
-
}
|
|
8791
|
-
}
|
|
8792
|
-
for (const p2 of state.particles) {
|
|
8793
|
-
const img = getImage(p2.spriteUrl);
|
|
8794
|
-
if (!img) continue;
|
|
8795
|
-
const w = img.naturalWidth * p2.scale;
|
|
8796
|
-
const h = img.naturalHeight * p2.scale;
|
|
8797
|
-
ctx.save();
|
|
8798
|
-
ctx.translate(p2.x, p2.y);
|
|
8799
|
-
ctx.rotate(p2.rotation);
|
|
8800
|
-
drawTintedImage(ctx, img, -w / 2, -h / 2, w, h, p2.tint, p2.alpha, p2.blendMode);
|
|
8801
|
-
ctx.restore();
|
|
8802
|
-
}
|
|
8803
|
-
}
|
|
8804
|
-
function hasActiveEffects(state) {
|
|
8805
|
-
return state.particles.length > 0 || state.sequences.length > 0 || state.overlays.length > 0;
|
|
8806
|
-
}
|
|
8807
|
-
function getAllEffectSpriteUrls(manifest) {
|
|
8808
|
-
const urls = [];
|
|
8809
|
-
const base = manifest.baseUrl;
|
|
8810
|
-
if (manifest.particles) {
|
|
8811
|
-
for (const value of Object.values(manifest.particles)) {
|
|
8812
|
-
if (Array.isArray(value)) {
|
|
8813
|
-
value.forEach((v) => urls.push(`${base}/${v}`));
|
|
8814
|
-
} else if (typeof value === "string") {
|
|
8815
|
-
urls.push(`${base}/${value}`);
|
|
8816
|
-
}
|
|
8817
|
-
}
|
|
8818
|
-
}
|
|
8819
|
-
if (manifest.animations) {
|
|
8820
|
-
for (const frames of Object.values(manifest.animations)) {
|
|
8821
|
-
if (Array.isArray(frames)) {
|
|
8822
|
-
frames.forEach((f3) => urls.push(`${base}/${f3}`));
|
|
8823
|
-
}
|
|
8824
|
-
}
|
|
8825
|
-
}
|
|
8826
|
-
return urls;
|
|
8827
|
-
}
|
|
8828
|
-
var _offscreen, _offCtx;
|
|
8829
|
-
var init_canvasEffects = __esm({
|
|
8830
|
-
"components/game/shared/canvasEffects.ts"() {
|
|
8831
|
-
_offscreen = null;
|
|
8832
|
-
_offCtx = null;
|
|
8833
|
-
}
|
|
8834
|
-
});
|
|
8835
|
-
|
|
8836
7823
|
// components/game/shared/index.ts
|
|
8837
7824
|
var init_shared = __esm({
|
|
8838
7825
|
"components/game/shared/index.ts"() {
|
|
8839
7826
|
init_effects();
|
|
8840
7827
|
init_boardEntity();
|
|
8841
7828
|
init_makeAsset();
|
|
8842
|
-
init_combatPresets();
|
|
8843
|
-
init_canvasEffects();
|
|
8844
7829
|
}
|
|
8845
7830
|
});
|
|
8846
7831
|
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
@@ -11567,8 +10552,8 @@ function Canvas2D({
|
|
|
11567
10552
|
if (isFree) return 0;
|
|
11568
10553
|
return (gridHeight - 1) * (scaledTileWidth / 2);
|
|
11569
10554
|
}, [isFree, gridHeight, scaledTileWidth]);
|
|
11570
|
-
const validMoveSet = useMemo(() => new Set(validMoves.map((
|
|
11571
|
-
const attackTargetSet = useMemo(() => new Set(attackTargets.map((
|
|
10555
|
+
const validMoveSet = useMemo(() => new Set(validMoves.map((p) => `${p.x},${p.y}`)), [validMoves]);
|
|
10556
|
+
const attackTargetSet = useMemo(() => new Set(attackTargets.map((p) => `${p.x},${p.y}`)), [attackTargets]);
|
|
11572
10557
|
const spriteUrls = useMemo(() => {
|
|
11573
10558
|
const urls = [];
|
|
11574
10559
|
for (const tile of sortedTiles) {
|
|
@@ -12285,264 +11270,6 @@ var init_Canvas2D = __esm({
|
|
|
12285
11270
|
Canvas2D.displayName = "Canvas2D";
|
|
12286
11271
|
}
|
|
12287
11272
|
});
|
|
12288
|
-
function CanvasEffectEngine({
|
|
12289
|
-
actionType,
|
|
12290
|
-
x,
|
|
12291
|
-
y,
|
|
12292
|
-
duration = 2e3,
|
|
12293
|
-
intensity = 1,
|
|
12294
|
-
onComplete,
|
|
12295
|
-
className,
|
|
12296
|
-
assetManifest,
|
|
12297
|
-
width = 400,
|
|
12298
|
-
height = 300
|
|
12299
|
-
}) {
|
|
12300
|
-
const canvasRef = useRef(null);
|
|
12301
|
-
const stateRef = useRef({ ...EMPTY_EFFECT_STATE });
|
|
12302
|
-
const lastTimeRef = useRef(0);
|
|
12303
|
-
const rafRef = useRef(0);
|
|
12304
|
-
const imageCacheRef = useRef(/* @__PURE__ */ new Map());
|
|
12305
|
-
const [shakeOffset, setShakeOffset] = useState({ x: 0, y: 0 });
|
|
12306
|
-
const [flash, setFlash] = useState(null);
|
|
12307
|
-
const shakeRef = useRef({ x: 0, y: 0, intensity: 0 });
|
|
12308
|
-
const presets = useMemo(() => createCombatPresets(assetManifest), [assetManifest]);
|
|
12309
|
-
const spriteUrls = useMemo(() => getAllEffectSpriteUrls(assetManifest), [assetManifest]);
|
|
12310
|
-
useEffect(() => {
|
|
12311
|
-
const cache = imageCacheRef.current;
|
|
12312
|
-
for (const url of spriteUrls) {
|
|
12313
|
-
if (!cache.has(url)) {
|
|
12314
|
-
const img = new Image();
|
|
12315
|
-
img.crossOrigin = "anonymous";
|
|
12316
|
-
img.src = url;
|
|
12317
|
-
cache.set(url, img);
|
|
12318
|
-
}
|
|
12319
|
-
}
|
|
12320
|
-
}, [spriteUrls]);
|
|
12321
|
-
const getImage = useCallback((url) => {
|
|
12322
|
-
const img = imageCacheRef.current.get(url);
|
|
12323
|
-
return img?.complete ? img : void 0;
|
|
12324
|
-
}, []);
|
|
12325
|
-
useEffect(() => {
|
|
12326
|
-
const now2 = performance.now();
|
|
12327
|
-
const effectX = x || width / 2;
|
|
12328
|
-
const effectY = y || height / 2;
|
|
12329
|
-
const preset = presets[actionType](effectX, effectY);
|
|
12330
|
-
const state = stateRef.current;
|
|
12331
|
-
for (const emitter of preset.particles) {
|
|
12332
|
-
const scaledEmitter = { ...emitter, count: Math.round(emitter.count * intensity) };
|
|
12333
|
-
state.particles.push(...spawnParticles(scaledEmitter, now2));
|
|
12334
|
-
}
|
|
12335
|
-
for (const seqConfig of preset.sequences) {
|
|
12336
|
-
state.sequences.push(spawnSequence(seqConfig, now2));
|
|
12337
|
-
}
|
|
12338
|
-
for (const ovConfig of preset.overlays) {
|
|
12339
|
-
state.overlays.push(spawnOverlay(ovConfig, now2));
|
|
12340
|
-
}
|
|
12341
|
-
if (preset.screenShake > 0) {
|
|
12342
|
-
shakeRef.current.intensity = preset.screenShake * intensity;
|
|
12343
|
-
}
|
|
12344
|
-
if (preset.screenFlash) {
|
|
12345
|
-
const { r, g, b, duration: flashDur } = preset.screenFlash;
|
|
12346
|
-
setFlash({ color: `rgb(${r}, ${g}, ${b})`, alpha: 0.3 });
|
|
12347
|
-
setTimeout(() => setFlash(null), flashDur);
|
|
12348
|
-
}
|
|
12349
|
-
const timer = setTimeout(() => {
|
|
12350
|
-
onComplete?.();
|
|
12351
|
-
}, duration);
|
|
12352
|
-
return () => clearTimeout(timer);
|
|
12353
|
-
}, []);
|
|
12354
|
-
useEffect(() => {
|
|
12355
|
-
const canvas = canvasRef.current;
|
|
12356
|
-
if (!canvas) return;
|
|
12357
|
-
const ctx = canvas.getContext("2d");
|
|
12358
|
-
if (!ctx) return;
|
|
12359
|
-
function loop(animTime) {
|
|
12360
|
-
const delta = lastTimeRef.current > 0 ? animTime - lastTimeRef.current : 16;
|
|
12361
|
-
lastTimeRef.current = animTime;
|
|
12362
|
-
stateRef.current = updateEffectState(stateRef.current, animTime, delta);
|
|
12363
|
-
if (shakeRef.current.intensity > 0.2) {
|
|
12364
|
-
const i = shakeRef.current.intensity;
|
|
12365
|
-
shakeRef.current.x = (Math.random() - 0.5) * i * 2;
|
|
12366
|
-
shakeRef.current.y = (Math.random() - 0.5) * i * 2;
|
|
12367
|
-
shakeRef.current.intensity *= 0.85;
|
|
12368
|
-
setShakeOffset({ x: shakeRef.current.x, y: shakeRef.current.y });
|
|
12369
|
-
} else if (shakeRef.current.intensity > 0) {
|
|
12370
|
-
shakeRef.current = { x: 0, y: 0, intensity: 0 };
|
|
12371
|
-
setShakeOffset({ x: 0, y: 0 });
|
|
12372
|
-
}
|
|
12373
|
-
ctx.clearRect(0, 0, width, height);
|
|
12374
|
-
drawEffectState(ctx, stateRef.current, animTime, getImage);
|
|
12375
|
-
if (hasActiveEffects(stateRef.current)) {
|
|
12376
|
-
rafRef.current = requestAnimationFrame(loop);
|
|
12377
|
-
}
|
|
12378
|
-
}
|
|
12379
|
-
rafRef.current = requestAnimationFrame(loop);
|
|
12380
|
-
return () => cancelAnimationFrame(rafRef.current);
|
|
12381
|
-
}, [width, height, getImage]);
|
|
12382
|
-
const shakeStyle = shakeOffset.x !== 0 || shakeOffset.y !== 0 ? { transform: `translate(${shakeOffset.x}px, ${shakeOffset.y}px)` } : {};
|
|
12383
|
-
return /* @__PURE__ */ jsxs(
|
|
12384
|
-
Box,
|
|
12385
|
-
{
|
|
12386
|
-
className: cn("absolute inset-0 pointer-events-none z-10", className),
|
|
12387
|
-
style: shakeStyle,
|
|
12388
|
-
children: [
|
|
12389
|
-
flash && /* @__PURE__ */ jsx(
|
|
12390
|
-
Box,
|
|
12391
|
-
{
|
|
12392
|
-
className: "absolute inset-0 z-20 pointer-events-none rounded-container",
|
|
12393
|
-
style: { backgroundColor: flash.color, opacity: flash.alpha }
|
|
12394
|
-
}
|
|
12395
|
-
),
|
|
12396
|
-
/* @__PURE__ */ jsx(
|
|
12397
|
-
"canvas",
|
|
12398
|
-
{
|
|
12399
|
-
ref: canvasRef,
|
|
12400
|
-
width,
|
|
12401
|
-
height,
|
|
12402
|
-
className: "absolute inset-0 w-full h-full",
|
|
12403
|
-
style: { imageRendering: "pixelated" }
|
|
12404
|
-
}
|
|
12405
|
-
)
|
|
12406
|
-
]
|
|
12407
|
-
}
|
|
12408
|
-
);
|
|
12409
|
-
}
|
|
12410
|
-
function EmojiEffect({
|
|
12411
|
-
actionType,
|
|
12412
|
-
x,
|
|
12413
|
-
y,
|
|
12414
|
-
duration = 800,
|
|
12415
|
-
intensity = 1,
|
|
12416
|
-
onComplete,
|
|
12417
|
-
className,
|
|
12418
|
-
effectSpriteUrl,
|
|
12419
|
-
assetBaseUrl
|
|
12420
|
-
}) {
|
|
12421
|
-
const [visible, setVisible] = useState(true);
|
|
12422
|
-
const [phase, setPhase] = useState("enter");
|
|
12423
|
-
useEffect(() => {
|
|
12424
|
-
const enterTimer = setTimeout(() => setPhase("active"), 100);
|
|
12425
|
-
const exitTimer = setTimeout(() => setPhase("exit"), duration * 0.7);
|
|
12426
|
-
const doneTimer = setTimeout(() => {
|
|
12427
|
-
setVisible(false);
|
|
12428
|
-
onComplete?.();
|
|
12429
|
-
}, duration);
|
|
12430
|
-
return () => {
|
|
12431
|
-
clearTimeout(enterTimer);
|
|
12432
|
-
clearTimeout(exitTimer);
|
|
12433
|
-
clearTimeout(doneTimer);
|
|
12434
|
-
};
|
|
12435
|
-
}, [duration, onComplete]);
|
|
12436
|
-
if (!visible) return null;
|
|
12437
|
-
const config = ACTION_EMOJI[actionType] ?? ACTION_EMOJI.melee;
|
|
12438
|
-
const scaleVal = phase === "enter" ? 0.3 : phase === "active" ? intensity : 0.5;
|
|
12439
|
-
const opacity = phase === "exit" ? 0 : 1;
|
|
12440
|
-
const resolvedSpriteUrl = effectSpriteUrl ? effectSpriteUrl.startsWith("http") || effectSpriteUrl.startsWith("/") ? effectSpriteUrl : assetBaseUrl ? `${assetBaseUrl.replace(/\/$/, "")}/${effectSpriteUrl}` : effectSpriteUrl : void 0;
|
|
12441
|
-
return /* @__PURE__ */ jsxs(
|
|
12442
|
-
Box,
|
|
12443
|
-
{
|
|
12444
|
-
className: cn(
|
|
12445
|
-
"fixed pointer-events-none z-50 flex items-center justify-center",
|
|
12446
|
-
"transition-all ease-out",
|
|
12447
|
-
className
|
|
12448
|
-
),
|
|
12449
|
-
style: {
|
|
12450
|
-
left: x,
|
|
12451
|
-
top: y,
|
|
12452
|
-
transform: `translate(-50%, -50%) scale(${scaleVal})`,
|
|
12453
|
-
opacity,
|
|
12454
|
-
transitionDuration: phase === "enter" ? "100ms" : "300ms"
|
|
12455
|
-
},
|
|
12456
|
-
children: [
|
|
12457
|
-
/* @__PURE__ */ jsx(
|
|
12458
|
-
Box,
|
|
12459
|
-
{
|
|
12460
|
-
className: "absolute rounded-pill animate-ping",
|
|
12461
|
-
style: {
|
|
12462
|
-
width: 48 * intensity,
|
|
12463
|
-
height: 48 * intensity,
|
|
12464
|
-
backgroundColor: config.color,
|
|
12465
|
-
opacity: 0.25
|
|
12466
|
-
}
|
|
12467
|
-
}
|
|
12468
|
-
),
|
|
12469
|
-
resolvedSpriteUrl ? /* @__PURE__ */ jsx(
|
|
12470
|
-
"img",
|
|
12471
|
-
{
|
|
12472
|
-
src: resolvedSpriteUrl,
|
|
12473
|
-
alt: config.label,
|
|
12474
|
-
className: "relative drop-shadow-lg",
|
|
12475
|
-
style: {
|
|
12476
|
-
width: `${3 * intensity}rem`,
|
|
12477
|
-
height: `${3 * intensity}rem`,
|
|
12478
|
-
objectFit: "contain",
|
|
12479
|
-
imageRendering: "pixelated"
|
|
12480
|
-
}
|
|
12481
|
-
}
|
|
12482
|
-
) : /* @__PURE__ */ jsx(
|
|
12483
|
-
"span",
|
|
12484
|
-
{
|
|
12485
|
-
className: "relative text-3xl drop-shadow-lg",
|
|
12486
|
-
style: { fontSize: `${2 * intensity}rem` },
|
|
12487
|
-
role: "img",
|
|
12488
|
-
"aria-label": config.label,
|
|
12489
|
-
children: config.emoji
|
|
12490
|
-
}
|
|
12491
|
-
)
|
|
12492
|
-
]
|
|
12493
|
-
}
|
|
12494
|
-
);
|
|
12495
|
-
}
|
|
12496
|
-
function CanvasEffect({
|
|
12497
|
-
effectSpriteUrl,
|
|
12498
|
-
assetBaseUrl,
|
|
12499
|
-
...props
|
|
12500
|
-
}) {
|
|
12501
|
-
const eventBus = useEventBus();
|
|
12502
|
-
const mergedProps = { effectSpriteUrl, assetBaseUrl, ...props };
|
|
12503
|
-
const { completeEvent, onComplete, ...rest } = mergedProps;
|
|
12504
|
-
const handleComplete = useCallback(() => {
|
|
12505
|
-
if (completeEvent) eventBus.emit(`UI:${completeEvent}`, {});
|
|
12506
|
-
onComplete?.();
|
|
12507
|
-
}, [completeEvent, eventBus, onComplete]);
|
|
12508
|
-
const enhancedProps = { ...rest, onComplete: handleComplete };
|
|
12509
|
-
if (rest.assetManifest) {
|
|
12510
|
-
return /* @__PURE__ */ jsx(CanvasEffectEngine, { ...enhancedProps, assetManifest: rest.assetManifest });
|
|
12511
|
-
}
|
|
12512
|
-
return /* @__PURE__ */ jsx(EmojiEffect, { ...enhancedProps });
|
|
12513
|
-
}
|
|
12514
|
-
var ACTION_EMOJI;
|
|
12515
|
-
var init_CanvasEffect = __esm({
|
|
12516
|
-
"components/game/2d/organisms/CanvasEffect.tsx"() {
|
|
12517
|
-
"use client";
|
|
12518
|
-
init_cn();
|
|
12519
|
-
init_useEventBus();
|
|
12520
|
-
init_Box();
|
|
12521
|
-
init_effects();
|
|
12522
|
-
init_canvasEffects();
|
|
12523
|
-
init_combatPresets();
|
|
12524
|
-
ACTION_EMOJI = {
|
|
12525
|
-
melee: { emoji: "\u2694\uFE0F", color: "var(--color-error)", label: "Slash" },
|
|
12526
|
-
ranged: { emoji: "\u{1F3F9}", color: "var(--color-warning)", label: "Arrow" },
|
|
12527
|
-
magic: { emoji: "\u2728", color: "var(--color-primary)", label: "Spell" },
|
|
12528
|
-
heal: { emoji: "\u{1F49A}", color: "var(--color-success)", label: "Heal" },
|
|
12529
|
-
buff: { emoji: "\u2B06\uFE0F", color: "var(--color-info)", label: "Buff" },
|
|
12530
|
-
debuff: { emoji: "\u2B07\uFE0F", color: "var(--color-warning)", label: "Debuff" },
|
|
12531
|
-
shield: { emoji: "\u{1F6E1}\uFE0F", color: "var(--color-info)", label: "Shield" },
|
|
12532
|
-
aoe: { emoji: "\u{1F4A5}", color: "var(--color-error)", label: "Explosion" },
|
|
12533
|
-
critical: { emoji: "\u{1F525}", color: "var(--color-error)", label: "Critical" },
|
|
12534
|
-
defend: { emoji: "\u{1F6E1}\uFE0F", color: "var(--color-info)", label: "Defend" },
|
|
12535
|
-
hit: { emoji: "\u{1F4A5}", color: "var(--color-error)", label: "Hit" },
|
|
12536
|
-
death: { emoji: "\u{1F480}", color: "var(--color-error)", label: "Death" }
|
|
12537
|
-
};
|
|
12538
|
-
CanvasEffect.displayName = "CanvasEffect";
|
|
12539
|
-
}
|
|
12540
|
-
});
|
|
12541
|
-
var init_useCanvasEffects = __esm({
|
|
12542
|
-
"components/game/shared/hooks/useCanvasEffects.ts"() {
|
|
12543
|
-
"use client";
|
|
12544
|
-
}
|
|
12545
|
-
});
|
|
12546
11273
|
var init_useGameAudio = __esm({
|
|
12547
11274
|
"components/game/shared/hooks/useGameAudio.ts"() {
|
|
12548
11275
|
"use client";
|
|
@@ -15162,7 +13889,7 @@ function NegotiatorBoard({
|
|
|
15162
13889
|
useEffect(() => {
|
|
15163
13890
|
if (currentRound > prevRoundRef.current && lastPlayerAction) {
|
|
15164
13891
|
const opponentPayoffEntry = payoffMatrix.find(
|
|
15165
|
-
(
|
|
13892
|
+
(p) => p.playerAction === lastPlayerAction && p.opponentAction === lastOpponentAction
|
|
15166
13893
|
);
|
|
15167
13894
|
setHistory((prev) => [
|
|
15168
13895
|
...prev,
|
|
@@ -15448,14 +14175,14 @@ function SimulationCanvas({
|
|
|
15448
14175
|
const ctx = canvas.getContext("2d");
|
|
15449
14176
|
if (!ctx) return;
|
|
15450
14177
|
const bodies = bodiesRef.current;
|
|
15451
|
-
const
|
|
14178
|
+
const p = presetRef.current;
|
|
15452
14179
|
const w = widthRef.current;
|
|
15453
14180
|
const h = heightRef.current;
|
|
15454
14181
|
ctx.clearRect(0, 0, w, h);
|
|
15455
|
-
ctx.fillStyle =
|
|
14182
|
+
ctx.fillStyle = p.backgroundColor ?? "#1a1a2e";
|
|
15456
14183
|
ctx.fillRect(0, 0, w, h);
|
|
15457
|
-
if (
|
|
15458
|
-
for (const c of
|
|
14184
|
+
if (p.constraints) {
|
|
14185
|
+
for (const c of p.constraints) {
|
|
15459
14186
|
const a = bodies[c.bodyA];
|
|
15460
14187
|
const b = bodies[c.bodyB];
|
|
15461
14188
|
if (a && b) {
|
|
@@ -15478,7 +14205,7 @@ function SimulationCanvas({
|
|
|
15478
14205
|
ctx.arc(pos.x, pos.y, body.radius, 0, Math.PI * 2);
|
|
15479
14206
|
ctx.fillStyle = body.color ?? "#e94560";
|
|
15480
14207
|
ctx.fill();
|
|
15481
|
-
if (
|
|
14208
|
+
if (p.showVelocity) {
|
|
15482
14209
|
ctx.beginPath();
|
|
15483
14210
|
ctx.moveTo(pos.x, pos.y);
|
|
15484
14211
|
ctx.lineTo(pos.x + body.vx * 0.1, pos.y + body.vy * 0.1);
|
|
@@ -15737,7 +14464,6 @@ var init_GameShell = __esm({
|
|
|
15737
14464
|
var init_molecules = __esm({
|
|
15738
14465
|
"components/game/2d/molecules/index.ts"() {
|
|
15739
14466
|
init_shared();
|
|
15740
|
-
init_useCanvasEffects();
|
|
15741
14467
|
init_puzzleObject();
|
|
15742
14468
|
}
|
|
15743
14469
|
});
|
|
@@ -15778,8 +14504,8 @@ function shapeBounds(shape) {
|
|
|
15778
14504
|
case "polygon":
|
|
15779
14505
|
if (!shape.points || shape.points.length === 0) return null;
|
|
15780
14506
|
{
|
|
15781
|
-
const xs = shape.points.map((
|
|
15782
|
-
const ys = shape.points.map((
|
|
14507
|
+
const xs = shape.points.map((p) => p.x);
|
|
14508
|
+
const ys = shape.points.map((p) => p.y);
|
|
15783
14509
|
const minX = Math.min(...xs);
|
|
15784
14510
|
const minY = Math.min(...ys);
|
|
15785
14511
|
return {
|
|
@@ -15905,13 +14631,13 @@ function drawShape(ctx, shape, width, height) {
|
|
|
15905
14631
|
}
|
|
15906
14632
|
case "path": {
|
|
15907
14633
|
if (!shape.path) break;
|
|
15908
|
-
const
|
|
14634
|
+
const p = new Path2D(shape.path);
|
|
15909
14635
|
if (fill) {
|
|
15910
14636
|
ctx.fillStyle = fill;
|
|
15911
|
-
ctx.fill(
|
|
14637
|
+
ctx.fill(p);
|
|
15912
14638
|
}
|
|
15913
14639
|
ctx.strokeStyle = stroke;
|
|
15914
|
-
ctx.stroke(
|
|
14640
|
+
ctx.stroke(p);
|
|
15915
14641
|
break;
|
|
15916
14642
|
}
|
|
15917
14643
|
case "text": {
|
|
@@ -21371,7 +20097,7 @@ function renderStateMachineToDomData(stateMachine, options = {}, config = DEFAUL
|
|
|
21371
20097
|
}
|
|
21372
20098
|
let domOutputs;
|
|
21373
20099
|
if (outputs.length > 0) {
|
|
21374
|
-
const maxX = Math.max(...Object.values(positions).map((
|
|
20100
|
+
const maxX = Math.max(...Object.values(positions).map((p) => p.x));
|
|
21375
20101
|
const maxOutputLength = Math.max(...outputs.map((o) => o.length));
|
|
21376
20102
|
const boxWidth = Math.max(200, maxOutputLength * 7 + 30);
|
|
21377
20103
|
const lineHeight = 22;
|
|
@@ -22353,7 +21079,7 @@ var init_BookViewer = __esm({
|
|
|
22353
21079
|
}
|
|
22354
21080
|
});
|
|
22355
21081
|
function BoxPattern({
|
|
22356
|
-
p
|
|
21082
|
+
p,
|
|
22357
21083
|
m,
|
|
22358
21084
|
bg = "transparent",
|
|
22359
21085
|
border = false,
|
|
@@ -22366,7 +21092,7 @@ function BoxPattern({
|
|
|
22366
21092
|
return /* @__PURE__ */ jsx(
|
|
22367
21093
|
Box,
|
|
22368
21094
|
{
|
|
22369
|
-
padding:
|
|
21095
|
+
padding: p,
|
|
22370
21096
|
margin: m,
|
|
22371
21097
|
bg,
|
|
22372
21098
|
border,
|
|
@@ -24068,10 +22794,10 @@ var init_Chart = __esm({
|
|
|
24068
22794
|
const set = [];
|
|
24069
22795
|
const seen = /* @__PURE__ */ new Set();
|
|
24070
22796
|
for (const s of series) {
|
|
24071
|
-
for (const
|
|
24072
|
-
if (!seen.has(
|
|
24073
|
-
seen.add(
|
|
24074
|
-
set.push(
|
|
22797
|
+
for (const p of s.data) {
|
|
22798
|
+
if (!seen.has(p.label)) {
|
|
22799
|
+
seen.add(p.label);
|
|
22800
|
+
set.push(p.label);
|
|
24075
22801
|
}
|
|
24076
22802
|
}
|
|
24077
22803
|
}
|
|
@@ -24079,8 +22805,8 @@ var init_Chart = __esm({
|
|
|
24079
22805
|
}, [series]);
|
|
24080
22806
|
const valueAt = useCallback(
|
|
24081
22807
|
(s, label) => {
|
|
24082
|
-
const
|
|
24083
|
-
return
|
|
22808
|
+
const p = s.data.find((d) => d.label === label);
|
|
22809
|
+
return p ? p.value : 0;
|
|
24084
22810
|
},
|
|
24085
22811
|
[]
|
|
24086
22812
|
);
|
|
@@ -24097,7 +22823,7 @@ var init_Chart = __esm({
|
|
|
24097
22823
|
}
|
|
24098
22824
|
let m = 1;
|
|
24099
22825
|
for (const s of series) {
|
|
24100
|
-
for (const
|
|
22826
|
+
for (const p of s.data) if (p.value > m) m = p.value;
|
|
24101
22827
|
}
|
|
24102
22828
|
return m;
|
|
24103
22829
|
}, [series, stack, columnTotals]);
|
|
@@ -24357,10 +23083,10 @@ var init_Chart = __esm({
|
|
|
24357
23083
|
const seen = /* @__PURE__ */ new Set();
|
|
24358
23084
|
const out = [];
|
|
24359
23085
|
for (const s of series) {
|
|
24360
|
-
for (const
|
|
24361
|
-
if (!seen.has(
|
|
24362
|
-
seen.add(
|
|
24363
|
-
out.push(
|
|
23086
|
+
for (const p of s.data) {
|
|
23087
|
+
if (!seen.has(p.label)) {
|
|
23088
|
+
seen.add(p.label);
|
|
23089
|
+
out.push(p.label);
|
|
24364
23090
|
}
|
|
24365
23091
|
}
|
|
24366
23092
|
}
|
|
@@ -24369,7 +23095,7 @@ var init_Chart = __esm({
|
|
|
24369
23095
|
const maxValue = useMemo(() => {
|
|
24370
23096
|
let m = 1;
|
|
24371
23097
|
for (const s of series) {
|
|
24372
|
-
for (const
|
|
23098
|
+
for (const p of s.data) if (p.value > m) m = p.value;
|
|
24373
23099
|
}
|
|
24374
23100
|
return m;
|
|
24375
23101
|
}, [series]);
|
|
@@ -24416,7 +23142,7 @@ var init_Chart = __esm({
|
|
|
24416
23142
|
label
|
|
24417
23143
|
};
|
|
24418
23144
|
});
|
|
24419
|
-
const linePath = points.map((
|
|
23145
|
+
const linePath = points.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
|
|
24420
23146
|
const areaPath = `${linePath} L ${points[points.length - 1]?.x ?? 0} ${padding.top + chartHeight} L ${padding.left} ${padding.top + chartHeight} Z`;
|
|
24421
23147
|
return /* @__PURE__ */ jsxs("g", { children: [
|
|
24422
23148
|
fill && /* @__PURE__ */ jsx(
|
|
@@ -24439,19 +23165,19 @@ var init_Chart = __esm({
|
|
|
24439
23165
|
strokeDasharray: s.dashed ? "6 4" : void 0
|
|
24440
23166
|
}
|
|
24441
23167
|
),
|
|
24442
|
-
points.map((
|
|
23168
|
+
points.map((p, idx) => /* @__PURE__ */ jsxs("g", { children: [
|
|
24443
23169
|
/* @__PURE__ */ jsx(
|
|
24444
23170
|
"circle",
|
|
24445
23171
|
{
|
|
24446
|
-
cx:
|
|
24447
|
-
cy:
|
|
23172
|
+
cx: p.x,
|
|
23173
|
+
cy: p.y,
|
|
24448
23174
|
r: "4",
|
|
24449
23175
|
fill: "var(--color-card)",
|
|
24450
23176
|
stroke: color,
|
|
24451
23177
|
strokeWidth: "2",
|
|
24452
23178
|
className: "cursor-pointer",
|
|
24453
23179
|
onClick: () => onPointClick?.(
|
|
24454
|
-
{ label:
|
|
23180
|
+
{ label: p.label, value: p.value, color },
|
|
24455
23181
|
s.name
|
|
24456
23182
|
)
|
|
24457
23183
|
}
|
|
@@ -24459,13 +23185,13 @@ var init_Chart = __esm({
|
|
|
24459
23185
|
showValues && series.length === 1 && /* @__PURE__ */ jsx(
|
|
24460
23186
|
"text",
|
|
24461
23187
|
{
|
|
24462
|
-
x:
|
|
24463
|
-
y:
|
|
23188
|
+
x: p.x,
|
|
23189
|
+
y: p.y - 10,
|
|
24464
23190
|
textAnchor: "middle",
|
|
24465
23191
|
fill: "var(--color-foreground)",
|
|
24466
23192
|
fontSize: "10",
|
|
24467
23193
|
fontWeight: "500",
|
|
24468
|
-
children:
|
|
23194
|
+
children: p.value
|
|
24469
23195
|
}
|
|
24470
23196
|
)
|
|
24471
23197
|
] }, idx))
|
|
@@ -24500,11 +23226,11 @@ var init_Chart = __esm({
|
|
|
24500
23226
|
let mxX = data[0].x;
|
|
24501
23227
|
let mnY = data[0].y;
|
|
24502
23228
|
let mxY = data[0].y;
|
|
24503
|
-
for (const
|
|
24504
|
-
if (
|
|
24505
|
-
if (
|
|
24506
|
-
if (
|
|
24507
|
-
if (
|
|
23229
|
+
for (const p of data) {
|
|
23230
|
+
if (p.x < mnX) mnX = p.x;
|
|
23231
|
+
if (p.x > mxX) mxX = p.x;
|
|
23232
|
+
if (p.y < mnY) mnY = p.y;
|
|
23233
|
+
if (p.y > mxY) mxY = p.y;
|
|
24508
23234
|
}
|
|
24509
23235
|
return { minX: mnX, maxX: mxX, minY: mnY, maxY: mxY };
|
|
24510
23236
|
}, [data]);
|
|
@@ -24534,11 +23260,11 @@ var init_Chart = __esm({
|
|
|
24534
23260
|
frac
|
|
24535
23261
|
);
|
|
24536
23262
|
}),
|
|
24537
|
-
data.map((
|
|
24538
|
-
const cx = padding.left + (
|
|
24539
|
-
const cy = padding.top + chartHeight - (
|
|
24540
|
-
const r =
|
|
24541
|
-
const color =
|
|
23263
|
+
data.map((p, idx) => {
|
|
23264
|
+
const cx = padding.left + (p.x - minX) / rangeX * chartWidth;
|
|
23265
|
+
const cy = padding.top + chartHeight - (p.y - minY) / rangeY * chartHeight;
|
|
23266
|
+
const r = p.size ?? 5;
|
|
23267
|
+
const color = p.color ?? CHART_COLORS[idx % CHART_COLORS.length];
|
|
24542
23268
|
return /* @__PURE__ */ jsx(
|
|
24543
23269
|
"circle",
|
|
24544
23270
|
{
|
|
@@ -24550,13 +23276,13 @@ var init_Chart = __esm({
|
|
|
24550
23276
|
className: "cursor-pointer hover:opacity-100",
|
|
24551
23277
|
onClick: () => onPointClick?.(
|
|
24552
23278
|
{
|
|
24553
|
-
label:
|
|
24554
|
-
value:
|
|
23279
|
+
label: p.label ?? `(${p.x}, ${p.y})`,
|
|
23280
|
+
value: p.y,
|
|
24555
23281
|
color
|
|
24556
23282
|
},
|
|
24557
23283
|
"default"
|
|
24558
23284
|
),
|
|
24559
|
-
children: /* @__PURE__ */ jsx("title", { children:
|
|
23285
|
+
children: /* @__PURE__ */ jsx("title", { children: p.label ?? `(${p.x}, ${p.y})` })
|
|
24560
23286
|
},
|
|
24561
23287
|
idx
|
|
24562
23288
|
);
|
|
@@ -30636,7 +29362,7 @@ var init_LineChart = __esm({
|
|
|
30636
29362
|
}, [sortedData, width, height]);
|
|
30637
29363
|
const linePath = useMemo(() => {
|
|
30638
29364
|
if (points.length === 0) return "";
|
|
30639
|
-
return points.map((
|
|
29365
|
+
return points.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
|
|
30640
29366
|
}, [points]);
|
|
30641
29367
|
const areaPath = useMemo(() => {
|
|
30642
29368
|
if (points.length === 0 || !showArea) return "";
|
|
@@ -30836,18 +29562,18 @@ var init_MathCanvas = __esm({
|
|
|
30836
29562
|
});
|
|
30837
29563
|
}
|
|
30838
29564
|
}
|
|
30839
|
-
for (const
|
|
30840
|
-
if (
|
|
29565
|
+
for (const p of points) {
|
|
29566
|
+
if (p.x < xMin || p.x > xMax || p.y < yMin || p.y > yMax) continue;
|
|
30841
29567
|
out.push({
|
|
30842
29568
|
type: "circle",
|
|
30843
|
-
x: mapX(
|
|
30844
|
-
y: mapY(
|
|
30845
|
-
radius:
|
|
30846
|
-
color:
|
|
30847
|
-
fill:
|
|
29569
|
+
x: mapX(p.x),
|
|
29570
|
+
y: mapY(p.y),
|
|
29571
|
+
radius: p.radius ?? 4,
|
|
29572
|
+
color: p.color ?? "#dc2626",
|
|
29573
|
+
fill: p.color ?? "#dc2626"
|
|
30848
29574
|
});
|
|
30849
|
-
if (
|
|
30850
|
-
out.push({ type: "text", x: mapX(
|
|
29575
|
+
if (p.label) {
|
|
29576
|
+
out.push({ type: "text", x: mapX(p.x) + 8, y: mapY(p.y) - 8, text: p.label, color: "#111827", fontSize: 12 });
|
|
30851
29577
|
}
|
|
30852
29578
|
}
|
|
30853
29579
|
for (const v of vectors) {
|
|
@@ -31366,13 +30092,13 @@ var init_MapView = __esm({
|
|
|
31366
30092
|
shadowSize: [41, 41]
|
|
31367
30093
|
});
|
|
31368
30094
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
31369
|
-
const { useEffect:
|
|
30095
|
+
const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback99, useState: useState97 } = React95__default;
|
|
31370
30096
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
31371
30097
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
31372
30098
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
31373
30099
|
const map = useMap();
|
|
31374
|
-
const prevRef =
|
|
31375
|
-
|
|
30100
|
+
const prevRef = useRef65({ centerLat, centerLng, zoom });
|
|
30101
|
+
useEffect67(() => {
|
|
31376
30102
|
const prev = prevRef.current;
|
|
31377
30103
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
31378
30104
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -31383,7 +30109,7 @@ var init_MapView = __esm({
|
|
|
31383
30109
|
}
|
|
31384
30110
|
function MapClickHandler({ onMapClick }) {
|
|
31385
30111
|
const map = useMap();
|
|
31386
|
-
|
|
30112
|
+
useEffect67(() => {
|
|
31387
30113
|
if (!onMapClick) return;
|
|
31388
30114
|
const handler = (e) => {
|
|
31389
30115
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -31411,8 +30137,8 @@ var init_MapView = __esm({
|
|
|
31411
30137
|
showAttribution = true
|
|
31412
30138
|
}) {
|
|
31413
30139
|
const eventBus = useEventBus2();
|
|
31414
|
-
const [clickedPosition, setClickedPosition] =
|
|
31415
|
-
const handleMapClick =
|
|
30140
|
+
const [clickedPosition, setClickedPosition] = useState97(null);
|
|
30141
|
+
const handleMapClick = useCallback99((lat, lng) => {
|
|
31416
30142
|
if (showClickedPin) {
|
|
31417
30143
|
setClickedPosition({ lat, lng });
|
|
31418
30144
|
}
|
|
@@ -31421,7 +30147,7 @@ var init_MapView = __esm({
|
|
|
31421
30147
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
31422
30148
|
}
|
|
31423
30149
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
31424
|
-
const handleMarkerClick =
|
|
30150
|
+
const handleMarkerClick = useCallback99((marker) => {
|
|
31425
30151
|
onMarkerClick?.(marker);
|
|
31426
30152
|
if (markerClickEvent) {
|
|
31427
30153
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -32494,7 +31220,7 @@ function TableView({
|
|
|
32494
31220
|
children: [
|
|
32495
31221
|
header,
|
|
32496
31222
|
dnd.wrapContainer(body),
|
|
32497
|
-
hasMore && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setVisibleCount((
|
|
31223
|
+
hasMore && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setVisibleCount((p) => p + (pageSize || 5)), children: [
|
|
32498
31224
|
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
32499
31225
|
t("common.showMore"),
|
|
32500
31226
|
" (",
|
|
@@ -35078,7 +33804,7 @@ var init_QrScanner = __esm({
|
|
|
35078
33804
|
setCurrentFacing((f3) => f3 === "environment" ? "user" : "environment");
|
|
35079
33805
|
}, []);
|
|
35080
33806
|
const togglePause = useCallback(() => {
|
|
35081
|
-
setIsPaused((
|
|
33807
|
+
setIsPaused((p) => !p);
|
|
35082
33808
|
}, []);
|
|
35083
33809
|
const handleMockScan = useCallback(() => {
|
|
35084
33810
|
const result = {
|
|
@@ -38000,10 +36726,10 @@ var init_ModuleCard = __esm({
|
|
|
38000
36726
|
] })
|
|
38001
36727
|
] }, trait.name);
|
|
38002
36728
|
}),
|
|
38003
|
-
pages.length > 0 && /* @__PURE__ */ jsx("div", { className: "px-3 py-1.5 flex items-center gap-2 flex-wrap", children: pages.map((
|
|
36729
|
+
pages.length > 0 && /* @__PURE__ */ jsx("div", { className: "px-3 py-1.5 flex items-center gap-2 flex-wrap", children: pages.map((p) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
38004
36730
|
/* @__PURE__ */ jsx("svg", { width: 10, height: 10, viewBox: "0 0 12 12", children: /* @__PURE__ */ jsx(AvlPage, { x: 6, y: 6, size: 5 }) }),
|
|
38005
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-mono text-[var(--color-muted-foreground)]", children:
|
|
38006
|
-
] },
|
|
36731
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-mono text-[var(--color-muted-foreground)]", children: p.route })
|
|
36732
|
+
] }, p.name)) })
|
|
38007
36733
|
]
|
|
38008
36734
|
}
|
|
38009
36735
|
);
|
|
@@ -39539,12 +38265,12 @@ var init_DocumentViewer = __esm({
|
|
|
39539
38265
|
const handleZoomIn = useCallback(() => setZoom((z) => Math.min(z + 25, 200)), []);
|
|
39540
38266
|
const handleZoomOut = useCallback(() => setZoom((z) => Math.max(z - 25, 50)), []);
|
|
39541
38267
|
const handlePagePrev = useCallback(() => {
|
|
39542
|
-
setCurrentPage((
|
|
38268
|
+
setCurrentPage((p) => Math.max(p - 1, 1));
|
|
39543
38269
|
eventBus.emit("UI:DOCUMENT_PAGE_CHANGE", { page: currentPage - 1 });
|
|
39544
38270
|
}, [eventBus, currentPage]);
|
|
39545
38271
|
const handlePageNext = useCallback(() => {
|
|
39546
38272
|
if (totalPages) {
|
|
39547
|
-
setCurrentPage((
|
|
38273
|
+
setCurrentPage((p) => Math.min(p + 1, totalPages));
|
|
39548
38274
|
eventBus.emit("UI:DOCUMENT_PAGE_CHANGE", { page: currentPage + 1 });
|
|
39549
38275
|
}
|
|
39550
38276
|
}, [totalPages, eventBus, currentPage]);
|
|
@@ -43646,7 +42372,7 @@ function WalkMinimap() {
|
|
|
43646
42372
|
const graphH = 120;
|
|
43647
42373
|
const nodeR = 10;
|
|
43648
42374
|
const positions = activeTrait ? layoutGraph(activeTrait.states, activeTrait.transitions, activeTrait.initialState, graphW, graphH) : [];
|
|
43649
|
-
const posMap = new Map(positions.map((
|
|
42375
|
+
const posMap = new Map(positions.map((p) => [p.state, p]));
|
|
43650
42376
|
const visitedStates = new Set(
|
|
43651
42377
|
coveredEdges.filter((e) => e.trait === walkStep.traitName).flatMap((e) => [e.from, e.to])
|
|
43652
42378
|
);
|
|
@@ -46916,7 +45642,6 @@ var init_component_registry_generated = __esm({
|
|
|
46916
45642
|
init_CTABanner();
|
|
46917
45643
|
init_CalendarGrid();
|
|
46918
45644
|
init_Canvas2D();
|
|
46919
|
-
init_CanvasEffect();
|
|
46920
45645
|
init_Card();
|
|
46921
45646
|
init_CardGrid();
|
|
46922
45647
|
init_Carousel();
|
|
@@ -47215,7 +45940,6 @@ var init_component_registry_generated = __esm({
|
|
|
47215
45940
|
"CTABanner": CTABanner,
|
|
47216
45941
|
"CalendarGrid": CalendarGrid,
|
|
47217
45942
|
"Canvas2D": Canvas2D,
|
|
47218
|
-
"CanvasEffect": CanvasEffect,
|
|
47219
45943
|
"Card": Card,
|
|
47220
45944
|
"CardGrid": CardGrid,
|
|
47221
45945
|
"Carousel": Carousel,
|
|
@@ -48459,12 +47183,12 @@ function isFnFormLambda(value) {
|
|
|
48459
47183
|
return false;
|
|
48460
47184
|
}
|
|
48461
47185
|
const params = arr[1];
|
|
48462
|
-
return typeof params === "string" || Array.isArray(params) && params.length > 0 && params.every((
|
|
47186
|
+
return typeof params === "string" || Array.isArray(params) && params.length > 0 && params.every((p) => typeof p === "string");
|
|
48463
47187
|
}
|
|
48464
47188
|
function fnFormParams(value) {
|
|
48465
|
-
const
|
|
48466
|
-
if (typeof
|
|
48467
|
-
if (Array.isArray(
|
|
47189
|
+
const p = value[1];
|
|
47190
|
+
if (typeof p === "string") return [p];
|
|
47191
|
+
if (Array.isArray(p)) return p.filter((x) => typeof x === "string");
|
|
48468
47192
|
return [];
|
|
48469
47193
|
}
|
|
48470
47194
|
function resolveLambdaBindings(body, params, item, index) {
|
|
@@ -49964,9 +48688,9 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
|
|
|
49964
48688
|
const orbitalsByTrait = useMemo(
|
|
49965
48689
|
() => buildOrbitalsByTrait(
|
|
49966
48690
|
schema,
|
|
49967
|
-
ir ? Array.from(ir.pages.values()).map((
|
|
49968
|
-
path:
|
|
49969
|
-
traitNames:
|
|
48691
|
+
ir ? Array.from(ir.pages.values()).map((p) => ({
|
|
48692
|
+
path: p.path,
|
|
48693
|
+
traitNames: p.traits.map((b) => b.trait.name)
|
|
49970
48694
|
})) : []
|
|
49971
48695
|
),
|
|
49972
48696
|
[schema, ir]
|
|
@@ -50155,7 +48879,7 @@ function OrbPreview({
|
|
|
50155
48879
|
navLog.debug("handleNavigate", () => ({
|
|
50156
48880
|
path,
|
|
50157
48881
|
matched: match?.page.name ?? null,
|
|
50158
|
-
availablePaths: pages.map((
|
|
48882
|
+
availablePaths: pages.map((p) => p.page.path)
|
|
50159
48883
|
}));
|
|
50160
48884
|
if (match) {
|
|
50161
48885
|
setCurrentPage(match.page.name);
|
|
@@ -50199,7 +48923,7 @@ function OrbPreview({
|
|
|
50199
48923
|
handleNavigate(href);
|
|
50200
48924
|
};
|
|
50201
48925
|
el.addEventListener("click", handler, true);
|
|
50202
|
-
navLog.info("interceptor:installed", { pageCount: pages.length, paths: pages.map((
|
|
48926
|
+
navLog.info("interceptor:installed", { pageCount: pages.length, paths: pages.map((p) => p.page.path) });
|
|
50203
48927
|
return () => el.removeEventListener("click", handler, true);
|
|
50204
48928
|
}, [pages, handleNavigate]);
|
|
50205
48929
|
return /* @__PURE__ */ jsxs(
|