@betorigami/game-ui-shared 2.0.1 → 3.0.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 (31) hide show
  1. package/README.md +1 -1
  2. package/dist/components/shared/GameComponent.d.ts +1 -0
  3. package/dist/components/shared/GameProviderWrapper.d.ts +5 -4
  4. package/dist/components/shared/GenericAutobet/GenericAutobet.d.ts +1 -8
  5. package/dist/components/shared/context/slices/layout.context.d.ts +2 -1
  6. package/dist/index.d.ts +1 -2
  7. package/dist/index.mjs +1759 -1794
  8. package/dist/shared/constants.d.ts +1 -0
  9. package/dist/shared/container-queries.styles.d.ts +3 -0
  10. package/dist/translations/ar.json.d.ts +0 -5
  11. package/dist/translations/de.json.d.ts +0 -5
  12. package/dist/translations/en-soc.json.d.ts +0 -5
  13. package/dist/translations/en.json.d.ts +0 -5
  14. package/dist/translations/es.json.d.ts +0 -5
  15. package/dist/translations/fi.json.d.ts +0 -5
  16. package/dist/translations/fr.json.d.ts +0 -5
  17. package/dist/translations/hi.json.d.ts +0 -5
  18. package/dist/translations/id.json.d.ts +0 -5
  19. package/dist/translations/index.d.ts +0 -85
  20. package/dist/translations/ja.json.d.ts +0 -5
  21. package/dist/translations/ko.json.d.ts +0 -5
  22. package/dist/translations/pl.json.d.ts +0 -5
  23. package/dist/translations/pt.json.d.ts +0 -5
  24. package/dist/translations/ru.json.d.ts +0 -5
  25. package/dist/translations/tr.json.d.ts +0 -5
  26. package/dist/translations/vi.json.d.ts +0 -5
  27. package/dist/translations/zh.json.d.ts +0 -5
  28. package/dist/utils/game-layout-style.d.ts +2 -2
  29. package/package.json +1 -1
  30. package/dist/components/shared/GenericAutobet/context/autobet.context.d.ts +0 -13
  31. package/dist/components/shared/context/desktop-attribute.d.ts +0 -2
package/README.md CHANGED
@@ -10,7 +10,7 @@ The Lit components, controllers, translations, wire types and game-module regist
10
10
  import { GameComponent, RequiredContext, localeContext, getTranslation } from '@betorigami/game-ui-shared';
11
11
  ```
12
12
 
13
- Elements read the game context through `RequiredContext`, one per slice they need (`localeContext`, `sessionContext`, `limitsContext`, `servicesContext`, `skinContext`, `preferencesContext`, `layoutContext`, `walletContext`), all provided by `<origami-game-provider-wrapper>`. Reading a slice outside the wrapper throws. Elements whose styles use `data-is-desktop` add the `@desktopAttribute` decorator. Tests give an element its slices with `provideTestContexts` and change them with `updateTestContexts`.
13
+ Elements read the game context through `RequiredContext`, one per slice they need (`localeContext`, `sessionContext`, `limitsContext`, `servicesContext`, `skinContext`, `preferencesContext`, `layoutContext`, `walletContext`), all provided by `<origami-game-provider-wrapper>`. Reading a slice outside the wrapper throws. Desktop and mobile styles go in `${desktopContainerQuery} { … }` and `${mobileContainerQuery} { … }` blocks, after the base rules they override; both query the `game-layout` container the wrapper provides. Tests give an element its slices with `provideTestContexts` and change them with `updateTestContexts`.
14
14
 
15
15
  A game contributes itself through a `GameUiModule`:
16
16
 
@@ -9,6 +9,7 @@ import { NewBetItem } from '../../controllers/history.controller';
9
9
  import { RequiredContext } from './context/required-context';
10
10
  export declare const isBetMode: (value: unknown) => value is BetMode;
11
11
  export type AutobetSettingsWithId = AutobetEventPayload & {
12
+ numberOfBets: number;
12
13
  autobetId: string;
13
14
  betIndex: number;
14
15
  pnlSinceStart: string;
@@ -17,7 +17,7 @@ export declare class GameProviderWrapper extends OrigamiElement {
17
17
  maxPayout: number;
18
18
  minBet: number;
19
19
  maxBet: number;
20
- edge: 1 | 2 | 3 | 8 | 4;
20
+ edge: 1 | 2 | 3 | 4 | 8;
21
21
  showCurrencyAsText: boolean;
22
22
  footerPosition: 'ABOVE' | 'BELOW';
23
23
  logoUrl: string | null;
@@ -70,7 +70,8 @@ export declare class GameProviderWrapper extends OrigamiElement {
70
70
  private showMaxBetButton;
71
71
  private volume;
72
72
  private instantBetEnabled;
73
- private mainWidth;
73
+ private documentClientWidth;
74
+ private documentClientHeight;
74
75
  private publicKey;
75
76
  private scale;
76
77
  language: Language;
@@ -107,10 +108,10 @@ export declare class GameProviderWrapper extends OrigamiElement {
107
108
  updateVolume(volume: number): void;
108
109
  updateInstantBetEnabled(enabled: boolean): void;
109
110
  updateAutobetNumberOfBets(numberOfBets: number): void;
110
- updateMainWidth(width: number): void;
111
+ updateClientSize(width: number, height: number): void;
111
112
  updateBetAmount(newAmount: Big): void;
112
113
  updateBalance(newAmount: Big): void;
113
- private _boundCalculateScale;
114
+ private handleResize;
114
115
  private setupResizeObserver;
115
116
  private cleanupResizeObserver;
116
117
  private calculateScale;
@@ -1,4 +1,3 @@
1
- import { ContextProvider } from '@lit/context';
2
1
  import { default as OrigamiElement } from '../../../shared/origami-element';
3
2
  export type AfterBetEffect = 'Reset' | 'Increase';
4
3
  export type AutobetValues = {
@@ -10,9 +9,7 @@ export type AutobetValues = {
10
9
  onWinStrategy: AfterBetEffect;
11
10
  };
12
11
  export declare const defaultAutobetValues: AutobetValues;
13
- export type AutobetEventPayload = AutobetValues & {
14
- numberOfBets: string;
15
- };
12
+ export type AutobetEventPayload = AutobetValues;
16
13
  export declare class GenericAutobet extends OrigamiElement {
17
14
  private readonly locale;
18
15
  private readonly wallet;
@@ -35,11 +32,7 @@ export declare class GenericAutobet extends OrigamiElement {
35
32
  customInputsSlot?: HTMLSlotElement;
36
33
  private betButtonEl?;
37
34
  static styles: import('lit').CSSResult[];
38
- protected _autobetProvider: ContextProvider<{
39
- __context__: import('./context/autobet.context').AutobetContextType;
40
- }, this>;
41
35
  willUpdate(changedProperties: Map<string | symbol, unknown>): void;
42
- updateNumberOfBets(numberOfBets: string): void;
43
36
  triggerPrimaryAction(): void;
44
37
  isPrimaryActionDisabled(): boolean;
45
38
  private _handleWinPercentageChange;
@@ -1,7 +1,8 @@
1
- export declare const DESKTOP_MIN_WIDTH = 768;
2
1
  export type LayoutContextType = {
3
2
  isDesktop: boolean;
4
3
  scale: number;
4
+ clientWidth: number;
5
+ clientHeight: number;
5
6
  };
6
7
  export declare const DEFAULT_LAYOUT_CONTEXT: LayoutContextType;
7
8
  export declare const layoutContext: {
package/dist/index.d.ts CHANGED
@@ -37,7 +37,6 @@ export * from './components/shared/GameWinPopup/GameWinPopup';
37
37
  export * from './components/shared/GenericAutobet/BetCountInput';
38
38
  export * from './components/shared/GenericAutobet/GenericAutobet.styles';
39
39
  export * from './components/shared/GenericAutobet/GenericAutobet';
40
- export * from './components/shared/GenericAutobet/context/autobet.context';
41
40
  export * from './components/shared/HistoryPills/HistoryPills.styles';
42
41
  export { HistoryPills } from './components/shared/HistoryPills/HistoryPills';
43
42
  export type { HistoryItem as HistoryPillItem } from './components/shared/HistoryPills/HistoryPills';
@@ -68,7 +67,6 @@ export * from './components/shared/Toggle/Toggle';
68
67
  export * from './components/shared/Tooltip/Tooltip.styles';
69
68
  export * from './components/shared/Tooltip/Tooltip';
70
69
  export * from './components/shared/context/required-context';
71
- export * from './components/shared/context/desktop-attribute';
72
70
  export * from './components/shared/context/provide-test-contexts';
73
71
  export * from './components/shared/context/slices/layout.context';
74
72
  export * from './components/shared/context/slices/limits.context';
@@ -110,6 +108,7 @@ export * from './shared/cards/card.utils';
110
108
  export * from './shared/chip-state.utils';
111
109
  export * from './shared/component.styles';
112
110
  export * from './shared/constants';
111
+ export * from './shared/container-queries.styles';
113
112
  export * from './shared/create-api-factory';
114
113
  export * from './shared/event-map';
115
114
  export * from './shared/format-monetary-amount';