@rb-games/core 0.1.3 → 0.1.5

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.
Files changed (36) hide show
  1. package/dist/{chunk-DOHQE2YZ.js → chunk-C45KDREE.js} +46 -50
  2. package/dist/chunk-C45KDREE.js.map +1 -0
  3. package/dist/{chunk-RAEOBW6E.js → chunk-P4GCINNA.js} +3 -3
  4. package/dist/{chunk-RAEOBW6E.js.map → chunk-P4GCINNA.js.map} +1 -1
  5. package/dist/{chunk-YSLGJAV6.js → chunk-XHUPUPPW.js} +3 -5
  6. package/dist/chunk-XHUPUPPW.js.map +1 -0
  7. package/dist/engine/index.js +5 -6
  8. package/dist/engine/index.js.map +1 -1
  9. package/dist/helpers/index.js +4 -4
  10. package/dist/helpers/index.js.map +1 -1
  11. package/dist/i18n/index.js +2 -2
  12. package/dist/particle/index.js +109 -476
  13. package/dist/particle/index.js.map +1 -1
  14. package/dist/plugins/index.js +157 -202
  15. package/dist/plugins/index.js.map +1 -1
  16. package/dist/plugins/language/I18NextPlugin.types.d.ts +2 -1
  17. package/dist/plugins/language/I18NextPlugin.types.d.ts.map +1 -1
  18. package/dist/state-machine/index.js +1583 -11
  19. package/dist/state-machine/index.js.map +1 -1
  20. package/dist/store/index.js +3 -4
  21. package/dist/store/index.js.map +1 -1
  22. package/dist/ui/components/Skinable.d.ts.map +1 -1
  23. package/dist/ui/index.js +142 -191
  24. package/dist/ui/index.js.map +1 -1
  25. package/dist/utils/index.js +2 -2
  26. package/package.json +2 -11
  27. package/dist/chunk-DOHQE2YZ.js.map +0 -1
  28. package/dist/chunk-JHN6RF66.js +0 -1580
  29. package/dist/chunk-JHN6RF66.js.map +0 -1
  30. package/dist/chunk-YSLGJAV6.js.map +0 -1
  31. package/dist/vite/index.d.ts +0 -3
  32. package/dist/vite/index.d.ts.map +0 -1
  33. package/dist/vite/index.js +0 -128
  34. package/dist/vite/index.js.map +0 -1
  35. package/dist/vite/mergeLocalesPlugin.d.ts +0 -22
  36. package/dist/vite/mergeLocalesPlugin.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
- import { initSlotI18n, t, changeLanguage, getCurrentLanguage, isI18nReady, getI18nInstance } from '../chunk-RAEOBW6E.js';
1
+ import { initSlotI18n, t, changeLanguage, getCurrentLanguage, isI18nReady, getI18nInstance } from '../chunk-P4GCINNA.js';
2
2
  import { ENGINE_HOOKS } from '../chunk-MI6BP7A6.js';
3
3
  import { resolvePublicPath } from '../chunk-NQMORMNP.js';
4
- import { getLogger } from '../chunk-DOHQE2YZ.js';
4
+ import { getLogger } from '../chunk-C45KDREE.js';
5
5
  import { require_lodash } from '../chunk-NAQG7TMS.js';
6
6
  import { __toESM } from '../chunk-G3PMV62Z.js';
7
7
  import { EventEmitter, detectWebp, isMobile, Assets, Container, VERSION } from 'pixi.js';
@@ -11,30 +11,16 @@ import * as Sentry from '@sentry/browser';
11
11
  import { sound } from '@pixi/sound';
12
12
 
13
13
  var DeviceOptimizerPlugin = class {
14
- name = "deviceOptimizerPlugin";
15
- priority = 10;
16
- // Very early - before asset loading
17
- dependencies = [];
18
- // No dependencies
19
- config;
20
- deviceInfo = null;
21
- metrics = null;
22
- settings = null;
23
- performanceTier = "medium";
24
- isInitialized = false;
25
- /**
26
- * Detect WebP support using PIXI's native method
27
- */
28
- async detectWebP() {
29
- try {
30
- return await detectWebp.test();
31
- } catch (error) {
32
- return false;
33
- }
34
- }
35
- // Default tier settings - will be initialized in constructor
36
- defaultTierSettings;
37
14
  constructor(config = {}) {
15
+ this.name = "deviceOptimizerPlugin";
16
+ this.priority = 10;
17
+ // Very early - before asset loading
18
+ this.dependencies = [];
19
+ this.deviceInfo = null;
20
+ this.metrics = null;
21
+ this.settings = null;
22
+ this.performanceTier = "medium";
23
+ this.isInitialized = false;
38
24
  this.config = {
39
25
  enableAdvancedMetrics: false,
40
26
  // Safe default
@@ -151,6 +137,16 @@ var DeviceOptimizerPlugin = class {
151
137
  });
152
138
  }
153
139
  }
140
+ /**
141
+ * Detect WebP support using PIXI's native method
142
+ */
143
+ async detectWebP() {
144
+ try {
145
+ return await detectWebp.test();
146
+ } catch (error) {
147
+ return false;
148
+ }
149
+ }
154
150
  async initialize(engine) {
155
151
  try {
156
152
  this.deviceInfo = this.detectDevice();
@@ -659,21 +655,18 @@ var DeviceOptimizerPlugin = class {
659
655
  }
660
656
  };
661
657
  var ResourcePlugin = class {
662
- name = "resourcePlugin";
663
- priority = 50;
664
- dependencies = [];
665
- config;
666
- engine;
667
- isInitialized = false;
668
- // Asset management state
669
- bundleStates = /* @__PURE__ */ new Map();
670
- manifest = {};
671
- resolution = 1;
672
- resolutionSuffix;
673
- textureFormat = "png";
674
- /** Sound alias -> channel mapping collected from bundle configs */
675
- _soundChannelMappings = /* @__PURE__ */ new Map();
676
658
  constructor(config) {
659
+ this.name = "resourcePlugin";
660
+ this.priority = 50;
661
+ this.dependencies = [];
662
+ this.isInitialized = false;
663
+ // Asset management state
664
+ this.bundleStates = /* @__PURE__ */ new Map();
665
+ this.manifest = {};
666
+ this.resolution = 1;
667
+ this.textureFormat = "png";
668
+ /** Sound alias -> channel mapping collected from bundle configs */
669
+ this._soundChannelMappings = /* @__PURE__ */ new Map();
677
670
  this.config = {
678
671
  basePath: resolvePublicPath("assets/graphics/"),
679
672
  spineBasePath: resolvePublicPath("assets/spine/"),
@@ -1041,21 +1034,6 @@ var ResourcePlugin = class {
1041
1034
  }
1042
1035
  };
1043
1036
  var DisplayPlugin = class extends EventEmitter {
1044
- name = "displayPlugin";
1045
- priority = 900;
1046
- // Plugin that will be processed last
1047
- /**
1048
- * No dependencies - this is a core display plugin
1049
- */
1050
- dependencies = [];
1051
- _designWidth;
1052
- _designHeight;
1053
- _engine = null;
1054
- config;
1055
- isInitialized = false;
1056
- _currentOrientation = "landscape";
1057
- _activeConfig;
1058
- _lastResizeData = null;
1059
1037
  /**
1060
1038
  * Creates a new DisplayPlugin instance.
1061
1039
  *
@@ -1074,6 +1052,17 @@ var DisplayPlugin = class extends EventEmitter {
1074
1052
  */
1075
1053
  constructor(config) {
1076
1054
  super();
1055
+ this.name = "displayPlugin";
1056
+ this.priority = 900;
1057
+ // Plugin that will be processed last
1058
+ /**
1059
+ * No dependencies - this is a core display plugin
1060
+ */
1061
+ this.dependencies = [];
1062
+ this._engine = null;
1063
+ this.isInitialized = false;
1064
+ this._currentOrientation = "landscape";
1065
+ this._lastResizeData = null;
1077
1066
  this.config = config;
1078
1067
  if (this.config.priority !== void 0) {
1079
1068
  this.priority = this.config.priority;
@@ -1429,10 +1418,10 @@ function computeDesignViewportRect(data) {
1429
1418
  };
1430
1419
  }
1431
1420
  var EventBusPlugin = class extends EventEmitter {
1432
- name = "eventBusPlugin";
1433
- priority = 5;
1434
1421
  constructor() {
1435
1422
  super();
1423
+ this.name = "eventBusPlugin";
1424
+ this.priority = 5;
1436
1425
  }
1437
1426
  async initialize(_engine) {
1438
1427
  getLogger("EventBusPlugin").debug("Initialized");
@@ -1531,21 +1520,21 @@ var EventBusPlugin = class extends EventEmitter {
1531
1520
  }
1532
1521
  };
1533
1522
  var GsapPlugin = class {
1534
- /**
1535
- * Plugin name
1536
- */
1537
- name = "gsapPlugin";
1538
- /**
1539
- * High priority to ensure it runs before other plugins
1540
- */
1541
- priority = 100;
1542
- /**
1543
- * No dependencies - this is a core plugin
1544
- */
1545
- dependencies = [];
1546
- engine;
1547
- gsapTickerCallback;
1548
- isInitialized = false;
1523
+ constructor() {
1524
+ /**
1525
+ * Plugin name
1526
+ */
1527
+ this.name = "gsapPlugin";
1528
+ /**
1529
+ * High priority to ensure it runs before other plugins
1530
+ */
1531
+ this.priority = 100;
1532
+ /**
1533
+ * No dependencies - this is a core plugin
1534
+ */
1535
+ this.dependencies = [];
1536
+ this.isInitialized = false;
1537
+ }
1549
1538
  /**
1550
1539
  * Initializes the GSAP plugin.
1551
1540
  *
@@ -1932,12 +1921,11 @@ var INPUT_EVENTS = {
1932
1921
 
1933
1922
  // plugins/input/KeyboardManager.ts
1934
1923
  var KeyboardManager = class extends EventEmitter {
1935
- keys = /* @__PURE__ */ new Map();
1936
- justPressed = /* @__PURE__ */ new Set();
1937
- justReleased = /* @__PURE__ */ new Set();
1938
- config;
1939
1924
  constructor(config = {}) {
1940
1925
  super();
1926
+ this.keys = /* @__PURE__ */ new Map();
1927
+ this.justPressed = /* @__PURE__ */ new Set();
1928
+ this.justReleased = /* @__PURE__ */ new Set();
1941
1929
  this.config = config;
1942
1930
  getLogger("KeyboardManager").info("KeyboardManager initialized");
1943
1931
  this.setupListeners();
@@ -2096,32 +2084,24 @@ var KeyboardManager = class extends EventEmitter {
2096
2084
 
2097
2085
  // plugins/input/InputPlugin.ts
2098
2086
  var InputPlugin = class extends EventEmitter {
2099
- name = "inputPlugin";
2100
- priority = 150;
2101
- // Should run after GSAP and before other plugins
2102
- /**
2103
- * No dependencies - this is a core input plugin
2104
- */
2105
- dependencies = [];
2106
- // Input managers
2107
- keyboard;
2108
- // Managers to be added in the future:
2109
- // public mouse: MouseManager;
2110
- // public touch: TouchManager;
2111
- // public gamepad: GamepadManager;
2112
- _engine;
2113
- config;
2114
- isInitialized = false;
2115
- // Default configuration values
2116
- defaultConfig = {
2117
- priority: 150,
2118
- enabled: true,
2119
- repeatRate: 0.2,
2120
- // 5 repeats per second (200ms)
2121
- preventDefaultKeys: ["f11", "space", "arrowup", "arrowdown", "arrowleft", "arrowright"]
2122
- };
2123
2087
  constructor(config = {}) {
2124
2088
  super();
2089
+ this.name = "inputPlugin";
2090
+ this.priority = 150;
2091
+ // Should run after GSAP and before other plugins
2092
+ /**
2093
+ * No dependencies - this is a core input plugin
2094
+ */
2095
+ this.dependencies = [];
2096
+ this.isInitialized = false;
2097
+ // Default configuration values
2098
+ this.defaultConfig = {
2099
+ priority: 150,
2100
+ enabled: true,
2101
+ repeatRate: 0.2,
2102
+ // 5 repeats per second (200ms)
2103
+ preventDefaultKeys: ["f11", "space", "arrowup", "arrowdown", "arrowleft", "arrowright"]
2104
+ };
2125
2105
  this.config = { ...this.defaultConfig, ...config };
2126
2106
  if (this.config.priority !== void 0) {
2127
2107
  this.priority = this.config.priority;
@@ -2197,12 +2177,11 @@ var InputPlugin = class extends EventEmitter {
2197
2177
 
2198
2178
  // plugins/language/I18NextPlugin.ts
2199
2179
  var I18NextPlugin = class {
2200
- name = "i18nextPlugin";
2201
- priority = 900;
2202
- dependencies = [];
2203
- _engine = null;
2204
- config;
2205
2180
  constructor(config = {}) {
2181
+ this.name = "i18nextPlugin";
2182
+ this.priority = 900;
2183
+ this.dependencies = [];
2184
+ this._engine = null;
2206
2185
  this.config = {
2207
2186
  priority: 900,
2208
2187
  enabled: true
@@ -2256,18 +2235,16 @@ var I18NextPlugin = class {
2256
2235
 
2257
2236
  // plugins/scene/ScenePlugin.ts
2258
2237
  var ScenePlugin = class {
2259
- name = "scenePlugin";
2260
- priority = 90;
2261
- dependencies = [];
2262
- // No hard dependencies for now
2263
- engine = null;
2264
- currentScene = null;
2265
- scenes;
2266
- isTransitioning = false;
2267
- config;
2268
- root = null;
2269
2238
  // Initially defined as null
2270
2239
  constructor(config = {}) {
2240
+ this.name = "scenePlugin";
2241
+ this.priority = 90;
2242
+ this.dependencies = [];
2243
+ // No hard dependencies for now
2244
+ this.engine = null;
2245
+ this.currentScene = null;
2246
+ this.isTransitioning = false;
2247
+ this.root = null;
2271
2248
  this.scenes = /* @__PURE__ */ new Map();
2272
2249
  this.config = {
2273
2250
  priority: 90,
@@ -2443,7 +2420,6 @@ var Scene = class extends Container {
2443
2420
  this.label = sceneName;
2444
2421
  this.sortableChildren = true;
2445
2422
  }
2446
- engine;
2447
2423
  /**
2448
2424
  * Sets the engine reference.
2449
2425
  *
@@ -2602,17 +2578,16 @@ var Scene = class extends Container {
2602
2578
  }
2603
2579
  };
2604
2580
  var SentryPlugin = class {
2605
- name = "sentryPlugin";
2606
- priority = -1;
2607
- // Highest priority - this plugin will run first
2608
- /**
2609
- * No dependencies - this should be the first plugin to initialize
2610
- */
2611
- dependencies = [];
2612
- _engine = null;
2613
- config;
2614
- isInitialized = false;
2615
2581
  constructor(config) {
2582
+ this.name = "sentryPlugin";
2583
+ this.priority = -1;
2584
+ // Highest priority - this plugin will run first
2585
+ /**
2586
+ * No dependencies - this should be the first plugin to initialize
2587
+ */
2588
+ this.dependencies = [];
2589
+ this._engine = null;
2590
+ this.isInitialized = false;
2616
2591
  this.config = {
2617
2592
  priority: -1,
2618
2593
  enabled: true,
@@ -2781,18 +2756,15 @@ var ServiceActions = /* @__PURE__ */ ((ServiceActions2) => {
2781
2756
 
2782
2757
  // plugins/service/ServicePlugin.ts
2783
2758
  var ServicePlugin = class extends EventEmitter {
2784
- name = "servicePlugin";
2785
- priority = 15;
2786
- dependencies = ["eventBusPlugin"];
2787
- engine;
2788
- adapter;
2789
- config;
2790
- /** Cached session response */
2791
- _session = null;
2792
- /** Cached game config */
2793
- _gameConfig = null;
2794
2759
  constructor(config) {
2795
2760
  super();
2761
+ this.name = "servicePlugin";
2762
+ this.priority = 15;
2763
+ this.dependencies = ["eventBusPlugin"];
2764
+ /** Cached session response */
2765
+ this._session = null;
2766
+ /** Cached game config */
2767
+ this._gameConfig = null;
2796
2768
  this.config = {
2797
2769
  priority: 15,
2798
2770
  enabled: true,
@@ -2983,9 +2955,6 @@ var ServiceAdapter = class extends EventEmitter {
2983
2955
 
2984
2956
  // plugins/service/adapters/RGSAdapter.ts
2985
2957
  var RGSAdapter = class extends ServiceAdapter {
2986
- _sessionId;
2987
- baseUrl;
2988
- requestTimeout;
2989
2958
  constructor(config) {
2990
2959
  super();
2991
2960
  this._sessionId = config.sessionId;
@@ -3202,15 +3171,12 @@ async function resolvePublicIp(options = {}) {
3202
3171
 
3203
3172
  // plugins/service/adapters/DevAuthAdapter.ts
3204
3173
  var DevAdapter = class extends RGSAdapter {
3205
- createSessionData;
3206
- configIp;
3207
- queryParams;
3208
- _sessionCreated = false;
3209
3174
  constructor(config) {
3210
3175
  super({
3211
3176
  ...config,
3212
3177
  sessionId: ""
3213
3178
  });
3179
+ this._sessionCreated = false;
3214
3180
  this.configIp = config.ip;
3215
3181
  this.queryParams = new URLSearchParams(window.location.search);
3216
3182
  this.createSessionData = {
@@ -3293,11 +3259,6 @@ var DevAdapter = class extends RGSAdapter {
3293
3259
  // plugins/skin/Skin.ts
3294
3260
  var import_lodash = __toESM(require_lodash(), 1);
3295
3261
  var Skin = class extends EventEmitter {
3296
- data;
3297
- currentTheme;
3298
- defaultTheme;
3299
- id;
3300
- plugin;
3301
3262
  // SkinPlugin instance
3302
3263
  constructor(options, plugin) {
3303
3264
  super();
@@ -3430,16 +3391,15 @@ var Skin = class extends EventEmitter {
3430
3391
 
3431
3392
  // plugins/skin/SkinPlugin.ts
3432
3393
  var SkinPlugin = class {
3433
- name = "skinPlugin";
3434
- priority = 50;
3435
- dependencies = [];
3436
- skins = /* @__PURE__ */ new Map();
3437
- skinCache = /* @__PURE__ */ new Map();
3438
- globalTheme = "";
3439
- config;
3440
- isInitialized = false;
3441
- globalData = {};
3442
3394
  constructor(config = {}) {
3395
+ this.name = "skinPlugin";
3396
+ this.priority = 50;
3397
+ this.dependencies = [];
3398
+ this.skins = /* @__PURE__ */ new Map();
3399
+ this.skinCache = /* @__PURE__ */ new Map();
3400
+ this.globalTheme = "";
3401
+ this.isInitialized = false;
3402
+ this.globalData = {};
3443
3403
  this.config = {
3444
3404
  autoCleanup: true,
3445
3405
  enableCache: true,
@@ -3720,33 +3680,32 @@ var SkinPlugin = class {
3720
3680
  }
3721
3681
  };
3722
3682
  var SoundPlugin = class {
3723
- name = "SoundPlugin";
3724
- priority = 60;
3725
- dependencies = ["resourcePlugin"];
3726
- config;
3727
- /** Sprite alias -> sound alias + sprite key mapping */
3728
- spriteRegistry = /* @__PURE__ */ new Map();
3729
- /** Channel configurations */
3730
- channels = /* @__PURE__ */ new Map();
3731
- /** Currently playing instances by alias */
3732
- playingInstances = /* @__PURE__ */ new Map();
3733
- /** Sound alias -> channel mapping */
3734
- soundChannelMap = /* @__PURE__ */ new Map();
3735
- /** Master volume */
3736
- _masterVolume = 1;
3737
- /** Audio context unlocked flag */
3738
- _unlocked = false;
3739
- /** Active interval loop timers by alias */
3740
- intervalTimers = /* @__PURE__ */ new Map();
3741
- /** Active interval loop instance per alias — only this instance may schedule the next play */
3742
- activeLoopInstances = /* @__PURE__ */ new Map();
3743
- /** Store original PlayOptions for interval loops to restore on trigger/replay */
3744
- intervalLoopOptions = /* @__PURE__ */ new Map();
3745
- /** Store original volume for all playing sounds (for mute/unmute restore) */
3746
- soundVolumeMap = /* @__PURE__ */ new Map();
3747
- /** Group -> tracked instances for stopGroup support */
3748
- groupInstances = /* @__PURE__ */ new Map();
3749
3683
  constructor(config = {}) {
3684
+ this.name = "SoundPlugin";
3685
+ this.priority = 60;
3686
+ this.dependencies = ["resourcePlugin"];
3687
+ /** Sprite alias -> sound alias + sprite key mapping */
3688
+ this.spriteRegistry = /* @__PURE__ */ new Map();
3689
+ /** Channel configurations */
3690
+ this.channels = /* @__PURE__ */ new Map();
3691
+ /** Currently playing instances by alias */
3692
+ this.playingInstances = /* @__PURE__ */ new Map();
3693
+ /** Sound alias -> channel mapping */
3694
+ this.soundChannelMap = /* @__PURE__ */ new Map();
3695
+ /** Master volume */
3696
+ this._masterVolume = 1;
3697
+ /** Audio context unlocked flag */
3698
+ this._unlocked = false;
3699
+ /** Active interval loop timers by alias */
3700
+ this.intervalTimers = /* @__PURE__ */ new Map();
3701
+ /** Active interval loop instance per alias — only this instance may schedule the next play */
3702
+ this.activeLoopInstances = /* @__PURE__ */ new Map();
3703
+ /** Store original PlayOptions for interval loops to restore on trigger/replay */
3704
+ this.intervalLoopOptions = /* @__PURE__ */ new Map();
3705
+ /** Store original volume for all playing sounds (for mute/unmute restore) */
3706
+ this.soundVolumeMap = /* @__PURE__ */ new Map();
3707
+ /** Group -> tracked instances for stopGroup support */
3708
+ this.groupInstances = /* @__PURE__ */ new Map();
3750
3709
  this.config = {
3751
3710
  masterVolume: 1,
3752
3711
  autoUnlock: true,
@@ -11962,26 +11921,23 @@ new Semver("4.0.5");
11962
11921
 
11963
11922
  // plugins/sound/SoundTestGUI.ts
11964
11923
  var SoundTestGUI = class {
11965
- // Using 'any' because Tweakpane's Pane extends RootApi which extends FolderApi,
11966
- // but TypeScript doesn't properly infer the inherited methods
11967
- pane;
11968
- plugin;
11969
- playingFolder = null;
11970
- soundsFolder = null;
11971
- updateInterval = null;
11972
- lastSoundCount = 0;
11973
- params = {
11974
- masterVolume: 1,
11975
- groupName: "",
11976
- channelToStop: "music"
11977
- };
11978
- channelParams = {
11979
- music: { volume: 1, muted: false },
11980
- sfx: { volume: 1, muted: false },
11981
- voice: { volume: 1, muted: false },
11982
- ui: { volume: 1, muted: false }
11983
- };
11984
11924
  constructor(soundPlugin) {
11925
+ this.playingFolder = null;
11926
+ this.soundsFolder = null;
11927
+ this.updateInterval = null;
11928
+ this.lastSoundCount = 0;
11929
+ this.params = {
11930
+ masterVolume: 1,
11931
+ groupName: "",
11932
+ channelToStop: "music"
11933
+ };
11934
+ this.channelParams = {
11935
+ music: { volume: 1, muted: false },
11936
+ sfx: { volume: 1, muted: false },
11937
+ voice: { volume: 1, muted: false },
11938
+ ui: { volume: 1, muted: false }
11939
+ };
11940
+ this.expandedAliases = /* @__PURE__ */ new Set();
11985
11941
  this.plugin = soundPlugin;
11986
11942
  this.pane = new Pane({ title: "SoundPlugin Debug", expanded: true });
11987
11943
  const paneElement = this.pane.element;
@@ -12137,7 +12093,6 @@ var SoundTestGUI = class {
12137
12093
  this.playingFolder = this.pane.addFolder({ title: "Currently Playing", expanded: true });
12138
12094
  this.updatePlayingList();
12139
12095
  }
12140
- expandedAliases = /* @__PURE__ */ new Set();
12141
12096
  updatePlayingList() {
12142
12097
  if (!this.playingFolder) return;
12143
12098
  const children = [...this.playingFolder.children];