@open-slot-ui/pixi 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.d.cts CHANGED
@@ -1,30 +1,6 @@
1
1
  import * as pixi_js from 'pixi.js';
2
2
  import { Container, Ticker, Texture, Application, TextStyleOptions, Graphics } from 'pixi.js';
3
- import { ScreenState, ReadoutControl, OpenUI, Control, BlockSpec, Theme, EventLog, SpinControl, ValueDisplay, ButtonControl, ToggleControl, TurboControl, AutoplayControl, SliderControl, PanelControl, SelectControl, StepperControl, Signal, NoticeAction, OpenUIEvents, Dispose, CurrencySpec, JurisdictionConfig, NoticeOptions, RgsErrorOptions, ControlSnapshot, HostHooks, UISpec, Transition } from '@open-slot-ui/core';
4
-
5
- type StatusBarSide = 'top' | 'bottom';
6
- /**
7
- * A thin, full-width black-and-white status strip pinned to the top or bottom edge,
8
- * holding the compliance readouts (net · RTP · session) as inline items — white
9
- * text on a dark bar, no theme accent. Only the jurisdiction-revealed readouts take
10
- * a slot, so it adapts from 0→3 items (and hides itself when empty). A full-screen
11
- * overlay (OpenUIPixi manages it + insets the HUD by {@link StatusBarView.heightFor}
12
- * so controls never sit under it).
13
- */
14
- declare class StatusBarView extends Container {
15
- private readonly ui;
16
- private readonly side;
17
- private readonly bg;
18
- private readonly items;
19
- private screen;
20
- private readonly disposers;
21
- /** The strip's pixel height for the current screen (used for the HUD margin too). */
22
- static heightFor(screen: ScreenState): number;
23
- constructor(controls: ReadoutControl[], ui: OpenUI, ticker: Ticker, side: StatusBarSide);
24
- applyLayout(screen: ScreenState): void;
25
- private relayout;
26
- dispose(): void;
27
- }
3
+ import { Control, OpenUI, ScreenState, BlockSpec, Theme, EventLog, SpinControl, ValueDisplay, ButtonControl, ToggleControl, TurboControl, AutoplayControl, SliderControl, PanelControl, SelectControl, StepperControl, ReadoutControl, Signal, NoticeAction, OpenUIEvents, Dispose, CurrencySpec, JurisdictionConfig, NoticeOptions, RgsErrorOptions, ControlSnapshot, HostHooks, UISpec, Transition } from '@open-slot-ui/core';
28
4
 
29
5
  /**
30
6
  * Base view: a Pixi Container bound to a core Control. Owns layout placement and
@@ -146,11 +122,11 @@ interface OpenUIPixiOptions {
146
122
  */
147
123
  autoplayPicker?: 'drawer' | 'radial';
148
124
  /**
149
- * Put the compliance readouts (net · RTP · session) in a thin status strip at the
150
- * `'top'` or `'bottom'` edge instead of at screen corners. Each readout still only
151
- * shows when its jurisdiction `display*` flag is set.
125
+ * Text colour for the top-corner compliance readouts (RTP / net / session). Defaults
126
+ * to the theme text colour; a light-background host can pass a dark colour so the
127
+ * Figma-style `Label: value` block stays legible.
152
128
  */
153
- statusBar?: StatusBarSide;
129
+ readoutColor?: string;
154
130
  /**
155
131
  * How the interactive HUD appears on mount: `'shown'` (default), `'hidden'` (off
156
132
  * screen + non-interactive; reveal later with `showControls()`), or `'slide-in'`
@@ -231,9 +207,15 @@ declare class SpinView extends ControlView {
231
207
  private readonly fsFace;
232
208
  private readonly fsCount;
233
209
  private readonly fsLabel;
210
+ /** Autoplay STOP face — a "STOP" label over the remaining count (or ∞); shown while
211
+ * autoplay is active. Tapping the spin button then STOPS autoplay. */
212
+ private readonly stopFace;
213
+ private readonly stopCount;
214
+ private readonly stopLabel;
234
215
  constructor(spin: SpinControl, ui: OpenUI, ticker: Ticker, skinOrOpts?: SpinSkinFactory | SpinViewOptions);
235
- /** Swap the spin face: free-spins counter when `freeSpins > 0`, else the skin. */
236
- private updateFreeSpins;
216
+ /** Pick the spin face: autoplay STOP-count (top priority) free-spins counter
217
+ * the normal skin. */
218
+ private updateFaces;
237
219
  private readonly onOver;
238
220
  private readonly onOut;
239
221
  private readonly onDown;
@@ -262,6 +244,7 @@ declare class ValueDisplayView extends ControlView {
262
244
  private readonly fitGsap?;
263
245
  private counter;
264
246
  private caption;
247
+ private captionPill;
265
248
  constructor(vd: ValueDisplay, ui: OpenUI, ticker: Ticker,
266
249
  /** Host `gsap` — when present, the counter auto-downscales wide values to fit
267
250
  * (Charter B5: no hard gsap dep; the host passes it). */
@@ -289,16 +272,15 @@ interface ButtonViewOptions {
289
272
  /** Monochrome look — white circle, black ring, black glyph (matches the turbo
290
273
  * button's b&w art). Only affects the drawn (no-texture) circle path. */
291
274
  mono?: boolean;
275
+ /** Inverted look — solid black circle with a white glyph, no ring (the Figma ☰
276
+ * menu button). Only affects the drawn (no-texture) circle path. */
277
+ dark?: boolean;
292
278
  }
293
- /**
294
- * Generic button view. With `iconTexture` it renders the provided art as a Sprite
295
- * (swappable via `setIconTexture`, e.g. ☰ ↔ ✕); otherwise a neutral token placeholder.
296
- * Pointer input drives the control's state machine; entry transitions play on `art`.
297
- */
298
279
  declare class ButtonView extends ControlView {
299
280
  private readonly btn;
300
281
  private readonly art;
301
282
  private readonly bg;
283
+ private readonly glyphG;
302
284
  private sprite;
303
285
  private labelText;
304
286
  private readonly tween;
@@ -308,14 +290,13 @@ declare class ButtonView extends ControlView {
308
290
  private glyph;
309
291
  private readonly iconTarget;
310
292
  private readonly mono;
293
+ private readonly dark;
311
294
  constructor(btn: ButtonControl, ui: OpenUI, ticker: Ticker, opts?: ButtonViewOptions);
312
295
  /** Swap the displayed art (e.g. ☰ → ✕). */
313
296
  setIconTexture(tex: Texture): void;
314
297
  /** Swap the placeholder glyph (e.g. speaker ↔ speaker-mute, fullscreen ↔ exit). */
315
298
  setGlyph(glyph: ButtonGlyph): void;
316
299
  private fitSprite;
317
- private readonly onOver;
318
- private readonly onOut;
319
300
  private readonly onDown;
320
301
  private readonly onUp;
321
302
  private readonly onUpOutside;
@@ -731,6 +712,10 @@ interface ReadoutViewOptions {
731
712
  inline?: boolean;
732
713
  /** Force black-and-white text (white on a dark bar), ignoring the theme accent/text hue. */
733
714
  mono?: boolean;
715
+ /** Single left-aligned `Label: value` line (the Figma top-corner block). */
716
+ prefix?: boolean;
717
+ /** Explicit text colour (else the theme text colour). Lets a light-bg host darken it. */
718
+ fill?: string;
734
719
  }
735
720
  /**
736
721
  * A compact, non-interactive readout for the Stake Engine jurisdiction `display*`
@@ -746,6 +731,7 @@ declare class ReadoutView extends ControlView {
746
731
  private readonly caption?;
747
732
  private readonly valueText;
748
733
  private readonly tick?;
734
+ private readonly prefix;
749
735
  constructor(ro: ReadoutControl, ui: OpenUI, ticker: Ticker, opts?: ReadoutViewOptions);
750
736
  private render;
751
737
  dispose(): void;
@@ -779,6 +765,9 @@ declare class DialogView extends ControlView {
779
765
  private childViews;
780
766
  private screen;
781
767
  private readonly maxWidth;
768
+ /** `ui` proxy with a light theme — so the shared block renderer draws dark-on-white
769
+ * content inside the white modal card (Figma "default" dialog look). */
770
+ private readonly lightUi;
782
771
  constructor(panel: PanelControl, blocks: Signal<BlockSpec[]>, actions: Signal<NoticeAction[]>, ui: OpenUI, ticker: Ticker, opts?: DialogViewOptions);
783
772
  private buildClose;
784
773
  applyLayout(screen: ScreenState): void;
@@ -930,4 +919,4 @@ declare class Tweener {
930
919
  /** Treat touch devices as non-desktop so we don't fire phantom hover states. */
931
920
  declare function isDesktop(): boolean;
932
921
 
933
- export { AutoplayDrawerView, AutoplayView, type AutoplayViewOptions, type BlockColumn, type BlockColumnOptions, type BootedHud, type ButtonGlyph, ButtonView, type ButtonViewOptions, ControlView, type ControlViewFactory, DialogView, type DialogViewOptions, type HudOptions, type InfoContentBuilder, MenuView, type MenuViewOptions, type OpenUIIcons, OpenUIPixi, type OpenUIPixiOptions, type PanelBodyOptions, PanelBodyView, PanelView, type PanelViewOptions, type PopoverArt, type PopoverParts, PopoverView, ReadoutView, type ReadoutViewOptions, SelectView, type SelectViewOptions, SliderView, type SpinSkin, type SpinSkinFactory, SpinView, type SpinViewOptions, type StatusBarSide, StatusBarView, StepperView, type SvgSpinTextures, TextCellRenderer, type TextCellRendererOptions, ToggleView, type ToggleViewOptions, TurboView, type TurboViewOptions, Tweener, ValueDisplayView, buildBlockColumn, defaultSpinSkin, drawSpin, isDesktop, mountHud, svgSpinSkin };
922
+ export { AutoplayDrawerView, AutoplayView, type AutoplayViewOptions, type BlockColumn, type BlockColumnOptions, type BootedHud, type ButtonGlyph, ButtonView, type ButtonViewOptions, ControlView, type ControlViewFactory, DialogView, type DialogViewOptions, type HudOptions, type InfoContentBuilder, MenuView, type MenuViewOptions, type OpenUIIcons, OpenUIPixi, type OpenUIPixiOptions, type PanelBodyOptions, PanelBodyView, PanelView, type PanelViewOptions, type PopoverArt, type PopoverParts, PopoverView, ReadoutView, type ReadoutViewOptions, SelectView, type SelectViewOptions, SliderView, type SpinSkin, type SpinSkinFactory, SpinView, type SpinViewOptions, StepperView, type SvgSpinTextures, TextCellRenderer, type TextCellRendererOptions, ToggleView, type ToggleViewOptions, TurboView, type TurboViewOptions, Tweener, ValueDisplayView, buildBlockColumn, defaultSpinSkin, drawSpin, isDesktop, mountHud, svgSpinSkin };
package/dist/index.d.ts CHANGED
@@ -1,30 +1,6 @@
1
1
  import * as pixi_js from 'pixi.js';
2
2
  import { Container, Ticker, Texture, Application, TextStyleOptions, Graphics } from 'pixi.js';
3
- import { ScreenState, ReadoutControl, OpenUI, Control, BlockSpec, Theme, EventLog, SpinControl, ValueDisplay, ButtonControl, ToggleControl, TurboControl, AutoplayControl, SliderControl, PanelControl, SelectControl, StepperControl, Signal, NoticeAction, OpenUIEvents, Dispose, CurrencySpec, JurisdictionConfig, NoticeOptions, RgsErrorOptions, ControlSnapshot, HostHooks, UISpec, Transition } from '@open-slot-ui/core';
4
-
5
- type StatusBarSide = 'top' | 'bottom';
6
- /**
7
- * A thin, full-width black-and-white status strip pinned to the top or bottom edge,
8
- * holding the compliance readouts (net · RTP · session) as inline items — white
9
- * text on a dark bar, no theme accent. Only the jurisdiction-revealed readouts take
10
- * a slot, so it adapts from 0→3 items (and hides itself when empty). A full-screen
11
- * overlay (OpenUIPixi manages it + insets the HUD by {@link StatusBarView.heightFor}
12
- * so controls never sit under it).
13
- */
14
- declare class StatusBarView extends Container {
15
- private readonly ui;
16
- private readonly side;
17
- private readonly bg;
18
- private readonly items;
19
- private screen;
20
- private readonly disposers;
21
- /** The strip's pixel height for the current screen (used for the HUD margin too). */
22
- static heightFor(screen: ScreenState): number;
23
- constructor(controls: ReadoutControl[], ui: OpenUI, ticker: Ticker, side: StatusBarSide);
24
- applyLayout(screen: ScreenState): void;
25
- private relayout;
26
- dispose(): void;
27
- }
3
+ import { Control, OpenUI, ScreenState, BlockSpec, Theme, EventLog, SpinControl, ValueDisplay, ButtonControl, ToggleControl, TurboControl, AutoplayControl, SliderControl, PanelControl, SelectControl, StepperControl, ReadoutControl, Signal, NoticeAction, OpenUIEvents, Dispose, CurrencySpec, JurisdictionConfig, NoticeOptions, RgsErrorOptions, ControlSnapshot, HostHooks, UISpec, Transition } from '@open-slot-ui/core';
28
4
 
29
5
  /**
30
6
  * Base view: a Pixi Container bound to a core Control. Owns layout placement and
@@ -146,11 +122,11 @@ interface OpenUIPixiOptions {
146
122
  */
147
123
  autoplayPicker?: 'drawer' | 'radial';
148
124
  /**
149
- * Put the compliance readouts (net · RTP · session) in a thin status strip at the
150
- * `'top'` or `'bottom'` edge instead of at screen corners. Each readout still only
151
- * shows when its jurisdiction `display*` flag is set.
125
+ * Text colour for the top-corner compliance readouts (RTP / net / session). Defaults
126
+ * to the theme text colour; a light-background host can pass a dark colour so the
127
+ * Figma-style `Label: value` block stays legible.
152
128
  */
153
- statusBar?: StatusBarSide;
129
+ readoutColor?: string;
154
130
  /**
155
131
  * How the interactive HUD appears on mount: `'shown'` (default), `'hidden'` (off
156
132
  * screen + non-interactive; reveal later with `showControls()`), or `'slide-in'`
@@ -231,9 +207,15 @@ declare class SpinView extends ControlView {
231
207
  private readonly fsFace;
232
208
  private readonly fsCount;
233
209
  private readonly fsLabel;
210
+ /** Autoplay STOP face — a "STOP" label over the remaining count (or ∞); shown while
211
+ * autoplay is active. Tapping the spin button then STOPS autoplay. */
212
+ private readonly stopFace;
213
+ private readonly stopCount;
214
+ private readonly stopLabel;
234
215
  constructor(spin: SpinControl, ui: OpenUI, ticker: Ticker, skinOrOpts?: SpinSkinFactory | SpinViewOptions);
235
- /** Swap the spin face: free-spins counter when `freeSpins > 0`, else the skin. */
236
- private updateFreeSpins;
216
+ /** Pick the spin face: autoplay STOP-count (top priority) free-spins counter
217
+ * the normal skin. */
218
+ private updateFaces;
237
219
  private readonly onOver;
238
220
  private readonly onOut;
239
221
  private readonly onDown;
@@ -262,6 +244,7 @@ declare class ValueDisplayView extends ControlView {
262
244
  private readonly fitGsap?;
263
245
  private counter;
264
246
  private caption;
247
+ private captionPill;
265
248
  constructor(vd: ValueDisplay, ui: OpenUI, ticker: Ticker,
266
249
  /** Host `gsap` — when present, the counter auto-downscales wide values to fit
267
250
  * (Charter B5: no hard gsap dep; the host passes it). */
@@ -289,16 +272,15 @@ interface ButtonViewOptions {
289
272
  /** Monochrome look — white circle, black ring, black glyph (matches the turbo
290
273
  * button's b&w art). Only affects the drawn (no-texture) circle path. */
291
274
  mono?: boolean;
275
+ /** Inverted look — solid black circle with a white glyph, no ring (the Figma ☰
276
+ * menu button). Only affects the drawn (no-texture) circle path. */
277
+ dark?: boolean;
292
278
  }
293
- /**
294
- * Generic button view. With `iconTexture` it renders the provided art as a Sprite
295
- * (swappable via `setIconTexture`, e.g. ☰ ↔ ✕); otherwise a neutral token placeholder.
296
- * Pointer input drives the control's state machine; entry transitions play on `art`.
297
- */
298
279
  declare class ButtonView extends ControlView {
299
280
  private readonly btn;
300
281
  private readonly art;
301
282
  private readonly bg;
283
+ private readonly glyphG;
302
284
  private sprite;
303
285
  private labelText;
304
286
  private readonly tween;
@@ -308,14 +290,13 @@ declare class ButtonView extends ControlView {
308
290
  private glyph;
309
291
  private readonly iconTarget;
310
292
  private readonly mono;
293
+ private readonly dark;
311
294
  constructor(btn: ButtonControl, ui: OpenUI, ticker: Ticker, opts?: ButtonViewOptions);
312
295
  /** Swap the displayed art (e.g. ☰ → ✕). */
313
296
  setIconTexture(tex: Texture): void;
314
297
  /** Swap the placeholder glyph (e.g. speaker ↔ speaker-mute, fullscreen ↔ exit). */
315
298
  setGlyph(glyph: ButtonGlyph): void;
316
299
  private fitSprite;
317
- private readonly onOver;
318
- private readonly onOut;
319
300
  private readonly onDown;
320
301
  private readonly onUp;
321
302
  private readonly onUpOutside;
@@ -731,6 +712,10 @@ interface ReadoutViewOptions {
731
712
  inline?: boolean;
732
713
  /** Force black-and-white text (white on a dark bar), ignoring the theme accent/text hue. */
733
714
  mono?: boolean;
715
+ /** Single left-aligned `Label: value` line (the Figma top-corner block). */
716
+ prefix?: boolean;
717
+ /** Explicit text colour (else the theme text colour). Lets a light-bg host darken it. */
718
+ fill?: string;
734
719
  }
735
720
  /**
736
721
  * A compact, non-interactive readout for the Stake Engine jurisdiction `display*`
@@ -746,6 +731,7 @@ declare class ReadoutView extends ControlView {
746
731
  private readonly caption?;
747
732
  private readonly valueText;
748
733
  private readonly tick?;
734
+ private readonly prefix;
749
735
  constructor(ro: ReadoutControl, ui: OpenUI, ticker: Ticker, opts?: ReadoutViewOptions);
750
736
  private render;
751
737
  dispose(): void;
@@ -779,6 +765,9 @@ declare class DialogView extends ControlView {
779
765
  private childViews;
780
766
  private screen;
781
767
  private readonly maxWidth;
768
+ /** `ui` proxy with a light theme — so the shared block renderer draws dark-on-white
769
+ * content inside the white modal card (Figma "default" dialog look). */
770
+ private readonly lightUi;
782
771
  constructor(panel: PanelControl, blocks: Signal<BlockSpec[]>, actions: Signal<NoticeAction[]>, ui: OpenUI, ticker: Ticker, opts?: DialogViewOptions);
783
772
  private buildClose;
784
773
  applyLayout(screen: ScreenState): void;
@@ -930,4 +919,4 @@ declare class Tweener {
930
919
  /** Treat touch devices as non-desktop so we don't fire phantom hover states. */
931
920
  declare function isDesktop(): boolean;
932
921
 
933
- export { AutoplayDrawerView, AutoplayView, type AutoplayViewOptions, type BlockColumn, type BlockColumnOptions, type BootedHud, type ButtonGlyph, ButtonView, type ButtonViewOptions, ControlView, type ControlViewFactory, DialogView, type DialogViewOptions, type HudOptions, type InfoContentBuilder, MenuView, type MenuViewOptions, type OpenUIIcons, OpenUIPixi, type OpenUIPixiOptions, type PanelBodyOptions, PanelBodyView, PanelView, type PanelViewOptions, type PopoverArt, type PopoverParts, PopoverView, ReadoutView, type ReadoutViewOptions, SelectView, type SelectViewOptions, SliderView, type SpinSkin, type SpinSkinFactory, SpinView, type SpinViewOptions, type StatusBarSide, StatusBarView, StepperView, type SvgSpinTextures, TextCellRenderer, type TextCellRendererOptions, ToggleView, type ToggleViewOptions, TurboView, type TurboViewOptions, Tweener, ValueDisplayView, buildBlockColumn, defaultSpinSkin, drawSpin, isDesktop, mountHud, svgSpinSkin };
922
+ export { AutoplayDrawerView, AutoplayView, type AutoplayViewOptions, type BlockColumn, type BlockColumnOptions, type BootedHud, type ButtonGlyph, ButtonView, type ButtonViewOptions, ControlView, type ControlViewFactory, DialogView, type DialogViewOptions, type HudOptions, type InfoContentBuilder, MenuView, type MenuViewOptions, type OpenUIIcons, OpenUIPixi, type OpenUIPixiOptions, type PanelBodyOptions, PanelBodyView, PanelView, type PanelViewOptions, type PopoverArt, type PopoverParts, PopoverView, ReadoutView, type ReadoutViewOptions, SelectView, type SelectViewOptions, SliderView, type SpinSkin, type SpinSkinFactory, SpinView, type SpinViewOptions, StepperView, type SvgSpinTextures, TextCellRenderer, type TextCellRendererOptions, ToggleView, type ToggleViewOptions, TurboView, type TurboViewOptions, Tweener, ValueDisplayView, buildBlockColumn, defaultSpinSkin, drawSpin, isDesktop, mountHud, svgSpinSkin };