@energy8platform/shell 0.6.3 → 0.6.5

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/pixi.cjs.js CHANGED
@@ -1221,12 +1221,19 @@ function normalizeLang(code) {
1221
1221
  return (LANG_SET.has(base) ? base : 'en');
1222
1222
  }
1223
1223
  function createI18n(opts) {
1224
- // Social is the `en-social` pseudo-locale: it rewrites the English source. Non-English locales are
1225
- // authored social-safe already, so `socialize` only runs on the English source string.
1224
+ // Social is the `en-social` pseudo-locale: it rewrites the English source into social-safe
1225
+ // vocabulary. The replacement dictionary only exists for English, so social mode FORCES English
1226
+ // the requested `language` is ignored, matching the `isSocial` contract ("…derived from English…
1227
+ // regardless of `language`"). Rendering a non-English locale in social mode would leak untranslated
1228
+ // restricted terms, so we never do it.
1229
+ if (opts.isSocial) {
1230
+ const t = (src) => socialize(src);
1231
+ return { lang: 'en', t };
1232
+ }
1226
1233
  const lang = normalizeLang(opts.language);
1227
1234
  const t = (src) => {
1228
1235
  if (lang === 'en')
1229
- return opts.isSocial ? socialize(src) : src;
1236
+ return src;
1230
1237
  return opts.messages?.[lang]?.[src] ?? LOCALES[lang]?.[src] ?? src;
1231
1238
  };
1232
1239
  return { lang, t };
@@ -1449,7 +1456,7 @@ class KeyboardController {
1449
1456
 
1450
1457
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
1451
1458
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
1452
- const PACKAGE_VERSION = '0.6.3';
1459
+ const PACKAGE_VERSION = '0.6.5';
1453
1460
 
1454
1461
  /** Apply defaults to the raw config (the mount target lives on the renderer, not here). */
1455
1462
  function resolveConfig(config) {
@@ -1927,6 +1934,11 @@ function makeText(str, opts) {
1927
1934
  if (opts.wrapWidth != null) {
1928
1935
  style.wordWrap = true;
1929
1936
  style.wordWrapWidth = opts.wrapWidth;
1937
+ // CJK (and any long unbroken run) has no spaces to wrap on — without breakWords the line
1938
+ // overflows the wrap width instead of wrapping. This is the single shell text helper (How to
1939
+ // Play, disclaimer, Game Info section titles, mode table, win messages, buy-bonus cards), so
1940
+ // one flag fixes wrapping everywhere.
1941
+ style.breakWords = true;
1930
1942
  }
1931
1943
  if (opts.lineHeight != null)
1932
1944
  style.lineHeight = opts.lineHeight;
@@ -5986,7 +5998,7 @@ class PixiRenderer {
5986
5998
  layer = openAutoplayPicker(this.ctx);
5987
5999
  break;
5988
6000
  case 'replay':
5989
- layer = buildReplayModal(this.ctx, req.opts, () => this.openReplayInternal(req.opts));
6001
+ layer = buildReplayModal(this.ctx, req.opts, () => this.host.openReplay(req.opts));
5990
6002
  break;
5991
6003
  case 'modal':
5992
6004
  layer = buildModal(this.ctx, req.opts);
@@ -6060,15 +6072,6 @@ class PixiRenderer {
6060
6072
  fitModals() {
6061
6073
  this.currentLayer?.fit?.();
6062
6074
  }
6063
- /** Replay's reopen path: a replay modal can rebuild itself (e.g. after a replay completes). It is
6064
- * routed back through the controller-equivalent open flow so the layer stack + backdrop stay in
6065
- * sync — mirrors PixiGameShell.openReplay (push a fresh replay modal). */
6066
- openReplayInternal(opts) {
6067
- if (this.destroyed)
6068
- return;
6069
- const layer = buildReplayModal(this.ctx, opts, () => this.openReplayInternal(opts));
6070
- this.pushLayer(layer);
6071
- }
6072
6075
  // ── frosted backdrop ─────────────────────────────────────────────────────────
6073
6076
  /** Snapshot the scene behind the modal layer and blur it — the Pixi analogue of the overlay's
6074
6077
  * `backdrop-filter: blur(20px) saturate(120%)`. Static (captured at open time): the game is paused
@@ -6165,6 +6168,7 @@ class PixiRenderer {
6165
6168
  get layout() { return host.layout; },
6166
6169
  get soundOn() { return host.soundOn; },
6167
6170
  get actions() { return host.actions; },
6171
+ openReplay: (opts) => host.openReplay(opts),
6168
6172
  t: (s) => host.t(s),
6169
6173
  formatCurrency: (n, win) => host.formatCurrency(n, win),
6170
6174
  emit: host.emit.bind(host),