@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.cjs
CHANGED
|
@@ -817,13 +817,13 @@ function useRenderInterpolation(options = {}) {
|
|
|
817
817
|
const prevMap = /* @__PURE__ */ new Map();
|
|
818
818
|
for (const e of prev.entities) prevMap.set(e.id, e);
|
|
819
819
|
for (const c of curr.entities) {
|
|
820
|
-
const
|
|
821
|
-
if (!
|
|
820
|
+
const p = prevMap.get(c.id);
|
|
821
|
+
if (!p) {
|
|
822
822
|
out.set(c.id, { x: c.x, y: c.y });
|
|
823
823
|
} else {
|
|
824
824
|
out.set(c.id, {
|
|
825
|
-
x:
|
|
826
|
-
y:
|
|
825
|
+
x: p.x + (c.x - p.x) * alpha,
|
|
826
|
+
y: p.y + (c.y - p.y) * alpha
|
|
827
827
|
});
|
|
828
828
|
}
|
|
829
829
|
}
|
|
@@ -1135,12 +1135,12 @@ function kebabToPascal(name) {
|
|
|
1135
1135
|
}).join("");
|
|
1136
1136
|
}
|
|
1137
1137
|
function loadLib(key, importer) {
|
|
1138
|
-
let
|
|
1139
|
-
if (!
|
|
1140
|
-
|
|
1141
|
-
libPromises.set(key,
|
|
1138
|
+
let p = libPromises.get(key);
|
|
1139
|
+
if (!p) {
|
|
1140
|
+
p = importer();
|
|
1141
|
+
libPromises.set(key, p);
|
|
1142
1142
|
}
|
|
1143
|
-
return
|
|
1143
|
+
return p;
|
|
1144
1144
|
}
|
|
1145
1145
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
1146
1146
|
const Lazy = React95__namespace.default.lazy(async () => {
|
|
@@ -6394,28 +6394,28 @@ var init_ConfettiEffect = __esm({
|
|
|
6394
6394
|
),
|
|
6395
6395
|
"aria-hidden": "true",
|
|
6396
6396
|
children: [
|
|
6397
|
-
particles.map((
|
|
6398
|
-
const rad =
|
|
6399
|
-
const tx = Math.cos(rad) *
|
|
6400
|
-
const ty = Math.sin(rad) *
|
|
6397
|
+
particles.map((p) => {
|
|
6398
|
+
const rad = p.angle * Math.PI / 180;
|
|
6399
|
+
const tx = Math.cos(rad) * p.distance;
|
|
6400
|
+
const ty = Math.sin(rad) * p.distance - 20;
|
|
6401
6401
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6402
6402
|
Box,
|
|
6403
6403
|
{
|
|
6404
6404
|
className: "absolute rounded-sm",
|
|
6405
6405
|
style: {
|
|
6406
|
-
left: `${
|
|
6406
|
+
left: `${p.left}%`,
|
|
6407
6407
|
top: "50%",
|
|
6408
|
-
width:
|
|
6409
|
-
height:
|
|
6410
|
-
backgroundColor:
|
|
6411
|
-
animation: `confetti-burst ${duration -
|
|
6408
|
+
width: p.size,
|
|
6409
|
+
height: p.size,
|
|
6410
|
+
backgroundColor: p.color,
|
|
6411
|
+
animation: `confetti-burst ${duration - p.delay}ms ease-out ${p.delay}ms forwards`,
|
|
6412
6412
|
opacity: 0,
|
|
6413
6413
|
"--confetti-tx": `${tx}px`,
|
|
6414
6414
|
"--confetti-ty": `${ty}px`,
|
|
6415
|
-
"--confetti-rotate": `${
|
|
6415
|
+
"--confetti-rotate": `${p.rotation}deg`
|
|
6416
6416
|
}
|
|
6417
6417
|
},
|
|
6418
|
-
|
|
6418
|
+
p.id
|
|
6419
6419
|
);
|
|
6420
6420
|
}),
|
|
6421
6421
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
@@ -7326,8 +7326,8 @@ var init_AnimatedGraphic = __esm({
|
|
|
7326
7326
|
const el = containerRef.current;
|
|
7327
7327
|
if (!el || !strokeColor) return;
|
|
7328
7328
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
7329
|
-
paths.forEach((
|
|
7330
|
-
|
|
7329
|
+
paths.forEach((p) => {
|
|
7330
|
+
p.style.stroke = strokeColor;
|
|
7331
7331
|
});
|
|
7332
7332
|
}, [resolvedSvg, strokeColor]);
|
|
7333
7333
|
React95.useEffect(() => {
|
|
@@ -7335,23 +7335,23 @@ var init_AnimatedGraphic = __esm({
|
|
|
7335
7335
|
if (!el || !resolvedSvg) return;
|
|
7336
7336
|
if (animation === "draw" || animation === "fill") {
|
|
7337
7337
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
7338
|
-
paths.forEach((
|
|
7339
|
-
if ("getTotalLength" in
|
|
7340
|
-
const len =
|
|
7341
|
-
|
|
7342
|
-
|
|
7338
|
+
paths.forEach((p) => {
|
|
7339
|
+
if ("getTotalLength" in p && typeof p.getTotalLength === "function") {
|
|
7340
|
+
const len = p.getTotalLength();
|
|
7341
|
+
p.style.strokeDasharray = `${len}`;
|
|
7342
|
+
p.style.strokeDashoffset = `${len}`;
|
|
7343
7343
|
}
|
|
7344
7344
|
if (animation === "fill") {
|
|
7345
|
-
|
|
7345
|
+
p.style.fillOpacity = "0";
|
|
7346
7346
|
}
|
|
7347
7347
|
});
|
|
7348
7348
|
}
|
|
7349
7349
|
if (animation === "morph") {
|
|
7350
7350
|
const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
7351
|
-
paths.forEach((
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7351
|
+
paths.forEach((p) => {
|
|
7352
|
+
p.style.transform = "scale(0)";
|
|
7353
|
+
p.style.transformOrigin = "center";
|
|
7354
|
+
p.style.opacity = "0";
|
|
7355
7355
|
});
|
|
7356
7356
|
}
|
|
7357
7357
|
}, [resolvedSvg, animation]);
|
|
@@ -7456,14 +7456,8 @@ var init_TraitFrame = __esm({
|
|
|
7456
7456
|
});
|
|
7457
7457
|
|
|
7458
7458
|
// components/game/shared/effects.ts
|
|
7459
|
-
var EMPTY_EFFECT_STATE;
|
|
7460
7459
|
var init_effects = __esm({
|
|
7461
7460
|
"components/game/shared/effects.ts"() {
|
|
7462
|
-
EMPTY_EFFECT_STATE = {
|
|
7463
|
-
particles: [],
|
|
7464
|
-
sequences: [],
|
|
7465
|
-
overlays: []
|
|
7466
|
-
};
|
|
7467
7461
|
}
|
|
7468
7462
|
});
|
|
7469
7463
|
|
|
@@ -7871,1021 +7865,12 @@ var init_spriteAnimation = __esm({
|
|
|
7871
7865
|
}
|
|
7872
7866
|
});
|
|
7873
7867
|
|
|
7874
|
-
// components/game/shared/combatPresets.ts
|
|
7875
|
-
function p(manifest, key) {
|
|
7876
|
-
const particles = manifest.particles;
|
|
7877
|
-
if (!particles) return [];
|
|
7878
|
-
const val = particles[key];
|
|
7879
|
-
if (Array.isArray(val)) return val.map((v) => `${manifest.baseUrl}/${v}`);
|
|
7880
|
-
if (typeof val === "string") return [`${manifest.baseUrl}/${val}`];
|
|
7881
|
-
return [];
|
|
7882
|
-
}
|
|
7883
|
-
function anim(manifest, key) {
|
|
7884
|
-
const animations = manifest.animations;
|
|
7885
|
-
if (!animations) return [];
|
|
7886
|
-
const val = animations[key];
|
|
7887
|
-
if (Array.isArray(val)) return val.map((v) => `${manifest.baseUrl}/${v}`);
|
|
7888
|
-
return [];
|
|
7889
|
-
}
|
|
7890
|
-
function createCombatPresets(manifest) {
|
|
7891
|
-
return {
|
|
7892
|
-
// =====================================================================
|
|
7893
|
-
// MELEE — slash (red) + dirt + scratch + flash sequence
|
|
7894
|
-
// =====================================================================
|
|
7895
|
-
melee: (originX, originY) => {
|
|
7896
|
-
const particles = [
|
|
7897
|
-
{
|
|
7898
|
-
spriteUrls: p(manifest, "slash"),
|
|
7899
|
-
count: 6,
|
|
7900
|
-
originX,
|
|
7901
|
-
originY,
|
|
7902
|
-
spread: 8,
|
|
7903
|
-
velocityMin: 40,
|
|
7904
|
-
velocityMax: 120,
|
|
7905
|
-
angleMin: -PI2 * 0.8,
|
|
7906
|
-
angleMax: -PI2 * 0.2,
|
|
7907
|
-
gravity: 0,
|
|
7908
|
-
tint: { r: 255, g: 60, b: 40 },
|
|
7909
|
-
scaleMin: 0.3,
|
|
7910
|
-
scaleMax: 0.6,
|
|
7911
|
-
lifetimeMin: 300,
|
|
7912
|
-
lifetimeMax: 500,
|
|
7913
|
-
fadeRate: -2.5
|
|
7914
|
-
},
|
|
7915
|
-
{
|
|
7916
|
-
spriteUrls: p(manifest, "dirt"),
|
|
7917
|
-
count: 4,
|
|
7918
|
-
originX,
|
|
7919
|
-
originY: originY + 10,
|
|
7920
|
-
spread: 12,
|
|
7921
|
-
velocityMin: 20,
|
|
7922
|
-
velocityMax: 60,
|
|
7923
|
-
angleMin: -PI2 * 0.9,
|
|
7924
|
-
angleMax: -PI2 * 0.1,
|
|
7925
|
-
gravity: 120,
|
|
7926
|
-
tint: { r: 180, g: 140, b: 90 },
|
|
7927
|
-
scaleMin: 0.15,
|
|
7928
|
-
scaleMax: 0.3,
|
|
7929
|
-
lifetimeMin: 400,
|
|
7930
|
-
lifetimeMax: 700,
|
|
7931
|
-
fadeRate: -1.8
|
|
7932
|
-
},
|
|
7933
|
-
{
|
|
7934
|
-
spriteUrls: p(manifest, "scratch"),
|
|
7935
|
-
count: 2,
|
|
7936
|
-
originX,
|
|
7937
|
-
originY,
|
|
7938
|
-
spread: 5,
|
|
7939
|
-
velocityMin: 10,
|
|
7940
|
-
velocityMax: 30,
|
|
7941
|
-
angleMin: -PI2 * 0.7,
|
|
7942
|
-
angleMax: -PI2 * 0.3,
|
|
7943
|
-
gravity: 0,
|
|
7944
|
-
tint: { r: 255, g: 200, b: 150 },
|
|
7945
|
-
scaleMin: 0.25,
|
|
7946
|
-
scaleMax: 0.4,
|
|
7947
|
-
lifetimeMin: 200,
|
|
7948
|
-
lifetimeMax: 400,
|
|
7949
|
-
fadeRate: -3
|
|
7950
|
-
}
|
|
7951
|
-
];
|
|
7952
|
-
const sequences = [];
|
|
7953
|
-
const flashFrames = anim(manifest, "flash");
|
|
7954
|
-
if (flashFrames.length > 0) {
|
|
7955
|
-
sequences.push({
|
|
7956
|
-
frameUrls: flashFrames,
|
|
7957
|
-
originX,
|
|
7958
|
-
originY,
|
|
7959
|
-
frameDuration: 35,
|
|
7960
|
-
scale: 0.4
|
|
7961
|
-
});
|
|
7962
|
-
}
|
|
7963
|
-
return {
|
|
7964
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
7965
|
-
sequences,
|
|
7966
|
-
overlays: [],
|
|
7967
|
-
screenShake: 4,
|
|
7968
|
-
screenFlash: null
|
|
7969
|
-
};
|
|
7970
|
-
},
|
|
7971
|
-
// =====================================================================
|
|
7972
|
-
// RANGED — muzzle + trace + smoke + explosion sequence
|
|
7973
|
-
// =====================================================================
|
|
7974
|
-
ranged: (originX, originY) => {
|
|
7975
|
-
const particles = [
|
|
7976
|
-
{
|
|
7977
|
-
spriteUrls: p(manifest, "muzzle"),
|
|
7978
|
-
count: 3,
|
|
7979
|
-
originX,
|
|
7980
|
-
originY,
|
|
7981
|
-
spread: 4,
|
|
7982
|
-
velocityMin: 60,
|
|
7983
|
-
velocityMax: 150,
|
|
7984
|
-
angleMin: -PI2 * 0.6,
|
|
7985
|
-
angleMax: -PI2 * 0.4,
|
|
7986
|
-
gravity: 0,
|
|
7987
|
-
tint: { r: 255, g: 220, b: 100 },
|
|
7988
|
-
scaleMin: 0.2,
|
|
7989
|
-
scaleMax: 0.4,
|
|
7990
|
-
lifetimeMin: 200,
|
|
7991
|
-
lifetimeMax: 400,
|
|
7992
|
-
fadeRate: -3
|
|
7993
|
-
},
|
|
7994
|
-
{
|
|
7995
|
-
spriteUrls: p(manifest, "trace"),
|
|
7996
|
-
count: 5,
|
|
7997
|
-
originX,
|
|
7998
|
-
originY,
|
|
7999
|
-
spread: 3,
|
|
8000
|
-
velocityMin: 100,
|
|
8001
|
-
velocityMax: 200,
|
|
8002
|
-
angleMin: -PI2 * 0.55,
|
|
8003
|
-
angleMax: -PI2 * 0.45,
|
|
8004
|
-
gravity: 0,
|
|
8005
|
-
tint: { r: 255, g: 200, b: 80 },
|
|
8006
|
-
scaleMin: 0.15,
|
|
8007
|
-
scaleMax: 0.3,
|
|
8008
|
-
lifetimeMin: 150,
|
|
8009
|
-
lifetimeMax: 300,
|
|
8010
|
-
fadeRate: -4
|
|
8011
|
-
},
|
|
8012
|
-
{
|
|
8013
|
-
spriteUrls: p(manifest, "smoke").slice(0, 3),
|
|
8014
|
-
count: 3,
|
|
8015
|
-
originX,
|
|
8016
|
-
originY: originY + 5,
|
|
8017
|
-
spread: 6,
|
|
8018
|
-
velocityMin: 10,
|
|
8019
|
-
velocityMax: 30,
|
|
8020
|
-
angleMin: -PI2 * 0.8,
|
|
8021
|
-
angleMax: -PI2 * 0.2,
|
|
8022
|
-
gravity: -20,
|
|
8023
|
-
tint: { r: 200, g: 200, b: 200 },
|
|
8024
|
-
scaleMin: 0.2,
|
|
8025
|
-
scaleMax: 0.35,
|
|
8026
|
-
lifetimeMin: 500,
|
|
8027
|
-
lifetimeMax: 800,
|
|
8028
|
-
fadeRate: -1.5
|
|
8029
|
-
}
|
|
8030
|
-
];
|
|
8031
|
-
const sequences = [];
|
|
8032
|
-
const explosionFrames = anim(manifest, "smokeExplosion");
|
|
8033
|
-
if (explosionFrames.length > 0) {
|
|
8034
|
-
sequences.push({
|
|
8035
|
-
frameUrls: explosionFrames,
|
|
8036
|
-
originX,
|
|
8037
|
-
originY,
|
|
8038
|
-
frameDuration: 50,
|
|
8039
|
-
scale: 0.35
|
|
8040
|
-
});
|
|
8041
|
-
}
|
|
8042
|
-
return {
|
|
8043
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8044
|
-
sequences,
|
|
8045
|
-
overlays: [],
|
|
8046
|
-
screenShake: 2,
|
|
8047
|
-
screenFlash: null
|
|
8048
|
-
};
|
|
8049
|
-
},
|
|
8050
|
-
// =====================================================================
|
|
8051
|
-
// MAGIC — twirl (purple) + spark (purple) + star
|
|
8052
|
-
// =====================================================================
|
|
8053
|
-
magic: (originX, originY) => {
|
|
8054
|
-
const particles = [
|
|
8055
|
-
{
|
|
8056
|
-
spriteUrls: p(manifest, "twirl"),
|
|
8057
|
-
count: 5,
|
|
8058
|
-
originX,
|
|
8059
|
-
originY,
|
|
8060
|
-
spread: 15,
|
|
8061
|
-
velocityMin: 20,
|
|
8062
|
-
velocityMax: 80,
|
|
8063
|
-
angleMin: 0,
|
|
8064
|
-
angleMax: PI2 * 2,
|
|
8065
|
-
gravity: -30,
|
|
8066
|
-
tint: { r: 180, g: 80, b: 255 },
|
|
8067
|
-
scaleMin: 0.2,
|
|
8068
|
-
scaleMax: 0.5,
|
|
8069
|
-
lifetimeMin: 500,
|
|
8070
|
-
lifetimeMax: 900,
|
|
8071
|
-
fadeRate: -1.2,
|
|
8072
|
-
blendMode: "lighter",
|
|
8073
|
-
rotationSpeedMin: -4,
|
|
8074
|
-
rotationSpeedMax: 4
|
|
8075
|
-
},
|
|
8076
|
-
{
|
|
8077
|
-
spriteUrls: p(manifest, "spark"),
|
|
8078
|
-
count: 8,
|
|
8079
|
-
originX,
|
|
8080
|
-
originY,
|
|
8081
|
-
spread: 20,
|
|
8082
|
-
velocityMin: 30,
|
|
8083
|
-
velocityMax: 100,
|
|
8084
|
-
angleMin: 0,
|
|
8085
|
-
angleMax: PI2 * 2,
|
|
8086
|
-
gravity: -15,
|
|
8087
|
-
tint: { r: 200, g: 120, b: 255 },
|
|
8088
|
-
scaleMin: 0.1,
|
|
8089
|
-
scaleMax: 0.25,
|
|
8090
|
-
lifetimeMin: 300,
|
|
8091
|
-
lifetimeMax: 600,
|
|
8092
|
-
fadeRate: -2,
|
|
8093
|
-
blendMode: "lighter"
|
|
8094
|
-
},
|
|
8095
|
-
{
|
|
8096
|
-
spriteUrls: p(manifest, "star"),
|
|
8097
|
-
count: 4,
|
|
8098
|
-
originX,
|
|
8099
|
-
originY,
|
|
8100
|
-
spread: 10,
|
|
8101
|
-
velocityMin: 15,
|
|
8102
|
-
velocityMax: 50,
|
|
8103
|
-
angleMin: -PI2,
|
|
8104
|
-
angleMax: 0,
|
|
8105
|
-
gravity: -40,
|
|
8106
|
-
tint: { r: 220, g: 180, b: 255 },
|
|
8107
|
-
scaleMin: 0.15,
|
|
8108
|
-
scaleMax: 0.3,
|
|
8109
|
-
lifetimeMin: 600,
|
|
8110
|
-
lifetimeMax: 1e3,
|
|
8111
|
-
fadeRate: -1,
|
|
8112
|
-
blendMode: "lighter"
|
|
8113
|
-
}
|
|
8114
|
-
];
|
|
8115
|
-
const overlays = [];
|
|
8116
|
-
const circleUrls = p(manifest, "circle");
|
|
8117
|
-
if (circleUrls.length > 0) {
|
|
8118
|
-
overlays.push({
|
|
8119
|
-
spriteUrl: circleUrls[0],
|
|
8120
|
-
originX,
|
|
8121
|
-
originY,
|
|
8122
|
-
alpha: 0.5,
|
|
8123
|
-
fadeRate: -0.6,
|
|
8124
|
-
pulseAmplitude: 0.2,
|
|
8125
|
-
pulseFrequency: 3,
|
|
8126
|
-
scale: 0.5,
|
|
8127
|
-
blendMode: "lighter",
|
|
8128
|
-
lifetime: 1200
|
|
8129
|
-
});
|
|
8130
|
-
}
|
|
8131
|
-
return {
|
|
8132
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8133
|
-
sequences: [],
|
|
8134
|
-
overlays,
|
|
8135
|
-
screenShake: 0,
|
|
8136
|
-
screenFlash: null
|
|
8137
|
-
};
|
|
8138
|
-
},
|
|
8139
|
-
// =====================================================================
|
|
8140
|
-
// HEAL — circle (green) + star (green) + light (green, pulse)
|
|
8141
|
-
// =====================================================================
|
|
8142
|
-
heal: (originX, originY) => {
|
|
8143
|
-
const particles = [
|
|
8144
|
-
{
|
|
8145
|
-
spriteUrls: p(manifest, "circle"),
|
|
8146
|
-
count: 6,
|
|
8147
|
-
originX,
|
|
8148
|
-
originY,
|
|
8149
|
-
spread: 15,
|
|
8150
|
-
velocityMin: 10,
|
|
8151
|
-
velocityMax: 40,
|
|
8152
|
-
angleMin: -PI2,
|
|
8153
|
-
angleMax: -PI2 * 0.3,
|
|
8154
|
-
gravity: -50,
|
|
8155
|
-
tint: { r: 80, g: 255, b: 120 },
|
|
8156
|
-
scaleMin: 0.15,
|
|
8157
|
-
scaleMax: 0.35,
|
|
8158
|
-
lifetimeMin: 600,
|
|
8159
|
-
lifetimeMax: 1e3,
|
|
8160
|
-
fadeRate: -0.8,
|
|
8161
|
-
blendMode: "lighter"
|
|
8162
|
-
},
|
|
8163
|
-
{
|
|
8164
|
-
spriteUrls: p(manifest, "star"),
|
|
8165
|
-
count: 5,
|
|
8166
|
-
originX,
|
|
8167
|
-
originY,
|
|
8168
|
-
spread: 12,
|
|
8169
|
-
velocityMin: 15,
|
|
8170
|
-
velocityMax: 50,
|
|
8171
|
-
angleMin: -PI2 * 0.9,
|
|
8172
|
-
angleMax: -PI2 * 0.1,
|
|
8173
|
-
gravity: -60,
|
|
8174
|
-
tint: { r: 100, g: 255, b: 140 },
|
|
8175
|
-
scaleMin: 0.1,
|
|
8176
|
-
scaleMax: 0.2,
|
|
8177
|
-
lifetimeMin: 500,
|
|
8178
|
-
lifetimeMax: 800,
|
|
8179
|
-
fadeRate: -1.2,
|
|
8180
|
-
blendMode: "lighter"
|
|
8181
|
-
}
|
|
8182
|
-
];
|
|
8183
|
-
const overlays = [];
|
|
8184
|
-
const lightUrls = p(manifest, "light");
|
|
8185
|
-
if (lightUrls.length > 0) {
|
|
8186
|
-
overlays.push({
|
|
8187
|
-
spriteUrl: lightUrls[0],
|
|
8188
|
-
originX,
|
|
8189
|
-
originY,
|
|
8190
|
-
alpha: 0.6,
|
|
8191
|
-
fadeRate: -0.4,
|
|
8192
|
-
pulseAmplitude: 0.25,
|
|
8193
|
-
pulseFrequency: 2.5,
|
|
8194
|
-
scale: 0.6,
|
|
8195
|
-
blendMode: "lighter",
|
|
8196
|
-
lifetime: 1500
|
|
8197
|
-
});
|
|
8198
|
-
}
|
|
8199
|
-
return {
|
|
8200
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8201
|
-
sequences: [],
|
|
8202
|
-
overlays,
|
|
8203
|
-
screenShake: 0,
|
|
8204
|
-
screenFlash: null
|
|
8205
|
-
};
|
|
8206
|
-
},
|
|
8207
|
-
// =====================================================================
|
|
8208
|
-
// DEFEND / SHIELD — star (blue) + circle (blue, pulse)
|
|
8209
|
-
// =====================================================================
|
|
8210
|
-
defend: (originX, originY) => {
|
|
8211
|
-
const particles = [
|
|
8212
|
-
{
|
|
8213
|
-
spriteUrls: p(manifest, "star"),
|
|
8214
|
-
count: 8,
|
|
8215
|
-
originX,
|
|
8216
|
-
originY,
|
|
8217
|
-
spread: 18,
|
|
8218
|
-
velocityMin: 10,
|
|
8219
|
-
velocityMax: 35,
|
|
8220
|
-
angleMin: 0,
|
|
8221
|
-
angleMax: PI2 * 2,
|
|
8222
|
-
gravity: 0,
|
|
8223
|
-
tint: { r: 80, g: 160, b: 255 },
|
|
8224
|
-
scaleMin: 0.12,
|
|
8225
|
-
scaleMax: 0.25,
|
|
8226
|
-
lifetimeMin: 600,
|
|
8227
|
-
lifetimeMax: 1e3,
|
|
8228
|
-
fadeRate: -0.8,
|
|
8229
|
-
blendMode: "lighter",
|
|
8230
|
-
rotationSpeedMin: -1,
|
|
8231
|
-
rotationSpeedMax: 1
|
|
8232
|
-
}
|
|
8233
|
-
];
|
|
8234
|
-
const overlays = [];
|
|
8235
|
-
const circleUrls = p(manifest, "circle");
|
|
8236
|
-
if (circleUrls.length > 0) {
|
|
8237
|
-
overlays.push({
|
|
8238
|
-
spriteUrl: circleUrls[0],
|
|
8239
|
-
originX,
|
|
8240
|
-
originY,
|
|
8241
|
-
alpha: 0.6,
|
|
8242
|
-
fadeRate: -0.3,
|
|
8243
|
-
pulseAmplitude: 0.2,
|
|
8244
|
-
pulseFrequency: 2,
|
|
8245
|
-
scale: 0.6,
|
|
8246
|
-
blendMode: "lighter",
|
|
8247
|
-
lifetime: 1500
|
|
8248
|
-
});
|
|
8249
|
-
}
|
|
8250
|
-
return {
|
|
8251
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8252
|
-
sequences: [],
|
|
8253
|
-
overlays,
|
|
8254
|
-
screenShake: 0,
|
|
8255
|
-
screenFlash: null
|
|
8256
|
-
};
|
|
8257
|
-
},
|
|
8258
|
-
// shield aliases to defend
|
|
8259
|
-
shield: (originX, originY) => {
|
|
8260
|
-
const particles = [
|
|
8261
|
-
{
|
|
8262
|
-
spriteUrls: p(manifest, "star"),
|
|
8263
|
-
count: 10,
|
|
8264
|
-
originX,
|
|
8265
|
-
originY,
|
|
8266
|
-
spread: 20,
|
|
8267
|
-
velocityMin: 8,
|
|
8268
|
-
velocityMax: 30,
|
|
8269
|
-
angleMin: 0,
|
|
8270
|
-
angleMax: PI2 * 2,
|
|
8271
|
-
gravity: 0,
|
|
8272
|
-
tint: { r: 60, g: 180, b: 255 },
|
|
8273
|
-
scaleMin: 0.1,
|
|
8274
|
-
scaleMax: 0.22,
|
|
8275
|
-
lifetimeMin: 700,
|
|
8276
|
-
lifetimeMax: 1200,
|
|
8277
|
-
fadeRate: -0.7,
|
|
8278
|
-
blendMode: "lighter",
|
|
8279
|
-
rotationSpeedMin: -0.8,
|
|
8280
|
-
rotationSpeedMax: 0.8
|
|
8281
|
-
}
|
|
8282
|
-
];
|
|
8283
|
-
const overlays = [];
|
|
8284
|
-
const circleUrls = p(manifest, "circle");
|
|
8285
|
-
if (circleUrls.length > 0) {
|
|
8286
|
-
overlays.push({
|
|
8287
|
-
spriteUrl: circleUrls[0],
|
|
8288
|
-
originX,
|
|
8289
|
-
originY,
|
|
8290
|
-
alpha: 0.7,
|
|
8291
|
-
fadeRate: -0.25,
|
|
8292
|
-
pulseAmplitude: 0.25,
|
|
8293
|
-
pulseFrequency: 1.8,
|
|
8294
|
-
scale: 0.7,
|
|
8295
|
-
blendMode: "lighter",
|
|
8296
|
-
lifetime: 1800
|
|
8297
|
-
});
|
|
8298
|
-
}
|
|
8299
|
-
return {
|
|
8300
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8301
|
-
sequences: [],
|
|
8302
|
-
overlays,
|
|
8303
|
-
screenShake: 0,
|
|
8304
|
-
screenFlash: null
|
|
8305
|
-
};
|
|
8306
|
-
},
|
|
8307
|
-
// =====================================================================
|
|
8308
|
-
// HIT — spark (orange) + flash (5 frames) + screen shake/flash
|
|
8309
|
-
// =====================================================================
|
|
8310
|
-
hit: (originX, originY) => {
|
|
8311
|
-
const particles = [
|
|
8312
|
-
{
|
|
8313
|
-
spriteUrls: p(manifest, "spark"),
|
|
8314
|
-
count: 10,
|
|
8315
|
-
originX,
|
|
8316
|
-
originY,
|
|
8317
|
-
spread: 8,
|
|
8318
|
-
velocityMin: 50,
|
|
8319
|
-
velocityMax: 150,
|
|
8320
|
-
angleMin: 0,
|
|
8321
|
-
angleMax: PI2 * 2,
|
|
8322
|
-
gravity: 80,
|
|
8323
|
-
tint: { r: 255, g: 180, b: 50 },
|
|
8324
|
-
scaleMin: 0.08,
|
|
8325
|
-
scaleMax: 0.2,
|
|
8326
|
-
lifetimeMin: 200,
|
|
8327
|
-
lifetimeMax: 500,
|
|
8328
|
-
fadeRate: -2.5
|
|
8329
|
-
}
|
|
8330
|
-
];
|
|
8331
|
-
const sequences = [];
|
|
8332
|
-
const flashFrames = anim(manifest, "flash");
|
|
8333
|
-
if (flashFrames.length > 0) {
|
|
8334
|
-
sequences.push({
|
|
8335
|
-
frameUrls: flashFrames.slice(0, 5),
|
|
8336
|
-
originX,
|
|
8337
|
-
originY,
|
|
8338
|
-
frameDuration: 40,
|
|
8339
|
-
scale: 0.3
|
|
8340
|
-
});
|
|
8341
|
-
}
|
|
8342
|
-
return {
|
|
8343
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8344
|
-
sequences,
|
|
8345
|
-
overlays: [],
|
|
8346
|
-
screenShake: 3,
|
|
8347
|
-
screenFlash: { r: 255, g: 50, b: 50, duration: 150 }
|
|
8348
|
-
};
|
|
8349
|
-
},
|
|
8350
|
-
// critical aliases to hit with bigger shake
|
|
8351
|
-
critical: (originX, originY) => {
|
|
8352
|
-
const particles = [
|
|
8353
|
-
{
|
|
8354
|
-
spriteUrls: p(manifest, "flame"),
|
|
8355
|
-
count: 8,
|
|
8356
|
-
originX,
|
|
8357
|
-
originY,
|
|
8358
|
-
spread: 12,
|
|
8359
|
-
velocityMin: 60,
|
|
8360
|
-
velocityMax: 180,
|
|
8361
|
-
angleMin: 0,
|
|
8362
|
-
angleMax: PI2 * 2,
|
|
8363
|
-
gravity: 60,
|
|
8364
|
-
tint: { r: 255, g: 120, b: 30 },
|
|
8365
|
-
scaleMin: 0.15,
|
|
8366
|
-
scaleMax: 0.4,
|
|
8367
|
-
lifetimeMin: 300,
|
|
8368
|
-
lifetimeMax: 600,
|
|
8369
|
-
fadeRate: -2
|
|
8370
|
-
},
|
|
8371
|
-
{
|
|
8372
|
-
spriteUrls: p(manifest, "spark"),
|
|
8373
|
-
count: 12,
|
|
8374
|
-
originX,
|
|
8375
|
-
originY,
|
|
8376
|
-
spread: 10,
|
|
8377
|
-
velocityMin: 80,
|
|
8378
|
-
velocityMax: 200,
|
|
8379
|
-
angleMin: 0,
|
|
8380
|
-
angleMax: PI2 * 2,
|
|
8381
|
-
gravity: 100,
|
|
8382
|
-
tint: { r: 255, g: 200, b: 60 },
|
|
8383
|
-
scaleMin: 0.06,
|
|
8384
|
-
scaleMax: 0.18,
|
|
8385
|
-
lifetimeMin: 200,
|
|
8386
|
-
lifetimeMax: 400,
|
|
8387
|
-
fadeRate: -3
|
|
8388
|
-
}
|
|
8389
|
-
];
|
|
8390
|
-
const sequences = [];
|
|
8391
|
-
const flashFrames = anim(manifest, "flash");
|
|
8392
|
-
if (flashFrames.length > 0) {
|
|
8393
|
-
sequences.push({
|
|
8394
|
-
frameUrls: flashFrames,
|
|
8395
|
-
originX,
|
|
8396
|
-
originY,
|
|
8397
|
-
frameDuration: 30,
|
|
8398
|
-
scale: 0.5
|
|
8399
|
-
});
|
|
8400
|
-
}
|
|
8401
|
-
return {
|
|
8402
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8403
|
-
sequences,
|
|
8404
|
-
overlays: [],
|
|
8405
|
-
screenShake: 6,
|
|
8406
|
-
screenFlash: { r: 255, g: 80, b: 0, duration: 200 }
|
|
8407
|
-
};
|
|
8408
|
-
},
|
|
8409
|
-
// =====================================================================
|
|
8410
|
-
// DEATH — dirt (gray) + explosion + black smoke + scorch (ground)
|
|
8411
|
-
// =====================================================================
|
|
8412
|
-
death: (originX, originY) => {
|
|
8413
|
-
const particles = [
|
|
8414
|
-
{
|
|
8415
|
-
spriteUrls: p(manifest, "dirt"),
|
|
8416
|
-
count: 8,
|
|
8417
|
-
originX,
|
|
8418
|
-
originY,
|
|
8419
|
-
spread: 10,
|
|
8420
|
-
velocityMin: 30,
|
|
8421
|
-
velocityMax: 100,
|
|
8422
|
-
angleMin: 0,
|
|
8423
|
-
angleMax: PI2 * 2,
|
|
8424
|
-
gravity: 100,
|
|
8425
|
-
tint: { r: 140, g: 140, b: 140 },
|
|
8426
|
-
scaleMin: 0.15,
|
|
8427
|
-
scaleMax: 0.35,
|
|
8428
|
-
lifetimeMin: 500,
|
|
8429
|
-
lifetimeMax: 900,
|
|
8430
|
-
fadeRate: -1.2
|
|
8431
|
-
}
|
|
8432
|
-
];
|
|
8433
|
-
const sequences = [];
|
|
8434
|
-
const explosionFrames = anim(manifest, "explosion");
|
|
8435
|
-
if (explosionFrames.length > 0) {
|
|
8436
|
-
sequences.push({
|
|
8437
|
-
frameUrls: explosionFrames,
|
|
8438
|
-
originX,
|
|
8439
|
-
originY,
|
|
8440
|
-
frameDuration: 60,
|
|
8441
|
-
scale: 0.5
|
|
8442
|
-
});
|
|
8443
|
-
}
|
|
8444
|
-
const blackSmokeFrames = anim(manifest, "blackSmoke");
|
|
8445
|
-
if (blackSmokeFrames.length > 0) {
|
|
8446
|
-
sequences.push({
|
|
8447
|
-
frameUrls: blackSmokeFrames,
|
|
8448
|
-
originX,
|
|
8449
|
-
originY: originY - 10,
|
|
8450
|
-
frameDuration: 50,
|
|
8451
|
-
scale: 0.4,
|
|
8452
|
-
alpha: 0.7
|
|
8453
|
-
});
|
|
8454
|
-
}
|
|
8455
|
-
const overlays = [];
|
|
8456
|
-
const scorchUrls = p(manifest, "scorch");
|
|
8457
|
-
if (scorchUrls.length > 0) {
|
|
8458
|
-
overlays.push({
|
|
8459
|
-
spriteUrl: scorchUrls[0],
|
|
8460
|
-
originX,
|
|
8461
|
-
originY: originY + 10,
|
|
8462
|
-
alpha: 0.6,
|
|
8463
|
-
fadeRate: -0.15,
|
|
8464
|
-
scale: 0.4,
|
|
8465
|
-
lifetime: 4e3
|
|
8466
|
-
});
|
|
8467
|
-
}
|
|
8468
|
-
return {
|
|
8469
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8470
|
-
sequences,
|
|
8471
|
-
overlays,
|
|
8472
|
-
screenShake: 0,
|
|
8473
|
-
screenFlash: null
|
|
8474
|
-
};
|
|
8475
|
-
},
|
|
8476
|
-
// =====================================================================
|
|
8477
|
-
// BUFF — star (gold) + symbol + flare (gold, pulse)
|
|
8478
|
-
// =====================================================================
|
|
8479
|
-
buff: (originX, originY) => {
|
|
8480
|
-
const particles = [
|
|
8481
|
-
{
|
|
8482
|
-
spriteUrls: p(manifest, "star"),
|
|
8483
|
-
count: 6,
|
|
8484
|
-
originX,
|
|
8485
|
-
originY,
|
|
8486
|
-
spread: 15,
|
|
8487
|
-
velocityMin: 15,
|
|
8488
|
-
velocityMax: 50,
|
|
8489
|
-
angleMin: -PI2,
|
|
8490
|
-
angleMax: 0,
|
|
8491
|
-
gravity: -30,
|
|
8492
|
-
tint: { r: 255, g: 215, b: 50 },
|
|
8493
|
-
scaleMin: 0.12,
|
|
8494
|
-
scaleMax: 0.25,
|
|
8495
|
-
lifetimeMin: 600,
|
|
8496
|
-
lifetimeMax: 1e3,
|
|
8497
|
-
fadeRate: -0.8,
|
|
8498
|
-
blendMode: "lighter"
|
|
8499
|
-
},
|
|
8500
|
-
{
|
|
8501
|
-
spriteUrls: p(manifest, "symbol"),
|
|
8502
|
-
count: 2,
|
|
8503
|
-
originX,
|
|
8504
|
-
originY: originY - 10,
|
|
8505
|
-
spread: 8,
|
|
8506
|
-
velocityMin: 5,
|
|
8507
|
-
velocityMax: 20,
|
|
8508
|
-
angleMin: -PI2 * 0.7,
|
|
8509
|
-
angleMax: -PI2 * 0.3,
|
|
8510
|
-
gravity: -20,
|
|
8511
|
-
tint: { r: 255, g: 230, b: 100 },
|
|
8512
|
-
scaleMin: 0.2,
|
|
8513
|
-
scaleMax: 0.35,
|
|
8514
|
-
lifetimeMin: 800,
|
|
8515
|
-
lifetimeMax: 1200,
|
|
8516
|
-
fadeRate: -0.6,
|
|
8517
|
-
blendMode: "lighter"
|
|
8518
|
-
}
|
|
8519
|
-
];
|
|
8520
|
-
const overlays = [];
|
|
8521
|
-
const flareUrls = p(manifest, "flare");
|
|
8522
|
-
if (flareUrls.length > 0) {
|
|
8523
|
-
overlays.push({
|
|
8524
|
-
spriteUrl: flareUrls[0],
|
|
8525
|
-
originX,
|
|
8526
|
-
originY,
|
|
8527
|
-
alpha: 0.5,
|
|
8528
|
-
fadeRate: -0.3,
|
|
8529
|
-
pulseAmplitude: 0.3,
|
|
8530
|
-
pulseFrequency: 2,
|
|
8531
|
-
scale: 0.5,
|
|
8532
|
-
blendMode: "lighter",
|
|
8533
|
-
lifetime: 1500
|
|
8534
|
-
});
|
|
8535
|
-
}
|
|
8536
|
-
return {
|
|
8537
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8538
|
-
sequences: [],
|
|
8539
|
-
overlays,
|
|
8540
|
-
screenShake: 0,
|
|
8541
|
-
screenFlash: null
|
|
8542
|
-
};
|
|
8543
|
-
},
|
|
8544
|
-
// =====================================================================
|
|
8545
|
-
// DEBUFF — scorch (dark) + smoke (purple tint)
|
|
8546
|
-
// =====================================================================
|
|
8547
|
-
debuff: (originX, originY) => {
|
|
8548
|
-
const particles = [
|
|
8549
|
-
{
|
|
8550
|
-
spriteUrls: p(manifest, "scorch"),
|
|
8551
|
-
count: 4,
|
|
8552
|
-
originX,
|
|
8553
|
-
originY,
|
|
8554
|
-
spread: 12,
|
|
8555
|
-
velocityMin: 15,
|
|
8556
|
-
velocityMax: 40,
|
|
8557
|
-
angleMin: -PI2,
|
|
8558
|
-
angleMax: 0,
|
|
8559
|
-
gravity: -20,
|
|
8560
|
-
tint: { r: 120, g: 40, b: 160 },
|
|
8561
|
-
scaleMin: 0.15,
|
|
8562
|
-
scaleMax: 0.3,
|
|
8563
|
-
lifetimeMin: 500,
|
|
8564
|
-
lifetimeMax: 800,
|
|
8565
|
-
fadeRate: -1
|
|
8566
|
-
},
|
|
8567
|
-
{
|
|
8568
|
-
spriteUrls: p(manifest, "smoke").slice(0, 3),
|
|
8569
|
-
count: 3,
|
|
8570
|
-
originX,
|
|
8571
|
-
originY,
|
|
8572
|
-
spread: 10,
|
|
8573
|
-
velocityMin: 8,
|
|
8574
|
-
velocityMax: 25,
|
|
8575
|
-
angleMin: -PI2 * 0.8,
|
|
8576
|
-
angleMax: -PI2 * 0.2,
|
|
8577
|
-
gravity: -15,
|
|
8578
|
-
tint: { r: 100, g: 50, b: 140 },
|
|
8579
|
-
scaleMin: 0.2,
|
|
8580
|
-
scaleMax: 0.35,
|
|
8581
|
-
lifetimeMin: 600,
|
|
8582
|
-
lifetimeMax: 1e3,
|
|
8583
|
-
fadeRate: -0.8
|
|
8584
|
-
}
|
|
8585
|
-
];
|
|
8586
|
-
const overlays = [];
|
|
8587
|
-
const circleUrls = p(manifest, "circle");
|
|
8588
|
-
if (circleUrls.length > 0) {
|
|
8589
|
-
overlays.push({
|
|
8590
|
-
spriteUrl: circleUrls[0],
|
|
8591
|
-
originX,
|
|
8592
|
-
originY,
|
|
8593
|
-
alpha: 0.4,
|
|
8594
|
-
fadeRate: -0.4,
|
|
8595
|
-
pulseAmplitude: 0.15,
|
|
8596
|
-
pulseFrequency: 2,
|
|
8597
|
-
scale: 0.45,
|
|
8598
|
-
lifetime: 1200
|
|
8599
|
-
});
|
|
8600
|
-
}
|
|
8601
|
-
return {
|
|
8602
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8603
|
-
sequences: [],
|
|
8604
|
-
overlays,
|
|
8605
|
-
screenShake: 0,
|
|
8606
|
-
screenFlash: null
|
|
8607
|
-
};
|
|
8608
|
-
},
|
|
8609
|
-
// =====================================================================
|
|
8610
|
-
// AOE — explosion (large) + flame + spark (radial) + screen shake
|
|
8611
|
-
// =====================================================================
|
|
8612
|
-
aoe: (originX, originY) => {
|
|
8613
|
-
const particles = [
|
|
8614
|
-
{
|
|
8615
|
-
spriteUrls: p(manifest, "flame"),
|
|
8616
|
-
count: 10,
|
|
8617
|
-
originX,
|
|
8618
|
-
originY,
|
|
8619
|
-
spread: 20,
|
|
8620
|
-
velocityMin: 40,
|
|
8621
|
-
velocityMax: 140,
|
|
8622
|
-
angleMin: 0,
|
|
8623
|
-
angleMax: PI2 * 2,
|
|
8624
|
-
gravity: 40,
|
|
8625
|
-
tint: { r: 255, g: 140, b: 30 },
|
|
8626
|
-
scaleMin: 0.2,
|
|
8627
|
-
scaleMax: 0.5,
|
|
8628
|
-
lifetimeMin: 400,
|
|
8629
|
-
lifetimeMax: 800,
|
|
8630
|
-
fadeRate: -1.5
|
|
8631
|
-
},
|
|
8632
|
-
{
|
|
8633
|
-
spriteUrls: p(manifest, "spark"),
|
|
8634
|
-
count: 15,
|
|
8635
|
-
originX,
|
|
8636
|
-
originY,
|
|
8637
|
-
spread: 15,
|
|
8638
|
-
velocityMin: 60,
|
|
8639
|
-
velocityMax: 200,
|
|
8640
|
-
angleMin: 0,
|
|
8641
|
-
angleMax: PI2 * 2,
|
|
8642
|
-
gravity: 60,
|
|
8643
|
-
tint: { r: 255, g: 180, b: 60 },
|
|
8644
|
-
scaleMin: 0.06,
|
|
8645
|
-
scaleMax: 0.15,
|
|
8646
|
-
lifetimeMin: 200,
|
|
8647
|
-
lifetimeMax: 500,
|
|
8648
|
-
fadeRate: -2.5
|
|
8649
|
-
}
|
|
8650
|
-
];
|
|
8651
|
-
const sequences = [];
|
|
8652
|
-
const explosionFrames = anim(manifest, "explosion");
|
|
8653
|
-
if (explosionFrames.length > 0) {
|
|
8654
|
-
sequences.push({
|
|
8655
|
-
frameUrls: explosionFrames,
|
|
8656
|
-
originX,
|
|
8657
|
-
originY,
|
|
8658
|
-
frameDuration: 50,
|
|
8659
|
-
scale: 0.6
|
|
8660
|
-
});
|
|
8661
|
-
}
|
|
8662
|
-
return {
|
|
8663
|
-
particles: particles.filter((pc) => pc.spriteUrls.length > 0),
|
|
8664
|
-
sequences,
|
|
8665
|
-
overlays: [],
|
|
8666
|
-
screenShake: 5,
|
|
8667
|
-
screenFlash: { r: 255, g: 160, b: 0, duration: 180 }
|
|
8668
|
-
};
|
|
8669
|
-
}
|
|
8670
|
-
};
|
|
8671
|
-
}
|
|
8672
|
-
var PI2;
|
|
8673
|
-
var init_combatPresets = __esm({
|
|
8674
|
-
"components/game/shared/combatPresets.ts"() {
|
|
8675
|
-
PI2 = Math.PI;
|
|
8676
|
-
}
|
|
8677
|
-
});
|
|
8678
|
-
|
|
8679
|
-
// components/game/shared/canvasEffects.ts
|
|
8680
|
-
function getOffscreenCtx(w, h) {
|
|
8681
|
-
if (!_offscreen) {
|
|
8682
|
-
if (typeof OffscreenCanvas !== "undefined") {
|
|
8683
|
-
_offscreen = new OffscreenCanvas(w, h);
|
|
8684
|
-
} else {
|
|
8685
|
-
_offscreen = document.createElement("canvas");
|
|
8686
|
-
}
|
|
8687
|
-
}
|
|
8688
|
-
if (_offscreen.width < w) _offscreen.width = w;
|
|
8689
|
-
if (_offscreen.height < h) _offscreen.height = h;
|
|
8690
|
-
if (!_offCtx) {
|
|
8691
|
-
_offCtx = _offscreen.getContext("2d");
|
|
8692
|
-
}
|
|
8693
|
-
return _offCtx;
|
|
8694
|
-
}
|
|
8695
|
-
function drawTintedImage(ctx, img, x, y, w, h, tint, alpha, blendMode = "source-over") {
|
|
8696
|
-
if (w <= 0 || h <= 0) return;
|
|
8697
|
-
const oc = getOffscreenCtx(w, h);
|
|
8698
|
-
oc.clearRect(0, 0, w, h);
|
|
8699
|
-
oc.globalCompositeOperation = "source-over";
|
|
8700
|
-
oc.drawImage(img, 0, 0, w, h);
|
|
8701
|
-
oc.globalCompositeOperation = "source-atop";
|
|
8702
|
-
oc.fillStyle = `rgb(${tint.r}, ${tint.g}, ${tint.b})`;
|
|
8703
|
-
oc.fillRect(0, 0, w, h);
|
|
8704
|
-
const prevAlpha = ctx.globalAlpha;
|
|
8705
|
-
const prevBlend = ctx.globalCompositeOperation;
|
|
8706
|
-
ctx.globalAlpha = alpha;
|
|
8707
|
-
ctx.globalCompositeOperation = blendMode;
|
|
8708
|
-
ctx.drawImage(_offscreen, 0, 0, w, h, x, y, w, h);
|
|
8709
|
-
ctx.globalAlpha = prevAlpha;
|
|
8710
|
-
ctx.globalCompositeOperation = prevBlend;
|
|
8711
|
-
}
|
|
8712
|
-
function randRange(min, max) {
|
|
8713
|
-
return min + Math.random() * (max - min);
|
|
8714
|
-
}
|
|
8715
|
-
function spawnParticles(config, animTime) {
|
|
8716
|
-
const particles = [];
|
|
8717
|
-
for (let i = 0; i < config.count; i++) {
|
|
8718
|
-
const angle = randRange(config.angleMin, config.angleMax);
|
|
8719
|
-
const speed = randRange(config.velocityMin, config.velocityMax);
|
|
8720
|
-
const spriteUrl = config.spriteUrls[Math.floor(Math.random() * config.spriteUrls.length)];
|
|
8721
|
-
particles.push({
|
|
8722
|
-
spriteUrl,
|
|
8723
|
-
x: config.originX + randRange(-config.spread, config.spread),
|
|
8724
|
-
y: config.originY + randRange(-config.spread, config.spread),
|
|
8725
|
-
vx: Math.cos(angle) * speed,
|
|
8726
|
-
vy: Math.sin(angle) * speed,
|
|
8727
|
-
gravity: config.gravity,
|
|
8728
|
-
rotation: Math.random() * Math.PI * 2,
|
|
8729
|
-
rotationSpeed: randRange(config.rotationSpeedMin ?? -2, config.rotationSpeedMax ?? 2),
|
|
8730
|
-
scale: randRange(config.scaleMin, config.scaleMax),
|
|
8731
|
-
scaleSpeed: config.scaleSpeed ?? 0,
|
|
8732
|
-
alpha: config.alpha ?? 1,
|
|
8733
|
-
fadeRate: config.fadeRate ?? -1.5,
|
|
8734
|
-
tint: { ...config.tint },
|
|
8735
|
-
blendMode: config.blendMode ?? "source-over",
|
|
8736
|
-
spawnTime: animTime,
|
|
8737
|
-
lifetime: randRange(config.lifetimeMin, config.lifetimeMax)
|
|
8738
|
-
});
|
|
8739
|
-
}
|
|
8740
|
-
return particles;
|
|
8741
|
-
}
|
|
8742
|
-
function spawnSequence(config, animTime) {
|
|
8743
|
-
return {
|
|
8744
|
-
frameUrls: config.frameUrls,
|
|
8745
|
-
x: config.originX,
|
|
8746
|
-
y: config.originY,
|
|
8747
|
-
frameDuration: config.frameDuration,
|
|
8748
|
-
startTime: animTime,
|
|
8749
|
-
loop: config.loop ?? false,
|
|
8750
|
-
scale: config.scale ?? 1,
|
|
8751
|
-
tint: config.tint ?? null,
|
|
8752
|
-
alpha: config.alpha ?? 1,
|
|
8753
|
-
blendMode: config.blendMode ?? "source-over"
|
|
8754
|
-
};
|
|
8755
|
-
}
|
|
8756
|
-
function spawnOverlay(config, animTime) {
|
|
8757
|
-
return {
|
|
8758
|
-
spriteUrl: config.spriteUrl,
|
|
8759
|
-
x: config.originX,
|
|
8760
|
-
y: config.originY,
|
|
8761
|
-
alpha: config.alpha ?? 0.8,
|
|
8762
|
-
fadeRate: config.fadeRate ?? -0.5,
|
|
8763
|
-
pulseAmplitude: config.pulseAmplitude ?? 0,
|
|
8764
|
-
pulseFrequency: config.pulseFrequency ?? 2,
|
|
8765
|
-
scale: config.scale ?? 1,
|
|
8766
|
-
blendMode: config.blendMode ?? "source-over",
|
|
8767
|
-
spawnTime: animTime,
|
|
8768
|
-
lifetime: config.lifetime ?? 2e3
|
|
8769
|
-
};
|
|
8770
|
-
}
|
|
8771
|
-
function updateEffectState(state, animTime, deltaMs) {
|
|
8772
|
-
const dt = deltaMs / 1e3;
|
|
8773
|
-
const particles = state.particles.map((p2) => ({
|
|
8774
|
-
...p2,
|
|
8775
|
-
x: p2.x + p2.vx * dt,
|
|
8776
|
-
y: p2.y + p2.vy * dt,
|
|
8777
|
-
vy: p2.vy + p2.gravity * dt,
|
|
8778
|
-
rotation: p2.rotation + p2.rotationSpeed * dt,
|
|
8779
|
-
scale: Math.max(0, p2.scale + p2.scaleSpeed * dt),
|
|
8780
|
-
alpha: Math.max(0, p2.alpha + p2.fadeRate * dt)
|
|
8781
|
-
})).filter((p2) => p2.alpha > 0.01 && animTime - p2.spawnTime < p2.lifetime);
|
|
8782
|
-
const sequences = state.sequences.filter((s) => {
|
|
8783
|
-
const elapsed = animTime - s.startTime;
|
|
8784
|
-
const totalDuration = s.frameUrls.length * s.frameDuration;
|
|
8785
|
-
return s.loop || elapsed < totalDuration;
|
|
8786
|
-
});
|
|
8787
|
-
const overlays = state.overlays.map((o) => ({
|
|
8788
|
-
...o,
|
|
8789
|
-
alpha: Math.max(0, o.alpha + o.fadeRate * dt)
|
|
8790
|
-
})).filter((o) => o.alpha > 0.01 && animTime - o.spawnTime < o.lifetime);
|
|
8791
|
-
return { particles, sequences, overlays };
|
|
8792
|
-
}
|
|
8793
|
-
function drawEffectState(ctx, state, animTime, getImage) {
|
|
8794
|
-
for (const o of state.overlays) {
|
|
8795
|
-
const img = getImage(o.spriteUrl);
|
|
8796
|
-
if (!img) continue;
|
|
8797
|
-
let alpha = o.alpha;
|
|
8798
|
-
if (o.pulseAmplitude > 0) {
|
|
8799
|
-
const elapsed = (animTime - o.spawnTime) / 1e3;
|
|
8800
|
-
alpha += Math.sin(elapsed * o.pulseFrequency * Math.PI * 2) * o.pulseAmplitude;
|
|
8801
|
-
alpha = Math.max(0, Math.min(1, alpha));
|
|
8802
|
-
}
|
|
8803
|
-
const w = img.naturalWidth * o.scale;
|
|
8804
|
-
const h = img.naturalHeight * o.scale;
|
|
8805
|
-
const prevAlpha = ctx.globalAlpha;
|
|
8806
|
-
const prevBlend = ctx.globalCompositeOperation;
|
|
8807
|
-
ctx.globalAlpha = alpha;
|
|
8808
|
-
ctx.globalCompositeOperation = o.blendMode;
|
|
8809
|
-
ctx.drawImage(img, o.x - w / 2, o.y - h / 2, w, h);
|
|
8810
|
-
ctx.globalAlpha = prevAlpha;
|
|
8811
|
-
ctx.globalCompositeOperation = prevBlend;
|
|
8812
|
-
}
|
|
8813
|
-
for (const s of state.sequences) {
|
|
8814
|
-
const elapsed = animTime - s.startTime;
|
|
8815
|
-
let frameIndex = Math.floor(elapsed / s.frameDuration);
|
|
8816
|
-
if (s.loop) {
|
|
8817
|
-
frameIndex = frameIndex % s.frameUrls.length;
|
|
8818
|
-
} else if (frameIndex >= s.frameUrls.length) {
|
|
8819
|
-
continue;
|
|
8820
|
-
}
|
|
8821
|
-
const img = getImage(s.frameUrls[frameIndex]);
|
|
8822
|
-
if (!img) continue;
|
|
8823
|
-
const w = img.naturalWidth * s.scale;
|
|
8824
|
-
const h = img.naturalHeight * s.scale;
|
|
8825
|
-
if (s.tint) {
|
|
8826
|
-
drawTintedImage(ctx, img, s.x - w / 2, s.y - h / 2, w, h, s.tint, s.alpha, s.blendMode);
|
|
8827
|
-
} else {
|
|
8828
|
-
const prevAlpha = ctx.globalAlpha;
|
|
8829
|
-
const prevBlend = ctx.globalCompositeOperation;
|
|
8830
|
-
ctx.globalAlpha = s.alpha;
|
|
8831
|
-
ctx.globalCompositeOperation = s.blendMode;
|
|
8832
|
-
ctx.drawImage(img, s.x - w / 2, s.y - h / 2, w, h);
|
|
8833
|
-
ctx.globalAlpha = prevAlpha;
|
|
8834
|
-
ctx.globalCompositeOperation = prevBlend;
|
|
8835
|
-
}
|
|
8836
|
-
}
|
|
8837
|
-
for (const p2 of state.particles) {
|
|
8838
|
-
const img = getImage(p2.spriteUrl);
|
|
8839
|
-
if (!img) continue;
|
|
8840
|
-
const w = img.naturalWidth * p2.scale;
|
|
8841
|
-
const h = img.naturalHeight * p2.scale;
|
|
8842
|
-
ctx.save();
|
|
8843
|
-
ctx.translate(p2.x, p2.y);
|
|
8844
|
-
ctx.rotate(p2.rotation);
|
|
8845
|
-
drawTintedImage(ctx, img, -w / 2, -h / 2, w, h, p2.tint, p2.alpha, p2.blendMode);
|
|
8846
|
-
ctx.restore();
|
|
8847
|
-
}
|
|
8848
|
-
}
|
|
8849
|
-
function hasActiveEffects(state) {
|
|
8850
|
-
return state.particles.length > 0 || state.sequences.length > 0 || state.overlays.length > 0;
|
|
8851
|
-
}
|
|
8852
|
-
function getAllEffectSpriteUrls(manifest) {
|
|
8853
|
-
const urls = [];
|
|
8854
|
-
const base = manifest.baseUrl;
|
|
8855
|
-
if (manifest.particles) {
|
|
8856
|
-
for (const value of Object.values(manifest.particles)) {
|
|
8857
|
-
if (Array.isArray(value)) {
|
|
8858
|
-
value.forEach((v) => urls.push(`${base}/${v}`));
|
|
8859
|
-
} else if (typeof value === "string") {
|
|
8860
|
-
urls.push(`${base}/${value}`);
|
|
8861
|
-
}
|
|
8862
|
-
}
|
|
8863
|
-
}
|
|
8864
|
-
if (manifest.animations) {
|
|
8865
|
-
for (const frames of Object.values(manifest.animations)) {
|
|
8866
|
-
if (Array.isArray(frames)) {
|
|
8867
|
-
frames.forEach((f3) => urls.push(`${base}/${f3}`));
|
|
8868
|
-
}
|
|
8869
|
-
}
|
|
8870
|
-
}
|
|
8871
|
-
return urls;
|
|
8872
|
-
}
|
|
8873
|
-
var _offscreen, _offCtx;
|
|
8874
|
-
var init_canvasEffects = __esm({
|
|
8875
|
-
"components/game/shared/canvasEffects.ts"() {
|
|
8876
|
-
_offscreen = null;
|
|
8877
|
-
_offCtx = null;
|
|
8878
|
-
}
|
|
8879
|
-
});
|
|
8880
|
-
|
|
8881
7868
|
// components/game/shared/index.ts
|
|
8882
7869
|
var init_shared = __esm({
|
|
8883
7870
|
"components/game/shared/index.ts"() {
|
|
8884
7871
|
init_effects();
|
|
8885
7872
|
init_boardEntity();
|
|
8886
7873
|
init_makeAsset();
|
|
8887
|
-
init_combatPresets();
|
|
8888
|
-
init_canvasEffects();
|
|
8889
7874
|
}
|
|
8890
7875
|
});
|
|
8891
7876
|
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
@@ -11612,8 +10597,8 @@ function Canvas2D({
|
|
|
11612
10597
|
if (isFree) return 0;
|
|
11613
10598
|
return (gridHeight - 1) * (scaledTileWidth / 2);
|
|
11614
10599
|
}, [isFree, gridHeight, scaledTileWidth]);
|
|
11615
|
-
const validMoveSet = React95.useMemo(() => new Set(validMoves.map((
|
|
11616
|
-
const attackTargetSet = React95.useMemo(() => new Set(attackTargets.map((
|
|
10600
|
+
const validMoveSet = React95.useMemo(() => new Set(validMoves.map((p) => `${p.x},${p.y}`)), [validMoves]);
|
|
10601
|
+
const attackTargetSet = React95.useMemo(() => new Set(attackTargets.map((p) => `${p.x},${p.y}`)), [attackTargets]);
|
|
11617
10602
|
const spriteUrls = React95.useMemo(() => {
|
|
11618
10603
|
const urls = [];
|
|
11619
10604
|
for (const tile of sortedTiles) {
|
|
@@ -12330,264 +11315,6 @@ var init_Canvas2D = __esm({
|
|
|
12330
11315
|
Canvas2D.displayName = "Canvas2D";
|
|
12331
11316
|
}
|
|
12332
11317
|
});
|
|
12333
|
-
function CanvasEffectEngine({
|
|
12334
|
-
actionType,
|
|
12335
|
-
x,
|
|
12336
|
-
y,
|
|
12337
|
-
duration = 2e3,
|
|
12338
|
-
intensity = 1,
|
|
12339
|
-
onComplete,
|
|
12340
|
-
className,
|
|
12341
|
-
assetManifest,
|
|
12342
|
-
width = 400,
|
|
12343
|
-
height = 300
|
|
12344
|
-
}) {
|
|
12345
|
-
const canvasRef = React95.useRef(null);
|
|
12346
|
-
const stateRef = React95.useRef({ ...EMPTY_EFFECT_STATE });
|
|
12347
|
-
const lastTimeRef = React95.useRef(0);
|
|
12348
|
-
const rafRef = React95.useRef(0);
|
|
12349
|
-
const imageCacheRef = React95.useRef(/* @__PURE__ */ new Map());
|
|
12350
|
-
const [shakeOffset, setShakeOffset] = React95.useState({ x: 0, y: 0 });
|
|
12351
|
-
const [flash, setFlash] = React95.useState(null);
|
|
12352
|
-
const shakeRef = React95.useRef({ x: 0, y: 0, intensity: 0 });
|
|
12353
|
-
const presets = React95.useMemo(() => createCombatPresets(assetManifest), [assetManifest]);
|
|
12354
|
-
const spriteUrls = React95.useMemo(() => getAllEffectSpriteUrls(assetManifest), [assetManifest]);
|
|
12355
|
-
React95.useEffect(() => {
|
|
12356
|
-
const cache = imageCacheRef.current;
|
|
12357
|
-
for (const url of spriteUrls) {
|
|
12358
|
-
if (!cache.has(url)) {
|
|
12359
|
-
const img = new Image();
|
|
12360
|
-
img.crossOrigin = "anonymous";
|
|
12361
|
-
img.src = url;
|
|
12362
|
-
cache.set(url, img);
|
|
12363
|
-
}
|
|
12364
|
-
}
|
|
12365
|
-
}, [spriteUrls]);
|
|
12366
|
-
const getImage = React95.useCallback((url) => {
|
|
12367
|
-
const img = imageCacheRef.current.get(url);
|
|
12368
|
-
return img?.complete ? img : void 0;
|
|
12369
|
-
}, []);
|
|
12370
|
-
React95.useEffect(() => {
|
|
12371
|
-
const now2 = performance.now();
|
|
12372
|
-
const effectX = x || width / 2;
|
|
12373
|
-
const effectY = y || height / 2;
|
|
12374
|
-
const preset = presets[actionType](effectX, effectY);
|
|
12375
|
-
const state = stateRef.current;
|
|
12376
|
-
for (const emitter of preset.particles) {
|
|
12377
|
-
const scaledEmitter = { ...emitter, count: Math.round(emitter.count * intensity) };
|
|
12378
|
-
state.particles.push(...spawnParticles(scaledEmitter, now2));
|
|
12379
|
-
}
|
|
12380
|
-
for (const seqConfig of preset.sequences) {
|
|
12381
|
-
state.sequences.push(spawnSequence(seqConfig, now2));
|
|
12382
|
-
}
|
|
12383
|
-
for (const ovConfig of preset.overlays) {
|
|
12384
|
-
state.overlays.push(spawnOverlay(ovConfig, now2));
|
|
12385
|
-
}
|
|
12386
|
-
if (preset.screenShake > 0) {
|
|
12387
|
-
shakeRef.current.intensity = preset.screenShake * intensity;
|
|
12388
|
-
}
|
|
12389
|
-
if (preset.screenFlash) {
|
|
12390
|
-
const { r, g, b, duration: flashDur } = preset.screenFlash;
|
|
12391
|
-
setFlash({ color: `rgb(${r}, ${g}, ${b})`, alpha: 0.3 });
|
|
12392
|
-
setTimeout(() => setFlash(null), flashDur);
|
|
12393
|
-
}
|
|
12394
|
-
const timer = setTimeout(() => {
|
|
12395
|
-
onComplete?.();
|
|
12396
|
-
}, duration);
|
|
12397
|
-
return () => clearTimeout(timer);
|
|
12398
|
-
}, []);
|
|
12399
|
-
React95.useEffect(() => {
|
|
12400
|
-
const canvas = canvasRef.current;
|
|
12401
|
-
if (!canvas) return;
|
|
12402
|
-
const ctx = canvas.getContext("2d");
|
|
12403
|
-
if (!ctx) return;
|
|
12404
|
-
function loop(animTime) {
|
|
12405
|
-
const delta = lastTimeRef.current > 0 ? animTime - lastTimeRef.current : 16;
|
|
12406
|
-
lastTimeRef.current = animTime;
|
|
12407
|
-
stateRef.current = updateEffectState(stateRef.current, animTime, delta);
|
|
12408
|
-
if (shakeRef.current.intensity > 0.2) {
|
|
12409
|
-
const i = shakeRef.current.intensity;
|
|
12410
|
-
shakeRef.current.x = (Math.random() - 0.5) * i * 2;
|
|
12411
|
-
shakeRef.current.y = (Math.random() - 0.5) * i * 2;
|
|
12412
|
-
shakeRef.current.intensity *= 0.85;
|
|
12413
|
-
setShakeOffset({ x: shakeRef.current.x, y: shakeRef.current.y });
|
|
12414
|
-
} else if (shakeRef.current.intensity > 0) {
|
|
12415
|
-
shakeRef.current = { x: 0, y: 0, intensity: 0 };
|
|
12416
|
-
setShakeOffset({ x: 0, y: 0 });
|
|
12417
|
-
}
|
|
12418
|
-
ctx.clearRect(0, 0, width, height);
|
|
12419
|
-
drawEffectState(ctx, stateRef.current, animTime, getImage);
|
|
12420
|
-
if (hasActiveEffects(stateRef.current)) {
|
|
12421
|
-
rafRef.current = requestAnimationFrame(loop);
|
|
12422
|
-
}
|
|
12423
|
-
}
|
|
12424
|
-
rafRef.current = requestAnimationFrame(loop);
|
|
12425
|
-
return () => cancelAnimationFrame(rafRef.current);
|
|
12426
|
-
}, [width, height, getImage]);
|
|
12427
|
-
const shakeStyle = shakeOffset.x !== 0 || shakeOffset.y !== 0 ? { transform: `translate(${shakeOffset.x}px, ${shakeOffset.y}px)` } : {};
|
|
12428
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12429
|
-
Box,
|
|
12430
|
-
{
|
|
12431
|
-
className: cn("absolute inset-0 pointer-events-none z-10", className),
|
|
12432
|
-
style: shakeStyle,
|
|
12433
|
-
children: [
|
|
12434
|
-
flash && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12435
|
-
Box,
|
|
12436
|
-
{
|
|
12437
|
-
className: "absolute inset-0 z-20 pointer-events-none rounded-container",
|
|
12438
|
-
style: { backgroundColor: flash.color, opacity: flash.alpha }
|
|
12439
|
-
}
|
|
12440
|
-
),
|
|
12441
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12442
|
-
"canvas",
|
|
12443
|
-
{
|
|
12444
|
-
ref: canvasRef,
|
|
12445
|
-
width,
|
|
12446
|
-
height,
|
|
12447
|
-
className: "absolute inset-0 w-full h-full",
|
|
12448
|
-
style: { imageRendering: "pixelated" }
|
|
12449
|
-
}
|
|
12450
|
-
)
|
|
12451
|
-
]
|
|
12452
|
-
}
|
|
12453
|
-
);
|
|
12454
|
-
}
|
|
12455
|
-
function EmojiEffect({
|
|
12456
|
-
actionType,
|
|
12457
|
-
x,
|
|
12458
|
-
y,
|
|
12459
|
-
duration = 800,
|
|
12460
|
-
intensity = 1,
|
|
12461
|
-
onComplete,
|
|
12462
|
-
className,
|
|
12463
|
-
effectSpriteUrl,
|
|
12464
|
-
assetBaseUrl
|
|
12465
|
-
}) {
|
|
12466
|
-
const [visible, setVisible] = React95.useState(true);
|
|
12467
|
-
const [phase, setPhase] = React95.useState("enter");
|
|
12468
|
-
React95.useEffect(() => {
|
|
12469
|
-
const enterTimer = setTimeout(() => setPhase("active"), 100);
|
|
12470
|
-
const exitTimer = setTimeout(() => setPhase("exit"), duration * 0.7);
|
|
12471
|
-
const doneTimer = setTimeout(() => {
|
|
12472
|
-
setVisible(false);
|
|
12473
|
-
onComplete?.();
|
|
12474
|
-
}, duration);
|
|
12475
|
-
return () => {
|
|
12476
|
-
clearTimeout(enterTimer);
|
|
12477
|
-
clearTimeout(exitTimer);
|
|
12478
|
-
clearTimeout(doneTimer);
|
|
12479
|
-
};
|
|
12480
|
-
}, [duration, onComplete]);
|
|
12481
|
-
if (!visible) return null;
|
|
12482
|
-
const config = ACTION_EMOJI[actionType] ?? ACTION_EMOJI.melee;
|
|
12483
|
-
const scaleVal = phase === "enter" ? 0.3 : phase === "active" ? intensity : 0.5;
|
|
12484
|
-
const opacity = phase === "exit" ? 0 : 1;
|
|
12485
|
-
const resolvedSpriteUrl = effectSpriteUrl ? effectSpriteUrl.startsWith("http") || effectSpriteUrl.startsWith("/") ? effectSpriteUrl : assetBaseUrl ? `${assetBaseUrl.replace(/\/$/, "")}/${effectSpriteUrl}` : effectSpriteUrl : void 0;
|
|
12486
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12487
|
-
Box,
|
|
12488
|
-
{
|
|
12489
|
-
className: cn(
|
|
12490
|
-
"fixed pointer-events-none z-50 flex items-center justify-center",
|
|
12491
|
-
"transition-all ease-out",
|
|
12492
|
-
className
|
|
12493
|
-
),
|
|
12494
|
-
style: {
|
|
12495
|
-
left: x,
|
|
12496
|
-
top: y,
|
|
12497
|
-
transform: `translate(-50%, -50%) scale(${scaleVal})`,
|
|
12498
|
-
opacity,
|
|
12499
|
-
transitionDuration: phase === "enter" ? "100ms" : "300ms"
|
|
12500
|
-
},
|
|
12501
|
-
children: [
|
|
12502
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12503
|
-
Box,
|
|
12504
|
-
{
|
|
12505
|
-
className: "absolute rounded-pill animate-ping",
|
|
12506
|
-
style: {
|
|
12507
|
-
width: 48 * intensity,
|
|
12508
|
-
height: 48 * intensity,
|
|
12509
|
-
backgroundColor: config.color,
|
|
12510
|
-
opacity: 0.25
|
|
12511
|
-
}
|
|
12512
|
-
}
|
|
12513
|
-
),
|
|
12514
|
-
resolvedSpriteUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12515
|
-
"img",
|
|
12516
|
-
{
|
|
12517
|
-
src: resolvedSpriteUrl,
|
|
12518
|
-
alt: config.label,
|
|
12519
|
-
className: "relative drop-shadow-lg",
|
|
12520
|
-
style: {
|
|
12521
|
-
width: `${3 * intensity}rem`,
|
|
12522
|
-
height: `${3 * intensity}rem`,
|
|
12523
|
-
objectFit: "contain",
|
|
12524
|
-
imageRendering: "pixelated"
|
|
12525
|
-
}
|
|
12526
|
-
}
|
|
12527
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
12528
|
-
"span",
|
|
12529
|
-
{
|
|
12530
|
-
className: "relative text-3xl drop-shadow-lg",
|
|
12531
|
-
style: { fontSize: `${2 * intensity}rem` },
|
|
12532
|
-
role: "img",
|
|
12533
|
-
"aria-label": config.label,
|
|
12534
|
-
children: config.emoji
|
|
12535
|
-
}
|
|
12536
|
-
)
|
|
12537
|
-
]
|
|
12538
|
-
}
|
|
12539
|
-
);
|
|
12540
|
-
}
|
|
12541
|
-
function CanvasEffect({
|
|
12542
|
-
effectSpriteUrl,
|
|
12543
|
-
assetBaseUrl,
|
|
12544
|
-
...props
|
|
12545
|
-
}) {
|
|
12546
|
-
const eventBus = useEventBus();
|
|
12547
|
-
const mergedProps = { effectSpriteUrl, assetBaseUrl, ...props };
|
|
12548
|
-
const { completeEvent, onComplete, ...rest } = mergedProps;
|
|
12549
|
-
const handleComplete = React95.useCallback(() => {
|
|
12550
|
-
if (completeEvent) eventBus.emit(`UI:${completeEvent}`, {});
|
|
12551
|
-
onComplete?.();
|
|
12552
|
-
}, [completeEvent, eventBus, onComplete]);
|
|
12553
|
-
const enhancedProps = { ...rest, onComplete: handleComplete };
|
|
12554
|
-
if (rest.assetManifest) {
|
|
12555
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CanvasEffectEngine, { ...enhancedProps, assetManifest: rest.assetManifest });
|
|
12556
|
-
}
|
|
12557
|
-
return /* @__PURE__ */ jsxRuntime.jsx(EmojiEffect, { ...enhancedProps });
|
|
12558
|
-
}
|
|
12559
|
-
var ACTION_EMOJI;
|
|
12560
|
-
var init_CanvasEffect = __esm({
|
|
12561
|
-
"components/game/2d/organisms/CanvasEffect.tsx"() {
|
|
12562
|
-
"use client";
|
|
12563
|
-
init_cn();
|
|
12564
|
-
init_useEventBus();
|
|
12565
|
-
init_Box();
|
|
12566
|
-
init_effects();
|
|
12567
|
-
init_canvasEffects();
|
|
12568
|
-
init_combatPresets();
|
|
12569
|
-
ACTION_EMOJI = {
|
|
12570
|
-
melee: { emoji: "\u2694\uFE0F", color: "var(--color-error)", label: "Slash" },
|
|
12571
|
-
ranged: { emoji: "\u{1F3F9}", color: "var(--color-warning)", label: "Arrow" },
|
|
12572
|
-
magic: { emoji: "\u2728", color: "var(--color-primary)", label: "Spell" },
|
|
12573
|
-
heal: { emoji: "\u{1F49A}", color: "var(--color-success)", label: "Heal" },
|
|
12574
|
-
buff: { emoji: "\u2B06\uFE0F", color: "var(--color-info)", label: "Buff" },
|
|
12575
|
-
debuff: { emoji: "\u2B07\uFE0F", color: "var(--color-warning)", label: "Debuff" },
|
|
12576
|
-
shield: { emoji: "\u{1F6E1}\uFE0F", color: "var(--color-info)", label: "Shield" },
|
|
12577
|
-
aoe: { emoji: "\u{1F4A5}", color: "var(--color-error)", label: "Explosion" },
|
|
12578
|
-
critical: { emoji: "\u{1F525}", color: "var(--color-error)", label: "Critical" },
|
|
12579
|
-
defend: { emoji: "\u{1F6E1}\uFE0F", color: "var(--color-info)", label: "Defend" },
|
|
12580
|
-
hit: { emoji: "\u{1F4A5}", color: "var(--color-error)", label: "Hit" },
|
|
12581
|
-
death: { emoji: "\u{1F480}", color: "var(--color-error)", label: "Death" }
|
|
12582
|
-
};
|
|
12583
|
-
CanvasEffect.displayName = "CanvasEffect";
|
|
12584
|
-
}
|
|
12585
|
-
});
|
|
12586
|
-
var init_useCanvasEffects = __esm({
|
|
12587
|
-
"components/game/shared/hooks/useCanvasEffects.ts"() {
|
|
12588
|
-
"use client";
|
|
12589
|
-
}
|
|
12590
|
-
});
|
|
12591
11318
|
var init_useGameAudio = __esm({
|
|
12592
11319
|
"components/game/shared/hooks/useGameAudio.ts"() {
|
|
12593
11320
|
"use client";
|
|
@@ -15207,7 +13934,7 @@ function NegotiatorBoard({
|
|
|
15207
13934
|
React95.useEffect(() => {
|
|
15208
13935
|
if (currentRound > prevRoundRef.current && lastPlayerAction) {
|
|
15209
13936
|
const opponentPayoffEntry = payoffMatrix.find(
|
|
15210
|
-
(
|
|
13937
|
+
(p) => p.playerAction === lastPlayerAction && p.opponentAction === lastOpponentAction
|
|
15211
13938
|
);
|
|
15212
13939
|
setHistory((prev) => [
|
|
15213
13940
|
...prev,
|
|
@@ -15493,14 +14220,14 @@ function SimulationCanvas({
|
|
|
15493
14220
|
const ctx = canvas.getContext("2d");
|
|
15494
14221
|
if (!ctx) return;
|
|
15495
14222
|
const bodies = bodiesRef.current;
|
|
15496
|
-
const
|
|
14223
|
+
const p = presetRef.current;
|
|
15497
14224
|
const w = widthRef.current;
|
|
15498
14225
|
const h = heightRef.current;
|
|
15499
14226
|
ctx.clearRect(0, 0, w, h);
|
|
15500
|
-
ctx.fillStyle =
|
|
14227
|
+
ctx.fillStyle = p.backgroundColor ?? "#1a1a2e";
|
|
15501
14228
|
ctx.fillRect(0, 0, w, h);
|
|
15502
|
-
if (
|
|
15503
|
-
for (const c of
|
|
14229
|
+
if (p.constraints) {
|
|
14230
|
+
for (const c of p.constraints) {
|
|
15504
14231
|
const a = bodies[c.bodyA];
|
|
15505
14232
|
const b = bodies[c.bodyB];
|
|
15506
14233
|
if (a && b) {
|
|
@@ -15523,7 +14250,7 @@ function SimulationCanvas({
|
|
|
15523
14250
|
ctx.arc(pos.x, pos.y, body.radius, 0, Math.PI * 2);
|
|
15524
14251
|
ctx.fillStyle = body.color ?? "#e94560";
|
|
15525
14252
|
ctx.fill();
|
|
15526
|
-
if (
|
|
14253
|
+
if (p.showVelocity) {
|
|
15527
14254
|
ctx.beginPath();
|
|
15528
14255
|
ctx.moveTo(pos.x, pos.y);
|
|
15529
14256
|
ctx.lineTo(pos.x + body.vx * 0.1, pos.y + body.vy * 0.1);
|
|
@@ -15782,7 +14509,6 @@ var init_GameShell = __esm({
|
|
|
15782
14509
|
var init_molecules = __esm({
|
|
15783
14510
|
"components/game/2d/molecules/index.ts"() {
|
|
15784
14511
|
init_shared();
|
|
15785
|
-
init_useCanvasEffects();
|
|
15786
14512
|
init_puzzleObject();
|
|
15787
14513
|
}
|
|
15788
14514
|
});
|
|
@@ -15823,8 +14549,8 @@ function shapeBounds(shape) {
|
|
|
15823
14549
|
case "polygon":
|
|
15824
14550
|
if (!shape.points || shape.points.length === 0) return null;
|
|
15825
14551
|
{
|
|
15826
|
-
const xs = shape.points.map((
|
|
15827
|
-
const ys = shape.points.map((
|
|
14552
|
+
const xs = shape.points.map((p) => p.x);
|
|
14553
|
+
const ys = shape.points.map((p) => p.y);
|
|
15828
14554
|
const minX = Math.min(...xs);
|
|
15829
14555
|
const minY = Math.min(...ys);
|
|
15830
14556
|
return {
|
|
@@ -15950,13 +14676,13 @@ function drawShape(ctx, shape, width, height) {
|
|
|
15950
14676
|
}
|
|
15951
14677
|
case "path": {
|
|
15952
14678
|
if (!shape.path) break;
|
|
15953
|
-
const
|
|
14679
|
+
const p = new Path2D(shape.path);
|
|
15954
14680
|
if (fill) {
|
|
15955
14681
|
ctx.fillStyle = fill;
|
|
15956
|
-
ctx.fill(
|
|
14682
|
+
ctx.fill(p);
|
|
15957
14683
|
}
|
|
15958
14684
|
ctx.strokeStyle = stroke;
|
|
15959
|
-
ctx.stroke(
|
|
14685
|
+
ctx.stroke(p);
|
|
15960
14686
|
break;
|
|
15961
14687
|
}
|
|
15962
14688
|
case "text": {
|
|
@@ -21416,7 +20142,7 @@ function renderStateMachineToDomData(stateMachine, options = {}, config = DEFAUL
|
|
|
21416
20142
|
}
|
|
21417
20143
|
let domOutputs;
|
|
21418
20144
|
if (outputs.length > 0) {
|
|
21419
|
-
const maxX = Math.max(...Object.values(positions).map((
|
|
20145
|
+
const maxX = Math.max(...Object.values(positions).map((p) => p.x));
|
|
21420
20146
|
const maxOutputLength = Math.max(...outputs.map((o) => o.length));
|
|
21421
20147
|
const boxWidth = Math.max(200, maxOutputLength * 7 + 30);
|
|
21422
20148
|
const lineHeight = 22;
|
|
@@ -22398,7 +21124,7 @@ var init_BookViewer = __esm({
|
|
|
22398
21124
|
}
|
|
22399
21125
|
});
|
|
22400
21126
|
function BoxPattern({
|
|
22401
|
-
p
|
|
21127
|
+
p,
|
|
22402
21128
|
m,
|
|
22403
21129
|
bg = "transparent",
|
|
22404
21130
|
border = false,
|
|
@@ -22411,7 +21137,7 @@ function BoxPattern({
|
|
|
22411
21137
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22412
21138
|
Box,
|
|
22413
21139
|
{
|
|
22414
|
-
padding:
|
|
21140
|
+
padding: p,
|
|
22415
21141
|
margin: m,
|
|
22416
21142
|
bg,
|
|
22417
21143
|
border,
|
|
@@ -24113,10 +22839,10 @@ var init_Chart = __esm({
|
|
|
24113
22839
|
const set = [];
|
|
24114
22840
|
const seen = /* @__PURE__ */ new Set();
|
|
24115
22841
|
for (const s of series) {
|
|
24116
|
-
for (const
|
|
24117
|
-
if (!seen.has(
|
|
24118
|
-
seen.add(
|
|
24119
|
-
set.push(
|
|
22842
|
+
for (const p of s.data) {
|
|
22843
|
+
if (!seen.has(p.label)) {
|
|
22844
|
+
seen.add(p.label);
|
|
22845
|
+
set.push(p.label);
|
|
24120
22846
|
}
|
|
24121
22847
|
}
|
|
24122
22848
|
}
|
|
@@ -24124,8 +22850,8 @@ var init_Chart = __esm({
|
|
|
24124
22850
|
}, [series]);
|
|
24125
22851
|
const valueAt = React95.useCallback(
|
|
24126
22852
|
(s, label) => {
|
|
24127
|
-
const
|
|
24128
|
-
return
|
|
22853
|
+
const p = s.data.find((d) => d.label === label);
|
|
22854
|
+
return p ? p.value : 0;
|
|
24129
22855
|
},
|
|
24130
22856
|
[]
|
|
24131
22857
|
);
|
|
@@ -24142,7 +22868,7 @@ var init_Chart = __esm({
|
|
|
24142
22868
|
}
|
|
24143
22869
|
let m = 1;
|
|
24144
22870
|
for (const s of series) {
|
|
24145
|
-
for (const
|
|
22871
|
+
for (const p of s.data) if (p.value > m) m = p.value;
|
|
24146
22872
|
}
|
|
24147
22873
|
return m;
|
|
24148
22874
|
}, [series, stack, columnTotals]);
|
|
@@ -24402,10 +23128,10 @@ var init_Chart = __esm({
|
|
|
24402
23128
|
const seen = /* @__PURE__ */ new Set();
|
|
24403
23129
|
const out = [];
|
|
24404
23130
|
for (const s of series) {
|
|
24405
|
-
for (const
|
|
24406
|
-
if (!seen.has(
|
|
24407
|
-
seen.add(
|
|
24408
|
-
out.push(
|
|
23131
|
+
for (const p of s.data) {
|
|
23132
|
+
if (!seen.has(p.label)) {
|
|
23133
|
+
seen.add(p.label);
|
|
23134
|
+
out.push(p.label);
|
|
24409
23135
|
}
|
|
24410
23136
|
}
|
|
24411
23137
|
}
|
|
@@ -24414,7 +23140,7 @@ var init_Chart = __esm({
|
|
|
24414
23140
|
const maxValue = React95.useMemo(() => {
|
|
24415
23141
|
let m = 1;
|
|
24416
23142
|
for (const s of series) {
|
|
24417
|
-
for (const
|
|
23143
|
+
for (const p of s.data) if (p.value > m) m = p.value;
|
|
24418
23144
|
}
|
|
24419
23145
|
return m;
|
|
24420
23146
|
}, [series]);
|
|
@@ -24461,7 +23187,7 @@ var init_Chart = __esm({
|
|
|
24461
23187
|
label
|
|
24462
23188
|
};
|
|
24463
23189
|
});
|
|
24464
|
-
const linePath = points.map((
|
|
23190
|
+
const linePath = points.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
|
|
24465
23191
|
const areaPath = `${linePath} L ${points[points.length - 1]?.x ?? 0} ${padding.top + chartHeight} L ${padding.left} ${padding.top + chartHeight} Z`;
|
|
24466
23192
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
24467
23193
|
fill && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -24484,19 +23210,19 @@ var init_Chart = __esm({
|
|
|
24484
23210
|
strokeDasharray: s.dashed ? "6 4" : void 0
|
|
24485
23211
|
}
|
|
24486
23212
|
),
|
|
24487
|
-
points.map((
|
|
23213
|
+
points.map((p, idx) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
24488
23214
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24489
23215
|
"circle",
|
|
24490
23216
|
{
|
|
24491
|
-
cx:
|
|
24492
|
-
cy:
|
|
23217
|
+
cx: p.x,
|
|
23218
|
+
cy: p.y,
|
|
24493
23219
|
r: "4",
|
|
24494
23220
|
fill: "var(--color-card)",
|
|
24495
23221
|
stroke: color,
|
|
24496
23222
|
strokeWidth: "2",
|
|
24497
23223
|
className: "cursor-pointer",
|
|
24498
23224
|
onClick: () => onPointClick?.(
|
|
24499
|
-
{ label:
|
|
23225
|
+
{ label: p.label, value: p.value, color },
|
|
24500
23226
|
s.name
|
|
24501
23227
|
)
|
|
24502
23228
|
}
|
|
@@ -24504,13 +23230,13 @@ var init_Chart = __esm({
|
|
|
24504
23230
|
showValues && series.length === 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
24505
23231
|
"text",
|
|
24506
23232
|
{
|
|
24507
|
-
x:
|
|
24508
|
-
y:
|
|
23233
|
+
x: p.x,
|
|
23234
|
+
y: p.y - 10,
|
|
24509
23235
|
textAnchor: "middle",
|
|
24510
23236
|
fill: "var(--color-foreground)",
|
|
24511
23237
|
fontSize: "10",
|
|
24512
23238
|
fontWeight: "500",
|
|
24513
|
-
children:
|
|
23239
|
+
children: p.value
|
|
24514
23240
|
}
|
|
24515
23241
|
)
|
|
24516
23242
|
] }, idx))
|
|
@@ -24545,11 +23271,11 @@ var init_Chart = __esm({
|
|
|
24545
23271
|
let mxX = data[0].x;
|
|
24546
23272
|
let mnY = data[0].y;
|
|
24547
23273
|
let mxY = data[0].y;
|
|
24548
|
-
for (const
|
|
24549
|
-
if (
|
|
24550
|
-
if (
|
|
24551
|
-
if (
|
|
24552
|
-
if (
|
|
23274
|
+
for (const p of data) {
|
|
23275
|
+
if (p.x < mnX) mnX = p.x;
|
|
23276
|
+
if (p.x > mxX) mxX = p.x;
|
|
23277
|
+
if (p.y < mnY) mnY = p.y;
|
|
23278
|
+
if (p.y > mxY) mxY = p.y;
|
|
24553
23279
|
}
|
|
24554
23280
|
return { minX: mnX, maxX: mxX, minY: mnY, maxY: mxY };
|
|
24555
23281
|
}, [data]);
|
|
@@ -24579,11 +23305,11 @@ var init_Chart = __esm({
|
|
|
24579
23305
|
frac
|
|
24580
23306
|
);
|
|
24581
23307
|
}),
|
|
24582
|
-
data.map((
|
|
24583
|
-
const cx = padding.left + (
|
|
24584
|
-
const cy = padding.top + chartHeight - (
|
|
24585
|
-
const r =
|
|
24586
|
-
const color =
|
|
23308
|
+
data.map((p, idx) => {
|
|
23309
|
+
const cx = padding.left + (p.x - minX) / rangeX * chartWidth;
|
|
23310
|
+
const cy = padding.top + chartHeight - (p.y - minY) / rangeY * chartHeight;
|
|
23311
|
+
const r = p.size ?? 5;
|
|
23312
|
+
const color = p.color ?? CHART_COLORS[idx % CHART_COLORS.length];
|
|
24587
23313
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24588
23314
|
"circle",
|
|
24589
23315
|
{
|
|
@@ -24595,13 +23321,13 @@ var init_Chart = __esm({
|
|
|
24595
23321
|
className: "cursor-pointer hover:opacity-100",
|
|
24596
23322
|
onClick: () => onPointClick?.(
|
|
24597
23323
|
{
|
|
24598
|
-
label:
|
|
24599
|
-
value:
|
|
23324
|
+
label: p.label ?? `(${p.x}, ${p.y})`,
|
|
23325
|
+
value: p.y,
|
|
24600
23326
|
color
|
|
24601
23327
|
},
|
|
24602
23328
|
"default"
|
|
24603
23329
|
),
|
|
24604
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("title", { children:
|
|
23330
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("title", { children: p.label ?? `(${p.x}, ${p.y})` })
|
|
24605
23331
|
},
|
|
24606
23332
|
idx
|
|
24607
23333
|
);
|
|
@@ -30681,7 +29407,7 @@ var init_LineChart = __esm({
|
|
|
30681
29407
|
}, [sortedData, width, height]);
|
|
30682
29408
|
const linePath = React95.useMemo(() => {
|
|
30683
29409
|
if (points.length === 0) return "";
|
|
30684
|
-
return points.map((
|
|
29410
|
+
return points.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
|
|
30685
29411
|
}, [points]);
|
|
30686
29412
|
const areaPath = React95.useMemo(() => {
|
|
30687
29413
|
if (points.length === 0 || !showArea) return "";
|
|
@@ -30881,18 +29607,18 @@ var init_MathCanvas = __esm({
|
|
|
30881
29607
|
});
|
|
30882
29608
|
}
|
|
30883
29609
|
}
|
|
30884
|
-
for (const
|
|
30885
|
-
if (
|
|
29610
|
+
for (const p of points) {
|
|
29611
|
+
if (p.x < xMin || p.x > xMax || p.y < yMin || p.y > yMax) continue;
|
|
30886
29612
|
out.push({
|
|
30887
29613
|
type: "circle",
|
|
30888
|
-
x: mapX(
|
|
30889
|
-
y: mapY(
|
|
30890
|
-
radius:
|
|
30891
|
-
color:
|
|
30892
|
-
fill:
|
|
29614
|
+
x: mapX(p.x),
|
|
29615
|
+
y: mapY(p.y),
|
|
29616
|
+
radius: p.radius ?? 4,
|
|
29617
|
+
color: p.color ?? "#dc2626",
|
|
29618
|
+
fill: p.color ?? "#dc2626"
|
|
30893
29619
|
});
|
|
30894
|
-
if (
|
|
30895
|
-
out.push({ type: "text", x: mapX(
|
|
29620
|
+
if (p.label) {
|
|
29621
|
+
out.push({ type: "text", x: mapX(p.x) + 8, y: mapY(p.y) - 8, text: p.label, color: "#111827", fontSize: 12 });
|
|
30896
29622
|
}
|
|
30897
29623
|
}
|
|
30898
29624
|
for (const v of vectors) {
|
|
@@ -31411,13 +30137,13 @@ var init_MapView = __esm({
|
|
|
31411
30137
|
shadowSize: [41, 41]
|
|
31412
30138
|
});
|
|
31413
30139
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
31414
|
-
const { useEffect:
|
|
30140
|
+
const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback99, useState: useState97 } = React95__namespace.default;
|
|
31415
30141
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
31416
30142
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
31417
30143
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
31418
30144
|
const map = useMap();
|
|
31419
|
-
const prevRef =
|
|
31420
|
-
|
|
30145
|
+
const prevRef = useRef65({ centerLat, centerLng, zoom });
|
|
30146
|
+
useEffect67(() => {
|
|
31421
30147
|
const prev = prevRef.current;
|
|
31422
30148
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
31423
30149
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -31428,7 +30154,7 @@ var init_MapView = __esm({
|
|
|
31428
30154
|
}
|
|
31429
30155
|
function MapClickHandler({ onMapClick }) {
|
|
31430
30156
|
const map = useMap();
|
|
31431
|
-
|
|
30157
|
+
useEffect67(() => {
|
|
31432
30158
|
if (!onMapClick) return;
|
|
31433
30159
|
const handler = (e) => {
|
|
31434
30160
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -31456,8 +30182,8 @@ var init_MapView = __esm({
|
|
|
31456
30182
|
showAttribution = true
|
|
31457
30183
|
}) {
|
|
31458
30184
|
const eventBus = useEventBus2();
|
|
31459
|
-
const [clickedPosition, setClickedPosition] =
|
|
31460
|
-
const handleMapClick =
|
|
30185
|
+
const [clickedPosition, setClickedPosition] = useState97(null);
|
|
30186
|
+
const handleMapClick = useCallback99((lat, lng) => {
|
|
31461
30187
|
if (showClickedPin) {
|
|
31462
30188
|
setClickedPosition({ lat, lng });
|
|
31463
30189
|
}
|
|
@@ -31466,7 +30192,7 @@ var init_MapView = __esm({
|
|
|
31466
30192
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
31467
30193
|
}
|
|
31468
30194
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
31469
|
-
const handleMarkerClick =
|
|
30195
|
+
const handleMarkerClick = useCallback99((marker) => {
|
|
31470
30196
|
onMarkerClick?.(marker);
|
|
31471
30197
|
if (markerClickEvent) {
|
|
31472
30198
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -32539,7 +31265,7 @@ function TableView({
|
|
|
32539
31265
|
children: [
|
|
32540
31266
|
header,
|
|
32541
31267
|
dnd.wrapContainer(body),
|
|
32542
|
-
hasMore && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setVisibleCount((
|
|
31268
|
+
hasMore && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setVisibleCount((p) => p + (pageSize || 5)), children: [
|
|
32543
31269
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
32544
31270
|
t("common.showMore"),
|
|
32545
31271
|
" (",
|
|
@@ -35123,7 +33849,7 @@ var init_QrScanner = __esm({
|
|
|
35123
33849
|
setCurrentFacing((f3) => f3 === "environment" ? "user" : "environment");
|
|
35124
33850
|
}, []);
|
|
35125
33851
|
const togglePause = React95.useCallback(() => {
|
|
35126
|
-
setIsPaused((
|
|
33852
|
+
setIsPaused((p) => !p);
|
|
35127
33853
|
}, []);
|
|
35128
33854
|
const handleMockScan = React95.useCallback(() => {
|
|
35129
33855
|
const result = {
|
|
@@ -38045,10 +36771,10 @@ var init_ModuleCard = __esm({
|
|
|
38045
36771
|
] })
|
|
38046
36772
|
] }, trait.name);
|
|
38047
36773
|
}),
|
|
38048
|
-
pages.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-1.5 flex items-center gap-2 flex-wrap", children: pages.map((
|
|
36774
|
+
pages.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-1.5 flex items-center gap-2 flex-wrap", children: pages.map((p) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
38049
36775
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 10, height: 10, viewBox: "0 0 12 12", children: /* @__PURE__ */ jsxRuntime.jsx(AvlPage, { x: 6, y: 6, size: 5 }) }),
|
|
38050
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-mono text-[var(--color-muted-foreground)]", children:
|
|
38051
|
-
] },
|
|
36776
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-mono text-[var(--color-muted-foreground)]", children: p.route })
|
|
36777
|
+
] }, p.name)) })
|
|
38052
36778
|
]
|
|
38053
36779
|
}
|
|
38054
36780
|
);
|
|
@@ -39584,12 +38310,12 @@ var init_DocumentViewer = __esm({
|
|
|
39584
38310
|
const handleZoomIn = React95.useCallback(() => setZoom((z) => Math.min(z + 25, 200)), []);
|
|
39585
38311
|
const handleZoomOut = React95.useCallback(() => setZoom((z) => Math.max(z - 25, 50)), []);
|
|
39586
38312
|
const handlePagePrev = React95.useCallback(() => {
|
|
39587
|
-
setCurrentPage((
|
|
38313
|
+
setCurrentPage((p) => Math.max(p - 1, 1));
|
|
39588
38314
|
eventBus.emit("UI:DOCUMENT_PAGE_CHANGE", { page: currentPage - 1 });
|
|
39589
38315
|
}, [eventBus, currentPage]);
|
|
39590
38316
|
const handlePageNext = React95.useCallback(() => {
|
|
39591
38317
|
if (totalPages) {
|
|
39592
|
-
setCurrentPage((
|
|
38318
|
+
setCurrentPage((p) => Math.min(p + 1, totalPages));
|
|
39593
38319
|
eventBus.emit("UI:DOCUMENT_PAGE_CHANGE", { page: currentPage + 1 });
|
|
39594
38320
|
}
|
|
39595
38321
|
}, [totalPages, eventBus, currentPage]);
|
|
@@ -43691,7 +42417,7 @@ function WalkMinimap() {
|
|
|
43691
42417
|
const graphH = 120;
|
|
43692
42418
|
const nodeR = 10;
|
|
43693
42419
|
const positions = activeTrait ? layoutGraph(activeTrait.states, activeTrait.transitions, activeTrait.initialState, graphW, graphH) : [];
|
|
43694
|
-
const posMap = new Map(positions.map((
|
|
42420
|
+
const posMap = new Map(positions.map((p) => [p.state, p]));
|
|
43695
42421
|
const visitedStates = new Set(
|
|
43696
42422
|
coveredEdges.filter((e) => e.trait === walkStep.traitName).flatMap((e) => [e.from, e.to])
|
|
43697
42423
|
);
|
|
@@ -46961,7 +45687,6 @@ var init_component_registry_generated = __esm({
|
|
|
46961
45687
|
init_CTABanner();
|
|
46962
45688
|
init_CalendarGrid();
|
|
46963
45689
|
init_Canvas2D();
|
|
46964
|
-
init_CanvasEffect();
|
|
46965
45690
|
init_Card();
|
|
46966
45691
|
init_CardGrid();
|
|
46967
45692
|
init_Carousel();
|
|
@@ -47260,7 +45985,6 @@ var init_component_registry_generated = __esm({
|
|
|
47260
45985
|
"CTABanner": CTABanner,
|
|
47261
45986
|
"CalendarGrid": CalendarGrid,
|
|
47262
45987
|
"Canvas2D": Canvas2D,
|
|
47263
|
-
"CanvasEffect": CanvasEffect,
|
|
47264
45988
|
"Card": Card,
|
|
47265
45989
|
"CardGrid": CardGrid,
|
|
47266
45990
|
"Carousel": Carousel,
|
|
@@ -48504,12 +47228,12 @@ function isFnFormLambda(value) {
|
|
|
48504
47228
|
return false;
|
|
48505
47229
|
}
|
|
48506
47230
|
const params = arr[1];
|
|
48507
|
-
return typeof params === "string" || Array.isArray(params) && params.length > 0 && params.every((
|
|
47231
|
+
return typeof params === "string" || Array.isArray(params) && params.length > 0 && params.every((p) => typeof p === "string");
|
|
48508
47232
|
}
|
|
48509
47233
|
function fnFormParams(value) {
|
|
48510
|
-
const
|
|
48511
|
-
if (typeof
|
|
48512
|
-
if (Array.isArray(
|
|
47234
|
+
const p = value[1];
|
|
47235
|
+
if (typeof p === "string") return [p];
|
|
47236
|
+
if (Array.isArray(p)) return p.filter((x) => typeof x === "string");
|
|
48513
47237
|
return [];
|
|
48514
47238
|
}
|
|
48515
47239
|
function resolveLambdaBindings(body, params, item, index) {
|
|
@@ -50009,9 +48733,9 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
|
|
|
50009
48733
|
const orbitalsByTrait = React95.useMemo(
|
|
50010
48734
|
() => buildOrbitalsByTrait(
|
|
50011
48735
|
schema,
|
|
50012
|
-
ir ? Array.from(ir.pages.values()).map((
|
|
50013
|
-
path:
|
|
50014
|
-
traitNames:
|
|
48736
|
+
ir ? Array.from(ir.pages.values()).map((p) => ({
|
|
48737
|
+
path: p.path,
|
|
48738
|
+
traitNames: p.traits.map((b) => b.trait.name)
|
|
50015
48739
|
})) : []
|
|
50016
48740
|
),
|
|
50017
48741
|
[schema, ir]
|
|
@@ -50200,7 +48924,7 @@ function OrbPreview({
|
|
|
50200
48924
|
navLog.debug("handleNavigate", () => ({
|
|
50201
48925
|
path,
|
|
50202
48926
|
matched: match?.page.name ?? null,
|
|
50203
|
-
availablePaths: pages.map((
|
|
48927
|
+
availablePaths: pages.map((p) => p.page.path)
|
|
50204
48928
|
}));
|
|
50205
48929
|
if (match) {
|
|
50206
48930
|
setCurrentPage(match.page.name);
|
|
@@ -50244,7 +48968,7 @@ function OrbPreview({
|
|
|
50244
48968
|
handleNavigate(href);
|
|
50245
48969
|
};
|
|
50246
48970
|
el.addEventListener("click", handler, true);
|
|
50247
|
-
navLog.info("interceptor:installed", { pageCount: pages.length, paths: pages.map((
|
|
48971
|
+
navLog.info("interceptor:installed", { pageCount: pages.length, paths: pages.map((p) => p.page.path) });
|
|
50248
48972
|
return () => el.removeEventListener("click", handler, true);
|
|
50249
48973
|
}, [pages, handleNavigate]);
|
|
50250
48974
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|