@number10/phaserjsx 0.4.2 → 0.5.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/{TransformOriginView-CrzevUOh.cjs → TransformOriginView-DyhDBexY.cjs} +520 -539
- package/dist/TransformOriginView-DyhDBexY.cjs.map +1 -0
- package/dist/{TransformOriginView-TeXhLqNs.js → TransformOriginView-Y2LMZNcF.js} +587 -606
- package/dist/TransformOriginView-Y2LMZNcF.js.map +1 -0
- package/dist/animation/useSpring.d.ts.map +1 -1
- package/dist/colors/preset-manager.d.ts.map +1 -1
- package/dist/components/appliers/applyLayout.d.ts +4 -0
- package/dist/components/appliers/applyLayout.d.ts.map +1 -1
- package/dist/components/custom/Portal.d.ts.map +1 -1
- package/dist/components/custom/index.cjs +34 -34
- package/dist/components/custom/index.js +1 -1
- package/dist/effects/use-effect.d.ts +5 -0
- package/dist/effects/use-effect.d.ts.map +1 -1
- package/dist/hooks-svg.d.ts +1 -1
- package/dist/hooks-svg.d.ts.map +1 -1
- package/dist/hooks.d.ts +5 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/host.d.ts +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/index.cjs +496 -285
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +292 -81
- package/dist/index.js.map +1 -1
- package/dist/render-context.d.ts +1 -1
- package/dist/render-context.d.ts.map +1 -1
- package/dist/scene-backgrounds.d.ts +19 -0
- package/dist/scene-backgrounds.d.ts.map +1 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/utils/phaser-guards.d.ts +7 -0
- package/dist/utils/phaser-guards.d.ts.map +1 -0
- package/dist/vdom.d.ts.map +1 -1
- package/jsx-dev-runtime.d.ts +1 -0
- package/jsx-runtime.d.ts +1 -0
- package/package.json +4 -2
- package/dist/TransformOriginView-CrzevUOh.cjs.map +0 -1
- package/dist/TransformOriginView-TeXhLqNs.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './theme';
|
|
|
10
10
|
export * from './types';
|
|
11
11
|
export * from './vdom';
|
|
12
12
|
export * from './particles';
|
|
13
|
+
export * from './scene-backgrounds';
|
|
13
14
|
export { normalizeCornerRadius, normalizeEdgeInsets, normalizeGap, type CornerRadiusInsets, type EdgeInsets, type GapInsets, } from './core-props';
|
|
14
15
|
export type { Display, FlexBasisValue, FocusEventData, GestureEventData, GestureProps, InputEventData, KeyboardEventData, SizeValue, TouchMoveState, } from './core-props';
|
|
15
16
|
export { DOMInputElement, type DOMInputConfig } from './utils/dom-input-manager';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,aAAa,CAAA;AAKpB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,MAAM,CAAA;AACpB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,aAAa,CAAA;AAKpB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,MAAM,CAAA;AACpB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AAGnC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,SAAS,GACf,MAAM,cAAc,CAAA;AAGrB,YAAY,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,cAAc,GACf,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAGpG,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,aAAa,EACb,QAAQ,IAAI,cAAc,EAC1B,KAAK,mBAAmB,EACxB,KAAK,UAAU,GAChB,MAAM,QAAQ,CAAA;AAGf,cAAc,cAAc,CAAA;AAG5B,cAAc,qBAAqB,CAAA;AAGnC,cAAc,UAAU,CAAA;AAGxB,cAAc,aAAa,CAAA;AAG3B,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,cAAc,UAAU,CAAA;AAGxB,cAAc,iBAAiB,CAAA;AAG/B,YAAY,EACV,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,eAAe,GAChB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGxE,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEvE;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAGnD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as equal, v as viewportRegistry, w as parseSize, x as resolveSize, y as getGestureManager, z as calculateLayout, E as themeRegistry, F as normalizeGap, G as getChildSize, H as DebugLogger, K as useTheme, L as getThemedProps, O as register, Q as useEffect, U as useScene, V as useRef, X as useCallback, Y as mountJSX, Z as useState, _ as getPresetWithMode, $ as alpha, a0 as
|
|
2
|
-
import { A, a, B, C, b,
|
|
3
|
-
import * as Phaser
|
|
1
|
+
import { t as equal, v as viewportRegistry, w as parseSize, x as resolveSize, y as getGestureManager, z as calculateLayout, E as themeRegistry, F as normalizeGap, G as getChildSize, H as DebugLogger, K as useTheme, L as getThemedProps, O as register, Q as useEffect, U as useScene, V as useRef, X as useCallback, Y as mountJSX, Z as useState, _ as getPresetWithMode, $ as alpha, a0 as remountAll, a1 as defaultRadiusTokens, a2 as defaultSizeTokens, a3 as defaultSpacingTokens, a4 as createTextStyleTokens } from "./TransformOriginView-Y2LMZNcF.js";
|
|
2
|
+
import { A, a, B, C, b, af, bj, a7, ab, ac, D, c, d, ag, bc, bo, I, f, J, a8, M, N, g, P, h, R, i, n, j, bk, S, l, m, o, bl, T, p, q, bd, r, s, be, W, bg, bB, ah, bC, k, aj, ak, b2, b7, al, am, an, ao, ap, e, aq, ar, as, at, au, av, aw, ax, ay, az, by, b5, aA, aB, aC, aD, bt, bu, bJ, b3, aW, bz, bD, bE, aM, bA, aE, aL, aO, aJ, a9, bF, aa, aQ, bv, bp, b1, bh, bw, bx, b4, bG, b8, b0, a5, a6, b6, bq, br, bH, ba, bf, bI, aZ, aX, aY, ai, bs, aT, aU, ad, b9, bb, bi, aN, aG, ae, u, aS, aP, aK, aH, aV, a_, a$, bm, bn, aI, aR, aF } from "./TransformOriginView-Y2LMZNcF.js";
|
|
3
|
+
import * as Phaser from "phaser";
|
|
4
4
|
import { jsx } from "./jsx-runtime.js";
|
|
5
5
|
import { Fragment, jsxs } from "./jsx-runtime.js";
|
|
6
6
|
import { computed } from "@preact/signals-core";
|
|
@@ -426,13 +426,13 @@ function buildZoneSource(zone, fallbackSize) {
|
|
|
426
426
|
const { width, height } = resolveZoneSize(zone, fallbackSize);
|
|
427
427
|
switch (zone.shape) {
|
|
428
428
|
case "rect":
|
|
429
|
-
return new Phaser
|
|
429
|
+
return new Phaser.Geom.Rectangle(baseX, baseY, width ?? 1, height ?? 1);
|
|
430
430
|
case "circle":
|
|
431
|
-
return new Phaser
|
|
431
|
+
return new Phaser.Geom.Circle(baseX, baseY, zone.radius ?? 1);
|
|
432
432
|
case "ellipse":
|
|
433
|
-
return new Phaser
|
|
433
|
+
return new Phaser.Geom.Ellipse(baseX, baseY, width ?? 1, height ?? 1);
|
|
434
434
|
case "line":
|
|
435
|
-
return new Phaser
|
|
435
|
+
return new Phaser.Geom.Line(
|
|
436
436
|
baseX,
|
|
437
437
|
baseY,
|
|
438
438
|
zone.endX ?? baseX + (width ?? 1),
|
|
@@ -1150,7 +1150,7 @@ function applyGesturesProps(scene, container, prev, next) {
|
|
|
1150
1150
|
width = bounds.width || 100;
|
|
1151
1151
|
height = bounds.height || 100;
|
|
1152
1152
|
}
|
|
1153
|
-
const hitArea = new Phaser
|
|
1153
|
+
const hitArea = new Phaser.Geom.Rectangle(0, 0, width, height);
|
|
1154
1154
|
const callbacks = {};
|
|
1155
1155
|
if (next.onTouch) callbacks.onTouch = next.onTouch;
|
|
1156
1156
|
if (next.onTouchOutside) callbacks.onTouchOutside = next.onTouchOutside;
|
|
@@ -1196,7 +1196,7 @@ function applyGesturesProps(scene, container, prev, next) {
|
|
|
1196
1196
|
width = bounds.width || 100;
|
|
1197
1197
|
height = bounds.height || 100;
|
|
1198
1198
|
}
|
|
1199
|
-
const hitArea = new Phaser
|
|
1199
|
+
const hitArea = new Phaser.Geom.Rectangle(0, 0, width, height);
|
|
1200
1200
|
manager.updateHitArea(container, hitArea);
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
@@ -1563,7 +1563,7 @@ function createGestures(scene, container, props) {
|
|
|
1563
1563
|
width = bounds.width || 100;
|
|
1564
1564
|
height = bounds.height || 100;
|
|
1565
1565
|
}
|
|
1566
|
-
const hitArea = new Phaser
|
|
1566
|
+
const hitArea = new Phaser.Geom.Rectangle(0, 0, width, height);
|
|
1567
1567
|
const callbacks = {};
|
|
1568
1568
|
if (props.onTouch) callbacks.onTouch = props.onTouch;
|
|
1569
1569
|
if (props.onTouchOutside) callbacks.onTouchOutside = props.onTouchOutside;
|
|
@@ -1747,7 +1747,7 @@ function registerBuiltins() {
|
|
|
1747
1747
|
}
|
|
1748
1748
|
const createCameraShakeFX = (camera, config) => {
|
|
1749
1749
|
const duration = config.duration ?? 250;
|
|
1750
|
-
const intensity = typeof config.intensity === "object" ? new Phaser
|
|
1750
|
+
const intensity = typeof config.intensity === "object" ? new Phaser.Math.Vector2(config.intensity.x, config.intensity.y) : config.intensity ?? 0.01;
|
|
1751
1751
|
camera.shake(duration, intensity, config.force ?? false, config.onComplete);
|
|
1752
1752
|
};
|
|
1753
1753
|
const createCameraFlashFX = (camera, config) => {
|
|
@@ -2153,6 +2153,217 @@ function useParticles(ref) {
|
|
|
2153
2153
|
setExcludeZones
|
|
2154
2154
|
};
|
|
2155
2155
|
}
|
|
2156
|
+
const DEFAULT_LOGO_KEY = "phaser-jsx-logo";
|
|
2157
|
+
const DEFAULT_BACKGROUND = {
|
|
2158
|
+
type: "grid",
|
|
2159
|
+
animation: "lemniscate",
|
|
2160
|
+
opacity: 0.15,
|
|
2161
|
+
color: 4890367
|
|
2162
|
+
};
|
|
2163
|
+
function addSceneBackground(scene, config = DEFAULT_BACKGROUND) {
|
|
2164
|
+
const bgConfig = config ?? DEFAULT_BACKGROUND;
|
|
2165
|
+
if (bgConfig.type === "none") return null;
|
|
2166
|
+
let background;
|
|
2167
|
+
let backgroundTween;
|
|
2168
|
+
const particleTweens = [];
|
|
2169
|
+
let resizeFn;
|
|
2170
|
+
let destroyed = false;
|
|
2171
|
+
const createGridBackground = () => {
|
|
2172
|
+
const graphics = scene.add.graphics();
|
|
2173
|
+
const gridSize = 40;
|
|
2174
|
+
const color = bgConfig.color ?? 4890367;
|
|
2175
|
+
const opacity = bgConfig.opacity ?? 0.15;
|
|
2176
|
+
const drawGrid = (offsetX, offsetY) => {
|
|
2177
|
+
graphics.clear();
|
|
2178
|
+
graphics.lineStyle(1, color, opacity);
|
|
2179
|
+
const width = scene.scale.width;
|
|
2180
|
+
const height = scene.scale.height;
|
|
2181
|
+
for (let x = offsetX % gridSize; x < width; x += gridSize) {
|
|
2182
|
+
graphics.lineBetween(x, 0, x, height);
|
|
2183
|
+
}
|
|
2184
|
+
for (let y = offsetY % gridSize; y < height; y += gridSize) {
|
|
2185
|
+
graphics.lineBetween(0, y, width, y);
|
|
2186
|
+
}
|
|
2187
|
+
};
|
|
2188
|
+
drawGrid(0, 0);
|
|
2189
|
+
graphics.__redrawFn = drawGrid;
|
|
2190
|
+
background = graphics;
|
|
2191
|
+
resizeFn = () => drawGrid(0, 0);
|
|
2192
|
+
};
|
|
2193
|
+
const createLogoBackground = () => {
|
|
2194
|
+
const container = scene.add.container(scene.scale.width / 2, scene.scale.height / 2);
|
|
2195
|
+
const opacity = bgConfig.opacity ?? 0.1;
|
|
2196
|
+
const logoKey = bgConfig.logoKey ?? DEFAULT_LOGO_KEY;
|
|
2197
|
+
const logo = scene.add.image(0, 0, logoKey);
|
|
2198
|
+
logo.setAlpha(opacity);
|
|
2199
|
+
logo.setScale(0.5);
|
|
2200
|
+
container.add(logo);
|
|
2201
|
+
background = container;
|
|
2202
|
+
resizeFn = (width, height) => {
|
|
2203
|
+
container.setPosition(width / 2, height / 2);
|
|
2204
|
+
};
|
|
2205
|
+
};
|
|
2206
|
+
const createGradientBackground = () => {
|
|
2207
|
+
const graphics = scene.add.graphics();
|
|
2208
|
+
const color1 = bgConfig.color ?? 4890367;
|
|
2209
|
+
const color2 = bgConfig.colorSecondary ?? 7031551;
|
|
2210
|
+
const opacity = bgConfig.opacity ?? 0.2;
|
|
2211
|
+
const drawGradient = () => {
|
|
2212
|
+
graphics.clear();
|
|
2213
|
+
graphics.fillGradientStyle(color1, color1, color2, color2, opacity, opacity, opacity, opacity);
|
|
2214
|
+
graphics.fillRect(0, 0, scene.scale.width, scene.scale.height);
|
|
2215
|
+
};
|
|
2216
|
+
drawGradient();
|
|
2217
|
+
background = graphics;
|
|
2218
|
+
resizeFn = drawGradient;
|
|
2219
|
+
};
|
|
2220
|
+
const createParticlesBackground = () => {
|
|
2221
|
+
const container = scene.add.container(0, 0);
|
|
2222
|
+
const particleCount = 20;
|
|
2223
|
+
const color = bgConfig.color ?? 4890367;
|
|
2224
|
+
const opacity = bgConfig.opacity ?? 0.1;
|
|
2225
|
+
const particles = [];
|
|
2226
|
+
for (let i2 = 0; i2 < particleCount; i2 += 1) {
|
|
2227
|
+
const size = Phaser.Math.Between(2, 6);
|
|
2228
|
+
const x = Phaser.Math.Between(0, scene.scale.width);
|
|
2229
|
+
const y = Phaser.Math.Between(0, scene.scale.height);
|
|
2230
|
+
const particle = scene.add.circle(x, y, size, color, opacity);
|
|
2231
|
+
container.add(particle);
|
|
2232
|
+
particles.push(particle);
|
|
2233
|
+
particleTweens.push(
|
|
2234
|
+
scene.tweens.add({
|
|
2235
|
+
targets: particle,
|
|
2236
|
+
y: particle.y + Phaser.Math.Between(-50, 50),
|
|
2237
|
+
x: particle.x + Phaser.Math.Between(-50, 50),
|
|
2238
|
+
alpha: opacity * 1.5,
|
|
2239
|
+
duration: Phaser.Math.Between(2e3, 4e3),
|
|
2240
|
+
yoyo: true,
|
|
2241
|
+
repeat: -1,
|
|
2242
|
+
ease: "Sine.easeInOut"
|
|
2243
|
+
})
|
|
2244
|
+
);
|
|
2245
|
+
}
|
|
2246
|
+
background = container;
|
|
2247
|
+
resizeFn = (width, height) => {
|
|
2248
|
+
for (const particle of particles) {
|
|
2249
|
+
particle.setPosition(Phaser.Math.Between(0, width), Phaser.Math.Between(0, height));
|
|
2250
|
+
}
|
|
2251
|
+
};
|
|
2252
|
+
};
|
|
2253
|
+
switch (bgConfig.type) {
|
|
2254
|
+
case "grid":
|
|
2255
|
+
createGridBackground();
|
|
2256
|
+
break;
|
|
2257
|
+
case "logo":
|
|
2258
|
+
createLogoBackground();
|
|
2259
|
+
break;
|
|
2260
|
+
case "gradient":
|
|
2261
|
+
createGradientBackground();
|
|
2262
|
+
break;
|
|
2263
|
+
case "particles":
|
|
2264
|
+
createParticlesBackground();
|
|
2265
|
+
break;
|
|
2266
|
+
}
|
|
2267
|
+
if (!background) return null;
|
|
2268
|
+
if (bgConfig.animation && bgConfig.animation !== "static") {
|
|
2269
|
+
backgroundTween = applyAnimation(scene, background, bgConfig.animation);
|
|
2270
|
+
}
|
|
2271
|
+
const onResize = () => {
|
|
2272
|
+
if (resizeFn) resizeFn(scene.scale.width, scene.scale.height);
|
|
2273
|
+
};
|
|
2274
|
+
const cleanup = () => {
|
|
2275
|
+
if (destroyed) return;
|
|
2276
|
+
destroyed = true;
|
|
2277
|
+
backgroundTween?.stop();
|
|
2278
|
+
for (const tween of particleTweens) {
|
|
2279
|
+
tween.stop();
|
|
2280
|
+
}
|
|
2281
|
+
background?.destroy();
|
|
2282
|
+
background = void 0;
|
|
2283
|
+
scene.scale.off(Phaser.Scale.Events.RESIZE, onResize);
|
|
2284
|
+
scene.events.off(Phaser.Scenes.Events.SHUTDOWN, cleanup);
|
|
2285
|
+
scene.events.off(Phaser.Scenes.Events.DESTROY, cleanup);
|
|
2286
|
+
};
|
|
2287
|
+
scene.scale.on(Phaser.Scale.Events.RESIZE, onResize);
|
|
2288
|
+
scene.events.once(Phaser.Scenes.Events.SHUTDOWN, cleanup);
|
|
2289
|
+
scene.events.once(Phaser.Scenes.Events.DESTROY, cleanup);
|
|
2290
|
+
return {
|
|
2291
|
+
background,
|
|
2292
|
+
destroy: cleanup,
|
|
2293
|
+
resize: (width, height) => {
|
|
2294
|
+
if (resizeFn) resizeFn(width, height);
|
|
2295
|
+
}
|
|
2296
|
+
};
|
|
2297
|
+
}
|
|
2298
|
+
function applyAnimation(scene, target, animation) {
|
|
2299
|
+
const redrawFn = target.__redrawFn;
|
|
2300
|
+
switch (animation) {
|
|
2301
|
+
case "lemniscate":
|
|
2302
|
+
return redrawFn ? animateLemniscate(scene, redrawFn) : animatePulse(scene, target);
|
|
2303
|
+
case "wave":
|
|
2304
|
+
return redrawFn ? animateWave(scene, redrawFn) : animatePulse(scene, target);
|
|
2305
|
+
case "pulse":
|
|
2306
|
+
return animatePulse(scene, target);
|
|
2307
|
+
case "rotate":
|
|
2308
|
+
return animateRotate(scene, target);
|
|
2309
|
+
case "static":
|
|
2310
|
+
default:
|
|
2311
|
+
return void 0;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
function animateLemniscate(scene, drawFn) {
|
|
2315
|
+
const amplitude = 30;
|
|
2316
|
+
const duration = 8e3;
|
|
2317
|
+
return scene.tweens.addCounter({
|
|
2318
|
+
from: 0,
|
|
2319
|
+
to: Math.PI * 2,
|
|
2320
|
+
duration,
|
|
2321
|
+
repeat: -1,
|
|
2322
|
+
onUpdate: (tween) => {
|
|
2323
|
+
const t = tween.getValue();
|
|
2324
|
+
if (t !== null) {
|
|
2325
|
+
const offsetX = amplitude * Math.cos(t);
|
|
2326
|
+
const offsetY = amplitude * Math.sin(2 * t) / 2;
|
|
2327
|
+
drawFn(offsetX, offsetY);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
});
|
|
2331
|
+
}
|
|
2332
|
+
function animateWave(scene, drawFn) {
|
|
2333
|
+
return scene.tweens.addCounter({
|
|
2334
|
+
from: 0,
|
|
2335
|
+
to: 40,
|
|
2336
|
+
duration: 3e3,
|
|
2337
|
+
yoyo: true,
|
|
2338
|
+
repeat: -1,
|
|
2339
|
+
onUpdate: (tween) => {
|
|
2340
|
+
const offset = tween.getValue();
|
|
2341
|
+
if (offset !== null) {
|
|
2342
|
+
drawFn(offset, 0);
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
});
|
|
2346
|
+
}
|
|
2347
|
+
function animatePulse(scene, target) {
|
|
2348
|
+
return scene.tweens.add({
|
|
2349
|
+
targets: target,
|
|
2350
|
+
scaleX: 1.1,
|
|
2351
|
+
scaleY: 1.1,
|
|
2352
|
+
duration: 2e3,
|
|
2353
|
+
yoyo: true,
|
|
2354
|
+
repeat: -1,
|
|
2355
|
+
ease: "Sine.easeInOut"
|
|
2356
|
+
});
|
|
2357
|
+
}
|
|
2358
|
+
function animateRotate(scene, target) {
|
|
2359
|
+
return scene.tweens.add({
|
|
2360
|
+
targets: target,
|
|
2361
|
+
angle: 360,
|
|
2362
|
+
duration: 2e4,
|
|
2363
|
+
repeat: -1,
|
|
2364
|
+
ease: "Linear"
|
|
2365
|
+
});
|
|
2366
|
+
}
|
|
2156
2367
|
function createPhaserJSXPlugin(config) {
|
|
2157
2368
|
return {
|
|
2158
2369
|
key: "PhaserJSX",
|
|
@@ -2161,7 +2372,7 @@ function createPhaserJSXPlugin(config) {
|
|
|
2161
2372
|
data: config
|
|
2162
2373
|
};
|
|
2163
2374
|
}
|
|
2164
|
-
class PhaserJSXPlugin extends Phaser
|
|
2375
|
+
class PhaserJSXPlugin extends Phaser.Plugins.BasePlugin {
|
|
2165
2376
|
config;
|
|
2166
2377
|
mountHandle;
|
|
2167
2378
|
container;
|
|
@@ -2406,9 +2617,7 @@ function setColorPreset(presetName, colorMode) {
|
|
|
2406
2617
|
return;
|
|
2407
2618
|
}
|
|
2408
2619
|
setTimeout(() => {
|
|
2409
|
-
|
|
2410
|
-
remountAll();
|
|
2411
|
-
});
|
|
2620
|
+
remountAll();
|
|
2412
2621
|
}, 0);
|
|
2413
2622
|
}
|
|
2414
2623
|
function getCurrentPreset() {
|
|
@@ -2489,18 +2698,19 @@ export {
|
|
|
2489
2698
|
CAMERA_FX_REGISTRY,
|
|
2490
2699
|
C as CharText,
|
|
2491
2700
|
b as CharTextInput,
|
|
2701
|
+
DEFAULT_BACKGROUND,
|
|
2492
2702
|
DEFAULT_CAMERA_FX,
|
|
2493
|
-
|
|
2703
|
+
af as DEFAULT_EFFECT,
|
|
2494
2704
|
DEFAULT_FX,
|
|
2495
2705
|
bj as DEFAULT_SPRING_CONFIG,
|
|
2496
|
-
|
|
2706
|
+
a7 as DOMInputElement,
|
|
2497
2707
|
DebugLogger,
|
|
2498
|
-
|
|
2499
|
-
|
|
2708
|
+
ab as DevConfig,
|
|
2709
|
+
ac as DevPresets,
|
|
2500
2710
|
D as Dialog,
|
|
2501
2711
|
c as Divider,
|
|
2502
2712
|
d as Dropdown,
|
|
2503
|
-
|
|
2713
|
+
ag as EFFECT_REGISTRY,
|
|
2504
2714
|
FX_REGISTRY,
|
|
2505
2715
|
Fragment,
|
|
2506
2716
|
bc as Graphics,
|
|
@@ -2508,7 +2718,7 @@ export {
|
|
|
2508
2718
|
I as Icon,
|
|
2509
2719
|
f as Image,
|
|
2510
2720
|
J as Joystick,
|
|
2511
|
-
|
|
2721
|
+
a8 as KeyboardInputManager,
|
|
2512
2722
|
M as Modal,
|
|
2513
2723
|
N as NineSlice,
|
|
2514
2724
|
g as NineSliceButton,
|
|
@@ -2536,11 +2746,12 @@ export {
|
|
|
2536
2746
|
s as TransformOriginView,
|
|
2537
2747
|
be as View,
|
|
2538
2748
|
W as WrapText,
|
|
2749
|
+
addSceneBackground,
|
|
2539
2750
|
alpha,
|
|
2540
2751
|
bg as animatedSignal,
|
|
2541
2752
|
applyCameraFXByName,
|
|
2542
2753
|
bB as applyDarkMode,
|
|
2543
|
-
|
|
2754
|
+
ah as applyEffectByName,
|
|
2544
2755
|
applyFXByName,
|
|
2545
2756
|
bC as applyLightMode,
|
|
2546
2757
|
buildDeathZonesFromLayout,
|
|
@@ -2550,78 +2761,78 @@ export {
|
|
|
2550
2761
|
colorsToTheme,
|
|
2551
2762
|
computed,
|
|
2552
2763
|
createBlurFX,
|
|
2553
|
-
|
|
2554
|
-
|
|
2764
|
+
aj as createBounceEffect,
|
|
2765
|
+
ak as createBreatheEffect,
|
|
2555
2766
|
createCameraFadeInFX,
|
|
2556
2767
|
createCameraFadeOutFX,
|
|
2557
2768
|
createCameraFlashFX,
|
|
2558
2769
|
createCameraShakeFX,
|
|
2559
2770
|
createCameraZoomFX,
|
|
2560
2771
|
createColorMatrixFX,
|
|
2561
|
-
|
|
2772
|
+
b2 as createDefaultTheme,
|
|
2562
2773
|
b7 as createElement,
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2774
|
+
al as createFadeEffect,
|
|
2775
|
+
am as createFlashEffect,
|
|
2776
|
+
an as createFlipInEffect,
|
|
2777
|
+
ao as createFlipOutEffect,
|
|
2778
|
+
ap as createFloatEffect,
|
|
2568
2779
|
createGlowFX,
|
|
2569
2780
|
e as createIconComponent,
|
|
2570
|
-
|
|
2571
|
-
|
|
2781
|
+
aq as createJelloEffect,
|
|
2782
|
+
ar as createNoneEffect,
|
|
2572
2783
|
createPhaserJSXPlugin,
|
|
2573
2784
|
createPixelateFX,
|
|
2574
|
-
|
|
2575
|
-
|
|
2785
|
+
as as createPressEffect,
|
|
2786
|
+
at as createPulseEffect,
|
|
2576
2787
|
createShadowFX,
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2788
|
+
au as createShakeEffect,
|
|
2789
|
+
av as createSlideInEffect,
|
|
2790
|
+
aw as createSlideOutEffect,
|
|
2791
|
+
ax as createSpinEffect,
|
|
2792
|
+
ay as createSwingEffect,
|
|
2793
|
+
az as createTadaEffect,
|
|
2583
2794
|
by as createTextStyle,
|
|
2584
2795
|
createTextStyleTokens,
|
|
2585
|
-
|
|
2796
|
+
b5 as createTheme,
|
|
2586
2797
|
createVignetteFX,
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2798
|
+
aA as createWiggleEffect,
|
|
2799
|
+
aB as createWobbleEffect,
|
|
2800
|
+
aC as createZoomInEffect,
|
|
2801
|
+
aD as createZoomOutEffect,
|
|
2591
2802
|
bt as darken,
|
|
2592
2803
|
bu as darkenHex,
|
|
2593
2804
|
defaultRadiusTokens,
|
|
2594
2805
|
defaultSizeTokens,
|
|
2595
2806
|
defaultSpacingTokens,
|
|
2596
2807
|
bJ as defaultTextStyleTokens,
|
|
2597
|
-
|
|
2598
|
-
|
|
2808
|
+
b3 as defaultTheme,
|
|
2809
|
+
aW as disposeCtx,
|
|
2599
2810
|
bz as ensureContrast,
|
|
2600
2811
|
bD as forestGreenPreset,
|
|
2601
2812
|
bE as generateColorScale,
|
|
2602
2813
|
getAvailablePresets,
|
|
2603
2814
|
getBackgroundColor,
|
|
2604
|
-
|
|
2815
|
+
aM as getBackgroundGraphics,
|
|
2605
2816
|
getBorderColor,
|
|
2606
2817
|
bA as getContrastRatio,
|
|
2607
|
-
|
|
2818
|
+
aE as getCurrent,
|
|
2608
2819
|
getCurrentPreset,
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2820
|
+
aL as getLayoutProps,
|
|
2821
|
+
aO as getLayoutRect,
|
|
2822
|
+
aJ as getLayoutSize,
|
|
2823
|
+
a9 as getMountStats,
|
|
2613
2824
|
bF as getPreset,
|
|
2614
2825
|
getPresetWithMode,
|
|
2615
|
-
|
|
2826
|
+
aa as getRenderContext,
|
|
2616
2827
|
getSurfaceColor,
|
|
2617
2828
|
getTextColor,
|
|
2618
2829
|
getThemedProps,
|
|
2619
|
-
|
|
2830
|
+
aQ as getWorldLayoutRect,
|
|
2620
2831
|
graphicsCreator,
|
|
2621
2832
|
graphicsPatcher,
|
|
2622
2833
|
bv as hex,
|
|
2623
2834
|
bp as hexToNumber,
|
|
2624
|
-
|
|
2835
|
+
b1 as host,
|
|
2625
2836
|
imageCreator,
|
|
2626
2837
|
imagePatcher,
|
|
2627
2838
|
bh as isAnimatedSignal,
|
|
@@ -2630,7 +2841,7 @@ export {
|
|
|
2630
2841
|
bw as lighten,
|
|
2631
2842
|
bx as lightenHex,
|
|
2632
2843
|
memo,
|
|
2633
|
-
|
|
2844
|
+
b4 as mergeThemes,
|
|
2634
2845
|
bG as midnightPreset,
|
|
2635
2846
|
b8 as mount,
|
|
2636
2847
|
mountJSX as mountComponent,
|
|
@@ -2638,9 +2849,9 @@ export {
|
|
|
2638
2849
|
nineSliceCreator,
|
|
2639
2850
|
nineSlicePatcher,
|
|
2640
2851
|
noMemo,
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2852
|
+
b0 as nodeRegistry,
|
|
2853
|
+
a5 as normalizeCornerRadius,
|
|
2854
|
+
a6 as normalizeEdgeInsets,
|
|
2644
2855
|
normalizeGap,
|
|
2645
2856
|
b6 as normalizeVNodeLike,
|
|
2646
2857
|
bq as numberToHex,
|
|
@@ -2653,22 +2864,22 @@ export {
|
|
|
2653
2864
|
bI as presets,
|
|
2654
2865
|
register,
|
|
2655
2866
|
registerBuiltins,
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2867
|
+
aZ as releaseAllSVGTextures,
|
|
2868
|
+
aX as releaseSVGTexture,
|
|
2869
|
+
aY as releaseSVGTextures,
|
|
2870
|
+
remountAll,
|
|
2660
2871
|
resolveCameraFX,
|
|
2661
|
-
|
|
2872
|
+
ai as resolveEffect,
|
|
2662
2873
|
resolveFX,
|
|
2663
2874
|
resolveParticlePreset,
|
|
2664
2875
|
bs as rgbToNumber,
|
|
2665
2876
|
setColorMode,
|
|
2666
2877
|
setColorPreset,
|
|
2667
|
-
|
|
2668
|
-
|
|
2878
|
+
aT as shallowEqual,
|
|
2879
|
+
aU as shouldComponentUpdate,
|
|
2669
2880
|
spriteCreator,
|
|
2670
2881
|
spritePatcher,
|
|
2671
|
-
|
|
2882
|
+
ad as svgToTexture,
|
|
2672
2883
|
textCreator,
|
|
2673
2884
|
textPatcher,
|
|
2674
2885
|
themeRegistry,
|
|
@@ -2677,7 +2888,7 @@ export {
|
|
|
2677
2888
|
b9 as unmount,
|
|
2678
2889
|
bb as unmountJSX,
|
|
2679
2890
|
bi as unwrapSignal,
|
|
2680
|
-
|
|
2891
|
+
aN as useBackgroundGraphics,
|
|
2681
2892
|
useBlur,
|
|
2682
2893
|
useCallback,
|
|
2683
2894
|
useCameraFX,
|
|
@@ -2688,19 +2899,19 @@ export {
|
|
|
2688
2899
|
useColors,
|
|
2689
2900
|
useEffect,
|
|
2690
2901
|
useFX,
|
|
2691
|
-
|
|
2692
|
-
|
|
2902
|
+
aG as useForceRedraw,
|
|
2903
|
+
ae as useGameObjectEffect,
|
|
2693
2904
|
useGlow,
|
|
2694
2905
|
u as useIconPreload,
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2906
|
+
aS as useLayoutEffect,
|
|
2907
|
+
aP as useLayoutRect,
|
|
2908
|
+
aK as useLayoutSize,
|
|
2909
|
+
aH as useMemo,
|
|
2699
2910
|
useParticles,
|
|
2700
|
-
|
|
2911
|
+
aV as useRedraw,
|
|
2701
2912
|
useRef,
|
|
2702
|
-
|
|
2703
|
-
|
|
2913
|
+
a_ as useSVGTexture,
|
|
2914
|
+
a$ as useSVGTextures,
|
|
2704
2915
|
useScene,
|
|
2705
2916
|
useScreenShake,
|
|
2706
2917
|
useShadow,
|
|
@@ -2710,11 +2921,11 @@ export {
|
|
|
2710
2921
|
useTheme,
|
|
2711
2922
|
useThemeSubscription,
|
|
2712
2923
|
useThemeTokens,
|
|
2713
|
-
|
|
2714
|
-
|
|
2924
|
+
aI as useViewportSize,
|
|
2925
|
+
aR as useWorldLayoutRect,
|
|
2715
2926
|
viewCreator,
|
|
2716
2927
|
viewPatcher,
|
|
2717
2928
|
viewportRegistry,
|
|
2718
|
-
|
|
2929
|
+
aF as withHooks
|
|
2719
2930
|
};
|
|
2720
2931
|
//# sourceMappingURL=index.js.map
|