phaser-wind 0.9.1 → 0.10.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 +57 -60
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/opacity.d.ts +36 -0
- package/dist/core/opacity.d.ts.map +1 -0
- package/dist/core/opacity.js +59 -0
- package/dist/core/opacity.js.map +1 -0
- package/dist/core/opacity.spec.d.ts +2 -0
- package/dist/core/opacity.spec.d.ts.map +1 -0
- package/dist/core/opacity.spec.js +60 -0
- package/dist/core/opacity.spec.js.map +1 -0
- package/dist/phaser-wind.js +127 -1
- package/dist/phaser-wind.min.js +1 -1
- package/dist/plugin/plugin.d.ts +3 -0
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +6 -0
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/scene/index.d.ts +1 -0
- package/dist/scene/index.d.ts.map +1 -1
- package/dist/scene/index.js +1 -0
- package/dist/scene/index.js.map +1 -1
- package/dist/scene/scene-with-phaser-wind.d.ts +23 -1
- package/dist/scene/scene-with-phaser-wind.d.ts.map +1 -1
- package/dist/scene/scene-with-phaser-wind.js +23 -1
- package/dist/scene/scene-with-phaser-wind.js.map +1 -1
- package/dist/scene/with-phaser-wind.d.ts +34 -0
- package/dist/scene/with-phaser-wind.d.ts.map +1 -0
- package/dist/scene/with-phaser-wind.js +32 -0
- package/dist/scene/with-phaser-wind.js.map +1 -0
- package/dist/theme/theme-config.d.ts +7 -0
- package/dist/theme/theme-config.d.ts.map +1 -1
- package/dist/theme/theme-config.js +3 -0
- package/dist/theme/theme-config.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -283,83 +283,80 @@ new Phaser.Game({
|
|
|
283
283
|
});
|
|
284
284
|
```
|
|
285
285
|
|
|
286
|
-
### 3)
|
|
286
|
+
### 3) Access the plugin from your scene with `withPhaserWind`
|
|
287
287
|
|
|
288
|
-
|
|
288
|
+
Use the `withPhaserWind(scene)` accessor to get a fully typed handle to the plugin. It composes with any base scene, doesn't rely on global module augmentation, and infers your theme's tokens at the call site.
|
|
289
289
|
|
|
290
290
|
```ts
|
|
291
|
-
|
|
292
|
-
import 'phaser';
|
|
293
|
-
import type {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
291
|
+
import Phaser from 'phaser';
|
|
292
|
+
import { withPhaserWind } from 'phaser-wind';
|
|
293
|
+
import type { ThemeType } from './theme'; // your createTheme() result
|
|
294
|
+
|
|
295
|
+
class MyScene extends Phaser.Scene {
|
|
296
|
+
create(): void {
|
|
297
|
+
const pw = withPhaserWind<ThemeType>(this);
|
|
298
|
+
const { color, fontSize, spacing, radius, font, shadow } = pw;
|
|
299
|
+
|
|
300
|
+
this.cameras.main.setBackgroundColor(color.rgb('background'));
|
|
301
|
+
|
|
302
|
+
this.add
|
|
303
|
+
.text(300, 100, 'Primary color', {
|
|
304
|
+
fontSize: fontSize.css('2xl'),
|
|
305
|
+
color: color.rgb('primary'), // ✅ Type-narrowed to your theme
|
|
306
|
+
})
|
|
307
|
+
.setOrigin(0.5);
|
|
308
|
+
|
|
309
|
+
// ✅ Type-narrowed to your theme
|
|
310
|
+
spacing.px('gutter');
|
|
311
|
+
radius.css('card');
|
|
312
|
+
font.family('display');
|
|
313
|
+
shadow.get('glow');
|
|
314
|
+
|
|
315
|
+
// ❌ Compile-time errors
|
|
316
|
+
// color.rgb('blue-501');
|
|
317
|
+
// spacing.px('unknown');
|
|
307
318
|
}
|
|
308
319
|
}
|
|
309
|
-
|
|
310
|
-
// In your scene
|
|
311
|
-
|
|
312
|
-
class MyCustomScene extends Phaser.Scene {
|
|
313
|
-
create(): void {
|
|
314
|
-
this.pw // <-- Valid instance in your ts file
|
|
315
320
|
```
|
|
316
321
|
|
|
317
|
-
|
|
322
|
+
Call `withPhaserWind(this)` inside `create()` / `update()` (after the plugin has mounted). Don't call it in the constructor or `init()` — the plugin isn't attached yet.
|
|
323
|
+
|
|
324
|
+
### 4) Recommended: wrap it in a project-local helper
|
|
318
325
|
|
|
319
|
-
|
|
326
|
+
Passing `<ThemeType>` on every call gets old. Define a one-line helper once in your project so scenes stay short and the theme type stays in one place:
|
|
320
327
|
|
|
321
328
|
```ts
|
|
322
|
-
|
|
323
|
-
import {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
this.add
|
|
331
|
-
.text(300, 100, 'Primary color', {
|
|
332
|
-
fontSize: pw.fontSize.css('2xl'), // use the pw property to get the font size
|
|
333
|
-
color: pw.color.rgb('primary'), // use the pw property to get the color with type safety
|
|
334
|
-
})
|
|
335
|
-
.setOrigin(0.5);
|
|
336
|
-
```
|
|
329
|
+
// src/theme.ts (in your project)
|
|
330
|
+
import type { Scene } from 'phaser';
|
|
331
|
+
import { createTheme, withPhaserWind, type CreateTheme } from 'phaser-wind';
|
|
332
|
+
|
|
333
|
+
export const theme = createTheme({
|
|
334
|
+
colors: { primary: 'blue-600', danger: 'red-500' },
|
|
335
|
+
// ...
|
|
336
|
+
} satisfies CreateTheme<any>);
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
export type ThemeType = typeof theme;
|
|
339
339
|
|
|
340
|
-
|
|
340
|
+
/** Project-local accessor — no need to pass the theme type. */
|
|
341
|
+
export const withPw = (scene: Scene) => withPhaserWind<ThemeType>(scene);
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Now every scene is a one-liner:
|
|
341
345
|
|
|
342
346
|
```ts
|
|
343
347
|
import Phaser from 'phaser';
|
|
344
|
-
import {
|
|
345
|
-
|
|
346
|
-
class
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
fontSize.css('lg');
|
|
353
|
-
spacing.px('gutter');
|
|
354
|
-
radius.css('card');
|
|
355
|
-
font.family('display');
|
|
356
|
-
shadow.get('glow');
|
|
357
|
-
|
|
358
|
-
// ❌ Compile-time errors
|
|
359
|
-
// color.rgb('blue-501');
|
|
360
|
-
// spacing.px('unknown');
|
|
348
|
+
import { withPw } from './theme';
|
|
349
|
+
|
|
350
|
+
class MyScene extends Phaser.Scene {
|
|
351
|
+
create(): void {
|
|
352
|
+
const pw = withPw(this); // fully typed against your theme
|
|
353
|
+
this.cameras.main.setBackgroundColor(pw.color.rgb('background'));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
361
356
|
```
|
|
362
357
|
|
|
358
|
+
You can name the helper whatever fits your style — `withPw`, `usePw`, `getPw`, `pw`. The lib intentionally doesn't ship an alias, so you own the naming in your codebase.
|
|
359
|
+
|
|
363
360
|
### 🎮 **Real Game Example**
|
|
364
361
|
|
|
365
362
|
You can check some examples in our [Storybook in this clicking here](https://renatocassino.github.io/phaser-toolkit).
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
package/dist/core/index.js
CHANGED
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BaseThemeConfig } from '../theme';
|
|
2
|
+
/**
|
|
3
|
+
* Valid opacity scale keys following Tailwind's opacity scale.
|
|
4
|
+
* Values map to alpha in the 0..1 range (Phaser's `setAlpha` range).
|
|
5
|
+
*/
|
|
6
|
+
export type OpacityKey = '0' | '5' | '10' | '15' | '20' | '25' | '30' | '35' | '40' | '45' | '50' | '55' | '60' | '65' | '70' | '75' | '80' | '85' | '90' | '95' | '100';
|
|
7
|
+
/** Maps opacity scale keys to their 0..1 alpha values. */
|
|
8
|
+
export type OpacityMap = Record<OpacityKey | string, number>;
|
|
9
|
+
/**
|
|
10
|
+
* Opacity scale mapping following Tailwind's opacity scale.
|
|
11
|
+
* Values are in the 0..1 range, ready for Phaser's `setAlpha()`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const opacityMap: OpacityMap;
|
|
14
|
+
/**
|
|
15
|
+
* API for resolving opacity tokens.
|
|
16
|
+
* Accepted keys are narrowed to default tokens plus theme keys.
|
|
17
|
+
*/
|
|
18
|
+
export type OpacityApi<T extends OpacityMap | undefined> = {
|
|
19
|
+
/** Alpha value in 0..1 range, ready for Phaser's `setAlpha()`. */
|
|
20
|
+
value: (key: OpacityKey | (T extends OpacityMap ? keyof T : never)) => number;
|
|
21
|
+
/** Percentage as a number (0..100). */
|
|
22
|
+
percent: (key: OpacityKey | (T extends OpacityMap ? keyof T : never)) => number;
|
|
23
|
+
/** CSS opacity string like `'50%'`. */
|
|
24
|
+
css: (key: OpacityKey | (T extends OpacityMap ? keyof T : never)) => string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Create an opacity API bound to an optional theme opacity map.
|
|
28
|
+
* @example
|
|
29
|
+
* const o = createOpacity({ faded: 0.35 });
|
|
30
|
+
* o.value('faded'); // 0.35
|
|
31
|
+
* o.value('50'); // 0.5
|
|
32
|
+
*/
|
|
33
|
+
export declare const createOpacity: <T extends OpacityMap | undefined = BaseThemeConfig["opacity"]>(themeOpacity?: T) => OpacityApi<T>;
|
|
34
|
+
/** Convenience instance using default opacity map (no theme). */
|
|
35
|
+
export declare const Opacity: OpacityApi<undefined>;
|
|
36
|
+
//# sourceMappingURL=opacity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opacity.d.ts","sourceRoot":"","sources":["../../src/core/opacity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,CAAC;AAEV,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,UAsBxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,GAAG,SAAS,IAAI;IACzD,kEAAkE;IAClE,KAAK,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,MAAM,CAAC;IAC9E,uCAAuC;IACvC,OAAO,EAAE,CACP,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,KACvD,MAAM,CAAC;IACZ,uCAAuC;IACvC,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC,SAAS,UAAU,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,MAAM,CAAC;CAC7E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,CAAC,SAAS,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,EAE7D,eAAe,CAAC,KACf,UAAU,CAAC,CAAC,CA6Bd,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,SAAS,CACL,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opacity scale mapping following Tailwind's opacity scale.
|
|
3
|
+
* Values are in the 0..1 range, ready for Phaser's `setAlpha()`.
|
|
4
|
+
*/
|
|
5
|
+
export const opacityMap = {
|
|
6
|
+
'0': 0,
|
|
7
|
+
'5': 0.05,
|
|
8
|
+
'10': 0.1,
|
|
9
|
+
'15': 0.15,
|
|
10
|
+
'20': 0.2,
|
|
11
|
+
'25': 0.25,
|
|
12
|
+
'30': 0.3,
|
|
13
|
+
'35': 0.35,
|
|
14
|
+
'40': 0.4,
|
|
15
|
+
'45': 0.45,
|
|
16
|
+
'50': 0.5,
|
|
17
|
+
'55': 0.55,
|
|
18
|
+
'60': 0.6,
|
|
19
|
+
'65': 0.65,
|
|
20
|
+
'70': 0.7,
|
|
21
|
+
'75': 0.75,
|
|
22
|
+
'80': 0.8,
|
|
23
|
+
'85': 0.85,
|
|
24
|
+
'90': 0.9,
|
|
25
|
+
'95': 0.95,
|
|
26
|
+
'100': 1,
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Create an opacity API bound to an optional theme opacity map.
|
|
30
|
+
* @example
|
|
31
|
+
* const o = createOpacity({ faded: 0.35 });
|
|
32
|
+
* o.value('faded'); // 0.35
|
|
33
|
+
* o.value('50'); // 0.5
|
|
34
|
+
*/
|
|
35
|
+
export const createOpacity = (themeOpacity) => {
|
|
36
|
+
const map = {
|
|
37
|
+
...opacityMap,
|
|
38
|
+
...themeOpacity,
|
|
39
|
+
};
|
|
40
|
+
const get = (key) => {
|
|
41
|
+
return typeof map[key] === 'number' ? map[key] : 0;
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
value: (key) => {
|
|
45
|
+
return get(key);
|
|
46
|
+
},
|
|
47
|
+
percent: (key) => {
|
|
48
|
+
const ONE_HUNDRED = 100;
|
|
49
|
+
return get(key) * ONE_HUNDRED;
|
|
50
|
+
},
|
|
51
|
+
css: (key) => {
|
|
52
|
+
const ONE_HUNDRED = 100;
|
|
53
|
+
return `${get(key) * ONE_HUNDRED}%`;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
/** Convenience instance using default opacity map (no theme). */
|
|
58
|
+
export const Opacity = createOpacity(undefined);
|
|
59
|
+
//# sourceMappingURL=opacity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opacity.js","sourceRoot":"","sources":["../../src/core/opacity.ts"],"names":[],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AO,GAAG,GAAG,CAAC,GAAa,CAAC,GAAG,WAAW,GAAG,CAAC;QAChD,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,iEAAiE;AACjE,MAAM,CAAC,MAAM,OAAO,GAClB,aAAa,CAAY,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opacity.spec.d.ts","sourceRoot":"","sources":["../../src/core/opacity.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* eslint-disable no-magic-numbers */
|
|
2
|
+
/* eslint-disable max-lines-per-function */
|
|
3
|
+
/* eslint-disable sonarjs/no-duplicate-string */
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import { createOpacity, Opacity } from './opacity';
|
|
6
|
+
describe('Opacity', () => {
|
|
7
|
+
describe('value', () => {
|
|
8
|
+
it('should return alpha values in 0..1 range', () => {
|
|
9
|
+
const opacity = createOpacity();
|
|
10
|
+
expect(opacity.value('0')).toBe(0);
|
|
11
|
+
expect(opacity.value('50')).toBe(0.5);
|
|
12
|
+
expect(opacity.value('100')).toBe(1);
|
|
13
|
+
});
|
|
14
|
+
it('should handle every tailwind step', () => {
|
|
15
|
+
const opacity = createOpacity();
|
|
16
|
+
expect(opacity.value('5')).toBe(0.05);
|
|
17
|
+
expect(opacity.value('25')).toBe(0.25);
|
|
18
|
+
expect(opacity.value('75')).toBe(0.75);
|
|
19
|
+
expect(opacity.value('95')).toBe(0.95);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
describe('percent', () => {
|
|
23
|
+
it('should return values as percentages (0..100)', () => {
|
|
24
|
+
const opacity = createOpacity();
|
|
25
|
+
expect(opacity.percent('0')).toBe(0);
|
|
26
|
+
expect(opacity.percent('50')).toBe(50);
|
|
27
|
+
expect(opacity.percent('100')).toBe(100);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
describe('css', () => {
|
|
31
|
+
it('should return CSS opacity strings', () => {
|
|
32
|
+
const opacity = createOpacity();
|
|
33
|
+
expect(opacity.css('0')).toBe('0%');
|
|
34
|
+
expect(opacity.css('50')).toBe('50%');
|
|
35
|
+
expect(opacity.css('100')).toBe('100%');
|
|
36
|
+
});
|
|
37
|
+
it('should work with default Opacity constant', () => {
|
|
38
|
+
expect(Opacity.value('50')).toBe(0.5);
|
|
39
|
+
expect(Opacity.percent('75')).toBe(75);
|
|
40
|
+
expect(Opacity.css('25')).toBe('25%');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe('theme override', () => {
|
|
44
|
+
it('should resolve custom theme opacity keys', () => {
|
|
45
|
+
const opacity = createOpacity({ faded: 0.35, ghost: 0.08 });
|
|
46
|
+
expect(opacity.value('faded')).toBe(0.35);
|
|
47
|
+
expect(opacity.value('ghost')).toBe(0.08);
|
|
48
|
+
});
|
|
49
|
+
it('should keep default tokens available alongside theme keys', () => {
|
|
50
|
+
const opacity = createOpacity({ faded: 0.35 });
|
|
51
|
+
expect(opacity.value('50')).toBe(0.5);
|
|
52
|
+
expect(opacity.value('faded')).toBe(0.35);
|
|
53
|
+
});
|
|
54
|
+
it('should let theme keys override default keys with the same name', () => {
|
|
55
|
+
const opacity = createOpacity({ '50': 0.42 });
|
|
56
|
+
expect(opacity.value('50')).toBe(0.42);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=opacity.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opacity.spec.js","sourceRoot":"","sources":["../../src/core/opacity.spec.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,2CAA2C;AAC3C,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,QAAQ,CAAC,SAAS,EAAE,GAAG,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AM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;YACnE,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;YACxE,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/phaser-wind.js
CHANGED
|
@@ -1193,6 +1193,62 @@
|
|
|
1193
1193
|
};
|
|
1194
1194
|
};
|
|
1195
1195
|
|
|
1196
|
+
/**
|
|
1197
|
+
* Opacity scale mapping following Tailwind's opacity scale.
|
|
1198
|
+
* Values are in the 0..1 range, ready for Phaser's `setAlpha()`.
|
|
1199
|
+
*/
|
|
1200
|
+
var opacityMap = {
|
|
1201
|
+
'0': 0,
|
|
1202
|
+
'5': 0.05,
|
|
1203
|
+
'10': 0.1,
|
|
1204
|
+
'15': 0.15,
|
|
1205
|
+
'20': 0.2,
|
|
1206
|
+
'25': 0.25,
|
|
1207
|
+
'30': 0.3,
|
|
1208
|
+
'35': 0.35,
|
|
1209
|
+
'40': 0.4,
|
|
1210
|
+
'45': 0.45,
|
|
1211
|
+
'50': 0.5,
|
|
1212
|
+
'55': 0.55,
|
|
1213
|
+
'60': 0.6,
|
|
1214
|
+
'65': 0.65,
|
|
1215
|
+
'70': 0.7,
|
|
1216
|
+
'75': 0.75,
|
|
1217
|
+
'80': 0.8,
|
|
1218
|
+
'85': 0.85,
|
|
1219
|
+
'90': 0.9,
|
|
1220
|
+
'95': 0.95,
|
|
1221
|
+
'100': 1,
|
|
1222
|
+
};
|
|
1223
|
+
/**
|
|
1224
|
+
* Create an opacity API bound to an optional theme opacity map.
|
|
1225
|
+
* @example
|
|
1226
|
+
* const o = createOpacity({ faded: 0.35 });
|
|
1227
|
+
* o.value('faded'); // 0.35
|
|
1228
|
+
* o.value('50'); // 0.5
|
|
1229
|
+
*/
|
|
1230
|
+
var createOpacity = function (themeOpacity) {
|
|
1231
|
+
var map = __assign(__assign({}, opacityMap), themeOpacity);
|
|
1232
|
+
var get = function (key) {
|
|
1233
|
+
return typeof map[key] === 'number' ? map[key] : 0;
|
|
1234
|
+
};
|
|
1235
|
+
return {
|
|
1236
|
+
value: function (key) {
|
|
1237
|
+
return get(key);
|
|
1238
|
+
},
|
|
1239
|
+
percent: function (key) {
|
|
1240
|
+
var ONE_HUNDRED = 100;
|
|
1241
|
+
return get(key) * ONE_HUNDRED;
|
|
1242
|
+
},
|
|
1243
|
+
css: function (key) {
|
|
1244
|
+
var ONE_HUNDRED = 100;
|
|
1245
|
+
return "".concat(get(key) * ONE_HUNDRED, "%");
|
|
1246
|
+
},
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
/** Convenience instance using default opacity map (no theme). */
|
|
1250
|
+
var Opacity = createOpacity(undefined);
|
|
1251
|
+
|
|
1196
1252
|
/**
|
|
1197
1253
|
* Mapping of radius keys to their pixel values
|
|
1198
1254
|
*/
|
|
@@ -1360,6 +1416,7 @@
|
|
|
1360
1416
|
overlay: 'black',
|
|
1361
1417
|
},
|
|
1362
1418
|
spacing: __assign({}, spacingMap),
|
|
1419
|
+
opacity: __assign({}, opacityMap),
|
|
1363
1420
|
typography: {
|
|
1364
1421
|
heading: {
|
|
1365
1422
|
fontSize: '2xl',
|
|
@@ -1436,6 +1493,7 @@
|
|
|
1436
1493
|
overlay: 'black',
|
|
1437
1494
|
},
|
|
1438
1495
|
spacing: __assign({}, spacingMap),
|
|
1496
|
+
opacity: __assign({}, opacityMap),
|
|
1439
1497
|
typography: {
|
|
1440
1498
|
heading: {
|
|
1441
1499
|
fontSize: '2xl',
|
|
@@ -1506,6 +1564,7 @@
|
|
|
1506
1564
|
_this.fontSizeInstance = null;
|
|
1507
1565
|
_this.spacingInstance = null;
|
|
1508
1566
|
_this.radiusInstance = null;
|
|
1567
|
+
_this.opacityInstance = null;
|
|
1509
1568
|
_this.fontInstance = null;
|
|
1510
1569
|
_this.shadowInstance = null;
|
|
1511
1570
|
_this.theme = defaultLightTheme;
|
|
@@ -1546,6 +1605,7 @@
|
|
|
1546
1605
|
this.fontSizeInstance = createFontSize(this.theme.fontSizes);
|
|
1547
1606
|
this.spacingInstance = createSpacing(this.theme.spacing);
|
|
1548
1607
|
this.radiusInstance = createRadius(this.theme.radius);
|
|
1608
|
+
this.opacityInstance = createOpacity(this.theme.opacity);
|
|
1549
1609
|
this.fontInstance = createFont(this.theme.fonts, this.theme.fontSizes);
|
|
1550
1610
|
this.shadowInstance = createShadow(this.theme.effects);
|
|
1551
1611
|
};
|
|
@@ -1584,6 +1644,13 @@
|
|
|
1584
1644
|
enumerable: false,
|
|
1585
1645
|
configurable: true
|
|
1586
1646
|
});
|
|
1647
|
+
Object.defineProperty(PhaserWindPlugin.prototype, "opacity", {
|
|
1648
|
+
get: function () {
|
|
1649
|
+
return this.opacityInstance;
|
|
1650
|
+
},
|
|
1651
|
+
enumerable: false,
|
|
1652
|
+
configurable: true
|
|
1653
|
+
});
|
|
1587
1654
|
Object.defineProperty(PhaserWindPlugin.prototype, "font", {
|
|
1588
1655
|
get: function () {
|
|
1589
1656
|
return this.fontInstance;
|
|
@@ -1601,10 +1668,32 @@
|
|
|
1601
1668
|
return PhaserWindPlugin;
|
|
1602
1669
|
}(phaser.Plugins.BasePlugin));
|
|
1603
1670
|
|
|
1671
|
+
/**
|
|
1672
|
+
* @deprecated Use {@link withPhaserWind} instead.
|
|
1673
|
+
*
|
|
1674
|
+
* Forces single inheritance, which conflicts with any user-defined `BaseScene`
|
|
1675
|
+
* or other libraries that ship their own scene base class. It also relies on a
|
|
1676
|
+
* non-null assertion (`pw!`) that lies to TypeScript about when the plugin is
|
|
1677
|
+
* available — touching `this.pw` before the plugin mounts throws at runtime.
|
|
1678
|
+
*
|
|
1679
|
+
* Prefer the `withPhaserWind(scene)` accessor:
|
|
1680
|
+
*
|
|
1681
|
+
* ```ts
|
|
1682
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
1683
|
+
* import type { ThemeType } from './theme';
|
|
1684
|
+
*
|
|
1685
|
+
* class MyScene extends Phaser.Scene {
|
|
1686
|
+
* create() {
|
|
1687
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
1688
|
+
* }
|
|
1689
|
+
* }
|
|
1690
|
+
* ```
|
|
1691
|
+
*
|
|
1692
|
+
* Kept exported to avoid breaking existing consumers.
|
|
1693
|
+
*/
|
|
1604
1694
|
var SceneWithPhaserWind = /** @class */ (function (_super) {
|
|
1605
1695
|
__extends(SceneWithPhaserWind, _super);
|
|
1606
1696
|
/**
|
|
1607
|
-
*
|
|
1608
1697
|
* @param config The scene key or scene specific configuration settings.
|
|
1609
1698
|
*/
|
|
1610
1699
|
function SceneWithPhaserWind(config) {
|
|
@@ -1613,10 +1702,44 @@
|
|
|
1613
1702
|
return SceneWithPhaserWind;
|
|
1614
1703
|
}(Phaser.Scene));
|
|
1615
1704
|
|
|
1705
|
+
/**
|
|
1706
|
+
* Accessor for the Phaser Wind plugin from within a Phaser scene.
|
|
1707
|
+
*
|
|
1708
|
+
* Preferred over {@link SceneWithPhaserWind} (inheritance) and over module
|
|
1709
|
+
* augmentation of `Phaser.Scene`, because it:
|
|
1710
|
+
* - Composes with any existing base scene (no forced inheritance).
|
|
1711
|
+
* - Keeps the theme type explicit at the call site (no silent `any`).
|
|
1712
|
+
* - Doesn't rely on non-null assertions that lie about lifecycle.
|
|
1713
|
+
*
|
|
1714
|
+
* Call it inside `create()` / `update()` (after the plugin has been installed).
|
|
1715
|
+
*
|
|
1716
|
+
* @typeParam T - The theme config type. Pass your `ThemeType` to get
|
|
1717
|
+
* type-narrowed access to your custom tokens.
|
|
1718
|
+
* @param scene - The Phaser scene instance.
|
|
1719
|
+
* @returns The Phaser Wind plugin instance bound to the given theme type.
|
|
1720
|
+
*
|
|
1721
|
+
* @example
|
|
1722
|
+
* ```ts
|
|
1723
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
1724
|
+
* import type { ThemeType } from './theme';
|
|
1725
|
+
*
|
|
1726
|
+
* class MyScene extends Phaser.Scene {
|
|
1727
|
+
* create() {
|
|
1728
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
1729
|
+
* this.cameras.main.setBackgroundColor(pw.color.rgb('background'));
|
|
1730
|
+
* }
|
|
1731
|
+
* }
|
|
1732
|
+
* ```
|
|
1733
|
+
*/
|
|
1734
|
+
var withPhaserWind = function (scene) {
|
|
1735
|
+
return scene.plugins.get(PHASER_WIND_KEY);
|
|
1736
|
+
};
|
|
1737
|
+
|
|
1616
1738
|
exports.Color = Color;
|
|
1617
1739
|
exports.Column = Column;
|
|
1618
1740
|
exports.DEFAULT_GAP = DEFAULT_GAP;
|
|
1619
1741
|
exports.FontSize = FontSize;
|
|
1742
|
+
exports.Opacity = Opacity;
|
|
1620
1743
|
exports.PHASER_WIND_KEY = PHASER_WIND_KEY;
|
|
1621
1744
|
exports.PhaserWindPlugin = PhaserWindPlugin;
|
|
1622
1745
|
exports.Radius = Radius;
|
|
@@ -1627,6 +1750,7 @@
|
|
|
1627
1750
|
exports.createColor = createColor;
|
|
1628
1751
|
exports.createFont = createFont;
|
|
1629
1752
|
exports.createFontSize = createFontSize;
|
|
1753
|
+
exports.createOpacity = createOpacity;
|
|
1630
1754
|
exports.createRadius = createRadius;
|
|
1631
1755
|
exports.createShadow = createShadow;
|
|
1632
1756
|
exports.createSpacing = createSpacing;
|
|
@@ -1642,8 +1766,10 @@
|
|
|
1642
1766
|
exports.isValidColor = isValidColor;
|
|
1643
1767
|
exports.merge = merge;
|
|
1644
1768
|
exports.mergeDeep = mergeDeep;
|
|
1769
|
+
exports.opacityMap = opacityMap;
|
|
1645
1770
|
exports.palette = palette;
|
|
1646
1771
|
exports.radiusMap = radiusMap;
|
|
1647
1772
|
exports.spacingMap = spacingMap;
|
|
1773
|
+
exports.withPhaserWind = withPhaserWind;
|
|
1648
1774
|
|
|
1649
1775
|
}));
|
package/dist/phaser-wind.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("phaser")):"function"==typeof define&&define.amd?define(["exports","phaser"],t):t((r="undefined"!=typeof globalThis?globalThis:r||self).PhaserWind={},r.Phaser)}(this,function(r,t){"use strict";var n=function(r,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])},n(r,t)};function e(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}n(r,t),r.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}var i=function(){return i=Object.assign||function(r){for(var t,n=1,e=arguments.length;n<e;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i]);return r},i.apply(this,arguments)};function o(r,t,n){if(n||2===arguments.length)for(var e,i=0,o=t.length;i<o;i++)!e&&i in t||(e||(e=Array.prototype.slice.call(t,0,i)),e[i]=t[i]);return r.concat(e||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var a=function(r){var t,n=r;if(r&&"object"==typeof r&&"list"in r&&Array.isArray(r.list)){if("number"==typeof n.displayWidth&&n.displayWidth>0)return n.displayWidth;if("number"==typeof n.width&&n.width>0)return n.width;var e=r;if("number"==typeof e.displayWidth&&e.displayWidth>0)return e.displayWidth;if("number"==typeof e.width&&e.width>0)return"number"==typeof e.scale&&e.scale>0?e.width/e.scale:e.width;for(var i=0,o=0,g=e.list;o<g.length;o++){var c=g[o],u=a(c);i=Math.max(i,u)}return i}if("number"==typeof n.displayWidth)return n.displayWidth;if("number"==typeof n.width)return n.width;var s=null===(t=n.getBounds)||void 0===t?void 0:t.call(n);return s?s.width:0},g=function(r){var t,n=r;if(r&&"object"==typeof r&&"list"in r&&Array.isArray(r.list)){if("number"==typeof n.displayHeight&&n.displayHeight>0)return n.displayHeight;if("number"==typeof n.height&&n.height>0)return n.height;var e=r;if("number"==typeof e.displayHeight&&e.displayHeight>0)return e.displayHeight;if("number"==typeof e.height&&e.height>0)return"number"==typeof e.scale&&e.scale>0?e.height/e.scale:e.height;for(var i=0,o=0,a=e.list;o<a.length;o++){var c=a[o],u=g(c);i=Math.max(i,u)}return i}if("number"==typeof n.displayHeight)return n.displayHeight;if("number"==typeof n.height)return n.height;var s=null===(t=n.getBounds)||void 0===t?void 0:t.call(n);return s?s.height:0},c=function(r){var t=a(r),n=g(r),e=r,i="number"==typeof e.originX?e.originX:void 0,o="number"==typeof e.originY?e.originY:void 0;return void 0===i&&"number"==typeof e.displayOriginX&&t>0&&(i=e.displayOriginX/t),void 0===o&&"number"==typeof e.displayOriginY&&n>0&&(o=e.displayOriginY/n),{x:null!=i?i:.5,y:null!=o?o:.5}},u=function(r){function t(t){var n=t.scene,e=t.x,i=t.y,o=t.gap,a=void 0===o?8:o,g=t.align,c=void 0===g?"center":g,u=t.children,s=void 0===u?[]:u,l=t.verticalOrigin,f=void 0===l?"center":l,b=r.call(this,n,e,i)||this;return b.gap=a,b.align=c,b.verticalOrigin=f,s.length>0&&b.add(s),b.layout(),b}return e(t,r),t.prototype.setGap=function(r){this.gap=r,this.layout()},t.prototype.setAlign=function(r){this.align=r,this.layout()},t.prototype.addChild=function(r,t){return void 0===t&&(t=!0),this.add(r),t&&this.layout(),this},t.prototype.addChildren=function(r,t){return void 0===t&&(t=!0),r.length>0&&this.add(r),t&&this.layout(),this},t.prototype.layout=function(){var r=this,t=this.list;if(0!==t.length){for(var n=t.map(function(t){return{child:t,width:r.getDisplayWidth(t),height:r.getDisplayHeight(t),origin:r.getNormalizedOrigin(t)}}),e=n.reduce(function(r,t){return Math.max(r,t.width)},0),i=n.reduce(function(r,t){return r+t.height},0)+this.gap*(n.length-1),o="top"===this.verticalOrigin?0:"center"===this.verticalOrigin?-i/2:-i,a=0,g=n;a<g.length;a++){var c=g[a],u=c.child,s=c.width,l=c.height,f=c.origin,b=0;b="left"===this.align?-e/2+f.x*s:"right"===this.align?e/2-(1-f.x)*s:(f.x-.5)*s;var h=o+f.y*l;u.setPosition(b,h),o+=l+this.gap}this.setSize(e,i)}else this.setSize(0,0)},t.prototype.getDisplayWidth=function(r){return a(r)},t.prototype.getDisplayHeight=function(r){return g(r)},t.prototype.getNormalizedOrigin=function(r){return c(r)},t}(t.GameObjects.Container),s=function(r){function t(t){var n=t.scene,e=t.x,i=t.y,o=t.gap,a=void 0===o?8:o,g=t.align,c=void 0===g?"center":g,u=t.children,s=void 0===u?[]:u,l=t.horizontalOrigin,f=void 0===l?"center":l,b=r.call(this,n,e,i)||this;return b.gap=a,b.align=c,b.horizontalOrigin=f,s.length>0&&b.add(s),b.layout(),b}return e(t,r),t.prototype.setGap=function(r){this.gap=r,this.layout()},t.prototype.setAlign=function(r){this.align=r,this.layout()},t.prototype.addChild=function(r,t){return void 0===t&&(t=!0),this.add(r),t&&this.layout(),this},t.prototype.addChildren=function(r,t){return void 0===t&&(t=!0),r.length>0&&this.add(r),t&&this.layout(),this},t.prototype.layout=function(){var r=this,t=this.list;if(0!==t.length){for(var n=t.map(function(t){return{child:t,width:r.getDisplayWidth(t),height:r.getDisplayHeight(t),origin:r.getNormalizedOrigin(t)}}),e=n.reduce(function(r,t){return Math.max(r,t.height)},0),i=n.reduce(function(r,t){return r+t.width},0)+this.gap*(n.length-1),o="left"===this.horizontalOrigin?0:"center"===this.horizontalOrigin?-i/2:-i,a=0,g=n;a<g.length;a++){var c=g[a],u=c.child,s=c.width,l=c.height,f=c.origin,b=0;b="top"===this.align?-e/2+f.y*l:"bottom"===this.align?e/2-(1-f.y)*l:(f.y-.5)*l;var h=o+f.x*s;u.setPosition(h,b),o+=s+this.gap}this.setSize(i,e)}else this.setSize(0,0)},t.prototype.getDisplayWidth=function(r){return a(r)},t.prototype.getDisplayHeight=function(r){return g(r)},t.prototype.getNormalizedOrigin=function(r){return c(r)},t}(t.GameObjects.Container),l=function(r){return null!==r&&"object"==typeof r&&!Array.isArray(r)&&"[object Object]"===Object.prototype.toString.call(r)},f=function(r){if(null===r||"object"!=typeof r)return r;if(Array.isArray(r))return r.map(function(r){return f(r)});if(l(r)){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=f(r[n]));return t}return r},b=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!l(r))return r;for(var e=f(r),i=0,o=t;i<o.length;i++){var a=o[i];if(l(a)){var g=f(a);for(var c in g)if(Object.prototype.hasOwnProperty.call(g,c)){var u=g[c],s=e[c];l(u)&&l(s)?e[c]=b(s,u):void 0!==u&&(e[c]=u)}}}return e},h=function(r){if("string"!=typeof r)return!1;var t=r.trim();return!!/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(t)||(!!/^rgb\(\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)$/.test(t)||(!!/^rgba\(\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*([01]|0?\.\d+)\s*\)$/.test(t)||!!/^oklch\(\s*(\d*\.?\d+%?)\s+(\d*\.?\d+)\s+(\d*\.?\d+)(?:\s*\/\s*([01]|0?\.\d+))?\s*\)$/.test(t)))},p={black:"#000",white:"#fff",slate:{50:"rgb(248, 250, 252)",100:"rgb(241, 245, 249)",200:"rgb(226, 232, 240)",300:"rgb(203, 213, 225)",400:"rgb(148, 163, 184)",500:"rgb(100, 116, 139)",600:"rgb(71, 85, 105)",700:"rgb(51, 65, 85)",800:"rgb(30, 41, 59)",900:"rgb(15, 23, 42)",950:"rgb(2, 6, 23)"},gray:{50:"rgb(249, 250, 251)",100:"rgb(243, 244, 246)",200:"rgb(229, 231, 235)",300:"rgb(209, 213, 219)",400:"rgb(156, 163, 175)",500:"rgb(107, 114, 128)",600:"rgb(75, 85, 99)",700:"rgb(55, 65, 81)",800:"rgb(31, 41, 55)",900:"rgb(17, 24, 39)",950:"rgb(3, 7, 18)"},zinc:{50:"rgb(250, 250, 250)",100:"rgb(244, 244, 245)",200:"rgb(228, 228, 231)",300:"rgb(212, 212, 216)",400:"rgb(161, 161, 170)",500:"rgb(113, 113, 122)",600:"rgb(82, 82, 91)",700:"rgb(63, 63, 70)",800:"rgb(39, 39, 42)",900:"rgb(24, 24, 27)",950:"rgb(9, 9, 11)"},neutral:{50:"rgb(250, 250, 250)",100:"rgb(245, 245, 245)",200:"rgb(229, 229, 229)",300:"rgb(212, 212, 212)",400:"rgb(163, 163, 163)",500:"rgb(115, 115, 115)",600:"rgb(82, 82, 82)",700:"rgb(64, 64, 64)",800:"rgb(38, 38, 38)",900:"rgb(23, 23, 23)",950:"rgb(10, 10, 10)"},stone:{50:"rgb(250, 250, 249)",100:"rgb(245, 245, 244)",200:"rgb(231, 229, 228)",300:"rgb(214, 211, 209)",400:"rgb(168, 162, 158)",500:"rgb(120, 113, 108)",600:"rgb(87, 83, 78)",700:"rgb(68, 64, 60)",800:"rgb(41, 37, 36)",900:"rgb(28, 25, 23)",950:"rgb(12, 10, 9)"},red:{50:"rgb(254, 242, 242)",100:"rgb(254, 226, 226)",200:"rgb(254, 202, 202)",300:"rgb(252, 165, 165)",400:"rgb(248, 113, 113)",500:"rgb(239, 68, 68)",600:"rgb(220, 38, 38)",700:"rgb(185, 28, 28)",800:"rgb(153, 27, 27)",900:"rgb(127, 29, 29)",950:"rgb(69, 10, 10)"},orange:{50:"rgb(255, 247, 237)",100:"rgb(255, 237, 213)",200:"rgb(254, 215, 170)",300:"rgb(253, 186, 116)",400:"rgb(251, 146, 60)",500:"rgb(249, 115, 22)",600:"rgb(234, 88, 12)",700:"rgb(194, 65, 12)",800:"rgb(154, 52, 18)",900:"rgb(124, 45, 18)",950:"rgb(67, 20, 7)"},amber:{50:"rgb(255, 251, 235)",100:"rgb(254, 243, 199)",200:"rgb(253, 230, 138)",300:"rgb(252, 211, 77)",400:"rgb(251, 191, 36)",500:"rgb(245, 158, 11)",600:"rgb(217, 119, 6)",700:"rgb(180, 83, 9)",800:"rgb(146, 64, 14)",900:"rgb(120, 53, 15)",950:"rgb(69, 26, 3)"},yellow:{50:"rgb(254, 252, 232)",100:"rgb(254, 249, 195)",200:"rgb(254, 240, 138)",300:"rgb(253, 224, 71)",400:"rgb(250, 204, 21)",500:"rgb(234, 179, 8)",600:"rgb(202, 138, 4)",700:"rgb(161, 98, 7)",800:"rgb(133, 77, 14)",900:"rgb(113, 63, 18)",950:"rgb(66, 32, 6)"},lime:{50:"rgb(247, 254, 231)",100:"rgb(236, 252, 203)",200:"rgb(217, 249, 157)",300:"rgb(190, 242, 100)",400:"rgb(163, 230, 53)",500:"rgb(132, 204, 22)",600:"rgb(101, 163, 13)",700:"rgb(77, 124, 15)",800:"rgb(63, 98, 18)",900:"rgb(54, 83, 20)",950:"rgb(26, 46, 5)"},green:{50:"rgb(240, 253, 244)",100:"rgb(220, 252, 231)",200:"rgb(187, 247, 208)",300:"rgb(134, 239, 172)",400:"rgb(74, 222, 128)",500:"rgb(34, 197, 94)",600:"rgb(22, 163, 74)",700:"rgb(21, 128, 61)",800:"rgb(22, 101, 52)",900:"rgb(20, 83, 45)",950:"rgb(5, 46, 22)"},emerald:{50:"rgb(236, 253, 245)",100:"rgb(209, 250, 229)",200:"rgb(167, 243, 208)",300:"rgb(110, 231, 183)",400:"rgb(52, 211, 153)",500:"rgb(16, 185, 129)",600:"rgb(5, 150, 105)",700:"rgb(4, 120, 87)",800:"rgb(6, 95, 70)",900:"rgb(6, 78, 59)",950:"rgb(2, 44, 34)"},teal:{50:"rgb(240, 253, 250)",100:"rgb(204, 251, 241)",200:"rgb(153, 246, 228)",300:"rgb(94, 234, 212)",400:"rgb(45, 212, 191)",500:"rgb(20, 184, 166)",600:"rgb(13, 148, 136)",700:"rgb(15, 118, 110)",800:"rgb(17, 94, 89)",900:"rgb(19, 78, 74)",950:"rgb(4, 47, 46)"},cyan:{50:"rgb(236, 254, 255)",100:"rgb(207, 250, 254)",200:"rgb(165, 243, 252)",300:"rgb(103, 232, 249)",400:"rgb(34, 211, 238)",500:"rgb(6, 182, 212)",600:"rgb(8, 145, 178)",700:"rgb(14, 116, 144)",800:"rgb(21, 94, 117)",900:"rgb(22, 78, 99)",950:"rgb(8, 51, 68)"},sky:{50:"rgb(240, 249, 255)",100:"rgb(224, 242, 254)",200:"rgb(186, 230, 253)",300:"rgb(125, 211, 252)",400:"rgb(56, 189, 248)",500:"rgb(14, 165, 233)",600:"rgb(2, 132, 199)",700:"rgb(3, 105, 161)",800:"rgb(7, 89, 133)",900:"rgb(12, 74, 110)",950:"rgb(8, 47, 73)"},blue:{50:"rgb(239, 246, 255)",100:"rgb(219, 234, 254)",200:"rgb(191, 219, 254)",300:"rgb(147, 197, 253)",400:"rgb(96, 165, 250)",500:"rgb(59, 130, 246)",600:"rgb(37, 99, 235)",700:"rgb(29, 78, 216)",800:"rgb(30, 64, 175)",900:"rgb(30, 58, 138)",950:"rgb(23, 37, 84)"},indigo:{50:"rgb(238, 242, 255)",100:"rgb(224, 231, 255)",200:"rgb(199, 210, 254)",300:"rgb(165, 180, 252)",400:"rgb(129, 140, 248)",500:"rgb(99, 102, 241)",600:"rgb(79, 70, 229)",700:"rgb(67, 56, 202)",800:"rgb(55, 48, 163)",900:"rgb(49, 46, 129)",950:"rgb(30, 27, 75)"},violet:{50:"rgb(245, 243, 255)",100:"rgb(237, 233, 254)",200:"rgb(221, 214, 254)",300:"rgb(196, 181, 253)",400:"rgb(167, 139, 250)",500:"rgb(139, 92, 246)",600:"rgb(124, 58, 237)",700:"rgb(109, 40, 217)",800:"rgb(91, 33, 182)",900:"rgb(76, 29, 149)",950:"rgb(46, 16, 101)"},purple:{50:"rgb(250, 245, 255)",100:"rgb(243, 232, 255)",200:"rgb(233, 213, 255)",300:"rgb(216, 180, 254)",400:"rgb(192, 132, 252)",500:"rgb(168, 85, 247)",600:"rgb(147, 51, 234)",700:"rgb(126, 34, 206)",800:"rgb(107, 33, 168)",900:"rgb(88, 28, 135)",950:"rgb(59, 7, 100)"},fuchsia:{50:"rgb(253, 244, 255)",100:"rgb(250, 232, 255)",200:"rgb(245, 208, 254)",300:"rgb(240, 171, 252)",400:"rgb(232, 121, 249)",500:"rgb(217, 70, 239)",600:"rgb(192, 38, 211)",700:"rgb(162, 28, 175)",800:"rgb(134, 25, 143)",900:"rgb(112, 26, 117)",950:"rgb(74, 4, 78)"},pink:{50:"rgb(253, 242, 248)",100:"rgb(252, 231, 243)",200:"rgb(251, 207, 232)",300:"rgb(249, 168, 212)",400:"rgb(244, 114, 182)",500:"rgb(236, 72, 153)",600:"rgb(219, 39, 119)",700:"rgb(190, 24, 93)",800:"rgb(157, 23, 77)",900:"rgb(131, 24, 67)",950:"rgb(80, 7, 36)"},rose:{50:"rgb(255, 241, 242)",100:"rgb(255, 228, 230)",200:"rgb(254, 205, 211)",300:"rgb(253, 164, 175)",400:"rgb(251, 113, 133)",500:"rgb(244, 63, 94)",600:"rgb(225, 29, 72)",700:"rgb(190, 18, 60)",800:"rgb(159, 18, 57)",900:"rgb(136, 19, 55)",950:"rgb(76, 5, 25)"}},d=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/,y=function(r){return r.startsWith("#")?3===(t=r.slice(1)).length?(parseInt(t[0]+t[0],16)<<16)+(parseInt(t[1]+t[1],16)<<8)+parseInt(t[2]+t[2],16):parseInt(t,16):function(r){var t=r.match(d);if(!t)throw new Error("Invalid RGB format: ".concat(r));return(parseInt(t[1])<<16)+(parseInt(t[2])<<8)+parseInt(t[3])}(r);var t},m=function(r){var t=function(t){return r&&t in r?r[t]:null},n=function(r){return"string"==typeof r&&!String(r).includes("-")&&r in p&&"black"!==r&&"white"!==r?"".concat(r,"-500"):r},e=function(r){var i,o;if("string"==typeof r&&h(r))return r;var a=t(r);if(a)return e(a);var g=n(r),c=null!==(i=null==g?void 0:g.split("-"))&&void 0!==i?i:[];if(2===c.length){var u=c[0],s=c[1],l=null===(o=p[u])||void 0===o?void 0:o[s];if(!l){if(h(g))return g;throw new Error('Color token "'.concat(u,"-").concat(s,'" not found'))}return l}var f=p[g];if(!f){if(h(g))return g;throw new Error('Color token "'.concat(g,'" not found'))}return f},i=function(r){var e,o;if("string"==typeof r&&h(r))return y(r);var a=t(r);if(a)return i(a);var g=n(r),c=null!==(e=null==g?void 0:g.split("-"))&&void 0!==e?e:[];if(2===c.length){var u=c[0],s=c[1],l=null===(o=p[u])||void 0===o?void 0:o[s];if(!l){if(h(g))return y(g);throw new Error('Color token "'.concat(u,"-").concat(s,'" not found'))}return y(l)}var f=p[g];if(h(f))return y(f);throw new Error('Color token "'.concat(g,'" not found'))};return{rgb:e,hex:i,isValidColorToken:function(r){if("black"===r||"white"===r)return!0;var t=r.split("-");if(2===t.length){var n=t[0],e=t[1];return n in p&&e in p[n]}return!1},black:function(){return e("black")},white:function(){return e("white")},slate:function(r){return e("slate-".concat(r))},gray:function(r){return e("gray-".concat(r))},zinc:function(r){return e("zinc-".concat(r))},neutral:function(r){return e("neutral-".concat(r))},stone:function(r){return e("stone-".concat(r))},red:function(r){return e("red-".concat(r))},orange:function(r){return e("orange-".concat(r))},amber:function(r){return e("amber-".concat(r))},yellow:function(r){return e("yellow-".concat(r))},lime:function(r){return e("lime-".concat(r))},green:function(r){return e("green-".concat(r))},emerald:function(r){return e("emerald-".concat(r))},teal:function(r){return e("teal-".concat(r))},cyan:function(r){return e("cyan-".concat(r))},sky:function(r){return e("sky-".concat(r))},blue:function(r){return e("blue-".concat(r))},indigo:function(r){return e("indigo-".concat(r))},violet:function(r){return e("violet-".concat(r))},purple:function(r){return e("purple-".concat(r))},fuchsia:function(r){return e("fuchsia-".concat(r))},pink:function(r){return e("pink-".concat(r))},rose:function(r){return e("rose-".concat(r))},blackHex:function(){return i("black")},whiteHex:function(){return i("white")},slateHex:function(r){return i("slate-".concat(r))},grayHex:function(r){return i("gray-".concat(r))},zincHex:function(r){return i("zinc-".concat(r))},neutralHex:function(r){return i("neutral-".concat(r))},stoneHex:function(r){return i("stone-".concat(r))},redHex:function(r){return i("red-".concat(r))},orangeHex:function(r){return i("orange-".concat(r))},amberHex:function(r){return i("amber-".concat(r))},yellowHex:function(r){return i("yellow-".concat(r))},limeHex:function(r){return i("lime-".concat(r))},greenHex:function(r){return i("green-".concat(r))},emeraldHex:function(r){return i("emerald-".concat(r))},tealHex:function(r){return i("teal-".concat(r))},cyanHex:function(r){return i("cyan-".concat(r))},skyHex:function(r){return i("sky-".concat(r))},blueHex:function(r){return i("blue-".concat(r))},indigoHex:function(r){return i("indigo-".concat(r))},violetHex:function(r){return i("violet-".concat(r))},purpleHex:function(r){return i("purple-".concat(r))},fuchsiaHex:function(r){return i("fuchsia-".concat(r))},pinkHex:function(r){return i("pink-".concat(r))},roseHex:function(r){return i("rose-".concat(r))}}},v=m({}),w={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},x=function(r){var t=i(i({},w),r);return{px:function(r){var n=t[r];return"number"==typeof n?n:0},rem:function(r){var n=t[r];return"number"==typeof n?n/16:0},css:function(r){var n=t[r];return"number"==typeof n?"".concat(n,"px"):"0px"}}},H=x(void 0),O={primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},z=function(r,t){var n=i(i({},O),r),e=x(t),a=function(r){if(r.includes(".")){var t=r.split(".")[1];if(t&&"string"==typeof n[t])return n[t]}return"string"==typeof n[r]?n[r]:r};return{size:function(r){var t;return null!==(t=e.px(r))&&void 0!==t?t:0},format:function(r){var t,n=r.size,i=r.family,o=null!==(t=e.px(n))&&void 0!==t?t:0;return"".concat(o,"px '").concat(a(i),"'")},family:function(r){return a(r)},getAvailableFonts:function(){return Array.from(new Set(o(o([],Object.keys(O),!0),Object.keys(n),!0)))}}},S={none:0,sm:2,default:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999},k=function(r){var t=i(i({},S),r),n=function(r){return"number"==typeof t[r]?t[r]:0};return{px:function(r){return n(r)},rem:function(r){return n(r)/16},css:function(r){return"".concat(n(r),"px")}}},I=k(void 0),W={sm:{blur:2,offsetX:1,offsetY:1,alpha:.15},md:{blur:4,offsetX:2,offsetY:2,alpha:.2},lg:{blur:6,offsetX:4,offsetY:4,alpha:.25},xl:{blur:8,offsetX:6,offsetY:6,alpha:.3},"2xl":{blur:12,offsetX:8,offsetY:8,alpha:.35},inner:{blur:4,offsetX:-2,offsetY:-2,alpha:.2}},j=function(r){var t=i(i({},W),r);return{get:function(r){return function(r){var n=t[r];return n&&"object"==typeof n?n:W.md}(r)}}},P=j(void 0),A={0:0,px:1,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},C=function(r){var t=i(i({},A),r),n=function(r){return"number"==typeof t[r]?t[r]:0};return{px:function(r){return n(r)},rem:function(r){return n(r)/16},css:function(r){return"".concat(n(r),"px")}}},F=C(void 0),Y={fonts:{primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},fontSizes:i({},w),colors:{primary:"blue-600",secondary:"gray-600",success:"green-500",warning:"yellow-500",error:"red-500",info:"blue-400",background:"white",text:"gray-900",shadow:"black",overlay:"black"},spacing:i({},A),typography:{heading:{fontSize:"2xl",fontFamily:"fonts.display",fontWeight:600,lineHeight:1.2},"heading-large":{fontSize:"4xl",fontFamily:"fonts.display",fontWeight:700,lineHeight:1.1},body:{fontSize:"base",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.5},caption:{fontSize:"sm",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.4}},effects:{"shadow-sm":{blur:2,offsetY:1,color:"colors.shadow",alpha:.05},"shadow-md":{blur:4,offsetY:2,color:"colors.shadow",alpha:.1},"shadow-lg":{blur:8,offsetY:4,color:"colors.shadow",alpha:.1}},custom:{}},D={fonts:{primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},fontSizes:i({},w),radius:i({},S),colors:{primary:"blue-400",secondary:"gray-400",success:"green-400",warning:"yellow-400",error:"red-400",info:"blue-300",background:"gray-900",text:"white",shadow:"black",overlay:"black"},spacing:i({},A),typography:{heading:{fontSize:"2xl",fontFamily:"fonts.display",fontWeight:600,lineHeight:1.2},"heading-large":{fontSize:"4xl",fontFamily:"fonts.display",fontWeight:700,lineHeight:1.1},body:{fontSize:"base",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.5},caption:{fontSize:"sm",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.4}},effects:{"shadow-sm":{blur:2,offsetY:1,color:"colors.shadow",alpha:.1},"shadow-md":{blur:4,offsetY:2,color:"colors.shadow",alpha:.15},"shadow-lg":{blur:8,offsetY:4,color:"colors.shadow",alpha:.2}},custom:{}},E=function(r){function t(t){var n=r.call(this,t)||this;return n.colorInstance=null,n.fontSizeInstance=null,n.spacingInstance=null,n.radiusInstance=null,n.fontInstance=null,n.shadowInstance=null,n.theme=Y,n}return e(t,r),t.prototype.init=function(r){var t=r.theme,n=r.darkMode,e=void 0!==n&&n;t?(this.theme=t,this.colorInstance=m(this.theme.colors),this.fontSizeInstance=x(this.theme.fontSizes),this.spacingInstance=C(this.theme.spacing),this.radiusInstance=k(this.theme.radius),this.fontInstance=z(this.theme.fonts,this.theme.fontSizes),this.shadowInstance=j(this.theme.effects)):this.theme=e?D:Y},t.prototype.getTheme=function(){return this.theme},Object.defineProperty(t.prototype,"color",{get:function(){return this.colorInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.fontSizeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){return this.spacingInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.radiusInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.fontInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadow",{get:function(){return this.shadowInstance},enumerable:!1,configurable:!0}),t}(t.Plugins.BasePlugin),_=function(r){function t(t){return r.call(this,t)||this}return e(t,r),t}(Phaser.Scene);r.Color=v,r.Column=u,r.DEFAULT_GAP=8,r.FontSize=H,r.PHASER_WIND_KEY="pw",r.PhaserWindPlugin=E,r.Radius=I,r.Row=s,r.SceneWithPhaserWind=_,r.Shadow=P,r.Spacing=F,r.createColor=m,r.createFont=z,r.createFontSize=x,r.createRadius=k,r.createShadow=j,r.createSpacing=C,r.createTheme=function(r){return b({},Y,r)},r.defaultDarkTheme=D,r.defaultLightTheme=Y,r.defaultShadowMap=W,r.fontMap=O,r.fontSizeMap=w,r.getDisplayHeightOf=g,r.getDisplayWidthOf=a,r.getNormalizedOriginOf=c,r.isValidColor=h,r.merge=b,r.mergeDeep=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return b.apply(void 0,o([{},r],t,!1))},r.palette=p,r.radiusMap=S,r.spacingMap=A});
|
|
1
|
+
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("phaser")):"function"==typeof define&&define.amd?define(["exports","phaser"],t):t((r="undefined"!=typeof globalThis?globalThis:r||self).PhaserWind={},r.Phaser)}(this,function(r,t){"use strict";var n=function(r,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])},n(r,t)};function e(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}n(r,t),r.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}var i=function(){return i=Object.assign||function(r){for(var t,n=1,e=arguments.length;n<e;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i]);return r},i.apply(this,arguments)};function o(r,t,n){if(n||2===arguments.length)for(var e,i=0,o=t.length;i<o;i++)!e&&i in t||(e||(e=Array.prototype.slice.call(t,0,i)),e[i]=t[i]);return r.concat(e||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var a=function(r){var t,n=r;if(r&&"object"==typeof r&&"list"in r&&Array.isArray(r.list)){if("number"==typeof n.displayWidth&&n.displayWidth>0)return n.displayWidth;if("number"==typeof n.width&&n.width>0)return n.width;var e=r;if("number"==typeof e.displayWidth&&e.displayWidth>0)return e.displayWidth;if("number"==typeof e.width&&e.width>0)return"number"==typeof e.scale&&e.scale>0?e.width/e.scale:e.width;for(var i=0,o=0,c=e.list;o<c.length;o++){var u=c[o],g=a(u);i=Math.max(i,g)}return i}if("number"==typeof n.displayWidth)return n.displayWidth;if("number"==typeof n.width)return n.width;var s=null===(t=n.getBounds)||void 0===t?void 0:t.call(n);return s?s.width:0},c=function(r){var t,n=r;if(r&&"object"==typeof r&&"list"in r&&Array.isArray(r.list)){if("number"==typeof n.displayHeight&&n.displayHeight>0)return n.displayHeight;if("number"==typeof n.height&&n.height>0)return n.height;var e=r;if("number"==typeof e.displayHeight&&e.displayHeight>0)return e.displayHeight;if("number"==typeof e.height&&e.height>0)return"number"==typeof e.scale&&e.scale>0?e.height/e.scale:e.height;for(var i=0,o=0,a=e.list;o<a.length;o++){var u=a[o],g=c(u);i=Math.max(i,g)}return i}if("number"==typeof n.displayHeight)return n.displayHeight;if("number"==typeof n.height)return n.height;var s=null===(t=n.getBounds)||void 0===t?void 0:t.call(n);return s?s.height:0},u=function(r){var t=a(r),n=c(r),e=r,i="number"==typeof e.originX?e.originX:void 0,o="number"==typeof e.originY?e.originY:void 0;return void 0===i&&"number"==typeof e.displayOriginX&&t>0&&(i=e.displayOriginX/t),void 0===o&&"number"==typeof e.displayOriginY&&n>0&&(o=e.displayOriginY/n),{x:null!=i?i:.5,y:null!=o?o:.5}},g=function(r){function t(t){var n=t.scene,e=t.x,i=t.y,o=t.gap,a=void 0===o?8:o,c=t.align,u=void 0===c?"center":c,g=t.children,s=void 0===g?[]:g,l=t.verticalOrigin,f=void 0===l?"center":l,b=r.call(this,n,e,i)||this;return b.gap=a,b.align=u,b.verticalOrigin=f,s.length>0&&b.add(s),b.layout(),b}return e(t,r),t.prototype.setGap=function(r){this.gap=r,this.layout()},t.prototype.setAlign=function(r){this.align=r,this.layout()},t.prototype.addChild=function(r,t){return void 0===t&&(t=!0),this.add(r),t&&this.layout(),this},t.prototype.addChildren=function(r,t){return void 0===t&&(t=!0),r.length>0&&this.add(r),t&&this.layout(),this},t.prototype.layout=function(){var r=this,t=this.list;if(0!==t.length){for(var n=t.map(function(t){return{child:t,width:r.getDisplayWidth(t),height:r.getDisplayHeight(t),origin:r.getNormalizedOrigin(t)}}),e=n.reduce(function(r,t){return Math.max(r,t.width)},0),i=n.reduce(function(r,t){return r+t.height},0)+this.gap*(n.length-1),o="top"===this.verticalOrigin?0:"center"===this.verticalOrigin?-i/2:-i,a=0,c=n;a<c.length;a++){var u=c[a],g=u.child,s=u.width,l=u.height,f=u.origin,b=0;b="left"===this.align?-e/2+f.x*s:"right"===this.align?e/2-(1-f.x)*s:(f.x-.5)*s;var h=o+f.y*l;g.setPosition(b,h),o+=l+this.gap}this.setSize(e,i)}else this.setSize(0,0)},t.prototype.getDisplayWidth=function(r){return a(r)},t.prototype.getDisplayHeight=function(r){return c(r)},t.prototype.getNormalizedOrigin=function(r){return u(r)},t}(t.GameObjects.Container),s=function(r){function t(t){var n=t.scene,e=t.x,i=t.y,o=t.gap,a=void 0===o?8:o,c=t.align,u=void 0===c?"center":c,g=t.children,s=void 0===g?[]:g,l=t.horizontalOrigin,f=void 0===l?"center":l,b=r.call(this,n,e,i)||this;return b.gap=a,b.align=u,b.horizontalOrigin=f,s.length>0&&b.add(s),b.layout(),b}return e(t,r),t.prototype.setGap=function(r){this.gap=r,this.layout()},t.prototype.setAlign=function(r){this.align=r,this.layout()},t.prototype.addChild=function(r,t){return void 0===t&&(t=!0),this.add(r),t&&this.layout(),this},t.prototype.addChildren=function(r,t){return void 0===t&&(t=!0),r.length>0&&this.add(r),t&&this.layout(),this},t.prototype.layout=function(){var r=this,t=this.list;if(0!==t.length){for(var n=t.map(function(t){return{child:t,width:r.getDisplayWidth(t),height:r.getDisplayHeight(t),origin:r.getNormalizedOrigin(t)}}),e=n.reduce(function(r,t){return Math.max(r,t.height)},0),i=n.reduce(function(r,t){return r+t.width},0)+this.gap*(n.length-1),o="left"===this.horizontalOrigin?0:"center"===this.horizontalOrigin?-i/2:-i,a=0,c=n;a<c.length;a++){var u=c[a],g=u.child,s=u.width,l=u.height,f=u.origin,b=0;b="top"===this.align?-e/2+f.y*l:"bottom"===this.align?e/2-(1-f.y)*l:(f.y-.5)*l;var h=o+f.x*s;g.setPosition(h,b),o+=s+this.gap}this.setSize(i,e)}else this.setSize(0,0)},t.prototype.getDisplayWidth=function(r){return a(r)},t.prototype.getDisplayHeight=function(r){return c(r)},t.prototype.getNormalizedOrigin=function(r){return u(r)},t}(t.GameObjects.Container),l=function(r){return null!==r&&"object"==typeof r&&!Array.isArray(r)&&"[object Object]"===Object.prototype.toString.call(r)},f=function(r){if(null===r||"object"!=typeof r)return r;if(Array.isArray(r))return r.map(function(r){return f(r)});if(l(r)){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=f(r[n]));return t}return r},b=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!l(r))return r;for(var e=f(r),i=0,o=t;i<o.length;i++){var a=o[i];if(l(a)){var c=f(a);for(var u in c)if(Object.prototype.hasOwnProperty.call(c,u)){var g=c[u],s=e[u];l(g)&&l(s)?e[u]=b(s,g):void 0!==g&&(e[u]=g)}}}return e},h=function(r){if("string"!=typeof r)return!1;var t=r.trim();return!!/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(t)||(!!/^rgb\(\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)$/.test(t)||(!!/^rgba\(\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*([01]|0?\.\d+)\s*\)$/.test(t)||!!/^oklch\(\s*(\d*\.?\d+%?)\s+(\d*\.?\d+)\s+(\d*\.?\d+)(?:\s*\/\s*([01]|0?\.\d+))?\s*\)$/.test(t)))},p={black:"#000",white:"#fff",slate:{50:"rgb(248, 250, 252)",100:"rgb(241, 245, 249)",200:"rgb(226, 232, 240)",300:"rgb(203, 213, 225)",400:"rgb(148, 163, 184)",500:"rgb(100, 116, 139)",600:"rgb(71, 85, 105)",700:"rgb(51, 65, 85)",800:"rgb(30, 41, 59)",900:"rgb(15, 23, 42)",950:"rgb(2, 6, 23)"},gray:{50:"rgb(249, 250, 251)",100:"rgb(243, 244, 246)",200:"rgb(229, 231, 235)",300:"rgb(209, 213, 219)",400:"rgb(156, 163, 175)",500:"rgb(107, 114, 128)",600:"rgb(75, 85, 99)",700:"rgb(55, 65, 81)",800:"rgb(31, 41, 55)",900:"rgb(17, 24, 39)",950:"rgb(3, 7, 18)"},zinc:{50:"rgb(250, 250, 250)",100:"rgb(244, 244, 245)",200:"rgb(228, 228, 231)",300:"rgb(212, 212, 216)",400:"rgb(161, 161, 170)",500:"rgb(113, 113, 122)",600:"rgb(82, 82, 91)",700:"rgb(63, 63, 70)",800:"rgb(39, 39, 42)",900:"rgb(24, 24, 27)",950:"rgb(9, 9, 11)"},neutral:{50:"rgb(250, 250, 250)",100:"rgb(245, 245, 245)",200:"rgb(229, 229, 229)",300:"rgb(212, 212, 212)",400:"rgb(163, 163, 163)",500:"rgb(115, 115, 115)",600:"rgb(82, 82, 82)",700:"rgb(64, 64, 64)",800:"rgb(38, 38, 38)",900:"rgb(23, 23, 23)",950:"rgb(10, 10, 10)"},stone:{50:"rgb(250, 250, 249)",100:"rgb(245, 245, 244)",200:"rgb(231, 229, 228)",300:"rgb(214, 211, 209)",400:"rgb(168, 162, 158)",500:"rgb(120, 113, 108)",600:"rgb(87, 83, 78)",700:"rgb(68, 64, 60)",800:"rgb(41, 37, 36)",900:"rgb(28, 25, 23)",950:"rgb(12, 10, 9)"},red:{50:"rgb(254, 242, 242)",100:"rgb(254, 226, 226)",200:"rgb(254, 202, 202)",300:"rgb(252, 165, 165)",400:"rgb(248, 113, 113)",500:"rgb(239, 68, 68)",600:"rgb(220, 38, 38)",700:"rgb(185, 28, 28)",800:"rgb(153, 27, 27)",900:"rgb(127, 29, 29)",950:"rgb(69, 10, 10)"},orange:{50:"rgb(255, 247, 237)",100:"rgb(255, 237, 213)",200:"rgb(254, 215, 170)",300:"rgb(253, 186, 116)",400:"rgb(251, 146, 60)",500:"rgb(249, 115, 22)",600:"rgb(234, 88, 12)",700:"rgb(194, 65, 12)",800:"rgb(154, 52, 18)",900:"rgb(124, 45, 18)",950:"rgb(67, 20, 7)"},amber:{50:"rgb(255, 251, 235)",100:"rgb(254, 243, 199)",200:"rgb(253, 230, 138)",300:"rgb(252, 211, 77)",400:"rgb(251, 191, 36)",500:"rgb(245, 158, 11)",600:"rgb(217, 119, 6)",700:"rgb(180, 83, 9)",800:"rgb(146, 64, 14)",900:"rgb(120, 53, 15)",950:"rgb(69, 26, 3)"},yellow:{50:"rgb(254, 252, 232)",100:"rgb(254, 249, 195)",200:"rgb(254, 240, 138)",300:"rgb(253, 224, 71)",400:"rgb(250, 204, 21)",500:"rgb(234, 179, 8)",600:"rgb(202, 138, 4)",700:"rgb(161, 98, 7)",800:"rgb(133, 77, 14)",900:"rgb(113, 63, 18)",950:"rgb(66, 32, 6)"},lime:{50:"rgb(247, 254, 231)",100:"rgb(236, 252, 203)",200:"rgb(217, 249, 157)",300:"rgb(190, 242, 100)",400:"rgb(163, 230, 53)",500:"rgb(132, 204, 22)",600:"rgb(101, 163, 13)",700:"rgb(77, 124, 15)",800:"rgb(63, 98, 18)",900:"rgb(54, 83, 20)",950:"rgb(26, 46, 5)"},green:{50:"rgb(240, 253, 244)",100:"rgb(220, 252, 231)",200:"rgb(187, 247, 208)",300:"rgb(134, 239, 172)",400:"rgb(74, 222, 128)",500:"rgb(34, 197, 94)",600:"rgb(22, 163, 74)",700:"rgb(21, 128, 61)",800:"rgb(22, 101, 52)",900:"rgb(20, 83, 45)",950:"rgb(5, 46, 22)"},emerald:{50:"rgb(236, 253, 245)",100:"rgb(209, 250, 229)",200:"rgb(167, 243, 208)",300:"rgb(110, 231, 183)",400:"rgb(52, 211, 153)",500:"rgb(16, 185, 129)",600:"rgb(5, 150, 105)",700:"rgb(4, 120, 87)",800:"rgb(6, 95, 70)",900:"rgb(6, 78, 59)",950:"rgb(2, 44, 34)"},teal:{50:"rgb(240, 253, 250)",100:"rgb(204, 251, 241)",200:"rgb(153, 246, 228)",300:"rgb(94, 234, 212)",400:"rgb(45, 212, 191)",500:"rgb(20, 184, 166)",600:"rgb(13, 148, 136)",700:"rgb(15, 118, 110)",800:"rgb(17, 94, 89)",900:"rgb(19, 78, 74)",950:"rgb(4, 47, 46)"},cyan:{50:"rgb(236, 254, 255)",100:"rgb(207, 250, 254)",200:"rgb(165, 243, 252)",300:"rgb(103, 232, 249)",400:"rgb(34, 211, 238)",500:"rgb(6, 182, 212)",600:"rgb(8, 145, 178)",700:"rgb(14, 116, 144)",800:"rgb(21, 94, 117)",900:"rgb(22, 78, 99)",950:"rgb(8, 51, 68)"},sky:{50:"rgb(240, 249, 255)",100:"rgb(224, 242, 254)",200:"rgb(186, 230, 253)",300:"rgb(125, 211, 252)",400:"rgb(56, 189, 248)",500:"rgb(14, 165, 233)",600:"rgb(2, 132, 199)",700:"rgb(3, 105, 161)",800:"rgb(7, 89, 133)",900:"rgb(12, 74, 110)",950:"rgb(8, 47, 73)"},blue:{50:"rgb(239, 246, 255)",100:"rgb(219, 234, 254)",200:"rgb(191, 219, 254)",300:"rgb(147, 197, 253)",400:"rgb(96, 165, 250)",500:"rgb(59, 130, 246)",600:"rgb(37, 99, 235)",700:"rgb(29, 78, 216)",800:"rgb(30, 64, 175)",900:"rgb(30, 58, 138)",950:"rgb(23, 37, 84)"},indigo:{50:"rgb(238, 242, 255)",100:"rgb(224, 231, 255)",200:"rgb(199, 210, 254)",300:"rgb(165, 180, 252)",400:"rgb(129, 140, 248)",500:"rgb(99, 102, 241)",600:"rgb(79, 70, 229)",700:"rgb(67, 56, 202)",800:"rgb(55, 48, 163)",900:"rgb(49, 46, 129)",950:"rgb(30, 27, 75)"},violet:{50:"rgb(245, 243, 255)",100:"rgb(237, 233, 254)",200:"rgb(221, 214, 254)",300:"rgb(196, 181, 253)",400:"rgb(167, 139, 250)",500:"rgb(139, 92, 246)",600:"rgb(124, 58, 237)",700:"rgb(109, 40, 217)",800:"rgb(91, 33, 182)",900:"rgb(76, 29, 149)",950:"rgb(46, 16, 101)"},purple:{50:"rgb(250, 245, 255)",100:"rgb(243, 232, 255)",200:"rgb(233, 213, 255)",300:"rgb(216, 180, 254)",400:"rgb(192, 132, 252)",500:"rgb(168, 85, 247)",600:"rgb(147, 51, 234)",700:"rgb(126, 34, 206)",800:"rgb(107, 33, 168)",900:"rgb(88, 28, 135)",950:"rgb(59, 7, 100)"},fuchsia:{50:"rgb(253, 244, 255)",100:"rgb(250, 232, 255)",200:"rgb(245, 208, 254)",300:"rgb(240, 171, 252)",400:"rgb(232, 121, 249)",500:"rgb(217, 70, 239)",600:"rgb(192, 38, 211)",700:"rgb(162, 28, 175)",800:"rgb(134, 25, 143)",900:"rgb(112, 26, 117)",950:"rgb(74, 4, 78)"},pink:{50:"rgb(253, 242, 248)",100:"rgb(252, 231, 243)",200:"rgb(251, 207, 232)",300:"rgb(249, 168, 212)",400:"rgb(244, 114, 182)",500:"rgb(236, 72, 153)",600:"rgb(219, 39, 119)",700:"rgb(190, 24, 93)",800:"rgb(157, 23, 77)",900:"rgb(131, 24, 67)",950:"rgb(80, 7, 36)"},rose:{50:"rgb(255, 241, 242)",100:"rgb(255, 228, 230)",200:"rgb(254, 205, 211)",300:"rgb(253, 164, 175)",400:"rgb(251, 113, 133)",500:"rgb(244, 63, 94)",600:"rgb(225, 29, 72)",700:"rgb(190, 18, 60)",800:"rgb(159, 18, 57)",900:"rgb(136, 19, 55)",950:"rgb(76, 5, 25)"}},d=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/,y=function(r){return r.startsWith("#")?3===(t=r.slice(1)).length?(parseInt(t[0]+t[0],16)<<16)+(parseInt(t[1]+t[1],16)<<8)+parseInt(t[2]+t[2],16):parseInt(t,16):function(r){var t=r.match(d);if(!t)throw new Error("Invalid RGB format: ".concat(r));return(parseInt(t[1])<<16)+(parseInt(t[2])<<8)+parseInt(t[3])}(r);var t},m=function(r){var t=function(t){return r&&t in r?r[t]:null},n=function(r){return"string"==typeof r&&!String(r).includes("-")&&r in p&&"black"!==r&&"white"!==r?"".concat(r,"-500"):r},e=function(r){var i,o;if("string"==typeof r&&h(r))return r;var a=t(r);if(a)return e(a);var c=n(r),u=null!==(i=null==c?void 0:c.split("-"))&&void 0!==i?i:[];if(2===u.length){var g=u[0],s=u[1],l=null===(o=p[g])||void 0===o?void 0:o[s];if(!l){if(h(c))return c;throw new Error('Color token "'.concat(g,"-").concat(s,'" not found'))}return l}var f=p[c];if(!f){if(h(c))return c;throw new Error('Color token "'.concat(c,'" not found'))}return f},i=function(r){var e,o;if("string"==typeof r&&h(r))return y(r);var a=t(r);if(a)return i(a);var c=n(r),u=null!==(e=null==c?void 0:c.split("-"))&&void 0!==e?e:[];if(2===u.length){var g=u[0],s=u[1],l=null===(o=p[g])||void 0===o?void 0:o[s];if(!l){if(h(c))return y(c);throw new Error('Color token "'.concat(g,"-").concat(s,'" not found'))}return y(l)}var f=p[c];if(h(f))return y(f);throw new Error('Color token "'.concat(c,'" not found'))};return{rgb:e,hex:i,isValidColorToken:function(r){if("black"===r||"white"===r)return!0;var t=r.split("-");if(2===t.length){var n=t[0],e=t[1];return n in p&&e in p[n]}return!1},black:function(){return e("black")},white:function(){return e("white")},slate:function(r){return e("slate-".concat(r))},gray:function(r){return e("gray-".concat(r))},zinc:function(r){return e("zinc-".concat(r))},neutral:function(r){return e("neutral-".concat(r))},stone:function(r){return e("stone-".concat(r))},red:function(r){return e("red-".concat(r))},orange:function(r){return e("orange-".concat(r))},amber:function(r){return e("amber-".concat(r))},yellow:function(r){return e("yellow-".concat(r))},lime:function(r){return e("lime-".concat(r))},green:function(r){return e("green-".concat(r))},emerald:function(r){return e("emerald-".concat(r))},teal:function(r){return e("teal-".concat(r))},cyan:function(r){return e("cyan-".concat(r))},sky:function(r){return e("sky-".concat(r))},blue:function(r){return e("blue-".concat(r))},indigo:function(r){return e("indigo-".concat(r))},violet:function(r){return e("violet-".concat(r))},purple:function(r){return e("purple-".concat(r))},fuchsia:function(r){return e("fuchsia-".concat(r))},pink:function(r){return e("pink-".concat(r))},rose:function(r){return e("rose-".concat(r))},blackHex:function(){return i("black")},whiteHex:function(){return i("white")},slateHex:function(r){return i("slate-".concat(r))},grayHex:function(r){return i("gray-".concat(r))},zincHex:function(r){return i("zinc-".concat(r))},neutralHex:function(r){return i("neutral-".concat(r))},stoneHex:function(r){return i("stone-".concat(r))},redHex:function(r){return i("red-".concat(r))},orangeHex:function(r){return i("orange-".concat(r))},amberHex:function(r){return i("amber-".concat(r))},yellowHex:function(r){return i("yellow-".concat(r))},limeHex:function(r){return i("lime-".concat(r))},greenHex:function(r){return i("green-".concat(r))},emeraldHex:function(r){return i("emerald-".concat(r))},tealHex:function(r){return i("teal-".concat(r))},cyanHex:function(r){return i("cyan-".concat(r))},skyHex:function(r){return i("sky-".concat(r))},blueHex:function(r){return i("blue-".concat(r))},indigoHex:function(r){return i("indigo-".concat(r))},violetHex:function(r){return i("violet-".concat(r))},purpleHex:function(r){return i("purple-".concat(r))},fuchsiaHex:function(r){return i("fuchsia-".concat(r))},pinkHex:function(r){return i("pink-".concat(r))},roseHex:function(r){return i("rose-".concat(r))}}},v=m({}),w={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},x=function(r){var t=i(i({},w),r);return{px:function(r){var n=t[r];return"number"==typeof n?n:0},rem:function(r){var n=t[r];return"number"==typeof n?n/16:0},css:function(r){var n=t[r];return"number"==typeof n?"".concat(n,"px"):"0px"}}},O=x(void 0),H={primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},z=function(r,t){var n=i(i({},H),r),e=x(t),a=function(r){if(r.includes(".")){var t=r.split(".")[1];if(t&&"string"==typeof n[t])return n[t]}return"string"==typeof n[r]?n[r]:r};return{size:function(r){var t;return null!==(t=e.px(r))&&void 0!==t?t:0},format:function(r){var t,n=r.size,i=r.family,o=null!==(t=e.px(n))&&void 0!==t?t:0;return"".concat(o,"px '").concat(a(i),"'")},family:function(r){return a(r)},getAvailableFonts:function(){return Array.from(new Set(o(o([],Object.keys(H),!0),Object.keys(n),!0)))}}},S={0:0,5:.05,10:.1,15:.15,20:.2,25:.25,30:.3,35:.35,40:.4,45:.45,50:.5,55:.55,60:.6,65:.65,70:.7,75:.75,80:.8,85:.85,90:.9,95:.95,100:1},I=function(r){var t=i(i({},S),r),n=function(r){return"number"==typeof t[r]?t[r]:0};return{value:function(r){return n(r)},percent:function(r){return 100*n(r)},css:function(r){return"".concat(100*n(r),"%")}}},k=I(void 0),P={none:0,sm:2,default:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999},W=function(r){var t=i(i({},P),r),n=function(r){return"number"==typeof t[r]?t[r]:0};return{px:function(r){return n(r)},rem:function(r){return n(r)/16},css:function(r){return"".concat(n(r),"px")}}},j=W(void 0),A={sm:{blur:2,offsetX:1,offsetY:1,alpha:.15},md:{blur:4,offsetX:2,offsetY:2,alpha:.2},lg:{blur:6,offsetX:4,offsetY:4,alpha:.25},xl:{blur:8,offsetX:6,offsetY:6,alpha:.3},"2xl":{blur:12,offsetX:8,offsetY:8,alpha:.35},inner:{blur:4,offsetX:-2,offsetY:-2,alpha:.2}},C=function(r){var t=i(i({},A),r);return{get:function(r){return function(r){var n=t[r];return n&&"object"==typeof n?n:A.md}(r)}}},F=C(void 0),Y={0:0,px:1,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},D=function(r){var t=i(i({},Y),r),n=function(r){return"number"==typeof t[r]?t[r]:0};return{px:function(r){return n(r)},rem:function(r){return n(r)/16},css:function(r){return"".concat(n(r),"px")}}},E=D(void 0),M={fonts:{primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},fontSizes:i({},w),colors:{primary:"blue-600",secondary:"gray-600",success:"green-500",warning:"yellow-500",error:"red-500",info:"blue-400",background:"white",text:"gray-900",shadow:"black",overlay:"black"},spacing:i({},Y),opacity:i({},S),typography:{heading:{fontSize:"2xl",fontFamily:"fonts.display",fontWeight:600,lineHeight:1.2},"heading-large":{fontSize:"4xl",fontFamily:"fonts.display",fontWeight:700,lineHeight:1.1},body:{fontSize:"base",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.5},caption:{fontSize:"sm",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.4}},effects:{"shadow-sm":{blur:2,offsetY:1,color:"colors.shadow",alpha:.05},"shadow-md":{blur:4,offsetY:2,color:"colors.shadow",alpha:.1},"shadow-lg":{blur:8,offsetY:4,color:"colors.shadow",alpha:.1}},custom:{}},_={fonts:{primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},fontSizes:i({},w),radius:i({},P),colors:{primary:"blue-400",secondary:"gray-400",success:"green-400",warning:"yellow-400",error:"red-400",info:"blue-300",background:"gray-900",text:"white",shadow:"black",overlay:"black"},spacing:i({},Y),opacity:i({},S),typography:{heading:{fontSize:"2xl",fontFamily:"fonts.display",fontWeight:600,lineHeight:1.2},"heading-large":{fontSize:"4xl",fontFamily:"fonts.display",fontWeight:700,lineHeight:1.1},body:{fontSize:"base",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.5},caption:{fontSize:"sm",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.4}},effects:{"shadow-sm":{blur:2,offsetY:1,color:"colors.shadow",alpha:.1},"shadow-md":{blur:4,offsetY:2,color:"colors.shadow",alpha:.15},"shadow-lg":{blur:8,offsetY:4,color:"colors.shadow",alpha:.2}},custom:{}},X=function(r){function t(t){var n=r.call(this,t)||this;return n.colorInstance=null,n.fontSizeInstance=null,n.spacingInstance=null,n.radiusInstance=null,n.opacityInstance=null,n.fontInstance=null,n.shadowInstance=null,n.theme=M,n}return e(t,r),t.prototype.init=function(r){var t=r.theme,n=r.darkMode,e=void 0!==n&&n;t?(this.theme=t,this.colorInstance=m(this.theme.colors),this.fontSizeInstance=x(this.theme.fontSizes),this.spacingInstance=D(this.theme.spacing),this.radiusInstance=W(this.theme.radius),this.opacityInstance=I(this.theme.opacity),this.fontInstance=z(this.theme.fonts,this.theme.fontSizes),this.shadowInstance=C(this.theme.effects)):this.theme=e?_:M},t.prototype.getTheme=function(){return this.theme},Object.defineProperty(t.prototype,"color",{get:function(){return this.colorInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.fontSizeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){return this.spacingInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.radiusInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"opacity",{get:function(){return this.opacityInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.fontInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadow",{get:function(){return this.shadowInstance},enumerable:!1,configurable:!0}),t}(t.Plugins.BasePlugin),T=function(r){function t(t){return r.call(this,t)||this}return e(t,r),t}(Phaser.Scene);r.Color=v,r.Column=g,r.DEFAULT_GAP=8,r.FontSize=O,r.Opacity=k,r.PHASER_WIND_KEY="pw",r.PhaserWindPlugin=X,r.Radius=j,r.Row=s,r.SceneWithPhaserWind=T,r.Shadow=F,r.Spacing=E,r.createColor=m,r.createFont=z,r.createFontSize=x,r.createOpacity=I,r.createRadius=W,r.createShadow=C,r.createSpacing=D,r.createTheme=function(r){return b({},M,r)},r.defaultDarkTheme=_,r.defaultLightTheme=M,r.defaultShadowMap=A,r.fontMap=H,r.fontSizeMap=w,r.getDisplayHeightOf=c,r.getDisplayWidthOf=a,r.getNormalizedOriginOf=u,r.isValidColor=h,r.merge=b,r.mergeDeep=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return b.apply(void 0,o([{},r],t,!1))},r.opacityMap=S,r.palette=p,r.radiusMap=P,r.spacingMap=Y,r.withPhaserWind=function(r){return r.plugins.get("pw")}});
|
package/dist/plugin/plugin.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Plugins } from 'phaser';
|
|
2
2
|
import { FontSizeApi, type SpacingApi, type FontApi, type ShadowApi } from '../core';
|
|
3
3
|
import { type Color } from '../core/color';
|
|
4
|
+
import { type OpacityApi } from '../core/opacity';
|
|
4
5
|
import { type RadiusApi } from '../core/radius';
|
|
5
6
|
import { BaseThemeConfig, ThemeOverride } from '../theme';
|
|
6
7
|
export declare const PHASER_WIND_KEY: string;
|
|
@@ -26,6 +27,7 @@ export declare class PhaserWindPlugin<T extends BaseThemeConfig> extends Plugins
|
|
|
26
27
|
private fontSizeInstance;
|
|
27
28
|
private spacingInstance;
|
|
28
29
|
private radiusInstance;
|
|
30
|
+
private opacityInstance;
|
|
29
31
|
private fontInstance;
|
|
30
32
|
private shadowInstance;
|
|
31
33
|
/** Current theme configuration */
|
|
@@ -65,6 +67,7 @@ export declare class PhaserWindPlugin<T extends BaseThemeConfig> extends Plugins
|
|
|
65
67
|
get fontSize(): FontSizeApi<T['fontSizes']>;
|
|
66
68
|
get spacing(): SpacingApi<T['spacing']>;
|
|
67
69
|
get radius(): RadiusApi<T['radius']>;
|
|
70
|
+
get opacity(): OpacityApi<T['opacity']>;
|
|
68
71
|
get font(): FontApi<T['fonts'], T['fontSizes']>;
|
|
69
72
|
get shadow(): ShadowApi<T['effects']>;
|
|
70
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,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,IAAW,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAE1C;IAED,IAAW,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAE7C;IAED,IAAW,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAErD;IAED,IAAW,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAE3C;CACF"}
|
package/dist/plugin/plugin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Plugins } from 'phaser';
|
|
2
2
|
import { createFontSize, createSpacing, createFont, createShadow, } from '../core';
|
|
3
3
|
import { createColor } from '../core/color';
|
|
4
|
+
import { createOpacity } from '../core/opacity';
|
|
4
5
|
import { createRadius } from '../core/radius';
|
|
5
6
|
import { defaultDarkTheme, defaultLightTheme, } from '../theme';
|
|
6
7
|
export const PHASER_WIND_KEY = 'pw';
|
|
@@ -13,6 +14,7 @@ export class PhaserWindPlugin extends Plugins.BasePlugin {
|
|
|
13
14
|
fontSizeInstance = null;
|
|
14
15
|
spacingInstance = null;
|
|
15
16
|
radiusInstance = null;
|
|
17
|
+
opacityInstance = null;
|
|
16
18
|
fontInstance = null;
|
|
17
19
|
shadowInstance = null;
|
|
18
20
|
/** Current theme configuration */
|
|
@@ -59,6 +61,7 @@ export class PhaserWindPlugin extends Plugins.BasePlugin {
|
|
|
59
61
|
this.fontSizeInstance = createFontSize(this.theme.fontSizes);
|
|
60
62
|
this.spacingInstance = createSpacing(this.theme.spacing);
|
|
61
63
|
this.radiusInstance = createRadius(this.theme.radius);
|
|
64
|
+
this.opacityInstance = createOpacity(this.theme.opacity);
|
|
62
65
|
this.fontInstance = createFont(this.theme.fonts, this.theme.fontSizes);
|
|
63
66
|
this.shadowInstance = createShadow(this.theme.effects);
|
|
64
67
|
}
|
|
@@ -81,6 +84,9 @@ export class PhaserWindPlugin extends Plugins.BasePlugin {
|
|
|
81
84
|
get radius() {
|
|
82
85
|
return this.radiusInstance;
|
|
83
86
|
}
|
|
87
|
+
get opacity() {
|
|
88
|
+
return this.opacityInstance;
|
|
89
|
+
}
|
|
84
90
|
get font() {
|
|
85
91
|
return this.fontInstance;
|
|
86
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EACL,cAAc,EAEd,aAAa,EAEb,UAAU,EACV,YAAY,GAGb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,eAAe,GAAW,IAAI,CAAC;AAe5C;;;GAGG;AACH,MAAM,OAAO,gBAEX,SAAQ,OAAO,CAAC,UAAU;IAClB,aAAa,GAA8B,IAAI,CAAC;IAChD,gBAAgB,GAAuC,IAAI,CAAC;IAC5D,eAAe,GAAoC,IAAI,CAAC;IACxD,cAAc,GAAkC,IAAI,CAAC;IACrD,YAAY,GAA+C,IAAI,CAAC;IAChE,cAAc,GAAmC,IAAI,CAAC;IAE9D,kCAAkC;IAC1B,KAAK,CAAsB;IAEnC;;;OAGG;IACH,YAAY,aAAoC;QAC9C,KAAK,CAAC,aAAa,CAAC,CAAC;QAErB,IAAI,CAAC,KAAK,GAAG,iBAAwC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACM,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAA2B;QAChE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,QAAQ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,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
package/dist/scene/index.js
CHANGED
package/dist/scene/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
import { PhaserWindPlugin } from '../plugin/plugin';
|
|
2
2
|
import { BaseThemeConfig } from '../theme';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use {@link withPhaserWind} instead.
|
|
5
|
+
*
|
|
6
|
+
* Forces single inheritance, which conflicts with any user-defined `BaseScene`
|
|
7
|
+
* or other libraries that ship their own scene base class. It also relies on a
|
|
8
|
+
* non-null assertion (`pw!`) that lies to TypeScript about when the plugin is
|
|
9
|
+
* available — touching `this.pw` before the plugin mounts throws at runtime.
|
|
10
|
+
*
|
|
11
|
+
* Prefer the `withPhaserWind(scene)` accessor:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
15
|
+
* import type { ThemeType } from './theme';
|
|
16
|
+
*
|
|
17
|
+
* class MyScene extends Phaser.Scene {
|
|
18
|
+
* create() {
|
|
19
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Kept exported to avoid breaking existing consumers.
|
|
25
|
+
*/
|
|
3
26
|
export declare abstract class SceneWithPhaserWind<T extends BaseThemeConfig = BaseThemeConfig> extends Phaser.Scene {
|
|
4
27
|
/**
|
|
5
|
-
*
|
|
6
28
|
* @param config The scene key or scene specific configuration settings.
|
|
7
29
|
*/
|
|
8
30
|
constructor(config?: string | Phaser.Types.Scenes.SettingsConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-with-phaser-wind.d.ts","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,8BAAsB,mBAAmB,CACvC,CAAC,SAAS,eAAe,GAAG,eAAe,CAC3C,SAAQ,MAAM,CAAC,KAAK;IACpB
|
|
1
|
+
{"version":3,"file":"scene-with-phaser-wind.d.ts","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,mBAAmB,CACvC,CAAC,SAAS,eAAe,GAAG,eAAe,CAC3C,SAAQ,MAAM,CAAC,KAAK;IACpB;;OAEG;gBACS,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc;IAIzD,EAAE,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACjC"}
|
|
@@ -1,6 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use {@link withPhaserWind} instead.
|
|
3
|
+
*
|
|
4
|
+
* Forces single inheritance, which conflicts with any user-defined `BaseScene`
|
|
5
|
+
* or other libraries that ship their own scene base class. It also relies on a
|
|
6
|
+
* non-null assertion (`pw!`) that lies to TypeScript about when the plugin is
|
|
7
|
+
* available — touching `this.pw` before the plugin mounts throws at runtime.
|
|
8
|
+
*
|
|
9
|
+
* Prefer the `withPhaserWind(scene)` accessor:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
13
|
+
* import type { ThemeType } from './theme';
|
|
14
|
+
*
|
|
15
|
+
* class MyScene extends Phaser.Scene {
|
|
16
|
+
* create() {
|
|
17
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Kept exported to avoid breaking existing consumers.
|
|
23
|
+
*/
|
|
1
24
|
export class SceneWithPhaserWind extends Phaser.Scene {
|
|
2
25
|
/**
|
|
3
|
-
*
|
|
4
26
|
* @param config The scene key or scene specific configuration settings.
|
|
5
27
|
*/
|
|
6
28
|
constructor(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-with-phaser-wind.js","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAGA,MAAM,OAAgB,mBAEpB,SAAQ,MAAM,CAAC,KAAK;IACpB
|
|
1
|
+
{"version":3,"file":"scene-with-phaser-wind.js","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,mBAEpB,SAAQ,MAAM,CAAC,KAAK;IACpB;;OAEG;IACH,YAAY,MAAoD;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEM,EAAE,CAAuB;CACjC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Scene } from 'phaser';
|
|
2
|
+
import { PhaserWindPlugin } from '../plugin/plugin';
|
|
3
|
+
import { BaseThemeConfig } from '../theme';
|
|
4
|
+
/**
|
|
5
|
+
* Accessor for the Phaser Wind plugin from within a Phaser scene.
|
|
6
|
+
*
|
|
7
|
+
* Preferred over {@link SceneWithPhaserWind} (inheritance) and over module
|
|
8
|
+
* augmentation of `Phaser.Scene`, because it:
|
|
9
|
+
* - Composes with any existing base scene (no forced inheritance).
|
|
10
|
+
* - Keeps the theme type explicit at the call site (no silent `any`).
|
|
11
|
+
* - Doesn't rely on non-null assertions that lie about lifecycle.
|
|
12
|
+
*
|
|
13
|
+
* Call it inside `create()` / `update()` (after the plugin has been installed).
|
|
14
|
+
*
|
|
15
|
+
* @typeParam T - The theme config type. Pass your `ThemeType` to get
|
|
16
|
+
* type-narrowed access to your custom tokens.
|
|
17
|
+
* @param scene - The Phaser scene instance.
|
|
18
|
+
* @returns The Phaser Wind plugin instance bound to the given theme type.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
23
|
+
* import type { ThemeType } from './theme';
|
|
24
|
+
*
|
|
25
|
+
* class MyScene extends Phaser.Scene {
|
|
26
|
+
* create() {
|
|
27
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
28
|
+
* this.cameras.main.setBackgroundColor(pw.color.rgb('background'));
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const withPhaserWind: <T extends BaseThemeConfig = BaseThemeConfig>(scene: Scene) => PhaserWindPlugin<T>;
|
|
34
|
+
//# sourceMappingURL=with-phaser-wind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-phaser-wind.d.ts","sourceRoot":"","sources":["../../src/scene/with-phaser-wind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAmB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,eAAe,GAAG,eAAe,EACxE,OAAO,KAAK,KACX,gBAAgB,CAAC,CAAC,CACiD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PHASER_WIND_KEY } from '../plugin/plugin';
|
|
2
|
+
/**
|
|
3
|
+
* Accessor for the Phaser Wind plugin from within a Phaser scene.
|
|
4
|
+
*
|
|
5
|
+
* Preferred over {@link SceneWithPhaserWind} (inheritance) and over module
|
|
6
|
+
* augmentation of `Phaser.Scene`, because it:
|
|
7
|
+
* - Composes with any existing base scene (no forced inheritance).
|
|
8
|
+
* - Keeps the theme type explicit at the call site (no silent `any`).
|
|
9
|
+
* - Doesn't rely on non-null assertions that lie about lifecycle.
|
|
10
|
+
*
|
|
11
|
+
* Call it inside `create()` / `update()` (after the plugin has been installed).
|
|
12
|
+
*
|
|
13
|
+
* @typeParam T - The theme config type. Pass your `ThemeType` to get
|
|
14
|
+
* type-narrowed access to your custom tokens.
|
|
15
|
+
* @param scene - The Phaser scene instance.
|
|
16
|
+
* @returns The Phaser Wind plugin instance bound to the given theme type.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
21
|
+
* import type { ThemeType } from './theme';
|
|
22
|
+
*
|
|
23
|
+
* class MyScene extends Phaser.Scene {
|
|
24
|
+
* create() {
|
|
25
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
26
|
+
* this.cameras.main.setBackgroundColor(pw.color.rgb('background'));
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export const withPhaserWind = (scene) => scene.plugins.get(PHASER_WIND_KEY);
|
|
32
|
+
//# sourceMappingURL=with-phaser-wind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-phaser-wind.js","sourceRoot":"","sources":["../../src/scene/with-phaser-wind.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAoB,MAAM,kBAAkB,CAAC;AAGrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,KAAY,EACS,EAAE,CACvB,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAmC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type FontSizeMap } from '../core/font-size';
|
|
2
|
+
import { type OpacityMap } from '../core/opacity';
|
|
2
3
|
import { type RadiusMap } from '../core/radius';
|
|
3
4
|
import { type ColorConfig, type EffectConfig, type FontConfig, type SpacingConfig, type TypographyConfig } from './type';
|
|
4
5
|
/**
|
|
@@ -36,6 +37,9 @@ export type ThemeOverride = {
|
|
|
36
37
|
radius?: Partial<RadiusMap> & {
|
|
37
38
|
[key: string]: number;
|
|
38
39
|
};
|
|
40
|
+
opacity?: Partial<OpacityMap> & {
|
|
41
|
+
[key: string]: number;
|
|
42
|
+
};
|
|
39
43
|
custom?: {
|
|
40
44
|
[key: string]: unknown;
|
|
41
45
|
};
|
|
@@ -54,6 +58,9 @@ export type BaseThemeConfig = {
|
|
|
54
58
|
radius?: RadiusMap & {
|
|
55
59
|
[key: string]: number;
|
|
56
60
|
};
|
|
61
|
+
opacity?: OpacityMap & {
|
|
62
|
+
[key: string]: number;
|
|
63
|
+
};
|
|
57
64
|
custom?: {
|
|
58
65
|
[key: string]: unknown;
|
|
59
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-config.d.ts","sourceRoot":"","sources":["../../src/theme/theme-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3D,OAAO,E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GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,MAAM,CAAC,EAAE,SAAS,GAAG;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,OAAO,CAAC,EAAE,UAAU,GAAG;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,eA+E/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eA+E9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,eAAe,IAAI,MAAM,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
/* eslint-disable sonarjs/no-duplicate-string */
|
|
3
3
|
import { fontSizeMap } from '../core/font-size';
|
|
4
|
+
import { opacityMap } from '../core/opacity';
|
|
4
5
|
import { radiusMap } from '../core/radius';
|
|
5
6
|
import { spacingMap } from '../core/spacing';
|
|
6
7
|
/**
|
|
@@ -32,6 +33,7 @@ export const defaultLightTheme = {
|
|
|
32
33
|
overlay: 'black',
|
|
33
34
|
},
|
|
34
35
|
spacing: { ...spacingMap },
|
|
36
|
+
opacity: { ...opacityMap },
|
|
35
37
|
typography: {
|
|
36
38
|
heading: {
|
|
37
39
|
fontSize: '2xl',
|
|
@@ -108,6 +110,7 @@ export const defaultDarkTheme = {
|
|
|
108
110
|
overlay: 'black',
|
|
109
111
|
},
|
|
110
112
|
spacing: { ...spacingMap },
|
|
113
|
+
opacity: { ...opacityMap },
|
|
111
114
|
typography: {
|
|
112
115
|
heading: {
|
|
113
116
|
fontSize: '2xl',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-config.js","sourceRoot":"","sources":["../../src/theme/theme-config.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"theme-config.js","sourceRoot":"","sources":["../../src/theme/theme-config.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAmE7C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,KAAK,EAAE;QACL,OAAO,EAAE,8BAA8B;QACvC,SAAS,EAAE,2BAA2B;QACtC,SAAS,EAAE,gCAAgC;QAC3C,OAAO,EAAE,4BAA4B;KACtC;IACD,SAAS,EAAE,EAAE,GAAG,WAAW,EAAE;IAC7B,MAAM,EAAE;QACN,iBAAiB;QACjB,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE,UAAU;QAErB,kBAAkB;QAClB,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,SAAS;QAChB,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