@energy8platform/shell 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/html.d.ts CHANGED
@@ -641,7 +641,7 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
641
641
  tokens: ShellTokens;
642
642
  layout: ShellLayoutMode;
643
643
  soundOn: boolean;
644
- readonly engineVersion = "0.11.0";
644
+ readonly engineVersion = "0.11.1";
645
645
  readonly actions: ShellActions;
646
646
  private renderer;
647
647
  private i18n;
@@ -800,7 +800,7 @@ declare function createI18n(opts: I18nOptions): I18n;
800
800
  declare const DISCLAIMER_LINES: readonly string[];
801
801
 
802
802
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
803
- declare const PACKAGE_VERSION = "0.11.0";
803
+ declare const PACKAGE_VERSION = "0.11.1";
804
804
 
805
805
  /**
806
806
  * What a scrollable region should ADVERTISE about itself.
package/dist/html.esm.js CHANGED
@@ -322,6 +322,20 @@ function nextTurbo(current, maxLevels) {
322
322
  return 0;
323
323
  return current >= maxLevels ? 0 : current + 1;
324
324
  }
325
+ /**
326
+ * Is a bonus buy unavailable right now?
327
+ *
328
+ * The three RUNTIME locks, in one place because they used to be in three: both bottom bars spelled
329
+ * them out for the coin, and the Shift+B hotkey spelled out a different, shorter set — so the
330
+ * keyboard opened the buy-bonus overlay mid-round and let a player stake a second bet on top of a
331
+ * round already in flight. A predicate the bars and the hotkey share cannot drift apart again.
332
+ *
333
+ * Runtime only. Whether the feature EXISTS at all is a config question (`features.buyBonus`), and
334
+ * whether this particular surface should offer it (mode, replay) belongs to the caller.
335
+ */
336
+ function bonusBuyLocked(s) {
337
+ return s.busy || s.autoplay.active || !s.buyBonusEnabled;
338
+ }
325
339
 
326
340
  /** The single brand accent (purple). The bar accent default (theme.ts) and the buy-a-bonus
327
341
  * card default both derive from this, so a rebrand only touches one constant. */
@@ -1624,7 +1638,9 @@ class KeyboardController {
1624
1638
  }
1625
1639
  break;
1626
1640
  case 'KeyB':
1627
- if (h.buyBonusEnabled && s.mode === 'base' && !s.replay) {
1641
+ // `bonusBuyLocked` is the same predicate the bar's coin uses. Without it this hotkey
1642
+ // reached past a disabled coin and opened the overlay mid-round.
1643
+ if (h.buyBonusEnabled && s.mode === 'base' && !s.replay && !bonusBuyLocked(s)) {
1628
1644
  h.openBuyBonus();
1629
1645
  return;
1630
1646
  }
@@ -1736,7 +1752,7 @@ function keyboardCapable(win = typeof window === 'undefined' ? undefined : windo
1736
1752
 
1737
1753
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
1738
1754
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
1739
- const PACKAGE_VERSION = '0.11.0';
1755
+ const PACKAGE_VERSION = '0.11.1';
1740
1756
 
1741
1757
  /** Apply defaults to the raw config (the mount target lives on the renderer, not here). */
1742
1758
  function resolveConfig(config) {
@@ -3343,7 +3359,7 @@ function applyBusy(host, bar) {
3343
3359
  const buy = bar.querySelector('[data-ge="buybonus"]');
3344
3360
  // disabled for the whole autoplay run (not just per-spin busy) so it doesn't flicker/pulse
3345
3361
  if (buy)
3346
- buy.disabled = busy || auto || !host.state.buyBonusEnabled;
3362
+ buy.disabled = bonusBuyLocked(host.state);
3347
3363
  }
3348
3364
 
3349
3365
  /** Cue diameter, mirrored in the stylesheet. Kept here because the cue is positioned in JS. */