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