@energy8platform/shell 0.7.0 → 0.7.2

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
@@ -138,6 +138,9 @@ interface CurrencyConfig {
138
138
  * trimmed down to this many places so small wins keep their significant digits (e.g. 0.0673)
139
139
  * while round amounts stay compact (e.g. 0.30). Everything else is shown at exactly this many. */
140
140
  minDecimals?: number;
141
+ /** Defaults to the platform convention: `{ thousands: ',', decimal: '.' }` → `€1,234.50`.
142
+ * Override only for a jurisdiction that requires another convention — a comma decimal reads
143
+ * as a thousands group to most players and inflates the perceived payout. */
141
144
  separator?: {
142
145
  thousands?: string;
143
146
  decimal?: string;
@@ -628,7 +631,7 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
628
631
  tokens: ShellTokens;
629
632
  layout: ShellLayoutMode;
630
633
  soundOn: boolean;
631
- readonly engineVersion = "0.7.0";
634
+ readonly engineVersion = "0.7.2";
632
635
  readonly actions: ShellActions;
633
636
  private renderer;
634
637
  private i18n;
@@ -773,7 +776,7 @@ interface I18n {
773
776
  declare function createI18n(opts: I18nOptions): I18n;
774
777
 
775
778
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
776
- declare const PACKAGE_VERSION = "0.7.0";
779
+ declare const PACKAGE_VERSION = "0.7.2";
777
780
 
778
781
  /** A shell: the renderer-agnostic controller plus the surface facade (safeArea/barHeight/setVisible)
779
782
  * an embedding host reads. `createShell`, `createGameShell` and `createPixiShell` all return this. */
package/dist/html.esm.js CHANGED
@@ -401,15 +401,19 @@ function resolveTheme(theme = {}) {
401
401
  * trailing zeros are trimmed down to (but never past) `minDecimals`, so small wins keep their
402
402
  * significant digits. Balance / bet / prices stay fixed at `minDecimals`.
403
403
  *
404
+ * Separators default to the platform convention — `.` decimal, `,` thousands (`€1,234.50`).
405
+ * A comma decimal is NOT safe as a default: players read "2,50" as 250 and believe they were
406
+ * paid far more than they were. Games that need another convention pass `currency.separator`.
407
+ *
404
408
  * Example with `maxDecimals: 4, minDecimals: 2`:
405
- * fixed → 0.0673 → 0,07 0.3 → 0,30
406
- * variable → 0.0673 → 0,0673 0.067 → 0,067 0.3 → 0,30 0 → 0,00
409
+ * fixed → 0.0673 → 0.07 0.3 → 0.30
410
+ * variable → 0.0673 → 0.0673 0.067 → 0.067 0.3 → 0.30 0 → 0.00
407
411
  */
408
412
  function formatCurrency(value, currency, variableDecimals = false) {
409
413
  const maxDecimals = currency.maxDecimals ?? 2;
410
414
  const minDecimals = Math.max(0, Math.min(maxDecimals, currency.minDecimals ?? maxDecimals));
411
- const thousands = currency.separator?.thousands ?? '.';
412
- const decimal = currency.separator?.decimal ?? ',';
415
+ const thousands = currency.separator?.thousands ?? ',';
416
+ const decimal = currency.separator?.decimal ?? '.';
413
417
  const safe = Number.isFinite(value) ? value : 0;
414
418
  // fixed callers round at minDecimals; variable callers round at maxDecimals then trim back down.
415
419
  const places = variableDecimals ? maxDecimals : minDecimals;
@@ -1687,7 +1691,7 @@ class KeyboardController {
1687
1691
 
1688
1692
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
1689
1693
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
1690
- const PACKAGE_VERSION = '0.7.0';
1694
+ const PACKAGE_VERSION = '0.7.2';
1691
1695
 
1692
1696
  /** Apply defaults to the raw config (the mount target lives on the renderer, not here). */
1693
1697
  function resolveConfig(config) {