@open-slot-ui/core 0.12.0 → 0.12.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 +19 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +19 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -133,10 +133,10 @@ function anchorFactors(anchor) {
|
|
|
133
133
|
function resolvePlacement(spec, screen) {
|
|
134
134
|
const [ax, ay] = anchorFactors(spec.anchor);
|
|
135
135
|
const [ox, oy] = spec.offset ?? [0, 0];
|
|
136
|
-
const
|
|
136
|
+
const rect = spec.origin === "screen" ? { x: 0, y: 0, width: screen.width, height: screen.height } : screen.stage;
|
|
137
137
|
return {
|
|
138
|
-
x:
|
|
139
|
-
y:
|
|
138
|
+
x: rect.x + ax * rect.width + ox * screen.scale,
|
|
139
|
+
y: rect.y + ay * rect.height + oy * screen.scale,
|
|
140
140
|
scale: screen.scale * (spec.scale ?? 1),
|
|
141
141
|
rotation: (spec.rotation ?? 0) * Math.PI / 180
|
|
142
142
|
};
|
|
@@ -160,11 +160,13 @@ var landscapeDefaultLayouts = Object.freeze({
|
|
|
160
160
|
// Right-anchored so a long localized caption grows LEFT and never clips the edge.
|
|
161
161
|
"total-win": { anchor: "bottom-right", offset: [-150, -300] },
|
|
162
162
|
settings: { anchor: "bottom-center", offset: [-740, -320], rotation: -5 },
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
// Corner utilities anchor to the SCREEN (not the letterboxed frame) so they hug the true
|
|
164
|
+
// viewport corners at every aspect — see `LayoutSpec.origin`.
|
|
165
|
+
mute: { anchor: "top-right", offset: [-122, 46], origin: "screen" },
|
|
166
|
+
fullscreen: { anchor: "top-right", offset: [-46, 46], origin: "screen" },
|
|
167
|
+
rtp: { anchor: "top-left", offset: [20, 18], origin: "screen" },
|
|
168
|
+
"session-timer": { anchor: "top-left", offset: [20, 46], origin: "screen" },
|
|
169
|
+
"net-position": { anchor: "top-left", offset: [20, 74], origin: "screen" }
|
|
168
170
|
});
|
|
169
171
|
var portraitDefaultLayouts = Object.freeze({
|
|
170
172
|
// Mobile sizes run ~1.5× the desktop base (the Figma mobile frame draws the
|
|
@@ -179,19 +181,21 @@ var portraitDefaultLayouts = Object.freeze({
|
|
|
179
181
|
settings: { anchor: "bottom-center", offset: [438, -480], scale: 1.5, rotation: -5 },
|
|
180
182
|
"bet-minus": { anchor: "bottom-center", offset: [-105, -267], scale: 1.5 },
|
|
181
183
|
"bet-plus": { anchor: "bottom-center", offset: [105, -267], scale: 1.5 },
|
|
182
|
-
|
|
183
|
-
|
|
184
|
+
// Corner utilities anchor to the SCREEN (see `LayoutSpec.origin`) so they stay in the true
|
|
185
|
+
// viewport corner even when the portrait frame is letterboxed.
|
|
186
|
+
mute: { anchor: "top-right", offset: [-159, 57], scale: 1.5, origin: "screen" },
|
|
187
|
+
fullscreen: { anchor: "top-right", offset: [-57, 57], scale: 1.5, origin: "screen" },
|
|
184
188
|
// Compliance readouts scale up ~2× on mobile with wider line spacing.
|
|
185
|
-
rtp: { anchor: "top-left", offset: [16, 16], scale: 2 },
|
|
186
|
-
"session-timer": { anchor: "top-left", offset: [16, 66], scale: 2 },
|
|
187
|
-
"net-position": { anchor: "top-left", offset: [16, 116], scale: 2 },
|
|
189
|
+
rtp: { anchor: "top-left", offset: [16, 16], scale: 2, origin: "screen" },
|
|
190
|
+
"session-timer": { anchor: "top-left", offset: [16, 66], scale: 2, origin: "screen" },
|
|
191
|
+
"net-position": { anchor: "top-left", offset: [16, 116], scale: 2, origin: "screen" },
|
|
188
192
|
balance: { anchor: "bottom-left", offset: [36, -110], rotation: -5 },
|
|
189
193
|
bet: { anchor: "bottom-right", offset: [-36, -110], rotation: 5 }
|
|
190
194
|
});
|
|
191
195
|
function defaultLayout(id) {
|
|
192
196
|
const l = landscapeDefaultLayouts[id];
|
|
193
197
|
if (!l) return { anchor: "center" };
|
|
194
|
-
return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale, rotation: l.rotation };
|
|
198
|
+
return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale, rotation: l.rotation, origin: l.origin };
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
// src/transition/Transition.ts
|
|
@@ -2459,7 +2463,7 @@ var OpenUI = class {
|
|
|
2459
2463
|
|
|
2460
2464
|
// src/spec/responsive.ts
|
|
2461
2465
|
function cloneLayout(l) {
|
|
2462
|
-
return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale, rotation: l.rotation };
|
|
2466
|
+
return { anchor: l.anchor, offset: l.offset ? [l.offset[0], l.offset[1]] : void 0, scale: l.scale, rotation: l.rotation, origin: l.origin };
|
|
2463
2467
|
}
|
|
2464
2468
|
function activeKeys(screen) {
|
|
2465
2469
|
return [screen.orientation, screen.breakpoint];
|