@energy8platform/shell 0.4.0 → 0.4.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
@@ -471,7 +471,7 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
471
471
  tokens: ShellTokens;
472
472
  layout: ShellLayoutMode;
473
473
  soundOn: boolean;
474
- readonly engineVersion = "0.4.0";
474
+ readonly engineVersion = "0.4.1";
475
475
  readonly actions: ShellActions;
476
476
  private renderer;
477
477
  private i18n;
@@ -537,7 +537,7 @@ interface I18n {
537
537
  declare function createI18n(opts: I18nOptions): I18n;
538
538
 
539
539
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
540
- declare const PACKAGE_VERSION = "0.4.0";
540
+ declare const PACKAGE_VERSION = "0.4.1";
541
541
 
542
542
  /** A shell: the renderer-agnostic controller plus the surface facade (safeArea/barHeight/setVisible)
543
543
  * an embedding host reads. `createShell`, `createGameShell` and `createPixiShell` all return this. */
package/dist/html.esm.js CHANGED
@@ -1436,7 +1436,7 @@ class KeyboardController {
1436
1436
 
1437
1437
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
1438
1438
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
1439
- const PACKAGE_VERSION = '0.4.0';
1439
+ const PACKAGE_VERSION = '0.4.1';
1440
1440
 
1441
1441
  /** Apply defaults to the raw config (the mount target lives on the renderer, not here). */
1442
1442
  function resolveConfig(config) {
@@ -1910,7 +1910,12 @@ const SHELL_CSS = SHELL_FONT_CSS + SHELL_DIGIT_FONT_CSS + `
1910
1910
  #${SHELL_ROOT_ID} .ge-gi-hk-block { display:flex; flex-direction:column; }
1911
1911
  #${SHELL_ROOT_ID} .ge-gi-hk { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 0; }
1912
1912
  #${SHELL_ROOT_ID} .ge-gi-hk + .ge-gi-hk { border-top:1px solid var(--shell-plaque-line); }
1913
- #${SHELL_ROOT_ID} .ge-gi-hk-chips { display:flex; align-items:center; flex-wrap:wrap; gap:4px; flex:0 0 auto; }
1913
+ /* Let the keycaps SHRINK instead of hogging the row: flex:0 1 auto lets the chips block give up
1914
+ width down to its widest single combo, and flex-wrap reflows the extra combos onto another line.
1915
+ On narrow/mobile widths the many-chip rows (Raise/Lower bet) otherwise squeeze the label off the
1916
+ right edge and clip it. (No min-width:0 here — the min-content floor is what keeps a combo intact
1917
+ and wrapping rather than overflowing.) */
1918
+ #${SHELL_ROOT_ID} .ge-gi-hk-chips { display:flex; align-items:center; flex-wrap:wrap; gap:4px; flex:0 1 auto; }
1914
1919
  #${SHELL_ROOT_ID} .ge-gi-hk-combo { display:inline-flex; align-items:center; gap:4px; }
1915
1920
  #${SHELL_ROOT_ID} .ge-gi-hk-chip { display:inline-flex; align-items:center; justify-content:center;
1916
1921
  padding:2px 7px; border-radius:6px; border:1px solid var(--shell-plaque-line);
@@ -1919,7 +1924,10 @@ const SHELL_CSS = SHELL_FONT_CSS + SHELL_DIGIT_FONT_CSS + `
1919
1924
  font-weight:600; line-height:1.5; white-space:nowrap; min-width:1.6em; text-align:center; }
1920
1925
  #${SHELL_ROOT_ID} .ge-gi-hk-sep { color:var(--shell-plaque-label); font-size:11px; padding:0 1px; }
1921
1926
  #${SHELL_ROOT_ID} .ge-gi-hk-sep2 { color:var(--shell-plaque-label); font-size:11px; padding:0 4px; }
1922
- #${SHELL_ROOT_ID} .ge-gi-hk-tx { color:rgba(255,255,255,.88); font-size:14px; font-weight:600; text-align:right; flex:1; }
1927
+ /* flex:1 1 auto (content-based basis, NOT flex:1's 0 basis) so the label keeps demanding its word
1928
+ width and shrinks in PROPORTION to the chips — both give ground and wrap, instead of the label
1929
+ collapsing to nothing. No min-width:0: the min-content floor stops a word being clipped. */
1930
+ #${SHELL_ROOT_ID} .ge-gi-hk-tx { color:rgba(255,255,255,.88); font-size:14px; font-weight:600; text-align:right; flex:1 1 auto; }
1923
1931
 
1924
1932
  /* controls — two blocks (gameplay / menu & info), icon/name/description per control */
1925
1933
  #${SHELL_ROOT_ID} .ge-gi-ctl-block + .ge-gi-ctl-block { margin-top:16px; padding-top:4px; border-top:1px solid var(--shell-plaque-line); }
@@ -1933,7 +1941,7 @@ const SHELL_CSS = SHELL_FONT_CSS + SHELL_DIGIT_FONT_CSS + `
1933
1941
  #${SHELL_ROOT_ID} .ge-gi-ctl-ic--bet { flex-direction:column; font-size:18px; gap:0; }
1934
1942
  /* buy bonus draws the real control-bar badge, scaled down & non-interactive */
1935
1943
  #${SHELL_ROOT_ID} .ge-gi-ctl-ic .ge-shell-buybonus { width:46px; height:46px; font-size:8px; border-width:2px; pointer-events:none; }
1936
- #${SHELL_ROOT_ID} .ge-gi-ctl-tx { display:flex; flex-direction:column; gap:2px; }
1944
+ #${SHELL_ROOT_ID} .ge-gi-ctl-tx { display:flex; flex-direction:column; gap:2px; min-width:0; }
1937
1945
  #${SHELL_ROOT_ID} .ge-gi-ctl-tx b { color:#fff; font-size:15px; font-weight:700; }
1938
1946
  #${SHELL_ROOT_ID} .ge-gi-ctl-tx span { color:rgba(255,255,255,.7); font-size:13px; line-height:1.4; }
1939
1947
 
@@ -2220,6 +2228,14 @@ const SHELL_CSS = SHELL_FONT_CSS + SHELL_DIGIT_FONT_CSS + `
2220
2228
  #${SHELL_ROOT_ID}.ge-mobile .ge-sheet-grid { grid-template-columns:repeat(var(--cols-m,var(--cols,3)),1fr); }
2221
2229
  /* the bet picker packs 6 chips/row → give its card room (autoplay & co. stay at the 28em default) */
2222
2230
  #${SHELL_ROOT_ID} .ge-sheet[data-ge="bet-modal"] .ge-modal-card { max-width:44em; }
2231
+ /* Bet chips carry variable-width currency (a wide currency makes labels grow). Reflow the columns
2232
+ to the widest label (--chip-min, computed in JS) so no chip is ever clipped, and cap the grid
2233
+ height so a long bet ladder scrolls instead of overflowing the card's clipped edge. */
2234
+ #${SHELL_ROOT_ID} .ge-sheet[data-ge="bet-modal"] .ge-sheet-grid,
2235
+ #${SHELL_ROOT_ID}.ge-mobile .ge-sheet[data-ge="bet-modal"] .ge-sheet-grid {
2236
+ grid-template-columns:repeat(auto-fill, minmax(min(100%, var(--chip-min, 6em)), 1fr));
2237
+ max-height:min(50vh, 28em); overflow-y:auto; overflow-x:hidden; }
2238
+ #${SHELL_ROOT_ID} .ge-sheet[data-ge="bet-modal"] .ge-chip { min-width:0; }
2223
2239
  #${SHELL_ROOT_ID} .ge-chip { pointer-events:auto; cursor:pointer; border:1px solid var(--shell-plaque-line);
2224
2240
  border-radius:.8em; background:rgba(255,255,255,.04); color:#fff; font-size:1em; font-weight:700;
2225
2241
  font-variant-numeric:tabular-nums; padding:.8em .55em; transition:background .12s ease, border-color .12s ease; }
@@ -3470,6 +3486,15 @@ function buildSheet(opts) {
3470
3486
  const cols = typeof opts.columns === 'number' ? { wide: opts.columns, mobile: opts.columns } : opts.columns;
3471
3487
  grid.style.setProperty('--cols', String(cols.wide));
3472
3488
  grid.style.setProperty('--cols-m', String(cols.mobile));
3489
+ if (opts.autoFit) {
3490
+ // Widest label in ch (tabular digits ≈ 1ch each; symbols/separators are narrower, so this
3491
+ // slightly over-estimates → safe) + chip padding/border. Floored so normal-width currencies
3492
+ // keep the compact ~6-per-row look and only wide currencies drop to fewer columns.
3493
+ const maxLen = opts.choices.reduce((m, c) => Math.max(m, c.label.length), 0);
3494
+ // Floor at 6em ≈ the natural width of a chip in the 6-wide layout (44em card): short labels
3495
+ // clamp here so a normal currency keeps 6 columns; wider labels raise it and drop to fewer.
3496
+ grid.style.setProperty('--chip-min', `max(6em, calc(${maxLen}ch + 1.4em))`);
3497
+ }
3473
3498
  let selected = opts.selected;
3474
3499
  let focusIndex = opts.choices.findIndex((c) => c.id === selected);
3475
3500
  if (focusIndex < 0)
@@ -3541,7 +3566,7 @@ function buildSheet(opts) {
3541
3566
  /** Bet picker — all available bets as chips (6 per row, 3 on mobile), accent Confirm applies it. */
3542
3567
  function openBetModal(host) {
3543
3568
  return buildSheet({
3544
- ge: 'bet-modal', title: host.t('Bet'), columns: { wide: 6, mobile: 3 }, confirmLabel: host.t('Confirm'),
3569
+ ge: 'bet-modal', title: host.t('Bet'), columns: { wide: 6, mobile: 3 }, autoFit: true, confirmLabel: host.t('Confirm'),
3545
3570
  choices: host.state.availableBets.map((b) => ({ id: String(b), label: host.formatCurrency(b) })),
3546
3571
  selected: String(host.state.bet),
3547
3572
  onClose: () => host.actions.closeOverlay(),