phaser-wind 0.9.1 → 0.11.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/color.d.ts +36 -0
- package/dist/core/color.d.ts.map +1 -1
- package/dist/core/color.js +69 -1
- package/dist/core/color.js.map +1 -1
- package/dist/core/color.spec.js +82 -6
- package/dist/core/color.spec.js.map +1 -1
- 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 +201 -2
- 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
|
@@ -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":[],"mappings":"AAgCA;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAe;IACpC,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,CAAC;CACT,CAAC;AAiBF;;;;;;GAMG;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,KAAK,EAAE,CACL,GAA0D,EAClD,EAAE;YACV,OAAO,GAAG,CAAC,GAAa,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,EAAE,CACP,GAA0D,EAClD,EAAE;YACV,MAAM,WAAW,GAAG,GAAG,CAAC;YACxB,OAAO,GAAG,CAAC,GAAa,CAAC,GAAG,WAAW,CAAC;QAC1C,CAAC;QACD,GAAG,EAAE,CACH,GAA0D,EAClD,EAAE;YACV,MAAM,WAAW,GAAG,GAAG,CAAC;YACxB,OAAO,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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
|
|
|
861
861
|
/** Regular expression to match RGB color format */
|
|
862
862
|
var RGB_REGEX = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/;
|
|
863
|
+
/** Palette shades in ascending order — used by `shift` to snap deltas to a valid step. */
|
|
864
|
+
var VALID_SHADES = [
|
|
865
|
+
50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950,
|
|
866
|
+
];
|
|
867
|
+
var MIN_SHADE = 50;
|
|
868
|
+
var MAX_SHADE = 950;
|
|
869
|
+
/**
|
|
870
|
+
* Snap an arbitrary number to the nearest valid palette shade,
|
|
871
|
+
* clamping to `[50, 950]`.
|
|
872
|
+
*/
|
|
873
|
+
var snapToShade = function (value) {
|
|
874
|
+
if (value <= MIN_SHADE)
|
|
875
|
+
return String(MIN_SHADE);
|
|
876
|
+
if (value >= MAX_SHADE)
|
|
877
|
+
return String(MAX_SHADE);
|
|
878
|
+
var closest = VALID_SHADES[0];
|
|
879
|
+
var minDist = Math.abs(value - closest);
|
|
880
|
+
for (var _i = 0, VALID_SHADES_1 = VALID_SHADES; _i < VALID_SHADES_1.length; _i++) {
|
|
881
|
+
var shade = VALID_SHADES_1[_i];
|
|
882
|
+
var dist = Math.abs(value - shade);
|
|
883
|
+
if (dist < minDist) {
|
|
884
|
+
minDist = dist;
|
|
885
|
+
closest = shade;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
return String(closest);
|
|
889
|
+
};
|
|
890
|
+
var DEFAULT_SHADE = 500;
|
|
891
|
+
/**
|
|
892
|
+
* Shift a palette token to a different shade by an absolute delta.
|
|
893
|
+
* Kept as a module-level pure function so it can be reused by other utilities.
|
|
894
|
+
* See {@link Color.shift} for the public docs.
|
|
895
|
+
*/
|
|
896
|
+
var shiftToken = function (token, diff) {
|
|
897
|
+
var _a;
|
|
898
|
+
if (token === 'black' || token === 'white') {
|
|
899
|
+
return token;
|
|
900
|
+
}
|
|
901
|
+
// Family-only ('blue') — treat as if it were 'blue-500'.
|
|
902
|
+
if (isColorKey(token)) {
|
|
903
|
+
var newShade_1 = snapToShade(DEFAULT_SHADE + diff);
|
|
904
|
+
return "".concat(token, "-").concat(newShade_1);
|
|
905
|
+
}
|
|
906
|
+
var parts = String(token).split('-');
|
|
907
|
+
if (parts.length !== 2) {
|
|
908
|
+
return token;
|
|
909
|
+
}
|
|
910
|
+
var family = parts[0];
|
|
911
|
+
var currentShade = parseInt((_a = parts[1]) !== null && _a !== void 0 ? _a : '', 10);
|
|
912
|
+
if (Number.isNaN(currentShade)) {
|
|
913
|
+
return token;
|
|
914
|
+
}
|
|
915
|
+
var newShade = snapToShade(currentShade + diff);
|
|
916
|
+
return "".concat(family, "-").concat(newShade);
|
|
917
|
+
};
|
|
918
|
+
/**
|
|
919
|
+
* Type-guard: is `value` a palette family name (`'blue'`, `'red'`, ...)
|
|
920
|
+
* or one of the special tokens `'black'` / `'white'`?
|
|
921
|
+
*
|
|
922
|
+
* @example
|
|
923
|
+
* isColorKey('blue'); // true
|
|
924
|
+
* isColorKey('black'); // true
|
|
925
|
+
* isColorKey('blue-500'); // false — this is a ColorToken, use `Color.isValidColorToken` instead
|
|
926
|
+
* isColorKey('#3B82F6'); // false
|
|
927
|
+
* isColorKey('rgb(0,0,0)'); // false
|
|
928
|
+
*/
|
|
929
|
+
var isColorKey = function (value) {
|
|
930
|
+
return value in palette;
|
|
931
|
+
};
|
|
863
932
|
/**
|
|
864
933
|
* Convert hex color value to number
|
|
865
934
|
* @param hexValue - Hex color value (e.g., '#ff0000')
|
|
@@ -991,7 +1060,9 @@
|
|
|
991
1060
|
if (parts.length === 2) {
|
|
992
1061
|
var colorKey = parts[0];
|
|
993
1062
|
var shade = parts[1];
|
|
994
|
-
return colorKey in palette &&
|
|
1063
|
+
return (colorKey in palette &&
|
|
1064
|
+
shade in
|
|
1065
|
+
palette[colorKey]);
|
|
995
1066
|
}
|
|
996
1067
|
return false;
|
|
997
1068
|
};
|
|
@@ -1035,6 +1106,7 @@
|
|
|
1035
1106
|
var api = {
|
|
1036
1107
|
rgb: rgb,
|
|
1037
1108
|
hex: hex,
|
|
1109
|
+
shift: shiftToken,
|
|
1038
1110
|
isValidColorToken: isValidColorToken,
|
|
1039
1111
|
black: function () { return rgb('black'); },
|
|
1040
1112
|
white: function () { return rgb('white'); },
|
|
@@ -1193,6 +1265,62 @@
|
|
|
1193
1265
|
};
|
|
1194
1266
|
};
|
|
1195
1267
|
|
|
1268
|
+
/**
|
|
1269
|
+
* Opacity scale mapping following Tailwind's opacity scale.
|
|
1270
|
+
* Values are in the 0..1 range, ready for Phaser's `setAlpha()`.
|
|
1271
|
+
*/
|
|
1272
|
+
var opacityMap = {
|
|
1273
|
+
'0': 0,
|
|
1274
|
+
'5': 0.05,
|
|
1275
|
+
'10': 0.1,
|
|
1276
|
+
'15': 0.15,
|
|
1277
|
+
'20': 0.2,
|
|
1278
|
+
'25': 0.25,
|
|
1279
|
+
'30': 0.3,
|
|
1280
|
+
'35': 0.35,
|
|
1281
|
+
'40': 0.4,
|
|
1282
|
+
'45': 0.45,
|
|
1283
|
+
'50': 0.5,
|
|
1284
|
+
'55': 0.55,
|
|
1285
|
+
'60': 0.6,
|
|
1286
|
+
'65': 0.65,
|
|
1287
|
+
'70': 0.7,
|
|
1288
|
+
'75': 0.75,
|
|
1289
|
+
'80': 0.8,
|
|
1290
|
+
'85': 0.85,
|
|
1291
|
+
'90': 0.9,
|
|
1292
|
+
'95': 0.95,
|
|
1293
|
+
'100': 1,
|
|
1294
|
+
};
|
|
1295
|
+
/**
|
|
1296
|
+
* Create an opacity API bound to an optional theme opacity map.
|
|
1297
|
+
* @example
|
|
1298
|
+
* const o = createOpacity({ faded: 0.35 });
|
|
1299
|
+
* o.value('faded'); // 0.35
|
|
1300
|
+
* o.value('50'); // 0.5
|
|
1301
|
+
*/
|
|
1302
|
+
var createOpacity = function (themeOpacity) {
|
|
1303
|
+
var map = __assign(__assign({}, opacityMap), themeOpacity);
|
|
1304
|
+
var get = function (key) {
|
|
1305
|
+
return typeof map[key] === 'number' ? map[key] : 0;
|
|
1306
|
+
};
|
|
1307
|
+
return {
|
|
1308
|
+
value: function (key) {
|
|
1309
|
+
return get(key);
|
|
1310
|
+
},
|
|
1311
|
+
percent: function (key) {
|
|
1312
|
+
var ONE_HUNDRED = 100;
|
|
1313
|
+
return get(key) * ONE_HUNDRED;
|
|
1314
|
+
},
|
|
1315
|
+
css: function (key) {
|
|
1316
|
+
var ONE_HUNDRED = 100;
|
|
1317
|
+
return "".concat(get(key) * ONE_HUNDRED, "%");
|
|
1318
|
+
},
|
|
1319
|
+
};
|
|
1320
|
+
};
|
|
1321
|
+
/** Convenience instance using default opacity map (no theme). */
|
|
1322
|
+
var Opacity = createOpacity(undefined);
|
|
1323
|
+
|
|
1196
1324
|
/**
|
|
1197
1325
|
* Mapping of radius keys to their pixel values
|
|
1198
1326
|
*/
|
|
@@ -1360,6 +1488,7 @@
|
|
|
1360
1488
|
overlay: 'black',
|
|
1361
1489
|
},
|
|
1362
1490
|
spacing: __assign({}, spacingMap),
|
|
1491
|
+
opacity: __assign({}, opacityMap),
|
|
1363
1492
|
typography: {
|
|
1364
1493
|
heading: {
|
|
1365
1494
|
fontSize: '2xl',
|
|
@@ -1436,6 +1565,7 @@
|
|
|
1436
1565
|
overlay: 'black',
|
|
1437
1566
|
},
|
|
1438
1567
|
spacing: __assign({}, spacingMap),
|
|
1568
|
+
opacity: __assign({}, opacityMap),
|
|
1439
1569
|
typography: {
|
|
1440
1570
|
heading: {
|
|
1441
1571
|
fontSize: '2xl',
|
|
@@ -1506,6 +1636,7 @@
|
|
|
1506
1636
|
_this.fontSizeInstance = null;
|
|
1507
1637
|
_this.spacingInstance = null;
|
|
1508
1638
|
_this.radiusInstance = null;
|
|
1639
|
+
_this.opacityInstance = null;
|
|
1509
1640
|
_this.fontInstance = null;
|
|
1510
1641
|
_this.shadowInstance = null;
|
|
1511
1642
|
_this.theme = defaultLightTheme;
|
|
@@ -1546,6 +1677,7 @@
|
|
|
1546
1677
|
this.fontSizeInstance = createFontSize(this.theme.fontSizes);
|
|
1547
1678
|
this.spacingInstance = createSpacing(this.theme.spacing);
|
|
1548
1679
|
this.radiusInstance = createRadius(this.theme.radius);
|
|
1680
|
+
this.opacityInstance = createOpacity(this.theme.opacity);
|
|
1549
1681
|
this.fontInstance = createFont(this.theme.fonts, this.theme.fontSizes);
|
|
1550
1682
|
this.shadowInstance = createShadow(this.theme.effects);
|
|
1551
1683
|
};
|
|
@@ -1584,6 +1716,13 @@
|
|
|
1584
1716
|
enumerable: false,
|
|
1585
1717
|
configurable: true
|
|
1586
1718
|
});
|
|
1719
|
+
Object.defineProperty(PhaserWindPlugin.prototype, "opacity", {
|
|
1720
|
+
get: function () {
|
|
1721
|
+
return this.opacityInstance;
|
|
1722
|
+
},
|
|
1723
|
+
enumerable: false,
|
|
1724
|
+
configurable: true
|
|
1725
|
+
});
|
|
1587
1726
|
Object.defineProperty(PhaserWindPlugin.prototype, "font", {
|
|
1588
1727
|
get: function () {
|
|
1589
1728
|
return this.fontInstance;
|
|
@@ -1601,10 +1740,32 @@
|
|
|
1601
1740
|
return PhaserWindPlugin;
|
|
1602
1741
|
}(phaser.Plugins.BasePlugin));
|
|
1603
1742
|
|
|
1743
|
+
/**
|
|
1744
|
+
* @deprecated Use {@link withPhaserWind} instead.
|
|
1745
|
+
*
|
|
1746
|
+
* Forces single inheritance, which conflicts with any user-defined `BaseScene`
|
|
1747
|
+
* or other libraries that ship their own scene base class. It also relies on a
|
|
1748
|
+
* non-null assertion (`pw!`) that lies to TypeScript about when the plugin is
|
|
1749
|
+
* available — touching `this.pw` before the plugin mounts throws at runtime.
|
|
1750
|
+
*
|
|
1751
|
+
* Prefer the `withPhaserWind(scene)` accessor:
|
|
1752
|
+
*
|
|
1753
|
+
* ```ts
|
|
1754
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
1755
|
+
* import type { ThemeType } from './theme';
|
|
1756
|
+
*
|
|
1757
|
+
* class MyScene extends Phaser.Scene {
|
|
1758
|
+
* create() {
|
|
1759
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
1760
|
+
* }
|
|
1761
|
+
* }
|
|
1762
|
+
* ```
|
|
1763
|
+
*
|
|
1764
|
+
* Kept exported to avoid breaking existing consumers.
|
|
1765
|
+
*/
|
|
1604
1766
|
var SceneWithPhaserWind = /** @class */ (function (_super) {
|
|
1605
1767
|
__extends(SceneWithPhaserWind, _super);
|
|
1606
1768
|
/**
|
|
1607
|
-
*
|
|
1608
1769
|
* @param config The scene key or scene specific configuration settings.
|
|
1609
1770
|
*/
|
|
1610
1771
|
function SceneWithPhaserWind(config) {
|
|
@@ -1613,10 +1774,44 @@
|
|
|
1613
1774
|
return SceneWithPhaserWind;
|
|
1614
1775
|
}(Phaser.Scene));
|
|
1615
1776
|
|
|
1777
|
+
/**
|
|
1778
|
+
* Accessor for the Phaser Wind plugin from within a Phaser scene.
|
|
1779
|
+
*
|
|
1780
|
+
* Preferred over {@link SceneWithPhaserWind} (inheritance) and over module
|
|
1781
|
+
* augmentation of `Phaser.Scene`, because it:
|
|
1782
|
+
* - Composes with any existing base scene (no forced inheritance).
|
|
1783
|
+
* - Keeps the theme type explicit at the call site (no silent `any`).
|
|
1784
|
+
* - Doesn't rely on non-null assertions that lie about lifecycle.
|
|
1785
|
+
*
|
|
1786
|
+
* Call it inside `create()` / `update()` (after the plugin has been installed).
|
|
1787
|
+
*
|
|
1788
|
+
* @typeParam T - The theme config type. Pass your `ThemeType` to get
|
|
1789
|
+
* type-narrowed access to your custom tokens.
|
|
1790
|
+
* @param scene - The Phaser scene instance.
|
|
1791
|
+
* @returns The Phaser Wind plugin instance bound to the given theme type.
|
|
1792
|
+
*
|
|
1793
|
+
* @example
|
|
1794
|
+
* ```ts
|
|
1795
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
1796
|
+
* import type { ThemeType } from './theme';
|
|
1797
|
+
*
|
|
1798
|
+
* class MyScene extends Phaser.Scene {
|
|
1799
|
+
* create() {
|
|
1800
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
1801
|
+
* this.cameras.main.setBackgroundColor(pw.color.rgb('background'));
|
|
1802
|
+
* }
|
|
1803
|
+
* }
|
|
1804
|
+
* ```
|
|
1805
|
+
*/
|
|
1806
|
+
var withPhaserWind = function (scene) {
|
|
1807
|
+
return scene.plugins.get(PHASER_WIND_KEY);
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1616
1810
|
exports.Color = Color;
|
|
1617
1811
|
exports.Column = Column;
|
|
1618
1812
|
exports.DEFAULT_GAP = DEFAULT_GAP;
|
|
1619
1813
|
exports.FontSize = FontSize;
|
|
1814
|
+
exports.Opacity = Opacity;
|
|
1620
1815
|
exports.PHASER_WIND_KEY = PHASER_WIND_KEY;
|
|
1621
1816
|
exports.PhaserWindPlugin = PhaserWindPlugin;
|
|
1622
1817
|
exports.Radius = Radius;
|
|
@@ -1627,6 +1822,7 @@
|
|
|
1627
1822
|
exports.createColor = createColor;
|
|
1628
1823
|
exports.createFont = createFont;
|
|
1629
1824
|
exports.createFontSize = createFontSize;
|
|
1825
|
+
exports.createOpacity = createOpacity;
|
|
1630
1826
|
exports.createRadius = createRadius;
|
|
1631
1827
|
exports.createShadow = createShadow;
|
|
1632
1828
|
exports.createSpacing = createSpacing;
|
|
@@ -1639,11 +1835,14 @@
|
|
|
1639
1835
|
exports.getDisplayHeightOf = getDisplayHeightOf;
|
|
1640
1836
|
exports.getDisplayWidthOf = getDisplayWidthOf;
|
|
1641
1837
|
exports.getNormalizedOriginOf = getNormalizedOriginOf;
|
|
1838
|
+
exports.isColorKey = isColorKey;
|
|
1642
1839
|
exports.isValidColor = isValidColor;
|
|
1643
1840
|
exports.merge = merge;
|
|
1644
1841
|
exports.mergeDeep = mergeDeep;
|
|
1842
|
+
exports.opacityMap = opacityMap;
|
|
1645
1843
|
exports.palette = palette;
|
|
1646
1844
|
exports.radiusMap = radiusMap;
|
|
1647
1845
|
exports.spacingMap = spacingMap;
|
|
1846
|
+
exports.withPhaserWind = withPhaserWind;
|
|
1648
1847
|
|
|
1649
1848
|
}));
|
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=[50,100,200,300,400,500,600,700,800,900,950],m=function(r){if(r<=50)return String(50);if(r>=950)return String(950);for(var t=y[0],n=Math.abs(r-t),e=0,i=y;e<i.length;e++){var o=i[e],a=Math.abs(r-o);a<n&&(n=a,t=o)}return String(t)},v=function(r,t){var n;if("black"===r||"white"===r)return r;if(w(r)){var e=m(500+t);return"".concat(r,"-").concat(e)}var i=String(r).split("-");if(2!==i.length)return r;var o=i[0],a=parseInt(null!==(n=i[1])&&void 0!==n?n:"",10);if(Number.isNaN(a))return r;var c=m(a+t);return"".concat(o,"-").concat(c)},w=function(r){return r in p},x=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},O=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 x(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 x(c);throw new Error('Color token "'.concat(g,"-").concat(s,'" not found'))}return x(l)}var f=p[c];if(h(f))return x(f);throw new Error('Color token "'.concat(c,'" not found'))};return{rgb:e,hex:i,shift:v,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))}}},H=O({}),S={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},z=function(r){var t=i(i({},S),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"}}},I=z(void 0),k={primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},P=function(r,t){var n=i(i({},k),r),e=z(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(k),!0),Object.keys(n),!0)))}}},W={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},j=function(r){var t=i(i({},W),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),"%")}}},A=j(void 0),C={none:0,sm:2,default:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999},F=function(r){var t=i(i({},C),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")}}},Y=F(void 0),D={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}},M=function(r){var t=i(i({},D),r);return{get:function(r){return function(r){var n=t[r];return n&&"object"==typeof n?n:D.md}(r)}}},E=M(void 0),_={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},X=function(r){var t=i(i({},_),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")}}},N=X(void 0),T={fonts:{primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},fontSizes:i({},S),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({},_),opacity:i({},W),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:{}},R={fonts:{primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},fontSizes:i({},S),radius:i({},C),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({},_),opacity:i({},W),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:{}},G=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=T,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=O(this.theme.colors),this.fontSizeInstance=z(this.theme.fontSizes),this.spacingInstance=X(this.theme.spacing),this.radiusInstance=F(this.theme.radius),this.opacityInstance=j(this.theme.opacity),this.fontInstance=P(this.theme.fonts,this.theme.fontSizes),this.shadowInstance=M(this.theme.effects)):this.theme=e?R:T},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),B=function(r){function t(t){return r.call(this,t)||this}return e(t,r),t}(Phaser.Scene);r.Color=H,r.Column=g,r.DEFAULT_GAP=8,r.FontSize=I,r.Opacity=A,r.PHASER_WIND_KEY="pw",r.PhaserWindPlugin=G,r.Radius=Y,r.Row=s,r.SceneWithPhaserWind=B,r.Shadow=E,r.Spacing=N,r.createColor=O,r.createFont=P,r.createFontSize=z,r.createOpacity=j,r.createRadius=F,r.createShadow=M,r.createSpacing=X,r.createTheme=function(r){return b({},T,r)},r.defaultDarkTheme=R,r.defaultLightTheme=T,r.defaultShadowMap=D,r.fontMap=k,r.fontSizeMap=S,r.getDisplayHeightOf=c,r.getDisplayWidthOf=a,r.getNormalizedOriginOf=u,r.isColorKey=w,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=W,r.palette=p,r.radiusMap=C,r.spacingMap=_,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,OAAO,EAEL,WAAW,EAEX,KAAK,UAAU,EAGf,KAAK,OAAO,EACZ,KAAK,SAAS,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,eAAe,C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ED,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
|
}
|