@energy8platform/shell 0.6.5 → 0.7.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.cjs.js +679 -113
- package/dist/html.cjs.js.map +1 -1
- package/dist/html.d.ts +213 -31
- package/dist/html.esm.js +672 -114
- package/dist/html.esm.js.map +1 -1
- package/dist/index.cjs.js +376 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +204 -29
- package/dist/index.esm.js +369 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/pixi.cjs.js +957 -285
- package/dist/pixi.cjs.js.map +1 -1
- package/dist/pixi.d.ts +208 -32
- package/dist/pixi.esm.js +950 -286
- package/dist/pixi.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/core/ShellController.ts +75 -21
- package/src/core/icon-names.ts +30 -0
- package/src/core/index.ts +4 -0
- package/src/core/menu.ts +301 -0
- package/src/core/popover.ts +81 -0
- package/src/core/renderer.ts +17 -12
- package/src/core/state.ts +2 -1
- package/src/core/types.ts +12 -6
- package/src/core/version.ts +1 -1
- package/src/ui/html/HtmlRenderer.ts +35 -12
- package/src/ui/html/components/GameInfo.ts +1 -1
- package/src/ui/html/components/Menu.ts +153 -0
- package/src/ui/html/icons.ts +16 -15
- package/src/ui/html/primitives.ts +142 -0
- package/src/ui/html/shell.css.ts +21 -1
- package/src/ui/pixi/PixiRenderer.ts +41 -21
- package/src/ui/pixi/components/BottomBar.ts +80 -9
- package/src/ui/pixi/components/GameInfo.ts +1 -1
- package/src/ui/pixi/components/Menu.ts +167 -0
- package/src/ui/pixi/context.ts +3 -2
- package/src/ui/pixi/icons.ts +16 -15
- package/src/ui/pixi/pixi-icon.ts +15 -3
- package/src/ui/pixi/primitives/controls.ts +46 -0
- package/src/ui/pixi/primitives/popover.ts +163 -0
- package/src/ui/pixi/primitives/scroll.ts +9 -5
- package/src/ui/html/components/Settings.ts +0 -68
- package/src/ui/pixi/components/Settings.ts +0 -132
package/dist/html.d.ts
CHANGED
|
@@ -16,13 +16,117 @@ declare class EventEmitter<TEvents extends {}> {
|
|
|
16
16
|
removeAllListeners(event?: keyof TEvents): this;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
declare const ICON_NAMES: readonly ["spin", "turbo1", "autoplay", "stop", "menu", "minus", "plus", "gift", "info", "soundOn", "soundOff", "close", "back", "chevronRight", "ticket", "turbo2", "turboOff", "chevronUp", "chevronDown"];
|
|
20
|
+
type IconName = (typeof ICON_NAMES)[number];
|
|
21
|
+
|
|
22
|
+
/** Built-in presets: the id alone is enough — the shell knows the label, icon and behaviour. */
|
|
23
|
+
type MenuPresetId = 'sound' | 'music' | 'sfx' | 'gameInfo';
|
|
24
|
+
declare function isPresetId(id: string): id is MenuPresetId;
|
|
25
|
+
interface MenuItemBase {
|
|
26
|
+
id: string;
|
|
27
|
+
/** Overrides the preset/default label. Run through the shell translator. */
|
|
28
|
+
label?: string;
|
|
29
|
+
icon?: IconName;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
}
|
|
32
|
+
type MenuPresetItem = {
|
|
33
|
+
id: MenuPresetId;
|
|
34
|
+
} & Omit<MenuItemBase, 'id'>;
|
|
35
|
+
type MenuToggleItem = {
|
|
36
|
+
type: 'toggle';
|
|
37
|
+
value?: boolean;
|
|
38
|
+
onChange?(v: boolean): void;
|
|
39
|
+
} & MenuItemBase;
|
|
40
|
+
type MenuRangeItem = {
|
|
41
|
+
type: 'range';
|
|
42
|
+
min?: number;
|
|
43
|
+
max?: number;
|
|
44
|
+
step?: number;
|
|
45
|
+
value?: number;
|
|
46
|
+
/** Right-hand readout. Defaults to percent for a 0..1 range, else the raw number. */
|
|
47
|
+
format?(v: number): string;
|
|
48
|
+
onChange?(v: number): void;
|
|
49
|
+
} & MenuItemBase;
|
|
50
|
+
type MenuButtonItem = {
|
|
51
|
+
type: 'button';
|
|
52
|
+
chevron?: boolean;
|
|
53
|
+
onSelect?(): void;
|
|
54
|
+
} & MenuItemBase;
|
|
55
|
+
type MenuSeparatorItem = {
|
|
56
|
+
type: 'separator';
|
|
57
|
+
};
|
|
58
|
+
type MenuItem = MenuPresetItem | MenuToggleItem | MenuRangeItem | MenuButtonItem | MenuSeparatorItem;
|
|
59
|
+
/** The rows shown when `ShellConfig.menu` is omitted — today's Settings content, minus master. */
|
|
60
|
+
declare const DEFAULT_MENU: MenuItem[];
|
|
61
|
+
/** What `resolveMenu` reads. `ShellController` satisfies it; tests can supply a small literal. */
|
|
62
|
+
interface MenuHost {
|
|
63
|
+
readonly menu: MenuItem[];
|
|
64
|
+
t(text: string): string;
|
|
65
|
+
getMenuValue(id: string): boolean | number | undefined;
|
|
66
|
+
setMenuValue(id: string, value: boolean | number): void;
|
|
67
|
+
readonly actions: {
|
|
68
|
+
openInfo(): void;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** A row, ready to draw: no preset knowledge left, no config shapes, just kind + accessors. */
|
|
72
|
+
type MenuRow = {
|
|
73
|
+
kind: 'separator';
|
|
74
|
+
} | {
|
|
75
|
+
kind: 'toggle';
|
|
76
|
+
id: string;
|
|
77
|
+
label: string;
|
|
78
|
+
disabled: boolean;
|
|
79
|
+
/** Glyph for the current value (the sound preset swaps speaker on/off). */
|
|
80
|
+
icon(value: boolean): IconName | undefined;
|
|
81
|
+
get(): boolean;
|
|
82
|
+
set(value: boolean): void;
|
|
83
|
+
} | {
|
|
84
|
+
kind: 'range';
|
|
85
|
+
id: string;
|
|
86
|
+
label: string;
|
|
87
|
+
icon?: IconName;
|
|
88
|
+
disabled: boolean;
|
|
89
|
+
min: number;
|
|
90
|
+
max: number;
|
|
91
|
+
step: number;
|
|
92
|
+
get(): number;
|
|
93
|
+
set(value: number): void;
|
|
94
|
+
format(value: number): string;
|
|
95
|
+
} | {
|
|
96
|
+
kind: 'button';
|
|
97
|
+
id: string;
|
|
98
|
+
label: string;
|
|
99
|
+
icon?: IconName;
|
|
100
|
+
disabled: boolean;
|
|
101
|
+
chevron: boolean;
|
|
102
|
+
select(): void;
|
|
103
|
+
};
|
|
104
|
+
/** Range bounds with defaults: 0..1 like a volume slider, step = a twentieth of the span. */
|
|
105
|
+
declare function rangeBounds(item: {
|
|
106
|
+
min?: number;
|
|
107
|
+
max?: number;
|
|
108
|
+
step?: number;
|
|
109
|
+
}): {
|
|
110
|
+
min: number;
|
|
111
|
+
max: number;
|
|
112
|
+
step: number;
|
|
113
|
+
};
|
|
114
|
+
/** Initial values for CUSTOM items (presets keep their own homes). Values already in `prev` win, so
|
|
115
|
+
* a later `setMenu()` with the same ids does not reset what the player has changed. */
|
|
116
|
+
declare function seedMenuValues(items: MenuItem[], prev?: Record<string, boolean | number>): Record<string, boolean | number>;
|
|
117
|
+
/** Expand the configured list into render-ready rows. A config mistake — an unknown preset id, an
|
|
118
|
+
* unrecognized custom `type`, or an invalid range span — is dropped with one warning rather than
|
|
119
|
+
* silently misbehaving: a typo must be visible, not silently invisible. A custom id that collides
|
|
120
|
+
* with a reserved preset id also warns, but keeps its row (see `custom()`). */
|
|
121
|
+
declare function resolveMenu(host: MenuHost): MenuRow[];
|
|
122
|
+
|
|
19
123
|
/** `freeSpins` and `bonus` are the SAME bar layout (host-driven hero + Total Win); `freeSpins` is
|
|
20
124
|
* kept as a back-compat alias for the common case (its readout is derived current/total), while
|
|
21
125
|
* `bonus` pairs with `setBonus()` to show a game-supplied label + value (adventure, hold-and-spin,
|
|
22
126
|
* respins — anything that isn't a plain free-spins counter). */
|
|
23
127
|
type ShellMode = 'base' | 'bonus' | 'freeSpins' | 'replay';
|
|
24
|
-
/** The
|
|
25
|
-
type VolumeKey = '
|
|
128
|
+
/** The two independent volume sliders shown in the bar menu. */
|
|
129
|
+
type VolumeKey = 'music' | 'sfx';
|
|
26
130
|
type VolumeLevels = Record<VolumeKey, number>;
|
|
27
131
|
interface CurrencyConfig {
|
|
28
132
|
symbol: string;
|
|
@@ -287,11 +391,13 @@ interface ShellConfig {
|
|
|
287
391
|
onBonusBuy?: () => void;
|
|
288
392
|
/** Initial Settings-overlay volume slider positions (each 0..1, defaults to 1 = 100%). The shell
|
|
289
393
|
* keeps them stateful across opens; read/update at runtime via `shell.getVolume()` /
|
|
290
|
-
* `shell.setVolume()`, and listen to `settingChange` ({ key: '
|
|
394
|
+
* `shell.setVolume()`, and listen to `settingChange` ({ key: 'music'|'sfx' }) to apply. */
|
|
291
395
|
volumes?: Partial<VolumeLevels>;
|
|
396
|
+
/** Bar-menu items, in order. Omit for the default list (sound, music, sfx, ─, game info). */
|
|
397
|
+
menu?: MenuItem[];
|
|
292
398
|
}
|
|
293
399
|
/** ShellConfig after the controller applies defaults (version, isSocial, replay, theme). No mount. */
|
|
294
|
-
type ResolvedShellConfig = Required<Pick<ShellConfig, 'language' | 'currency' | 'availableBets' | 'defaultBet' | 'balance' | 'win' | 'mode' | 'features' | 'gameInfo' | 'version' | 'isSocial' | 'replay'>> & Pick<ShellConfig, 'currentBet' | 'theme' | 'onBonusBuy' | 'volumes'>;
|
|
400
|
+
type ResolvedShellConfig = Required<Pick<ShellConfig, 'language' | 'currency' | 'availableBets' | 'defaultBet' | 'balance' | 'win' | 'mode' | 'features' | 'gameInfo' | 'version' | 'isSocial' | 'replay'>> & Pick<ShellConfig, 'currentBet' | 'theme' | 'onBonusBuy' | 'volumes' | 'menu'>;
|
|
295
401
|
interface ShellState {
|
|
296
402
|
mode: ShellMode;
|
|
297
403
|
/** Sticky replay marker — true for a historical-round replay, regardless of the current
|
|
@@ -316,9 +422,11 @@ interface ShellState {
|
|
|
316
422
|
/** The currently activated `feature` option (e.g. Ante), or null. Drives the
|
|
317
423
|
* effective-bet readout tint and the BUY BONUS → DISABLE toggle on the bar. */
|
|
318
424
|
activeFeature: BonusOption | null;
|
|
319
|
-
/** Volume slider positions (0..1)
|
|
320
|
-
* reopened overlay reflects the last-set positions instead of resetting to 100%. */
|
|
425
|
+
/** Volume slider positions (0..1) for the two sliders in the menu. */
|
|
321
426
|
volumes: VolumeLevels;
|
|
427
|
+
/** Values of CUSTOM menu items, keyed by id. Seeded from the item list; preset values live in
|
|
428
|
+
* their own homes (`soundOn`, `volumes`) and are reached through `getMenuValue`. */
|
|
429
|
+
menu: Record<string, boolean | number>;
|
|
322
430
|
}
|
|
323
431
|
interface ShellEvents {
|
|
324
432
|
spin: void;
|
|
@@ -390,15 +498,15 @@ interface ShellRenderer {
|
|
|
390
498
|
setLayout(layout: ShellLayoutMode): void;
|
|
391
499
|
/** Apply colour tokens (CSS vars in DOM / repaint in Pixi). */
|
|
392
500
|
applyTheme(tokens: ShellTokens): void;
|
|
393
|
-
/** Count a money readout from→to on the freshly-rendered bar (DOM rAF / Pixi ticker).
|
|
394
|
-
|
|
501
|
+
/** Count a money readout from→to on the freshly-rendered bar (DOM rAF / Pixi ticker).
|
|
502
|
+
* `durationMs` overrides the renderer's default count-up length — a cascade/tumble scene
|
|
503
|
+
* reporting a win per step needs each count-up to fit inside its step. */
|
|
504
|
+
animateMoney(field: 'balance' | 'win', from: number, to: number, durationMs?: number): void;
|
|
395
505
|
/** Build + show an overlay from a controller-supplied model; return a handle for key routing
|
|
396
506
|
* and programmatic close. Returns void when nothing was shown. */
|
|
397
507
|
openOverlay(req: OverlayRequest): OverlayHandle | void;
|
|
398
508
|
/** Tear down any open overlay. */
|
|
399
509
|
closeOverlay(): void;
|
|
400
|
-
/** If the open overlay registered a sound-icon refresher, the controller calls this to refresh it. */
|
|
401
|
-
refreshSoundIcon?(on: boolean): void;
|
|
402
510
|
/** Fade out + remove all nodes; resolve when gone. */
|
|
403
511
|
destroy(): Promise<void> | void;
|
|
404
512
|
/** Insets a scene should avoid (only the bottom bar is reserved; the rest is full-bleed). */
|
|
@@ -437,17 +545,21 @@ interface ShellHost {
|
|
|
437
545
|
emit: EventEmitter<ShellEvents>['emit'];
|
|
438
546
|
/** Renderer reports its surface size; the controller recomputes layout + re-renders. */
|
|
439
547
|
notifyResize(w: number, h: number): void;
|
|
440
|
-
/** Flip shared sound state (emits settingChange + refreshes an open
|
|
548
|
+
/** Flip shared sound state (emits settingChange + refreshes an open menu's sound icon). */
|
|
441
549
|
setSound(on: boolean): void;
|
|
442
|
-
/**
|
|
443
|
-
setSoundRefresh(fn: ((on: boolean) => void) | null): void;
|
|
444
|
-
/** Current volume slider position (0..1) for master/music/sfx. */
|
|
550
|
+
/** Current volume slider position (0..1) for music/sfx. */
|
|
445
551
|
getVolume(key: VolumeKey): number;
|
|
446
552
|
/** Set a volume slider (0..1): clamps, stores, emits `settingChange`, and live-updates an open
|
|
447
|
-
*
|
|
553
|
+
* menu. Called by the slider control on drag AND by game code as the public API. */
|
|
448
554
|
setVolume(key: VolumeKey, value: number): void;
|
|
449
|
-
/**
|
|
450
|
-
|
|
555
|
+
/** The configured menu items (see core/menu.ts). */
|
|
556
|
+
readonly menu: MenuItem[];
|
|
557
|
+
/** Current value of a menu item — presets included (sound → soundOn, music/sfx → volumes). */
|
|
558
|
+
getMenuValue(id: string): boolean | number | undefined;
|
|
559
|
+
/** Set a menu value: clamps ranges, stores, emits `settingChange`, refreshes an open menu. */
|
|
560
|
+
setMenuValue(id: string, value: boolean | number): void;
|
|
561
|
+
/** An open menu registers a row updater here (null clears it on close). */
|
|
562
|
+
setMenuRefresh(fn: ((id: string, value: boolean | number) => void) | null): void;
|
|
451
563
|
/** Logic-bearing actions invoked by renderer controls. */
|
|
452
564
|
readonly actions: ShellActions;
|
|
453
565
|
/** Re-show the replay summary modal through the controller (keeps its OverlayHandle in sync).
|
|
@@ -485,7 +597,7 @@ interface OverlayHandle {
|
|
|
485
597
|
close(): void;
|
|
486
598
|
}
|
|
487
599
|
type OverlayRequest = {
|
|
488
|
-
kind: '
|
|
600
|
+
kind: 'menu';
|
|
489
601
|
} | {
|
|
490
602
|
kind: 'gameInfo';
|
|
491
603
|
} | {
|
|
@@ -516,14 +628,15 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
|
|
|
516
628
|
tokens: ShellTokens;
|
|
517
629
|
layout: ShellLayoutMode;
|
|
518
630
|
soundOn: boolean;
|
|
519
|
-
readonly engineVersion = "0.
|
|
631
|
+
readonly engineVersion = "0.7.0";
|
|
520
632
|
readonly actions: ShellActions;
|
|
521
633
|
private renderer;
|
|
522
634
|
private i18n;
|
|
523
635
|
private kbd?;
|
|
524
636
|
private overlay;
|
|
525
|
-
private
|
|
526
|
-
private
|
|
637
|
+
private menuItems;
|
|
638
|
+
private menuRefresh;
|
|
639
|
+
private overlayKind;
|
|
527
640
|
private prevBalance;
|
|
528
641
|
private prevWin;
|
|
529
642
|
private destroyed;
|
|
@@ -536,7 +649,9 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
|
|
|
536
649
|
private attachKeyboard;
|
|
537
650
|
private pullFocus;
|
|
538
651
|
private show;
|
|
652
|
+
/** Open the bar menu. Called again while it is open, it closes it — the burger toggles. */
|
|
539
653
|
openMenu(): void;
|
|
654
|
+
/** @deprecated The Settings overlay is gone — this opens the bar menu. */
|
|
540
655
|
openSettings(): void;
|
|
541
656
|
openInfo(): void;
|
|
542
657
|
openBuyBonus(): void;
|
|
@@ -547,22 +662,32 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
|
|
|
547
662
|
/** Programmatically dismiss whatever overlay/modal is open. No-op when nothing is shown. */
|
|
548
663
|
closeModal(): void;
|
|
549
664
|
setSound(on: boolean): void;
|
|
550
|
-
setSoundRefresh(fn: ((on: boolean) => void) | null): void;
|
|
551
665
|
getVolume(key: VolumeKey): number;
|
|
552
666
|
/** Set a volume slider (0..1). Shared by the slider control (drag) and game code (public API):
|
|
553
|
-
* clamps, stores so a reopened
|
|
554
|
-
* live-updates the slider if the
|
|
667
|
+
* clamps, stores so a reopened menu popover reflects it, emits `settingChange`, and
|
|
668
|
+
* live-updates the slider if the menu is currently open. */
|
|
555
669
|
setVolume(key: VolumeKey, value: number): void;
|
|
556
|
-
|
|
670
|
+
get menu(): MenuItem[];
|
|
671
|
+
/** Replace the item list. Values of ids already in state are kept; new ids are seeded. */
|
|
672
|
+
setMenu(items: MenuItem[]): void;
|
|
673
|
+
getMenuValue(id: string): boolean | number | undefined;
|
|
674
|
+
/** Set a menu value. Presets route to their own homes so there is never a second copy. */
|
|
675
|
+
setMenuValue(id: string, value: boolean | number): void;
|
|
676
|
+
setMenuRefresh(fn: ((id: string, value: boolean | number) => void) | null): void;
|
|
677
|
+
/** Clamp to the declared bounds of a custom `range` item (a non-range id passes through). */
|
|
678
|
+
private clampRange;
|
|
557
679
|
activateFeature(bonus: BonusOption): void;
|
|
558
680
|
deactivateFeature(): void;
|
|
559
681
|
private money;
|
|
560
682
|
setBalance(n: number): void;
|
|
561
683
|
/** Set the WIN readout. Counts up/down from the previous value by default. Pass
|
|
562
684
|
* `{ animate: false }` to SNAP instantly (renderBar cancels any in-flight count-up) — used by the
|
|
563
|
-
* host to clear WIN to 0 at spin start, where an animated count-DOWN would look wrong.
|
|
685
|
+
* host to clear WIN to 0 at spin start, where an animated count-DOWN would look wrong.
|
|
686
|
+
* `{ durationMs }` shortens/lengthens the count-up (default 450ms) — a scene reporting a win per
|
|
687
|
+
* cascade step passes its step length so each count-up finishes before the next step lands. */
|
|
564
688
|
setWin(n: number, opts?: {
|
|
565
689
|
animate?: boolean;
|
|
690
|
+
durationMs?: number;
|
|
566
691
|
}): void;
|
|
567
692
|
setBet(n: number): void;
|
|
568
693
|
setMode(mode: ShellMode): void;
|
|
@@ -582,6 +707,56 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
|
|
|
582
707
|
destroy(): Promise<void>;
|
|
583
708
|
}
|
|
584
709
|
|
|
710
|
+
/** Geometry for the bar-menu popover. Pure math over rectangles so the DOM and Pixi renderers
|
|
711
|
+
* place it identically — the renderers only supply measured sizes and apply the result. */
|
|
712
|
+
interface Rect {
|
|
713
|
+
x: number;
|
|
714
|
+
y: number;
|
|
715
|
+
w: number;
|
|
716
|
+
h: number;
|
|
717
|
+
}
|
|
718
|
+
interface Surface {
|
|
719
|
+
w: number;
|
|
720
|
+
h: number;
|
|
721
|
+
}
|
|
722
|
+
interface PopoverPlacement {
|
|
723
|
+
/** Top-left of the popover card, in surface coordinates. */
|
|
724
|
+
x: number;
|
|
725
|
+
y: number;
|
|
726
|
+
/** True space on the chosen side, in surface coordinates; may be less than minH on a very short surface. The row list scrolls inside it. */
|
|
727
|
+
maxH: number;
|
|
728
|
+
/** Arrow centre, relative to the card's left edge. `-1` when there is no anchor to point at. */
|
|
729
|
+
arrowX: number;
|
|
730
|
+
/** True when the card opens below the anchor (arrow flips to the top edge). */
|
|
731
|
+
below: boolean;
|
|
732
|
+
}
|
|
733
|
+
declare const POPOVER: {
|
|
734
|
+
/** Keep-out from the surface edges. */
|
|
735
|
+
readonly margin: 8;
|
|
736
|
+
/** Space between the anchor and the card. */
|
|
737
|
+
readonly gap: 8;
|
|
738
|
+
/** Minimum distance from the arrow tip to either rounded corner. */
|
|
739
|
+
readonly arrowInset: 14;
|
|
740
|
+
/** A card shorter than this does not fit — flip to the other side instead. */
|
|
741
|
+
readonly minH: 120;
|
|
742
|
+
readonly minW: 220;
|
|
743
|
+
readonly maxW: 320;
|
|
744
|
+
};
|
|
745
|
+
/** Card width: content width clamped to [minW, maxW] and never wider than the surface. */
|
|
746
|
+
declare function popoverWidth(surfaceW: number, contentW: number): number;
|
|
747
|
+
/** Place the card above the `anchor` (below if it does not fit), left-aligned to it and clamped
|
|
748
|
+
* inside the surface. `anchor === null` (no bar / hidden shell) centres it, arrow off.
|
|
749
|
+
*
|
|
750
|
+
* `anchor` drives PLACEMENT (x, y, maxH, below) — normally the bar's whole plaque ("plate"), so the
|
|
751
|
+
* card sits flush with the bar as a whole rather than with whichever control opened it. `pointer` is
|
|
752
|
+
* the (optional) rect the ARROW points at — normally the burger button, which can sit anywhere
|
|
753
|
+
* inside the plate. Defaults to `anchor` when omitted, so every caller that only ever had one rect
|
|
754
|
+
* (i.e. every caller before `pointer` existed) keeps behaving exactly as it did before. */
|
|
755
|
+
declare function placePopover(anchor: Rect | null, surface: Surface, size: {
|
|
756
|
+
w: number;
|
|
757
|
+
h: number;
|
|
758
|
+
}, pointer?: Rect | null): PopoverPlacement;
|
|
759
|
+
|
|
585
760
|
/** Rewrite restricted gambling terms in `text` to social-safe phrasing, preserving case. */
|
|
586
761
|
declare function socialize(text: string): string;
|
|
587
762
|
type Lang = 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hi' | 'id' | 'ja' | 'ko' | 'pl' | 'pt' | 'ru' | 'tr' | 'vi' | 'zh' | 'da';
|
|
@@ -598,7 +773,7 @@ interface I18n {
|
|
|
598
773
|
declare function createI18n(opts: I18nOptions): I18n;
|
|
599
774
|
|
|
600
775
|
/** The @energy8platform/shell package version, stamped into the game-info footer. */
|
|
601
|
-
declare const PACKAGE_VERSION = "0.
|
|
776
|
+
declare const PACKAGE_VERSION = "0.7.0";
|
|
602
777
|
|
|
603
778
|
/** A shell: the renderer-agnostic controller plus the surface facade (safeArea/barHeight/setVisible)
|
|
604
779
|
* an embedding host reads. `createShell`, `createGameShell` and `createPixiShell` all return this. */
|
|
@@ -624,7 +799,11 @@ declare class HtmlRenderer implements ShellRenderer {
|
|
|
624
799
|
private ro;
|
|
625
800
|
private moneyAnims;
|
|
626
801
|
private modalOnKey;
|
|
802
|
+
private popoverPosition;
|
|
627
803
|
private destroyed;
|
|
804
|
+
/** The scale factor last applied to the bar by applyFitScale() — exposed so the menu popover can
|
|
805
|
+
* match it exactly (see getBarScale) rather than re-derive its own, possibly-disagreeing, value. */
|
|
806
|
+
private barScale;
|
|
628
807
|
/** MutationObserver for buy-bonus confirm fit — fires fitModals() when nodes are added
|
|
629
808
|
* inside the modalHost (e.g. the confirm dialog appended after the grid is open). */
|
|
630
809
|
private mutObs;
|
|
@@ -636,13 +815,16 @@ declare class HtmlRenderer implements ShellRenderer {
|
|
|
636
815
|
applyTheme(tokens: ShellTokens): void;
|
|
637
816
|
renderBar(): void;
|
|
638
817
|
setLayout(): void;
|
|
639
|
-
animateMoney(field: 'balance' | 'win', from: number, to: number): void;
|
|
818
|
+
animateMoney(field: 'balance' | 'win', from: number, to: number, durationMs?: number): void;
|
|
640
819
|
openOverlay(req: OverlayRequest): OverlayHandle | void;
|
|
641
820
|
closeOverlay(): void;
|
|
642
|
-
refreshSoundIcon?(_on: boolean): void;
|
|
643
821
|
destroy(): Promise<void>;
|
|
644
822
|
/** Trigger a bar fit-scale pass (used by tests that stub geometry after the initial render). */
|
|
645
823
|
fitBar(): void;
|
|
824
|
+
/** The scale factor applyFitScale() last applied to the bar — the menu popover multiplies its own
|
|
825
|
+
* card by this SAME number so its typography/padding/row-heights carry the same visual weight
|
|
826
|
+
* relationship the bar has, instead of ignoring the viewport like a fixed-px card would. */
|
|
827
|
+
getBarScale(): number;
|
|
646
828
|
private cancelMoneyAnims;
|
|
647
829
|
private buildOverlay;
|
|
648
830
|
private showModal;
|
|
@@ -671,5 +853,5 @@ declare function createGameShell(config: HtmlShellConfig): ShellController;
|
|
|
671
853
|
/** Tear down the active shell (no argument — singleton). Resolves immediately when nothing is active. */
|
|
672
854
|
declare function removeGameShell(): Promise<void>;
|
|
673
855
|
|
|
674
|
-
export { DEFAULT_ACCENT, ShellController as GameShell, HtmlRenderer, PACKAGE_VERSION, SCHEMES, ShellController, createGameShell, createI18n, createShell, normalizeLang, removeGameShell, resolveConfig, resolveTheme, socialize };
|
|
675
|
-
export type { AutoplayConfig, AutoplayOptions, BonusCardContext, BonusOption, BonusReadout, CellRef, CreateShellOptions, CurrencyConfig, FreeSpinsState, GameInfoContent, GameInfoSection, GameMode, HtmlShellConfig, I18n, I18nOptions, Lang, ModalAction, ModalOptions, OverlayHandle, OverlayRequest, PaylineDef, PaytableRow, ReplayModalOptions, ResolvedShellConfig, SafeArea, ShapeDef, Shell, ShellActions, HtmlShellConfig as ShellConfig, ShellEvents, ShellFeatures, ShellHost, ShellLayoutMode, ShellMode, ShellRenderer, ShellState, ShellSurface, ShellTokens, ThemeConfig, VolumeKey, VolumeLevels, WinSection };
|
|
856
|
+
export { DEFAULT_ACCENT, DEFAULT_MENU, ShellController as GameShell, HtmlRenderer, PACKAGE_VERSION, POPOVER, SCHEMES, ShellController, createGameShell, createI18n, createShell, isPresetId, normalizeLang, placePopover, popoverWidth, rangeBounds, removeGameShell, resolveConfig, resolveMenu, resolveTheme, seedMenuValues, socialize };
|
|
857
|
+
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 };
|