@rpg-engine/long-bow 0.8.6 → 0.8.8
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/InformationCenter/sections/bestiary/{BestiarySection.d.ts → InformationCenterBestiarySection.d.ts} +1 -1
- package/dist/components/InformationCenter/sections/faq/{FaqSection.d.ts → InformationCenterFaqSection.d.ts} +1 -1
- package/dist/components/InformationCenter/sections/items/{ItemsSection.d.ts → InformationCenterItemsSection.d.ts} +1 -1
- package/dist/components/InformationCenter/sections/tutorials/{TutorialsSection.d.ts → InformationCenterTutorialsSection.d.ts} +2 -1
- package/dist/components/Item/Inventory/ItemPropertyColorSelector.d.ts +10 -0
- package/dist/components/Item/Inventory/ItemPropertySimpleHandler.d.ts +10 -0
- package/dist/components/Store/CartView.d.ts +15 -0
- package/dist/components/Store/StoreItemDetails.d.ts +16 -0
- package/dist/components/Store/StoreItemRow.d.ts +1 -2
- package/dist/components/Store/StoreTypes.d.ts +33 -4
- package/dist/components/Store/hooks/useStoreCart.d.ts +14 -0
- package/dist/components/Store/sections/StoreItemsSection.d.ts +12 -0
- package/dist/components/Store/sections/StorePacksSection.d.ts +9 -0
- package/dist/components/shared/CTAButton/CTAButton.d.ts +13 -0
- package/dist/components/shared/Card/Card.d.ts +14 -0
- package/dist/components/shared/Ellipsis.d.ts +1 -1
- package/dist/components/shared/PaginatedContent/PaginatedContent.d.ts +3 -1
- package/dist/components/shared/ScrollableContent/ScrollableContent.d.ts +23 -0
- package/dist/components/shared/SearchBar/SearchBar.d.ts +2 -3
- package/dist/components/shared/SearchHeader/SearchHeader.d.ts +17 -0
- package/dist/components/shared/ShoppingCart/CartCard.d.ts +14 -0
- package/dist/components/shared/ShoppingCart/CartCardHorizontal.d.ts +13 -0
- package/dist/components/shared/SpriteFromAtlas.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +109 -44
- 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 +109 -45
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/UI/buttonsAndInputs/CTAButton.stories.d.ts +18 -0
- package/dist/stories/UI/dropdownsAndSelectors/ItemPropertyColorSelector.stories.d.ts +3 -0
- package/package.json +3 -2
- package/src/components/InformationCenter/InformationCenter.tsx +8 -8
- package/src/components/InformationCenter/InformationCenterTabView.tsx +0 -1
- package/src/components/InformationCenter/sections/bestiary/{BestiarySection.tsx → InformationCenterBestiarySection.tsx} +2 -1
- package/src/components/InformationCenter/sections/faq/InformationCenterFaqSection.tsx +81 -0
- package/src/components/InformationCenter/sections/items/{ItemsSection.tsx → InformationCenterItemsSection.tsx} +2 -10
- package/src/components/InformationCenter/sections/tutorials/InformationCenterTutorialsSection.tsx +135 -0
- package/src/components/Item/Inventory/ItemPropertyColorSelector.tsx +75 -0
- package/src/components/Item/Inventory/ItemPropertySimpleHandler.tsx +26 -0
- package/src/components/Item/Inventory/ItemSlotRenderer.tsx +1 -0
- package/src/components/Item/Inventory/itemContainerHelper.ts +10 -1
- package/src/components/Store/CartView.tsx +271 -0
- package/src/components/Store/Store.tsx +199 -96
- package/src/components/Store/StoreItemDetails.tsx +161 -0
- package/src/components/Store/StoreItemRow.tsx +24 -40
- package/src/components/Store/StoreTypes.ts +38 -4
- package/src/components/Store/hooks/useStoreCart.ts +121 -0
- package/src/components/Store/sections/StoreItemsSection.tsx +52 -0
- package/src/components/Store/sections/StorePacksSection.tsx +89 -0
- package/src/components/Store/sections/images/custom-skin.png +0 -0
- package/src/components/shared/CTAButton/CTAButton.tsx +127 -0
- package/src/components/shared/Card/Card.tsx +107 -0
- package/src/components/shared/Ellipsis.tsx +20 -22
- package/src/components/shared/PaginatedContent/PaginatedContent.tsx +48 -79
- package/src/components/shared/ScrollableContent/ScrollableContent.tsx +160 -0
- package/src/components/shared/SearchBar/SearchBar.tsx +43 -24
- package/src/components/shared/SearchHeader/SearchHeader.tsx +80 -0
- package/src/components/shared/ShoppingCart/CartCard.tsx +116 -0
- package/src/components/shared/ShoppingCart/CartCardHorizontal.tsx +120 -0
- package/src/components/shared/SpriteFromAtlas.tsx +59 -38
- package/src/index.tsx +1 -0
- package/src/mocks/itemContainer.mocks.ts +1 -0
- package/src/stories/Features/store/Store.stories.tsx +54 -4
- package/src/stories/UI/buttonsAndInputs/CTAButton.stories.tsx +77 -0
- package/src/stories/UI/dropdownsAndSelectors/ItemPropertyColorSelector.stories.tsx +77 -0
- package/dist/components/Store/InternalStoreTab.d.ts +0 -15
- package/dist/components/Store/StoreTabContent.d.ts +0 -14
- package/src/components/InformationCenter/sections/faq/FaqSection.tsx +0 -51
- package/src/components/InformationCenter/sections/tutorials/TutorialsSection.tsx +0 -144
- package/src/components/Store/InternalStoreTab.tsx +0 -142
- package/src/components/Store/StoreTabContent.tsx +0 -46
|
@@ -3,6 +3,7 @@ import { IVideoGuide } from '../../InformationCenter';
|
|
|
3
3
|
interface ITutorialsSectionProps {
|
|
4
4
|
videoGuides: IVideoGuide[];
|
|
5
5
|
initialSearchQuery: string;
|
|
6
|
+
tabId: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const
|
|
8
|
+
export declare const InformationCenterTutorialsSection: React.FC<ITutorialsSectionProps>;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
selectedColor: string;
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onConfirm: (color: string) => void;
|
|
7
|
+
onChange: (color: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const ColorSelector: React.FC<Props>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
selectedColor: string;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onConfirm: (color: string) => void;
|
|
7
|
+
onChange: (color: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const ItemPropertySimpleHandler: React.FC<Props>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IStoreItem } from './StoreTypes';
|
|
3
|
+
interface ICartViewProps {
|
|
4
|
+
cartItems: {
|
|
5
|
+
item: IStoreItem;
|
|
6
|
+
quantity: number;
|
|
7
|
+
}[];
|
|
8
|
+
onRemoveFromCart: (itemKey: string) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onPurchase: () => Promise<boolean>;
|
|
11
|
+
atlasJSON: Record<string, any>;
|
|
12
|
+
atlasIMG: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const CartView: React.FC<ICartViewProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IItemPack, IStoreItem } from './StoreTypes';
|
|
3
|
+
interface IStoreItemDetailsProps {
|
|
4
|
+
item: IStoreItem | (IItemPack & {
|
|
5
|
+
name: string;
|
|
6
|
+
texturePath: string;
|
|
7
|
+
});
|
|
8
|
+
imageUrl: string | {
|
|
9
|
+
src: string;
|
|
10
|
+
default?: string;
|
|
11
|
+
};
|
|
12
|
+
onBack: () => void;
|
|
13
|
+
onAddToCart: (item: IStoreItem) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const StoreItemDetails: React.FC<IStoreItemDetailsProps>;
|
|
16
|
+
export {};
|
|
@@ -5,8 +5,7 @@ interface IStoreItemRowProps {
|
|
|
5
5
|
item: IStoreItem;
|
|
6
6
|
atlasJSON: Record<string, any>;
|
|
7
7
|
atlasIMG: string;
|
|
8
|
-
|
|
9
|
-
userGold: number;
|
|
8
|
+
onAddToCart: (item: IStoreItem, quantity: number) => void;
|
|
10
9
|
userAccountType: UserAccountTypes;
|
|
11
10
|
}
|
|
12
11
|
export declare const StoreItemRow: React.FC<IStoreItemRowProps>;
|
|
@@ -1,19 +1,48 @@
|
|
|
1
1
|
import { IItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
export interface IStoreItem extends Omit<IItem, 'canSell'> {
|
|
3
3
|
price: number;
|
|
4
|
-
stock: number;
|
|
5
4
|
requiredAccountType?: UserAccountTypes[];
|
|
6
|
-
|
|
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
|
+
};
|
|
7
22
|
}
|
|
8
23
|
export interface IStoreProps {
|
|
9
24
|
items: IStoreItem[];
|
|
25
|
+
packs?: IItemPack[];
|
|
10
26
|
atlasJSON: Record<string, any>;
|
|
11
27
|
atlasIMG: string;
|
|
12
|
-
onPurchase: (
|
|
13
|
-
userGold: number;
|
|
28
|
+
onPurchase: (purchase: IPurchase) => void;
|
|
14
29
|
userAccountType: UserAccountTypes;
|
|
15
30
|
loading?: boolean;
|
|
16
31
|
error?: string;
|
|
17
32
|
initialSearchQuery?: string;
|
|
18
33
|
onClose?: () => void;
|
|
19
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
|
+
}
|
|
46
|
+
export interface IPurchase {
|
|
47
|
+
purchases: IPurchaseUnit[];
|
|
48
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICartItem, IPurchase, IStoreItem } from '../StoreTypes';
|
|
2
|
+
interface IUseStoreCart {
|
|
3
|
+
cartItems: ICartItem[];
|
|
4
|
+
isCartOpen: boolean;
|
|
5
|
+
handleAddToCart: (item: IStoreItem, quantity: number) => void;
|
|
6
|
+
handleRemoveFromCart: (itemKey: string) => void;
|
|
7
|
+
handlePurchase: (onPurchase: (purchase: IPurchase) => void) => void;
|
|
8
|
+
openCart: () => void;
|
|
9
|
+
closeCart: () => void;
|
|
10
|
+
getTotalItems: () => number;
|
|
11
|
+
getTotalPrice: () => number;
|
|
12
|
+
}
|
|
13
|
+
export declare const useStoreCart: () => IUseStoreCart;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UserAccountTypes } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IStoreItem } from '../StoreTypes';
|
|
4
|
+
interface IStoreItemsSectionProps {
|
|
5
|
+
items: IStoreItem[];
|
|
6
|
+
onAddToCart: (item: IStoreItem, quantity: number) => void;
|
|
7
|
+
atlasJSON: Record<string, any>;
|
|
8
|
+
atlasIMG: string;
|
|
9
|
+
userAccountType?: UserAccountTypes;
|
|
10
|
+
}
|
|
11
|
+
export declare const StoreItemsSection: React.FC<IStoreItemsSectionProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IItemPack } from '../StoreTypes';
|
|
3
|
+
interface IStorePacksSectionProps {
|
|
4
|
+
packs: IItemPack[];
|
|
5
|
+
onAddToCart: (pack: IItemPack) => void;
|
|
6
|
+
onSelectPack?: (pack: IItemPack) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const StorePacksSection: React.FC<IStorePacksSectionProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ICTAButtonProps {
|
|
3
|
+
icon: React.ReactNode;
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
textColor?: string;
|
|
9
|
+
iconColor?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const CTAButton: React.FC<ICTAButtonProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ICardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
imageUrl?: string | {
|
|
6
|
+
src: string;
|
|
7
|
+
default?: string;
|
|
8
|
+
};
|
|
9
|
+
category?: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
footer?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ShoppingCard: React.FC<ICardProps>;
|
|
@@ -19,6 +19,8 @@ interface IPaginatedContentProps<T> {
|
|
|
19
19
|
dependencies?: any[];
|
|
20
20
|
tabId?: string;
|
|
21
21
|
layout?: 'grid' | 'list';
|
|
22
|
+
gridColumns?: number;
|
|
23
|
+
itemHeight?: string;
|
|
22
24
|
}
|
|
23
|
-
export declare const PaginatedContent: <T extends unknown>({ items, itemsPerPage, renderItem, emptyMessage, className, filterOptions, searchOptions, dependencies, tabId, layout, }: IPaginatedContentProps<T>) => React.ReactElement;
|
|
25
|
+
export declare const PaginatedContent: <T extends unknown>({ items, itemsPerPage, renderItem, emptyMessage, className, filterOptions, searchOptions, dependencies, tabId, layout, gridColumns, itemHeight, }: IPaginatedContentProps<T>) => React.ReactElement;
|
|
24
26
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IOptionsProps } from '../../Dropdown';
|
|
3
|
+
interface IScrollableContentProps<T> {
|
|
4
|
+
items: T[];
|
|
5
|
+
renderItem: (item: T) => React.ReactNode;
|
|
6
|
+
emptyMessage?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
filterOptions?: {
|
|
9
|
+
options: IOptionsProps[];
|
|
10
|
+
selectedOption: string;
|
|
11
|
+
onOptionChange: (value: string) => void;
|
|
12
|
+
};
|
|
13
|
+
searchOptions?: {
|
|
14
|
+
value: string;
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
};
|
|
18
|
+
layout?: 'grid' | 'list';
|
|
19
|
+
gridColumns?: number;
|
|
20
|
+
maxHeight?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const ScrollableContent: <T extends unknown>({ items, renderItem, emptyMessage, className, filterOptions, searchOptions, layout, gridColumns, maxHeight, }: IScrollableContentProps<T>) => React.ReactElement;
|
|
23
|
+
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
interface ISearchBarProps {
|
|
3
3
|
value: string;
|
|
4
4
|
onChange: (value: string) => void;
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
className?: string;
|
|
7
|
-
autoFocus?: boolean;
|
|
8
7
|
}
|
|
9
|
-
export declare const SearchBar: React.FC<
|
|
8
|
+
export declare const SearchBar: React.FC<ISearchBarProps>;
|
|
10
9
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IOptionsProps } from '../../Dropdown';
|
|
3
|
+
interface ISearchHeaderProps {
|
|
4
|
+
searchOptions?: {
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
};
|
|
9
|
+
filterOptions?: {
|
|
10
|
+
options: IOptionsProps[];
|
|
11
|
+
selectedOption: string;
|
|
12
|
+
onOptionChange: (value: string) => void;
|
|
13
|
+
};
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const SearchHeader: React.FC<ISearchHeaderProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ICardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
imageUrl?: string | {
|
|
6
|
+
src: string;
|
|
7
|
+
default?: string;
|
|
8
|
+
};
|
|
9
|
+
category?: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
footer?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ShoppingCard: React.FC<ICardProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ICardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
imageUrl?: string | {
|
|
6
|
+
src: string;
|
|
7
|
+
default?: string;
|
|
8
|
+
};
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
footer?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const ShoppingCardHorizontal: React.FC<ICardProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './components/Input';
|
|
|
22
22
|
export * from './components/InternalTabs/InternalTabs';
|
|
23
23
|
export { ErrorBoundary } from './components/Item/Inventory/ErrorBoundary';
|
|
24
24
|
export * from './components/Item/Inventory/ItemContainer';
|
|
25
|
+
export * from './components/Item/Inventory/ItemPropertySimpleHandler';
|
|
25
26
|
export * from './components/Item/Inventory/ItemQuantitySelectorModal';
|
|
26
27
|
export * from './components/Item/Inventory/ItemSlot';
|
|
27
28
|
export * from './components/itemSelector/ItemSelector';
|