phaser-wind 0.5.0 → 0.5.1
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/scene/scene-with-phaser-wind.d.ts +1 -1
- package/dist/scene/scene-with-phaser-wind.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/components/column.js +0 -2
- package/dist/components/column.js.map +0 -1
- package/dist/core/color.js +0 -205
- package/dist/core/color.js.map +0 -1
- package/dist/core/color.spec.js +0 -243
- package/dist/core/color.spec.js.map +0 -1
- package/dist/core/font-size.js +0 -63
- package/dist/core/font-size.js.map +0 -1
- package/dist/core/font-size.spec.js +0 -85
- package/dist/core/font-size.spec.js.map +0 -1
- package/dist/core/font.js +0 -37
- package/dist/core/font.js.map +0 -1
- package/dist/core/font.spec.js +0 -80
- package/dist/core/font.spec.js.map +0 -1
- package/dist/core/index.js +0 -8
- package/dist/core/index.js.map +0 -1
- package/dist/core/palette.js +0 -292
- package/dist/core/palette.js.map +0 -1
- package/dist/core/radius.js +0 -38
- package/dist/core/radius.js.map +0 -1
- package/dist/core/radius.spec.js +0 -56
- package/dist/core/radius.spec.js.map +0 -1
- package/dist/core/shadow.js +0 -33
- package/dist/core/shadow.js.map +0 -1
- package/dist/core/shadow.spec.js +0 -21
- package/dist/core/shadow.spec.js.map +0 -1
- package/dist/core/spacing.js +0 -70
- package/dist/core/spacing.js.map +0 -1
- package/dist/core/spacing.spec.js +0 -38
- package/dist/core/spacing.spec.js.map +0 -1
- package/dist/exceptions.js +0 -2
- package/dist/exceptions.js.map +0 -1
- package/dist/font/index.js +0 -3
- package/dist/font/index.js.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/plugin/index.js +0 -2
- package/dist/plugin/index.js.map +0 -1
- package/dist/plugin/plugin.js +0 -91
- package/dist/plugin/plugin.js.map +0 -1
- package/dist/scene/index.js +0 -2
- package/dist/scene/index.js.map +0 -1
- package/dist/scene/scene-with-phaser-wind.js +0 -11
- package/dist/scene/scene-with-phaser-wind.js.map +0 -1
- package/dist/theme/index.js +0 -3
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/theme-config.js +0 -159
- package/dist/theme/theme-config.js.map +0 -1
- package/dist/theme/theme-manager.js +0 -4
- package/dist/theme/theme-manager.js.map +0 -1
- package/dist/theme/type.js +0 -2
- package/dist/theme/type.js.map +0 -1
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/is-valid-color.js +0 -32
- package/dist/utils/is-valid-color.js.map +0 -1
- package/dist/utils/is-valid-color.spec.js +0 -82
- package/dist/utils/is-valid-color.spec.js.map +0 -1
package/dist/core/shadow.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/** Default shadow presets. */
|
|
2
|
-
export const defaultShadowMap = {
|
|
3
|
-
sm: { blur: 2, offsetX: 1, offsetY: 1, alpha: 0.15 },
|
|
4
|
-
md: { blur: 4, offsetX: 2, offsetY: 2, alpha: 0.2 },
|
|
5
|
-
lg: { blur: 6, offsetX: 4, offsetY: 4, alpha: 0.25 },
|
|
6
|
-
xl: { blur: 8, offsetX: 6, offsetY: 6, alpha: 0.3 },
|
|
7
|
-
'2xl': { blur: 12, offsetX: 8, offsetY: 8, alpha: 0.35 },
|
|
8
|
-
inner: { blur: 4, offsetX: -2, offsetY: -2, alpha: 0.2 },
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Create a shadow API bound to an optional effects map.
|
|
12
|
-
* @example
|
|
13
|
-
* const sh = createShadow({ glow: { blur: 8, offsetX: 0, offsetY: 0, alpha: .6 } });
|
|
14
|
-
* sh.get('glow');
|
|
15
|
-
*/
|
|
16
|
-
export const createShadow = (effects) => {
|
|
17
|
-
const map = {
|
|
18
|
-
...defaultShadowMap,
|
|
19
|
-
...effects,
|
|
20
|
-
};
|
|
21
|
-
const getConfig = (key) => {
|
|
22
|
-
const cfg = map[key];
|
|
23
|
-
if (cfg && typeof cfg === 'object')
|
|
24
|
-
return cfg;
|
|
25
|
-
return defaultShadowMap['md'];
|
|
26
|
-
};
|
|
27
|
-
return {
|
|
28
|
-
get: (key) => getConfig(key),
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
/** Convenience instance using default shadows (no theme). */
|
|
32
|
-
export const Shadow = createShadow(undefined);
|
|
33
|
-
//# sourceMappingURL=shadow.js.map
|
package/dist/core/shadow.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shadow.js","sourceRoot":"","sources":["../../src/core/shadow.ts"],"names":[],"mappings":"AAgBA,8BAA8B;AAC9B,MAAM,CAAC,MAAM,gBAAgB,GAAoC;IAC/D,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;IACpD,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;IACnD,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;IACpD,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;IACnD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;CACzD,CAAC;AAYF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAG1B,OAAW,EACG,EAAE;IAChB,MAAM,GAAG,GAAc;QACrB,GAAG,gBAAgB;QACnB,GAAI,OAA4C;KACpC,CAAC;IAEf,MAAM,SAAS,GAAG,CAAC,GAAW,EAAgB,EAAE;QAC9C,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,GAAmB,CAAC;QAC/D,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,OAAO;QACL,GAAG,EAAE,CACH,GAAsE,EACxD,EAAE,CAAC,SAAS,CAAC,GAAa,CAAC;KAC5C,CAAC;AACJ,CAAC,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAyB,YAAY,CAAY,SAAS,CAAC,CAAC"}
|
package/dist/core/shadow.spec.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-magic-numbers */
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import { Shadow, createShadow } from './shadow';
|
|
4
|
-
describe('Shadow', () => {
|
|
5
|
-
it('should provide defaults via Shadow constant', () => {
|
|
6
|
-
expect(Shadow.get('sm')).toEqual({
|
|
7
|
-
blur: 2,
|
|
8
|
-
offsetX: 1,
|
|
9
|
-
offsetY: 1,
|
|
10
|
-
alpha: 0.15,
|
|
11
|
-
});
|
|
12
|
-
expect(Shadow.get('md').blur).toBe(4);
|
|
13
|
-
});
|
|
14
|
-
it('should allow theme effect keys via factory', () => {
|
|
15
|
-
const shadow = createShadow({
|
|
16
|
-
customGlow: { blur: 20, offsetX: 0, offsetY: 0, alpha: 0.5 },
|
|
17
|
-
});
|
|
18
|
-
expect(shadow.get('customGlow').blur).toBe(20);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=shadow.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shadow.spec.js","sourceRoot":"","sources":["../../src/core/shadow.spec.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;YAC/B,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,MAAM,GAAG,YAAY,CAAC;YAC1B,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;SAC7D,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/core/spacing.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spacing scale mapping following Tailwind's spacing scale.
|
|
3
|
-
* Values are in pixels, with a base unit of 4px (1 = 4px).
|
|
4
|
-
*/
|
|
5
|
-
export const spacingMap = {
|
|
6
|
-
'0': 0,
|
|
7
|
-
px: 1,
|
|
8
|
-
'0.5': 2,
|
|
9
|
-
'1': 4,
|
|
10
|
-
'1.5': 6,
|
|
11
|
-
'2': 8,
|
|
12
|
-
'2.5': 10,
|
|
13
|
-
'3': 12,
|
|
14
|
-
'3.5': 14,
|
|
15
|
-
'4': 16,
|
|
16
|
-
'5': 20,
|
|
17
|
-
'6': 24,
|
|
18
|
-
'7': 28,
|
|
19
|
-
'8': 32,
|
|
20
|
-
'9': 36,
|
|
21
|
-
'10': 40,
|
|
22
|
-
'11': 44,
|
|
23
|
-
'12': 48,
|
|
24
|
-
'14': 56,
|
|
25
|
-
'16': 64,
|
|
26
|
-
'20': 80,
|
|
27
|
-
'24': 96,
|
|
28
|
-
'28': 112,
|
|
29
|
-
'32': 128,
|
|
30
|
-
'36': 144,
|
|
31
|
-
'40': 160,
|
|
32
|
-
'44': 176,
|
|
33
|
-
'48': 192,
|
|
34
|
-
'52': 208,
|
|
35
|
-
'56': 224,
|
|
36
|
-
'60': 240,
|
|
37
|
-
'64': 256,
|
|
38
|
-
'72': 288,
|
|
39
|
-
'80': 320,
|
|
40
|
-
'96': 384,
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Create a spacing API bound to an optional theme spacing map.
|
|
44
|
-
* @example
|
|
45
|
-
* const s = createSpacing({ gutter: 24 });
|
|
46
|
-
* s.px('gutter'); // 24
|
|
47
|
-
*/
|
|
48
|
-
export const createSpacing = (themeSpacing) => {
|
|
49
|
-
const map = {
|
|
50
|
-
...spacingMap,
|
|
51
|
-
...themeSpacing,
|
|
52
|
-
};
|
|
53
|
-
const get = (key) => {
|
|
54
|
-
return typeof map[key] === 'number' ? map[key] : 0;
|
|
55
|
-
};
|
|
56
|
-
return {
|
|
57
|
-
px: (key) => {
|
|
58
|
-
return get(key);
|
|
59
|
-
},
|
|
60
|
-
rem: (key) => {
|
|
61
|
-
return get(key) / 16;
|
|
62
|
-
},
|
|
63
|
-
css: (key) => {
|
|
64
|
-
return `${get(key)}px`;
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
/** Convenience instance using default spacing map (no theme). */
|
|
69
|
-
export const Spacing = createSpacing(undefined);
|
|
70
|
-
//# sourceMappingURL=spacing.js.map
|
package/dist/core/spacing.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacing.js","sourceRoot":"","sources":["../../src/core/spacing.ts"],"names":[],"mappings":"AA8CA;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAe;IACpC,GAAG,EAAE,CAAC;IACN,EAAE,EAAE,CAAC;IACL,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,EAAE;IACT,GAAG,EAAE,EAAE;IACP,KAAK,EAAE,EAAE;IACT,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;IACP,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;CACV,CAAC;AAYF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAG3B,YAAgB,EACD,EAAE;IACjB,MAAM,GAAG,GAAe;QACtB,GAAG,UAAU;QACb,GAAI,YAAuC;KAC9B,CAAC;IAEhB,MAAM,GAAG,GAAG,CAAC,GAAW,EAAU,EAAE;QAClC,OAAO,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,GAAG,CAAC,GAAG,CAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC;IAEF,OAAO;QACL,EAAE,EAAE,CACF,GAA0D,EAClD,EAAE;YACV,OAAO,GAAG,CAAC,GAAa,CAAC,CAAC;QAC5B,CAAC;QACD,GAAG,EAAE,CACH,GAA0D,EAClD,EAAE;YACV,OAAO,GAAG,CAAC,GAAa,CAAC,GAAG,EAAE,CAAC;QACjC,CAAC;QACD,GAAG,EAAE,CACH,GAA0D,EAClD,EAAE;YACV,OAAO,GAAG,GAAG,CAAC,GAAa,CAAC,IAAI,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,iEAAiE;AACjE,MAAM,CAAC,MAAM,OAAO,GAClB,aAAa,CAAY,SAAS,CAAC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-magic-numbers */
|
|
2
|
-
/* eslint-disable max-lines */
|
|
3
|
-
/* eslint-disable max-lines-per-function */
|
|
4
|
-
/* eslint-disable sonarjs/no-duplicate-string */
|
|
5
|
-
import { describe, expect, it } from 'vitest';
|
|
6
|
-
import { createSpacing, Spacing } from './spacing';
|
|
7
|
-
describe('Spacing', () => {
|
|
8
|
-
describe('px', () => {
|
|
9
|
-
it('should return pixel values', () => {
|
|
10
|
-
const spacing = createSpacing();
|
|
11
|
-
expect(spacing.px('2')).toBe(8);
|
|
12
|
-
expect(spacing.px('4')).toBe(16);
|
|
13
|
-
expect(spacing.px('8')).toBe(32);
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
describe('rem', () => {
|
|
17
|
-
it('should convert pixel values to rem', () => {
|
|
18
|
-
const spacing = createSpacing();
|
|
19
|
-
expect(spacing.rem('16')).toBe(4);
|
|
20
|
-
expect(spacing.rem('8')).toBe(2);
|
|
21
|
-
expect(spacing.rem('4')).toBe(1);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
describe('css', () => {
|
|
25
|
-
it('should return pixel values as CSS strings', () => {
|
|
26
|
-
const spacing = createSpacing();
|
|
27
|
-
expect(spacing.css('2')).toBe('8px');
|
|
28
|
-
expect(spacing.css('4')).toBe('16px');
|
|
29
|
-
expect(spacing.css('8')).toBe('32px');
|
|
30
|
-
});
|
|
31
|
-
it('should work with default Spacing constant', () => {
|
|
32
|
-
expect(Spacing.px('2')).toBe(8);
|
|
33
|
-
expect(Spacing.css('4')).toBe('16px');
|
|
34
|
-
expect(Spacing.rem('8')).toBe(2);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=spacing.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacing.spec.js","sourceRoot":"","sources":["../../src/core/spacing.spec.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,8BAA8B;AAC9B,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,EAAE;IACvB,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE;QAClB,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;YACpC,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;YAChC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjC,MA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,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/exceptions.js
DELETED
package/dist/exceptions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../src/exceptions.ts"],"names":[],"mappings":""}
|
package/dist/font/index.js
DELETED
package/dist/font/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/font/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/plugin/index.js
DELETED
package/dist/plugin/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
package/dist/plugin/plugin.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Plugins } from 'phaser';
|
|
2
|
-
import { createFontSize, createSpacing, createFont, createShadow, } from '../core';
|
|
3
|
-
import { createColor } from '../core/color';
|
|
4
|
-
import { createRadius } from '../core/radius';
|
|
5
|
-
import { defaultDarkTheme, defaultLightTheme, } from '../theme';
|
|
6
|
-
export const PHASER_WIND_KEY = 'pw';
|
|
7
|
-
/**
|
|
8
|
-
* Phaser Wind Plugin class that manages theme configuration
|
|
9
|
-
* @extends Plugins.BasePlugin
|
|
10
|
-
*/
|
|
11
|
-
export class PhaserWindPlugin extends Plugins.BasePlugin {
|
|
12
|
-
colorInstance = null;
|
|
13
|
-
fontSizeInstance = null;
|
|
14
|
-
spacingInstance = null;
|
|
15
|
-
radiusInstance = null;
|
|
16
|
-
fontInstance = null;
|
|
17
|
-
shadowInstance = null;
|
|
18
|
-
/** Current theme configuration */
|
|
19
|
-
theme;
|
|
20
|
-
/**
|
|
21
|
-
* Creates an instance of PhaserWindPlugin
|
|
22
|
-
* @param pluginManager - Phaser plugin manager instance
|
|
23
|
-
*/
|
|
24
|
-
constructor(pluginManager) {
|
|
25
|
-
super(pluginManager);
|
|
26
|
-
this.theme = defaultLightTheme;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Initializes the plugin with theme configuration
|
|
30
|
-
* @param theme - Custom theme configuration
|
|
31
|
-
* @param darkMode - Whether to use dark mode theme when no custom theme provided
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const game = new Phaser.Game({
|
|
35
|
-
* plugins: {
|
|
36
|
-
* global: [
|
|
37
|
-
* {
|
|
38
|
-
* key: PHASER_WIND_KEY,
|
|
39
|
-
* plugin: PhaserWindPlugin,
|
|
40
|
-
* mapping: PHASER_WIND_KEY,
|
|
41
|
-
* data: { theme: defaultLightTheme }
|
|
42
|
-
* },
|
|
43
|
-
* ],
|
|
44
|
-
* },
|
|
45
|
-
* });
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
init({ theme, darkMode = false }) {
|
|
49
|
-
if (!theme) {
|
|
50
|
-
this.theme = darkMode
|
|
51
|
-
? defaultDarkTheme
|
|
52
|
-
: defaultLightTheme;
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.theme = theme;
|
|
57
|
-
}
|
|
58
|
-
this.colorInstance = createColor(this.theme.colors);
|
|
59
|
-
this.fontSizeInstance = createFontSize(this.theme.fontSizes);
|
|
60
|
-
this.spacingInstance = createSpacing(this.theme.spacing);
|
|
61
|
-
this.radiusInstance = createRadius(this.theme.radius);
|
|
62
|
-
this.fontInstance = createFont(this.theme.fonts, this.theme.fontSizes);
|
|
63
|
-
this.shadowInstance = createShadow(this.theme.effects);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Returns the current theme configuration
|
|
67
|
-
* @returns Current BaseThemeConfig
|
|
68
|
-
*/
|
|
69
|
-
getTheme() {
|
|
70
|
-
return this.theme;
|
|
71
|
-
}
|
|
72
|
-
get color() {
|
|
73
|
-
return this.colorInstance;
|
|
74
|
-
}
|
|
75
|
-
get fontSize() {
|
|
76
|
-
return this.fontSizeInstance;
|
|
77
|
-
}
|
|
78
|
-
get spacing() {
|
|
79
|
-
return this.spacingInstance;
|
|
80
|
-
}
|
|
81
|
-
get radius() {
|
|
82
|
-
return this.radiusInstance;
|
|
83
|
-
}
|
|
84
|
-
get font() {
|
|
85
|
-
return this.fontInstance;
|
|
86
|
-
}
|
|
87
|
-
get shadow() {
|
|
88
|
-
return this.shadowInstance;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,MA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CAAC,KAAK,CAAC,SAA2B,CACvC,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,OAAuB,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,aAAmC,CAAC;IAClD,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,gBAA+C,CAAC;IAC9D,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,eAA2C,CAAC;IAC1D,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,cAAwC,CAAC;IACvD,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,YAAmD,CAAC;IAClE,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,cAAyC,CAAC;IACxD,CAAC;CACF"}
|
package/dist/scene/index.js
DELETED
package/dist/scene/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scene-with-phaser-wind.js","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAGA,MAAM,OAAgB,mBAAiE,SAAQ,MAAM,CAAC,KAAK;IACvG;;;OAGG;IACH,YAAY,MAAoD;QAC5D,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAES,EAAE,CAAuB;CACtC"}
|
package/dist/theme/index.js
DELETED
package/dist/theme/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
|
-
/* eslint-disable sonarjs/no-duplicate-string */
|
|
3
|
-
import { fontSizeMap } from '../core/font-size';
|
|
4
|
-
import { radiusMap } from '../core/radius';
|
|
5
|
-
import { spacingMap } from '../core/spacing';
|
|
6
|
-
/**
|
|
7
|
-
* Example theme configurations with structured design tokens
|
|
8
|
-
*/
|
|
9
|
-
export const defaultLightTheme = {
|
|
10
|
-
fonts: {
|
|
11
|
-
primary: 'Inter, system-ui, sans-serif',
|
|
12
|
-
secondary: 'Roboto, Arial, sans-serif',
|
|
13
|
-
monospace: 'Fira Code, Consolas, monospace',
|
|
14
|
-
display: 'Poppins, Inter, sans-serif',
|
|
15
|
-
},
|
|
16
|
-
fontSizes: { ...fontSizeMap },
|
|
17
|
-
colors: {
|
|
18
|
-
// Primary colors
|
|
19
|
-
primary: 'blue-600',
|
|
20
|
-
secondary: 'gray-600',
|
|
21
|
-
// Semantic colors
|
|
22
|
-
success: 'green-500',
|
|
23
|
-
warning: 'yellow-500',
|
|
24
|
-
error: 'red-500',
|
|
25
|
-
info: 'blue-400',
|
|
26
|
-
// Background colors
|
|
27
|
-
background: 'white',
|
|
28
|
-
// Text colors
|
|
29
|
-
text: 'gray-900',
|
|
30
|
-
// UI elements
|
|
31
|
-
shadow: 'black',
|
|
32
|
-
overlay: 'black',
|
|
33
|
-
},
|
|
34
|
-
spacing: { ...spacingMap },
|
|
35
|
-
typography: {
|
|
36
|
-
heading: {
|
|
37
|
-
fontSize: '2xl',
|
|
38
|
-
fontFamily: 'fonts.display',
|
|
39
|
-
fontWeight: 600,
|
|
40
|
-
lineHeight: 1.2,
|
|
41
|
-
},
|
|
42
|
-
'heading-large': {
|
|
43
|
-
fontSize: '4xl',
|
|
44
|
-
fontFamily: 'fonts.display',
|
|
45
|
-
fontWeight: 700,
|
|
46
|
-
lineHeight: 1.1,
|
|
47
|
-
},
|
|
48
|
-
body: {
|
|
49
|
-
fontSize: 'base',
|
|
50
|
-
fontFamily: 'fonts.primary',
|
|
51
|
-
fontWeight: 400,
|
|
52
|
-
lineHeight: 1.5,
|
|
53
|
-
},
|
|
54
|
-
caption: {
|
|
55
|
-
fontSize: 'sm',
|
|
56
|
-
fontFamily: 'fonts.primary',
|
|
57
|
-
fontWeight: 400,
|
|
58
|
-
lineHeight: 1.4,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
// TODO: Check this implementation
|
|
62
|
-
effects: {
|
|
63
|
-
'shadow-sm': {
|
|
64
|
-
blur: 2,
|
|
65
|
-
offsetY: 1,
|
|
66
|
-
color: 'colors.shadow',
|
|
67
|
-
alpha: 0.05,
|
|
68
|
-
},
|
|
69
|
-
'shadow-md': {
|
|
70
|
-
blur: 4,
|
|
71
|
-
offsetY: 2,
|
|
72
|
-
color: 'colors.shadow',
|
|
73
|
-
alpha: 0.1,
|
|
74
|
-
},
|
|
75
|
-
'shadow-lg': {
|
|
76
|
-
blur: 8,
|
|
77
|
-
offsetY: 4,
|
|
78
|
-
color: 'colors.shadow',
|
|
79
|
-
alpha: 0.1,
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
custom: {},
|
|
83
|
-
};
|
|
84
|
-
export const defaultDarkTheme = {
|
|
85
|
-
fonts: {
|
|
86
|
-
primary: 'Inter, system-ui, sans-serif',
|
|
87
|
-
secondary: 'Roboto, Arial, sans-serif',
|
|
88
|
-
monospace: 'Fira Code, Consolas, monospace',
|
|
89
|
-
display: 'Poppins, Inter, sans-serif',
|
|
90
|
-
},
|
|
91
|
-
fontSizes: { ...fontSizeMap },
|
|
92
|
-
radius: { ...radiusMap },
|
|
93
|
-
colors: {
|
|
94
|
-
// Primary colors
|
|
95
|
-
primary: 'blue-400',
|
|
96
|
-
secondary: 'gray-400',
|
|
97
|
-
// Semantic colors
|
|
98
|
-
success: 'green-400',
|
|
99
|
-
warning: 'yellow-400',
|
|
100
|
-
error: 'red-400',
|
|
101
|
-
info: 'blue-300',
|
|
102
|
-
// Background colors
|
|
103
|
-
background: 'gray-900',
|
|
104
|
-
// Text colors
|
|
105
|
-
text: 'white',
|
|
106
|
-
// UI elements
|
|
107
|
-
shadow: 'black',
|
|
108
|
-
overlay: 'black',
|
|
109
|
-
},
|
|
110
|
-
spacing: { ...spacingMap },
|
|
111
|
-
typography: {
|
|
112
|
-
heading: {
|
|
113
|
-
fontSize: '2xl',
|
|
114
|
-
fontFamily: 'fonts.display',
|
|
115
|
-
fontWeight: 600,
|
|
116
|
-
lineHeight: 1.2,
|
|
117
|
-
},
|
|
118
|
-
'heading-large': {
|
|
119
|
-
fontSize: '4xl',
|
|
120
|
-
fontFamily: 'fonts.display',
|
|
121
|
-
fontWeight: 700,
|
|
122
|
-
lineHeight: 1.1,
|
|
123
|
-
},
|
|
124
|
-
body: {
|
|
125
|
-
fontSize: 'base',
|
|
126
|
-
fontFamily: 'fonts.primary',
|
|
127
|
-
fontWeight: 400,
|
|
128
|
-
lineHeight: 1.5,
|
|
129
|
-
},
|
|
130
|
-
caption: {
|
|
131
|
-
fontSize: 'sm',
|
|
132
|
-
fontFamily: 'fonts.primary',
|
|
133
|
-
fontWeight: 400,
|
|
134
|
-
lineHeight: 1.4,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
effects: {
|
|
138
|
-
'shadow-sm': {
|
|
139
|
-
blur: 2,
|
|
140
|
-
offsetY: 1,
|
|
141
|
-
color: 'colors.shadow',
|
|
142
|
-
alpha: 0.1,
|
|
143
|
-
},
|
|
144
|
-
'shadow-md': {
|
|
145
|
-
blur: 4,
|
|
146
|
-
offsetY: 2,
|
|
147
|
-
color: 'colors.shadow',
|
|
148
|
-
alpha: 0.15,
|
|
149
|
-
},
|
|
150
|
-
'shadow-lg': {
|
|
151
|
-
blur: 8,
|
|
152
|
-
offsetY: 4,
|
|
153
|
-
color: 'colors.shadow',
|
|
154
|
-
alpha: 0.2,
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
custom: {},
|
|
158
|
-
};
|
|
159
|
-
//# sourceMappingURL=theme-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AA+D7C;;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,IAAI,EAAE,UAAU;QAEhB,oBAAoB;QACpB,UAAU,EAAE,OAAO;QAEnB,cAAc;QACd,IAAI,EAAE,UAAU;QAEhB,cAAc;QACd,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,OAAO;KACjB;IACD,OAAO,EAAE,EAAE,GAAG,UAAU,EAAE;IAC1B,UAAU,EAAE;QACV,OAAO,EAAE;YACP,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;SAChB;QACD,eAAe,EAAE;YACf,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;SAChB;QACD,IAAI,E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D,OAAO,EAAE,EAAE,GAAG,UAAU,EAAE;IAC1B,UAAU,EAAE;QACV,OAAO,EAAE;YACP,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;SAChB;QACD,eAAe,EAAE;YACf,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;SAChB;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;SAChB;QACD,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;SAChB;KACF;IACD,OAAO,EAAE;QACP,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,GAAG;SACX;QACD,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,IAAI;SACZ;QACD,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,GAAG;SACX;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme-manager.js","sourceRoot":"","sources":["../../src/theme/theme-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAsB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEvE,MAAM,CAAC,MAAM,WAAW,GAAG,CAA0B,KAAQ,EAAK,EAAE,CAClE,KAAK,CAAC,EAAE,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAC"}
|
package/dist/theme/type.js
DELETED
package/dist/theme/type.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/theme/type.ts"],"names":[],"mappings":""}
|
package/dist/utils/index.js
DELETED
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* eslint-disable security/detect-unsafe-regex */
|
|
2
|
-
/**
|
|
3
|
-
* Checks if a string is a valid CSS color value
|
|
4
|
-
* @param color - The color string to validate
|
|
5
|
-
* @returns True if the color string is valid, false otherwise
|
|
6
|
-
*
|
|
7
|
-
* Supports the following formats:
|
|
8
|
-
* - Hex colors (#RRGGBB or #RGB)
|
|
9
|
-
* - RGB colors (rgb(r, g, b))
|
|
10
|
-
* - RGBA colors (rgba(r, g, b, a))
|
|
11
|
-
* - OKLCH colors (oklch(l c h [/ a]))
|
|
12
|
-
*/
|
|
13
|
-
export const isValidColor = (color) => {
|
|
14
|
-
if (typeof color !== 'string') {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
const trimmedColor = color.trim();
|
|
18
|
-
if (/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(trimmedColor)) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
if (/^rgb\(\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)$/.test(trimmedColor)) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
if (/^rgba\(\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*([01]|0?\.\d+)\s*\)$/.test(trimmedColor)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
if (/^oklch\(\s*(\d*\.?\d+%?)\s+(\d*\.?\d+)\s+(\d*\.?\d+)(?:\s*\/\s*([01]|0?\.\d+))?\s*\)$/.test(trimmedColor)) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=is-valid-color.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-valid-color.js","sourceRoot":"","sources":["../../src/utils/is-valid-color.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAW,EAAE;IACrD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAClC,IAAI,oCAAoC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IACE,gEAAgE,CAAC,IAAI,CACnE,YAAY,CACb,EACD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IACE,sFAAsF,CAAC,IAAI,CACzF,YAAY,CACb,EACD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IACE,uFAAuF,CAAC,IAAI,CAC1F,YAAY,CACb,EACD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|