@adiakys/feeling-lucky 0.1.0 → 0.2.0

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.
Files changed (35) hide show
  1. package/README.md +20 -4
  2. package/dist/config/types.d.ts +6 -0
  3. package/dist/{de-Cp-ILcpM.js → de-B56NsnDF.js} +8 -2
  4. package/dist/developer/panel.d.ts +1 -0
  5. package/dist/developer/settings.d.ts +1 -0
  6. package/dist/engine/dealer.d.ts +21 -0
  7. package/dist/{es-DHZIstf4.js → es-9iWwCe8s.js} +8 -2
  8. package/dist/feeling-lucky.iife.js +259 -243
  9. package/dist/feeling-lucky.js +6 -4
  10. package/dist/{fr-BPFoerSF.js → fr-Y2BcCS3U.js} +8 -2
  11. package/dist/games/blackjack/blackjack.d.ts +1 -0
  12. package/dist/games/cards/dealer.d.ts +9 -0
  13. package/dist/games/cards/table.d.ts +4 -0
  14. package/dist/games/holdem/holdem.d.ts +2 -0
  15. package/dist/{i18n-CihzHMU5.js → i18n-it2FlmVZ.js} +12 -6
  16. package/dist/{it-B95CFDto.js → it-CNSOLgaT.js} +8 -2
  17. package/dist/locales/de/developer.d.ts +4 -0
  18. package/dist/locales/de/room.d.ts +2 -0
  19. package/dist/locales/en/developer.d.ts +4 -0
  20. package/dist/locales/en/room.d.ts +2 -0
  21. package/dist/locales/es/developer.d.ts +4 -0
  22. package/dist/locales/es/room.d.ts +2 -0
  23. package/dist/locales/fr/developer.d.ts +4 -0
  24. package/dist/locales/fr/room.d.ts +2 -0
  25. package/dist/locales/it/developer.d.ts +4 -0
  26. package/dist/locales/it/room.d.ts +2 -0
  27. package/dist/{mount-BxDaFww2.js → mount-CBUkAcVV.js} +937 -862
  28. package/dist/{panel-D1hKmQL7.js → panel-tWJMt9kl.js} +16 -1
  29. package/dist/room/boost.d.ts +1 -1
  30. package/dist/room/lobby.d.ts +1 -0
  31. package/dist/room/room.d.ts +5 -1
  32. package/dist/room/stage.d.ts +2 -1
  33. package/dist/runtime/context.d.ts +2 -1
  34. package/dist/runtime/sound.d.ts +1 -1
  35. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { A as e, B as t, C as n, D as r, E as i, F as a, I as o, L as s, M as c, N as l, O as u, P as d, R as f, S as p, T as m, _ as h, a as ee, b as te, c as ne, d as g, f as _, g as v, h as y, i as b, j as x, k as S, l as C, m as re, n as ie, o as w, p as ae, r as oe, s as T, u as se, v as E, w as ce, x as D, y as O, z as k } from "./mount-BxDaFww2.js";
1
+ import { A as e, B as t, C as n, D as r, E as i, F as a, I as o, L as s, M as c, N as l, O as u, P as d, R as f, S as p, T as m, _ as h, a as ee, b as te, c as ne, d as g, f as _, g as v, h as y, i as b, j as x, k as S, l as C, m as re, n as ie, o as w, p as ae, r as oe, s as T, u as se, v as E, w as ce, x as D, y as O, z as k } from "./mount-CBUkAcVV.js";
2
2
  // node_modules/lit-html/directives/live.js
3
3
  var A = x(class extends c {
4
4
  constructor(t) {
@@ -204,6 +204,7 @@ var J = {
204
204
  },
205
205
  "scratch.ticket": (e, t) => H("scratch").variant ?? t(),
206
206
  locale: (e, t) => z.locale ?? t(),
207
+ dealer: ({ count: e }, t) => z.dealer === void 0 ? t() : z.dealer === "none" ? null : z.dealer < e ? z.dealer : t(),
207
208
  theme: (e, t) => z.theme === void 0 ? t() : z.theme === "none" ? null : z.theme,
208
209
  "slot.machine": (e, t) => H("slot").variant ?? t(),
209
210
  "breakaway.tackle": (e, t) => G[H("slot").result] && G[H("slot").result] !== "none" ? null : t(),
@@ -323,6 +324,9 @@ var J = {
323
324
  setLanguage(e) {
324
325
  z.locale = e || void 0, E.value++;
325
326
  }
327
+ setDealer(e) {
328
+ z.dealer = e === "" ? void 0 : e === "none" ? "none" : Number(e), E.value++, this.requestUpdate();
329
+ }
326
330
  setTheme(e) {
327
331
  z.theme = e || void 0, E.value++, this.requestUpdate();
328
332
  }
@@ -443,6 +447,17 @@ var J = {
443
447
  })), z.locale, this.t("developer.autoLanguage"))}
444
448
  </select>
445
449
  </label>
450
+ ${this.room.dealers.length ? t`<label class="lk-dev-row">${this.t("developer.dealer")}
451
+ <select @change=${(e) => this.setDealer(s(e))}>
452
+ ${this.choices([{
453
+ value: "none",
454
+ label: this.t("developer.dealerAbsent")
455
+ }, ...this.room.dealers.map((e, t) => ({
456
+ value: String(t),
457
+ label: e.name ?? this.t("developer.dealerNumber", { n: t + 1 })
458
+ }))], z.dealer === void 0 ? void 0 : String(z.dealer), this.t("developer.dealerShifts"))}
459
+ </select>
460
+ </label>` : f}
446
461
  <label class="lk-dev-row">${this.t("developer.game")}
447
462
  <select @change=${this.selectGame}>
448
463
  ${y.map((n) => t`<option value=${n} ?selected=${n === e}>${this.t(`games.${n}.name`)}</option>`)}
@@ -1,2 +1,2 @@
1
1
  import type { Translate } from '../runtime/i18n';
2
- export declare const boost: (t: Translate, multiplier: number) => import("lit-html").TemplateResult<1>;
2
+ export declare const boost: (t: Translate, multiplier: number, dealer?: boolean) => import("lit-html").TemplateResult<1>;
@@ -7,6 +7,7 @@ export declare class Lobby extends LuckyElement {
7
7
  page: number;
8
8
  private takeoffShown;
9
9
  private grid?;
10
+ constructor();
10
11
  private strips;
11
12
  private stripsFor?;
12
13
  private struck;
@@ -1,5 +1,5 @@
1
1
  import { type PropertyValues } from 'lit';
2
- import type { Messages, Player, Prize, Win } from '../config/types';
2
+ import type { Dealer, Messages, Player, Prize, Win } from '../config/types';
3
3
  import { type RoomContext } from '../runtime/context';
4
4
  import { LuckyElement } from '../runtime/element';
5
5
  import '../games';
@@ -18,6 +18,7 @@ export interface RoomConfig {
18
18
  prizes: Prize[];
19
19
  player: Player | null;
20
20
  logo?: string;
21
+ dealers?: Dealer[];
21
22
  locale?: string;
22
23
  messages: Record<string, Messages>;
23
24
  onWin?: (win: Win) => void;
@@ -47,11 +48,14 @@ export declare class Room extends LuckyElement {
47
48
  private lightsCanvas?;
48
49
  private fxCanvas?;
49
50
  private lightsFrame;
51
+ private dutyCheck;
52
+ private dutyClock;
50
53
  private ambient;
51
54
  private boost;
52
55
  constructor();
53
56
  private get theme();
54
57
  protected willUpdate(changed: PropertyValues<this>): void;
58
+ private get dealers();
55
59
  private locale;
56
60
  private context;
57
61
  private go;
@@ -1,10 +1,11 @@
1
1
  import { type TemplateResult } from 'lit';
2
2
  import type { Translate } from '../runtime/i18n';
3
3
  import { LuckyElement } from '../runtime/element';
4
- export declare function stage(t: Translate, { state, rules, multiplier }: {
4
+ export declare function stage(t: Translate, { state, rules, multiplier, dealer }: {
5
5
  state: 'idle' | 'spinning' | 'won';
6
6
  rules: string;
7
7
  multiplier?: number;
8
+ dealer?: boolean;
8
9
  }, game: TemplateResult, overlay?: TemplateResult): TemplateResult<1>;
9
10
  export declare class Rules extends LuckyElement {
10
11
  text: string;
@@ -1,5 +1,5 @@
1
1
  import type { TemplateResult } from 'lit';
2
- import type { GameId, Player, Prize, Tier } from '../config/types';
2
+ import type { Dealer, GameId, Player, Prize, Tier } from '../config/types';
3
3
  import type { Award, Board } from '../engine/awards';
4
4
  import type { Outcome } from '../engine/outcome';
5
5
  import type { Translate } from './i18n';
@@ -15,6 +15,7 @@ export interface RoomContext {
15
15
  prizeIds: string[];
16
16
  board: Board;
17
17
  player: Player | null;
18
+ dealers: Dealer[];
18
19
  locale: string;
19
20
  locales: string[];
20
21
  t: Translate;
@@ -1,4 +1,4 @@
1
- export type SoundName = 'tick' | 'reel' | 'stop' | 'whoosh' | 'bounce' | 'chime' | 'win' | 'jackpot' | 'stamp' | 'scratch' | 'lever' | 'ambient' | 'thunder';
1
+ export type SoundName = 'tick' | 'reel' | 'stop' | 'whoosh' | 'bounce' | 'chime' | 'win' | 'jackpot' | 'stamp' | 'scratch' | 'lever' | 'ambient' | 'thunder' | 'dealer';
2
2
  export declare const sound: {
3
3
  enabled: boolean;
4
4
  context: AudioContext | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adiakys/feeling-lucky",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A casino room for any web app: classic casino games that award the prizes you configure.",
5
5
  "keywords": [
6
6
  "casino",