@open-slot-ui/core 0.0.1 → 0.1.1
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.cjs +12 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -26
- package/dist/index.d.ts +5 -26
- package/dist/index.js +13 -27
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -95,8 +95,11 @@ function extendTheme(base, patch) {
|
|
|
95
95
|
|
|
96
96
|
// src/layout/screen.ts
|
|
97
97
|
var defaultLayoutConfig = {
|
|
98
|
+
// Reference design frames, matching the Figma "DEF" frames 1:1 so offsets map
|
|
99
|
+
// directly: desktop 1920×1080, mobile 360×779 (×3 = 1080×2337). The portrait
|
|
100
|
+
// aspect matches real phones (~0.46), so scaling no longer squashes vertically.
|
|
98
101
|
refLandscape: [1920, 1080],
|
|
99
|
-
refPortrait: [1080,
|
|
102
|
+
refPortrait: [1080, 2337],
|
|
100
103
|
portraitBelowAspect: 0.85,
|
|
101
104
|
breakpoints: { mobile: 480, tablet: 840 }
|
|
102
105
|
};
|
|
@@ -1169,9 +1172,6 @@ function validateSpec(spec) {
|
|
|
1169
1172
|
if (spec.rtp != null && !(typeof spec.rtp === "number" && Number.isFinite(spec.rtp))) {
|
|
1170
1173
|
add("error", "rtp", "bad-rtp", `rtp must be a number, got ${String(spec.rtp)}`);
|
|
1171
1174
|
}
|
|
1172
|
-
if (spec.statusBar != null && spec.statusBar !== "top" && spec.statusBar !== "bottom") {
|
|
1173
|
-
add("error", "statusBar", "bad-statusbar", `statusBar must be 'top' or 'bottom', got "${String(spec.statusBar)}"`);
|
|
1174
|
-
}
|
|
1175
1175
|
if (spec.realityCheck != null && !(typeof spec.realityCheck.everyMinutes === "number" && spec.realityCheck.everyMinutes > 0)) {
|
|
1176
1176
|
add("error", "realityCheck.everyMinutes", "bad-interval", "realityCheck.everyMinutes must be a number > 0");
|
|
1177
1177
|
}
|
|
@@ -1346,10 +1346,10 @@ var RGS_ERROR_KEYS = Object.freeze({
|
|
|
1346
1346
|
ERR_TIMEOUT: { title: "openui.err.connection.title", message: "openui.err.connection.message" }
|
|
1347
1347
|
});
|
|
1348
1348
|
var DEFAULT_NOTICE_ACTION = { label: "openui.ok", variant: "primary" };
|
|
1349
|
-
function errorBlocks(message, title,
|
|
1349
|
+
function errorBlocks(message, title, _tone) {
|
|
1350
1350
|
return [
|
|
1351
1351
|
{ kind: "heading", id: "notice-title", text: title },
|
|
1352
|
-
{ kind: "
|
|
1352
|
+
{ kind: "text", id: "notice-body", text: message }
|
|
1353
1353
|
];
|
|
1354
1354
|
}
|
|
1355
1355
|
|
|
@@ -1620,11 +1620,11 @@ var OpenUI = class {
|
|
|
1620
1620
|
this.betMinus = new ButtonControl({ id: "bet-minus", layout: { anchor: "bottom-center", offset: [-150, -270] } }, this.bus);
|
|
1621
1621
|
this.betPlus = new ButtonControl({ id: "bet-plus", layout: { anchor: "bottom-center", offset: [150, -270] } }, this.bus);
|
|
1622
1622
|
this.betStepper = new StepperControl({ id: "bet-stepper", layout: { anchor: "center" }, levels: [0.5, 1, 2, 5, 10, 20], index: 1 }, this.bus);
|
|
1623
|
-
this.muteButton = new ButtonControl({ id: "mute", layout: { anchor: "top-right", offset: [-
|
|
1624
|
-
this.fullscreenButton = new ButtonControl({ id: "fullscreen", layout: { anchor: "top-right", offset: [-
|
|
1625
|
-
this.rtp = new ReadoutControl({ id: "rtp", kind: "percent", label: "RTP", layout: { anchor: "top-left", offset: [
|
|
1626
|
-
this.
|
|
1627
|
-
this.
|
|
1623
|
+
this.muteButton = new ButtonControl({ id: "mute", layout: { anchor: "top-right", offset: [-122, 46] } }, this.bus);
|
|
1624
|
+
this.fullscreenButton = new ButtonControl({ id: "fullscreen", layout: { anchor: "top-right", offset: [-46, 46] } }, this.bus);
|
|
1625
|
+
this.rtp = new ReadoutControl({ id: "rtp", kind: "percent", label: "RTP", layout: { anchor: "top-left", offset: [18, 18] } });
|
|
1626
|
+
this.sessionTimer = new ReadoutControl({ id: "session-timer", kind: "duration", label: "Session Time", layout: { anchor: "top-left", offset: [18, 36] } });
|
|
1627
|
+
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] } });
|
|
1628
1628
|
this.noticePanel = new PanelControl({ id: "notice-panel", variant: "modal", layout: { anchor: "center" } }, this.bus);
|
|
1629
1629
|
for (const c of [
|
|
1630
1630
|
this.spin,
|
|
@@ -1961,7 +1961,7 @@ var OpenUI = class {
|
|
|
1961
1961
|
|
|
1962
1962
|
// src/spec/responsive.ts
|
|
1963
1963
|
function cloneLayout(l) {
|
|
1964
|
-
return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale };
|
|
1964
|
+
return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale, rotation: l.rotation };
|
|
1965
1965
|
}
|
|
1966
1966
|
function activeKeys(screen) {
|
|
1967
1967
|
return [screen.orientation, screen.breakpoint];
|
|
@@ -2254,20 +2254,6 @@ function clampBet(amount, cfg, divisor = API_AMOUNT_DIVISOR) {
|
|
|
2254
2254
|
return Math.min(max, Math.max(min, v));
|
|
2255
2255
|
}
|
|
2256
2256
|
|
|
2257
|
-
// src/win.ts
|
|
2258
|
-
var DEFAULT_WIN_TIERS = Object.freeze([
|
|
2259
|
-
{ name: "big", minMultiplier: 10 },
|
|
2260
|
-
{ name: "mega", minMultiplier: 50 },
|
|
2261
|
-
{ name: "epic", minMultiplier: 100 }
|
|
2262
|
-
]);
|
|
2263
|
-
function winTier(win, stake, tiers = DEFAULT_WIN_TIERS) {
|
|
2264
|
-
if (!Number.isFinite(win) || !Number.isFinite(stake) || stake <= 0 || win <= stake) return "none";
|
|
2265
|
-
const mult = win / stake;
|
|
2266
|
-
let name = "win";
|
|
2267
|
-
for (const t of tiers) if (mult >= t.minMultiplier) name = t.name;
|
|
2268
|
-
return name;
|
|
2269
|
-
}
|
|
2270
|
-
|
|
2271
2257
|
exports.API_AMOUNT_DIVISOR = API_AMOUNT_DIVISOR;
|
|
2272
2258
|
exports.AutoplayControl = AutoplayControl;
|
|
2273
2259
|
exports.BLOCK_KINDS = BLOCK_KINDS;
|
|
@@ -2278,7 +2264,6 @@ exports.Control = Control;
|
|
|
2278
2264
|
exports.ControlRegistry = ControlRegistry;
|
|
2279
2265
|
exports.DEFAULT_MENU_TITLES = DEFAULT_MENU_TITLES;
|
|
2280
2266
|
exports.DEFAULT_NOTICE_ACTION = DEFAULT_NOTICE_ACTION;
|
|
2281
|
-
exports.DEFAULT_WIN_TIERS = DEFAULT_WIN_TIERS;
|
|
2282
2267
|
exports.DictionaryTranslator = DictionaryTranslator;
|
|
2283
2268
|
exports.EventBus = EventBus;
|
|
2284
2269
|
exports.EventLog = EventLog;
|
|
@@ -2338,6 +2323,5 @@ exports.sanitizeThemeOverrides = sanitizeThemeOverrides;
|
|
|
2338
2323
|
exports.themePresets = themePresets;
|
|
2339
2324
|
exports.validateSpec = validateSpec;
|
|
2340
2325
|
exports.valueFitMaxWidth = valueFitMaxWidth;
|
|
2341
|
-
exports.winTier = winTier;
|
|
2342
2326
|
//# sourceMappingURL=index.cjs.map
|
|
2343
2327
|
//# sourceMappingURL=index.cjs.map
|