@wlloyalty/wll-react-sdk 1.0.10 → 1.0.12
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 +51 -0
- package/dist/index.d.ts +21 -5
- package/dist/index.js +816 -274
- package/dist/index.js.map +1 -1
- package/package.json +24 -5
package/README.md
CHANGED
|
@@ -6,3 +6,54 @@ This library is compatible with:
|
|
|
6
6
|
- React Native: >=0.70.0 <0.73.0
|
|
7
7
|
|
|
8
8
|
Please ensure your project's React and React Native versions fall within these ranges for optimal compatibility.
|
|
9
|
+
|
|
10
|
+
## Commit Convention
|
|
11
|
+
|
|
12
|
+
This repository follows [Conventional Commits](https://www.conventionalcommits.org/) specification for commit messages to ensure consistent commits and automated versioning. Each commit message should be structured as follows:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
type(scope?): subject
|
|
16
|
+
|
|
17
|
+
[optional body]
|
|
18
|
+
|
|
19
|
+
[optional footer(s)]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Types
|
|
23
|
+
- `feat`: New features (e.g., `feat(auth): add Google OAuth login`)
|
|
24
|
+
- `fix`: Bug fixes (e.g., `fix(api): correct rate limiting logic`)
|
|
25
|
+
- `hotfix`: Critical bug fixes requiring immediate deployment
|
|
26
|
+
- `docs`: Documentation changes
|
|
27
|
+
- `style`: Code style changes (formatting, missing semi colons, etc)
|
|
28
|
+
- `refactor`: Code changes that neither fix bugs nor add features
|
|
29
|
+
- `perf`: Performance improvements
|
|
30
|
+
- `test`: Adding or updating tests
|
|
31
|
+
- `build`: Changes to build system or dependencies
|
|
32
|
+
- `ci`: Changes to CI configuration
|
|
33
|
+
- `chore`: Other changes that don't modify src or test files
|
|
34
|
+
- `revert`: Reverting previous changes
|
|
35
|
+
- `wip`: Work in progress
|
|
36
|
+
|
|
37
|
+
### Scope
|
|
38
|
+
The scope is optional and represents the section of the codebase the commit modifies (e.g., `auth`, `api`, `ui`).
|
|
39
|
+
|
|
40
|
+
### Commit Tools
|
|
41
|
+
We use several tools to enforce this convention:
|
|
42
|
+
|
|
43
|
+
- **Commitlint**: Checks if your commit messages meet the conventional commit format
|
|
44
|
+
- **Commitizen**: CLI tool to help format commit messages
|
|
45
|
+
- **Husky**: Git hooks to enforce commit message format
|
|
46
|
+
|
|
47
|
+
To make a commit using the interactive commit tool:
|
|
48
|
+
```bash
|
|
49
|
+
yarn commit
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Local Setup
|
|
53
|
+
If you're setting up the repository locally, the commit hooks will be installed automatically when you run `yarn install`. However, if you need to reinstall the hooks, you can run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
yarn prepare
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This ensures that all commits follow our conventions and maintains a clean, readable git history.
|
package/dist/index.d.ts
CHANGED
|
@@ -144,8 +144,8 @@ type TierType = {
|
|
|
144
144
|
attained?: boolean;
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
declare enum
|
|
148
|
-
sameWindow = "
|
|
147
|
+
declare enum CTALinkTarget {
|
|
148
|
+
sameWindow = "SAME_FRAME",
|
|
149
149
|
newWindow = "NEW_WINDOW"
|
|
150
150
|
}
|
|
151
151
|
declare enum TierTileType {
|
|
@@ -176,7 +176,7 @@ declare class BannerTileConfig {
|
|
|
176
176
|
description?: string | null;
|
|
177
177
|
ctaText?: string | null;
|
|
178
178
|
ctaLink?: string | null;
|
|
179
|
-
ctaLinkTarget?:
|
|
179
|
+
ctaLinkTarget?: CTALinkTarget;
|
|
180
180
|
}
|
|
181
181
|
declare class PointsTileConfig {
|
|
182
182
|
title?: string | null;
|
|
@@ -190,7 +190,8 @@ declare class ContentTileConfig {
|
|
|
190
190
|
title?: string | null;
|
|
191
191
|
body?: string | null;
|
|
192
192
|
artworkUrl?: string | null;
|
|
193
|
-
|
|
193
|
+
ctaLinkTarget?: CTALinkTarget;
|
|
194
|
+
ctaLink?: string | null;
|
|
194
195
|
}
|
|
195
196
|
declare class RewardTileConfig {
|
|
196
197
|
rewardId: string;
|
|
@@ -578,6 +579,19 @@ type TGroup = {
|
|
|
578
579
|
sections: TSection[];
|
|
579
580
|
};
|
|
580
581
|
|
|
582
|
+
type NavigationHandlerParams = {
|
|
583
|
+
target: string;
|
|
584
|
+
windowTarget: string;
|
|
585
|
+
};
|
|
586
|
+
type NavigationConfig = {
|
|
587
|
+
navigationHandlers?: {
|
|
588
|
+
external?: (params: NavigationHandlerParams) => void;
|
|
589
|
+
internal?: (params: NavigationHandlerParams) => void;
|
|
590
|
+
modal?: (params: NavigationHandlerParams) => void;
|
|
591
|
+
};
|
|
592
|
+
baseUrl?: string;
|
|
593
|
+
};
|
|
594
|
+
|
|
581
595
|
type Fetcher = <T>(endpoint: string, options?: RequestInit) => Promise<APIResponse<T>>;
|
|
582
596
|
type SDKConfig = {
|
|
583
597
|
apiKey: string;
|
|
@@ -594,13 +608,15 @@ type WllSdkContextType = ThemeContextType & {
|
|
|
594
608
|
getGroupByID: (id: string) => Promise<APIResponse<TGroup>>;
|
|
595
609
|
getSectionByID: (id: string) => Promise<APIResponse<TSection>>;
|
|
596
610
|
getTileByID: (id: string) => Promise<APIResponse<Tile>>;
|
|
611
|
+
handleNavigation: (link: string, target: CTALinkTarget) => void;
|
|
597
612
|
};
|
|
598
613
|
type WllSdkProviderProps = {
|
|
599
614
|
children: React__default.ReactNode;
|
|
600
615
|
theme?: Partial<BaseThemeObject>;
|
|
601
616
|
config: SDKConfig;
|
|
617
|
+
navigationConfig?: NavigationConfig;
|
|
602
618
|
};
|
|
603
619
|
declare const WllSdkProvider: React__default.FC<WllSdkProviderProps>;
|
|
604
620
|
declare const useWllSdk: () => WllSdkContextType;
|
|
605
621
|
|
|
606
|
-
export { type APIResponse, type Availability, type Badge, type BadgeDetail, BadgeTile$1 as BadgeTile, BadgeTileConfig, BadgeTileType, BadgeTile as BadgeTileUpdated, BannerTile, BannerTileConfig, BaseBanner, type BaseThemeObject, BaseTile, Button, Carousel, Column as Content, ContentTile, ContentTileConfig, type DerivedProperties, Grid, Group, Icon, type ImagePropsNoSource, LoadingIndicator, PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, RewardCategoryTile, RewardCategoryTileConfig, RewardTile, RewardTileConfig, RowHeader, type SDKConfig, Section, SectionHeader, SectionType, type Size, type TSection, Text, type ThemeContextType, type ThemeObject, type ThemeProviderProps, TierTile$1 as TierTile, TierTileConfig, TierTileType, TierTile as TierTileUpdated, type TierType, type Tile, type TileConfig, TileContainer, TileHeight, TileType,
|
|
622
|
+
export { type APIResponse, type Availability, type Badge, type BadgeDetail, BadgeTile$1 as BadgeTile, BadgeTileConfig, BadgeTileType, BadgeTile as BadgeTileUpdated, BannerTile, BannerTileConfig, BaseBanner, type BaseThemeObject, BaseTile, Button, CTALinkTarget, Carousel, Column as Content, ContentTile, ContentTileConfig, type DerivedProperties, Grid, Group, Icon, type ImagePropsNoSource, LoadingIndicator, PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, RewardCategoryTile, RewardCategoryTileConfig, RewardTile, RewardTileConfig, RowHeader, type SDKConfig, Section, SectionHeader, SectionType, type Size, type TSection, Text, type ThemeContextType, type ThemeObject, type ThemeProviderProps, TierTile$1 as TierTile, TierTileConfig, TierTileType, TierTile as TierTileUpdated, type TierType, type Tile, type TileConfig, TileContainer, TileHeight, TileType, type Variant, WllSdkProvider, useWllSdk };
|