@adiakys/feeling-lucky 0.1.0 → 0.3.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.
- package/README.md +73 -5
- package/dist/config/types.d.ts +11 -0
- package/dist/{de-Cp-ILcpM.js → de-CmzpGbNK.js} +19 -3
- package/dist/developer/panel.d.ts +2 -0
- package/dist/developer/settings.d.ts +2 -0
- package/dist/engine/dealer.d.ts +21 -0
- package/dist/{es-DHZIstf4.js → es-k_kS6Fn2.js} +19 -3
- package/dist/feeling-lucky.iife.js +417 -249
- package/dist/feeling-lucky.js +17 -39
- package/dist/{fr-BPFoerSF.js → fr-GuCZB1l4.js} +19 -3
- package/dist/games/blackjack/blackjack.d.ts +1 -0
- package/dist/games/cards/dealer.d.ts +9 -0
- package/dist/games/cards/table.d.ts +7 -1
- package/dist/games/holdem/holdem.d.ts +2 -0
- package/dist/{i18n-CihzHMU5.js → i18n-Cid8bj2R.js} +23 -7
- package/dist/icons-DTaPp44c.js +863 -0
- package/dist/{it-B95CFDto.js → it-BNztlqHd.js} +19 -3
- package/dist/locales/de/cards.d.ts +7 -0
- package/dist/locales/de/developer.d.ts +7 -0
- package/dist/locales/de/room.d.ts +2 -0
- package/dist/locales/en/cards.d.ts +7 -0
- package/dist/locales/en/developer.d.ts +7 -0
- package/dist/locales/en/room.d.ts +2 -0
- package/dist/locales/es/cards.d.ts +7 -0
- package/dist/locales/es/developer.d.ts +7 -0
- package/dist/locales/es/room.d.ts +2 -0
- package/dist/locales/fr/cards.d.ts +7 -0
- package/dist/locales/fr/developer.d.ts +7 -0
- package/dist/locales/fr/room.d.ts +2 -0
- package/dist/locales/it/cards.d.ts +7 -0
- package/dist/locales/it/developer.d.ts +7 -0
- package/dist/locales/it/room.d.ts +2 -0
- package/dist/mount-CMm0qSYk.js +6257 -0
- package/dist/multiplayer/blackjack.d.ts +35 -0
- package/dist/multiplayer/client.d.ts +55 -0
- package/dist/multiplayer/holdem.d.ts +21 -0
- package/dist/multiplayer/index.d.ts +2 -0
- package/dist/multiplayer/seats.d.ts +16 -0
- package/dist/multiplayer/shared.d.ts +33 -0
- package/dist/multiplayer-CN0t0j_F.js +502 -0
- package/dist/{panel-D1hKmQL7.js → panel-BVgq3Cm5.js} +167 -139
- package/dist/resolve-Dc48n2Jo.js +28 -0
- package/dist/room/boost.d.ts +1 -1
- package/dist/room/lobby.d.ts +1 -0
- package/dist/room/room.d.ts +11 -1
- package/dist/room/stage.d.ts +2 -1
- package/dist/runtime/context.d.ts +3 -1
- package/dist/runtime/sound.d.ts +1 -1
- package/package.json +2 -2
- package/dist/mount-BxDaFww2.js +0 -7034
package/dist/feeling-lucky.js
CHANGED
|
@@ -1,45 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var i = async (e) => typeof e == "function" ? e() : e;
|
|
4
|
-
async function a(e) {
|
|
5
|
-
let [t, n, r, a, o, s] = await Promise.all([
|
|
6
|
-
i(e.prizes),
|
|
7
|
-
e.locale === void 0 ? void 0 : i(e.locale),
|
|
8
|
-
e.messages === void 0 ? {} : i(e.messages),
|
|
9
|
-
e.player === void 0 ? null : i(e.player),
|
|
10
|
-
e.developer !== void 0 && i(e.developer),
|
|
11
|
-
e.logo === void 0 ? void 0 : i(e.logo)
|
|
12
|
-
]);
|
|
13
|
-
if (!t.length) throw Error("feeling-lucky: at least one prize is needed");
|
|
14
|
-
return {
|
|
15
|
-
prizes: t,
|
|
16
|
-
locale: n,
|
|
17
|
-
messages: r,
|
|
18
|
-
player: a,
|
|
19
|
-
logo: s,
|
|
20
|
-
developer: o === !1 ? null : { passwordHash: o === !0 ? void 0 : o.passwordHash },
|
|
21
|
-
onWin: e.onWin,
|
|
22
|
-
onClaim: e.onClaim
|
|
23
|
-
};
|
|
24
|
-
}
|
|
1
|
+
import { n as e } from "./resolve-Dc48n2Jo.js";
|
|
2
|
+
import { a as t, r as n, s as r, t as i } from "./i18n-Cid8bj2R.js";
|
|
25
3
|
// src/index.ts
|
|
26
|
-
function
|
|
27
|
-
let
|
|
4
|
+
function a(r) {
|
|
5
|
+
let a = r, o = null, s = null, c = () => {
|
|
28
6
|
o?.remove(), o = null, s = null;
|
|
29
7
|
};
|
|
30
8
|
return {
|
|
31
|
-
open({ from:
|
|
9
|
+
open({ from: r } = {}) {
|
|
32
10
|
if (o) return;
|
|
33
|
-
|
|
34
|
-
let l =
|
|
11
|
+
t();
|
|
12
|
+
let l = r instanceof Element ? r.getBoundingClientRect() : null, u = l ? {
|
|
35
13
|
x: l.left + l.width / 2,
|
|
36
14
|
y: l.top + l.height / 2
|
|
37
|
-
} :
|
|
15
|
+
} : r;
|
|
38
16
|
o = document.body.appendChild(document.createElement("feeling-lucky"));
|
|
39
17
|
let d = o;
|
|
40
18
|
(async () => {
|
|
41
|
-
let [
|
|
42
|
-
await
|
|
19
|
+
let [t, { mountRoom: r }] = await Promise.all([e(a), import("./mount-CMm0qSYk.js").then((e) => e.t)]);
|
|
20
|
+
await i(t.locale ?? n.value).catch(() => void 0), o === d && (s = r(d, t, u), s.addEventListener("closed", c));
|
|
43
21
|
})().catch((e) => {
|
|
44
22
|
o === d && c(), console.error(e);
|
|
45
23
|
});
|
|
@@ -47,17 +25,17 @@ function o(n) {
|
|
|
47
25
|
close() {
|
|
48
26
|
s ? s.close() : c();
|
|
49
27
|
},
|
|
50
|
-
update(
|
|
51
|
-
|
|
52
|
-
...
|
|
53
|
-
...
|
|
28
|
+
update(t) {
|
|
29
|
+
a = {
|
|
30
|
+
...a,
|
|
31
|
+
...t
|
|
54
32
|
};
|
|
55
|
-
let
|
|
56
|
-
|
|
33
|
+
let n = s;
|
|
34
|
+
n && e(a).then((e) => n === s && (n.config = e));
|
|
57
35
|
},
|
|
58
36
|
destroy() {
|
|
59
37
|
c();
|
|
60
38
|
}
|
|
61
39
|
};
|
|
62
40
|
}
|
|
63
|
-
export {
|
|
41
|
+
export { a as createFeelingLucky, r as en };
|
|
@@ -34,7 +34,9 @@ var t = e({
|
|
|
34
34
|
boost: {
|
|
35
35
|
badge: "×{n}",
|
|
36
36
|
title: "Bonus du jour",
|
|
37
|
-
odds: "Bonus du jour\xA0: gains {n} fois plus probables"
|
|
37
|
+
odds: "Bonus du jour\xA0: gains {n} fois plus probables",
|
|
38
|
+
dealer: "Croupier à la table",
|
|
39
|
+
dealerOdds: "Croupier à la table : gains {n} fois plus probables"
|
|
38
40
|
},
|
|
39
41
|
themes: {
|
|
40
42
|
christmas: {
|
|
@@ -335,7 +337,14 @@ var t = e({
|
|
|
335
337
|
cards: {
|
|
336
338
|
you: "Vous",
|
|
337
339
|
dealer: "Banque",
|
|
338
|
-
deal: "Distribuer"
|
|
340
|
+
deal: "Distribuer",
|
|
341
|
+
player: "Joueur",
|
|
342
|
+
stand: "Quitter la table",
|
|
343
|
+
sit: "S’asseoir ici",
|
|
344
|
+
chooseSeat: "Choisissez une place",
|
|
345
|
+
dealingIn: "Distribution dans {seconds}s",
|
|
346
|
+
playIn: "{seconds}s pour jouer",
|
|
347
|
+
nextHand: "Vous jouez dès la prochaine main"
|
|
339
348
|
},
|
|
340
349
|
blackjack: {
|
|
341
350
|
print: "La banque reste à 17 · Blackjack de pique\xA0: jackpot",
|
|
@@ -447,6 +456,13 @@ var t = e({
|
|
|
447
456
|
calendar: "D'après le calendrier",
|
|
448
457
|
noTheme: "Aucun",
|
|
449
458
|
language: "Langue",
|
|
450
|
-
autoLanguage: "Automatique"
|
|
459
|
+
autoLanguage: "Automatique",
|
|
460
|
+
tables: "Tables de cartes",
|
|
461
|
+
multiplayer: "Multijoueur",
|
|
462
|
+
singlePlayer: "Solo",
|
|
463
|
+
dealer: "Croupier",
|
|
464
|
+
dealerShifts: "Selon les services du jour",
|
|
465
|
+
dealerAbsent: "Absent",
|
|
466
|
+
dealerNumber: "Croupier {n}"
|
|
451
467
|
} });
|
|
452
468
|
export { t as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { nothing } from 'lit';
|
|
2
|
+
import { LuckyElement } from '../../runtime/element';
|
|
3
|
+
export declare class DealerPortrait extends LuckyElement {
|
|
4
|
+
dealer: number | null;
|
|
5
|
+
dealing: boolean;
|
|
6
|
+
private last;
|
|
7
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
8
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { type TemplateResult } from 'lit';
|
|
2
2
|
import type { RoomContext } from '../../runtime/context';
|
|
3
|
-
|
|
3
|
+
import './dealer';
|
|
4
|
+
export declare const silhouette: TemplateResult<1>;
|
|
5
|
+
export declare function cardTable(room: RoomContext, print: string, { dealer, centre, bet, player, seats }: {
|
|
4
6
|
dealer: TemplateResult;
|
|
5
7
|
centre: TemplateResult;
|
|
6
8
|
bet?: TemplateResult;
|
|
7
9
|
player: TemplateResult;
|
|
10
|
+
seats?: TemplateResult;
|
|
11
|
+
}, { on, dealing }: {
|
|
12
|
+
on: number | null;
|
|
13
|
+
dealing: boolean;
|
|
8
14
|
}): TemplateResult<1>;
|
|
@@ -35,7 +35,9 @@ var n = e({
|
|
|
35
35
|
boost: {
|
|
36
36
|
badge: "×{n}",
|
|
37
37
|
title: "Bonus of the day",
|
|
38
|
-
odds: "Bonus of the day: wins {n} times as likely"
|
|
38
|
+
odds: "Bonus of the day: wins {n} times as likely",
|
|
39
|
+
dealer: "Dealer at the table",
|
|
40
|
+
dealerOdds: "Dealer at the table: wins {n} times as likely"
|
|
39
41
|
},
|
|
40
42
|
themes: {
|
|
41
43
|
christmas: {
|
|
@@ -336,7 +338,14 @@ var n = e({
|
|
|
336
338
|
cards: {
|
|
337
339
|
you: "You",
|
|
338
340
|
dealer: "Dealer",
|
|
339
|
-
deal: "Deal"
|
|
341
|
+
deal: "Deal",
|
|
342
|
+
player: "Player",
|
|
343
|
+
stand: "Stand up",
|
|
344
|
+
sit: "Sit here",
|
|
345
|
+
chooseSeat: "Choose a seat",
|
|
346
|
+
dealingIn: "Dealing in {seconds}s",
|
|
347
|
+
playIn: "{seconds}s to play",
|
|
348
|
+
nextHand: "You're in from the next hand"
|
|
340
349
|
},
|
|
341
350
|
blackjack: {
|
|
342
351
|
print: "Dealer stands on 17 · Blackjack of spades: jackpot",
|
|
@@ -448,12 +457,19 @@ var n = e({
|
|
|
448
457
|
calendar: "From the calendar",
|
|
449
458
|
noTheme: "None",
|
|
450
459
|
language: "Language",
|
|
451
|
-
autoLanguage: "Automatic"
|
|
460
|
+
autoLanguage: "Automatic",
|
|
461
|
+
tables: "Card tables",
|
|
462
|
+
multiplayer: "Multiplayer",
|
|
463
|
+
singlePlayer: "Single player",
|
|
464
|
+
dealer: "Dealer",
|
|
465
|
+
dealerShifts: "From the day's shifts",
|
|
466
|
+
dealerAbsent: "Absent",
|
|
467
|
+
dealerNumber: "Dealer {n}"
|
|
452
468
|
} }), r = {
|
|
453
|
-
it: () => import("./it-
|
|
454
|
-
es: () => import("./es-
|
|
455
|
-
fr: () => import("./fr-
|
|
456
|
-
de: () => import("./de-
|
|
469
|
+
it: () => import("./it-BNztlqHd.js"),
|
|
470
|
+
es: () => import("./es-k_kS6Fn2.js"),
|
|
471
|
+
fr: () => import("./fr-GuCZB1l4.js"),
|
|
472
|
+
de: () => import("./de-CmzpGbNK.js")
|
|
457
473
|
}, i = ["en", ...Object.keys(r)], a = { en: n }, o = (e) => a[e], s = (e) => e.every((e) => !r[e] || a[e]);
|
|
458
474
|
async function c(e) {
|
|
459
475
|
await Promise.all(e.filter((e) => r[e] && !a[e]).map(async (e) => a[e] = (await r[e]()).default));
|