@open-slot-ui/pixi 0.2.0 → 0.2.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/index.cjs +31 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +31 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -685,6 +685,8 @@ declare class MenuView extends ControlView {
|
|
|
685
685
|
private childViews;
|
|
686
686
|
private readonly titleKey;
|
|
687
687
|
private readonly maxWidth;
|
|
688
|
+
/** `ui` proxy with a light theme — feeds the shared block renderer dark-on-white. */
|
|
689
|
+
private readonly lightUi;
|
|
688
690
|
private vpW;
|
|
689
691
|
private vpH;
|
|
690
692
|
private scrollY;
|
package/dist/index.d.ts
CHANGED
|
@@ -685,6 +685,8 @@ declare class MenuView extends ControlView {
|
|
|
685
685
|
private childViews;
|
|
686
686
|
private readonly titleKey;
|
|
687
687
|
private readonly maxWidth;
|
|
688
|
+
/** `ui` proxy with a light theme — feeds the shared block renderer dark-on-white. */
|
|
689
|
+
private readonly lightUi;
|
|
688
690
|
private vpW;
|
|
689
691
|
private vpH;
|
|
690
692
|
private scrollY;
|
package/dist/index.js
CHANGED
|
@@ -1706,16 +1706,17 @@ var AutoplayView = class extends ControlView {
|
|
|
1706
1706
|
const st = this.auto.current;
|
|
1707
1707
|
this.countText.visible = false;
|
|
1708
1708
|
const th = this.ui.theme;
|
|
1709
|
-
const r = this.sprite ? this.target / 2 : this.radius;
|
|
1710
1709
|
const active = st === "active";
|
|
1711
1710
|
this.eventMode = active ? "none" : "static";
|
|
1712
1711
|
this.cursor = active ? "default" : "pointer";
|
|
1713
1712
|
if (active) {
|
|
1714
|
-
this.bg.clear()
|
|
1713
|
+
this.bg.clear();
|
|
1715
1714
|
if (this.sprite) {
|
|
1716
1715
|
this.sprite.visible = true;
|
|
1717
|
-
this.sprite.tint = th.color.
|
|
1718
|
-
this.sprite.alpha = 0.
|
|
1716
|
+
this.sprite.tint = th.color.accent;
|
|
1717
|
+
this.sprite.alpha = 0.9;
|
|
1718
|
+
} else {
|
|
1719
|
+
this.bg.circle(0, 0, this.radius).fill({ color: th.color.accent }).stroke({ width: 4, color: th.color.accentText });
|
|
1719
1720
|
}
|
|
1720
1721
|
return;
|
|
1721
1722
|
}
|
|
@@ -2780,6 +2781,14 @@ function paytableCell(r, ui, cellW, lineH) {
|
|
|
2780
2781
|
var MARGIN = 16;
|
|
2781
2782
|
var HEADER_H = 60;
|
|
2782
2783
|
var INSET = 22;
|
|
2784
|
+
var LIGHT = {
|
|
2785
|
+
surface: "#ffffff",
|
|
2786
|
+
surfaceAlt: "#eef1f6",
|
|
2787
|
+
text: "#181b20",
|
|
2788
|
+
textDim: "#5b6472",
|
|
2789
|
+
border: "#000000",
|
|
2790
|
+
accent: "#d99000"
|
|
2791
|
+
};
|
|
2783
2792
|
var MenuView = class extends ControlView {
|
|
2784
2793
|
constructor(panel, controls, blocks, ui, ticker, opts = {}) {
|
|
2785
2794
|
super(panel, ui);
|
|
@@ -2791,9 +2800,11 @@ var MenuView = class extends ControlView {
|
|
|
2791
2800
|
this.zIndex = 120;
|
|
2792
2801
|
this.titleKey = opts.title ?? "Menu";
|
|
2793
2802
|
this.maxWidth = opts.maxWidth ?? 1600;
|
|
2803
|
+
const lightTheme = { ...ui.theme, color: { ...ui.theme.color, surface: LIGHT.surface, surfaceAlt: LIGHT.surfaceAlt, text: LIGHT.text, textDim: LIGHT.textDim, accent: LIGHT.accent } };
|
|
2804
|
+
this.lightUi = new Proxy(ui, { get: (t, p) => p === "theme" ? lightTheme : Reflect.get(t, p) });
|
|
2794
2805
|
this.backdrop.eventMode = "static";
|
|
2795
2806
|
this.backdrop.on("pointertap", () => this.panel.closePanel());
|
|
2796
|
-
this.title = new Text({ text: ui.t(this.titleKey), style: { fontFamily: ui.theme.type.family, fontSize: 24, fill:
|
|
2807
|
+
this.title = new Text({ text: ui.t(this.titleKey), style: { fontFamily: ui.theme.type.family, fontSize: 24, fill: LIGHT.text, fontWeight: "800", letterSpacing: 1 } });
|
|
2797
2808
|
this.title.anchor.set(0, 0.5);
|
|
2798
2809
|
this.buildClose();
|
|
2799
2810
|
this.viewport.addChild(this.catcher, this.content);
|
|
@@ -2834,6 +2845,8 @@ var MenuView = class extends ControlView {
|
|
|
2834
2845
|
childViews = [];
|
|
2835
2846
|
titleKey;
|
|
2836
2847
|
maxWidth;
|
|
2848
|
+
/** `ui` proxy with a light theme — feeds the shared block renderer dark-on-white. */
|
|
2849
|
+
lightUi;
|
|
2837
2850
|
vpW = 0;
|
|
2838
2851
|
vpH = 0;
|
|
2839
2852
|
scrollY = 0;
|
|
@@ -2842,10 +2855,9 @@ var MenuView = class extends ControlView {
|
|
|
2842
2855
|
lastY = 0;
|
|
2843
2856
|
wheelHandler;
|
|
2844
2857
|
buildClose() {
|
|
2845
|
-
const t = this.ui.theme;
|
|
2846
2858
|
const r = 22;
|
|
2847
|
-
const bg = new Graphics().circle(0, 0, r).fill({ color:
|
|
2848
|
-
const x = new Graphics().moveTo(-7, -7).lineTo(7, 7).moveTo(7, -7).lineTo(-7, 7).stroke({ width: 3, color:
|
|
2859
|
+
const bg = new Graphics().circle(0, 0, r).fill({ color: LIGHT.border });
|
|
2860
|
+
const x = new Graphics().moveTo(-7, -7).lineTo(7, 7).moveTo(7, -7).lineTo(-7, 7).stroke({ width: 3, color: "#ffffff", cap: "round" });
|
|
2849
2861
|
this.closeBtn.addChild(bg, x);
|
|
2850
2862
|
this.closeBtn.eventMode = "static";
|
|
2851
2863
|
this.closeBtn.cursor = "pointer";
|
|
@@ -2857,7 +2869,7 @@ var MenuView = class extends ControlView {
|
|
|
2857
2869
|
this.childViews.length = 0;
|
|
2858
2870
|
for (const child of this.content.removeChildren()) child.destroy();
|
|
2859
2871
|
const bodyW = this.vpW > 0 ? this.vpW : Math.min(this.maxWidth - INSET * 2, 520);
|
|
2860
|
-
const col = buildBlockColumn(this.blocks, this.controls, this.
|
|
2872
|
+
const col = buildBlockColumn(this.blocks, this.controls, this.lightUi, this.ticker, bodyW, { controlSkins: this.opts.controlSkins, dropdownLayer: this.dropdownLayer });
|
|
2861
2873
|
this.childViews = col.views;
|
|
2862
2874
|
this.content.addChild(...col.content.removeChildren());
|
|
2863
2875
|
this.content.x = bodyW / 2;
|
|
@@ -2869,16 +2881,15 @@ var MenuView = class extends ControlView {
|
|
|
2869
2881
|
const H = screen.height;
|
|
2870
2882
|
this.position.set(0, 0);
|
|
2871
2883
|
this.scale.set(1);
|
|
2872
|
-
|
|
2873
|
-
this.backdrop.clear().rect(0, 0, W, H).fill({ color: 0, alpha: 0.62 });
|
|
2884
|
+
this.backdrop.clear().rect(0, 0, W, H).fill({ color: 0, alpha: 0.5 });
|
|
2874
2885
|
this.backdrop.hitArea = new Rectangle(0, 0, W, H);
|
|
2875
2886
|
const marginX = Math.max(MARGIN, Math.round(W * 0.05));
|
|
2876
2887
|
const cardW = Math.min(W - marginX * 2, this.maxWidth);
|
|
2877
2888
|
const cardH = H - MARGIN * 2;
|
|
2878
2889
|
const cx = (W - cardW) / 2;
|
|
2879
2890
|
const cy = MARGIN;
|
|
2880
|
-
this.card.clear().roundRect(cx, cy, cardW, cardH,
|
|
2881
|
-
this.headerBar.clear().roundRect(cx, cy, cardW, HEADER_H,
|
|
2891
|
+
this.card.clear().roundRect(cx, cy, cardW, cardH, 14).fill({ color: LIGHT.surface }).stroke({ width: 2.5, color: LIGHT.border });
|
|
2892
|
+
this.headerBar.clear().roundRect(cx, cy, cardW, HEADER_H, 14).fill({ color: LIGHT.surfaceAlt }).moveTo(cx + INSET, cy + HEADER_H).lineTo(cx + cardW - INSET, cy + HEADER_H).stroke({ width: 1, color: LIGHT.textDim, alpha: 0.4 });
|
|
2882
2893
|
this.title.position.set(cx + INSET, cy + HEADER_H / 2);
|
|
2883
2894
|
this.closeBtn.position.set(cx + cardW - INSET - 8, cy + HEADER_H / 2);
|
|
2884
2895
|
const vpX = cx + INSET;
|
|
@@ -3054,7 +3065,7 @@ var INSET2 = 24;
|
|
|
3054
3065
|
var BTN_H = 52;
|
|
3055
3066
|
var BTN_GAP = 14;
|
|
3056
3067
|
var ROW_GAP = 16;
|
|
3057
|
-
var
|
|
3068
|
+
var LIGHT2 = {
|
|
3058
3069
|
surface: "#ffffff",
|
|
3059
3070
|
surfaceAlt: "#eef1f6",
|
|
3060
3071
|
text: "#181b20",
|
|
@@ -3073,7 +3084,7 @@ var DialogView = class extends ControlView {
|
|
|
3073
3084
|
this.opts = opts;
|
|
3074
3085
|
this.zIndex = 130;
|
|
3075
3086
|
this.maxWidth = opts.maxWidth ?? 520;
|
|
3076
|
-
const lightTheme = { ...ui.theme, color: { ...ui.theme.color, surface:
|
|
3087
|
+
const lightTheme = { ...ui.theme, color: { ...ui.theme.color, surface: LIGHT2.surface, surfaceAlt: LIGHT2.surfaceAlt, text: LIGHT2.text, textDim: LIGHT2.textDim } };
|
|
3077
3088
|
this.lightUi = new Proxy(ui, { get: (t, p) => p === "theme" ? lightTheme : Reflect.get(t, p) });
|
|
3078
3089
|
this.backdrop.eventMode = "static";
|
|
3079
3090
|
this.backdrop.on("pointertap", () => {
|
|
@@ -3119,7 +3130,7 @@ var DialogView = class extends ControlView {
|
|
|
3119
3130
|
lightUi;
|
|
3120
3131
|
buildClose() {
|
|
3121
3132
|
const r = 22;
|
|
3122
|
-
const bg = new Graphics().circle(0, 0, r).fill({ color:
|
|
3133
|
+
const bg = new Graphics().circle(0, 0, r).fill({ color: LIGHT2.primary });
|
|
3123
3134
|
const x = new Graphics().moveTo(-7, -7).lineTo(7, 7).moveTo(7, -7).lineTo(-7, 7).stroke({ width: 3, color: "#ffffff", cap: "round" });
|
|
3124
3135
|
this.closeBtn.addChild(bg, x);
|
|
3125
3136
|
this.closeBtn.eventMode = "static";
|
|
@@ -3156,7 +3167,7 @@ var DialogView = class extends ControlView {
|
|
|
3156
3167
|
const cy = (H - cardH) / 2;
|
|
3157
3168
|
this.backdrop.clear().rect(0, 0, W, H).fill({ color: 0, alpha: 0.5 });
|
|
3158
3169
|
this.backdrop.hitArea = new Rectangle(0, 0, W, H);
|
|
3159
|
-
this.card.clear().roundRect(cx, cy, cardW, cardH, 14).fill({ color:
|
|
3170
|
+
this.card.clear().roundRect(cx, cy, cardW, cardH, 14).fill({ color: LIGHT2.surface }).stroke({ width: 2.5, color: LIGHT2.border });
|
|
3160
3171
|
const bodyH = cardH - (buttonsH ? ROW_GAP + buttonsH + INSET2 : INSET2);
|
|
3161
3172
|
this.content.x = cx + cardW / 2;
|
|
3162
3173
|
this.content.y = cy;
|
|
@@ -3195,7 +3206,7 @@ var DialogView = class extends ControlView {
|
|
|
3195
3206
|
const bg = new Graphics();
|
|
3196
3207
|
const label = new Text({
|
|
3197
3208
|
text: this.ui.t(action.label),
|
|
3198
|
-
style: { fontFamily: t.type.family, fontSize: 18, fontWeight: "800", fill: variant === "primary" ?
|
|
3209
|
+
style: { fontFamily: t.type.family, fontSize: 18, fontWeight: "800", fill: variant === "primary" ? LIGHT2.primaryText : LIGHT2.text, letterSpacing: 0.5 }
|
|
3199
3210
|
});
|
|
3200
3211
|
label.anchor.set(0.5);
|
|
3201
3212
|
node.addChild(bg, label);
|
|
@@ -3214,9 +3225,9 @@ var DialogView = class extends ControlView {
|
|
|
3214
3225
|
drawButton(bg, variant, width) {
|
|
3215
3226
|
bg.clear();
|
|
3216
3227
|
if (variant === "primary") {
|
|
3217
|
-
bg.roundRect(-width / 2, -BTN_H / 2, width, BTN_H, BTN_H / 2).fill({ color:
|
|
3228
|
+
bg.roundRect(-width / 2, -BTN_H / 2, width, BTN_H, BTN_H / 2).fill({ color: LIGHT2.primary });
|
|
3218
3229
|
} else {
|
|
3219
|
-
bg.roundRect(-width / 2, -BTN_H / 2, width, BTN_H, BTN_H / 2).fill({ color:
|
|
3230
|
+
bg.roundRect(-width / 2, -BTN_H / 2, width, BTN_H, BTN_H / 2).fill({ color: LIGHT2.surface }).stroke({ width: 2.5, color: LIGHT2.border });
|
|
3220
3231
|
}
|
|
3221
3232
|
}
|
|
3222
3233
|
applyOpen(open) {
|