phaser-wind 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -60
- package/dist/core/color.d.ts.map +1 -1
- package/dist/core/color.js +29 -12
- package/dist/core/color.js.map +1 -1
- package/dist/core/color.spec.js +39 -0
- 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 +156 -13
- package/dist/phaser-wind.min.js +1 -1
- package/dist/plugin/plugin.d.ts +3 -0
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +6 -0
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/scene/index.d.ts +1 -0
- package/dist/scene/index.d.ts.map +1 -1
- package/dist/scene/index.js +1 -0
- package/dist/scene/index.js.map +1 -1
- package/dist/scene/scene-with-phaser-wind.d.ts +23 -1
- package/dist/scene/scene-with-phaser-wind.d.ts.map +1 -1
- package/dist/scene/scene-with-phaser-wind.js +23 -1
- package/dist/scene/scene-with-phaser-wind.js.map +1 -1
- package/dist/scene/with-phaser-wind.d.ts +34 -0
- package/dist/scene/with-phaser-wind.d.ts.map +1 -0
- package/dist/scene/with-phaser-wind.js +32 -0
- package/dist/scene/with-phaser-wind.js.map +1 -0
- package/dist/theme/theme-config.d.ts +7 -0
- package/dist/theme/theme-config.d.ts.map +1 -1
- package/dist/theme/theme-config.js +3 -0
- package/dist/theme/theme-config.js.map +1 -1
- package/package.json +1 -1
package/dist/phaser-wind.js
CHANGED
|
@@ -929,6 +929,19 @@
|
|
|
929
929
|
}
|
|
930
930
|
return null;
|
|
931
931
|
};
|
|
932
|
+
/**
|
|
933
|
+
* Normalizes a color by adding -500 if only color name is provided
|
|
934
|
+
* @param color - Color token or color name
|
|
935
|
+
* @returns Normalized color token
|
|
936
|
+
*/
|
|
937
|
+
var normalizeColorToken = function (color) {
|
|
938
|
+
if (typeof color === 'string' && !String(color).includes('-')) {
|
|
939
|
+
if (color in palette && color !== 'black' && color !== 'white') {
|
|
940
|
+
return "".concat(color, "-500");
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
return color;
|
|
944
|
+
};
|
|
932
945
|
/**
|
|
933
946
|
* Get RGB string representation of a color
|
|
934
947
|
* @param color - Color token, theme color key or valid color string
|
|
@@ -946,25 +959,27 @@
|
|
|
946
959
|
if (colorFromTheme) {
|
|
947
960
|
return rgb(colorFromTheme);
|
|
948
961
|
}
|
|
949
|
-
|
|
962
|
+
// Normalize color: add -500 if only color name is provided
|
|
963
|
+
var normalizedColor = normalizeColorToken(color);
|
|
964
|
+
var parts = (_a = normalizedColor === null || normalizedColor === void 0 ? void 0 : normalizedColor.split('-')) !== null && _a !== void 0 ? _a : [];
|
|
950
965
|
if (parts.length === 2) {
|
|
951
966
|
var colorKey = parts[0];
|
|
952
967
|
var shade = parts[1];
|
|
953
968
|
var colorValue_1 = (_b = palette[colorKey]) === null || _b === void 0 ? void 0 : _b[shade];
|
|
954
969
|
if (!colorValue_1) {
|
|
955
|
-
if (isValidColor(
|
|
956
|
-
return
|
|
970
|
+
if (isValidColor(normalizedColor)) {
|
|
971
|
+
return normalizedColor;
|
|
957
972
|
}
|
|
958
973
|
throw new Error("Color token \"".concat(colorKey, "-").concat(shade, "\" not found"));
|
|
959
974
|
}
|
|
960
975
|
return colorValue_1;
|
|
961
976
|
}
|
|
962
|
-
var colorValue = palette[
|
|
977
|
+
var colorValue = palette[normalizedColor];
|
|
963
978
|
if (!colorValue) {
|
|
964
|
-
if (isValidColor(
|
|
965
|
-
return
|
|
979
|
+
if (isValidColor(normalizedColor)) {
|
|
980
|
+
return normalizedColor;
|
|
966
981
|
}
|
|
967
|
-
throw new Error("Color token \"".concat(
|
|
982
|
+
throw new Error("Color token \"".concat(normalizedColor, "\" not found"));
|
|
968
983
|
}
|
|
969
984
|
return colorValue;
|
|
970
985
|
};
|
|
@@ -996,24 +1011,26 @@
|
|
|
996
1011
|
if (colorFromTheme) {
|
|
997
1012
|
return hex(colorFromTheme);
|
|
998
1013
|
}
|
|
999
|
-
|
|
1014
|
+
// Normalize color: add -500 if only color name is provided
|
|
1015
|
+
var normalizedColor = normalizeColorToken(color);
|
|
1016
|
+
var parts = (_a = normalizedColor === null || normalizedColor === void 0 ? void 0 : normalizedColor.split('-')) !== null && _a !== void 0 ? _a : [];
|
|
1000
1017
|
if (parts.length === 2) {
|
|
1001
1018
|
var colorKey = parts[0];
|
|
1002
1019
|
var shade = parts[1];
|
|
1003
1020
|
var colorValue = (_b = palette[colorKey]) === null || _b === void 0 ? void 0 : _b[shade];
|
|
1004
1021
|
if (!colorValue) {
|
|
1005
|
-
if (isValidColor(
|
|
1006
|
-
return convertColorValueToNumber(
|
|
1022
|
+
if (isValidColor(normalizedColor)) {
|
|
1023
|
+
return convertColorValueToNumber(normalizedColor);
|
|
1007
1024
|
}
|
|
1008
1025
|
throw new Error("Color token \"".concat(colorKey, "-").concat(shade, "\" not found"));
|
|
1009
1026
|
}
|
|
1010
1027
|
return convertColorValueToNumber(colorValue);
|
|
1011
1028
|
}
|
|
1012
|
-
var colorToConvert = palette[
|
|
1029
|
+
var colorToConvert = palette[normalizedColor];
|
|
1013
1030
|
if (isValidColor(colorToConvert)) {
|
|
1014
1031
|
return convertColorValueToNumber(colorToConvert);
|
|
1015
1032
|
}
|
|
1016
|
-
throw new Error("Color token \"".concat(
|
|
1033
|
+
throw new Error("Color token \"".concat(normalizedColor, "\" not found"));
|
|
1017
1034
|
};
|
|
1018
1035
|
var api = {
|
|
1019
1036
|
rgb: rgb,
|
|
@@ -1176,6 +1193,62 @@
|
|
|
1176
1193
|
};
|
|
1177
1194
|
};
|
|
1178
1195
|
|
|
1196
|
+
/**
|
|
1197
|
+
* Opacity scale mapping following Tailwind's opacity scale.
|
|
1198
|
+
* Values are in the 0..1 range, ready for Phaser's `setAlpha()`.
|
|
1199
|
+
*/
|
|
1200
|
+
var opacityMap = {
|
|
1201
|
+
'0': 0,
|
|
1202
|
+
'5': 0.05,
|
|
1203
|
+
'10': 0.1,
|
|
1204
|
+
'15': 0.15,
|
|
1205
|
+
'20': 0.2,
|
|
1206
|
+
'25': 0.25,
|
|
1207
|
+
'30': 0.3,
|
|
1208
|
+
'35': 0.35,
|
|
1209
|
+
'40': 0.4,
|
|
1210
|
+
'45': 0.45,
|
|
1211
|
+
'50': 0.5,
|
|
1212
|
+
'55': 0.55,
|
|
1213
|
+
'60': 0.6,
|
|
1214
|
+
'65': 0.65,
|
|
1215
|
+
'70': 0.7,
|
|
1216
|
+
'75': 0.75,
|
|
1217
|
+
'80': 0.8,
|
|
1218
|
+
'85': 0.85,
|
|
1219
|
+
'90': 0.9,
|
|
1220
|
+
'95': 0.95,
|
|
1221
|
+
'100': 1,
|
|
1222
|
+
};
|
|
1223
|
+
/**
|
|
1224
|
+
* Create an opacity API bound to an optional theme opacity map.
|
|
1225
|
+
* @example
|
|
1226
|
+
* const o = createOpacity({ faded: 0.35 });
|
|
1227
|
+
* o.value('faded'); // 0.35
|
|
1228
|
+
* o.value('50'); // 0.5
|
|
1229
|
+
*/
|
|
1230
|
+
var createOpacity = function (themeOpacity) {
|
|
1231
|
+
var map = __assign(__assign({}, opacityMap), themeOpacity);
|
|
1232
|
+
var get = function (key) {
|
|
1233
|
+
return typeof map[key] === 'number' ? map[key] : 0;
|
|
1234
|
+
};
|
|
1235
|
+
return {
|
|
1236
|
+
value: function (key) {
|
|
1237
|
+
return get(key);
|
|
1238
|
+
},
|
|
1239
|
+
percent: function (key) {
|
|
1240
|
+
var ONE_HUNDRED = 100;
|
|
1241
|
+
return get(key) * ONE_HUNDRED;
|
|
1242
|
+
},
|
|
1243
|
+
css: function (key) {
|
|
1244
|
+
var ONE_HUNDRED = 100;
|
|
1245
|
+
return "".concat(get(key) * ONE_HUNDRED, "%");
|
|
1246
|
+
},
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
/** Convenience instance using default opacity map (no theme). */
|
|
1250
|
+
var Opacity = createOpacity(undefined);
|
|
1251
|
+
|
|
1179
1252
|
/**
|
|
1180
1253
|
* Mapping of radius keys to their pixel values
|
|
1181
1254
|
*/
|
|
@@ -1343,6 +1416,7 @@
|
|
|
1343
1416
|
overlay: 'black',
|
|
1344
1417
|
},
|
|
1345
1418
|
spacing: __assign({}, spacingMap),
|
|
1419
|
+
opacity: __assign({}, opacityMap),
|
|
1346
1420
|
typography: {
|
|
1347
1421
|
heading: {
|
|
1348
1422
|
fontSize: '2xl',
|
|
@@ -1419,6 +1493,7 @@
|
|
|
1419
1493
|
overlay: 'black',
|
|
1420
1494
|
},
|
|
1421
1495
|
spacing: __assign({}, spacingMap),
|
|
1496
|
+
opacity: __assign({}, opacityMap),
|
|
1422
1497
|
typography: {
|
|
1423
1498
|
heading: {
|
|
1424
1499
|
fontSize: '2xl',
|
|
@@ -1489,6 +1564,7 @@
|
|
|
1489
1564
|
_this.fontSizeInstance = null;
|
|
1490
1565
|
_this.spacingInstance = null;
|
|
1491
1566
|
_this.radiusInstance = null;
|
|
1567
|
+
_this.opacityInstance = null;
|
|
1492
1568
|
_this.fontInstance = null;
|
|
1493
1569
|
_this.shadowInstance = null;
|
|
1494
1570
|
_this.theme = defaultLightTheme;
|
|
@@ -1529,6 +1605,7 @@
|
|
|
1529
1605
|
this.fontSizeInstance = createFontSize(this.theme.fontSizes);
|
|
1530
1606
|
this.spacingInstance = createSpacing(this.theme.spacing);
|
|
1531
1607
|
this.radiusInstance = createRadius(this.theme.radius);
|
|
1608
|
+
this.opacityInstance = createOpacity(this.theme.opacity);
|
|
1532
1609
|
this.fontInstance = createFont(this.theme.fonts, this.theme.fontSizes);
|
|
1533
1610
|
this.shadowInstance = createShadow(this.theme.effects);
|
|
1534
1611
|
};
|
|
@@ -1567,6 +1644,13 @@
|
|
|
1567
1644
|
enumerable: false,
|
|
1568
1645
|
configurable: true
|
|
1569
1646
|
});
|
|
1647
|
+
Object.defineProperty(PhaserWindPlugin.prototype, "opacity", {
|
|
1648
|
+
get: function () {
|
|
1649
|
+
return this.opacityInstance;
|
|
1650
|
+
},
|
|
1651
|
+
enumerable: false,
|
|
1652
|
+
configurable: true
|
|
1653
|
+
});
|
|
1570
1654
|
Object.defineProperty(PhaserWindPlugin.prototype, "font", {
|
|
1571
1655
|
get: function () {
|
|
1572
1656
|
return this.fontInstance;
|
|
@@ -1584,10 +1668,32 @@
|
|
|
1584
1668
|
return PhaserWindPlugin;
|
|
1585
1669
|
}(phaser.Plugins.BasePlugin));
|
|
1586
1670
|
|
|
1671
|
+
/**
|
|
1672
|
+
* @deprecated Use {@link withPhaserWind} instead.
|
|
1673
|
+
*
|
|
1674
|
+
* Forces single inheritance, which conflicts with any user-defined `BaseScene`
|
|
1675
|
+
* or other libraries that ship their own scene base class. It also relies on a
|
|
1676
|
+
* non-null assertion (`pw!`) that lies to TypeScript about when the plugin is
|
|
1677
|
+
* available — touching `this.pw` before the plugin mounts throws at runtime.
|
|
1678
|
+
*
|
|
1679
|
+
* Prefer the `withPhaserWind(scene)` accessor:
|
|
1680
|
+
*
|
|
1681
|
+
* ```ts
|
|
1682
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
1683
|
+
* import type { ThemeType } from './theme';
|
|
1684
|
+
*
|
|
1685
|
+
* class MyScene extends Phaser.Scene {
|
|
1686
|
+
* create() {
|
|
1687
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
1688
|
+
* }
|
|
1689
|
+
* }
|
|
1690
|
+
* ```
|
|
1691
|
+
*
|
|
1692
|
+
* Kept exported to avoid breaking existing consumers.
|
|
1693
|
+
*/
|
|
1587
1694
|
var SceneWithPhaserWind = /** @class */ (function (_super) {
|
|
1588
1695
|
__extends(SceneWithPhaserWind, _super);
|
|
1589
1696
|
/**
|
|
1590
|
-
*
|
|
1591
1697
|
* @param config The scene key or scene specific configuration settings.
|
|
1592
1698
|
*/
|
|
1593
1699
|
function SceneWithPhaserWind(config) {
|
|
@@ -1596,10 +1702,44 @@
|
|
|
1596
1702
|
return SceneWithPhaserWind;
|
|
1597
1703
|
}(Phaser.Scene));
|
|
1598
1704
|
|
|
1705
|
+
/**
|
|
1706
|
+
* Accessor for the Phaser Wind plugin from within a Phaser scene.
|
|
1707
|
+
*
|
|
1708
|
+
* Preferred over {@link SceneWithPhaserWind} (inheritance) and over module
|
|
1709
|
+
* augmentation of `Phaser.Scene`, because it:
|
|
1710
|
+
* - Composes with any existing base scene (no forced inheritance).
|
|
1711
|
+
* - Keeps the theme type explicit at the call site (no silent `any`).
|
|
1712
|
+
* - Doesn't rely on non-null assertions that lie about lifecycle.
|
|
1713
|
+
*
|
|
1714
|
+
* Call it inside `create()` / `update()` (after the plugin has been installed).
|
|
1715
|
+
*
|
|
1716
|
+
* @typeParam T - The theme config type. Pass your `ThemeType` to get
|
|
1717
|
+
* type-narrowed access to your custom tokens.
|
|
1718
|
+
* @param scene - The Phaser scene instance.
|
|
1719
|
+
* @returns The Phaser Wind plugin instance bound to the given theme type.
|
|
1720
|
+
*
|
|
1721
|
+
* @example
|
|
1722
|
+
* ```ts
|
|
1723
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
1724
|
+
* import type { ThemeType } from './theme';
|
|
1725
|
+
*
|
|
1726
|
+
* class MyScene extends Phaser.Scene {
|
|
1727
|
+
* create() {
|
|
1728
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
1729
|
+
* this.cameras.main.setBackgroundColor(pw.color.rgb('background'));
|
|
1730
|
+
* }
|
|
1731
|
+
* }
|
|
1732
|
+
* ```
|
|
1733
|
+
*/
|
|
1734
|
+
var withPhaserWind = function (scene) {
|
|
1735
|
+
return scene.plugins.get(PHASER_WIND_KEY);
|
|
1736
|
+
};
|
|
1737
|
+
|
|
1599
1738
|
exports.Color = Color;
|
|
1600
1739
|
exports.Column = Column;
|
|
1601
1740
|
exports.DEFAULT_GAP = DEFAULT_GAP;
|
|
1602
1741
|
exports.FontSize = FontSize;
|
|
1742
|
+
exports.Opacity = Opacity;
|
|
1603
1743
|
exports.PHASER_WIND_KEY = PHASER_WIND_KEY;
|
|
1604
1744
|
exports.PhaserWindPlugin = PhaserWindPlugin;
|
|
1605
1745
|
exports.Radius = Radius;
|
|
@@ -1610,6 +1750,7 @@
|
|
|
1610
1750
|
exports.createColor = createColor;
|
|
1611
1751
|
exports.createFont = createFont;
|
|
1612
1752
|
exports.createFontSize = createFontSize;
|
|
1753
|
+
exports.createOpacity = createOpacity;
|
|
1613
1754
|
exports.createRadius = createRadius;
|
|
1614
1755
|
exports.createShadow = createShadow;
|
|
1615
1756
|
exports.createSpacing = createSpacing;
|
|
@@ -1625,8 +1766,10 @@
|
|
|
1625
1766
|
exports.isValidColor = isValidColor;
|
|
1626
1767
|
exports.merge = merge;
|
|
1627
1768
|
exports.mergeDeep = mergeDeep;
|
|
1769
|
+
exports.opacityMap = opacityMap;
|
|
1628
1770
|
exports.palette = palette;
|
|
1629
1771
|
exports.radiusMap = radiusMap;
|
|
1630
1772
|
exports.spacingMap = spacingMap;
|
|
1773
|
+
exports.withPhaserWind = withPhaserWind;
|
|
1631
1774
|
|
|
1632
1775
|
}));
|
package/dist/phaser-wind.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("phaser")):"function"==typeof define&&define.amd?define(["exports","phaser"],t):t((r="undefined"!=typeof globalThis?globalThis:r||self).PhaserWind={},r.Phaser)}(this,function(r,t){"use strict";var n=function(r,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])},n(r,t)};function e(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}n(r,t),r.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}var i=function(){return i=Object.assign||function(r){for(var t,n=1,e=arguments.length;n<e;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i]);return r},i.apply(this,arguments)};function o(r,t,n){if(n||2===arguments.length)for(var e,i=0,o=t.length;i<o;i++)!e&&i in t||(e||(e=Array.prototype.slice.call(t,0,i)),e[i]=t[i]);return r.concat(e||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var a=function(r){var t,n=r;if(r&&"object"==typeof r&&"list"in r&&Array.isArray(r.list)){if("number"==typeof n.displayWidth&&n.displayWidth>0)return n.displayWidth;if("number"==typeof n.width&&n.width>0)return n.width;var e=r;if("number"==typeof e.displayWidth&&e.displayWidth>0)return e.displayWidth;if("number"==typeof e.width&&e.width>0)return"number"==typeof e.scale&&e.scale>0?e.width/e.scale:e.width;for(var i=0,o=0,g=e.list;o<g.length;o++){var u=g[o],c=a(u);i=Math.max(i,c)}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 u=a[o],c=g(u);i=Math.max(i,c)}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=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}},c=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,u=void 0===g?"center":g,c=t.children,s=void 0===c?[]:c,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,g=n;a<g.length;a++){var u=g[a],c=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;c.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 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,g=t.align,u=void 0===g?"center":g,c=t.children,s=void 0===c?[]:c,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,g=n;a<g.length;a++){var u=g[a],c=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;c.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 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 g=f(a);for(var u in g)if(Object.prototype.hasOwnProperty.call(g,u)){var c=g[u],s=e[u];l(c)&&l(s)?e[u]=b(s,c):void 0!==c&&(e[u]=c)}}}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){var e,i;if("string"==typeof r&&h(r))return r;var o=t(r);if(o)return n(o);var a=null!==(e=null==r?void 0:r.split("-"))&&void 0!==e?e:[];if(2===a.length){var g=a[0],u=a[1],c=null===(i=p[g])||void 0===i?void 0:i[u];if(!c){if(h(r))return r;throw new Error('Color token "'.concat(g,"-").concat(u,'" not found'))}return c}var s=p[r];if(!s){if(h(r))return r;throw new Error('Color token "'.concat(r,'" not found'))}return s},e=function(r){var n,i;if("string"==typeof r&&h(r))return y(r);var o=t(r);if(o)return e(o);var a=null!==(n=null==r?void 0:r.split("-"))&&void 0!==n?n:[];if(2===a.length){var g=a[0],u=a[1],c=null===(i=p[g])||void 0===i?void 0:i[u];if(!c){if(h(r))return y(r);throw new Error('Color token "'.concat(g,"-").concat(u,'" not found'))}return y(c)}var s=p[r];if(h(s))return y(s);throw new Error('Color token "'.concat(r,'" not found'))};return{rgb:n,hex:e,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 n("black")},white:function(){return n("white")},slate:function(r){return n("slate-".concat(r))},gray:function(r){return n("gray-".concat(r))},zinc:function(r){return n("zinc-".concat(r))},neutral:function(r){return n("neutral-".concat(r))},stone:function(r){return n("stone-".concat(r))},red:function(r){return n("red-".concat(r))},orange:function(r){return n("orange-".concat(r))},amber:function(r){return n("amber-".concat(r))},yellow:function(r){return n("yellow-".concat(r))},lime:function(r){return n("lime-".concat(r))},green:function(r){return n("green-".concat(r))},emerald:function(r){return n("emerald-".concat(r))},teal:function(r){return n("teal-".concat(r))},cyan:function(r){return n("cyan-".concat(r))},sky:function(r){return n("sky-".concat(r))},blue:function(r){return n("blue-".concat(r))},indigo:function(r){return n("indigo-".concat(r))},violet:function(r){return n("violet-".concat(r))},purple:function(r){return n("purple-".concat(r))},fuchsia:function(r){return n("fuchsia-".concat(r))},pink:function(r){return n("pink-".concat(r))},rose:function(r){return n("rose-".concat(r))},blackHex:function(){return e("black")},whiteHex:function(){return e("white")},slateHex:function(r){return e("slate-".concat(r))},grayHex:function(r){return e("gray-".concat(r))},zincHex:function(r){return e("zinc-".concat(r))},neutralHex:function(r){return e("neutral-".concat(r))},stoneHex:function(r){return e("stone-".concat(r))},redHex:function(r){return e("red-".concat(r))},orangeHex:function(r){return e("orange-".concat(r))},amberHex:function(r){return e("amber-".concat(r))},yellowHex:function(r){return e("yellow-".concat(r))},limeHex:function(r){return e("lime-".concat(r))},greenHex:function(r){return e("green-".concat(r))},emeraldHex:function(r){return e("emerald-".concat(r))},tealHex:function(r){return e("teal-".concat(r))},cyanHex:function(r){return e("cyan-".concat(r))},skyHex:function(r){return e("sky-".concat(r))},blueHex:function(r){return e("blue-".concat(r))},indigoHex:function(r){return e("indigo-".concat(r))},violetHex:function(r){return e("violet-".concat(r))},purpleHex:function(r){return e("purple-".concat(r))},fuchsiaHex:function(r){return e("fuchsia-".concat(r))},pinkHex:function(r){return e("pink-".concat(r))},roseHex:function(r){return e("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},I=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")}}},k=I(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=I(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=c,r.DEFAULT_GAP=8,r.FontSize=H,r.PHASER_WIND_KEY="pw",r.PhaserWindPlugin=E,r.Radius=k,r.Row=s,r.SceneWithPhaserWind=_,r.Shadow=P,r.Spacing=F,r.createColor=m,r.createFont=z,r.createFontSize=x,r.createRadius=I,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=u,r.isValidColor=h,r.merge=b,r.mergeDeep=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return b.apply(void 0,o([{},r],t,!1))},r.palette=p,r.radiusMap=S,r.spacingMap=A});
|
|
1
|
+
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("phaser")):"function"==typeof define&&define.amd?define(["exports","phaser"],t):t((r="undefined"!=typeof globalThis?globalThis:r||self).PhaserWind={},r.Phaser)}(this,function(r,t){"use strict";var n=function(r,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])},n(r,t)};function e(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}n(r,t),r.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}var i=function(){return i=Object.assign||function(r){for(var t,n=1,e=arguments.length;n<e;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i]);return r},i.apply(this,arguments)};function o(r,t,n){if(n||2===arguments.length)for(var e,i=0,o=t.length;i<o;i++)!e&&i in t||(e||(e=Array.prototype.slice.call(t,0,i)),e[i]=t[i]);return r.concat(e||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var a=function(r){var t,n=r;if(r&&"object"==typeof r&&"list"in r&&Array.isArray(r.list)){if("number"==typeof n.displayWidth&&n.displayWidth>0)return n.displayWidth;if("number"==typeof n.width&&n.width>0)return n.width;var e=r;if("number"==typeof e.displayWidth&&e.displayWidth>0)return e.displayWidth;if("number"==typeof e.width&&e.width>0)return"number"==typeof e.scale&&e.scale>0?e.width/e.scale:e.width;for(var i=0,o=0,c=e.list;o<c.length;o++){var u=c[o],g=a(u);i=Math.max(i,g)}return i}if("number"==typeof n.displayWidth)return n.displayWidth;if("number"==typeof n.width)return n.width;var s=null===(t=n.getBounds)||void 0===t?void 0:t.call(n);return s?s.width:0},c=function(r){var t,n=r;if(r&&"object"==typeof r&&"list"in r&&Array.isArray(r.list)){if("number"==typeof n.displayHeight&&n.displayHeight>0)return n.displayHeight;if("number"==typeof n.height&&n.height>0)return n.height;var e=r;if("number"==typeof e.displayHeight&&e.displayHeight>0)return e.displayHeight;if("number"==typeof e.height&&e.height>0)return"number"==typeof e.scale&&e.scale>0?e.height/e.scale:e.height;for(var i=0,o=0,a=e.list;o<a.length;o++){var u=a[o],g=c(u);i=Math.max(i,g)}return i}if("number"==typeof n.displayHeight)return n.displayHeight;if("number"==typeof n.height)return n.height;var s=null===(t=n.getBounds)||void 0===t?void 0:t.call(n);return s?s.height:0},u=function(r){var t=a(r),n=c(r),e=r,i="number"==typeof e.originX?e.originX:void 0,o="number"==typeof e.originY?e.originY:void 0;return void 0===i&&"number"==typeof e.displayOriginX&&t>0&&(i=e.displayOriginX/t),void 0===o&&"number"==typeof e.displayOriginY&&n>0&&(o=e.displayOriginY/n),{x:null!=i?i:.5,y:null!=o?o:.5}},g=function(r){function t(t){var n=t.scene,e=t.x,i=t.y,o=t.gap,a=void 0===o?8:o,c=t.align,u=void 0===c?"center":c,g=t.children,s=void 0===g?[]:g,l=t.verticalOrigin,f=void 0===l?"center":l,b=r.call(this,n,e,i)||this;return b.gap=a,b.align=u,b.verticalOrigin=f,s.length>0&&b.add(s),b.layout(),b}return e(t,r),t.prototype.setGap=function(r){this.gap=r,this.layout()},t.prototype.setAlign=function(r){this.align=r,this.layout()},t.prototype.addChild=function(r,t){return void 0===t&&(t=!0),this.add(r),t&&this.layout(),this},t.prototype.addChildren=function(r,t){return void 0===t&&(t=!0),r.length>0&&this.add(r),t&&this.layout(),this},t.prototype.layout=function(){var r=this,t=this.list;if(0!==t.length){for(var n=t.map(function(t){return{child:t,width:r.getDisplayWidth(t),height:r.getDisplayHeight(t),origin:r.getNormalizedOrigin(t)}}),e=n.reduce(function(r,t){return Math.max(r,t.width)},0),i=n.reduce(function(r,t){return r+t.height},0)+this.gap*(n.length-1),o="top"===this.verticalOrigin?0:"center"===this.verticalOrigin?-i/2:-i,a=0,c=n;a<c.length;a++){var u=c[a],g=u.child,s=u.width,l=u.height,f=u.origin,b=0;b="left"===this.align?-e/2+f.x*s:"right"===this.align?e/2-(1-f.x)*s:(f.x-.5)*s;var h=o+f.y*l;g.setPosition(b,h),o+=l+this.gap}this.setSize(e,i)}else this.setSize(0,0)},t.prototype.getDisplayWidth=function(r){return a(r)},t.prototype.getDisplayHeight=function(r){return c(r)},t.prototype.getNormalizedOrigin=function(r){return u(r)},t}(t.GameObjects.Container),s=function(r){function t(t){var n=t.scene,e=t.x,i=t.y,o=t.gap,a=void 0===o?8:o,c=t.align,u=void 0===c?"center":c,g=t.children,s=void 0===g?[]:g,l=t.horizontalOrigin,f=void 0===l?"center":l,b=r.call(this,n,e,i)||this;return b.gap=a,b.align=u,b.horizontalOrigin=f,s.length>0&&b.add(s),b.layout(),b}return e(t,r),t.prototype.setGap=function(r){this.gap=r,this.layout()},t.prototype.setAlign=function(r){this.align=r,this.layout()},t.prototype.addChild=function(r,t){return void 0===t&&(t=!0),this.add(r),t&&this.layout(),this},t.prototype.addChildren=function(r,t){return void 0===t&&(t=!0),r.length>0&&this.add(r),t&&this.layout(),this},t.prototype.layout=function(){var r=this,t=this.list;if(0!==t.length){for(var n=t.map(function(t){return{child:t,width:r.getDisplayWidth(t),height:r.getDisplayHeight(t),origin:r.getNormalizedOrigin(t)}}),e=n.reduce(function(r,t){return Math.max(r,t.height)},0),i=n.reduce(function(r,t){return r+t.width},0)+this.gap*(n.length-1),o="left"===this.horizontalOrigin?0:"center"===this.horizontalOrigin?-i/2:-i,a=0,c=n;a<c.length;a++){var u=c[a],g=u.child,s=u.width,l=u.height,f=u.origin,b=0;b="top"===this.align?-e/2+f.y*l:"bottom"===this.align?e/2-(1-f.y)*l:(f.y-.5)*l;var h=o+f.x*s;g.setPosition(h,b),o+=s+this.gap}this.setSize(i,e)}else this.setSize(0,0)},t.prototype.getDisplayWidth=function(r){return a(r)},t.prototype.getDisplayHeight=function(r){return c(r)},t.prototype.getNormalizedOrigin=function(r){return u(r)},t}(t.GameObjects.Container),l=function(r){return null!==r&&"object"==typeof r&&!Array.isArray(r)&&"[object Object]"===Object.prototype.toString.call(r)},f=function(r){if(null===r||"object"!=typeof r)return r;if(Array.isArray(r))return r.map(function(r){return f(r)});if(l(r)){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=f(r[n]));return t}return r},b=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!l(r))return r;for(var e=f(r),i=0,o=t;i<o.length;i++){var a=o[i];if(l(a)){var c=f(a);for(var u in c)if(Object.prototype.hasOwnProperty.call(c,u)){var g=c[u],s=e[u];l(g)&&l(s)?e[u]=b(s,g):void 0!==g&&(e[u]=g)}}}return e},h=function(r){if("string"!=typeof r)return!1;var t=r.trim();return!!/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(t)||(!!/^rgb\(\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)$/.test(t)||(!!/^rgba\(\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*([01]|0?\.\d+)\s*\)$/.test(t)||!!/^oklch\(\s*(\d*\.?\d+%?)\s+(\d*\.?\d+)\s+(\d*\.?\d+)(?:\s*\/\s*([01]|0?\.\d+))?\s*\)$/.test(t)))},p={black:"#000",white:"#fff",slate:{50:"rgb(248, 250, 252)",100:"rgb(241, 245, 249)",200:"rgb(226, 232, 240)",300:"rgb(203, 213, 225)",400:"rgb(148, 163, 184)",500:"rgb(100, 116, 139)",600:"rgb(71, 85, 105)",700:"rgb(51, 65, 85)",800:"rgb(30, 41, 59)",900:"rgb(15, 23, 42)",950:"rgb(2, 6, 23)"},gray:{50:"rgb(249, 250, 251)",100:"rgb(243, 244, 246)",200:"rgb(229, 231, 235)",300:"rgb(209, 213, 219)",400:"rgb(156, 163, 175)",500:"rgb(107, 114, 128)",600:"rgb(75, 85, 99)",700:"rgb(55, 65, 81)",800:"rgb(31, 41, 55)",900:"rgb(17, 24, 39)",950:"rgb(3, 7, 18)"},zinc:{50:"rgb(250, 250, 250)",100:"rgb(244, 244, 245)",200:"rgb(228, 228, 231)",300:"rgb(212, 212, 216)",400:"rgb(161, 161, 170)",500:"rgb(113, 113, 122)",600:"rgb(82, 82, 91)",700:"rgb(63, 63, 70)",800:"rgb(39, 39, 42)",900:"rgb(24, 24, 27)",950:"rgb(9, 9, 11)"},neutral:{50:"rgb(250, 250, 250)",100:"rgb(245, 245, 245)",200:"rgb(229, 229, 229)",300:"rgb(212, 212, 212)",400:"rgb(163, 163, 163)",500:"rgb(115, 115, 115)",600:"rgb(82, 82, 82)",700:"rgb(64, 64, 64)",800:"rgb(38, 38, 38)",900:"rgb(23, 23, 23)",950:"rgb(10, 10, 10)"},stone:{50:"rgb(250, 250, 249)",100:"rgb(245, 245, 244)",200:"rgb(231, 229, 228)",300:"rgb(214, 211, 209)",400:"rgb(168, 162, 158)",500:"rgb(120, 113, 108)",600:"rgb(87, 83, 78)",700:"rgb(68, 64, 60)",800:"rgb(41, 37, 36)",900:"rgb(28, 25, 23)",950:"rgb(12, 10, 9)"},red:{50:"rgb(254, 242, 242)",100:"rgb(254, 226, 226)",200:"rgb(254, 202, 202)",300:"rgb(252, 165, 165)",400:"rgb(248, 113, 113)",500:"rgb(239, 68, 68)",600:"rgb(220, 38, 38)",700:"rgb(185, 28, 28)",800:"rgb(153, 27, 27)",900:"rgb(127, 29, 29)",950:"rgb(69, 10, 10)"},orange:{50:"rgb(255, 247, 237)",100:"rgb(255, 237, 213)",200:"rgb(254, 215, 170)",300:"rgb(253, 186, 116)",400:"rgb(251, 146, 60)",500:"rgb(249, 115, 22)",600:"rgb(234, 88, 12)",700:"rgb(194, 65, 12)",800:"rgb(154, 52, 18)",900:"rgb(124, 45, 18)",950:"rgb(67, 20, 7)"},amber:{50:"rgb(255, 251, 235)",100:"rgb(254, 243, 199)",200:"rgb(253, 230, 138)",300:"rgb(252, 211, 77)",400:"rgb(251, 191, 36)",500:"rgb(245, 158, 11)",600:"rgb(217, 119, 6)",700:"rgb(180, 83, 9)",800:"rgb(146, 64, 14)",900:"rgb(120, 53, 15)",950:"rgb(69, 26, 3)"},yellow:{50:"rgb(254, 252, 232)",100:"rgb(254, 249, 195)",200:"rgb(254, 240, 138)",300:"rgb(253, 224, 71)",400:"rgb(250, 204, 21)",500:"rgb(234, 179, 8)",600:"rgb(202, 138, 4)",700:"rgb(161, 98, 7)",800:"rgb(133, 77, 14)",900:"rgb(113, 63, 18)",950:"rgb(66, 32, 6)"},lime:{50:"rgb(247, 254, 231)",100:"rgb(236, 252, 203)",200:"rgb(217, 249, 157)",300:"rgb(190, 242, 100)",400:"rgb(163, 230, 53)",500:"rgb(132, 204, 22)",600:"rgb(101, 163, 13)",700:"rgb(77, 124, 15)",800:"rgb(63, 98, 18)",900:"rgb(54, 83, 20)",950:"rgb(26, 46, 5)"},green:{50:"rgb(240, 253, 244)",100:"rgb(220, 252, 231)",200:"rgb(187, 247, 208)",300:"rgb(134, 239, 172)",400:"rgb(74, 222, 128)",500:"rgb(34, 197, 94)",600:"rgb(22, 163, 74)",700:"rgb(21, 128, 61)",800:"rgb(22, 101, 52)",900:"rgb(20, 83, 45)",950:"rgb(5, 46, 22)"},emerald:{50:"rgb(236, 253, 245)",100:"rgb(209, 250, 229)",200:"rgb(167, 243, 208)",300:"rgb(110, 231, 183)",400:"rgb(52, 211, 153)",500:"rgb(16, 185, 129)",600:"rgb(5, 150, 105)",700:"rgb(4, 120, 87)",800:"rgb(6, 95, 70)",900:"rgb(6, 78, 59)",950:"rgb(2, 44, 34)"},teal:{50:"rgb(240, 253, 250)",100:"rgb(204, 251, 241)",200:"rgb(153, 246, 228)",300:"rgb(94, 234, 212)",400:"rgb(45, 212, 191)",500:"rgb(20, 184, 166)",600:"rgb(13, 148, 136)",700:"rgb(15, 118, 110)",800:"rgb(17, 94, 89)",900:"rgb(19, 78, 74)",950:"rgb(4, 47, 46)"},cyan:{50:"rgb(236, 254, 255)",100:"rgb(207, 250, 254)",200:"rgb(165, 243, 252)",300:"rgb(103, 232, 249)",400:"rgb(34, 211, 238)",500:"rgb(6, 182, 212)",600:"rgb(8, 145, 178)",700:"rgb(14, 116, 144)",800:"rgb(21, 94, 117)",900:"rgb(22, 78, 99)",950:"rgb(8, 51, 68)"},sky:{50:"rgb(240, 249, 255)",100:"rgb(224, 242, 254)",200:"rgb(186, 230, 253)",300:"rgb(125, 211, 252)",400:"rgb(56, 189, 248)",500:"rgb(14, 165, 233)",600:"rgb(2, 132, 199)",700:"rgb(3, 105, 161)",800:"rgb(7, 89, 133)",900:"rgb(12, 74, 110)",950:"rgb(8, 47, 73)"},blue:{50:"rgb(239, 246, 255)",100:"rgb(219, 234, 254)",200:"rgb(191, 219, 254)",300:"rgb(147, 197, 253)",400:"rgb(96, 165, 250)",500:"rgb(59, 130, 246)",600:"rgb(37, 99, 235)",700:"rgb(29, 78, 216)",800:"rgb(30, 64, 175)",900:"rgb(30, 58, 138)",950:"rgb(23, 37, 84)"},indigo:{50:"rgb(238, 242, 255)",100:"rgb(224, 231, 255)",200:"rgb(199, 210, 254)",300:"rgb(165, 180, 252)",400:"rgb(129, 140, 248)",500:"rgb(99, 102, 241)",600:"rgb(79, 70, 229)",700:"rgb(67, 56, 202)",800:"rgb(55, 48, 163)",900:"rgb(49, 46, 129)",950:"rgb(30, 27, 75)"},violet:{50:"rgb(245, 243, 255)",100:"rgb(237, 233, 254)",200:"rgb(221, 214, 254)",300:"rgb(196, 181, 253)",400:"rgb(167, 139, 250)",500:"rgb(139, 92, 246)",600:"rgb(124, 58, 237)",700:"rgb(109, 40, 217)",800:"rgb(91, 33, 182)",900:"rgb(76, 29, 149)",950:"rgb(46, 16, 101)"},purple:{50:"rgb(250, 245, 255)",100:"rgb(243, 232, 255)",200:"rgb(233, 213, 255)",300:"rgb(216, 180, 254)",400:"rgb(192, 132, 252)",500:"rgb(168, 85, 247)",600:"rgb(147, 51, 234)",700:"rgb(126, 34, 206)",800:"rgb(107, 33, 168)",900:"rgb(88, 28, 135)",950:"rgb(59, 7, 100)"},fuchsia:{50:"rgb(253, 244, 255)",100:"rgb(250, 232, 255)",200:"rgb(245, 208, 254)",300:"rgb(240, 171, 252)",400:"rgb(232, 121, 249)",500:"rgb(217, 70, 239)",600:"rgb(192, 38, 211)",700:"rgb(162, 28, 175)",800:"rgb(134, 25, 143)",900:"rgb(112, 26, 117)",950:"rgb(74, 4, 78)"},pink:{50:"rgb(253, 242, 248)",100:"rgb(252, 231, 243)",200:"rgb(251, 207, 232)",300:"rgb(249, 168, 212)",400:"rgb(244, 114, 182)",500:"rgb(236, 72, 153)",600:"rgb(219, 39, 119)",700:"rgb(190, 24, 93)",800:"rgb(157, 23, 77)",900:"rgb(131, 24, 67)",950:"rgb(80, 7, 36)"},rose:{50:"rgb(255, 241, 242)",100:"rgb(255, 228, 230)",200:"rgb(254, 205, 211)",300:"rgb(253, 164, 175)",400:"rgb(251, 113, 133)",500:"rgb(244, 63, 94)",600:"rgb(225, 29, 72)",700:"rgb(190, 18, 60)",800:"rgb(159, 18, 57)",900:"rgb(136, 19, 55)",950:"rgb(76, 5, 25)"}},d=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/,y=function(r){return r.startsWith("#")?3===(t=r.slice(1)).length?(parseInt(t[0]+t[0],16)<<16)+(parseInt(t[1]+t[1],16)<<8)+parseInt(t[2]+t[2],16):parseInt(t,16):function(r){var t=r.match(d);if(!t)throw new Error("Invalid RGB format: ".concat(r));return(parseInt(t[1])<<16)+(parseInt(t[2])<<8)+parseInt(t[3])}(r);var t},m=function(r){var t=function(t){return r&&t in r?r[t]:null},n=function(r){return"string"==typeof r&&!String(r).includes("-")&&r in p&&"black"!==r&&"white"!==r?"".concat(r,"-500"):r},e=function(r){var i,o;if("string"==typeof r&&h(r))return r;var a=t(r);if(a)return e(a);var c=n(r),u=null!==(i=null==c?void 0:c.split("-"))&&void 0!==i?i:[];if(2===u.length){var g=u[0],s=u[1],l=null===(o=p[g])||void 0===o?void 0:o[s];if(!l){if(h(c))return c;throw new Error('Color token "'.concat(g,"-").concat(s,'" not found'))}return l}var f=p[c];if(!f){if(h(c))return c;throw new Error('Color token "'.concat(c,'" not found'))}return f},i=function(r){var e,o;if("string"==typeof r&&h(r))return y(r);var a=t(r);if(a)return i(a);var c=n(r),u=null!==(e=null==c?void 0:c.split("-"))&&void 0!==e?e:[];if(2===u.length){var g=u[0],s=u[1],l=null===(o=p[g])||void 0===o?void 0:o[s];if(!l){if(h(c))return y(c);throw new Error('Color token "'.concat(g,"-").concat(s,'" not found'))}return y(l)}var f=p[c];if(h(f))return y(f);throw new Error('Color token "'.concat(c,'" not found'))};return{rgb:e,hex:i,isValidColorToken:function(r){if("black"===r||"white"===r)return!0;var t=r.split("-");if(2===t.length){var n=t[0],e=t[1];return n in p&&e in p[n]}return!1},black:function(){return e("black")},white:function(){return e("white")},slate:function(r){return e("slate-".concat(r))},gray:function(r){return e("gray-".concat(r))},zinc:function(r){return e("zinc-".concat(r))},neutral:function(r){return e("neutral-".concat(r))},stone:function(r){return e("stone-".concat(r))},red:function(r){return e("red-".concat(r))},orange:function(r){return e("orange-".concat(r))},amber:function(r){return e("amber-".concat(r))},yellow:function(r){return e("yellow-".concat(r))},lime:function(r){return e("lime-".concat(r))},green:function(r){return e("green-".concat(r))},emerald:function(r){return e("emerald-".concat(r))},teal:function(r){return e("teal-".concat(r))},cyan:function(r){return e("cyan-".concat(r))},sky:function(r){return e("sky-".concat(r))},blue:function(r){return e("blue-".concat(r))},indigo:function(r){return e("indigo-".concat(r))},violet:function(r){return e("violet-".concat(r))},purple:function(r){return e("purple-".concat(r))},fuchsia:function(r){return e("fuchsia-".concat(r))},pink:function(r){return e("pink-".concat(r))},rose:function(r){return e("rose-".concat(r))},blackHex:function(){return i("black")},whiteHex:function(){return i("white")},slateHex:function(r){return i("slate-".concat(r))},grayHex:function(r){return i("gray-".concat(r))},zincHex:function(r){return i("zinc-".concat(r))},neutralHex:function(r){return i("neutral-".concat(r))},stoneHex:function(r){return i("stone-".concat(r))},redHex:function(r){return i("red-".concat(r))},orangeHex:function(r){return i("orange-".concat(r))},amberHex:function(r){return i("amber-".concat(r))},yellowHex:function(r){return i("yellow-".concat(r))},limeHex:function(r){return i("lime-".concat(r))},greenHex:function(r){return i("green-".concat(r))},emeraldHex:function(r){return i("emerald-".concat(r))},tealHex:function(r){return i("teal-".concat(r))},cyanHex:function(r){return i("cyan-".concat(r))},skyHex:function(r){return i("sky-".concat(r))},blueHex:function(r){return i("blue-".concat(r))},indigoHex:function(r){return i("indigo-".concat(r))},violetHex:function(r){return i("violet-".concat(r))},purpleHex:function(r){return i("purple-".concat(r))},fuchsiaHex:function(r){return i("fuchsia-".concat(r))},pinkHex:function(r){return i("pink-".concat(r))},roseHex:function(r){return i("rose-".concat(r))}}},v=m({}),w={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},x=function(r){var t=i(i({},w),r);return{px:function(r){var n=t[r];return"number"==typeof n?n:0},rem:function(r){var n=t[r];return"number"==typeof n?n/16:0},css:function(r){var n=t[r];return"number"==typeof n?"".concat(n,"px"):"0px"}}},O=x(void 0),H={primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},z=function(r,t){var n=i(i({},H),r),e=x(t),a=function(r){if(r.includes(".")){var t=r.split(".")[1];if(t&&"string"==typeof n[t])return n[t]}return"string"==typeof n[r]?n[r]:r};return{size:function(r){var t;return null!==(t=e.px(r))&&void 0!==t?t:0},format:function(r){var t,n=r.size,i=r.family,o=null!==(t=e.px(n))&&void 0!==t?t:0;return"".concat(o,"px '").concat(a(i),"'")},family:function(r){return a(r)},getAvailableFonts:function(){return Array.from(new Set(o(o([],Object.keys(H),!0),Object.keys(n),!0)))}}},S={0:0,5:.05,10:.1,15:.15,20:.2,25:.25,30:.3,35:.35,40:.4,45:.45,50:.5,55:.55,60:.6,65:.65,70:.7,75:.75,80:.8,85:.85,90:.9,95:.95,100:1},I=function(r){var t=i(i({},S),r),n=function(r){return"number"==typeof t[r]?t[r]:0};return{value:function(r){return n(r)},percent:function(r){return 100*n(r)},css:function(r){return"".concat(100*n(r),"%")}}},k=I(void 0),P={none:0,sm:2,default:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999},W=function(r){var t=i(i({},P),r),n=function(r){return"number"==typeof t[r]?t[r]:0};return{px:function(r){return n(r)},rem:function(r){return n(r)/16},css:function(r){return"".concat(n(r),"px")}}},j=W(void 0),A={sm:{blur:2,offsetX:1,offsetY:1,alpha:.15},md:{blur:4,offsetX:2,offsetY:2,alpha:.2},lg:{blur:6,offsetX:4,offsetY:4,alpha:.25},xl:{blur:8,offsetX:6,offsetY:6,alpha:.3},"2xl":{blur:12,offsetX:8,offsetY:8,alpha:.35},inner:{blur:4,offsetX:-2,offsetY:-2,alpha:.2}},C=function(r){var t=i(i({},A),r);return{get:function(r){return function(r){var n=t[r];return n&&"object"==typeof n?n:A.md}(r)}}},F=C(void 0),Y={0:0,px:1,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},D=function(r){var t=i(i({},Y),r),n=function(r){return"number"==typeof t[r]?t[r]:0};return{px:function(r){return n(r)},rem:function(r){return n(r)/16},css:function(r){return"".concat(n(r),"px")}}},E=D(void 0),M={fonts:{primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},fontSizes:i({},w),colors:{primary:"blue-600",secondary:"gray-600",success:"green-500",warning:"yellow-500",error:"red-500",info:"blue-400",background:"white",text:"gray-900",shadow:"black",overlay:"black"},spacing:i({},Y),opacity:i({},S),typography:{heading:{fontSize:"2xl",fontFamily:"fonts.display",fontWeight:600,lineHeight:1.2},"heading-large":{fontSize:"4xl",fontFamily:"fonts.display",fontWeight:700,lineHeight:1.1},body:{fontSize:"base",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.5},caption:{fontSize:"sm",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.4}},effects:{"shadow-sm":{blur:2,offsetY:1,color:"colors.shadow",alpha:.05},"shadow-md":{blur:4,offsetY:2,color:"colors.shadow",alpha:.1},"shadow-lg":{blur:8,offsetY:4,color:"colors.shadow",alpha:.1}},custom:{}},_={fonts:{primary:"Inter, system-ui, sans-serif",secondary:"Roboto, Arial, sans-serif",monospace:"Fira Code, Consolas, monospace",display:"Poppins, Inter, sans-serif"},fontSizes:i({},w),radius:i({},P),colors:{primary:"blue-400",secondary:"gray-400",success:"green-400",warning:"yellow-400",error:"red-400",info:"blue-300",background:"gray-900",text:"white",shadow:"black",overlay:"black"},spacing:i({},Y),opacity:i({},S),typography:{heading:{fontSize:"2xl",fontFamily:"fonts.display",fontWeight:600,lineHeight:1.2},"heading-large":{fontSize:"4xl",fontFamily:"fonts.display",fontWeight:700,lineHeight:1.1},body:{fontSize:"base",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.5},caption:{fontSize:"sm",fontFamily:"fonts.primary",fontWeight:400,lineHeight:1.4}},effects:{"shadow-sm":{blur:2,offsetY:1,color:"colors.shadow",alpha:.1},"shadow-md":{blur:4,offsetY:2,color:"colors.shadow",alpha:.15},"shadow-lg":{blur:8,offsetY:4,color:"colors.shadow",alpha:.2}},custom:{}},X=function(r){function t(t){var n=r.call(this,t)||this;return n.colorInstance=null,n.fontSizeInstance=null,n.spacingInstance=null,n.radiusInstance=null,n.opacityInstance=null,n.fontInstance=null,n.shadowInstance=null,n.theme=M,n}return e(t,r),t.prototype.init=function(r){var t=r.theme,n=r.darkMode,e=void 0!==n&&n;t?(this.theme=t,this.colorInstance=m(this.theme.colors),this.fontSizeInstance=x(this.theme.fontSizes),this.spacingInstance=D(this.theme.spacing),this.radiusInstance=W(this.theme.radius),this.opacityInstance=I(this.theme.opacity),this.fontInstance=z(this.theme.fonts,this.theme.fontSizes),this.shadowInstance=C(this.theme.effects)):this.theme=e?_:M},t.prototype.getTheme=function(){return this.theme},Object.defineProperty(t.prototype,"color",{get:function(){return this.colorInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.fontSizeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){return this.spacingInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.radiusInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"opacity",{get:function(){return this.opacityInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.fontInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadow",{get:function(){return this.shadowInstance},enumerable:!1,configurable:!0}),t}(t.Plugins.BasePlugin),T=function(r){function t(t){return r.call(this,t)||this}return e(t,r),t}(Phaser.Scene);r.Color=v,r.Column=g,r.DEFAULT_GAP=8,r.FontSize=O,r.Opacity=k,r.PHASER_WIND_KEY="pw",r.PhaserWindPlugin=X,r.Radius=j,r.Row=s,r.SceneWithPhaserWind=T,r.Shadow=F,r.Spacing=E,r.createColor=m,r.createFont=z,r.createFontSize=x,r.createOpacity=I,r.createRadius=W,r.createShadow=C,r.createSpacing=D,r.createTheme=function(r){return b({},M,r)},r.defaultDarkTheme=_,r.defaultLightTheme=M,r.defaultShadowMap=A,r.fontMap=H,r.fontSizeMap=w,r.getDisplayHeightOf=c,r.getDisplayWidthOf=a,r.getNormalizedOriginOf=u,r.isValidColor=h,r.merge=b,r.mergeDeep=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return b.apply(void 0,o([{},r],t,!1))},r.opacityMap=S,r.palette=p,r.radiusMap=P,r.spacingMap=Y,r.withPhaserWind=function(r){return r.plugins.get("pw")}});
|
package/dist/plugin/plugin.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Plugins } from 'phaser';
|
|
2
2
|
import { FontSizeApi, type SpacingApi, type FontApi, type ShadowApi } from '../core';
|
|
3
3
|
import { type Color } from '../core/color';
|
|
4
|
+
import { type OpacityApi } from '../core/opacity';
|
|
4
5
|
import { type RadiusApi } from '../core/radius';
|
|
5
6
|
import { BaseThemeConfig, ThemeOverride } from '../theme';
|
|
6
7
|
export declare const PHASER_WIND_KEY: string;
|
|
@@ -26,6 +27,7 @@ export declare class PhaserWindPlugin<T extends BaseThemeConfig> extends Plugins
|
|
|
26
27
|
private fontSizeInstance;
|
|
27
28
|
private spacingInstance;
|
|
28
29
|
private radiusInstance;
|
|
30
|
+
private opacityInstance;
|
|
29
31
|
private fontInstance;
|
|
30
32
|
private shadowInstance;
|
|
31
33
|
/** Current theme configuration */
|
|
@@ -65,6 +67,7 @@ export declare class PhaserWindPlugin<T extends BaseThemeConfig> extends Plugins
|
|
|
65
67
|
get fontSize(): FontSizeApi<T['fontSizes']>;
|
|
66
68
|
get spacing(): SpacingApi<T['spacing']>;
|
|
67
69
|
get radius(): RadiusApi<T['radius']>;
|
|
70
|
+
get opacity(): OpacityApi<T['opacity']>;
|
|
68
71
|
get font(): FontApi<T['fonts'], T['fontSizes']>;
|
|
69
72
|
get shadow(): ShadowApi<T['effects']>;
|
|
70
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAEL,WAAW,EAEX,KAAK,UAAU,EAGf,KAAK,OAAO,EACZ,KAAK,SAAS,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EACL,eAAe,EAGf,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,eAAe,EAAE,MAAa,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,aAAa,IAAI;IACpD,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF;;;GAGG;AACH,qBAAa,gBAAgB,CAC3B,CAAC,SAAS,eAAe,CACzB,SAAQ,OAAO,CAAC,UAAU;IAC1B,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,gBAAgB,CAA4C;IACpE,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,cAAc,CAAuC;IAC7D,OAAO,CAAC,YAAY,CAAoD;IACxE,OAAO,CAAC,cAAc,CAAwC;IAE9D,kCAAkC;IAClC,OAAO,CAAC,KAAK,CAAsB;IAEnC;;;OAGG;gBACS,aAAa,EAAE,OAAO,CAAC,aAAa;IAMhD;;;;;;;;;;;;;;;;;;;OAmBG;IACM,IAAI,CAAC,EAAE,KAAK,EAAE,QAAgB,EAAE,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,IAAI;
|
|
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,CAAC;AACxD,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EACL,eAAe,EAGf,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,eAAe,EAAE,MAAa,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,aAAa,IAAI;IACpD,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF;;;GAGG;AACH,qBAAa,gBAAgB,CAC3B,CAAC,SAAS,eAAe,CACzB,SAAQ,OAAO,CAAC,UAAU;IAC1B,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,gBAAgB,CAA4C;IACpE,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,cAAc,CAAuC;IAC7D,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,YAAY,CAAoD;IACxE,OAAO,CAAC,cAAc,CAAwC;IAE9D,kCAAkC;IAClC,OAAO,CAAC,KAAK,CAAsB;IAEnC;;;OAGG;gBACS,aAAa,EAAE,OAAO,CAAC,aAAa;IAMhD;;;;;;;;;;;;;;;;;;;OAmBG;IACM,IAAI,CAAC,EAAE,KAAK,EAAE,QAAgB,EAAE,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,IAAI;IAgCzE;;;OAGG;IACI,QAAQ,IAAI,CAAC,GAAG,eAAe;IAItC,IAAW,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAErC;IAED,IAAW,QAAQ,IAAI,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAEjD;IAED,IAAW,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAE7C;IAED,IAAW,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAE1C;IAED,IAAW,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAE7C;IAED,IAAW,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAErD;IAED,IAAW,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAE3C;CACF"}
|
package/dist/plugin/plugin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Plugins } from 'phaser';
|
|
2
2
|
import { createFontSize, createSpacing, createFont, createShadow, } from '../core';
|
|
3
3
|
import { createColor } from '../core/color';
|
|
4
|
+
import { createOpacity } from '../core/opacity';
|
|
4
5
|
import { createRadius } from '../core/radius';
|
|
5
6
|
import { defaultDarkTheme, defaultLightTheme, } from '../theme';
|
|
6
7
|
export const PHASER_WIND_KEY = 'pw';
|
|
@@ -13,6 +14,7 @@ export class PhaserWindPlugin extends Plugins.BasePlugin {
|
|
|
13
14
|
fontSizeInstance = null;
|
|
14
15
|
spacingInstance = null;
|
|
15
16
|
radiusInstance = null;
|
|
17
|
+
opacityInstance = null;
|
|
16
18
|
fontInstance = null;
|
|
17
19
|
shadowInstance = null;
|
|
18
20
|
/** Current theme configuration */
|
|
@@ -59,6 +61,7 @@ export class PhaserWindPlugin extends Plugins.BasePlugin {
|
|
|
59
61
|
this.fontSizeInstance = createFontSize(this.theme.fontSizes);
|
|
60
62
|
this.spacingInstance = createSpacing(this.theme.spacing);
|
|
61
63
|
this.radiusInstance = createRadius(this.theme.radius);
|
|
64
|
+
this.opacityInstance = createOpacity(this.theme.opacity);
|
|
62
65
|
this.fontInstance = createFont(this.theme.fonts, this.theme.fontSizes);
|
|
63
66
|
this.shadowInstance = createShadow(this.theme.effects);
|
|
64
67
|
}
|
|
@@ -81,6 +84,9 @@ export class PhaserWindPlugin extends Plugins.BasePlugin {
|
|
|
81
84
|
get radius() {
|
|
82
85
|
return this.radiusInstance;
|
|
83
86
|
}
|
|
87
|
+
get opacity() {
|
|
88
|
+
return this.opacityInstance;
|
|
89
|
+
}
|
|
84
90
|
get font() {
|
|
85
91
|
return this.fontInstance;
|
|
86
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EACL,cAAc,EAEd,aAAa,EAEb,UAAU,EACV,YAAY,GAGb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,eAAe,GAAW,IAAI,CAAC;AAe5C;;;GAGG;AACH,MAAM,OAAO,gBAEX,SAAQ,OAAO,CAAC,UAAU;IAClB,aAAa,GAA8B,IAAI,CAAC;IAChD,gBAAgB,GAAuC,IAAI,CAAC;IAC5D,eAAe,GAAoC,IAAI,CAAC;IACxD,cAAc,GAAkC,IAAI,CAAC;IACrD,YAAY,GAA+C,IAAI,CAAC;IAChE,cAAc,GAAmC,IAAI,CAAC;IAE9D,kCAAkC;IAC1B,KAAK,CAAsB;IAEnC;;;OAGG;IACH,YAAY,aAAoC;QAC9C,KAAK,CAAC,aAAa,CAAC,CAAC;QAErB,IAAI,CAAC,KAAK,GAAG,iBAAwC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACM,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAA2B;QAChE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,QAAQ;gBACnB,CAAC,CAAE,gBAAwC;gBAC3C,CAAC,CAAE,iBAAyC,CAAC;YAC/C,OAAO;QACT,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,GAAG,KAA4B,CAAC;QAC5C,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,WAAW,CAC9B,IAAI,CAAC,KAAK,CAAC,MAAqB,CACjC,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,cAAc,CACpC,IAAI,CAAC,KAAK,CAAC,SAA2B,CACvC,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,aAAa,CAClC,IAAI,CAAC,KAAK,CAAC,OAAuB,CACnC,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,YAAY,CAChC,IAAI,CAAC,KAAK,CAAC,MAAqB,CACjC,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,UAAU,CAC5B,IAAI,CAAC,KAAK,CAAC,KAAmB,EAC9B,IAAI,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"}
|
|
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,aAAa,EAAmB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,eAAe,GAAW,IAAI,CAAC;AAe5C;;;GAGG;AACH,MAAM,OAAO,gBAEX,SAAQ,OAAO,CAAC,UAAU;IAClB,aAAa,GAA8B,IAAI,CAAC;IAChD,gBAAgB,GAAuC,IAAI,CAAC;IAC5D,eAAe,GAAoC,IAAI,CAAC;IACxD,cAAc,GAAkC,IAAI,CAAC;IACrD,eAAe,GAAoC,IAAI,CAAC;IACxD,YAAY,GAA+C,IAAI,CAAC;IAChE,cAAc,GAAmC,IAAI,CAAC;IAE9D,kCAAkC;IAC1B,KAAK,CAAsB;IAEnC;;;OAGG;IACH,YAAY,aAAoC;QAC9C,KAAK,CAAC,aAAa,CAAC,CAAC;QAErB,IAAI,CAAC,KAAK,GAAG,iBAAwC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACM,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAA2B;QAChE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,QAAQ;gBACnB,CAAC,CAAE,gBAAwC;gBAC3C,CAAC,CAAE,iBAAyC,CAAC;YAC/C,OAAO;QACT,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,GAAG,KAA4B,CAAC;QAC5C,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,WAAW,CAC9B,IAAI,CAAC,KAAK,CAAC,MAAqB,CACjC,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,cAAc,CACpC,IAAI,CAAC,KAAK,CAAC,SAA2B,CACvC,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,aAAa,CAClC,IAAI,CAAC,KAAK,CAAC,OAAuB,CACnC,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,YAAY,CAChC,IAAI,CAAC,KAAK,CAAC,MAAqB,CACjC,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,aAAa,CAClC,IAAI,CAAC,KAAK,CAAC,OAAuB,CACnC,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,UAAU,CAC5B,IAAI,CAAC,KAAK,CAAC,KAAmB,EAC9B,IAAI,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,OAAO;QAChB,OAAO,IAAI,CAAC,eAA2C,CAAC;IAC1D,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.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
package/dist/scene/index.js
CHANGED
package/dist/scene/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
import { PhaserWindPlugin } from '../plugin/plugin';
|
|
2
2
|
import { BaseThemeConfig } from '../theme';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use {@link withPhaserWind} instead.
|
|
5
|
+
*
|
|
6
|
+
* Forces single inheritance, which conflicts with any user-defined `BaseScene`
|
|
7
|
+
* or other libraries that ship their own scene base class. It also relies on a
|
|
8
|
+
* non-null assertion (`pw!`) that lies to TypeScript about when the plugin is
|
|
9
|
+
* available — touching `this.pw` before the plugin mounts throws at runtime.
|
|
10
|
+
*
|
|
11
|
+
* Prefer the `withPhaserWind(scene)` accessor:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
15
|
+
* import type { ThemeType } from './theme';
|
|
16
|
+
*
|
|
17
|
+
* class MyScene extends Phaser.Scene {
|
|
18
|
+
* create() {
|
|
19
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Kept exported to avoid breaking existing consumers.
|
|
25
|
+
*/
|
|
3
26
|
export declare abstract class SceneWithPhaserWind<T extends BaseThemeConfig = BaseThemeConfig> extends Phaser.Scene {
|
|
4
27
|
/**
|
|
5
|
-
*
|
|
6
28
|
* @param config The scene key or scene specific configuration settings.
|
|
7
29
|
*/
|
|
8
30
|
constructor(config?: string | Phaser.Types.Scenes.SettingsConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-with-phaser-wind.d.ts","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,8BAAsB,mBAAmB,CACvC,CAAC,SAAS,eAAe,GAAG,eAAe,CAC3C,SAAQ,MAAM,CAAC,KAAK;IACpB
|
|
1
|
+
{"version":3,"file":"scene-with-phaser-wind.d.ts","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,mBAAmB,CACvC,CAAC,SAAS,eAAe,GAAG,eAAe,CAC3C,SAAQ,MAAM,CAAC,KAAK;IACpB;;OAEG;gBACS,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc;IAIzD,EAAE,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACjC"}
|
|
@@ -1,6 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use {@link withPhaserWind} instead.
|
|
3
|
+
*
|
|
4
|
+
* Forces single inheritance, which conflicts with any user-defined `BaseScene`
|
|
5
|
+
* or other libraries that ship their own scene base class. It also relies on a
|
|
6
|
+
* non-null assertion (`pw!`) that lies to TypeScript about when the plugin is
|
|
7
|
+
* available — touching `this.pw` before the plugin mounts throws at runtime.
|
|
8
|
+
*
|
|
9
|
+
* Prefer the `withPhaserWind(scene)` accessor:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
13
|
+
* import type { ThemeType } from './theme';
|
|
14
|
+
*
|
|
15
|
+
* class MyScene extends Phaser.Scene {
|
|
16
|
+
* create() {
|
|
17
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Kept exported to avoid breaking existing consumers.
|
|
23
|
+
*/
|
|
1
24
|
export class SceneWithPhaserWind extends Phaser.Scene {
|
|
2
25
|
/**
|
|
3
|
-
*
|
|
4
26
|
* @param config The scene key or scene specific configuration settings.
|
|
5
27
|
*/
|
|
6
28
|
constructor(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-with-phaser-wind.js","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAGA,MAAM,OAAgB,mBAEpB,SAAQ,MAAM,CAAC,KAAK;IACpB
|
|
1
|
+
{"version":3,"file":"scene-with-phaser-wind.js","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,mBAEpB,SAAQ,MAAM,CAAC,KAAK;IACpB;;OAEG;IACH,YAAY,MAAoD;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEM,EAAE,CAAuB;CACjC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Scene } from 'phaser';
|
|
2
|
+
import { PhaserWindPlugin } from '../plugin/plugin';
|
|
3
|
+
import { BaseThemeConfig } from '../theme';
|
|
4
|
+
/**
|
|
5
|
+
* Accessor for the Phaser Wind plugin from within a Phaser scene.
|
|
6
|
+
*
|
|
7
|
+
* Preferred over {@link SceneWithPhaserWind} (inheritance) and over module
|
|
8
|
+
* augmentation of `Phaser.Scene`, because it:
|
|
9
|
+
* - Composes with any existing base scene (no forced inheritance).
|
|
10
|
+
* - Keeps the theme type explicit at the call site (no silent `any`).
|
|
11
|
+
* - Doesn't rely on non-null assertions that lie about lifecycle.
|
|
12
|
+
*
|
|
13
|
+
* Call it inside `create()` / `update()` (after the plugin has been installed).
|
|
14
|
+
*
|
|
15
|
+
* @typeParam T - The theme config type. Pass your `ThemeType` to get
|
|
16
|
+
* type-narrowed access to your custom tokens.
|
|
17
|
+
* @param scene - The Phaser scene instance.
|
|
18
|
+
* @returns The Phaser Wind plugin instance bound to the given theme type.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { withPhaserWind } from 'phaser-wind';
|
|
23
|
+
* import type { ThemeType } from './theme';
|
|
24
|
+
*
|
|
25
|
+
* class MyScene extends Phaser.Scene {
|
|
26
|
+
* create() {
|
|
27
|
+
* const pw = withPhaserWind<ThemeType>(this);
|
|
28
|
+
* this.cameras.main.setBackgroundColor(pw.color.rgb('background'));
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const withPhaserWind: <T extends BaseThemeConfig = BaseThemeConfig>(scene: Scene) => PhaserWindPlugin<T>;
|
|
34
|
+
//# sourceMappingURL=with-phaser-wind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-phaser-wind.d.ts","sourceRoot":"","sources":["../../src/scene/with-phaser-wind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAmB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,eAAe,GAAG,eAAe,EACxE,OAAO,KAAK,KACX,gBAAgB,CAAC,CAAC,CACiD,CAAC"}
|