@rpg-engine/long-bow 0.8.71 → 0.8.73
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 +7 -6
- package/dist/components/Store/Store.d.ts +2 -2
- package/dist/components/Store/StoreCharacterSkinRow.d.ts +3 -3
- package/dist/components/Store/StoreItemDetails.d.ts +3 -3
- package/dist/components/Store/StoreItemRow.d.ts +4 -3
- package/dist/components/Store/hooks/useStoreCart.d.ts +5 -3
- package/dist/components/Store/hooks/useStoreMetadata.d.ts +3 -3
- package/dist/components/Store/sections/StoreItemsSection.d.ts +3 -3
- package/dist/hooks/useCharacterSkinNavigation.d.ts +7 -0
- package/dist/hooks/usePackFiltering.d.ts +7 -0
- package/dist/hooks/useQuantityControl.d.ts +10 -0
- package/dist/hooks/useStoreFiltering.d.ts +11 -0
- package/dist/long-bow.cjs.development.js +264 -112
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +265 -113
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Store/CartView.tsx +9 -6
- package/src/components/Store/Store.tsx +13 -21
- package/src/components/Store/StoreCharacterSkinRow.tsx +64 -46
- package/src/components/Store/StoreItemDetails.tsx +4 -4
- package/src/components/Store/StoreItemRow.tsx +64 -56
- package/src/components/Store/hooks/useStoreCart.ts +14 -9
- package/src/components/Store/hooks/useStoreMetadata.ts +5 -5
- package/src/components/Store/sections/StoreItemsSection.tsx +78 -27
- package/src/components/Store/sections/StorePacksSection.tsx +5 -10
- package/src/hooks/useCharacterSkinNavigation.ts +34 -0
- package/src/hooks/usePackFiltering.ts +20 -0
- package/src/hooks/useQuantityControl.ts +41 -0
- package/src/hooks/useStoreFiltering.ts +51 -0
- package/src/mocks/dailyTasks.mocks.ts +6 -6
- package/src/stories/Features/store/Store.stories.tsx +59 -72
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IProductBlueprint } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
interface ICartItem {
|
|
4
|
+
item: IProductBlueprint;
|
|
5
|
+
quantity: number;
|
|
6
|
+
metadata?: Record<string, any>;
|
|
7
|
+
}
|
|
3
8
|
interface ICartViewProps {
|
|
4
|
-
cartItems:
|
|
5
|
-
item: IStoreItem;
|
|
6
|
-
quantity: number;
|
|
7
|
-
metadata?: Record<string, any>;
|
|
8
|
-
}[];
|
|
9
|
+
cartItems: ICartItem[];
|
|
9
10
|
onRemoveFromCart: (itemKey: string) => void;
|
|
10
11
|
onClose: () => void;
|
|
11
12
|
onPurchase: () => Promise<boolean>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IItemPack, IPurchase,
|
|
1
|
+
import { IItemPack, IPurchase, IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare type TabId = 'premium' | 'packs' | 'items';
|
|
4
4
|
export interface IStoreProps {
|
|
5
|
-
items:
|
|
5
|
+
items: IProductBlueprint[];
|
|
6
6
|
packs?: IItemPack[];
|
|
7
7
|
atlasJSON: any;
|
|
8
8
|
atlasIMG: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface IStoreCharacterSkinRowProps {
|
|
4
|
-
item:
|
|
4
|
+
item: IProductBlueprint;
|
|
5
5
|
atlasJSON: Record<string, any>;
|
|
6
6
|
atlasIMG: string;
|
|
7
|
-
onAddToCart: (item:
|
|
7
|
+
onAddToCart: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
8
8
|
userAccountType: UserAccountTypes;
|
|
9
9
|
}
|
|
10
10
|
export declare const StoreCharacterSkinRow: React.FC<IStoreCharacterSkinRowProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IItemPack,
|
|
1
|
+
import { IItemPack, IProductBlueprint } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface IStoreItemDetailsProps {
|
|
4
|
-
item:
|
|
4
|
+
item: IProductBlueprint | (IItemPack & {
|
|
5
5
|
name: string;
|
|
6
6
|
texturePath: string;
|
|
7
7
|
});
|
|
@@ -10,7 +10,7 @@ interface IStoreItemDetailsProps {
|
|
|
10
10
|
default?: string;
|
|
11
11
|
};
|
|
12
12
|
onBack: () => void;
|
|
13
|
-
onAddToCart: (item:
|
|
13
|
+
onAddToCart: (item: IProductBlueprint) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const StoreItemDetails: React.FC<IStoreItemDetailsProps>;
|
|
16
16
|
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface IStoreItemRowProps {
|
|
4
|
-
item:
|
|
4
|
+
item: IProductBlueprint;
|
|
5
5
|
atlasJSON: Record<string, any>;
|
|
6
6
|
atlasIMG: string;
|
|
7
|
-
onAddToCart: (item:
|
|
7
|
+
onAddToCart: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
8
8
|
userAccountType: UserAccountTypes;
|
|
9
9
|
showTextInput?: boolean;
|
|
10
|
+
textInputPlaceholder?: string;
|
|
10
11
|
}
|
|
11
12
|
export declare const StoreItemRow: React.FC<IStoreItemRowProps>;
|
|
12
13
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface ICartItem
|
|
1
|
+
import { IPurchase, IProductBlueprint } from '@rpg-engine/shared';
|
|
2
|
+
interface ICartItem {
|
|
3
|
+
item: IProductBlueprint;
|
|
4
|
+
quantity: number;
|
|
3
5
|
metadata?: Record<string, any>;
|
|
4
6
|
}
|
|
5
7
|
interface IUseStoreCart {
|
|
6
8
|
cartItems: ICartItem[];
|
|
7
9
|
isCartOpen: boolean;
|
|
8
|
-
handleAddToCart: (item:
|
|
10
|
+
handleAddToCart: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
9
11
|
handleRemoveFromCart: (itemKey: string) => void;
|
|
10
12
|
handlePurchase: (onPurchase: (purchase: IPurchase) => void) => void;
|
|
11
13
|
openCart: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IProductBlueprint } from "@rpg-engine/shared";
|
|
2
2
|
interface IUseStoreMetadata {
|
|
3
|
-
collectMetadata: (item:
|
|
3
|
+
collectMetadata: (item: IProductBlueprint) => Promise<Record<string, any> | null>;
|
|
4
4
|
isCollectingMetadata: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const useStoreMetadata: () => IUseStoreMetadata;
|
|
@@ -8,7 +8,7 @@ declare global {
|
|
|
8
8
|
interface Window {
|
|
9
9
|
__metadataResolvers?: {
|
|
10
10
|
resolve: (metadata: Record<string, any> | null) => void;
|
|
11
|
-
item:
|
|
11
|
+
item: IProductBlueprint;
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface IStoreItemsSectionProps {
|
|
4
|
-
items:
|
|
5
|
-
onAddToCart: (item:
|
|
4
|
+
items: IProductBlueprint[];
|
|
5
|
+
onAddToCart: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
6
6
|
atlasJSON: Record<string, any>;
|
|
7
7
|
atlasIMG: string;
|
|
8
8
|
userAccountType?: UserAccountTypes;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICharacterProps } from '../components/Character/CharacterSelection';
|
|
2
|
+
export declare const useCharacterSkinNavigation: (availableCharacters: ICharacterProps[], itemKey: string) => {
|
|
3
|
+
currentIndex: number;
|
|
4
|
+
currentCharacter: ICharacterProps;
|
|
5
|
+
handlePreviousSkin: () => void;
|
|
6
|
+
handleNextSkin: () => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IItemPack } from '@rpg-engine/shared';
|
|
3
|
+
export declare const usePackFiltering: (packs: IItemPack[]) => {
|
|
4
|
+
searchQuery: string;
|
|
5
|
+
setSearchQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
6
|
+
filteredPacks: IItemPack[];
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const useQuantityControl: (initialQuantity?: number, min?: number, max?: number) => {
|
|
3
|
+
quantity: number;
|
|
4
|
+
setQuantity: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
5
|
+
handleQuantityChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
handleBlur: () => void;
|
|
7
|
+
incrementQuantity: () => void;
|
|
8
|
+
decrementQuantity: () => void;
|
|
9
|
+
resetQuantity: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IProductBlueprint, ItemType } from '@rpg-engine/shared';
|
|
3
|
+
import { IOptionsProps } from '../components/Dropdown';
|
|
4
|
+
export declare const useStoreFiltering: (items: IProductBlueprint[]) => {
|
|
5
|
+
searchQuery: string;
|
|
6
|
+
setSearchQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
7
|
+
selectedCategory: ItemType | "all";
|
|
8
|
+
setSelectedCategory: import("react").Dispatch<import("react").SetStateAction<ItemType | "all">>;
|
|
9
|
+
categoryOptions: IOptionsProps[];
|
|
10
|
+
filteredItems: IProductBlueprint[];
|
|
11
|
+
};
|