@rpg-engine/long-bow 0.8.61 → 0.8.64
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/components/Store/CartView.d.ts +1 -1
- package/dist/components/Store/Store.d.ts +1 -1
- package/dist/components/Store/StoreItemDetails.d.ts +1 -1
- package/dist/components/Store/StoreItemRow.d.ts +1 -2
- package/dist/components/Store/hooks/useStoreCart.d.ts +1 -1
- package/dist/components/Store/sections/StoreItemsSection.d.ts +1 -2
- package/dist/components/Store/sections/StorePacksSection.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Store/CartView.tsx +2 -1
- package/src/components/Store/Store.tsx +1 -2
- package/src/components/Store/StoreItemDetails.tsx +1 -1
- package/src/components/Store/StoreItemRow.tsx +1 -2
- package/src/components/Store/hooks/useStoreCart.ts +2 -2
- package/src/components/Store/sections/StoreItemsSection.tsx +2 -2
- package/src/components/Store/sections/StorePacksSection.tsx +1 -1
- package/src/mocks/dailyTasks.mocks.ts +16 -11
- package/src/stories/Features/store/Store.stories.tsx +1 -2
- package/dist/components/Store/StoreTypes.d.ts +0 -49
- package/src/components/Store/StoreTypes.ts +0 -56
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { UserAccountTypes } from '@rpg-engine/shared';
|
|
1
|
+
import { IStoreItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IStoreItem } from './StoreTypes';
|
|
4
3
|
interface IStoreItemRowProps {
|
|
5
4
|
item: IStoreItem;
|
|
6
5
|
atlasJSON: Record<string, any>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { UserAccountTypes } from '@rpg-engine/shared';
|
|
1
|
+
import { IStoreItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IStoreItem } from '../StoreTypes';
|
|
4
3
|
interface IStoreItemsSectionProps {
|
|
5
4
|
items: IStoreItem[];
|
|
6
5
|
onAddToCart: (item: IStoreItem, quantity: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.64",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@capacitor/core": "^6.1.0",
|
|
86
86
|
"@rollup/plugin-image": "^2.1.1",
|
|
87
|
-
"@rpg-engine/shared": "^0.9.
|
|
87
|
+
"@rpg-engine/shared": "^0.9.120",
|
|
88
88
|
"dayjs": "^1.11.2",
|
|
89
89
|
"font-awesome": "^4.7.0",
|
|
90
90
|
"fs-extra": "^10.1.0",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { IStoreItem } from '@rpg-engine/shared';
|
|
1
2
|
import React, { useState } from 'react';
|
|
2
3
|
import { FaShoppingBag, FaTimes, FaTrash } from 'react-icons/fa';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
import { CTAButton } from '../shared/CTAButton/CTAButton';
|
|
5
6
|
import { SpriteFromAtlas } from '../shared/SpriteFromAtlas';
|
|
6
|
-
|
|
7
|
+
|
|
7
8
|
|
|
8
9
|
interface ICartViewProps {
|
|
9
10
|
cartItems: { item: IStoreItem; quantity: number }[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemRarities, ItemSubType, ItemType } from '@rpg-engine/shared';
|
|
1
|
+
import { IItemPack, IStoreItem, IStoreProps, ItemRarities, ItemSubType, ItemType } from '@rpg-engine/shared';
|
|
2
2
|
import React, { useMemo, useState } from 'react';
|
|
3
3
|
import { FaShoppingCart } from 'react-icons/fa';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -12,7 +12,6 @@ import { useStoreCart } from './hooks/useStoreCart';
|
|
|
12
12
|
import { StoreItemsSection } from './sections/StoreItemsSection';
|
|
13
13
|
import { StorePacksSection } from './sections/StorePacksSection';
|
|
14
14
|
import { StoreItemDetails } from './StoreItemDetails';
|
|
15
|
-
import { IItemPack, IStoreItem, IStoreProps } from './StoreTypes';
|
|
16
15
|
|
|
17
16
|
export const Store: React.FC<IStoreProps> = ({
|
|
18
17
|
items,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { IItemPack, IStoreItem } from '@rpg-engine/shared';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { FaArrowLeft, FaCartPlus } from 'react-icons/fa';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
import { CTAButton } from '../shared/CTAButton/CTAButton';
|
|
5
|
-
import { IItemPack, IStoreItem } from './StoreTypes';
|
|
6
6
|
|
|
7
7
|
interface IStoreItemDetailsProps {
|
|
8
8
|
item: IStoreItem | (IItemPack & { name: string; texturePath: string });
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { UserAccountTypes } from '@rpg-engine/shared';
|
|
1
|
+
import { IStoreItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { FaCartPlus } from 'react-icons/fa';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { SelectArrow } from '../Arrow/SelectArrow';
|
|
6
6
|
import { CTAButton } from '../shared/CTAButton/CTAButton';
|
|
7
7
|
import { SpriteFromAtlas } from '../shared/SpriteFromAtlas';
|
|
8
|
-
import { IStoreItem } from './StoreTypes';
|
|
9
8
|
|
|
10
9
|
interface IStoreItemRowProps {
|
|
11
10
|
item: IStoreItem;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
ICartItem,
|
|
4
3
|
IItemPack,
|
|
@@ -6,7 +5,8 @@ import {
|
|
|
6
5
|
IPurchaseUnit,
|
|
7
6
|
IStoreItem,
|
|
8
7
|
PurchaseType,
|
|
9
|
-
} from '
|
|
8
|
+
} from '@rpg-engine/shared';
|
|
9
|
+
import { useEffect, useRef, useState } from 'react';
|
|
10
10
|
|
|
11
11
|
interface IUseStoreCart {
|
|
12
12
|
cartItems: ICartItem[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UserAccountTypes } from '@rpg-engine/shared';
|
|
1
|
+
import { IStoreItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { ScrollableContent } from '../../shared/ScrollableContent/ScrollableContent';
|
|
4
4
|
import { StoreItemRow } from '../StoreItemRow';
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
|
|
7
7
|
interface IStoreItemsSectionProps {
|
|
8
8
|
items: IStoreItem[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { IItemPack } from '@rpg-engine/shared';
|
|
1
2
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
3
|
import { FaCartPlus } from 'react-icons/fa';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
import { CTAButton } from '../../shared/CTAButton/CTAButton';
|
|
5
6
|
import { ScrollableContent } from '../../shared/ScrollableContent/ScrollableContent';
|
|
6
7
|
import { ShoppingCardHorizontal } from '../../shared/ShoppingCart/CartCardHorizontal';
|
|
7
|
-
import { IItemPack } from '../StoreTypes';
|
|
8
8
|
|
|
9
9
|
interface IStorePacksSectionProps {
|
|
10
10
|
packs: IItemPack[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DailyTaskBlueprintMapVisitRegular, DailyTaskChallengeKillMobsBlueprint, DailyTaskRegularCraftFoodBlueprint, DailyTaskRegularCraftPotionsBlueprint, DailyTaskRegularKillMobsBlueprint, ICharacterDailyTask, RewardType, TaskDifficulty, TaskStatus, TaskType } from "@rpg-engine/shared";
|
|
2
2
|
|
|
3
3
|
export const mockTasks: ICharacterDailyTask[] = [
|
|
4
4
|
{
|
|
5
|
-
key:
|
|
5
|
+
key: DailyTaskRegularKillMobsBlueprint.HuntRats,
|
|
6
6
|
name: 'Kill Rats',
|
|
7
7
|
description: 'Eliminate 5 rats in the forest',
|
|
8
8
|
type: TaskType.KillMobs,
|
|
@@ -39,10 +39,11 @@ export const mockTasks: ICharacterDailyTask[] = [
|
|
|
39
39
|
texturePath: 'others/royal-chalice.png',
|
|
40
40
|
quantity: 100
|
|
41
41
|
}
|
|
42
|
-
]
|
|
42
|
+
],
|
|
43
|
+
tier: 0
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
|
-
key:
|
|
46
|
+
key: DailyTaskRegularCraftFoodBlueprint.CraftCheese,
|
|
46
47
|
name: 'Gather Resources',
|
|
47
48
|
description: 'Collect 10 pieces of wood',
|
|
48
49
|
type: TaskType.CollectItems,
|
|
@@ -79,10 +80,11 @@ export const mockTasks: ICharacterDailyTask[] = [
|
|
|
79
80
|
}
|
|
80
81
|
],
|
|
81
82
|
status: TaskStatus.InProgress,
|
|
82
|
-
claimed: false
|
|
83
|
+
claimed: false,
|
|
84
|
+
tier: 0
|
|
83
85
|
},
|
|
84
86
|
{
|
|
85
|
-
key:
|
|
87
|
+
key: DailyTaskChallengeKillMobsBlueprint.HuntEloraTheQueen,
|
|
86
88
|
name: 'Slay the Dragon',
|
|
87
89
|
description: 'Defeat the Queen Dragon',
|
|
88
90
|
type: TaskType.KillMobs,
|
|
@@ -119,10 +121,11 @@ export const mockTasks: ICharacterDailyTask[] = [
|
|
|
119
121
|
}
|
|
120
122
|
],
|
|
121
123
|
status: TaskStatus.NotStarted,
|
|
122
|
-
claimed: false
|
|
124
|
+
claimed: false,
|
|
125
|
+
tier: 0
|
|
123
126
|
},
|
|
124
127
|
{
|
|
125
|
-
key:
|
|
128
|
+
key: DailyTaskBlueprintMapVisitRegular.ExploreVillage,
|
|
126
129
|
name: "Village Ilya Explorer",
|
|
127
130
|
description: "Visit the key locations in the ilya village",
|
|
128
131
|
difficulty: TaskDifficulty.Regular,
|
|
@@ -160,10 +163,11 @@ export const mockTasks: ICharacterDailyTask[] = [
|
|
|
160
163
|
visitedMaps: { 'ilya': true, 'isle_of_origins': false, 'ilya-village-sewer': false, 'dungeon-ilya-01': true },
|
|
161
164
|
},
|
|
162
165
|
status: TaskStatus.InProgress,
|
|
163
|
-
claimed: false
|
|
166
|
+
claimed: false,
|
|
167
|
+
tier: 0
|
|
164
168
|
},
|
|
165
169
|
{
|
|
166
|
-
key:
|
|
170
|
+
key: DailyTaskRegularCraftPotionsBlueprint.CraftLifePotion,
|
|
167
171
|
name: 'Craft Potions',
|
|
168
172
|
description: 'Craft 5 health potions for the local alchemist',
|
|
169
173
|
type: TaskType.CraftItems,
|
|
@@ -210,6 +214,7 @@ export const mockTasks: ICharacterDailyTask[] = [
|
|
|
210
214
|
}
|
|
211
215
|
],
|
|
212
216
|
status: TaskStatus.Completed,
|
|
213
|
-
claimed: true
|
|
217
|
+
claimed: true,
|
|
218
|
+
tier: 0
|
|
214
219
|
},
|
|
215
220
|
];
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { UserAccountTypes } from '@rpg-engine/shared';
|
|
1
|
+
import { IItemPack, IPurchase, IStoreItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { RPGUIRoot } from '../../../components/RPGUI/RPGUIRoot';
|
|
5
5
|
import customSkinImage from '../../../components/Store/sections/images/custom-skin.png';
|
|
6
6
|
import { Store } from '../../../components/Store/Store';
|
|
7
|
-
import { IItemPack, IPurchase, IStoreItem } from '../../../components/Store/StoreTypes';
|
|
8
7
|
import itemsAtlasJSON from '../../../mocks/atlas/items/items.json';
|
|
9
8
|
import itemsAtlasIMG from '../../../mocks/atlas/items/items.png';
|
|
10
9
|
import { mockItems } from '../../../mocks/informationCenter.mocks';
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { IItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
|
-
export interface IStoreItem extends Omit<IItem, 'canSell'> {
|
|
3
|
-
price: number;
|
|
4
|
-
requiredAccountType?: UserAccountTypes[];
|
|
5
|
-
key: string;
|
|
6
|
-
name: string;
|
|
7
|
-
texturePath: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ICartItem {
|
|
10
|
-
item: IStoreItem;
|
|
11
|
-
quantity: number;
|
|
12
|
-
}
|
|
13
|
-
export interface IItemPack {
|
|
14
|
-
key: string;
|
|
15
|
-
title: string;
|
|
16
|
-
description: string;
|
|
17
|
-
priceUSD: number;
|
|
18
|
-
image: {
|
|
19
|
-
src: string;
|
|
20
|
-
default?: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface IStoreProps {
|
|
24
|
-
items: IStoreItem[];
|
|
25
|
-
packs?: IItemPack[];
|
|
26
|
-
atlasJSON: Record<string, any>;
|
|
27
|
-
atlasIMG: string;
|
|
28
|
-
onPurchase: (purchase: IPurchase) => void;
|
|
29
|
-
userAccountType: UserAccountTypes;
|
|
30
|
-
loading?: boolean;
|
|
31
|
-
error?: string;
|
|
32
|
-
initialSearchQuery?: string;
|
|
33
|
-
onClose?: () => void;
|
|
34
|
-
}
|
|
35
|
-
export declare enum PurchaseType {
|
|
36
|
-
PremiumAccount = "PremiumAccount",
|
|
37
|
-
Item = "Item",
|
|
38
|
-
Pack = "Pack"
|
|
39
|
-
}
|
|
40
|
-
export interface IPurchaseUnit {
|
|
41
|
-
purchaseKey: string;
|
|
42
|
-
qty: number;
|
|
43
|
-
type: PurchaseType;
|
|
44
|
-
name: string;
|
|
45
|
-
metadata?: Record<string, any>;
|
|
46
|
-
}
|
|
47
|
-
export interface IPurchase {
|
|
48
|
-
purchases: IPurchaseUnit[];
|
|
49
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { IItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
|
-
|
|
3
|
-
export interface IStoreItem extends Omit<IItem, 'canSell'> {
|
|
4
|
-
price: number;
|
|
5
|
-
requiredAccountType?: UserAccountTypes[];
|
|
6
|
-
key: string;
|
|
7
|
-
name: string;
|
|
8
|
-
texturePath: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface ICartItem {
|
|
12
|
-
item: IStoreItem;
|
|
13
|
-
quantity: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface IItemPack {
|
|
17
|
-
key: string;
|
|
18
|
-
title: string;
|
|
19
|
-
description: string;
|
|
20
|
-
priceUSD: number;
|
|
21
|
-
image: {
|
|
22
|
-
src: string;
|
|
23
|
-
default?: string;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface IStoreProps {
|
|
28
|
-
items: IStoreItem[];
|
|
29
|
-
packs?: IItemPack[];
|
|
30
|
-
atlasJSON: Record<string, any>;
|
|
31
|
-
atlasIMG: string;
|
|
32
|
-
onPurchase: (purchase: IPurchase) => void;
|
|
33
|
-
userAccountType: UserAccountTypes;
|
|
34
|
-
loading?: boolean;
|
|
35
|
-
error?: string;
|
|
36
|
-
initialSearchQuery?: string;
|
|
37
|
-
onClose?: () => void;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export enum PurchaseType {
|
|
41
|
-
PremiumAccount = 'PremiumAccount',
|
|
42
|
-
Item = 'Item',
|
|
43
|
-
Pack = 'Pack',
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface IPurchaseUnit {
|
|
47
|
-
purchaseKey: string;
|
|
48
|
-
qty: number;
|
|
49
|
-
type: PurchaseType;
|
|
50
|
-
name: string; // Adding name for better identification
|
|
51
|
-
metadata?: Record<string, any>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface IPurchase {
|
|
55
|
-
purchases: IPurchaseUnit[];
|
|
56
|
-
}
|