hudini 0.2.1 → 0.4.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/README.md +187 -3
- package/dist/components/column/column.d.ts +88 -0
- package/dist/components/column/column.d.ts.map +1 -0
- package/dist/components/column/column.js +142 -0
- package/dist/components/column/column.js.map +1 -0
- package/dist/components/column/column.spec.d.ts +2 -0
- package/dist/components/column/column.spec.d.ts.map +1 -0
- package/dist/components/column/column.spec.js +147 -0
- package/dist/components/column/column.spec.js.map +1 -0
- package/dist/components/column/index.d.ts +2 -0
- package/dist/components/column/index.d.ts.map +1 -0
- package/dist/components/column/index.js +2 -0
- package/dist/components/column/index.js.map +1 -0
- package/dist/components/icon-button/icon-button.d.ts +6 -1
- package/dist/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js +63 -19
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/layout-utils.d.ts +13 -0
- package/dist/components/layout/layout-utils.d.ts.map +1 -0
- package/dist/components/layout/layout-utils.js +38 -0
- package/dist/components/layout/layout-utils.js.map +1 -0
- package/dist/components/layout/layout-utils.spec.d.ts +2 -0
- package/dist/components/layout/layout-utils.spec.d.ts.map +1 -0
- package/dist/components/layout/layout-utils.spec.js +70 -0
- package/dist/components/layout/layout-utils.spec.js.map +1 -0
- package/dist/components/row/index.d.ts +2 -0
- package/dist/components/row/index.d.ts.map +1 -0
- package/dist/components/row/index.js +2 -0
- package/dist/components/row/index.js.map +1 -0
- package/dist/components/row/row.d.ts +87 -0
- package/dist/components/row/row.d.ts.map +1 -0
- package/dist/components/row/row.js +139 -0
- package/dist/components/row/row.js.map +1 -0
- package/dist/components/row/row.spec.d.ts +2 -0
- package/dist/components/row/row.spec.d.ts.map +1 -0
- package/dist/components/row/row.spec.js +146 -0
- package/dist/components/row/row.spec.js.map +1 -0
- package/package.json +2 -2
|
@@ -16,58 +16,102 @@ const HOVER_SCALE = 1.07;
|
|
|
16
16
|
const CLICK_OFFSET = 2;
|
|
17
17
|
const MAIN_OVERLAY_SCALE = 0.9;
|
|
18
18
|
const INNER_OVERLAY_SCALE = 0.7;
|
|
19
|
+
const SQUARE_RADIUS_RATIO = 0.25; // smooth corner radius proportion for square
|
|
19
20
|
export class IconButton extends GameObjects.Container {
|
|
20
21
|
backgroundSprite;
|
|
21
22
|
shadowSprite;
|
|
22
23
|
iconText;
|
|
23
24
|
pw;
|
|
24
|
-
|
|
25
|
+
shape = 'circle';
|
|
26
|
+
baseColor;
|
|
27
|
+
sizePx;
|
|
28
|
+
constructor({ scene, x, y, icon, size, color, onClick, shape }) {
|
|
25
29
|
super(scene, x, y);
|
|
26
30
|
this.pw = getPWFromScene(scene);
|
|
31
|
+
this.shape = shape ?? 'circle';
|
|
27
32
|
const sizePx = typeof size === 'number'
|
|
28
33
|
? size
|
|
29
34
|
: this.pw.fontSize.px(size ?? 'md');
|
|
30
35
|
const baseColor = color ?? 'gray';
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
36
|
+
this.sizePx = sizePx;
|
|
37
|
+
this.baseColor = baseColor;
|
|
38
|
+
this.createShadowSprite(scene, sizePx, baseColor, this.shape);
|
|
39
|
+
this.createBackgroundSprite(scene, sizePx, baseColor, this.shape);
|
|
33
40
|
this.createIconText(scene, icon, sizePx, baseColor);
|
|
34
41
|
this.setupContainer();
|
|
35
42
|
this.setupInteractivity(onClick);
|
|
36
43
|
}
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
setShape(shape) {
|
|
45
|
+
if (this.shape === shape)
|
|
46
|
+
return this;
|
|
47
|
+
this.shape = shape;
|
|
48
|
+
// Regenerate textures for background and shadow
|
|
49
|
+
const shadowTexture = this.createShadowTexture(this.scene, this.sizePx, this.baseColor, this.shape);
|
|
50
|
+
const backgroundTexture = this.createBackgroundTexture(this.scene, this.sizePx, this.baseColor, this.shape);
|
|
51
|
+
this.shadowSprite.setTexture(shadowTexture);
|
|
52
|
+
this.backgroundSprite.setTexture(backgroundTexture);
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
createShadowSprite(scene, size, baseColor, shape) {
|
|
56
|
+
const shadowTexture = this.createShadowTexture(scene, size, baseColor, shape);
|
|
39
57
|
this.shadowSprite = scene.add.sprite(1, SHADOW_OFFSET, shadowTexture);
|
|
40
58
|
this.shadowSprite.setOrigin(0.5, 0.5);
|
|
41
59
|
}
|
|
42
|
-
createShadowTexture(scene, size, baseColor) {
|
|
43
|
-
const textureKey = `iconButton_shadow_${baseColor}_${size}`;
|
|
60
|
+
createShadowTexture(scene, size, baseColor, shape) {
|
|
61
|
+
const textureKey = `iconButton_shadow_${shape}_${baseColor}_${size}`;
|
|
44
62
|
const textureSize = size * BUTTON_SCALE;
|
|
45
63
|
const centerX = size * CENTER_OFFSET;
|
|
46
64
|
const centerY = size * CENTER_OFFSET;
|
|
47
65
|
const graphics = scene.add.graphics();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
66
|
+
if (shape === 'circle') {
|
|
67
|
+
graphics.fillStyle(Color.hex('black'), SHADOW_OPACITY);
|
|
68
|
+
graphics.fillCircle(centerX + 1, centerY, size * CENTER_OFFSET);
|
|
69
|
+
graphics.fillStyle(Color.hex(`${baseColor}-900`), MAIN_SHADOW_OPACITY);
|
|
70
|
+
graphics.fillCircle(centerX, centerY - CLICK_OFFSET, size);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
// square with smooth border radius
|
|
74
|
+
const sideOuter = size * 2 * CENTER_OFFSET;
|
|
75
|
+
const side = size * 2;
|
|
76
|
+
const radiusOuter = sideOuter * SQUARE_RADIUS_RATIO;
|
|
77
|
+
const radius = side * SQUARE_RADIUS_RATIO;
|
|
78
|
+
graphics.fillStyle(Color.hex('black'), SHADOW_OPACITY);
|
|
79
|
+
graphics.fillRoundedRect(centerX + 1 - sideOuter / 2, centerY - sideOuter / 2, sideOuter, sideOuter, radiusOuter);
|
|
80
|
+
graphics.fillStyle(Color.hex(`${baseColor}-900`), MAIN_SHADOW_OPACITY);
|
|
81
|
+
graphics.fillRoundedRect(centerX - side / 2, centerY - CLICK_OFFSET - side / 2, side, side, radius);
|
|
82
|
+
}
|
|
52
83
|
graphics.generateTexture(textureKey, textureSize, textureSize);
|
|
53
84
|
graphics.destroy();
|
|
54
85
|
return textureKey;
|
|
55
86
|
}
|
|
56
|
-
createBackgroundSprite(scene, size, baseColor) {
|
|
57
|
-
const backgroundTexture = this.createBackgroundTexture(scene, size, baseColor);
|
|
87
|
+
createBackgroundSprite(scene, size, baseColor, shape) {
|
|
88
|
+
const backgroundTexture = this.createBackgroundTexture(scene, size, baseColor, shape);
|
|
58
89
|
this.backgroundSprite = scene.add.sprite(1, 0, backgroundTexture);
|
|
59
90
|
this.backgroundSprite.setOrigin(0.5, 0.5);
|
|
60
91
|
}
|
|
61
|
-
createBackgroundTexture(scene, size, baseColor) {
|
|
62
|
-
const textureKey = `iconButton_${baseColor}_${size}`;
|
|
92
|
+
createBackgroundTexture(scene, size, baseColor, shape) {
|
|
93
|
+
const textureKey = `iconButton_${shape}_${baseColor}_${size}`;
|
|
63
94
|
const textureSize = size * BUTTON_SCALE;
|
|
64
95
|
const centerX = size * CENTER_OFFSET;
|
|
65
96
|
const centerY = size * CENTER_OFFSET;
|
|
66
97
|
const graphics = scene.add.graphics();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
98
|
+
if (shape === 'circle') {
|
|
99
|
+
graphics.fillStyle(Color.hex(`${baseColor}-600`), 1);
|
|
100
|
+
graphics.fillCircle(centerX, centerY, size * MAIN_OVERLAY_SCALE);
|
|
101
|
+
graphics.fillStyle(Color.hex(`${baseColor}-500`), INNER_OVERLAY_OPACITY);
|
|
102
|
+
graphics.fillCircle(centerX, centerY, size * INNER_OVERLAY_SCALE);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
const side = size * 2;
|
|
106
|
+
const mainSide = side * MAIN_OVERLAY_SCALE;
|
|
107
|
+
const innerSide = side * INNER_OVERLAY_SCALE;
|
|
108
|
+
const mainRadius = mainSide * SQUARE_RADIUS_RATIO;
|
|
109
|
+
const innerRadius = innerSide * SQUARE_RADIUS_RATIO;
|
|
110
|
+
graphics.fillStyle(Color.hex(`${baseColor}-600`), 1);
|
|
111
|
+
graphics.fillRoundedRect(centerX - mainSide / 2, centerY - mainSide / 2, mainSide, mainSide, mainRadius);
|
|
112
|
+
graphics.fillStyle(Color.hex(`${baseColor}-500`), INNER_OVERLAY_OPACITY);
|
|
113
|
+
graphics.fillRoundedRect(centerX - innerSide / 2, centerY - innerSide / 2, innerSide, innerSide, innerRadius);
|
|
114
|
+
}
|
|
71
115
|
graphics.generateTexture(textureKey, textureSize, textureSize);
|
|
72
116
|
graphics.destroy();
|
|
73
117
|
return textureKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAC5C,OAAO,EACL,KAAK,GAIN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAC5C,OAAO,EACL,KAAK,GAIN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAa/D,MAAM,SAAS,GAAG;IACh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e,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GameObjects } from 'phaser';
|
|
2
|
+
/** Default gap between elements in pixels */
|
|
3
|
+
export declare const DEFAULT_GAP = 8;
|
|
4
|
+
/** Measures the display width of a game object, with fallbacks */
|
|
5
|
+
export declare const getDisplayWidthOf: (child: GameObjects.GameObject) => number;
|
|
6
|
+
/** Measures the display height of a game object, with fallbacks */
|
|
7
|
+
export declare const getDisplayHeightOf: (child: GameObjects.GameObject) => number;
|
|
8
|
+
/** Returns normalized origin (0..1) for a game object */
|
|
9
|
+
export declare const getNormalizedOriginOf: (child: GameObjects.GameObject) => {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=layout-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-utils.d.ts","sourceRoot":"","sources":["../../../src/components/layout/layout-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,6CAA6C;AAC7C,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,GAAI,OAAO,WAAW,CAAC,UAAU,KAAG,MAUjE,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,GAAI,OAAO,WAAW,CAAC,UAAU,KAAG,MAUlE,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,qBAAqB,GAAI,OAAO,WAAW,CAAC,UAAU,KAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAwB3F,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Default gap between elements in pixels */
|
|
2
|
+
export const DEFAULT_GAP = 8;
|
|
3
|
+
/** Measures the display width of a game object, with fallbacks */
|
|
4
|
+
export const getDisplayWidthOf = (child) => {
|
|
5
|
+
const childTyped = child;
|
|
6
|
+
if (typeof childTyped.displayWidth === 'number')
|
|
7
|
+
return childTyped.displayWidth;
|
|
8
|
+
if (typeof childTyped.width === 'number')
|
|
9
|
+
return childTyped.width;
|
|
10
|
+
const bounds = childTyped.getBounds?.();
|
|
11
|
+
return bounds ? bounds.width : 0;
|
|
12
|
+
};
|
|
13
|
+
/** Measures the display height of a game object, with fallbacks */
|
|
14
|
+
export const getDisplayHeightOf = (child) => {
|
|
15
|
+
const childTyped = child;
|
|
16
|
+
if (typeof childTyped.displayHeight === 'number')
|
|
17
|
+
return childTyped.displayHeight;
|
|
18
|
+
if (typeof childTyped.height === 'number')
|
|
19
|
+
return childTyped.height;
|
|
20
|
+
const bounds = childTyped.getBounds?.();
|
|
21
|
+
return bounds ? bounds.height : 0;
|
|
22
|
+
};
|
|
23
|
+
/** Returns normalized origin (0..1) for a game object */
|
|
24
|
+
export const getNormalizedOriginOf = (child) => {
|
|
25
|
+
const width = getDisplayWidthOf(child);
|
|
26
|
+
const height = getDisplayHeightOf(child);
|
|
27
|
+
const childTyped = child;
|
|
28
|
+
let ox = typeof childTyped.originX === 'number' ? childTyped.originX : undefined;
|
|
29
|
+
let oy = typeof childTyped.originY === 'number' ? childTyped.originY : undefined;
|
|
30
|
+
if (ox === undefined && typeof childTyped.displayOriginX === 'number' && width > 0) {
|
|
31
|
+
ox = childTyped.displayOriginX / width;
|
|
32
|
+
}
|
|
33
|
+
if (oy === undefined && typeof childTyped.displayOriginY === 'number' && height > 0) {
|
|
34
|
+
oy = childTyped.displayOriginY / height;
|
|
35
|
+
}
|
|
36
|
+
return { x: ox ?? 0.5, y: oy ?? 0.5 };
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=layout-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-utils.js","sourceRoot":"","sources":["../../../src/components/layout/layout-utils.ts"],"names":[],"mappings":"AAGA,6CAA6C;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAE7B,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAU,EAAE;IACzE,MAAM,UAAU,GAAG,KAIlB,CAAC;IACF,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC,YAAY,CAAC;IAChF,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC,KAAe,CAAC;IAC5E,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC;IACxC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,mEAAmE;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA6B,EAAU,EAAE;IAC1E,MAAM,UAAU,GAAG,KAIlB,CAAC;IACF,IAAI,OAAO,UAAU,CAAC,aAAa,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC,aAAa,CAAC;IAClF,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC,MAAgB,CAAC;IAC9E,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,EA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{ describe, expect, it } from 'vitest';
|
|
2
|
+
import { DEFAULT_GAP, getDisplayHeightOf, getDisplayWidthOf, getNormalizedOriginOf, } from './layout-utils';
|
|
3
|
+
// Helper to satisfy typing without importing Phaser types in tests
|
|
4
|
+
const asGO = (o) => o;
|
|
5
|
+
describe('layout-utils', () => {
|
|
6
|
+
it('DEFAULT_GAP should be 8', () => {
|
|
7
|
+
expect(DEFAULT_GAP).toBe(8);
|
|
8
|
+
});
|
|
9
|
+
describe('getDisplayWidthOf', () => {
|
|
10
|
+
it('prefers displayWidth when present', () => {
|
|
11
|
+
const obj = asGO({ displayWidth: 120, width: 200, getBounds: () => ({ width: 300 }) });
|
|
12
|
+
expect(getDisplayWidthOf(obj)).toBe(120);
|
|
13
|
+
});
|
|
14
|
+
it('falls back to width when displayWidth is absent', () => {
|
|
15
|
+
const obj = asGO({ width: 200, getBounds: () => ({ width: 300 }) });
|
|
16
|
+
expect(getDisplayWidthOf(obj)).toBe(200);
|
|
17
|
+
});
|
|
18
|
+
it('falls back to getBounds().width when both displayWidth and width are absent', () => {
|
|
19
|
+
const obj = asGO({ getBounds: () => ({ width: 300 }) });
|
|
20
|
+
expect(getDisplayWidthOf(obj)).toBe(300);
|
|
21
|
+
});
|
|
22
|
+
it('returns 0 when nothing is available', () => {
|
|
23
|
+
const obj = asGO({});
|
|
24
|
+
expect(getDisplayWidthOf(obj)).toBe(0);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('getDisplayHeightOf', () => {
|
|
28
|
+
it('prefers displayHeight when present', () => {
|
|
29
|
+
const obj = asGO({ displayHeight: 110, height: 210, getBounds: () => ({ height: 310 }) });
|
|
30
|
+
expect(getDisplayHeightOf(obj)).toBe(110);
|
|
31
|
+
});
|
|
32
|
+
it('falls back to height when displayHeight is absent', () => {
|
|
33
|
+
const obj = asGO({ height: 210, getBounds: () => ({ height: 310 }) });
|
|
34
|
+
expect(getDisplayHeightOf(obj)).toBe(210);
|
|
35
|
+
});
|
|
36
|
+
it('falls back to getBounds().height when both displayHeight and height are absent', () => {
|
|
37
|
+
const obj = asGO({ getBounds: () => ({ height: 310 }) });
|
|
38
|
+
expect(getDisplayHeightOf(obj)).toBe(310);
|
|
39
|
+
});
|
|
40
|
+
it('returns 0 when nothing is available', () => {
|
|
41
|
+
const obj = asGO({});
|
|
42
|
+
expect(getDisplayHeightOf(obj)).toBe(0);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe('getNormalizedOriginOf', () => {
|
|
46
|
+
it('returns originX/Y when provided', () => {
|
|
47
|
+
const obj = asGO({ originX: 0.2, originY: 0.8, displayWidth: 100, displayHeight: 100 });
|
|
48
|
+
expect(getNormalizedOriginOf(obj)).toEqual({ x: 0.2, y: 0.8 });
|
|
49
|
+
});
|
|
50
|
+
it('computes from displayOriginX/Y over displayWidth/Height when originX/Y absent', () => {
|
|
51
|
+
const obj = asGO({ displayOriginX: 25, displayOriginY: 50, displayWidth: 100, displayHeight: 200 });
|
|
52
|
+
// x = 25/100 = 0.25, y = 50/200 = 0.25
|
|
53
|
+
expect(getNormalizedOriginOf(obj)).toEqual({ x: 0.25, y: 0.25 });
|
|
54
|
+
});
|
|
55
|
+
it('defaults to 0.5 when origins are missing and size is zero', () => {
|
|
56
|
+
const obj = asGO({ displayOriginX: 10, displayOriginY: 10, displayWidth: 0, displayHeight: 0 });
|
|
57
|
+
expect(getNormalizedOriginOf(obj)).toEqual({ x: 0.5, y: 0.5 });
|
|
58
|
+
});
|
|
59
|
+
it('uses mixed fallbacks per axis independently', () => {
|
|
60
|
+
const obj = asGO({
|
|
61
|
+
originX: 0.1, // should take precedence on X
|
|
62
|
+
displayOriginY: 30,
|
|
63
|
+
displayHeight: 120, // Y should be 30/120 = 0.25
|
|
64
|
+
displayWidth: 400,
|
|
65
|
+
});
|
|
66
|
+
expect(getNormalizedOriginOf(obj)).toEqual({ x: 0.1, y: 0.25 });
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=layout-utils.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-utils.spec.js","sourceRoot":"","sources":["../../../src/components/layout/layout-utils.spec.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB,mEAAmE;AACnE,MAAM,IAAI,GAAG,CAAC,CAAU,EAA0B,EAAE,CAAC,CAA2B,CAAC;AAEjF,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YACvF,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;YACzD,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YACpE,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC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C,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;YACnE,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;YAChG,MAAM,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,GAAG,GAAG,IAAI,CAAC;gBACf,OAAO,EAAE,GAAG,EAAE,8BAA8B;gBAC5C,cAAc,EAAE,EAAE;gBAClB,aAAa,EAAE,GAAG,EAAE,4BAA4B;gBAChD,YAAY,EAAE,GAAG;aAClB,CAAC,CAAC;YACH,MAAM,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/row/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/row/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { GameObjects, Scene } from 'phaser';
|
|
2
|
+
/** Vertical alignment options for row items */
|
|
3
|
+
export type VerticalAlign = 'top' | 'center' | 'bottom';
|
|
4
|
+
/** Parameters for creating a Row container */
|
|
5
|
+
export type RowParams = {
|
|
6
|
+
/** The scene this row belongs to */
|
|
7
|
+
scene: Scene;
|
|
8
|
+
/** X coordinate of the row */
|
|
9
|
+
x: number;
|
|
10
|
+
/** Y coordinate of the row */
|
|
11
|
+
y: number;
|
|
12
|
+
/** Gap between elements in pixels */
|
|
13
|
+
gap?: number;
|
|
14
|
+
/** Vertical alignment of elements */
|
|
15
|
+
align?: VerticalAlign;
|
|
16
|
+
/** Initial child elements */
|
|
17
|
+
children?: GameObjects.GameObject[];
|
|
18
|
+
/** Horizontal origin point of the row */
|
|
19
|
+
horizontalOrigin?: 'left' | 'center' | 'right';
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Row is a layout container that arranges children horizontally with a gap.
|
|
23
|
+
* The container position (x, y) represents the center of the whole row.
|
|
24
|
+
*/
|
|
25
|
+
export declare class Row extends GameObjects.Container {
|
|
26
|
+
/** Gap between elements in pixels */
|
|
27
|
+
private gap;
|
|
28
|
+
/** Vertical alignment of elements */
|
|
29
|
+
private align;
|
|
30
|
+
/** Horizontal origin point of the row */
|
|
31
|
+
private horizontalOrigin;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new Row container
|
|
34
|
+
* @param params Configuration parameters for the row
|
|
35
|
+
*/
|
|
36
|
+
constructor({ scene, x, y, gap, align, children, horizontalOrigin, }: RowParams);
|
|
37
|
+
/**
|
|
38
|
+
* Sets the gap between elements and updates layout
|
|
39
|
+
* @param gap Gap size in pixels
|
|
40
|
+
*/
|
|
41
|
+
setGap(gap: number): void;
|
|
42
|
+
/**
|
|
43
|
+
* Sets the vertical alignment and updates layout
|
|
44
|
+
* @param align New vertical alignment
|
|
45
|
+
*/
|
|
46
|
+
setAlign(align: VerticalAlign): void;
|
|
47
|
+
/**
|
|
48
|
+
* Adds a single child to the row
|
|
49
|
+
* @param child GameObject to add
|
|
50
|
+
* @param relayout Whether to update layout after adding
|
|
51
|
+
* @returns This row instance for chaining
|
|
52
|
+
*/
|
|
53
|
+
addChild(child: GameObjects.GameObject, relayout?: boolean): this;
|
|
54
|
+
/**
|
|
55
|
+
* Adds multiple children to the row
|
|
56
|
+
* @param children Array of GameObjects to add
|
|
57
|
+
* @param relayout Whether to update layout after adding
|
|
58
|
+
* @returns This row instance for chaining
|
|
59
|
+
*/
|
|
60
|
+
addChildren(children: GameObjects.GameObject[], relayout?: boolean): this;
|
|
61
|
+
/**
|
|
62
|
+
* Recomputes children's positions and updates this container size
|
|
63
|
+
*/
|
|
64
|
+
layout(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Gets the display width of a game object
|
|
67
|
+
* @param child GameObject to measure
|
|
68
|
+
* @returns Display width in pixels
|
|
69
|
+
*/
|
|
70
|
+
getDisplayWidth(child: GameObjects.GameObject): number;
|
|
71
|
+
/**
|
|
72
|
+
* Gets the display height of a game object
|
|
73
|
+
* @param child GameObject to measure
|
|
74
|
+
* @returns Display height in pixels
|
|
75
|
+
*/
|
|
76
|
+
getDisplayHeight(child: GameObjects.GameObject): number;
|
|
77
|
+
/**
|
|
78
|
+
* Gets the normalized origin point of a game object
|
|
79
|
+
* @param child GameObject to get origin from
|
|
80
|
+
* @returns Object with normalized x,y coordinates of the origin point
|
|
81
|
+
*/
|
|
82
|
+
getNormalizedOrigin(child: GameObjects.GameObject): {
|
|
83
|
+
x: number;
|
|
84
|
+
y: number;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/components/row/row.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAS5C,+CAA+C;AAC/C,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExD,8CAA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B,CAAC,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG,MAAM;IAI9D;;;;OAIG;IACI,mBAAmB,CAAC,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;CAGpF"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/* eslint-disable complexity */
|
|
2
|
+
import { GameObjects } from 'phaser';
|
|
3
|
+
import { DEFAULT_GAP, getDisplayHeightOf, getDisplayWidthOf, getNormalizedOriginOf, } from '../layout/layout-utils';
|
|
4
|
+
/**
|
|
5
|
+
* Row is a layout container that arranges children horizontally with a gap.
|
|
6
|
+
* The container position (x, y) represents the center of the whole row.
|
|
7
|
+
*/
|
|
8
|
+
export class Row extends GameObjects.Container {
|
|
9
|
+
/** Gap between elements in pixels */
|
|
10
|
+
gap;
|
|
11
|
+
/** Vertical alignment of elements */
|
|
12
|
+
align;
|
|
13
|
+
/** Horizontal origin point of the row */
|
|
14
|
+
horizontalOrigin;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new Row container
|
|
17
|
+
* @param params Configuration parameters for the row
|
|
18
|
+
*/
|
|
19
|
+
constructor({ scene, x, y, gap = DEFAULT_GAP, align = 'center', children = [], horizontalOrigin = 'center', }) {
|
|
20
|
+
super(scene, x, y);
|
|
21
|
+
this.gap = gap;
|
|
22
|
+
this.align = align;
|
|
23
|
+
this.horizontalOrigin = horizontalOrigin;
|
|
24
|
+
if (children.length > 0) {
|
|
25
|
+
this.add(children);
|
|
26
|
+
}
|
|
27
|
+
this.layout();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sets the gap between elements and updates layout
|
|
31
|
+
* @param gap Gap size in pixels
|
|
32
|
+
*/
|
|
33
|
+
setGap(gap) {
|
|
34
|
+
this.gap = gap;
|
|
35
|
+
this.layout();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Sets the vertical alignment and updates layout
|
|
39
|
+
* @param align New vertical alignment
|
|
40
|
+
*/
|
|
41
|
+
setAlign(align) {
|
|
42
|
+
this.align = align;
|
|
43
|
+
this.layout();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Adds a single child to the row
|
|
47
|
+
* @param child GameObject to add
|
|
48
|
+
* @param relayout Whether to update layout after adding
|
|
49
|
+
* @returns This row instance for chaining
|
|
50
|
+
*/
|
|
51
|
+
addChild(child, relayout = true) {
|
|
52
|
+
this.add(child);
|
|
53
|
+
if (relayout)
|
|
54
|
+
this.layout();
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Adds multiple children to the row
|
|
59
|
+
* @param children Array of GameObjects to add
|
|
60
|
+
* @param relayout Whether to update layout after adding
|
|
61
|
+
* @returns This row instance for chaining
|
|
62
|
+
*/
|
|
63
|
+
addChildren(children, relayout = true) {
|
|
64
|
+
if (children.length > 0)
|
|
65
|
+
this.add(children);
|
|
66
|
+
if (relayout)
|
|
67
|
+
this.layout();
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Recomputes children's positions and updates this container size
|
|
72
|
+
*/
|
|
73
|
+
layout() {
|
|
74
|
+
const children = this.list;
|
|
75
|
+
if (children.length === 0) {
|
|
76
|
+
this.setSize(0, 0);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// Measure sizes and origins
|
|
80
|
+
const entries = children.map((child) => ({
|
|
81
|
+
child,
|
|
82
|
+
width: this.getDisplayWidth(child),
|
|
83
|
+
height: this.getDisplayHeight(child),
|
|
84
|
+
origin: this.getNormalizedOrigin(child),
|
|
85
|
+
}));
|
|
86
|
+
const maxHeight = entries.reduce((m, s) => Math.max(m, s.height), 0);
|
|
87
|
+
const totalWidth = entries.reduce((sum, s) => sum + s.width, 0) + this.gap * (entries.length - 1);
|
|
88
|
+
// Determine left of content based on horizontalOrigin
|
|
89
|
+
const contentLeftX = this.horizontalOrigin === 'left' ? 0 : this.horizontalOrigin === 'center' ? -totalWidth / 2 : -totalWidth;
|
|
90
|
+
// Walk left to right, aligning considering each child's origin
|
|
91
|
+
let cursorLeftX = contentLeftX;
|
|
92
|
+
for (const { child, width, height, origin } of entries) {
|
|
93
|
+
// Vertical alignment: align top/bottom edges or centers correctly using origin
|
|
94
|
+
let y = 0;
|
|
95
|
+
if (this.align === 'top') {
|
|
96
|
+
// place child's top edge at content top
|
|
97
|
+
y = -maxHeight / 2 + origin.y * height;
|
|
98
|
+
}
|
|
99
|
+
else if (this.align === 'bottom') {
|
|
100
|
+
// place child's bottom edge at content bottom
|
|
101
|
+
y = maxHeight / 2 - (1 - origin.y) * height;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// center alignment
|
|
105
|
+
y = (origin.y - 0.5) * height;
|
|
106
|
+
}
|
|
107
|
+
// Horizontal position so that child's left is at cursorLeftX
|
|
108
|
+
const x = cursorLeftX + origin.x * width;
|
|
109
|
+
child.setPosition(x, y);
|
|
110
|
+
cursorLeftX += width + this.gap;
|
|
111
|
+
}
|
|
112
|
+
this.setSize(totalWidth, maxHeight);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Gets the display width of a game object
|
|
116
|
+
* @param child GameObject to measure
|
|
117
|
+
* @returns Display width in pixels
|
|
118
|
+
*/
|
|
119
|
+
getDisplayWidth(child) {
|
|
120
|
+
return getDisplayWidthOf(child);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Gets the display height of a game object
|
|
124
|
+
* @param child GameObject to measure
|
|
125
|
+
* @returns Display height in pixels
|
|
126
|
+
*/
|
|
127
|
+
getDisplayHeight(child) {
|
|
128
|
+
return getDisplayHeightOf(child);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Gets the normalized origin point of a game object
|
|
132
|
+
* @param child GameObject to get origin from
|
|
133
|
+
* @returns Object with normalized x,y coordinates of the origin point
|
|
134
|
+
*/
|
|
135
|
+
getNormalizedOrigin(child) {
|
|
136
|
+
return getNormalizedOriginOf(child);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/components/row/row.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAE5C,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAuBhC;;;GAGG;AACH,MAAM,OAAO,GAAI,SAAQ,WAAW,CAAC,SAAS;IAC5C,qCAAqC;IAC7B,GAAG,CAAS;IACpB,qCAAqC;IAC7B,KAAK,CAAgB;IAC7B,yCAAyC;IACjC,gBAAgB,CAA8B;IAEtD;;;OAGG;IACH,YAAY,EACV,KAAK,EACL,CAAC,EACD,CAAC,EACD,GAAG,GAAG,WAAW,EACjB,KAAK,GAAG,QAAQ,EAChB,QAAQ,GAAG,EAAE,EACb,gBAAgB,GAAG,QAAQ,GACjB;QACV,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAEnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAEzC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;QAED,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,GAAW;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,KAAoB;QAClC,IAAI,C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