@sleeperhq/mini-core 1.6.5 → 1.7.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.
- package/bin/build_mini.js +1 -1
- package/bin/preload_packages.js +0 -0
- package/declarations/avatar/index.d.ts +23 -0
- package/declarations/index.d.ts +2 -3
- package/declarations/jersey/index.d.ts +1 -1
- package/declarations/navigation/index.d.ts +1 -1
- package/declarations/sleeper_actions.d.ts +1 -1
- package/declarations/sleeper_context.d.ts +2 -2
- package/declarations/sleeper_message.d.ts +2 -2
- package/declarations/switch/index.d.ts +2 -2
- package/declarations/types/components/app_icon_switch.d.ts +24 -0
- package/declarations/types/components/jersey.d.ts +3 -0
- package/declarations/types/index.d.ts +9 -75
- package/declarations/types/minis/index.d.ts +71 -0
- package/declarations/types/shared/graphql.d.ts +29 -28
- package/declarations/types/utils/toast_helper.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/index.tsx +34 -1
- package/src/dev_server/index.tsx +0 -1
- package/src/types/index.ts +1 -2
- package/declarations/types/components/ui_2/app_icon_switch.d.ts +0 -18
package/bin/build_mini.js
CHANGED
|
@@ -46,7 +46,7 @@ const getCommands = (projectName) => {
|
|
|
46
46
|
--reset-cache \
|
|
47
47
|
--bundle-output "${bundleOutputPath[platform]}" \
|
|
48
48
|
--sourcemap-output "${sourcemapOutputPath[platform]}" \
|
|
49
|
-
--minify
|
|
49
|
+
--minify false \
|
|
50
50
|
--assets-dest "${assetsDestPath[platform]}" \
|
|
51
51
|
--webpackConfig ./node_modules/@sleeperhq/mini-core/webpack.config.js`;
|
|
52
52
|
};
|
package/bin/preload_packages.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { League, Player, User } from "@sleeperhq/mini-core/declarations/types/shared/graphql.d";
|
|
3
|
+
export interface AvatarProps {
|
|
4
|
+
user: User;
|
|
5
|
+
width?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const Avatar: React.MemoExoticComponent<(props: AvatarProps) => JSX.Element>;
|
|
8
|
+
export interface AvatarPlayerProps {
|
|
9
|
+
player: Player;
|
|
10
|
+
width?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const AvatarPlayer: React.MemoExoticComponent<(props: AvatarPlayerProps) => JSX.Element>;
|
|
13
|
+
export interface AvatarTeamProps {
|
|
14
|
+
team: string;
|
|
15
|
+
sport: string;
|
|
16
|
+
width?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const AvatarTeam: React.MemoExoticComponent<(props: AvatarTeamProps) => JSX.Element>;
|
|
19
|
+
export interface AvatarLeagueProps {
|
|
20
|
+
league: League;
|
|
21
|
+
width?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const AvatarLeague: React.MemoExoticComponent<(props: AvatarLeagueProps) => JSX.Element>;
|
package/declarations/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColorValue, ViewStyle } from 'react-native';
|
|
2
|
-
import SleeperJersey from 'components/
|
|
2
|
+
import SleeperJersey from '@sleeperhq/mini-core/declarations/types/components/jersey.d';
|
|
3
3
|
export interface JerseyProps {
|
|
4
4
|
style: ViewStyle;
|
|
5
5
|
sport: 'nfl' | 'nba' | 'cbb' | 'cfb' | 'mlb';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LeagueId, PlayerId, RosterId, SportType, TransactionId } from '
|
|
1
|
+
import type { LeagueId, PlayerId, RosterId, SportType, TransactionId } from '@sleeperhq/mini-core/declarations/types';
|
|
2
2
|
export type NavigationParams = {
|
|
3
3
|
LeaguesIndexScreen: undefined;
|
|
4
4
|
LeaguesDetailScreen: LeaguesDetailScreenParams;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NavigationParams, NavigationScreen, ToastConfig, Notification } from '
|
|
1
|
+
import { NavigationParams, NavigationScreen, ToastConfig, Notification } from '@sleeperhq/mini-core/declarations/types';
|
|
2
2
|
export type SleeperActions = {
|
|
3
3
|
navigate?: <T extends NavigationScreen>(screen: T, params?: NavigationParams[T]) => void;
|
|
4
4
|
requestLocation?: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { User, League, LeaguesMap, RostersInLeagueMap, UserMap, MatchupsInLeagueMap, UsersInLeagueMap, PlayoffsInLeagueMap, TransactionsInLeagueMap, TransactionsMap, SportInfoMap, DraftsInLeagueMap, DraftPickTradesInLeagueMap, DraftPicksInDraftMap, PlayersInSportMap, Topic, Location, SportType } from '
|
|
2
|
-
import type { SleeperActions } from '
|
|
1
|
+
import { User, League, LeaguesMap, RostersInLeagueMap, UserMap, MatchupsInLeagueMap, UsersInLeagueMap, PlayoffsInLeagueMap, TransactionsInLeagueMap, TransactionsMap, SportInfoMap, DraftsInLeagueMap, DraftPickTradesInLeagueMap, DraftPicksInDraftMap, PlayersInSportMap, Topic, Location, SportType } from '@sleeperhq/mini-core/declarations/types';
|
|
2
|
+
import type { SleeperActions } from '@sleeperhq/mini-core/declarations/sleeper_actions';
|
|
3
3
|
declare class SleeperContext {
|
|
4
4
|
static apiLevel: string;
|
|
5
5
|
user: User;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Entitlement, HeaderOptions,
|
|
1
|
+
import type { Entitlement, HeaderOptions, Metadata } from '@sleeperhq/mini-core/declarations/types';
|
|
2
2
|
type SocketMessage = {
|
|
3
3
|
_ip?: string;
|
|
4
4
|
_name?: string;
|
|
@@ -7,6 +7,6 @@ type SocketMessage = {
|
|
|
7
7
|
_description?: string;
|
|
8
8
|
_entitlements?: Entitlement[];
|
|
9
9
|
_headerOptions?: HeaderOptions;
|
|
10
|
-
|
|
10
|
+
_metadata?: Metadata;
|
|
11
11
|
};
|
|
12
12
|
export default SocketMessage;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AppIconSwitch } from '
|
|
2
|
-
export type { SwitchOption, Props as SwitchProps } from '
|
|
1
|
+
import { AppIconSwitch } from '@sleeperhq/mini-core/declarations/types/components/app_icon_switch.d';
|
|
2
|
+
export type { SwitchOption, Props as SwitchProps } from '@sleeperhq/mini-core/declarations/types/components/app_icon_switch.d';
|
|
3
3
|
export default AppIconSwitch;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export type SwitchOption = {
|
|
4
|
+
colorToggleActive: string;
|
|
5
|
+
colorIconActive: string;
|
|
6
|
+
colorIconInactive?: string;
|
|
7
|
+
iconStyle?: any;
|
|
8
|
+
icon: any;
|
|
9
|
+
iconInactive?: any;
|
|
10
|
+
text?: string;
|
|
11
|
+
hideIconInactive?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type Props = {
|
|
14
|
+
options: [SwitchOption, SwitchOption];
|
|
15
|
+
value?: number;
|
|
16
|
+
onChange?: (value: number) => void;
|
|
17
|
+
height?: number;
|
|
18
|
+
width?: number;
|
|
19
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
20
|
+
toggleStyle?: StyleProp<ViewStyle>;
|
|
21
|
+
aspectRatio?: number;
|
|
22
|
+
confirmationFunction?: (nextSelection: 'on' | 'off', continueAction: () => void) => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const AppIconSwitch: React.MemoExoticComponent<({ height, options, value, width, onChange, containerStyle, toggleStyle, aspectRatio, confirmationFunction }: Props) => JSX.Element>;
|
|
@@ -1,83 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export
|
|
6
|
-
export type RosterId = string;
|
|
7
|
-
export type UserId = string;
|
|
8
|
-
export type MatchupWeek = number;
|
|
9
|
-
export type MatchId = string;
|
|
10
|
-
export type TransactionId = string;
|
|
11
|
-
export type SportType = string;
|
|
12
|
-
export type DraftId = string;
|
|
13
|
-
export type PlayerId = string;
|
|
14
|
-
export type TopicId = 'podcasts' | 'videos';
|
|
15
|
-
export type { Topic };
|
|
16
|
-
export type BracketFrom = {
|
|
17
|
-
w?: RosterId;
|
|
18
|
-
l?: RosterId;
|
|
19
|
-
};
|
|
20
|
-
export type Bracket = {
|
|
21
|
-
round: number;
|
|
22
|
-
matchId: MatchId;
|
|
23
|
-
t1: RosterId;
|
|
24
|
-
t2: RosterId;
|
|
25
|
-
w: RosterId;
|
|
26
|
-
l: RosterId;
|
|
27
|
-
t1_from: BracketFrom;
|
|
28
|
-
t2_from: BracketFrom;
|
|
29
|
-
};
|
|
30
|
-
export type BracketSet = {
|
|
31
|
-
bracket: Bracket[];
|
|
32
|
-
loserBracket: Bracket[];
|
|
33
|
-
};
|
|
34
|
-
export type SportInfo = {
|
|
35
|
-
season_type: string;
|
|
36
|
-
season: string;
|
|
37
|
-
week?: number;
|
|
38
|
-
display_week?: number;
|
|
39
|
-
leg?: number;
|
|
40
|
-
league_season?: string;
|
|
41
|
-
league_create_season?: string;
|
|
42
|
-
previous_season?: string;
|
|
43
|
-
season_start_date?: string;
|
|
44
|
-
season_end_date?: string;
|
|
45
|
-
};
|
|
46
|
-
export type LeaguesMap = Record<LeagueId, League>;
|
|
47
|
-
export type RostersMap = Record<RosterId, Roster>;
|
|
48
|
-
export type RostersInLeagueMap = Record<LeagueId, RostersMap>;
|
|
49
|
-
export type UserMap = Record<UserId, User>;
|
|
50
|
-
export type MathchupWeekMap = Record<MatchupWeek, MatchupLeg>;
|
|
51
|
-
export type MatchupsInLeagueMap = Record<LeagueId, MathchupWeekMap>;
|
|
52
|
-
export type UsersInLeagueMap = Record<LeagueId, UserMap>;
|
|
53
|
-
export type PlayoffsInLeagueMap = Record<LeagueId, BracketSet>;
|
|
54
|
-
export type TransactionsInLeagueMap = Record<LeagueId, TransactionId[]>;
|
|
55
|
-
export type TransactionsMap = Record<TransactionId, LeagueTransaction>;
|
|
56
|
-
export type SportInfoMap = Record<SportType, SportInfo>;
|
|
57
|
-
export type DraftsInLeagueMap = Record<LeagueId, Draft[]>;
|
|
58
|
-
export type DraftPickTradesInLeagueMap = Record<LeagueId, RosterDraftPick[]>;
|
|
59
|
-
export type DraftPicksInDraftMap = Record<DraftId, DraftPick[]>;
|
|
60
|
-
export type PlayersMap = Record<PlayerId, Player>;
|
|
61
|
-
export type PlayersInSportMap = Record<SportType, PlayersMap>;
|
|
1
|
+
import type { ToastConfig as ToastConfigOriginal } from '@sleeperhq/mini-core/declarations/types/utils/toast_helper.d';
|
|
2
|
+
import { SportType } from '@sleeperhq/mini-core/declarations/types/minis/index.d';
|
|
3
|
+
export * from '@sleeperhq/mini-core/declarations/navigation/index.d';
|
|
4
|
+
export * from '@sleeperhq/mini-core/declarations/types/shared/graphql.d';
|
|
5
|
+
export * from '@sleeperhq/mini-core/declarations/types/minis/index.d';
|
|
62
6
|
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' | 'action:push_notification';
|
|
63
7
|
export type Entitlements = Partial<Record<Entitlement, any>>;
|
|
64
8
|
export declare const EntitlementDisplayText: Record<Entitlement, string>;
|
|
65
|
-
export type Notification = {
|
|
66
|
-
title?: string | undefined;
|
|
67
|
-
body?: string | undefined;
|
|
68
|
-
timestamp?: number;
|
|
69
|
-
};
|
|
70
|
-
export declare const EventHandlerResult: {
|
|
71
|
-
readonly CONSUMED: "CONSUMED";
|
|
72
|
-
readonly PROPAGATE: "PROPAGATE";
|
|
73
|
-
};
|
|
74
|
-
export type EventHandlerResultType = typeof EventHandlerResult[keyof typeof EventHandlerResult];
|
|
75
|
-
export type Events = {
|
|
76
|
-
onBackButtonPressed?: () => EventHandlerResultType;
|
|
77
|
-
};
|
|
78
9
|
export type HeaderOptions = {
|
|
79
10
|
useLeagueSelector?: boolean;
|
|
80
11
|
};
|
|
12
|
+
export type Metadata = {
|
|
13
|
+
sports?: SportType[];
|
|
14
|
+
};
|
|
81
15
|
export type Mini = {
|
|
82
16
|
name: string;
|
|
83
17
|
description: string;
|
|
@@ -86,7 +20,7 @@ export type Mini = {
|
|
|
86
20
|
email?: string;
|
|
87
21
|
entitlements?: Entitlement[];
|
|
88
22
|
headerOptions?: HeaderOptions;
|
|
89
|
-
|
|
23
|
+
metadata?: Metadata;
|
|
90
24
|
};
|
|
91
25
|
export type Location = {
|
|
92
26
|
state: string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { League, Roster, User, MatchupLeg, LeagueTransaction, Draft, DraftPick, RosterDraftPick, Player, Topic } from '@sleeperhq/mini-core/declarations/types/shared/graphql.d';
|
|
2
|
+
export type LeagueId = string;
|
|
3
|
+
export type RosterId = string;
|
|
4
|
+
export type UserId = string;
|
|
5
|
+
export type MatchupWeek = number;
|
|
6
|
+
export type MatchId = string;
|
|
7
|
+
export type TransactionId = string;
|
|
8
|
+
export type SportType = string;
|
|
9
|
+
export type DraftId = string;
|
|
10
|
+
export type PlayerId = string;
|
|
11
|
+
export type TopicId = 'podcasts' | 'videos';
|
|
12
|
+
export type { Topic };
|
|
13
|
+
export type BracketFrom = {
|
|
14
|
+
w?: RosterId;
|
|
15
|
+
l?: RosterId;
|
|
16
|
+
};
|
|
17
|
+
export type Bracket = {
|
|
18
|
+
round: number;
|
|
19
|
+
matchId: MatchId;
|
|
20
|
+
t1: RosterId;
|
|
21
|
+
t2: RosterId;
|
|
22
|
+
w: RosterId;
|
|
23
|
+
l: RosterId;
|
|
24
|
+
t1_from: BracketFrom;
|
|
25
|
+
t2_from: BracketFrom;
|
|
26
|
+
};
|
|
27
|
+
export type BracketSet = {
|
|
28
|
+
bracket: Bracket[];
|
|
29
|
+
loserBracket: Bracket[];
|
|
30
|
+
};
|
|
31
|
+
export type SportInfo = {
|
|
32
|
+
season_type: string;
|
|
33
|
+
season: string;
|
|
34
|
+
week?: number;
|
|
35
|
+
display_week?: number;
|
|
36
|
+
leg?: number;
|
|
37
|
+
league_season?: string;
|
|
38
|
+
league_create_season?: string;
|
|
39
|
+
previous_season?: string;
|
|
40
|
+
season_start_date?: string;
|
|
41
|
+
season_end_date?: string;
|
|
42
|
+
};
|
|
43
|
+
export type LeaguesMap = Record<LeagueId, League>;
|
|
44
|
+
export type RostersMap = Record<RosterId, Roster>;
|
|
45
|
+
export type RostersInLeagueMap = Record<LeagueId, RostersMap>;
|
|
46
|
+
export type UserMap = Record<UserId, User>;
|
|
47
|
+
export type MathchupWeekMap = Record<MatchupWeek, MatchupLeg>;
|
|
48
|
+
export type MatchupsInLeagueMap = Record<LeagueId, MathchupWeekMap>;
|
|
49
|
+
export type UsersInLeagueMap = Record<LeagueId, UserMap>;
|
|
50
|
+
export type PlayoffsInLeagueMap = Record<LeagueId, BracketSet>;
|
|
51
|
+
export type TransactionsInLeagueMap = Record<LeagueId, TransactionId[]>;
|
|
52
|
+
export type TransactionsMap = Record<TransactionId, LeagueTransaction>;
|
|
53
|
+
export type SportInfoMap = Record<SportType, SportInfo>;
|
|
54
|
+
export type DraftsInLeagueMap = Record<LeagueId, Draft[]>;
|
|
55
|
+
export type DraftPickTradesInLeagueMap = Record<LeagueId, RosterDraftPick[]>;
|
|
56
|
+
export type DraftPicksInDraftMap = Record<DraftId, DraftPick[]>;
|
|
57
|
+
export type PlayersMap = Record<PlayerId, Player>;
|
|
58
|
+
export type PlayersInSportMap = Record<SportType, PlayersMap>;
|
|
59
|
+
export type Notification = {
|
|
60
|
+
title?: string | undefined;
|
|
61
|
+
body?: string | undefined;
|
|
62
|
+
timestamp?: number;
|
|
63
|
+
};
|
|
64
|
+
export declare const EventHandlerResult: {
|
|
65
|
+
readonly CONSUMED: "CONSUMED";
|
|
66
|
+
readonly PROPAGATE: "PROPAGATE";
|
|
67
|
+
};
|
|
68
|
+
export type EventHandlerResultType = typeof EventHandlerResult[keyof typeof EventHandlerResult];
|
|
69
|
+
export type Events = {
|
|
70
|
+
onBackButtonPressed?: () => EventHandlerResultType;
|
|
71
|
+
};
|
|
@@ -202,6 +202,35 @@ export type RosterDraftPick = {
|
|
|
202
202
|
round?: Maybe<Scalars['Int']>;
|
|
203
203
|
season?: Maybe<Scalars['String']>;
|
|
204
204
|
};
|
|
205
|
+
export type Topic = {
|
|
206
|
+
__typename?: 'Topic';
|
|
207
|
+
attachment?: Maybe<Scalars['Json']>;
|
|
208
|
+
author_avatar?: Maybe<Scalars['String']>;
|
|
209
|
+
author_display_name?: Maybe<Scalars['String']>;
|
|
210
|
+
author_id?: Maybe<Scalars['Snowflake']>;
|
|
211
|
+
author_is_bot?: Maybe<Scalars['Boolean']>;
|
|
212
|
+
channel_id?: Maybe<Scalars['Snowflake']>;
|
|
213
|
+
channel_tags?: Maybe<Scalars['Set']>;
|
|
214
|
+
client_id?: Maybe<Scalars['String']>;
|
|
215
|
+
created?: Maybe<Scalars['Int']>;
|
|
216
|
+
hidden?: Maybe<Scalars['Boolean']>;
|
|
217
|
+
last_message_id?: Maybe<Scalars['Snowflake']>;
|
|
218
|
+
last_pinned_message_id?: Maybe<Scalars['Snowflake']>;
|
|
219
|
+
last_read_id?: Maybe<Scalars['Snowflake']>;
|
|
220
|
+
num_messages?: Maybe<Scalars['Int']>;
|
|
221
|
+
num_viewers?: Maybe<Scalars['Int']>;
|
|
222
|
+
pinned?: Maybe<Scalars['Boolean']>;
|
|
223
|
+
player_tags?: Maybe<Scalars['Set']>;
|
|
224
|
+
pushed_by?: Maybe<Scalars['Json']>;
|
|
225
|
+
score?: Maybe<Scalars['Int']>;
|
|
226
|
+
shadowed?: Maybe<Scalars['Boolean']>;
|
|
227
|
+
shard_max?: Maybe<Scalars['Int']>;
|
|
228
|
+
shard_min?: Maybe<Scalars['Int']>;
|
|
229
|
+
title?: Maybe<Scalars['String']>;
|
|
230
|
+
title_map?: Maybe<Scalars['Json']>;
|
|
231
|
+
topic_id?: Maybe<Scalars['Snowflake']>;
|
|
232
|
+
upvotes?: Maybe<Scalars['Int']>;
|
|
233
|
+
};
|
|
205
234
|
export type User = {
|
|
206
235
|
__typename?: 'User';
|
|
207
236
|
async_bundles?: Maybe<Scalars['List']>;
|
|
@@ -227,31 +256,3 @@ export type User = {
|
|
|
227
256
|
username?: Maybe<Scalars['String']>;
|
|
228
257
|
verification?: Maybe<Scalars['String']>;
|
|
229
258
|
};
|
|
230
|
-
export type Topic = {
|
|
231
|
-
__typename?: 'Topic';
|
|
232
|
-
attachment?: Maybe<Scalars['Json']>;
|
|
233
|
-
author_avatar?: Maybe<Scalars['String']>;
|
|
234
|
-
author_display_name?: Maybe<Scalars['String']>;
|
|
235
|
-
author_id?: Maybe<Scalars['Snowflake']>;
|
|
236
|
-
author_is_bot?: Maybe<Scalars['Boolean']>;
|
|
237
|
-
channel_id?: Maybe<Scalars['Snowflake']>;
|
|
238
|
-
channel_tags?: Maybe<Scalars['Set']>;
|
|
239
|
-
client_id?: Maybe<Scalars['String']>;
|
|
240
|
-
created?: Maybe<Scalars['Int']>;
|
|
241
|
-
hidden?: Maybe<Scalars['Boolean']>;
|
|
242
|
-
last_message_id?: Maybe<Scalars['Snowflake']>;
|
|
243
|
-
last_pinned_message_id?: Maybe<Scalars['Snowflake']>;
|
|
244
|
-
last_read_id?: Maybe<Scalars['Snowflake']>;
|
|
245
|
-
num_messages?: Maybe<Scalars['Int']>;
|
|
246
|
-
num_viewers?: Maybe<Scalars['Int']>;
|
|
247
|
-
pinned?: Maybe<Scalars['Boolean']>;
|
|
248
|
-
player_tags?: Maybe<Scalars['Set']>;
|
|
249
|
-
pushed_by?: Maybe<Scalars['Json']>;
|
|
250
|
-
score?: Maybe<Scalars['Int']>;
|
|
251
|
-
shard_max?: Maybe<Scalars['Int']>;
|
|
252
|
-
shard_min?: Maybe<Scalars['Int']>;
|
|
253
|
-
title?: Maybe<Scalars['String']>;
|
|
254
|
-
title_map?: Maybe<Scalars['Json']>;
|
|
255
|
-
topic_id?: Maybe<Scalars['Snowflake']>;
|
|
256
|
-
upvotes?: Maybe<Scalars['Int']>;
|
|
257
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleeperhq/mini-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "Core library frameworks for developing Sleeper Mini Apps.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@react-native-community/netinfo": "9.3.7",
|
|
44
44
|
"axios": "0.15.3",
|
|
45
45
|
"babel-loader": "9.1.2",
|
|
46
|
-
"react-native-fast-image": "https://github.com/blitzstudios/react-native-fast-image.git#release/1.
|
|
46
|
+
"react-native-fast-image": "https://github.com/blitzstudios/react-native-fast-image.git#release/1.1",
|
|
47
47
|
"react-native-interactable": "https://github.com/blitzstudios/react-native-interactable",
|
|
48
48
|
"react-native-linear-gradient": "2.5.6",
|
|
49
49
|
"react-native-rename": "^3.2.12",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
|
67
67
|
"@typescript-eslint/parser": "^5.31.0",
|
|
68
68
|
"babel-jest": "^26.6.3",
|
|
69
|
-
"eslint": "
|
|
69
|
+
"eslint": "8.38.0",
|
|
70
70
|
"jest": "^26.6.3",
|
|
71
71
|
"lodash": "4.17.21",
|
|
72
72
|
"metro-react-native-babel-preset": "^0.66.2",
|
package/src/components/index.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import {Federated} from '@callstack/repack/client';
|
|
|
4
4
|
import type {ButtonProps} from '../../declarations/button';
|
|
5
5
|
import type {JerseyProps} from '../../declarations/jersey';
|
|
6
6
|
import type {SwitchProps} from '../../declarations/switch';
|
|
7
|
+
import { AvatarProps, AvatarLeagueProps, AvatarPlayerProps, AvatarTeamProps } from '../../declarations/avatar';
|
|
7
8
|
|
|
8
9
|
const _SleeperModule = React.lazy(() =>
|
|
9
10
|
Federated.importModule('sleeper', 'index').catch(() => ({
|
|
@@ -16,6 +17,38 @@ const _SleeperModule = React.lazy(() =>
|
|
|
16
17
|
})),
|
|
17
18
|
);
|
|
18
19
|
|
|
20
|
+
const Avatar = (props: AvatarProps) => {
|
|
21
|
+
return (
|
|
22
|
+
<React.Suspense fallback={<View />}>
|
|
23
|
+
<_SleeperModule component="Avatar" {...props} />
|
|
24
|
+
</React.Suspense>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const AvatarLeague = (props: AvatarLeagueProps) => {
|
|
29
|
+
return (
|
|
30
|
+
<React.Suspense fallback={<View />}>
|
|
31
|
+
<_SleeperModule component="AvatarLeague" {...props} />
|
|
32
|
+
</React.Suspense>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const AvatarPlayer = (props: AvatarPlayerProps) => {
|
|
37
|
+
return (
|
|
38
|
+
<React.Suspense fallback={<View />}>
|
|
39
|
+
<_SleeperModule component="AvatarPlayer" {...props} />
|
|
40
|
+
</React.Suspense>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const AvatarTeam = (props: AvatarTeamProps) => {
|
|
45
|
+
return (
|
|
46
|
+
<React.Suspense fallback={<View />}>
|
|
47
|
+
<_SleeperModule component="AvatarTeam" {...props} />
|
|
48
|
+
</React.Suspense>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
19
52
|
const Button = (props: ButtonProps) => {
|
|
20
53
|
return (
|
|
21
54
|
<React.Suspense fallback={<View />}>
|
|
@@ -49,4 +82,4 @@ const Jersey = (props: JerseyProps) => {
|
|
|
49
82
|
};
|
|
50
83
|
|
|
51
84
|
export type {ButtonProps, TextProps, JerseyProps, SwitchProps};
|
|
52
|
-
export {Button, Text, Jersey, Switch};
|
|
85
|
+
export {Button, Text, Jersey, Switch, Avatar, AvatarLeague, AvatarPlayer, AvatarTeam};
|
package/src/dev_server/index.tsx
CHANGED
|
@@ -204,7 +204,6 @@ const DevServer = props => {
|
|
|
204
204
|
_name: config.name,
|
|
205
205
|
_entitlements: config.entitlements,
|
|
206
206
|
_headerOptions: config.headerOptions,
|
|
207
|
-
_sports: config.sports,
|
|
208
207
|
};
|
|
209
208
|
const json = JSON.stringify(message);
|
|
210
209
|
console.log('[Sleeper] Send IP address: ', ipAddress, config.name);
|
package/src/types/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HeaderOptions, Entitlement
|
|
1
|
+
import type { HeaderOptions, Entitlement } from '../../declarations/types';
|
|
2
2
|
|
|
3
3
|
export * from '../../declarations/types/index.d';
|
|
4
4
|
export type { default as Context } from '../../declarations/sleeper_context.d';
|
|
@@ -14,5 +14,4 @@ export type Config = {
|
|
|
14
14
|
logsEnabled?: boolean,
|
|
15
15
|
entitlements?: Entitlement[],
|
|
16
16
|
headerOptions?: HeaderOptions,
|
|
17
|
-
sports?: SportType[],
|
|
18
17
|
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
export type SwitchOption = {
|
|
3
|
-
colorToggleActive: string;
|
|
4
|
-
colorIconActive: string;
|
|
5
|
-
colorIconInactive: string;
|
|
6
|
-
iconStyle?: any;
|
|
7
|
-
icon: any;
|
|
8
|
-
};
|
|
9
|
-
export type Props = {
|
|
10
|
-
options: [SwitchOption, SwitchOption];
|
|
11
|
-
value?: number;
|
|
12
|
-
onChange?: (value: number) => void;
|
|
13
|
-
height?: number;
|
|
14
|
-
width?: number;
|
|
15
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
16
|
-
toggleStyle?: StyleProp<ViewStyle>;
|
|
17
|
-
};
|
|
18
|
-
export declare const AppIconSwitch: any;
|