@open-slot-ui/core 0.0.1 → 0.1.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/index.d.cts CHANGED
@@ -1069,8 +1069,10 @@ declare const RGS_ERROR_KEYS: Readonly<Record<string, {
1069
1069
  }>>;
1070
1070
  /** The default dismiss action used when a notice supplies none. */
1071
1071
  declare const DEFAULT_NOTICE_ACTION: NoticeAction;
1072
- /** Build the title + message blocks for an error/notice (used by `showError`). */
1073
- declare function errorBlocks(message: string, title: string, tone: NonNullable<NoticeOptions['tone']>): BlockSpec[];
1072
+ /** Build the title + message blocks for an error/notice (used by `showError`).
1073
+ * The Figma "default" modal is plain: a heading + body text (no tinted callout).
1074
+ * `tone` is kept for API compatibility but no longer changes the rendering. */
1075
+ declare function errorBlocks(message: string, title: string, _tone: NonNullable<NoticeOptions['tone']>): BlockSpec[];
1074
1076
 
1075
1077
  /**
1076
1078
  * i18n port (Charter B5/B8): the core depends on this tiny interface, NOT on i18next.
package/dist/index.d.ts CHANGED
@@ -1069,8 +1069,10 @@ declare const RGS_ERROR_KEYS: Readonly<Record<string, {
1069
1069
  }>>;
1070
1070
  /** The default dismiss action used when a notice supplies none. */
1071
1071
  declare const DEFAULT_NOTICE_ACTION: NoticeAction;
1072
- /** Build the title + message blocks for an error/notice (used by `showError`). */
1073
- declare function errorBlocks(message: string, title: string, tone: NonNullable<NoticeOptions['tone']>): BlockSpec[];
1072
+ /** Build the title + message blocks for an error/notice (used by `showError`).
1073
+ * The Figma "default" modal is plain: a heading + body text (no tinted callout).
1074
+ * `tone` is kept for API compatibility but no longer changes the rendering. */
1075
+ declare function errorBlocks(message: string, title: string, _tone: NonNullable<NoticeOptions['tone']>): BlockSpec[];
1074
1076
 
1075
1077
  /**
1076
1078
  * i18n port (Charter B5/B8): the core depends on this tiny interface, NOT on i18next.
package/dist/index.js CHANGED
@@ -93,8 +93,11 @@ function extendTheme(base, patch) {
93
93
 
94
94
  // src/layout/screen.ts
95
95
  var defaultLayoutConfig = {
96
+ // Reference design frames, matching the Figma "DEF" frames 1:1 so offsets map
97
+ // directly: desktop 1920×1080, mobile 360×779 (×3 = 1080×2337). The portrait
98
+ // aspect matches real phones (~0.46), so scaling no longer squashes vertically.
96
99
  refLandscape: [1920, 1080],
97
- refPortrait: [1080, 1920],
100
+ refPortrait: [1080, 2337],
98
101
  portraitBelowAspect: 0.85,
99
102
  breakpoints: { mobile: 480, tablet: 840 }
100
103
  };
@@ -1344,10 +1347,10 @@ var RGS_ERROR_KEYS = Object.freeze({
1344
1347
  ERR_TIMEOUT: { title: "openui.err.connection.title", message: "openui.err.connection.message" }
1345
1348
  });
1346
1349
  var DEFAULT_NOTICE_ACTION = { label: "openui.ok", variant: "primary" };
1347
- function errorBlocks(message, title, tone) {
1350
+ function errorBlocks(message, title, _tone) {
1348
1351
  return [
1349
1352
  { kind: "heading", id: "notice-title", text: title },
1350
- { kind: "callout", id: "notice-body", tone, text: message }
1353
+ { kind: "text", id: "notice-body", text: message }
1351
1354
  ];
1352
1355
  }
1353
1356
 
@@ -1618,11 +1621,11 @@ var OpenUI = class {
1618
1621
  this.betMinus = new ButtonControl({ id: "bet-minus", layout: { anchor: "bottom-center", offset: [-150, -270] } }, this.bus);
1619
1622
  this.betPlus = new ButtonControl({ id: "bet-plus", layout: { anchor: "bottom-center", offset: [150, -270] } }, this.bus);
1620
1623
  this.betStepper = new StepperControl({ id: "bet-stepper", layout: { anchor: "center" }, levels: [0.5, 1, 2, 5, 10, 20], index: 1 }, this.bus);
1621
- this.muteButton = new ButtonControl({ id: "mute", layout: { anchor: "top-right", offset: [-110, 28] } }, this.bus);
1622
- this.fullscreenButton = new ButtonControl({ id: "fullscreen", layout: { anchor: "top-right", offset: [-52, 28] } }, this.bus);
1623
- this.rtp = new ReadoutControl({ id: "rtp", kind: "percent", label: "RTP", layout: { anchor: "top-left", offset: [120, 96] } });
1624
- this.netPosition = new ReadoutControl({ id: "net-position", kind: "currency", label: "Net", currency: { code: "USD", decimals: 2 }, layout: { anchor: "top-center", offset: [0, 56] } });
1625
- this.sessionTimer = new ReadoutControl({ id: "session-timer", kind: "duration", label: "Session", layout: { anchor: "top-left", offset: [120, 56] } });
1624
+ this.muteButton = new ButtonControl({ id: "mute", layout: { anchor: "top-right", offset: [-122, 46] } }, this.bus);
1625
+ this.fullscreenButton = new ButtonControl({ id: "fullscreen", layout: { anchor: "top-right", offset: [-46, 46] } }, this.bus);
1626
+ this.rtp = new ReadoutControl({ id: "rtp", kind: "percent", label: "RTP", layout: { anchor: "top-left", offset: [18, 18] } });
1627
+ this.sessionTimer = new ReadoutControl({ id: "session-timer", kind: "duration", label: "Session Time", layout: { anchor: "top-left", offset: [18, 36] } });
1628
+ this.netPosition = new ReadoutControl({ id: "net-position", kind: "currency", label: "Net", currency: { code: "USD", symbol: "$", display: "symbol", position: "prefix", decimals: 2 }, layout: { anchor: "top-left", offset: [18, 60] } });
1626
1629
  this.noticePanel = new PanelControl({ id: "notice-panel", variant: "modal", layout: { anchor: "center" } }, this.bus);
1627
1630
  for (const c of [
1628
1631
  this.spin,
@@ -1959,7 +1962,7 @@ var OpenUI = class {
1959
1962
 
1960
1963
  // src/spec/responsive.ts
1961
1964
  function cloneLayout(l) {
1962
- return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale };
1965
+ return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale, rotation: l.rotation };
1963
1966
  }
1964
1967
  function activeKeys(screen) {
1965
1968
  return [screen.orientation, screen.breakpoint];