@energy8platform/shell 0.10.0 → 0.11.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/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.10.0";
644
+ readonly engineVersion = "0.11.0";
645
645
  readonly actions: ShellActions;
646
646
  private renderer;
647
647
  private i18n;
@@ -800,7 +800,59 @@ 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.10.0";
803
+ declare const PACKAGE_VERSION = "0.11.0";
804
+
805
+ /**
806
+ * What a scrollable region should ADVERTISE about itself.
807
+ *
808
+ * A slot in a Stake popout is 400×225. At that size the game-info overlay holds twelve screens of
809
+ * content, the buy-bonus switches to a vertical card stack, and the menu popover hides its last
810
+ * row — all of them scroll, and (before this module) none of them said so. macOS makes it worse:
811
+ * overlay scrollbars stay invisible until something is already scrolling, so the very affordance a
812
+ * player needs BEFORE they touch anything is the one the OS withholds. A certification reviewer
813
+ * reads that as content the player can't reach.
814
+ *
815
+ * The maths lives here, apart from both renderers, for one reason: the DOM shell reads
816
+ * `scrollTop`/`scrollHeight` while the Pixi shell tracks its own offset against a mask, and those
817
+ * two must never disagree about whether a fade belongs at the bottom edge. Renderers decide how a
818
+ * thumb LOOKS; this decides when there is one and where it sits.
819
+ */
820
+ /**
821
+ * Shortest thumb we will draw, as a fraction of its track.
822
+ *
823
+ * The honest ratio for game info at Popout S is 8% — an 18px speck on a 226px track, which reads
824
+ * as a rendering artifact rather than a scrollbar. Floored at 18% it stays recognisably a thumb,
825
+ * and it still travels the whole track, so the position it reports remains truthful even though
826
+ * its length no longer is. That is the right trade: length is decoration, position is information.
827
+ */
828
+ declare const SCROLL_THUMB_MIN = 0.18;
829
+ /** One axis of a scroll region. Named for the Y axis because that is the common case; the
830
+ * buy-bonus strip passes its width metrics through the same fields. */
831
+ interface ScrollMetrics {
832
+ scrollTop: number;
833
+ scrollHeight: number;
834
+ clientHeight: number;
835
+ }
836
+ interface ScrollHint {
837
+ /** There is content past an edge — draw the affordance at all. */
838
+ overflowing: boolean;
839
+ /** Nothing above/left of the viewport: suppress the leading fade. */
840
+ atStart: boolean;
841
+ /** Nothing below/right of the viewport: suppress the trailing fade and the chevron. */
842
+ atEnd: boolean;
843
+ /** Thumb length as a fraction of the track, in `[SCROLL_THUMB_MIN, 1]`. */
844
+ thumbSize: number;
845
+ /** Thumb's leading edge as a fraction of the track, in `[0, 1 - thumbSize]`. */
846
+ thumbOffset: number;
847
+ /** Scrollable distance in pixels — 0 when the content fits. */
848
+ maxScroll: number;
849
+ }
850
+ /** Resolve one axis of a scroll region into everything a renderer needs to draw its affordance. */
851
+ declare function scrollHint(m: ScrollMetrics): ScrollHint;
852
+ /** The three-state tag both renderers put on a scroll region, so CSS and tests can name it.
853
+ * `none` when the content fits — the attribute is removed rather than set to it. */
854
+ type ScrollEdge = 'none' | 'start' | 'mid' | 'end';
855
+ declare function scrollEdge(h: ScrollHint): ScrollEdge;
804
856
 
805
857
  /** A shell: the renderer-agnostic controller plus the surface facade (safeArea/barHeight/setVisible)
806
858
  * an embedding host reads. `createShell`, `createGameShell` and `createPixiShell` all return this. */
@@ -880,5 +932,5 @@ declare function createGameShell(config: HtmlShellConfig): ShellController;
880
932
  /** Tear down the active shell (no argument — singleton). Resolves immediately when nothing is active. */
881
933
  declare function removeGameShell(): Promise<void>;
882
934
 
883
- export { DEFAULT_ACCENT, DEFAULT_MENU, DISCLAIMER_LINES, ShellController as GameShell, HtmlRenderer, PACKAGE_VERSION, POPOVER, SCHEMES, ShellController, createGameShell, createI18n, createShell, isPresetId, normalizeLang, placePopover, popoverWidth, rangeBounds, removeGameShell, resolveConfig, resolveMenu, resolveTheme, seedMenuValues, socialize };
884
- export type { AutoplayConfig, AutoplayOptions, BonusCardContext, BonusOption, BonusReadout, CellRef, CreateShellOptions, CurrencyConfig, FreeSpinsState, GameInfoContent, GameInfoSection, GameMode, HtmlShellConfig, I18n, I18nOptions, Lang, MenuHost, MenuItem, MenuPresetId, MenuRow, ModalAction, ModalOptions, OverlayHandle, OverlayRequest, PaylineDef, PaytableRow, PopoverPlacement, Rect as PopoverRect, ReplayModalOptions, ResolvedShellConfig, SafeArea, ShapeDef, Shell, ShellActions, HtmlShellConfig as ShellConfig, ShellEvents, ShellFeatures, ShellHost, ShellLayoutMode, ShellMode, ShellRenderer, ShellState, ShellSurface, ShellTokens, ThemeConfig, VolumeKey, VolumeLevels, WinSection };
935
+ export { DEFAULT_ACCENT, DEFAULT_MENU, DISCLAIMER_LINES, ShellController as GameShell, HtmlRenderer, PACKAGE_VERSION, POPOVER, SCHEMES, SCROLL_THUMB_MIN, ShellController, createGameShell, createI18n, createShell, isPresetId, normalizeLang, placePopover, popoverWidth, rangeBounds, removeGameShell, resolveConfig, resolveMenu, resolveTheme, scrollEdge, scrollHint, seedMenuValues, socialize };
936
+ export type { AutoplayConfig, AutoplayOptions, BonusCardContext, BonusOption, BonusReadout, CellRef, CreateShellOptions, CurrencyConfig, FreeSpinsState, GameInfoContent, GameInfoSection, GameMode, HtmlShellConfig, I18n, I18nOptions, Lang, MenuHost, MenuItem, MenuPresetId, MenuRow, ModalAction, ModalOptions, OverlayHandle, OverlayRequest, PaylineDef, PaytableRow, PopoverPlacement, Rect as PopoverRect, ReplayModalOptions, ResolvedShellConfig, SafeArea, ScrollEdge, ScrollHint, ScrollMetrics, ShapeDef, Shell, ShellActions, HtmlShellConfig as ShellConfig, ShellEvents, ShellFeatures, ShellHost, ShellLayoutMode, ShellMode, ShellRenderer, ShellState, ShellSurface, ShellTokens, ThemeConfig, VolumeKey, VolumeLevels, WinSection };
package/dist/html.esm.js CHANGED
@@ -1736,7 +1736,7 @@ function keyboardCapable(win = typeof window === 'undefined' ? undefined : windo
1736
1736
 
1737
1737
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
1738
1738
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
1739
- const PACKAGE_VERSION = '0.10.0';
1739
+ const PACKAGE_VERSION = '0.11.0';
1740
1740
 
1741
1741
  /** Apply defaults to the raw config (the mount target lives on the renderer, not here). */
1742
1742
  function resolveConfig(config) {
@@ -2222,6 +2222,66 @@ function placePopover(anchor, surface, size, pointer = null) {
2222
2222
  return { x, y, maxH, arrowX, below };
2223
2223
  }
2224
2224
 
2225
+ /**
2226
+ * What a scrollable region should ADVERTISE about itself.
2227
+ *
2228
+ * A slot in a Stake popout is 400×225. At that size the game-info overlay holds twelve screens of
2229
+ * content, the buy-bonus switches to a vertical card stack, and the menu popover hides its last
2230
+ * row — all of them scroll, and (before this module) none of them said so. macOS makes it worse:
2231
+ * overlay scrollbars stay invisible until something is already scrolling, so the very affordance a
2232
+ * player needs BEFORE they touch anything is the one the OS withholds. A certification reviewer
2233
+ * reads that as content the player can't reach.
2234
+ *
2235
+ * The maths lives here, apart from both renderers, for one reason: the DOM shell reads
2236
+ * `scrollTop`/`scrollHeight` while the Pixi shell tracks its own offset against a mask, and those
2237
+ * two must never disagree about whether a fade belongs at the bottom edge. Renderers decide how a
2238
+ * thumb LOOKS; this decides when there is one and where it sits.
2239
+ */
2240
+ /** Fractions of a pixel are layout rounding, not reachable content. */
2241
+ const EPSILON = 1;
2242
+ /** Landing within half a pixel of an edge counts as arriving: a browser settles a flung scroll on
2243
+ * 199.5 of 200, and a fade left glowing over content the player has already reached reads as a
2244
+ * bug. */
2245
+ const EDGE_EPSILON = 0.5;
2246
+ /**
2247
+ * Shortest thumb we will draw, as a fraction of its track.
2248
+ *
2249
+ * The honest ratio for game info at Popout S is 8% — an 18px speck on a 226px track, which reads
2250
+ * as a rendering artifact rather than a scrollbar. Floored at 18% it stays recognisably a thumb,
2251
+ * and it still travels the whole track, so the position it reports remains truthful even though
2252
+ * its length no longer is. That is the right trade: length is decoration, position is information.
2253
+ */
2254
+ const SCROLL_THUMB_MIN = 0.18;
2255
+ /** Resolve one axis of a scroll region into everything a renderer needs to draw its affordance. */
2256
+ function scrollHint(m) {
2257
+ const view = Math.max(0, m.clientHeight);
2258
+ const content = Math.max(0, m.scrollHeight);
2259
+ const maxScroll = Math.max(0, content - view);
2260
+ if (maxScroll <= EPSILON || view <= 0) {
2261
+ // Both edges are "the edge" when there is nowhere to go — callers gate every fade on the
2262
+ // matching flag, so a region that fits draws nothing without needing to check `overflowing`.
2263
+ return { overflowing: false, atStart: true, atEnd: true, thumbSize: 1, thumbOffset: 0, maxScroll: 0 };
2264
+ }
2265
+ const at = Math.max(0, Math.min(maxScroll, m.scrollTop));
2266
+ const thumbSize = Math.min(1, Math.max(SCROLL_THUMB_MIN, view / content));
2267
+ const progress = at / maxScroll;
2268
+ return {
2269
+ overflowing: true,
2270
+ atStart: at <= EDGE_EPSILON,
2271
+ atEnd: maxScroll - at <= EDGE_EPSILON,
2272
+ thumbSize,
2273
+ thumbOffset: progress * (1 - thumbSize),
2274
+ maxScroll,
2275
+ };
2276
+ }
2277
+ function scrollEdge(h) {
2278
+ if (!h.overflowing)
2279
+ return 'none';
2280
+ if (h.atStart)
2281
+ return 'start';
2282
+ return h.atEnd ? 'end' : 'mid';
2283
+ }
2284
+
2225
2285
  const NO_INSET = { top: 0, right: 0, bottom: 0, left: 0 };
2226
2286
  /** Create a shell with an explicit renderer instance (custom or a built-in HtmlRenderer/PixiRenderer).
2227
2287
  * Built-in renderers also have the createGameShell/createPixiShell sugar in /html and /pixi.
@@ -2425,6 +2485,68 @@ const SHELL_CSS = SHELL_FONT_CSS + SHELL_DIGIT_FONT_CSS + `
2425
2485
  transition:background .12s ease, color .12s ease; }
2426
2486
  #${SHELL_ROOT_ID} .ge-ov-nav:hover { background:var(--shell-plaque-glass); color:var(--shell-accent); }
2427
2487
  #${SHELL_ROOT_ID} .ge-ov-scroll { flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden; }
2488
+
2489
+ /* ═══ scroll affordance — "there is more, and you can reach it" ═══════════════════════════════
2490
+ A Stake popout is 400×225. Game info holds twelve screens there, buy-bonus stacks its cards, and
2491
+ the menu popover hides its last row. All of them scrolled already; none of them said so, and
2492
+ Stake rejected the build for it. macOS is the aggravating factor — its overlay scrollbars stay
2493
+ invisible until something is ALREADY scrolling, so the one moment a player needs the hint is the
2494
+ one moment the OS withholds it. Styling the scrollbar at all opts out of that behaviour.
2495
+
2496
+ Three layers, all keyed off data-scroll (written by attachScrollAffordance):
2497
+ 1. a persistent thumb — the standing "this scrolls" mark;
2498
+ 2. a mask fade at whichever edge hides content — the mask applies to the element's own box, so
2499
+ it does NOT travel with the content the way a child gradient would;
2500
+ 3. a chevron, shown only in the start state and retired for good on the first scroll.
2501
+ The end state deliberately gets no trailing fade: there is nothing left below to hint at. */
2502
+ /* Order matters here, and not for cascade reasons. Chromium honours the STANDARD scrollbar
2503
+ properties when they are present and then ignores ::-webkit-scrollbar entirely — and on macOS the
2504
+ standard properties leave the scrollbar in overlay mode, i.e. invisible until it is already
2505
+ moving. Defining ::-webkit-scrollbar with a width is what switches that scroller to a classic,
2506
+ always-painted, still-draggable scrollbar. So the standard properties are quarantined behind an
2507
+ @supports that only Firefox (which has no ::-webkit-scrollbar) satisfies. */
2508
+ @supports not selector(::-webkit-scrollbar) {
2509
+ #${SHELL_ROOT_ID} [data-scroll] { scrollbar-width:thin;
2510
+ scrollbar-color:var(--shell-scrollbar,rgba(255,255,255,.34)) transparent; } }
2511
+ #${SHELL_ROOT_ID} [data-scroll]::-webkit-scrollbar { width:6px; height:6px; }
2512
+ #${SHELL_ROOT_ID} [data-scroll]::-webkit-scrollbar-track { background:transparent; }
2513
+ #${SHELL_ROOT_ID} [data-scroll]::-webkit-scrollbar-thumb { border-radius:999px;
2514
+ background:var(--shell-scrollbar,rgba(255,255,255,.34)); }
2515
+ #${SHELL_ROOT_ID} [data-scroll]::-webkit-scrollbar-thumb:hover { background:var(--shell-accent); }
2516
+ /* Vertical fade. The stop pair is the same on both edges; only which edges are opaque changes.
2517
+ mask-composite-free on purpose — a single multi-stop gradient handles the two-edge case. */
2518
+ #${SHELL_ROOT_ID} [data-scroll="start"]:not([data-scroll-axis="x"]) {
2519
+ -webkit-mask-image:linear-gradient(to bottom, #000 calc(100% - 34px), transparent 100%);
2520
+ mask-image:linear-gradient(to bottom, #000 calc(100% - 34px), transparent 100%); }
2521
+ #${SHELL_ROOT_ID} [data-scroll="mid"]:not([data-scroll-axis="x"]) {
2522
+ -webkit-mask-image:linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 34px), transparent 100%);
2523
+ mask-image:linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 34px), transparent 100%); }
2524
+ #${SHELL_ROOT_ID} [data-scroll="end"]:not([data-scroll-axis="x"]) {
2525
+ -webkit-mask-image:linear-gradient(to bottom, transparent 0, #000 22px);
2526
+ mask-image:linear-gradient(to bottom, transparent 0, #000 22px); }
2527
+ /* Horizontal fade — the buy-bonus card strip. */
2528
+ #${SHELL_ROOT_ID} [data-scroll="start"][data-scroll-axis="x"] {
2529
+ -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 30px), transparent 100%);
2530
+ mask-image:linear-gradient(to right, #000 calc(100% - 30px), transparent 100%); }
2531
+ #${SHELL_ROOT_ID} [data-scroll="mid"][data-scroll-axis="x"] {
2532
+ -webkit-mask-image:linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 30px), transparent 100%);
2533
+ mask-image:linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 30px), transparent 100%); }
2534
+ #${SHELL_ROOT_ID} [data-scroll="end"][data-scroll-axis="x"] {
2535
+ -webkit-mask-image:linear-gradient(to right, transparent 0, #000 20px);
2536
+ mask-image:linear-gradient(to right, transparent 0, #000 20px); }
2537
+ /* The chevron. Its host is whatever box CONTAINS the scroller (overlay root / popover card), so it
2538
+ holds still while the content moves under it. */
2539
+ #${SHELL_ROOT_ID} .ge-scroll-cue { position:absolute; left:0; top:0; z-index:2;
2540
+ width:22px; height:22px; padding:3px; box-sizing:border-box;
2541
+ display:flex; align-items:center; justify-content:center; pointer-events:none;
2542
+ border-radius:50%; color:#fff; background:var(--shell-plaque-dark);
2543
+ box-shadow:0 2px 10px rgba(0,0,0,.45); animation:ge-scroll-cue 1.6s ease-in-out infinite; }
2544
+ @keyframes ge-scroll-cue {
2545
+ 0%,100% { transform:translateY(0); opacity:.85; }
2546
+ 50% { transform:translateY(4px); opacity:1; } }
2547
+ /* A player who has asked for stillness still needs the hint — keep the chevron, drop the bob. */
2548
+ @media (prefers-reduced-motion: reduce) {
2549
+ #${SHELL_ROOT_ID} .ge-scroll-cue { animation:none; opacity:.95; } }
2428
2550
  #${SHELL_ROOT_ID} .ge-ov-body { max-width:800px; margin:0 auto; box-sizing:border-box;
2429
2551
  padding:clamp(6px,2vh,16px) clamp(16px,4vw,24px) clamp(16px,4vh,28px); }
2430
2552
 
@@ -2786,7 +2908,9 @@ const SHELL_CSS = SHELL_FONT_CSS + SHELL_DIGIT_FONT_CSS + `
2786
2908
  card's font-size is the one knob (clamped for readability); everything inside is em-relative so
2787
2909
  the whole card scales as a unit. GameShell.fitModal() still transform-scales it down as a
2788
2910
  backstop for very short popouts. */
2789
- #${SHELL_ROOT_ID} .ge-modal-card { font-size:clamp(11px, 2cqmin, 15px); width:100%; max-width:28em; box-sizing:border-box;
2911
+ /* position:relative is here for the scroll cue: the card is the cue's containing block, so a
2912
+ capped, scrolling chip grid hints at its bottom edge rather than the screen's. */
2913
+ #${SHELL_ROOT_ID} .ge-modal-card { position:relative; font-size:clamp(11px, 2cqmin, 15px); width:100%; max-width:28em; box-sizing:border-box;
2790
2914
  overflow:hidden; transform-origin:center center; background:var(--shell-plaque-solid); border-radius:1.3em;
2791
2915
  display:flex; flex-direction:column; }
2792
2916
  /* ✕ pinned to the overlay corner (the screen), not the card */
@@ -3222,6 +3346,113 @@ function applyBusy(host, bar) {
3222
3346
  buy.disabled = busy || auto || !host.state.buyBonusEnabled;
3223
3347
  }
3224
3348
 
3349
+ /** Cue diameter, mirrored in the stylesheet. Kept here because the cue is positioned in JS. */
3350
+ const CUE_SIZE = 22;
3351
+ const CUE_GAP = 6;
3352
+ /** The chevron glyph, inline so it needs no icon-set entry and no font. */
3353
+ const CUE_SVG = '<svg viewBox="0 0 24 24" width="100%" height="100%" fill="none" stroke="currentColor" ' +
3354
+ 'stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M5 9l7 7 7-7"/></svg>';
3355
+ function attachScrollAffordance(el, opts = {}) {
3356
+ const axis = opts.axis ?? 'y';
3357
+ let cue = null;
3358
+ // Once the player scrolls they have discovered the gesture; re-offering it every time they
3359
+ // return to the top would nag rather than inform.
3360
+ let cueRetired = false;
3361
+ let destroyed = false;
3362
+ if (axis === 'x')
3363
+ el.dataset.scrollAxis = 'x';
3364
+ const removeCue = () => {
3365
+ cue?.remove();
3366
+ cue = null;
3367
+ };
3368
+ const showCue = () => {
3369
+ if (cue || cueRetired || opts.cue === false)
3370
+ return;
3371
+ const host = opts.cueHost ?? el.parentElement;
3372
+ if (!host)
3373
+ return;
3374
+ cue = document.createElement('div');
3375
+ cue.className = 'ge-scroll-cue';
3376
+ cue.setAttribute('aria-hidden', 'true');
3377
+ cue.innerHTML = CUE_SVG;
3378
+ host.appendChild(cue);
3379
+ positionCue();
3380
+ };
3381
+ /** Pin the cue to the bottom of the SCROLLER, not of its host. The buy-bonus overlay hangs a bet
3382
+ * bar below its scroll region, and a cue pinned to the host's bottom edge lands on top of it. */
3383
+ const positionCue = () => {
3384
+ if (!cue)
3385
+ return;
3386
+ const size = cue.offsetWidth || CUE_SIZE;
3387
+ if (axis === 'x') {
3388
+ cue.style.left = `${el.offsetLeft + el.offsetWidth - size - CUE_GAP}px`;
3389
+ cue.style.top = `${el.offsetTop + (el.offsetHeight - size) / 2}px`;
3390
+ }
3391
+ else {
3392
+ cue.style.left = `${el.offsetLeft + (el.offsetWidth - size) / 2}px`;
3393
+ cue.style.top = `${el.offsetTop + el.offsetHeight - size - CUE_GAP}px`;
3394
+ }
3395
+ };
3396
+ const sync = () => {
3397
+ if (destroyed)
3398
+ return;
3399
+ const h = axis === 'x'
3400
+ ? scrollHint({ scrollTop: el.scrollLeft, scrollHeight: el.scrollWidth, clientHeight: el.clientWidth })
3401
+ : scrollHint({ scrollTop: el.scrollTop, scrollHeight: el.scrollHeight, clientHeight: el.clientHeight });
3402
+ const edge = scrollEdge(h);
3403
+ if (edge === 'none') {
3404
+ delete el.dataset.scroll;
3405
+ removeCue();
3406
+ return;
3407
+ }
3408
+ el.dataset.scroll = edge;
3409
+ if (edge === 'start') {
3410
+ showCue();
3411
+ positionCue(); // the scroller can move/resize under a cue that is already up
3412
+ }
3413
+ else {
3414
+ removeCue();
3415
+ }
3416
+ };
3417
+ // Retirement is keyed off actual MOVEMENT, not off the event. A browser also fires `scroll` when
3418
+ // content reflows under a pinned offset, and a hint dismissed by a reflow the player never caused
3419
+ // is a hint they never saw.
3420
+ let lastPos = axis === 'x' ? el.scrollLeft : el.scrollTop;
3421
+ const onScroll = () => {
3422
+ const pos = axis === 'x' ? el.scrollLeft : el.scrollTop;
3423
+ if (pos !== lastPos) {
3424
+ lastPos = pos;
3425
+ cueRetired = true;
3426
+ removeCue();
3427
+ }
3428
+ sync();
3429
+ };
3430
+ el.addEventListener('scroll', onScroll, { passive: true });
3431
+ // Content in these regions is built asynchronously (fonts, images, a rebuilt body on resize), so
3432
+ // a single sync at mount would measure the wrong thing. ResizeObserver is absent in jsdom.
3433
+ const RO = globalThis.ResizeObserver;
3434
+ const ro = typeof RO === 'function' ? new RO(() => sync()) : null;
3435
+ if (ro) {
3436
+ ro.observe(el);
3437
+ if (el.firstElementChild)
3438
+ ro.observe(el.firstElementChild);
3439
+ }
3440
+ sync();
3441
+ return {
3442
+ sync,
3443
+ destroy() {
3444
+ if (destroyed)
3445
+ return;
3446
+ destroyed = true;
3447
+ el.removeEventListener('scroll', onScroll);
3448
+ ro?.disconnect();
3449
+ delete el.dataset.scroll;
3450
+ delete el.dataset.scrollAxis;
3451
+ removeCue();
3452
+ },
3453
+ };
3454
+ }
3455
+
3225
3456
  /** A centred CARD modal — frosted backdrop + opaque card with an accent title heading and an
3226
3457
  * overlay ✕ in the top-right. The shared chrome for every centred modal (buy-bonus confirm,
3227
3458
  * bet, autoplay, generic openModal). Append content to `body`; append full-bleed footer
@@ -3256,8 +3487,9 @@ function createCardModal(opts) {
3256
3487
  }
3257
3488
  return { root, card, body };
3258
3489
  }
3259
- /** Full-screen overlay. Returns { root, body, scroll }; append content to body.
3260
- * The `scroll` element is the scrollable container (overflow-y: auto). */
3490
+ /** Full-screen overlay. Returns { root, body, scroll, affordance }; append content to body.
3491
+ * The `scroll` element is the scrollable container (overflow-y: auto); `affordance` marks it as
3492
+ * scrollable once it overflows — call `affordance.sync()` after filling or resizing the body. */
3261
3493
  function createOverlay(opts) {
3262
3494
  const root = document.createElement('div');
3263
3495
  root.className = 'ge-shell-overlay';
@@ -3295,7 +3527,9 @@ function createOverlay(opts) {
3295
3527
  body.className = 'ge-ov-body';
3296
3528
  scroll.appendChild(body);
3297
3529
  root.append(head, scroll);
3298
- return { root, body, scroll };
3530
+ // The cue is hosted on `root`, not on `scroll`: `scroll` is the element that moves.
3531
+ const affordance = attachScrollAffordance(scroll, { cueHost: root });
3532
+ return { root, body, scroll, affordance };
3299
3533
  }
3300
3534
  /** A light-dismiss popover: a transparent full-surface layer (closes on pointerdown) holding a
3301
3535
  * card with an arrow that points at `pointer`. Append rows to `body`; call `position()` after the
@@ -3316,6 +3550,9 @@ function createPopover(opts) {
3316
3550
  // Clicks inside the card must not reach the dismiss layer.
3317
3551
  card.addEventListener('pointerdown', (e) => e.stopPropagation());
3318
3552
  root.addEventListener('pointerdown', opts.onClose);
3553
+ // The card clamps itself to `maxHeight` in position(), so the body's overflow is only knowable
3554
+ // after that runs — hence the sync at the end of position().
3555
+ const affordance = attachScrollAffordance(body, { cueHost: card });
3319
3556
  const resolveEl = (v) => typeof v === 'function' ? v() : (v ?? null);
3320
3557
  /** A rect in surface coordinates, or null when unresolved/fully zero-sized (a zero-HEIGHT rect —
3321
3558
  * e.g. a not-yet-laid-out anchor — is still considered valid, matching placePopover's own rule). */
@@ -3391,8 +3628,9 @@ function createPopover(opts) {
3391
3628
  arrow.style.display = '';
3392
3629
  arrow.style.left = `${p.arrowX / s}px`;
3393
3630
  }
3631
+ affordance.sync();
3394
3632
  };
3395
- return { root, card, body, position };
3633
+ return { root, card, body, affordance, position };
3396
3634
  }
3397
3635
 
3398
3636
  /** The bar menu, as a light-dismiss popover anchored to the burger. Rows come from the core model,
@@ -3543,7 +3781,7 @@ function buildRow(host, row, updaters, reposition) {
3543
3781
  const HOTKEYS_DEFAULT_ORDER = -0.5;
3544
3782
  const SVG_NS = 'http://www.w3.org/2000/svg';
3545
3783
  function openGameInfoModal(host) {
3546
- const { root, body, scroll } = createOverlay({
3784
+ const { root, body, scroll, affordance } = createOverlay({
3547
3785
  title: host.t('Game info'),
3548
3786
  onClose: () => host.actions.closeOverlay(),
3549
3787
  onBack: () => { root.remove(); host.actions.openMenu(); },
@@ -3569,6 +3807,8 @@ function openGameInfoModal(host) {
3569
3807
  .sort((a, b) => a.k - b.k || a.i - b.i)
3570
3808
  .forEach(({ s }) => body.appendChild(renderSection(host, s)));
3571
3809
  body.appendChild(versionFooter(host));
3810
+ // The body is filled after createOverlay returned, so its first honest measurement is here.
3811
+ affordance.sync();
3572
3812
  const LINE = 60;
3573
3813
  const PAGE = () => Math.floor(scroll.clientHeight * 0.9) || Math.floor(540 * 0.9);
3574
3814
  const onKey = (e) => {
@@ -3961,10 +4201,13 @@ function openBuyBonusOverlay(host) {
3961
4201
  if (bonuses === false || bonuses.length === 0)
3962
4202
  return null;
3963
4203
  const st = { focusIndex: -1, confirmBonus: undefined };
3964
- const { root, body } = createOverlay({ title: host.t('Buy bonus'), onClose: () => host.actions.closeOverlay() });
4204
+ const { root, body, affordance } = createOverlay({ title: host.t('Buy bonus'), onClose: () => host.actions.closeOverlay() });
3965
4205
  root.dataset.ge = 'buybonus-overlay';
4206
+ // The strip's own X-scroll affordance, rebuilt with the grid it describes.
4207
+ let gridAffordance = null;
3966
4208
  // Re-render the grid whenever the bet changes so every card's price stays live.
3967
4209
  const renderGrid = () => {
4210
+ gridAffordance?.destroy();
3968
4211
  body.innerHTML = '';
3969
4212
  const grid = document.createElement('div');
3970
4213
  grid.className = 'ge-bb-grid';
@@ -3990,6 +4233,11 @@ function openBuyBonusOverlay(host) {
3990
4233
  else {
3991
4234
  st.focusIndex = -1;
3992
4235
  }
4236
+ // Two axes, two affordances. Below a ~340px frame the CSS stacks the cards and the OVERLAY
4237
+ // scrolls vertically (see the ge-bb-frame container query); above it the STRIP scrolls
4238
+ // horizontally. Each is attached unconditionally and stays silent on the axis that fits.
4239
+ gridAffordance = attachScrollAffordance(grid, { axis: 'x', cue: false });
4240
+ affordance.sync();
3993
4241
  };
3994
4242
  renderGrid();
3995
4243
  root.appendChild(buildBetBar(host, renderGrid)); // thin bottom footer, only as tall as the pill
@@ -4320,6 +4568,9 @@ function buildSheet(opts) {
4320
4568
  grid.appendChild(chip);
4321
4569
  }
4322
4570
  ui.body.appendChild(grid);
4571
+ // A long bet ladder is capped at 50vh and scrolls; in a 225px popout that cap bites after two
4572
+ // rows. The cue hangs off the card, which holds still while the grid moves.
4573
+ attachScrollAffordance(grid, { cueHost: ui.card });
4323
4574
  function doConfirm() {
4324
4575
  opts.onConfirm(selected);
4325
4576
  opts.onClose();
@@ -4815,5 +5066,5 @@ function removeGameShell() {
4815
5066
  return shell.destroy();
4816
5067
  }
4817
5068
 
4818
- export { DEFAULT_ACCENT, DEFAULT_MENU, DISCLAIMER_LINES, ShellController as GameShell, HtmlRenderer, PACKAGE_VERSION, POPOVER, SCHEMES, ShellController, createGameShell, createI18n, createShell, isPresetId, normalizeLang, placePopover, popoverWidth, rangeBounds, removeGameShell, resolveConfig, resolveMenu, resolveTheme, seedMenuValues, socialize };
5069
+ export { DEFAULT_ACCENT, DEFAULT_MENU, DISCLAIMER_LINES, ShellController as GameShell, HtmlRenderer, PACKAGE_VERSION, POPOVER, SCHEMES, SCROLL_THUMB_MIN, ShellController, createGameShell, createI18n, createShell, isPresetId, normalizeLang, placePopover, popoverWidth, rangeBounds, removeGameShell, resolveConfig, resolveMenu, resolveTheme, scrollEdge, scrollHint, seedMenuValues, socialize };
4819
5070
  //# sourceMappingURL=html.esm.js.map