@betorigami/games 0.0.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/components/dice/DiceContent/DiceContent.d.ts +14 -0
- package/dist/components/dice/DiceContent/DiceContent.styles.d.ts +1 -0
- package/dist/components/dice/DiceContentBottom/DiceContentBottom.d.ts +15 -0
- package/dist/components/dice/DiceContentBottom/DiceContentBottom.styles.d.ts +1 -0
- package/dist/components/dice/DiceControls/DiceAuto.d.ts +9 -0
- package/dist/components/dice/DiceControls/DiceControls.styles.d.ts +1 -0
- package/dist/components/dice/DiceControls/DiceManual.d.ts +11 -0
- package/dist/components/dice/DiceGame.d.ts +47 -0
- package/dist/components/dice/DiceSlider/DiceSlider.d.ts +16 -0
- package/dist/components/dice/DiceSlider/DiceSlider.styles.d.ts +1 -0
- package/dist/components/dice/dice.api.d.ts +71 -0
- package/dist/components/dice/dice.mock.api.d.ts +13 -0
- package/dist/components/keno/KenoContent/KenoContent.d.ts +17 -0
- package/dist/components/keno/KenoContent/KenoContent.styles.d.ts +1 -0
- package/dist/components/keno/KenoContent/KenoContentBottom.d.ts +14 -0
- package/dist/components/keno/KenoContent/KenoContentBottom.styles.d.ts +1 -0
- package/dist/components/keno/KenoControls/KenoAuto.d.ts +9 -0
- package/dist/components/keno/KenoControls/KenoControls.styles.d.ts +1 -0
- package/dist/components/keno/KenoControls/KenoManual.d.ts +10 -0
- package/dist/components/keno/KenoGame.d.ts +30 -0
- package/dist/components/keno/KenoGrid/KenoGrid.d.ts +24 -0
- package/dist/components/keno/KenoGrid/KenoGrid.styles.d.ts +1 -0
- package/dist/components/keno/KenoTile/KenoTile.d.ts +16 -0
- package/dist/components/keno/KenoTile/KenoTile.styles.d.ts +1 -0
- package/dist/components/keno/keno.api.d.ts +67 -0
- package/dist/components/keno/keno.mock.api.d.ts +15 -0
- package/dist/components/limbo/LimboContent/LimboContent.d.ts +13 -0
- package/dist/components/limbo/LimboContent/LimboContent.styles.d.ts +1 -0
- package/dist/components/limbo/LimboContentBottom/LimboContentBottom.d.ts +14 -0
- package/dist/components/limbo/LimboContentBottom/LimboContentBottom.styles.d.ts +1 -0
- package/dist/components/limbo/LimboControls/LimboAuto.d.ts +9 -0
- package/dist/components/limbo/LimboControls/LimboControls.styles.d.ts +1 -0
- package/dist/components/limbo/LimboControls/LimboManual.d.ts +11 -0
- package/dist/components/limbo/LimboGame.d.ts +27 -0
- package/dist/components/limbo/Multiplier/LimboMultiplier.d.ts +17 -0
- package/dist/components/limbo/Multiplier/LimboMultiplier.styles.d.ts +1 -0
- package/dist/components/limbo/limbo.api.d.ts +62 -0
- package/dist/components/limbo/limbo.mock.api.d.ts +13 -0
- package/dist/components/mines/Controls/MinesAuto.d.ts +13 -0
- package/dist/components/mines/Controls/MinesControls.styles.d.ts +1 -0
- package/dist/components/mines/Controls/MinesManual.d.ts +11 -0
- package/dist/components/mines/MinesGame.d.ts +34 -0
- package/dist/components/mines/MinesGrid/MinesGrid.d.ts +29 -0
- package/dist/components/mines/MinesGrid/MinesGrid.styles.d.ts +1 -0
- package/dist/components/mines/MinesTile/MinesTile.d.ts +21 -0
- package/dist/components/mines/MinesTile/MinesTile.styles.d.ts +1 -0
- package/dist/components/mines/mines.api.d.ts +122 -0
- package/dist/components/mines/mines.constants.d.ts +22 -0
- package/dist/components/mines/mines.mock.api.d.ts +50 -0
- package/dist/components/shared/BetResultModal/BetResultModal.d.ts +45 -0
- package/dist/components/shared/BetResultModal/BetResultModal.styles.d.ts +1 -0
- package/dist/components/shared/Button/Button.d.ts +25 -0
- package/dist/components/shared/Button/Button.styles.d.ts +1 -0
- package/dist/components/shared/Button/ButtonGroup.d.ts +6 -0
- package/dist/components/shared/Button/ButtonGroup.styles.d.ts +1 -0
- package/dist/components/shared/FairnessDetails/FairnessDetails.d.ts +14 -0
- package/dist/components/shared/FairnessDetails/FairnessDetails.styles.d.ts +1 -0
- package/dist/components/shared/Footer/Footer.d.ts +49 -0
- package/dist/components/shared/Footer/Footer.styles.d.ts +1 -0
- package/dist/components/shared/GameComponent.d.ts +35 -0
- package/dist/components/shared/GameLayout/GameLayout.d.ts +40 -0
- package/dist/components/shared/GameLayout/GameLayout.styles.d.ts +1 -0
- package/dist/components/shared/GameProviderWrapper.d.ts +20 -0
- package/dist/components/shared/GameSidebar/GameSidebar.d.ts +15 -0
- package/dist/components/shared/GameSidebar/GameSidebar.styles.d.ts +1 -0
- package/dist/components/shared/GameWinPopup/GameWinPopup.d.ts +18 -0
- package/dist/components/shared/GameWinPopup/GameWinPopup.styles.d.ts +1 -0
- package/dist/components/shared/GenericAutobet/BetCountInput.d.ts +11 -0
- package/dist/components/shared/GenericAutobet/GenericAutobet.d.ts +42 -0
- package/dist/components/shared/GenericAutobet/GenericAutobet.styles.d.ts +1 -0
- package/dist/components/shared/GenericAutobet/context/autobet.context.d.ts +11 -0
- package/dist/components/shared/HistoryPills/HistoryPills.d.ts +20 -0
- package/dist/components/shared/HistoryPills/HistoryPills.styles.d.ts +1 -0
- package/dist/components/shared/Inputs/BetAmountInput/BetAmountInput.d.ts +22 -0
- package/dist/components/shared/Inputs/CurrencyInput/RawCurrencyInput.d.ts +46 -0
- package/dist/components/shared/Inputs/Input/Input.d.ts +68 -0
- package/dist/components/shared/Inputs/Input/Input.styles.d.ts +1 -0
- package/dist/components/shared/Modal/Modal.d.ts +91 -0
- package/dist/components/shared/Modal/Modal.styles.d.ts +2 -0
- package/dist/components/shared/Modal/Portal.d.ts +13 -0
- package/dist/components/shared/Select/Select.d.ts +48 -0
- package/dist/components/shared/Select/Select.styles.d.ts +1 -0
- package/dist/components/shared/Statistics/Statistics.d.ts +43 -0
- package/dist/components/shared/Statistics/Statistics.styles.d.ts +1 -0
- package/dist/components/shared/Toggle/Toggle.d.ts +12 -0
- package/dist/components/shared/Toggle/Toggle.styles.d.ts +1 -0
- package/dist/components/shared/Tooltip/Tooltip.d.ts +54 -0
- package/dist/components/shared/Tooltip/Tooltip.styles.d.ts +1 -0
- package/dist/components/shared/context/game.context.d.ts +15 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.png +0 -0
- package/dist/favicon.svg +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +18188 -0
- package/dist/index.umd.js +5695 -0
- package/dist/origami.svg +17 -0
- package/dist/shared/component.styles.d.ts +2 -0
- package/dist/shared/constants.d.ts +8 -0
- package/dist/shared/event-map.d.ts +126 -0
- package/dist/shared/get-game-outcome.d.ts +1 -0
- package/dist/shared/icons/diceCubeIcon.d.ts +1 -0
- package/dist/shared/icons/minesBombIcon.d.ts +1 -0
- package/dist/shared/icons/minesGemIcon.d.ts +1 -0
- package/dist/shared/icons/multiplierIcon.d.ts +1 -0
- package/dist/shared/icons/profitIcon.d.ts +1 -0
- package/dist/shared/icons/rollDirectionIcon.d.ts +1 -0
- package/dist/shared/icons/winChanceIcon.d.ts +1 -0
- package/dist/shared/origami-action.type.d.ts +7 -0
- package/dist/shared/origami-element.d.ts +21 -0
- package/dist/shared/sleep.d.ts +1 -0
- package/dist/shared/watch.d.ts +26 -0
- package/dist/utils/active-elements.d.ts +15 -0
- package/dist/utils/animate.d.ts +22 -0
- package/dist/utils/animation-registry.d.ts +24 -0
- package/dist/utils/event.d.ts +2 -0
- package/dist/utils/focus-trap.d.ts +24 -0
- package/dist/utils/scroll.d.ts +22 -0
- package/dist/utils/slot.controller.d.ts +23 -0
- package/dist/utils/tabbable.d.ts +9 -0
- package/package.json +40 -0
package/dist/origami.svg
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg width="777" height="189" viewBox="0 0 777 189" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_11769_64)">
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M188.68 72.35V0H116.33C112.51 0 108.91 1.78 106.59 4.8L94.59 20.45L82.6 4.8C80.27 1.78 76.67 0 72.86 0H0.5V72.35C0.5 76.17 2.28 79.77 5.31 82.09L20.96 94.09L5.31 106.08C2.28 108.41 0.5 112.01 0.5 115.82V188.18H72.86C76.67 188.18 80.27 186.4 82.6 183.37L94.59 167.72L106.59 183.37C108.91 186.4 112.51 188.18 116.33 188.18H188.68V115.82C188.68 112.01 186.9 108.41 183.88 106.08L168.23 94.09L183.88 82.09C186.9 79.77 188.68 76.17 188.68 72.35ZM111.06 110.55C96.94 124.67 94.59 141.13 94.59 141.13C94.59 141.13 92.24 124.67 78.13 110.55C64.01 96.44 47.55 94.09 47.55 94.09C47.55 94.09 64.01 91.74 78.13 77.62C92.24 63.51 94.59 47.04 94.59 47.04C94.59 47.04 96.94 63.51 111.06 77.62C125.17 91.74 141.64 94.09 141.64 94.09C141.64 94.09 125.17 96.44 111.06 110.55Z" fill="#b3b3b3"/>
|
|
4
|
+
<path d="M235.725 93.693C235.725 61.653 257.227 38.022 290.704 38.022C324.181 38.022 345.843 61.653 345.843 93.693C345.843 125.733 325.246 150.056 290.704 150.056C256.162 150.056 235.725 125.893 235.725 93.693ZM325.405 93.48C325.405 72.883 313.217 56.437 290.704 56.437C268.191 56.437 256.003 72.883 256.003 93.48C256.003 116.046 267.978 131.588 290.704 131.588C313.43 131.588 325.405 115.994 325.405 93.48Z" fill="#b3b3b3"/>
|
|
5
|
+
<path d="M354.252 147.714V63.569H373.572V91.138H373.944C377.723 69.317 385.228 63.569 397.948 63.569H402.791V85.231H394.542C379.48 85.231 373.625 90.447 373.625 105.083V147.661H354.305L354.252 147.714Z" fill="#b3b3b3"/>
|
|
6
|
+
<path d="M408.805 52.339V38.022H429.722V52.339H408.805ZM409.71 147.714V63.569H429.03V147.714H409.71Z" fill="#b3b3b3"/>
|
|
7
|
+
<path d="M436.056 157.401C436.056 150.216 443.028 144.68 456.121 143.084C447.871 142.019 443.241 138.081 443.241 131.8C443.241 127.489 447.019 123.018 453.779 120.73L460.219 117.856C447.711 113.918 440.899 104.976 440.899 92.415C440.899 74 454.311 63.621 477.037 63.621H518.178V79.907H507.268C503.169 79.907 499.018 79.907 493.11 79.534V79.694C503.489 81.663 511.366 86.134 511.366 97.417C511.366 112.266 499.018 119.983 476.132 119.983C470.757 119.983 465.914 119.451 461.656 118.173L459.846 121.047C458.782 122.857 457.877 123.921 457.877 125.358C457.877 128.551 460.219 129.829 465.222 129.829C475.228 129.829 485.979 129.297 495.292 129.297C513.175 129.297 520.733 137.174 520.733 150.214C520.733 165.967 509.822 174.749 477.942 174.536C445.21 174.696 436.056 167.937 436.056 157.345V157.399V157.401ZM505.298 150.216C505.298 146.437 502.957 143.243 495.984 143.243H463.785C455.003 143.243 451.064 147.341 451.064 151.493C451.064 157.933 456.067 160.275 477.569 160.275C500.455 160.275 505.298 157.081 505.298 150.269V150.216ZM458.249 93.48C458.249 101.889 463.093 107.265 476.345 107.265C489.597 107.265 494.76 102.049 494.76 93.48C494.76 84.911 488.693 79.536 476.132 79.536C463.571 79.536 458.249 85.071 458.249 93.48Z" fill="#b3b3b3"/>
|
|
8
|
+
<path d="M579.225 126.585H578.852C574.914 141.593 564.695 149.47 550.218 149.47C534.624 149.47 523.713 141.593 523.713 125.467C523.713 109.341 533.027 98.962 554.157 98.962H579.225V95.556C579.225 84.113 574.594 77.833 562.938 77.833C552.56 77.833 546.652 82.463 544.683 94.651L526.268 92.15C528.769 73.362 539.893 61.707 563.684 61.707C587.475 61.707 598.385 73.895 598.385 95.344V147.609H579.225V126.479V126.585ZM579.225 116.047V113.386H557.031C547.717 113.386 542.714 116.792 542.714 122.54C542.714 128.288 546.493 133.823 557.403 133.823C570.656 133.823 579.225 126.319 579.225 116.1V116.047Z" fill="#b3b3b3"/>
|
|
9
|
+
<path d="M629.893 147.715H610.573V63.57H629.893V86.669H630.052C633.831 68.786 644.529 61.441 658.686 61.441C676.941 61.441 684.978 72.192 686.415 87.733H686.575C689.981 68.945 699.667 61.441 715.049 61.441C735.646 61.441 743.15 74.693 743.15 92.949V147.716H723.99V97.952C723.99 87.733 719.307 78.792 706.267 78.792C693.919 78.792 686.575 85.977 686.575 97.952V147.716H667.255V97.952C667.255 87.733 662.784 78.792 649.691 78.792C637.344 78.792 629.839 85.977 629.839 97.952V147.716H629.893V147.715Z" fill="#b3b3b3"/>
|
|
10
|
+
<path d="M755.605 52.339V38.022H776.521V52.339H755.605ZM756.51 147.714V63.569H775.829V147.714H756.51Z" fill="#b3b3b3"/>
|
|
11
|
+
</g>
|
|
12
|
+
<defs>
|
|
13
|
+
<clipPath id="clip0_11769_64">
|
|
14
|
+
<rect width="776.021" height="188.18" fill="white" transform="translate(0.5)"/>
|
|
15
|
+
</clipPath>
|
|
16
|
+
</defs>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { KenoRiskLevel } from 'shufflecom-calculations';
|
|
2
|
+
import { GameType } from '../components/shared/BetResultModal/BetResultModal';
|
|
3
|
+
import { BetMode } from '../components/shared/GameSidebar/GameSidebar';
|
|
4
|
+
import { AutobetValues } from '../components/shared/GenericAutobet/GenericAutobet';
|
|
5
|
+
import { Currency } from './constants';
|
|
6
|
+
export type MinesCountChangeEvent = CustomEvent<{
|
|
7
|
+
count: number;
|
|
8
|
+
}>;
|
|
9
|
+
export type BetModeChangeEvent = CustomEvent<{
|
|
10
|
+
tab: BetMode;
|
|
11
|
+
}>;
|
|
12
|
+
export type MinesTileChosenEvent = CustomEvent<{
|
|
13
|
+
tile: number;
|
|
14
|
+
}>;
|
|
15
|
+
export type InputChangeEvent = CustomEvent<{
|
|
16
|
+
value: string;
|
|
17
|
+
target: HTMLInputElement;
|
|
18
|
+
}>;
|
|
19
|
+
export type AutobetToggleEvent = CustomEvent<AutobetValues & {
|
|
20
|
+
numberOfBets: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type SliderChangeEvent = CustomEvent<{
|
|
23
|
+
value: number;
|
|
24
|
+
}>;
|
|
25
|
+
export type DiceMultiplierChangeEvent = CustomEvent<{
|
|
26
|
+
multiplier: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type DiceWinChanceChangeEvent = CustomEvent<{
|
|
29
|
+
winChance: string;
|
|
30
|
+
}>;
|
|
31
|
+
export type LimboMultiplierChangeEvent = CustomEvent<{
|
|
32
|
+
multiplier: string;
|
|
33
|
+
}>;
|
|
34
|
+
export type LimboWinChanceChangeEvent = CustomEvent<{
|
|
35
|
+
winChance: string;
|
|
36
|
+
}>;
|
|
37
|
+
export type LimboMultiplierAnimationEndEvent = CustomEvent<{
|
|
38
|
+
resultMultiplier: number;
|
|
39
|
+
isWin: boolean;
|
|
40
|
+
betId: string;
|
|
41
|
+
}>;
|
|
42
|
+
export type InputBlurEvent = CustomEvent<{
|
|
43
|
+
value: string;
|
|
44
|
+
}>;
|
|
45
|
+
export type RawCurrencyInputChangeEvent = CustomEvent<{
|
|
46
|
+
value: string;
|
|
47
|
+
}>;
|
|
48
|
+
export type SelectEvent = CustomEvent<{
|
|
49
|
+
value: string;
|
|
50
|
+
originalEvent: Event;
|
|
51
|
+
}>;
|
|
52
|
+
export type ButtonClickEvent = CustomEvent<{
|
|
53
|
+
originalEvent: MouseEvent;
|
|
54
|
+
}>;
|
|
55
|
+
export type ToggleChangeEvent = CustomEvent<{
|
|
56
|
+
value: string;
|
|
57
|
+
}>;
|
|
58
|
+
export type BetCountChangeEvent = CustomEvent<{
|
|
59
|
+
value: number;
|
|
60
|
+
}>;
|
|
61
|
+
export type KenoRiskChangeEvent = CustomEvent<{
|
|
62
|
+
value: KenoRiskLevel;
|
|
63
|
+
}>;
|
|
64
|
+
export type KenoTileClickEvent = CustomEvent<{
|
|
65
|
+
tile: number;
|
|
66
|
+
}>;
|
|
67
|
+
export type KenoGridClickEvent = CustomEvent;
|
|
68
|
+
export type BalanceChangeEvent = CustomEvent<{
|
|
69
|
+
balance: number;
|
|
70
|
+
currency: Currency;
|
|
71
|
+
}>;
|
|
72
|
+
export type OpenBetResultModalEvent = CustomEvent<{
|
|
73
|
+
gameType: GameType;
|
|
74
|
+
betId: string;
|
|
75
|
+
}>;
|
|
76
|
+
declare global {
|
|
77
|
+
interface GlobalEventHandlersEventMap {
|
|
78
|
+
"bet-mode-change": BetModeChangeEvent;
|
|
79
|
+
"mines-count-change": MinesCountChangeEvent;
|
|
80
|
+
"mines-tile-selected": MinesTileChosenEvent;
|
|
81
|
+
"mines-manual-start": CustomEvent;
|
|
82
|
+
"mines-cashout": CustomEvent;
|
|
83
|
+
"mines-choose-random-tile": CustomEvent;
|
|
84
|
+
"autobet-toggle": AutobetToggleEvent;
|
|
85
|
+
"bet-count-change": BetCountChangeEvent;
|
|
86
|
+
"modal-after-hide": CustomEvent;
|
|
87
|
+
"modal-after-show": CustomEvent;
|
|
88
|
+
"modal-hide": CustomEvent;
|
|
89
|
+
"modal-initial-focus": CustomEvent;
|
|
90
|
+
"modal-request-close": CustomEvent;
|
|
91
|
+
"modal-show": CustomEvent;
|
|
92
|
+
"input-change": InputChangeEvent;
|
|
93
|
+
"input-focus": CustomEvent;
|
|
94
|
+
"input-click": CustomEvent;
|
|
95
|
+
"input-blur": InputBlurEvent;
|
|
96
|
+
"raw-currency-input-change": RawCurrencyInputChangeEvent;
|
|
97
|
+
"raw-currency-input-blur": CustomEvent;
|
|
98
|
+
"raw-currency-input-focus": CustomEvent;
|
|
99
|
+
"currency-input-change": InputChangeEvent;
|
|
100
|
+
"slider-input-change": SliderChangeEvent;
|
|
101
|
+
"select-change": SelectEvent;
|
|
102
|
+
"button-click": ButtonClickEvent;
|
|
103
|
+
"dice-multiplier-change": DiceMultiplierChangeEvent;
|
|
104
|
+
"dice-win-chance-change": DiceWinChanceChangeEvent;
|
|
105
|
+
"dice-roll-over-toggle": CustomEvent;
|
|
106
|
+
"dice-manual-play": CustomEvent;
|
|
107
|
+
"footer-settings-click": CustomEvent;
|
|
108
|
+
"footer-theatre-click": CustomEvent;
|
|
109
|
+
"footer-stats-click": CustomEvent;
|
|
110
|
+
"footer-favorites-click": CustomEvent;
|
|
111
|
+
"footer-provably-fair-click": CustomEvent;
|
|
112
|
+
"toggle-change": ToggleChangeEvent;
|
|
113
|
+
"limbo-multiplier-change": LimboMultiplierChangeEvent;
|
|
114
|
+
"limbo-win-chance-change": LimboWinChanceChangeEvent;
|
|
115
|
+
"limbo-multiplier-animation-end": LimboMultiplierAnimationEndEvent;
|
|
116
|
+
"keno-auto-pick": CustomEvent;
|
|
117
|
+
"keno-clear-table": CustomEvent;
|
|
118
|
+
"keno-manual-play": CustomEvent;
|
|
119
|
+
"keno-risk-change": KenoRiskChangeEvent;
|
|
120
|
+
"keno-tile-click": KenoTileClickEvent;
|
|
121
|
+
"keno-grid-click": KenoGridClickEvent;
|
|
122
|
+
"limbo-manual-play": CustomEvent;
|
|
123
|
+
"open-bet-result-modal": OpenBetResultModalEvent;
|
|
124
|
+
"balance-change": BalanceChangeEvent;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getGameOutcome: (multiplier: number) => "Draw" | "Win" | "Loss";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const diceCubeSvg: import('lit').TemplateResult<2>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const minesBombIcon: import('lit').TemplateResult<2>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const minesGemIcon: import('lit').TemplateResult<2>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const multiplierIcon: import('lit').TemplateResult<2>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const profitIcon: import('lit').TemplateResult<2>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const rollDirectionIcon: import('lit').TemplateResult<2>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const winChanceIcon: import('lit').TemplateResult<2>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare enum OrigamiActionType {
|
|
2
|
+
START_BET = "START_BET",// bet started but not yet ended send to the /bet webhook
|
|
3
|
+
END_BET = "END_BET",// bet has been completed. Can be started and ended in 1 webhook or started in 1 and ended in another. send to the /bet webhook
|
|
4
|
+
ROLLBACK = "ROLLBACK",// send to the /rollback webhook
|
|
5
|
+
INTERMEDIATE_BET_ACTION = "INTERMEDIATE_BET_ACTION",// bet amount was increased without game ending, such as doubling down in blackjack
|
|
6
|
+
INTERMEDIATE_NON_BET_ACTION = "INTERMEDIATE_NON_BET_ACTION"
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CSSResult, LitElement } from 'lit';
|
|
2
|
+
type EventTypeRequiresDetail<T> = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, unknown>> ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, never>> ? never : Partial<GlobalEventHandlersEventMap[T]["detail"]> extends GlobalEventHandlersEventMap[T]["detail"] ? never : T : never : never;
|
|
3
|
+
type EventTypeDoesNotRequireDetail<T> = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, unknown>> ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, never>> ? T : Partial<GlobalEventHandlersEventMap[T]["detail"]> extends GlobalEventHandlersEventMap[T]["detail"] ? T : never : T : T;
|
|
4
|
+
type EventTypesWithRequiredDetail = {
|
|
5
|
+
[EventType in keyof GlobalEventHandlersEventMap as EventTypeRequiresDetail<EventType>]: true;
|
|
6
|
+
};
|
|
7
|
+
type EventTypesWithoutRequiredDetail = {
|
|
8
|
+
[EventType in keyof GlobalEventHandlersEventMap as EventTypeDoesNotRequireDetail<EventType>]: true;
|
|
9
|
+
};
|
|
10
|
+
type WithRequired<T, K extends keyof T> = T & {
|
|
11
|
+
[P in K]-?: T[P];
|
|
12
|
+
};
|
|
13
|
+
type SlEventInit<T> = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, unknown>> ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, never>> ? CustomEventInit<GlobalEventHandlersEventMap[T]["detail"]> : Partial<GlobalEventHandlersEventMap[T]["detail"]> extends GlobalEventHandlersEventMap[T]["detail"] ? CustomEventInit<GlobalEventHandlersEventMap[T]["detail"]> : WithRequired<CustomEventInit<GlobalEventHandlersEventMap[T]["detail"]>, "detail"> : CustomEventInit : CustomEventInit;
|
|
14
|
+
type GetCustomEventType<T> = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent<unknown> ? GlobalEventHandlersEventMap[T] : CustomEvent<unknown> : CustomEvent<unknown>;
|
|
15
|
+
export default class OrigamiElement extends LitElement {
|
|
16
|
+
static componentStyles: CSSResult[];
|
|
17
|
+
/** Emits a custom event with more convenient defaults. */
|
|
18
|
+
emit<T extends string & keyof EventTypesWithoutRequiredDetail>(name: EventTypeDoesNotRequireDetail<T>, options?: SlEventInit<T> | undefined): GetCustomEventType<T>;
|
|
19
|
+
emit<T extends string & keyof EventTypesWithRequiredDetail>(name: EventTypeRequiresDetail<T>, options: SlEventInit<T>): GetCustomEventType<T>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sleep(ms: number): Promise<unknown>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type UpdateHandler = (prev?: unknown, next?: unknown) => void;
|
|
3
|
+
type NonUndefined<A> = A extends undefined ? never : A;
|
|
4
|
+
type UpdateHandlerFunctionKeys<T extends object> = {
|
|
5
|
+
[K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;
|
|
6
|
+
}[keyof T];
|
|
7
|
+
interface WatchOptions {
|
|
8
|
+
/**
|
|
9
|
+
* If true, will only start watching after the initial update/render
|
|
10
|
+
*/
|
|
11
|
+
waitUntilFirstUpdate?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an
|
|
15
|
+
* update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the
|
|
16
|
+
* initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
*
|
|
20
|
+
* @watch('propName')
|
|
21
|
+
* handlePropChange(oldValue, newValue) {
|
|
22
|
+
* ...
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
25
|
+
export declare function watch(propertyName: string | string[], options?: WatchOptions): <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => void;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use a generator so we can iterate and possibly break early.
|
|
3
|
+
* @example
|
|
4
|
+
* // to operate like a regular array. This kinda nullifies generator benefits, but worth knowing if you need the whole array.
|
|
5
|
+
* const allActiveElements = [...activeElements()]
|
|
6
|
+
*
|
|
7
|
+
* // Early return
|
|
8
|
+
* for (const activeElement of activeElements()) {
|
|
9
|
+
* if (<cond>) {
|
|
10
|
+
* break; // Break the loop, dont need to iterate over the whole array or store an array in memory!
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export declare function activeElements(activeElement?: Element | null): Generator<Element>;
|
|
15
|
+
export declare function getDeepestActiveElement(): Element | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animates an element using keyframes. Returns a promise that resolves after the animation completes or gets canceled.
|
|
3
|
+
*/
|
|
4
|
+
export declare function animateTo(el: HTMLElement, keyframes: Keyframe[], options?: KeyframeAnimationOptions): Promise<unknown>;
|
|
5
|
+
/** Parses a CSS duration and returns the number of milliseconds. */
|
|
6
|
+
export declare function parseDuration(delay: number | string): number;
|
|
7
|
+
/** Tells if the user has enabled the "reduced motion" setting in their browser or OS. */
|
|
8
|
+
export declare function prefersReducedMotion(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Stops all active animations on the target element. Returns a promise that resolves after all animations are canceled.
|
|
11
|
+
*/
|
|
12
|
+
export declare function stopAnimations(el: HTMLElement): Promise<unknown[]>;
|
|
13
|
+
/**
|
|
14
|
+
* We can't animate `height: auto`, but we can calculate the height and shim keyframes by replacing it with the
|
|
15
|
+
* element's scrollHeight before the animation.
|
|
16
|
+
*/
|
|
17
|
+
export declare function shimKeyframesHeightAuto(keyframes: Keyframe[], calculatedHeight: number): {
|
|
18
|
+
height: string | number | null | undefined;
|
|
19
|
+
composite?: CompositeOperationOrAuto;
|
|
20
|
+
easing?: string;
|
|
21
|
+
offset?: number | null;
|
|
22
|
+
}[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ElementAnimation {
|
|
2
|
+
keyframes: Keyframe[];
|
|
3
|
+
rtlKeyframes?: Keyframe[];
|
|
4
|
+
options?: KeyframeAnimationOptions;
|
|
5
|
+
}
|
|
6
|
+
export interface ElementAnimationMap {
|
|
7
|
+
[animationName: string]: ElementAnimation;
|
|
8
|
+
}
|
|
9
|
+
export interface GetAnimationOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The component's directionality. When set to "rtl", `rtlKeyframes` will be preferred over `keyframes` where
|
|
12
|
+
* available using getAnimation().
|
|
13
|
+
*/
|
|
14
|
+
dir: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets a default animation. Components should use the `name.animation` for primary animations and `name.part.animation`
|
|
18
|
+
* for secondary animations, e.g. `dialog.show` and `dialog.overlay.show`. For modifiers, use `drawer.showTop`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function setDefaultAnimation(animationName: string, animation: ElementAnimation | null): void;
|
|
21
|
+
/** Sets a custom animation for the specified element. */
|
|
22
|
+
export declare function setAnimation(el: Element, animationName: string, animation: ElementAnimation | null): void;
|
|
23
|
+
/** Gets an element's animation. Falls back to the default if no animation is found. */
|
|
24
|
+
export declare function getAnimation(el: Element, animationName: string, options: GetAnimationOptions): ElementAnimation;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default class FocusTrap {
|
|
2
|
+
element: HTMLElement;
|
|
3
|
+
isExternalActivated: boolean;
|
|
4
|
+
tabDirection: 'forward' | 'backward';
|
|
5
|
+
currentFocus: HTMLElement | null;
|
|
6
|
+
previousFocus: HTMLElement | null;
|
|
7
|
+
elementsWithTabbableControls: string[];
|
|
8
|
+
constructor(element: HTMLElement);
|
|
9
|
+
/** Activates focus trapping. */
|
|
10
|
+
activate(): void;
|
|
11
|
+
/** Deactivates focus trapping. */
|
|
12
|
+
deactivate(): void;
|
|
13
|
+
/** Determines if this modal element is currently active or not. */
|
|
14
|
+
isActive(): boolean;
|
|
15
|
+
/** Activates external modal behavior and temporarily disables focus trapping. */
|
|
16
|
+
activateExternal(): void;
|
|
17
|
+
/** Deactivates external modal behavior and re-enables focus trapping. */
|
|
18
|
+
deactivateExternal(): void;
|
|
19
|
+
private checkFocus;
|
|
20
|
+
private handleFocusIn;
|
|
21
|
+
private possiblyHasTabbableChildren;
|
|
22
|
+
private handleKeyDown;
|
|
23
|
+
private handleKeyUp;
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns an element's offset relative to its parent. Similar to element.offsetTop and element.offsetLeft, except the
|
|
3
|
+
* parent doesn't have to be positioned relative or absolute.
|
|
4
|
+
*
|
|
5
|
+
* NOTE: This was created to work around what appears to be a bug in Chrome where a slotted element's offsetParent seems
|
|
6
|
+
* to ignore elements inside the surrounding shadow DOM: https://bugs.chromium.org/p/chromium/issues/detail?id=920069
|
|
7
|
+
*/
|
|
8
|
+
export declare function getOffset(element: HTMLElement, parent: HTMLElement): {
|
|
9
|
+
top: number;
|
|
10
|
+
left: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Prevents body scrolling. Keeps track of which elements requested a lock so multiple levels of locking are possible
|
|
14
|
+
* without premature unlocking.
|
|
15
|
+
*/
|
|
16
|
+
export declare function lockBodyScrolling(lockingEl: HTMLElement): void;
|
|
17
|
+
/**
|
|
18
|
+
* Unlocks body scrolling. Scrolling will only be unlocked once all elements that requested a lock call this method.
|
|
19
|
+
*/
|
|
20
|
+
export declare function unlockBodyScrolling(lockingEl: HTMLElement): void;
|
|
21
|
+
/** Scrolls an element into view of its container. If the element is already in view, nothing will happen. */
|
|
22
|
+
export declare function scrollIntoView(element: HTMLElement, container: HTMLElement, direction?: "horizontal" | "vertical" | "both", behavior?: "smooth" | "auto"): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/** A reactive controller that determines when slots exist. */
|
|
3
|
+
export declare class HasSlotController implements ReactiveController {
|
|
4
|
+
host: ReactiveControllerHost & Element;
|
|
5
|
+
slotNames: string[];
|
|
6
|
+
constructor(host: ReactiveControllerHost & Element, ...slotNames: string[]);
|
|
7
|
+
private hasDefaultSlot;
|
|
8
|
+
private hasNamedSlot;
|
|
9
|
+
test(slotName: string): boolean;
|
|
10
|
+
hostConnected(): void;
|
|
11
|
+
hostDisconnected(): void;
|
|
12
|
+
private handleSlotChange;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated
|
|
16
|
+
* HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getInnerHTML(slot: HTMLSlotElement): string;
|
|
19
|
+
/**
|
|
20
|
+
* Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a
|
|
21
|
+
* string. This is useful because we can't use slot.textContent as an alternative.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getTextContent(slot: HTMLSlotElement | undefined | null): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the first and last bounding elements that are tabbable. This is more performant than checking every single
|
|
3
|
+
* element because it short-circuits after finding the first and last ones.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getTabbableBoundary(root: HTMLElement | ShadowRoot): {
|
|
6
|
+
start: HTMLElement;
|
|
7
|
+
end: HTMLElement;
|
|
8
|
+
};
|
|
9
|
+
export declare function getTabbableElements(root: HTMLElement | ShadowRoot): HTMLElement[];
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@betorigami/games",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"author": "",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"description": "",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"unpkg": "dist/index.umd.js",
|
|
17
|
+
"jsdelivr": "dist/index.umd.js",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@lit/context": "^1.1.5",
|
|
23
|
+
"bignumber.js": "^9.3.0",
|
|
24
|
+
"lit": "^3.3.0",
|
|
25
|
+
"shufflecom-calculations": "^1.14.10",
|
|
26
|
+
"uuid": "^11.1.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@storybook/test": "^8.6.14",
|
|
30
|
+
"@storybook/web-components": "^9.0.4",
|
|
31
|
+
"typescript": "^5.8.3",
|
|
32
|
+
"vite": "^6.3.5",
|
|
33
|
+
"vite-plugin-dts": "^4.5.4"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc && vite build",
|
|
37
|
+
"watch": "vite",
|
|
38
|
+
"preview": "vite preview"
|
|
39
|
+
}
|
|
40
|
+
}
|