@sleeperhq/mini-core 1.5.2 → 1.5.3

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.
@@ -0,0 +1,29 @@
1
+ export type NavigationParams = {
2
+ LeaguesIndexScreen: undefined;
3
+ LeaguesDetailScreen: LeaguesDetailScreenParams;
4
+ ScoreIndexScreen: undefined;
5
+ ScoreDetailScreen: undefined;
6
+ PicksIndexScreen: undefined;
7
+ FeedIndexScreen: undefined;
8
+ WebviewScreen: undefined;
9
+ ManageChannelsScreen: undefined;
10
+ MinisIndexScreen: undefined;
11
+ LeftDrawer: undefined;
12
+ TradeCenterTransactionScreen: TradeCenterTransactionScreenParams;
13
+ TradeCenterPlayersScreen: TradeCenterPlayersScreenParams;
14
+ };
15
+ export type NavigationScreen = keyof NavigationParams;
16
+ export type LeaguesDetailScreenParams = {
17
+ leagueId: string;
18
+ };
19
+ export type TradeCenterTransactionScreenParams = {
20
+ leagueId: string;
21
+ transactionId: string;
22
+ };
23
+ export type TradeCenterPlayersScreenParams = {
24
+ leagueId: string;
25
+ myRosterId: string;
26
+ rosterIds?: string[];
27
+ addMap?: any;
28
+ dropMap?: any;
29
+ };
@@ -1,6 +1,6 @@
1
- import { NavigationTabId, ToastConfig } from './types';
2
- export type SleeperActions = {
3
- navigate: (navTabType: NavigationTabId, args?: any) => void;
4
- requestLocation: () => void;
5
- showToast: (toastData: ToastConfig) => void;
6
- };
1
+ import { NavigationParams, NavigationScreen, ToastConfig } from './types';
2
+ export type SleeperActions = {
3
+ navigate: <T extends NavigationScreen>(screen: T, params: NavigationParams[T]) => void;
4
+ requestLocation: () => void;
5
+ showToast: (toastData: ToastConfig) => void;
6
+ };
@@ -1,12 +1,11 @@
1
- import type SleeperEntitlement from "@sleeperhq/mini-core/declarations/sleeper_entitlement";
2
- import type SleeperHeaderOptions from "@sleeperhq/mini-core/declarations/sleeper_header_options";
3
-
1
+ import type { Entitlement, HeaderOptions } from './types';
4
2
  type SocketMessage = {
5
3
  _ip?: string;
6
4
  _name?: string;
7
5
  _webpack?: string;
8
6
  _contextGet?: string;
9
- _entitlements?: SleeperEntitlement[];
10
- _headerOptions?: SleeperHeaderOptions;
7
+ _description?: string;
8
+ _entitlements?: Entitlement[];
9
+ _headerOptions?: HeaderOptions;
11
10
  };
12
11
  export default SocketMessage;
@@ -1,7 +1,7 @@
1
1
  import { League, Roster, User, MatchupLeg, LeagueTransaction, Draft, DraftPick, RosterDraftPick, Player, Topic } from './shared/graphql.d';
2
2
  import type { ToastConfig as ToastConfigOriginal } from './utils/toast_helper';
3
- export type NavigationTabId = 'LeaguesIndexScreen' | 'LeaguesDetailScreen' | 'ScoreIndexScreen' | 'ScoreDetailScreen' | 'PicksIndexScreen' | 'FeedIndexScreen' | 'WebviewScreen' | 'ManageChannelsScreen' | 'InboxIndexScreen' | 'MinisIndexScreen' | 'ManageChannelsScreen' | 'InboxIndexScreen' | 'MinisIndexScreen';
4
3
  export * from './shared/graphql.d';
4
+ export * from '../navigation/index.d';
5
5
  export type LeagueId = string;
6
6
  export type RosterId = string;
7
7
  export type UserId = string;
@@ -59,18 +59,26 @@ export type DraftPickTradesInLeagueMap = Record<LeagueId, RosterDraftPick[]>;
59
59
  export type DraftPicksInDraftMap = Record<DraftId, DraftPick[]>;
60
60
  export type PlayersMap = Record<PlayerId, Player>;
61
61
  export type PlayersInSportMap = Record<SportType, PlayersMap>;
62
- export declare enum MiniCategory {
63
- DEVELOPER = "Developer",
64
- FEATURED = "Featured",
65
- GAMES = "Games",
66
- SPORTUTILITY = "Sport Utility"
62
+ export type Entitlement = 'user:email' | 'user:phone' | 'wallet:date_of_birth' | 'wallet:first_name' | 'wallet:last_name' | 'wallet:country_code' | 'wallet:city' | 'location:longitude' | 'location:latitude' | 'location:state' | 'location:country' | 'location:postalCode';
63
+ export declare const EntitlementDisplayText: Record<Entitlement, string>;
64
+ export declare enum EventHandlerResult {
65
+ CONSUMED = "CONSUMED",
66
+ PROPAGATE = "PROPAGATE"
67
67
  }
68
+ export type Events = {
69
+ onBackButtonPressed?: () => EventHandlerResult;
70
+ };
71
+ export type HeaderOptions = {
72
+ useLeagueSelector?: boolean;
73
+ };
68
74
  export type Mini = {
69
75
  name: string;
70
76
  description: string;
71
- image: string;
72
- category: MiniCategory;
73
77
  id: string;
78
+ version?: number;
79
+ email?: string;
80
+ entitlements?: Entitlement[];
81
+ headerOptions?: HeaderOptions;
74
82
  };
75
83
  export type Location = {
76
84
  state: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleeperhq/mini-core",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "Core library frameworks for developing Sleeper Mini Apps.",
5
5
  "main": "index.ts",
6
6
  "types": "index.d.ts",
@@ -1,49 +1,24 @@
1
1
  const SHARED = {
2
- INTER_EXTRALIGHT: 'Inter-ExtraLight',
3
- INTER_THIN: 'Inter-Thin',
4
- INTER_LIGHT: 'Inter-Light',
5
2
  INTER_REGULAR: 'Inter-Regular',
6
3
  INTER_MEDIUM: 'Inter-Medium',
7
4
  INTER_SEMIBOLD: 'Inter-SemiBold',
8
5
  INTER_BOLD: 'Inter-Bold',
9
6
  INTER_BLACK: 'Inter-Black',
10
- INTER_EXTRABOLD: 'Inter-ExtraBold',
11
7
 
12
- POPPINS_THIN: 'Poppins-Thin',
13
- POPPINS_LIGHT: 'Poppins-Light',
14
8
  POPPINS_REGULAR: 'Poppins-Regular',
15
9
  POPPINS_MEDIUM: 'Poppins-Medium',
16
10
  POPPINS_SEMIBOLD: 'Poppins-SemiBold',
17
11
  POPPINS_BOLD: 'Poppins-Bold',
18
12
  POPPINS_BLACK: 'Poppins-Black',
19
13
  POPPINS_EXTRABOLD: 'Poppins-ExtraBold',
20
- } as const;
21
-
22
- const Fonts = {
23
- THIN: 'Lato-Thin',
24
- LIGHT: 'Lato-Light',
25
- REGULAR: 'Lato-Regular',
26
- MEDIUM: 'Lato-Medium',
27
- BOLD: 'Lato-Bold',
28
- HEAVY: 'Lato-Heavy',
29
- BLACK: 'Lato-Black',
30
-
31
- MULI_THIN: 'Muli-ExtraLight',
32
- MULI_LIGHT: 'Muli-Light',
33
- MULI_REGULAR: 'Muli-Regular',
34
- MULI_MEDIUM: 'Muli-SemiBold',
35
- MULI_BOLD: 'Muli-Bold',
36
- MULI_BLACK: 'Muli-Black',
37
- MULI_EXTRABOLD: 'Muli-ExtraBold',
38
14
 
39
- OSWALD__EXTRA_LIGHT: 'Oswald-ExtraLight',
40
- OSWALD_LIGHT: 'Oswald-Light',
41
- OSWALD_REGULAR: 'Oswald-Regular',
42
15
  OSWALD_MEDIUM: 'Oswald-Medium',
43
- OSWALD_SEMIBOLD: 'Oswald-SemiBold',
44
16
  OSWALD_BOLD: 'Oswald-Bold',
17
+ } as const;
45
18
 
19
+ const Fonts = {
46
20
  DRUK_SUPERITALIC: 'Druk-SuperItalic',
21
+ DRUK_REGULAR: 'Druk-Medium',
47
22
  CHANEY_EXTENDED: 'Chaney-Extended',
48
23
 
49
24
  ...SHARED,
@@ -83,6 +58,11 @@ const Fonts = {
83
58
  fontSize: 14,
84
59
  letterSpacing: 1,
85
60
  },
61
+ ButtonXLarge: {
62
+ fontFamily: SHARED.POPPINS_SEMIBOLD,
63
+ fontSize: 16,
64
+ letterSpacing: 1,
65
+ },
86
66
  ButtonSmall: {
87
67
  fontFamily: SHARED.POPPINS_SEMIBOLD,
88
68
  fontSize: 12,
@@ -148,6 +128,11 @@ const Fonts = {
148
128
  fontSize: 9,
149
129
  letterSpacing: -0.25,
150
130
  },
131
+ FootnoteBold: {
132
+ fontFamily: SHARED.INTER_BOLD,
133
+ fontSize: 9,
134
+ letterSpacing: -0.25,
135
+ },
151
136
  },
152
137
  } as const;
153
138
 
@@ -1,3 +0,0 @@
1
- declare type SleeperEntitlement = 'user:email' | 'user:phone' | 'wallet:date_of_birth' | 'wallet:first_name' | 'wallet:last_name' | 'wallet:country_code' | 'wallet:city' | 'location:longitude' | 'location:latitude' | 'location:state' | 'location:country' | 'location:postalCode';
2
-
3
- export default SleeperEntitlement;
@@ -1,5 +0,0 @@
1
- declare class SleeperHeaderOptions {
2
- useLeagueSelector?: boolean;
3
- }
4
-
5
- export default SleeperHeaderOptions;