@open-slot-ui/pixi 0.1.1 → 0.2.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.d.cts CHANGED
@@ -355,7 +355,6 @@ declare class TurboView extends ControlView {
355
355
  private readonly turbo;
356
356
  private readonly art;
357
357
  private readonly bg;
358
- private readonly pips;
359
358
  private sprite;
360
359
  private readonly tween;
361
360
  private readonly modeTex;
@@ -686,6 +685,8 @@ declare class MenuView extends ControlView {
686
685
  private childViews;
687
686
  private readonly titleKey;
688
687
  private readonly maxWidth;
688
+ /** `ui` proxy with a light theme — feeds the shared block renderer dark-on-white. */
689
+ private readonly lightUi;
689
690
  private vpW;
690
691
  private vpH;
691
692
  private scrollY;
package/dist/index.d.ts CHANGED
@@ -355,7 +355,6 @@ declare class TurboView extends ControlView {
355
355
  private readonly turbo;
356
356
  private readonly art;
357
357
  private readonly bg;
358
- private readonly pips;
359
358
  private sprite;
360
359
  private readonly tween;
361
360
  private readonly modeTex;
@@ -686,6 +685,8 @@ declare class MenuView extends ControlView {
686
685
  private childViews;
687
686
  private readonly titleKey;
688
687
  private readonly maxWidth;
688
+ /** `ui` proxy with a light theme — feeds the shared block renderer dark-on-white. */
689
+ private readonly lightUi;
689
690
  private vpW;
690
691
  private vpH;
691
692
  private scrollY;
package/dist/index.js CHANGED
@@ -1511,7 +1511,7 @@ var TurboView = class extends ControlView {
1511
1511
  } else {
1512
1512
  this.art.addChild(this.bg);
1513
1513
  }
1514
- this.addChild(this.art, this.pips);
1514
+ this.addChild(this.art);
1515
1515
  this.eventMode = "static";
1516
1516
  this.cursor = "pointer";
1517
1517
  this.hitArea = new Circle(0, 0, (this.sprite ? this.target / 2 : this.radius) + 8);
@@ -1526,7 +1526,6 @@ var TurboView = class extends ControlView {
1526
1526
  turbo;
1527
1527
  art = new Container();
1528
1528
  bg = new Graphics();
1529
- pips = new Graphics();
1530
1529
  sprite;
1531
1530
  tween;
1532
1531
  modeTex;
@@ -1563,19 +1562,6 @@ var TurboView = class extends ControlView {
1563
1562
  this.bg.circle(0, 0, r).fill({ color: lit ? th.color.accent : th.color.surface, alpha: lit ? Math.min(1, 0.55 + i * 0.25) : 1 }).stroke({ width: 4, color: th.color.accent });
1564
1563
  this.bg.poly([-6, -r * 0.42, 8, -4, 0, -4, 7, r * 0.42, -9, 2, 0, 2]).fill({ color: lit ? th.color.accentText : th.color.accent, alpha: disabled ? 0.5 : 1 });
1565
1564
  }
1566
- this.pips.clear();
1567
- const steps = this.turbo.modeCount - 1;
1568
- if (steps >= 2) {
1569
- const baseR = this.sprite ? this.target / 2 : this.radius;
1570
- const gap = 16;
1571
- const total = (steps - 1) * gap;
1572
- const y = baseR + 14;
1573
- for (let s = 0; s < steps; s++) {
1574
- const x = -total / 2 + s * gap;
1575
- const on = s < i;
1576
- this.pips.circle(x, y, 5).fill({ color: on ? th.color.accent : th.color.surface, alpha: disabled ? 0.5 : 1 }).stroke({ width: 2, color: th.color.accent, alpha: disabled ? 0.5 : 1 });
1577
- }
1578
- }
1579
1565
  }
1580
1566
  play(t) {
1581
1567
  this.animating = true;
@@ -2794,6 +2780,14 @@ function paytableCell(r, ui, cellW, lineH) {
2794
2780
  var MARGIN = 16;
2795
2781
  var HEADER_H = 60;
2796
2782
  var INSET = 22;
2783
+ var LIGHT = {
2784
+ surface: "#ffffff",
2785
+ surfaceAlt: "#eef1f6",
2786
+ text: "#181b20",
2787
+ textDim: "#5b6472",
2788
+ border: "#000000",
2789
+ accent: "#d99000"
2790
+ };
2797
2791
  var MenuView = class extends ControlView {
2798
2792
  constructor(panel, controls, blocks, ui, ticker, opts = {}) {
2799
2793
  super(panel, ui);
@@ -2805,9 +2799,11 @@ var MenuView = class extends ControlView {
2805
2799
  this.zIndex = 120;
2806
2800
  this.titleKey = opts.title ?? "Menu";
2807
2801
  this.maxWidth = opts.maxWidth ?? 1600;
2802
+ const lightTheme = { ...ui.theme, color: { ...ui.theme.color, surface: LIGHT.surface, surfaceAlt: LIGHT.surfaceAlt, text: LIGHT.text, textDim: LIGHT.textDim, accent: LIGHT.accent } };
2803
+ this.lightUi = new Proxy(ui, { get: (t, p) => p === "theme" ? lightTheme : Reflect.get(t, p) });
2808
2804
  this.backdrop.eventMode = "static";
2809
2805
  this.backdrop.on("pointertap", () => this.panel.closePanel());
2810
- this.title = new Text({ text: ui.t(this.titleKey), style: { fontFamily: ui.theme.type.family, fontSize: 24, fill: ui.theme.color.text, fontWeight: "800", letterSpacing: 1 } });
2806
+ this.title = new Text({ text: ui.t(this.titleKey), style: { fontFamily: ui.theme.type.family, fontSize: 24, fill: LIGHT.text, fontWeight: "800", letterSpacing: 1 } });
2811
2807
  this.title.anchor.set(0, 0.5);
2812
2808
  this.buildClose();
2813
2809
  this.viewport.addChild(this.catcher, this.content);
@@ -2848,6 +2844,8 @@ var MenuView = class extends ControlView {
2848
2844
  childViews = [];
2849
2845
  titleKey;
2850
2846
  maxWidth;
2847
+ /** `ui` proxy with a light theme — feeds the shared block renderer dark-on-white. */
2848
+ lightUi;
2851
2849
  vpW = 0;
2852
2850
  vpH = 0;
2853
2851
  scrollY = 0;
@@ -2856,10 +2854,9 @@ var MenuView = class extends ControlView {
2856
2854
  lastY = 0;
2857
2855
  wheelHandler;
2858
2856
  buildClose() {
2859
- const t = this.ui.theme;
2860
2857
  const r = 22;
2861
- const bg = new Graphics().circle(0, 0, r).fill({ color: t.color.surfaceAlt }).stroke({ width: 2, color: t.color.textDim });
2862
- const x = new Graphics().moveTo(-7, -7).lineTo(7, 7).moveTo(7, -7).lineTo(-7, 7).stroke({ width: 3, color: t.color.text });
2858
+ const bg = new Graphics().circle(0, 0, r).fill({ color: LIGHT.border });
2859
+ const x = new Graphics().moveTo(-7, -7).lineTo(7, 7).moveTo(7, -7).lineTo(-7, 7).stroke({ width: 3, color: "#ffffff", cap: "round" });
2863
2860
  this.closeBtn.addChild(bg, x);
2864
2861
  this.closeBtn.eventMode = "static";
2865
2862
  this.closeBtn.cursor = "pointer";
@@ -2871,7 +2868,7 @@ var MenuView = class extends ControlView {
2871
2868
  this.childViews.length = 0;
2872
2869
  for (const child of this.content.removeChildren()) child.destroy();
2873
2870
  const bodyW = this.vpW > 0 ? this.vpW : Math.min(this.maxWidth - INSET * 2, 520);
2874
- const col = buildBlockColumn(this.blocks, this.controls, this.ui, this.ticker, bodyW, { controlSkins: this.opts.controlSkins, dropdownLayer: this.dropdownLayer });
2871
+ const col = buildBlockColumn(this.blocks, this.controls, this.lightUi, this.ticker, bodyW, { controlSkins: this.opts.controlSkins, dropdownLayer: this.dropdownLayer });
2875
2872
  this.childViews = col.views;
2876
2873
  this.content.addChild(...col.content.removeChildren());
2877
2874
  this.content.x = bodyW / 2;
@@ -2883,16 +2880,15 @@ var MenuView = class extends ControlView {
2883
2880
  const H = screen.height;
2884
2881
  this.position.set(0, 0);
2885
2882
  this.scale.set(1);
2886
- const t = this.ui.theme;
2887
- this.backdrop.clear().rect(0, 0, W, H).fill({ color: 0, alpha: 0.62 });
2883
+ this.backdrop.clear().rect(0, 0, W, H).fill({ color: 0, alpha: 0.5 });
2888
2884
  this.backdrop.hitArea = new Rectangle(0, 0, W, H);
2889
2885
  const marginX = Math.max(MARGIN, Math.round(W * 0.05));
2890
2886
  const cardW = Math.min(W - marginX * 2, this.maxWidth);
2891
2887
  const cardH = H - MARGIN * 2;
2892
2888
  const cx = (W - cardW) / 2;
2893
2889
  const cy = MARGIN;
2894
- this.card.clear().roundRect(cx, cy, cardW, cardH, t.radius.card).fill({ color: t.color.surface }).stroke({ width: 2, color: t.color.accent });
2895
- this.headerBar.clear().roundRect(cx, cy, cardW, HEADER_H, t.radius.card).fill({ color: t.color.surfaceAlt }).moveTo(cx + INSET, cy + HEADER_H).lineTo(cx + cardW - INSET, cy + HEADER_H).stroke({ width: 1, color: t.color.textDim, alpha: 0.3 });
2890
+ this.card.clear().roundRect(cx, cy, cardW, cardH, 14).fill({ color: LIGHT.surface }).stroke({ width: 2.5, color: LIGHT.border });
2891
+ 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 });
2896
2892
  this.title.position.set(cx + INSET, cy + HEADER_H / 2);
2897
2893
  this.closeBtn.position.set(cx + cardW - INSET - 8, cy + HEADER_H / 2);
2898
2894
  const vpX = cx + INSET;
@@ -3068,7 +3064,7 @@ var INSET2 = 24;
3068
3064
  var BTN_H = 52;
3069
3065
  var BTN_GAP = 14;
3070
3066
  var ROW_GAP = 16;
3071
- var LIGHT = {
3067
+ var LIGHT2 = {
3072
3068
  surface: "#ffffff",
3073
3069
  surfaceAlt: "#eef1f6",
3074
3070
  text: "#181b20",
@@ -3087,7 +3083,7 @@ var DialogView = class extends ControlView {
3087
3083
  this.opts = opts;
3088
3084
  this.zIndex = 130;
3089
3085
  this.maxWidth = opts.maxWidth ?? 520;
3090
- const lightTheme = { ...ui.theme, color: { ...ui.theme.color, surface: LIGHT.surface, surfaceAlt: LIGHT.surfaceAlt, text: LIGHT.text, textDim: LIGHT.textDim } };
3086
+ const lightTheme = { ...ui.theme, color: { ...ui.theme.color, surface: LIGHT2.surface, surfaceAlt: LIGHT2.surfaceAlt, text: LIGHT2.text, textDim: LIGHT2.textDim } };
3091
3087
  this.lightUi = new Proxy(ui, { get: (t, p) => p === "theme" ? lightTheme : Reflect.get(t, p) });
3092
3088
  this.backdrop.eventMode = "static";
3093
3089
  this.backdrop.on("pointertap", () => {
@@ -3133,7 +3129,7 @@ var DialogView = class extends ControlView {
3133
3129
  lightUi;
3134
3130
  buildClose() {
3135
3131
  const r = 22;
3136
- const bg = new Graphics().circle(0, 0, r).fill({ color: LIGHT.primary });
3132
+ const bg = new Graphics().circle(0, 0, r).fill({ color: LIGHT2.primary });
3137
3133
  const x = new Graphics().moveTo(-7, -7).lineTo(7, 7).moveTo(7, -7).lineTo(-7, 7).stroke({ width: 3, color: "#ffffff", cap: "round" });
3138
3134
  this.closeBtn.addChild(bg, x);
3139
3135
  this.closeBtn.eventMode = "static";
@@ -3170,7 +3166,7 @@ var DialogView = class extends ControlView {
3170
3166
  const cy = (H - cardH) / 2;
3171
3167
  this.backdrop.clear().rect(0, 0, W, H).fill({ color: 0, alpha: 0.5 });
3172
3168
  this.backdrop.hitArea = new Rectangle(0, 0, W, H);
3173
- this.card.clear().roundRect(cx, cy, cardW, cardH, 14).fill({ color: LIGHT.surface }).stroke({ width: 2.5, color: LIGHT.border });
3169
+ this.card.clear().roundRect(cx, cy, cardW, cardH, 14).fill({ color: LIGHT2.surface }).stroke({ width: 2.5, color: LIGHT2.border });
3174
3170
  const bodyH = cardH - (buttonsH ? ROW_GAP + buttonsH + INSET2 : INSET2);
3175
3171
  this.content.x = cx + cardW / 2;
3176
3172
  this.content.y = cy;
@@ -3209,7 +3205,7 @@ var DialogView = class extends ControlView {
3209
3205
  const bg = new Graphics();
3210
3206
  const label = new Text({
3211
3207
  text: this.ui.t(action.label),
3212
- style: { fontFamily: t.type.family, fontSize: 18, fontWeight: "800", fill: variant === "primary" ? LIGHT.primaryText : LIGHT.text, letterSpacing: 0.5 }
3208
+ style: { fontFamily: t.type.family, fontSize: 18, fontWeight: "800", fill: variant === "primary" ? LIGHT2.primaryText : LIGHT2.text, letterSpacing: 0.5 }
3213
3209
  });
3214
3210
  label.anchor.set(0.5);
3215
3211
  node.addChild(bg, label);
@@ -3228,9 +3224,9 @@ var DialogView = class extends ControlView {
3228
3224
  drawButton(bg, variant, width) {
3229
3225
  bg.clear();
3230
3226
  if (variant === "primary") {
3231
- bg.roundRect(-width / 2, -BTN_H / 2, width, BTN_H, BTN_H / 2).fill({ color: LIGHT.primary });
3227
+ bg.roundRect(-width / 2, -BTN_H / 2, width, BTN_H, BTN_H / 2).fill({ color: LIGHT2.primary });
3232
3228
  } else {
3233
- bg.roundRect(-width / 2, -BTN_H / 2, width, BTN_H, BTN_H / 2).fill({ color: LIGHT.surface }).stroke({ width: 2.5, color: LIGHT.border });
3229
+ bg.roundRect(-width / 2, -BTN_H / 2, width, BTN_H, BTN_H / 2).fill({ color: LIGHT2.surface }).stroke({ width: 2.5, color: LIGHT2.border });
3234
3230
  }
3235
3231
  }
3236
3232
  applyOpen(open) {
@@ -3927,7 +3923,7 @@ function mountHud(app, spec = {}, opts = {}) {
3927
3923
  ui.showNotice(
3928
3924
  [
3929
3925
  { kind: "heading", id: "buy-title", text: o.title ?? "openui.buyFeature.title" },
3930
- { kind: "callout", id: "buy-body", tone: "bonus", text: o.message ?? "openui.buyFeature.message" }
3926
+ { kind: "text", id: "buy-body", text: o.message ?? "openui.buyFeature.message" }
3931
3927
  ],
3932
3928
  [
3933
3929
  { label: o.cancelLabel ?? "openui.cancel", variant: "secondary" },