@orderly.network/trading-leaderboard 2.5.3-alpha.1 → 2.6.0-alpha.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/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { PropsWithChildren, FC, ReactNode } from 'react';
2
+ import react__default, { FC, ReactNode } from 'react';
3
3
  import * as embla_carousel_react from 'embla-carousel-react';
4
4
  import * as _orderly_network_ui from '@orderly.network/ui';
5
5
  import { TableSort } from '@orderly.network/ui';
@@ -31,7 +31,7 @@ type TradingLeaderboardState$1 = {
31
31
  trading: string;
32
32
  };
33
33
  };
34
- type TradingLeaderboardProviderProps$1 = PropsWithChildren<TradingLeaderboardState$1>;
34
+ type TradingLeaderboardProviderProps$1 = react__default.PropsWithChildren<TradingLeaderboardState$1>;
35
35
 
36
36
  type LeaderboardScriptReturn = ReturnType<typeof useLeaderboardScript>;
37
37
  type LeaderboardScriptOptions = {
@@ -169,6 +169,23 @@ type TradingListWidgetProps = Pick<TradingListProps, "style" | "className">;
169
169
  */
170
170
  declare const TradingListWidget: FC<TradingListWidgetProps>;
171
171
 
172
+ type RankingColumnFields = "rank" | "address" | "volume" | "pnl" | "rewards";
173
+
174
+ type ListStyle = "disc" | "decimal" | "none" | "circle" | "square" | "decimal-leading-zero" | "lower-alpha" | "upper-alpha" | "lower-roman" | "upper-roman";
175
+ type DescriptionItem = {
176
+ content: string;
177
+ type: "markdown" | "text" | "image";
178
+ alt?: string;
179
+ className?: string;
180
+ listStyle?: ListStyle;
181
+ listClassName?: string;
182
+ children?: DescriptionItem[];
183
+ };
184
+ type DescriptionConfig = {
185
+ listStyle?: ListStyle;
186
+ listClassName?: string;
187
+ };
188
+
172
189
  declare enum CampaignTagEnum {
173
190
  ONGOING = "ongoing",
174
191
  COMING = "coming",
@@ -221,8 +238,25 @@ interface CampaignConfig {
221
238
  ticket_rules?: TicketRules;
222
239
  image?: string;
223
240
  rule_url?: string;
241
+ rule_config?: {
242
+ action?: "scroll" | "click";
243
+ };
224
244
  trading_url?: string;
245
+ trading_config?: {
246
+ format?: string;
247
+ };
225
248
  href?: string;
249
+ hide_arena?: boolean;
250
+ hide_rewards?: boolean;
251
+ hide_estimated_rewards?: boolean;
252
+ highlight_pool_id?: string;
253
+ user_account_label?: string;
254
+ rule?: {
255
+ rule: DescriptionItem[];
256
+ terms: DescriptionItem[];
257
+ ruleConfig?: DescriptionConfig;
258
+ };
259
+ exclude_leaderboard_columns?: RankingColumnFields[];
226
260
  }
227
261
  interface UserData {
228
262
  rank?: number | string;
@@ -260,9 +294,9 @@ type TradingLeaderboardState = {
260
294
  /** default trading now button url */
261
295
  trading: string;
262
296
  };
263
- currentCampaignId: string;
297
+ currentCampaignId: string | number;
264
298
  currentCampaign?: CampaignConfig;
265
- onCampaignChange: (campaignId: string) => void;
299
+ onCampaignChange: (campaignId: string | number) => void;
266
300
  /** leaderboard user data, it will be used to calculate the rewards */
267
301
  userData?: UserData;
268
302
  /** set leaderboard user data */
@@ -291,12 +325,12 @@ type TradingLeaderboardState = {
291
325
  /**
292
326
  * Trading leaderboard context
293
327
  */
294
- declare const TradingLeaderboardContext: react.Context<TradingLeaderboardState>;
295
- type TradingLeaderboardProviderProps = PropsWithChildren<Pick<TradingLeaderboardState, "campaigns" | "href" | "backgroundSrc" | "dataAdapter">> & {
328
+ declare const TradingLeaderboardContext: react__default.Context<TradingLeaderboardState>;
329
+ type TradingLeaderboardProviderProps = Pick<TradingLeaderboardState, "campaigns" | "href" | "backgroundSrc" | "dataAdapter"> & {
296
330
  campaignId?: string | number;
297
331
  onCampaignChange?: (campaignId: string | number) => void;
298
332
  };
299
- declare const TradingLeaderboardProvider: (props: TradingLeaderboardProviderProps) => react_jsx_runtime.JSX.Element;
333
+ declare const TradingLeaderboardProvider: react__default.FC<react__default.PropsWithChildren<TradingLeaderboardProviderProps>>;
300
334
  declare const useTradingLeaderboardContext: () => TradingLeaderboardState;
301
335
 
302
336
  type CampaignRankingData = {
@@ -373,8 +407,6 @@ declare function useGeneralRankingScript(options?: GeneralRankingScriptOptions):
373
407
  address: string | undefined;
374
408
  };
375
409
 
376
- type RankingColumnFields = "rank" | "address" | "volume" | "pnl" | "rewards";
377
-
378
410
  type RankingData = GeneralRankingData | CampaignRankingData;
379
411
  type RankingProps = {
380
412
  style?: React.CSSProperties;
@@ -424,6 +456,7 @@ type CampaignLeaderboardScriptReturn = ReturnType<typeof useCampaignLeaderboardS
424
456
  declare function useCampaignLeaderboardScript(): {
425
457
  activeTab: LeaderboardTab;
426
458
  onTabChange: react.Dispatch<react.SetStateAction<LeaderboardTab>>;
459
+ excludeColumns: RankingColumnFields[];
427
460
  };
428
461
 
429
462
  type CampaignLeaderboardProps = {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { PropsWithChildren, FC, ReactNode } from 'react';
2
+ import react__default, { FC, ReactNode } from 'react';
3
3
  import * as embla_carousel_react from 'embla-carousel-react';
4
4
  import * as _orderly_network_ui from '@orderly.network/ui';
5
5
  import { TableSort } from '@orderly.network/ui';
@@ -31,7 +31,7 @@ type TradingLeaderboardState$1 = {
31
31
  trading: string;
32
32
  };
33
33
  };
34
- type TradingLeaderboardProviderProps$1 = PropsWithChildren<TradingLeaderboardState$1>;
34
+ type TradingLeaderboardProviderProps$1 = react__default.PropsWithChildren<TradingLeaderboardState$1>;
35
35
 
36
36
  type LeaderboardScriptReturn = ReturnType<typeof useLeaderboardScript>;
37
37
  type LeaderboardScriptOptions = {
@@ -169,6 +169,23 @@ type TradingListWidgetProps = Pick<TradingListProps, "style" | "className">;
169
169
  */
170
170
  declare const TradingListWidget: FC<TradingListWidgetProps>;
171
171
 
172
+ type RankingColumnFields = "rank" | "address" | "volume" | "pnl" | "rewards";
173
+
174
+ type ListStyle = "disc" | "decimal" | "none" | "circle" | "square" | "decimal-leading-zero" | "lower-alpha" | "upper-alpha" | "lower-roman" | "upper-roman";
175
+ type DescriptionItem = {
176
+ content: string;
177
+ type: "markdown" | "text" | "image";
178
+ alt?: string;
179
+ className?: string;
180
+ listStyle?: ListStyle;
181
+ listClassName?: string;
182
+ children?: DescriptionItem[];
183
+ };
184
+ type DescriptionConfig = {
185
+ listStyle?: ListStyle;
186
+ listClassName?: string;
187
+ };
188
+
172
189
  declare enum CampaignTagEnum {
173
190
  ONGOING = "ongoing",
174
191
  COMING = "coming",
@@ -221,8 +238,25 @@ interface CampaignConfig {
221
238
  ticket_rules?: TicketRules;
222
239
  image?: string;
223
240
  rule_url?: string;
241
+ rule_config?: {
242
+ action?: "scroll" | "click";
243
+ };
224
244
  trading_url?: string;
245
+ trading_config?: {
246
+ format?: string;
247
+ };
225
248
  href?: string;
249
+ hide_arena?: boolean;
250
+ hide_rewards?: boolean;
251
+ hide_estimated_rewards?: boolean;
252
+ highlight_pool_id?: string;
253
+ user_account_label?: string;
254
+ rule?: {
255
+ rule: DescriptionItem[];
256
+ terms: DescriptionItem[];
257
+ ruleConfig?: DescriptionConfig;
258
+ };
259
+ exclude_leaderboard_columns?: RankingColumnFields[];
226
260
  }
227
261
  interface UserData {
228
262
  rank?: number | string;
@@ -260,9 +294,9 @@ type TradingLeaderboardState = {
260
294
  /** default trading now button url */
261
295
  trading: string;
262
296
  };
263
- currentCampaignId: string;
297
+ currentCampaignId: string | number;
264
298
  currentCampaign?: CampaignConfig;
265
- onCampaignChange: (campaignId: string) => void;
299
+ onCampaignChange: (campaignId: string | number) => void;
266
300
  /** leaderboard user data, it will be used to calculate the rewards */
267
301
  userData?: UserData;
268
302
  /** set leaderboard user data */
@@ -291,12 +325,12 @@ type TradingLeaderboardState = {
291
325
  /**
292
326
  * Trading leaderboard context
293
327
  */
294
- declare const TradingLeaderboardContext: react.Context<TradingLeaderboardState>;
295
- type TradingLeaderboardProviderProps = PropsWithChildren<Pick<TradingLeaderboardState, "campaigns" | "href" | "backgroundSrc" | "dataAdapter">> & {
328
+ declare const TradingLeaderboardContext: react__default.Context<TradingLeaderboardState>;
329
+ type TradingLeaderboardProviderProps = Pick<TradingLeaderboardState, "campaigns" | "href" | "backgroundSrc" | "dataAdapter"> & {
296
330
  campaignId?: string | number;
297
331
  onCampaignChange?: (campaignId: string | number) => void;
298
332
  };
299
- declare const TradingLeaderboardProvider: (props: TradingLeaderboardProviderProps) => react_jsx_runtime.JSX.Element;
333
+ declare const TradingLeaderboardProvider: react__default.FC<react__default.PropsWithChildren<TradingLeaderboardProviderProps>>;
300
334
  declare const useTradingLeaderboardContext: () => TradingLeaderboardState;
301
335
 
302
336
  type CampaignRankingData = {
@@ -373,8 +407,6 @@ declare function useGeneralRankingScript(options?: GeneralRankingScriptOptions):
373
407
  address: string | undefined;
374
408
  };
375
409
 
376
- type RankingColumnFields = "rank" | "address" | "volume" | "pnl" | "rewards";
377
-
378
410
  type RankingData = GeneralRankingData | CampaignRankingData;
379
411
  type RankingProps = {
380
412
  style?: React.CSSProperties;
@@ -424,6 +456,7 @@ type CampaignLeaderboardScriptReturn = ReturnType<typeof useCampaignLeaderboardS
424
456
  declare function useCampaignLeaderboardScript(): {
425
457
  activeTab: LeaderboardTab;
426
458
  onTabChange: react.Dispatch<react.SetStateAction<LeaderboardTab>>;
459
+ excludeColumns: RankingColumnFields[];
427
460
  };
428
461
 
429
462
  type CampaignLeaderboardProps = {