hudini 0.6.0 → 0.7.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/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/linear-progress/index.d.ts +2 -0
- package/dist/components/linear-progress/index.d.ts.map +1 -0
- package/dist/components/linear-progress/index.js +2 -0
- package/dist/components/linear-progress/index.js.map +1 -0
- package/dist/components/linear-progress/linear-progress.d.ts +93 -0
- package/dist/components/linear-progress/linear-progress.d.ts.map +1 -0
- package/dist/components/linear-progress/linear-progress.js +231 -0
- package/dist/components/linear-progress/linear-progress.js.map +1 -0
- package/dist/components/linear-progress/linear-progress.spec.d.ts +2 -0
- package/dist/components/linear-progress/linear-progress.spec.d.ts.map +1 -0
- package/dist/components/linear-progress/linear-progress.spec.js +288 -0
- package/dist/components/linear-progress/linear-progress.spec.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,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,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/linear-progress/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/linear-progress/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { GameObjects, Scene } from 'phaser';
|
|
2
|
+
import { type ColorToken, type RadiusKey } from 'phaser-wind';
|
|
3
|
+
export type LinearProgressParams = {
|
|
4
|
+
/** The scene this progress bar belongs to */
|
|
5
|
+
scene: Scene;
|
|
6
|
+
/** X coordinate of the progress bar */
|
|
7
|
+
x: number;
|
|
8
|
+
/** Y coordinate of the progress bar */
|
|
9
|
+
y: number;
|
|
10
|
+
/** Width of the progress bar in pixels */
|
|
11
|
+
width: number;
|
|
12
|
+
/** Height of the progress bar in pixels */
|
|
13
|
+
height: number;
|
|
14
|
+
/** Background color of the progress bar track */
|
|
15
|
+
backgroundColor?: ColorToken;
|
|
16
|
+
/** Color of the progress bar fill */
|
|
17
|
+
progressColor?: ColorToken;
|
|
18
|
+
/** Border radius in px (number) or a Phaser Wind radius token (string). Defaults to 'default'.
|
|
19
|
+
* Note: The effective radius is automatically limited to half of the smallest dimension to prevent visual artifacts. */
|
|
20
|
+
borderRadius?: RadiusKey | number;
|
|
21
|
+
/** Initial progress value (0-100) */
|
|
22
|
+
progress?: number;
|
|
23
|
+
/** Whether this is an indeterminate progress bar */
|
|
24
|
+
indeterminate?: boolean;
|
|
25
|
+
/** Duration of the indeterminate animation in milliseconds */
|
|
26
|
+
indeterminateAnimationDuration?: number;
|
|
27
|
+
};
|
|
28
|
+
export declare class LinearProgress extends GameObjects.Container {
|
|
29
|
+
backgroundProgressBar: GameObjects.Graphics;
|
|
30
|
+
progressBar: GameObjects.Graphics;
|
|
31
|
+
private pw;
|
|
32
|
+
private progressWidth;
|
|
33
|
+
private progressHeight;
|
|
34
|
+
private borderRadiusPx;
|
|
35
|
+
private backgroundColor;
|
|
36
|
+
private progressColor;
|
|
37
|
+
private currentProgress;
|
|
38
|
+
private isIndeterminate;
|
|
39
|
+
private indeterminateAnimation?;
|
|
40
|
+
private indeterminateAnimationDuration;
|
|
41
|
+
constructor({ scene, x, y, width, height, backgroundColor, progressColor, borderRadius, progress, indeterminate, indeterminateAnimationDuration, }: LinearProgressParams);
|
|
42
|
+
/**
|
|
43
|
+
* Sets the progress value (0-100)
|
|
44
|
+
* @param progress Progress value between 0 and 100
|
|
45
|
+
* @param animate Whether to animate the change (default: true)
|
|
46
|
+
*/
|
|
47
|
+
setProgress(progress: number, animate?: boolean): this;
|
|
48
|
+
/**
|
|
49
|
+
* Gets the current progress value
|
|
50
|
+
* @returns Current progress value (0-100)
|
|
51
|
+
*/
|
|
52
|
+
getProgress(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Sets whether the progress bar is indeterminate
|
|
55
|
+
* @param indeterminate Whether to show indeterminate animation
|
|
56
|
+
*/
|
|
57
|
+
setIndeterminate(indeterminate: boolean): this;
|
|
58
|
+
/**
|
|
59
|
+
* Sets the border radius of the progress bar
|
|
60
|
+
* @param borderRadius Border radius in px (number) or a Phaser Wind radius token (string)
|
|
61
|
+
* Note: The effective radius is automatically limited to half of the smallest dimension to prevent visual artifacts.
|
|
62
|
+
*/
|
|
63
|
+
setBorderRadius(borderRadius: RadiusKey | number): this;
|
|
64
|
+
/**
|
|
65
|
+
* Sets the background color of the progress bar
|
|
66
|
+
* @param color Background color token
|
|
67
|
+
*/
|
|
68
|
+
setBackgroundColor(color: ColorToken): this;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the progress color of the progress bar
|
|
71
|
+
* @param color Progress color token
|
|
72
|
+
*/
|
|
73
|
+
setProgressColor(color: ColorToken): this;
|
|
74
|
+
/**
|
|
75
|
+
* Destroys the component and cleans up animations
|
|
76
|
+
*/
|
|
77
|
+
destroy(): void;
|
|
78
|
+
private createBackgroundSprite;
|
|
79
|
+
private createProgressSprite;
|
|
80
|
+
private setupContainer;
|
|
81
|
+
private calculateProgressDimensions;
|
|
82
|
+
private updateProgressBar;
|
|
83
|
+
private startIndeterminateAnimation;
|
|
84
|
+
private stopIndeterminateAnimation;
|
|
85
|
+
private recreateSprites;
|
|
86
|
+
/**
|
|
87
|
+
* Calculates the effective border radius, ensuring it doesn't exceed
|
|
88
|
+
* half of the smallest dimension to prevent visual artifacts
|
|
89
|
+
* @returns Limited border radius in pixels
|
|
90
|
+
*/
|
|
91
|
+
private getEffectiveBorderRadius;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=linear-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-progress.d.ts","sourceRoot":"","sources":["../../../src/components/linear-progress/linear-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAIrB,MAAM,MAAM,oBAAoB,GAAG;IACjC,6CAA6C;IAC7C,KAAK,EAAE,KAAK,CAAC;IACb,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;IACV,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;IACV,0CAA0C;IAC1C,K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I,eAAe,CAAC,YAAY,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI;IAe9D;;;OAGG;IACI,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAUlD;;;OAGG;IACI,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAUhD;;OAEG;IACa,OAAO,IAAI,IAAI;IAK/B,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,2BAA2B;IAMnC,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,2BAA2B;IA0BnC,OAAO,CAAC,0BAA0B;IAOlC,OAAO,CAAC,eAAe;IAmBvB;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;CAIjC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { GameObjects } from 'phaser';
|
|
2
|
+
import { Color, } from 'phaser-wind';
|
|
3
|
+
import { getPWFromScene } from '../../utils/get-pw-from-scene';
|
|
4
|
+
const A_HUNDRED = 100;
|
|
5
|
+
const INDETERMINATE_ANIMATION_DURATION = 1500; // 1.5 seconds
|
|
6
|
+
export class LinearProgress extends GameObjects.Container {
|
|
7
|
+
backgroundProgressBar;
|
|
8
|
+
progressBar;
|
|
9
|
+
pw;
|
|
10
|
+
progressWidth;
|
|
11
|
+
progressHeight;
|
|
12
|
+
borderRadiusPx;
|
|
13
|
+
backgroundColor;
|
|
14
|
+
progressColor;
|
|
15
|
+
currentProgress;
|
|
16
|
+
isIndeterminate;
|
|
17
|
+
indeterminateAnimation;
|
|
18
|
+
indeterminateAnimationDuration;
|
|
19
|
+
constructor({ scene, x, y, width, height, backgroundColor = 'gray-200', progressColor = 'blue-500', borderRadius = 'default', progress = 0, indeterminate = false, indeterminateAnimationDuration = INDETERMINATE_ANIMATION_DURATION, }) {
|
|
20
|
+
super(scene, x, y);
|
|
21
|
+
this.pw = getPWFromScene(scene);
|
|
22
|
+
this.progressWidth = width;
|
|
23
|
+
this.progressHeight = height;
|
|
24
|
+
this.backgroundColor = backgroundColor;
|
|
25
|
+
this.progressColor = progressColor;
|
|
26
|
+
this.currentProgress = Math.max(0, Math.min(A_HUNDRED, progress));
|
|
27
|
+
this.isIndeterminate = indeterminate;
|
|
28
|
+
this.indeterminateAnimationDuration = indeterminateAnimationDuration;
|
|
29
|
+
this.borderRadiusPx =
|
|
30
|
+
typeof borderRadius === 'number'
|
|
31
|
+
? borderRadius
|
|
32
|
+
: this.pw.radius.px(borderRadius);
|
|
33
|
+
this.createBackgroundSprite();
|
|
34
|
+
this.createProgressSprite();
|
|
35
|
+
this.setupContainer();
|
|
36
|
+
if (this.isIndeterminate) {
|
|
37
|
+
this.startIndeterminateAnimation();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.updateProgressBar();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Sets the progress value (0-100)
|
|
45
|
+
* @param progress Progress value between 0 and 100
|
|
46
|
+
* @param animate Whether to animate the change (default: true)
|
|
47
|
+
*/
|
|
48
|
+
setProgress(progress, animate = true) {
|
|
49
|
+
if (this.isIndeterminate) {
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
const newProgress = Math.max(0, Math.min(A_HUNDRED, progress));
|
|
53
|
+
if (this.currentProgress === newProgress) {
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
if (animate) {
|
|
57
|
+
const target = { value: this.currentProgress };
|
|
58
|
+
this.scene.tweens.add({
|
|
59
|
+
targets: target,
|
|
60
|
+
value: newProgress,
|
|
61
|
+
duration: 300,
|
|
62
|
+
ease: 'Power2',
|
|
63
|
+
onUpdate: () => {
|
|
64
|
+
this.currentProgress = target.value;
|
|
65
|
+
this.updateProgressBar();
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.currentProgress = newProgress;
|
|
71
|
+
this.updateProgressBar();
|
|
72
|
+
}
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Gets the current progress value
|
|
77
|
+
* @returns Current progress value (0-100)
|
|
78
|
+
*/
|
|
79
|
+
getProgress() {
|
|
80
|
+
return this.currentProgress;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Sets whether the progress bar is indeterminate
|
|
84
|
+
* @param indeterminate Whether to show indeterminate animation
|
|
85
|
+
*/
|
|
86
|
+
setIndeterminate(indeterminate) {
|
|
87
|
+
if (this.isIndeterminate === indeterminate) {
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
this.isIndeterminate = indeterminate;
|
|
91
|
+
if (this.isIndeterminate) {
|
|
92
|
+
this.stopIndeterminateAnimation();
|
|
93
|
+
this.startIndeterminateAnimation();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this.stopIndeterminateAnimation();
|
|
97
|
+
this.updateProgressBar();
|
|
98
|
+
}
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Sets the border radius of the progress bar
|
|
103
|
+
* @param borderRadius Border radius in px (number) or a Phaser Wind radius token (string)
|
|
104
|
+
* Note: The effective radius is automatically limited to half of the smallest dimension to prevent visual artifacts.
|
|
105
|
+
*/
|
|
106
|
+
setBorderRadius(borderRadius) {
|
|
107
|
+
const newRadiusPx = typeof borderRadius === 'number'
|
|
108
|
+
? borderRadius
|
|
109
|
+
: this.pw.radius.px(borderRadius);
|
|
110
|
+
if (this.borderRadiusPx === newRadiusPx) {
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
this.borderRadiusPx = newRadiusPx;
|
|
114
|
+
this.recreateSprites();
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Sets the background color of the progress bar
|
|
119
|
+
* @param color Background color token
|
|
120
|
+
*/
|
|
121
|
+
setBackgroundColor(color) {
|
|
122
|
+
if (this.backgroundColor === color) {
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
this.backgroundColor = color;
|
|
126
|
+
this.recreateSprites();
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Sets the progress color of the progress bar
|
|
131
|
+
* @param color Progress color token
|
|
132
|
+
*/
|
|
133
|
+
setProgressColor(color) {
|
|
134
|
+
if (this.progressColor === color) {
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
this.progressColor = color;
|
|
138
|
+
this.recreateSprites();
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Destroys the component and cleans up animations
|
|
143
|
+
*/
|
|
144
|
+
destroy() {
|
|
145
|
+
this.stopIndeterminateAnimation();
|
|
146
|
+
super.destroy();
|
|
147
|
+
}
|
|
148
|
+
createBackgroundSprite() {
|
|
149
|
+
const bgGraphic = this.scene.add.graphics();
|
|
150
|
+
bgGraphic.fillStyle(Color.hex(this.backgroundColor), 1);
|
|
151
|
+
bgGraphic.fillRoundedRect(-this.progressWidth / 2, -this.progressHeight / 2, this.progressWidth, this.progressHeight, this.getEffectiveBorderRadius());
|
|
152
|
+
this.backgroundProgressBar = bgGraphic;
|
|
153
|
+
}
|
|
154
|
+
createProgressSprite() {
|
|
155
|
+
const progressBar = this.scene.add.graphics();
|
|
156
|
+
progressBar.fillStyle(Color.hex(this.progressColor), 1);
|
|
157
|
+
progressBar.fillRoundedRect(-this.progressWidth / 2, -this.progressHeight / 2, this.progressWidth, this.progressHeight, this.getEffectiveBorderRadius());
|
|
158
|
+
this.progressBar = progressBar;
|
|
159
|
+
}
|
|
160
|
+
setupContainer() {
|
|
161
|
+
this.add([this.backgroundProgressBar, this.progressBar]);
|
|
162
|
+
}
|
|
163
|
+
calculateProgressDimensions() {
|
|
164
|
+
const progressWidth = (this.progressWidth * this.currentProgress) / A_HUNDRED;
|
|
165
|
+
const leftOffset = (progressWidth - this.progressWidth) / 2;
|
|
166
|
+
return { progressWidth, leftOffset };
|
|
167
|
+
}
|
|
168
|
+
updateProgressBar(force = false) {
|
|
169
|
+
if (this.isIndeterminate && !force) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const { progressWidth, leftOffset } = this.calculateProgressDimensions();
|
|
173
|
+
this.progressBar.setScale(progressWidth / this.progressWidth, 1);
|
|
174
|
+
this.progressBar.setX(leftOffset);
|
|
175
|
+
}
|
|
176
|
+
startIndeterminateAnimation() {
|
|
177
|
+
if (!this.isIndeterminate) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
this.currentProgress = 40;
|
|
181
|
+
this.updateProgressBar(true);
|
|
182
|
+
const { progressWidth } = this.calculateProgressDimensions();
|
|
183
|
+
// Calculate the movement range: the bar should move within the background bounds
|
|
184
|
+
// The bar center can move from left edge + half bar width to right edge - half bar width
|
|
185
|
+
const maxX = (this.progressWidth / 2) - (progressWidth / 2);
|
|
186
|
+
const minX = -(this.progressWidth / 2) + (progressWidth / 2);
|
|
187
|
+
// Start from the left
|
|
188
|
+
this.progressBar.setX(minX);
|
|
189
|
+
this.indeterminateAnimation = this.scene.tweens.add({
|
|
190
|
+
targets: this.progressBar,
|
|
191
|
+
x: maxX,
|
|
192
|
+
duration: this.indeterminateAnimationDuration,
|
|
193
|
+
ease: 'Sine.easeInOut',
|
|
194
|
+
yoyo: true,
|
|
195
|
+
repeat: -1,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
stopIndeterminateAnimation() {
|
|
199
|
+
if (this.indeterminateAnimation) {
|
|
200
|
+
this.indeterminateAnimation.destroy();
|
|
201
|
+
this.indeterminateAnimation = undefined;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
recreateSprites() {
|
|
205
|
+
// Remove old sprites
|
|
206
|
+
this.remove([this.backgroundProgressBar, this.progressBar]);
|
|
207
|
+
this.backgroundProgressBar.destroy();
|
|
208
|
+
this.progressBar.destroy();
|
|
209
|
+
// Create new sprites with updated properties
|
|
210
|
+
this.createBackgroundSprite();
|
|
211
|
+
this.createProgressSprite();
|
|
212
|
+
this.setupContainer();
|
|
213
|
+
// Restore state
|
|
214
|
+
if (this.isIndeterminate) {
|
|
215
|
+
this.startIndeterminateAnimation();
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
this.updateProgressBar();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Calculates the effective border radius, ensuring it doesn't exceed
|
|
223
|
+
* half of the smallest dimension to prevent visual artifacts
|
|
224
|
+
* @returns Limited border radius in pixels
|
|
225
|
+
*/
|
|
226
|
+
getEffectiveBorderRadius() {
|
|
227
|
+
const maxRadius = Math.min(this.progressWidth, this.progressHeight) / 2;
|
|
228
|
+
return Math.min(this.borderRadiusPx, maxRadius);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=linear-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-progress.js","sourceRoot":"","sources":["../../../src/components/linear-progress/linear-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAC5C,OAAO,EACL,KAAK,GAIN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AA4B/D,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,gCAAgC,GAAG,IAAI,CAAC,CAAC,cAAc;AAE7D,MAAM,OAAO,cAAe,SAAQ,WAAW,CAAC,SAAS;IAChD,qBAAqB,CAAwB;IAC7C,WAAW,CAAwB;IAElC,EAAE,CAAuB;IACzB,aAAa,CAAS;IACtB,cAAc,CAAS;IACvB,cAAc,CAAS;IACvB,eAAe,CAAa;IAC5B,aAAa,CAAa;IAC1B,eAAe,CAAS;IACxB,eAAe,CAAU;IACzB,sBAAsB,CAAmC;IACzD,8BAA8B,CAAS;IAE/C,YAAY,EACV,KAAK,EAC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C,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC;YACtC,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;QAC1C,CAAC;IACH,CAAC;IAEO,eAAe;QACrB,qBAAqB;QACrB,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAE3B,6CAA6C;QAC7C,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,gBAAgB;QAChB,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,wBAAwB;QAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-progress.spec.d.ts","sourceRoot":"","sources":["../../../src/components/linear-progress/linear-progress.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/* eslint-disable no-magic-numbers */
|
|
2
|
+
/* eslint-disable max-lines-per-function */
|
|
3
|
+
import { Scene } from 'phaser';
|
|
4
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
// Mock Phaser to avoid canvas dependency in runtime
|
|
6
|
+
vi.mock('phaser', () => {
|
|
7
|
+
class Scene {
|
|
8
|
+
add = {
|
|
9
|
+
graphics: () => ({
|
|
10
|
+
fillStyle: vi.fn(),
|
|
11
|
+
fillRoundedRect: vi.fn(),
|
|
12
|
+
generateTexture: vi.fn(),
|
|
13
|
+
destroy: vi.fn(),
|
|
14
|
+
setScale: vi.fn(),
|
|
15
|
+
setX: vi.fn(),
|
|
16
|
+
}),
|
|
17
|
+
sprite: vi.fn(() => ({
|
|
18
|
+
setOrigin: vi.fn(),
|
|
19
|
+
setScale: vi.fn(),
|
|
20
|
+
setX: vi.fn(),
|
|
21
|
+
destroy: vi.fn(),
|
|
22
|
+
})),
|
|
23
|
+
};
|
|
24
|
+
textures = {
|
|
25
|
+
exists: vi.fn(() => false),
|
|
26
|
+
};
|
|
27
|
+
tweens = {
|
|
28
|
+
add: vi.fn(() => ({
|
|
29
|
+
destroy: vi.fn(),
|
|
30
|
+
})),
|
|
31
|
+
};
|
|
32
|
+
constructor() {
|
|
33
|
+
// Ensure textures is properly bound to this instance
|
|
34
|
+
this.textures = {
|
|
35
|
+
exists: vi.fn(() => false),
|
|
36
|
+
};
|
|
37
|
+
this.tweens = {
|
|
38
|
+
add: vi.fn(() => ({
|
|
39
|
+
destroy: vi.fn(),
|
|
40
|
+
})),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class Container {
|
|
45
|
+
list = [];
|
|
46
|
+
x;
|
|
47
|
+
y;
|
|
48
|
+
width = 0;
|
|
49
|
+
height = 0;
|
|
50
|
+
scene;
|
|
51
|
+
constructor(scene, x, y) {
|
|
52
|
+
this.scene = scene;
|
|
53
|
+
this.x = x;
|
|
54
|
+
this.y = y;
|
|
55
|
+
}
|
|
56
|
+
add(child) {
|
|
57
|
+
if (Array.isArray(child)) {
|
|
58
|
+
this.list.push(...child);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.list.push(child);
|
|
62
|
+
}
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
remove(child) {
|
|
66
|
+
if (Array.isArray(child)) {
|
|
67
|
+
child.forEach(c => {
|
|
68
|
+
const index = this.list.indexOf(c);
|
|
69
|
+
if (index !== -1)
|
|
70
|
+
this.list.splice(index, 1);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const index = this.list.indexOf(child);
|
|
75
|
+
if (index !== -1)
|
|
76
|
+
this.list.splice(index, 1);
|
|
77
|
+
}
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
destroy() {
|
|
81
|
+
this.list = [];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const GameObjects = { Container };
|
|
85
|
+
return { GameObjects, Scene };
|
|
86
|
+
});
|
|
87
|
+
// Mock the getPWFromScene utility
|
|
88
|
+
vi.mock('../../utils/get-pw-from-scene', () => ({
|
|
89
|
+
getPWFromScene: () => ({
|
|
90
|
+
radius: {
|
|
91
|
+
px: (key) => {
|
|
92
|
+
const radiusMap = {
|
|
93
|
+
none: 0,
|
|
94
|
+
sm: 2,
|
|
95
|
+
default: 4,
|
|
96
|
+
md: 6,
|
|
97
|
+
lg: 8,
|
|
98
|
+
xl: 12,
|
|
99
|
+
'2xl': 16,
|
|
100
|
+
'3xl': 24,
|
|
101
|
+
full: 9999,
|
|
102
|
+
};
|
|
103
|
+
return radiusMap[key] ?? 4;
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}),
|
|
107
|
+
}));
|
|
108
|
+
// Mock Color utility
|
|
109
|
+
vi.mock('phaser-wind', () => ({
|
|
110
|
+
Color: {
|
|
111
|
+
hex: vi.fn(() => 0x000000),
|
|
112
|
+
},
|
|
113
|
+
}));
|
|
114
|
+
import { LinearProgress } from './linear-progress';
|
|
115
|
+
describe('LinearProgress', () => {
|
|
116
|
+
let linearProgress;
|
|
117
|
+
let scene;
|
|
118
|
+
beforeEach(() => {
|
|
119
|
+
vi.clearAllMocks();
|
|
120
|
+
scene = new Scene();
|
|
121
|
+
});
|
|
122
|
+
describe('constructor', () => {
|
|
123
|
+
it('should create a linear progress bar with default parameters', () => {
|
|
124
|
+
linearProgress = new LinearProgress({
|
|
125
|
+
scene,
|
|
126
|
+
x: 100,
|
|
127
|
+
y: 100,
|
|
128
|
+
width: 200,
|
|
129
|
+
height: 8,
|
|
130
|
+
});
|
|
131
|
+
expect(linearProgress).toBeInstanceOf(LinearProgress);
|
|
132
|
+
expect(linearProgress.getProgress()).toBe(0);
|
|
133
|
+
});
|
|
134
|
+
it('should create a linear progress bar with custom parameters', () => {
|
|
135
|
+
linearProgress = new LinearProgress({
|
|
136
|
+
scene,
|
|
137
|
+
x: 100,
|
|
138
|
+
y: 100,
|
|
139
|
+
width: 300,
|
|
140
|
+
height: 12,
|
|
141
|
+
backgroundColor: 'gray-300',
|
|
142
|
+
progressColor: 'green-500',
|
|
143
|
+
borderRadius: 'lg',
|
|
144
|
+
progress: 50,
|
|
145
|
+
});
|
|
146
|
+
expect(linearProgress).toBeInstanceOf(LinearProgress);
|
|
147
|
+
expect(linearProgress.getProgress()).toBe(50);
|
|
148
|
+
});
|
|
149
|
+
it('should create an indeterminate progress bar', () => {
|
|
150
|
+
linearProgress = new LinearProgress({
|
|
151
|
+
scene,
|
|
152
|
+
x: 100,
|
|
153
|
+
y: 100,
|
|
154
|
+
width: 200,
|
|
155
|
+
height: 8,
|
|
156
|
+
indeterminate: true,
|
|
157
|
+
});
|
|
158
|
+
expect(linearProgress).toBeInstanceOf(LinearProgress);
|
|
159
|
+
expect(scene.tweens.add).toHaveBeenCalled();
|
|
160
|
+
});
|
|
161
|
+
it('should create indeterminate progress bar with correct positioning bounds', () => {
|
|
162
|
+
const width = 300;
|
|
163
|
+
linearProgress = new LinearProgress({
|
|
164
|
+
scene,
|
|
165
|
+
x: 100,
|
|
166
|
+
y: 100,
|
|
167
|
+
width,
|
|
168
|
+
height: 8,
|
|
169
|
+
indeterminate: true,
|
|
170
|
+
});
|
|
171
|
+
// Verify that tween was called with correct positioning
|
|
172
|
+
expect(scene.tweens.add).toHaveBeenCalled();
|
|
173
|
+
const tweenCall = vi.mocked(scene.tweens.add).mock.calls[0]?.[0];
|
|
174
|
+
// The indeterminate bar should move within bounds
|
|
175
|
+
// Bar width is 40% of total width = 120px
|
|
176
|
+
// Max X should be (300/2) - (120/2) = 150 - 60 = 90
|
|
177
|
+
// Min X should be -(300/2) + (120/2) = -150 + 60 = -90
|
|
178
|
+
expect(tweenCall.x).toBe(90); // maxX position
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
describe('setProgress', () => {
|
|
182
|
+
beforeEach(() => {
|
|
183
|
+
linearProgress = new LinearProgress({
|
|
184
|
+
scene,
|
|
185
|
+
x: 100,
|
|
186
|
+
y: 100,
|
|
187
|
+
width: 200,
|
|
188
|
+
height: 8,
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
it('should set progress value within valid range', () => {
|
|
192
|
+
linearProgress.setProgress(75, false);
|
|
193
|
+
expect(linearProgress.getProgress()).toBe(75);
|
|
194
|
+
});
|
|
195
|
+
it('should clamp progress value to 0-100 range', () => {
|
|
196
|
+
linearProgress.setProgress(-10, false);
|
|
197
|
+
expect(linearProgress.getProgress()).toBe(0);
|
|
198
|
+
linearProgress.setProgress(150, false);
|
|
199
|
+
expect(linearProgress.getProgress()).toBe(100);
|
|
200
|
+
});
|
|
201
|
+
it('should animate progress change by default', () => {
|
|
202
|
+
linearProgress.setProgress(50);
|
|
203
|
+
expect(scene.tweens.add).toHaveBeenCalled();
|
|
204
|
+
});
|
|
205
|
+
it('should not change progress for indeterminate progress bar', () => {
|
|
206
|
+
linearProgress.setIndeterminate(true);
|
|
207
|
+
const initialProgress = linearProgress.getProgress();
|
|
208
|
+
linearProgress.setProgress(75);
|
|
209
|
+
expect(linearProgress.getProgress()).toBe(initialProgress);
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
describe('setIndeterminate', () => {
|
|
213
|
+
beforeEach(() => {
|
|
214
|
+
linearProgress = new LinearProgress({
|
|
215
|
+
scene,
|
|
216
|
+
x: 100,
|
|
217
|
+
y: 100,
|
|
218
|
+
width: 200,
|
|
219
|
+
height: 8,
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
it('should start indeterminate animation when set to true', () => {
|
|
223
|
+
linearProgress.setIndeterminate(true);
|
|
224
|
+
expect(scene.tweens.add).toHaveBeenCalled();
|
|
225
|
+
});
|
|
226
|
+
it('should stop indeterminate animation when set to false', () => {
|
|
227
|
+
linearProgress.setIndeterminate(true);
|
|
228
|
+
const tweenMock = { destroy: vi.fn() };
|
|
229
|
+
vi.mocked(scene.tweens.add).mockReturnValue(tweenMock);
|
|
230
|
+
linearProgress.setIndeterminate(false);
|
|
231
|
+
// Animation should be stopped when switching back to determinate
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
describe('setBorderRadius', () => {
|
|
235
|
+
beforeEach(() => {
|
|
236
|
+
linearProgress = new LinearProgress({
|
|
237
|
+
scene,
|
|
238
|
+
x: 100,
|
|
239
|
+
y: 100,
|
|
240
|
+
width: 200,
|
|
241
|
+
height: 8,
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
it('should accept numeric border radius', () => {
|
|
245
|
+
expect(() => linearProgress.setBorderRadius(10)).not.toThrow();
|
|
246
|
+
});
|
|
247
|
+
it('should accept string border radius token', () => {
|
|
248
|
+
expect(() => linearProgress.setBorderRadius('lg')).not.toThrow();
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
describe('color setters', () => {
|
|
252
|
+
beforeEach(() => {
|
|
253
|
+
linearProgress = new LinearProgress({
|
|
254
|
+
scene,
|
|
255
|
+
x: 100,
|
|
256
|
+
y: 100,
|
|
257
|
+
width: 200,
|
|
258
|
+
height: 8,
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
it('should set background color', () => {
|
|
262
|
+
expect(() => linearProgress.setBackgroundColor('red-200')).not.toThrow();
|
|
263
|
+
});
|
|
264
|
+
it('should set progress color', () => {
|
|
265
|
+
expect(() => linearProgress.setProgressColor('blue-600')).not.toThrow();
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
describe('destroy', () => {
|
|
269
|
+
beforeEach(() => {
|
|
270
|
+
linearProgress = new LinearProgress({
|
|
271
|
+
scene,
|
|
272
|
+
x: 100,
|
|
273
|
+
y: 100,
|
|
274
|
+
width: 200,
|
|
275
|
+
height: 8,
|
|
276
|
+
indeterminate: true,
|
|
277
|
+
indeterminateAnimationDuration: 1000,
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
it('should clean up animations when destroyed', () => {
|
|
281
|
+
const tweenMock = { destroy: vi.fn() };
|
|
282
|
+
vi.mocked(scene.tweens.add).mockReturnValue(tweenMock);
|
|
283
|
+
linearProgress.destroy();
|
|
284
|
+
// Should clean up any running animations
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
//# sourceMappingURL=linear-progress.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-progress.spec.js","sourceRoot":"","sources":["../../../src/components/linear-progress/linear-progress.spec.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,2CAA2C;AAC3C,OAAO,EAAE,KAAK,EAAU,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9D,oDAAoD;AACpD,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;IACrB,MAAM,KAAK;QACF,GAAG,GAAG;YACX,QAAQ,EAAE,GAA4B,EAAE,CAAC,CAAC;gBACxC,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;gBAClB,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE;gBACxB,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE;gBACxB,OAAO,EAAE,EAAE,CAAC,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