@sleeperhq/mini-core 1.7.2 → 1.8.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/bin/build_mini.js CHANGED
@@ -69,7 +69,7 @@ const spawnProcess = (command, errorMessage) => {
69
69
  return new Promise((resolve) => {
70
70
  const child = isWindows
71
71
  ? spawn('cmd.exe', ['/c', command])
72
- : spawn(command, { shell: true });
72
+ : spawn(command, { env: process.env, shell: process.env.SHELL || true });
73
73
 
74
74
  child.stdout.on('data', (data) => {
75
75
  process.stdout.write(data); // output the data to the console
@@ -152,11 +152,14 @@ const main = async () => {
152
152
 
153
153
  const commands = getCommands(projectName);
154
154
 
155
- // Clean build folders
156
- await spawnProcess(commands.cleanAll, "clean command exited with non-zero code");
157
-
158
- // Run yarn + pod install
159
- await spawnProcess(commands.install, "clean command exited with non-zero code");
155
+ const shouldClean = await getInput("Clean and rebuild project? (y/n): ", 'y');
156
+ if (shouldClean === 'y') {
157
+ // Clean build folders
158
+ await spawnProcess(commands.cleanAll, "clean command exited with non-zero code");
159
+
160
+ // Run yarn + pod install
161
+ await spawnProcess(commands.install, "install command exited with non-zero code");
162
+ }
160
163
 
161
164
  // Build iOS
162
165
  printInfo("Building iOS...");
@@ -173,12 +176,12 @@ const main = async () => {
173
176
 
174
177
  // Create Zip Archive
175
178
  printInfo("Creating zip archive...");
176
- await spawnProcess(commands.cleanIndex, "clean command exited with non-zero code");
179
+ await spawnProcess(commands.cleanIndex, "clean index command exited with non-zero code");
177
180
  await spawnProcess(commands.zip, "zip command exited with non-zero code");
178
181
  printComplete(`Zip archive created successfully at ${commands.zipFilePath}`);
179
182
 
180
183
  // Clean build folders
181
- await spawnProcess(commands.cleanBuild, "clean command exited with non-zero code");
184
+ await spawnProcess(commands.cleanBuild, "clean build command exited with non-zero code");
182
185
 
183
186
  // Open output folder
184
187
  await spawnProcess(commands.openFile);
@@ -4,8 +4,6 @@ const os = require('os');
4
4
  const path = require('path');
5
5
  const fs = require('fs');
6
6
 
7
- const isWindows = os.platform() === 'win32';
8
-
9
7
  const printError = (error) => {
10
8
  console.error("\n\033[91m" + error + "\033[0m");
11
9
  };
@@ -37,7 +35,8 @@ const main = async () => {
37
35
  (packageName) => `import '${packageName}';`
38
36
  ).join('\n');
39
37
 
40
- let output = `/*
38
+ let output =
39
+ `/*
41
40
  This file is automatically generated when you
42
41
  add a package to your package.json and run yarn.
43
42
  Please do not edit manually.
@@ -47,6 +46,12 @@ ${packageList}
47
46
  `;
48
47
 
49
48
  fs.writeFileSync(packageListPath, output);
49
+
50
+ // Write a ./mini_packages.json file that shows all available packages in sleeper.
51
+ const source = 'node_modules/@sleeperhq/mini-core/mini_packages.json';
52
+ const destination = 'mini_packages.json';
53
+ fs.copyFile(source, destination);
54
+
50
55
  process.exit(0);
51
56
  };
52
57
 
@@ -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>;
@@ -1,4 +1,3 @@
1
- export * from './types';
2
- export * from './sleeper_message';
3
- declare const _default: any;
1
+ /// <reference types="react" />
2
+ declare const _default: (props: any) => JSX.Element;
4
3
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { ColorValue, ViewStyle } from 'react-native';
2
- import SleeperJersey from 'components/ui/jersey';
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 './types';
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,11 +1,13 @@
1
- import { User, League, LeaguesMap, RostersInLeagueMap, UserMap, MatchupsInLeagueMap, UsersInLeagueMap, PlayoffsInLeagueMap, TransactionsInLeagueMap, TransactionsMap, SportInfoMap, DraftsInLeagueMap, DraftPickTradesInLeagueMap, DraftPicksInDraftMap, PlayersInSportMap, Topic, Location } from './types';
2
- import type { SleeperActions } from './sleeper_actions';
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;
6
6
  league: League;
7
7
  leaguesMap: LeaguesMap;
8
+ leaguesMapBySport: Record<SportType, LeaguesMap>;
8
9
  userLeagueList: string[];
10
+ userLeagueListBySport: Record<SportType, string[]>;
9
11
  rostersInLeagueMap: RostersInLeagueMap;
10
12
  userMap: UserMap;
11
13
  matchupsInLeagueMap: MatchupsInLeagueMap;
@@ -1,4 +1,4 @@
1
- import type { Entitlement, HeaderOptions } from './types';
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,5 +7,6 @@ type SocketMessage = {
7
7
  _description?: string;
8
8
  _entitlements?: Entitlement[];
9
9
  _headerOptions?: HeaderOptions;
10
+ _metadata?: Metadata;
10
11
  };
11
12
  export default SocketMessage;
@@ -1,3 +1,3 @@
1
- import { AppIconSwitch } from '../types/components/ui_2/app_icon_switch';
2
- export type { SwitchOption, Props as SwitchProps } from '../types/components/ui_2/app_icon_switch';
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>;
@@ -0,0 +1,3 @@
1
+ export default Jersey;
2
+ declare const Jersey: React.NamedExoticComponent<object>;
3
+ import React from 'react';
@@ -1,83 +1,17 @@
1
- import { League, Roster, User, MatchupLeg, LeagueTransaction, Draft, DraftPick, RosterDraftPick, Player, Topic } from './shared/graphql.d';
2
- import type { ToastConfig as ToastConfigOriginal } from './utils/toast_helper';
3
- export * from './shared/graphql.d';
4
- export * from '../navigation/index.d';
5
- export type LeagueId = string;
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,6 +20,7 @@ export type Mini = {
86
20
  email?: string;
87
21
  entitlements?: Entitlement[];
88
22
  headerOptions?: HeaderOptions;
23
+ metadata?: Metadata;
89
24
  };
90
25
  export type Location = {
91
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
- };
@@ -1,7 +1,7 @@
1
1
  import { TextStyle, ViewStyle } from 'react-native';
2
2
  export type ToastConfig = {
3
3
  text: string;
4
- icon?: string;
4
+ icon?: 'success' | 'error' | 'trade' | 'voice';
5
5
  time?: number;
6
6
  style?: ViewStyle;
7
7
  slideTop?: boolean;
@@ -0,0 +1,113 @@
1
+ {
2
+ "packages": {
3
+ "@babel/runtime": "7.15.4",
4
+ "@babel/plugin-transform-runtime": "7.15.0",
5
+ "@mattermost/react-native-paste-input": "0.6.4",
6
+ "@notifee/react-native": "7.8.0",
7
+ "@ptomasroos/react-native-multi-slider": "2.2.2",
8
+ "@react-native-camera-roll/camera-roll": "5.2.0",
9
+ "@react-native-community/blur": "3.6.0",
10
+ "@react-native-community/datetimepicker": "2.6.2",
11
+ "@react-native-community/hooks": "2.8.0",
12
+ "@react-native-community/netinfo": "9.3.7",
13
+ "@react-native-masked-view/masked-view": "0.2.8",
14
+ "@react-native-picker/picker": "1.16.8",
15
+ "@react-navigation/bottom-tabs": "6.5.4",
16
+ "@react-navigation/compat": "5.3.20",
17
+ "@react-navigation/native": "6.1.3",
18
+ "@react-navigation/stack": "6.3.12",
19
+ "@shopify/flash-list": "1.4.1",
20
+ "@sleeperhq/mini-core": "1.8.1",
21
+ "amazon-cognito-identity-js": "6.3.2",
22
+ "crypto-js": "3.3.0",
23
+ "decimal.js-light": "2.5.1",
24
+ "deep-diff": "1.0.2",
25
+ "he": "1.2.0",
26
+ "moment-timezone": "0.5.11",
27
+ "path": "0.12.7",
28
+ "react": "18.2.0",
29
+ "react-freeze": "1.0.3",
30
+ "react-native": "0.72.7",
31
+ "react-native-action-sheet": "2.2.0",
32
+ "react-native-animatable": "1.3.3",
33
+ "react-native-branch": "5.4.0",
34
+ "react-native-check-version": "1.0.20",
35
+ "react-native-color-matrix-image-filters": "5.2.10",
36
+ "react-native-compressor": "1.5.2",
37
+ "react-native-confirmation-code-field": "6.7.0",
38
+ "react-native-contacts": "5.2.8",
39
+ "react-native-create-thumbnail": "2.0.0-rc.2",
40
+ "react-native-date-picker": "4.2.2",
41
+ "react-native-detector": "0.2.1",
42
+ "react-native-device-info": "8.4.1",
43
+ "react-native-draggable-flatlist": "4.0.1",
44
+ "react-native-draggable-reanimated": "1.0.5",
45
+ "react-native-dropdownalert": "4.3.0",
46
+ "react-native-emoji-rain": "0.0.1",
47
+ "react-native-extra-dimensions-android": "1.2.5",
48
+ "react-native-fs": "2.18.0",
49
+ "react-native-gesture-handler": "2.14.0",
50
+ "react-native-google-places-autocomplete": "2.4.1",
51
+ "react-native-haptic-feedback": "1.6.0",
52
+ "react-native-image-crop-picker": "0.39.0",
53
+ "react-native-image-pan-zoom": "2.1.12",
54
+ "react-native-image-picker": "4.10.3",
55
+ "react-native-image-resizer": "1.4.5",
56
+ "react-native-iphone-x-helper": "1.3.1",
57
+ "react-native-json-tree": "1.3.0",
58
+ "react-native-keep-awake": "4.0.0",
59
+ "react-native-keyboard-aware-scroll-view": "0.9.5",
60
+ "react-native-keyboard-spacer": "0.4.1",
61
+ "react-native-linear-gradient": "2.8.3",
62
+ "react-native-modal": "13.0.0",
63
+ "react-native-modal-datetime-picker": "13.0.1",
64
+ "react-native-parsed-text": "0.0.21",
65
+ "react-native-permissions": "3.6.1",
66
+ "react-native-platform-touchable": "1.1.1",
67
+ "react-native-popup-dialog": "0.11.46",
68
+ "react-native-popup-menu": "0.16.1",
69
+ "react-native-progress": "4.1.2",
70
+ "react-native-qrcode-svg": "6.1.1",
71
+ "react-native-reanimated": "3.5.4",
72
+ "react-native-redash": "18.1.0",
73
+ "react-native-safe-area-context": "4.7.4",
74
+ "react-native-screens": "3.29.0",
75
+ "react-native-search-bar": "3.5.1",
76
+ "react-native-section-list-get-item-layout": "2.2.3",
77
+ "react-native-shake": "5.3.1",
78
+ "react-native-share": "7.3.9",
79
+ "react-native-shimmer-placeholder": "1.0.36",
80
+ "react-native-simple-toast": "1.1.3",
81
+ "react-native-sms": "1.11.0",
82
+ "react-native-snap-carousel": "3.9.1",
83
+ "react-native-sound": "0.11.1",
84
+ "react-native-sound-level": "1.1.5",
85
+ "react-native-spinkit": "1.5.1",
86
+ "react-native-svg": "13.14.0",
87
+ "react-native-swiper": "1.6.0-rc.3",
88
+ "react-native-tab-view": "3.5.0",
89
+ "react-native-tcp-socket": "6.0.6",
90
+ "react-native-triangle": "0.0.9",
91
+ "react-native-vector-icons": "10.0.0",
92
+ "react-native-video": "5.2.1",
93
+ "react-native-view-shot": "3.7.0",
94
+ "react-native-webview": "11.23.1",
95
+ "react-native-webp-format": "1.1.2",
96
+ "regenerator-runtime": "0.13.9",
97
+ "recyclerlistview": "4.2.0",
98
+ "rn-prompt": "1.0.4"
99
+ },
100
+ "overrides": {
101
+ "@callstack/repack": "2.7.0",
102
+ "@react-native-async-storage/async-storage": "1.15.15",
103
+ "@react-native-community/audio-toolkit": "2.0.3",
104
+ "react-native-chart-kit": "6.7.0",
105
+ "react-native-circular-progress": "1.3.6",
106
+ "react-native-fast-image": "8.5.11",
107
+ "react-native-interactable": "0.1.10",
108
+ "react-native-recyclerview-list": "0.3.4"
109
+ },
110
+ "requiredBy": {
111
+ "amazon-cognito-identity-js": "flexfantasy"
112
+ }
113
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleeperhq/mini-core",
3
- "version": "1.7.2",
3
+ "version": "1.8.1",
4
4
  "description": "Core library frameworks for developing Sleeper Mini Apps.",
5
5
  "main": "index.ts",
6
6
  "types": "index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "axios": "0.15.3",
45
45
  "babel-loader": "9.1.2",
46
46
  "react-native-fast-image": "https://github.com/blitzstudios/react-native-fast-image.git#release/1.1",
47
- "react-native-interactable": "https://github.com/blitzstudios/react-native-interactable#release/1.0",
47
+ "react-native-interactable": "https://github.com/blitzstudios/react-native-interactable#release/1.1",
48
48
  "react-native-linear-gradient": "2.5.6",
49
49
  "react-native-rename": "^3.2.12",
50
50
  "react-refresh": "0.14.0",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "react": "18.2.0",
58
- "react-native": "0.72.6",
58
+ "react-native": "0.72.7",
59
59
  "react-native-svg": "13.7.0"
60
60
  },
61
61
  "devDependencies": {
@@ -63,11 +63,11 @@
63
63
  "@babel/preset-typescript": "7.21.4",
64
64
  "@react-native-community/eslint-config": "^2.0.0",
65
65
  "@types/react": "18.0.24",
66
- "@types/react-native": "0.72.5",
66
+ "@types/react-native": "0.72.7",
67
67
  "@typescript-eslint/eslint-plugin": "^5.31.0",
68
68
  "@typescript-eslint/parser": "^5.31.0",
69
69
  "babel-jest": "^26.6.3",
70
- "eslint": "7.14.0",
70
+ "eslint": "8.38.0",
71
71
  "jest": "^26.6.3",
72
72
  "lodash": "4.17.21",
73
73
  "metro-react-native-babel-preset": "^0.66.2",
@@ -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/webpack.config.js CHANGED
@@ -303,6 +303,12 @@ module.exports = env => {
303
303
  // split off into a seperate chunk, and named chunks will break (assume that's a bug that we can fix).
304
304
  },
305
305
  }),
306
+
307
+ // new Repack.plugins.ChunksToHermesBytecodePlugin({
308
+ // enabled: !dev,
309
+ // test: /\.(js)?bundle$/,
310
+ // exclude: /index\.bundle$/,
311
+ // }),
306
312
  ],
307
313
  };
308
314
  };
@@ -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;