@betorigami/game-ui-shared 2.1.0 → 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.
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
 
@@ -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,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
@@ -67,7 +67,6 @@ export * from './components/shared/Toggle/Toggle';
67
67
  export * from './components/shared/Tooltip/Tooltip.styles';
68
68
  export * from './components/shared/Tooltip/Tooltip';
69
69
  export * from './components/shared/context/required-context';
70
- export * from './components/shared/context/desktop-attribute';
71
70
  export * from './components/shared/context/provide-test-contexts';
72
71
  export * from './components/shared/context/slices/layout.context';
73
72
  export * from './components/shared/context/slices/limits.context';
@@ -109,6 +108,7 @@ export * from './shared/cards/card.utils';
109
108
  export * from './shared/chip-state.utils';
110
109
  export * from './shared/component.styles';
111
110
  export * from './shared/constants';
111
+ export * from './shared/container-queries.styles';
112
112
  export * from './shared/create-api-factory';
113
113
  export * from './shared/event-map';
114
114
  export * from './shared/format-monetary-amount';