@rpg-engine/long-bow 0.8.4 → 0.8.6
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 +1 -0
- package/dist/components/InformationCenter/sections/faq/FaqSection.d.ts +1 -0
- package/dist/components/InformationCenter/sections/items/ItemsSection.d.ts +1 -0
- package/dist/components/InternalTabs/InternalTabs.d.ts +2 -0
- package/dist/components/Store/InternalStoreTab.d.ts +15 -0
- package/dist/components/Store/Store.d.ts +3 -0
- package/dist/components/Store/StoreItemRow.d.ts +13 -0
- package/dist/components/Store/StoreTabContent.d.ts +14 -0
- package/dist/components/Store/StoreTypes.d.ts +19 -0
- package/dist/components/shared/PaginatedContent/PaginatedContent.d.ts +24 -0
- package/dist/long-bow.cjs.development.js +18 -7
- 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 +18 -7
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Features/store/Store.stories.d.ts +1 -0
- package/dist/utils/itemUtils.d.ts +8 -0
- package/package.json +1 -1
- package/src/components/InformationCenter/InformationCenter.tsx +15 -1
- package/src/components/InformationCenter/InformationCenterCell.tsx +7 -0
- package/src/components/InformationCenter/sections/bestiary/BestiarySection.tsx +31 -42
- package/src/components/InformationCenter/sections/faq/FaqSection.tsx +14 -34
- package/src/components/InformationCenter/sections/items/ItemsSection.tsx +40 -40
- package/src/components/InternalTabs/InternalTabs.tsx +9 -5
- package/src/components/Item/Inventory/itemContainerHelper.ts +12 -0
- package/src/components/Store/InternalStoreTab.tsx +142 -0
- package/src/components/Store/Store.tsx +192 -0
- package/src/components/Store/StoreItemRow.tsx +198 -0
- package/src/components/Store/StoreTabContent.tsx +46 -0
- package/src/components/Store/StoreTypes.ts +21 -0
- package/src/components/shared/PaginatedContent/PaginatedContent.tsx +182 -0
- package/src/stories/Features/store/Store.stories.tsx +102 -0
- package/src/utils/itemUtils.ts +36 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ItemType, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IStoreItem } from './StoreTypes';
|
|
4
|
+
interface IInternalStoreTabProps {
|
|
5
|
+
items: IStoreItem[];
|
|
6
|
+
atlasJSON: Record<string, any>;
|
|
7
|
+
atlasIMG: string;
|
|
8
|
+
onPurchase: (item: IStoreItem, quantity: number) => void;
|
|
9
|
+
userGold: number;
|
|
10
|
+
userAccountType: UserAccountTypes;
|
|
11
|
+
type?: ItemType | 'premium' | 'all';
|
|
12
|
+
initialSearchQuery?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const InternalStoreTab: React.FC<IInternalStoreTabProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UserAccountTypes } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IStoreItem } from './StoreTypes';
|
|
4
|
+
interface IStoreItemRowProps {
|
|
5
|
+
item: IStoreItem;
|
|
6
|
+
atlasJSON: Record<string, any>;
|
|
7
|
+
atlasIMG: string;
|
|
8
|
+
onPurchase: (item: IStoreItem, quantity: number) => void;
|
|
9
|
+
userGold: number;
|
|
10
|
+
userAccountType: UserAccountTypes;
|
|
11
|
+
}
|
|
12
|
+
export declare const StoreItemRow: React.FC<IStoreItemRowProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UserAccountTypes } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IStoreItem } from './StoreTypes';
|
|
4
|
+
interface IStoreTabContentProps {
|
|
5
|
+
items: IStoreItem[];
|
|
6
|
+
atlasJSON: Record<string, any>;
|
|
7
|
+
atlasIMG: string;
|
|
8
|
+
onPurchase: (item: IStoreItem, quantity: number) => void;
|
|
9
|
+
userGold: number;
|
|
10
|
+
userAccountType: UserAccountTypes;
|
|
11
|
+
tabId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const StoreTabContent: React.FC<IStoreTabContentProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IItem, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
|
+
export interface IStoreItem extends Omit<IItem, 'canSell'> {
|
|
3
|
+
price: number;
|
|
4
|
+
stock: number;
|
|
5
|
+
requiredAccountType?: UserAccountTypes[];
|
|
6
|
+
canSell: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface IStoreProps {
|
|
9
|
+
items: IStoreItem[];
|
|
10
|
+
atlasJSON: Record<string, any>;
|
|
11
|
+
atlasIMG: string;
|
|
12
|
+
onPurchase: (item: IStoreItem, quantity: number) => void;
|
|
13
|
+
userGold: number;
|
|
14
|
+
userAccountType: UserAccountTypes;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
initialSearchQuery?: string;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IOptionsProps } from '../../Dropdown';
|
|
3
|
+
interface IPaginatedContentProps<T> {
|
|
4
|
+
items: T[];
|
|
5
|
+
itemsPerPage?: number;
|
|
6
|
+
renderItem: (item: T) => React.ReactNode;
|
|
7
|
+
emptyMessage?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
filterOptions?: {
|
|
10
|
+
options: IOptionsProps[];
|
|
11
|
+
selectedOption: string;
|
|
12
|
+
onOptionChange: (value: string) => void;
|
|
13
|
+
};
|
|
14
|
+
searchOptions?: {
|
|
15
|
+
value: string;
|
|
16
|
+
onChange: (value: string) => void;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
};
|
|
19
|
+
dependencies?: any[];
|
|
20
|
+
tabId?: string;
|
|
21
|
+
layout?: 'grid' | 'list';
|
|
22
|
+
}
|
|
23
|
+
export declare const PaginatedContent: <T extends unknown>({ items, itemsPerPage, renderItem, emptyMessage, className, filterOptions, searchOptions, dependencies, tabId, layout, }: IPaginatedContentProps<T>) => React.ReactElement;
|
|
24
|
+
export {};
|
|
@@ -27797,6 +27797,17 @@ var generateContextMenu = function generateContextMenu(item, itemContainerType,
|
|
|
27797
27797
|
text: 'Withdraw'
|
|
27798
27798
|
}];
|
|
27799
27799
|
}
|
|
27800
|
+
if (item.type && item.type === shared.ItemType.Container) {
|
|
27801
|
+
var existInContextAction = contextActionMenu.some(function (item) {
|
|
27802
|
+
return item.text === shared.DepotSocketEvents.OpenContainer || item.id === shared.ItemSocketEvents.ContainerOpen || item.text === 'Open';
|
|
27803
|
+
});
|
|
27804
|
+
if (!existInContextAction) {
|
|
27805
|
+
contextActionMenu.push({
|
|
27806
|
+
id: shared.DepotSocketEvents.OpenContainer,
|
|
27807
|
+
text: 'Open'
|
|
27808
|
+
});
|
|
27809
|
+
}
|
|
27810
|
+
}
|
|
27800
27811
|
return contextActionMenu;
|
|
27801
27812
|
};
|
|
27802
27813
|
|
|
@@ -30701,27 +30712,27 @@ var InternalTabs = function InternalTabs(_ref) {
|
|
|
30701
30712
|
_ref$borderColor = _ref.borderColor,
|
|
30702
30713
|
borderColor = _ref$borderColor === void 0 ? '#f59e0b' : _ref$borderColor,
|
|
30703
30714
|
_ref$hoverColor = _ref.hoverColor,
|
|
30704
|
-
hoverColor = _ref$hoverColor === void 0 ? '#fef3c7' : _ref$hoverColor
|
|
30705
|
-
|
|
30706
|
-
|
|
30707
|
-
|
|
30715
|
+
hoverColor = _ref$hoverColor === void 0 ? '#fef3c7' : _ref$hoverColor,
|
|
30716
|
+
onTabChange = _ref.onTabChange,
|
|
30717
|
+
externalActiveTab = _ref.activeTab;
|
|
30718
|
+
var activeTabId = externalActiveTab != null ? externalActiveTab : tabs[0].id;
|
|
30708
30719
|
return React__default.createElement(TableWrapper, null, React__default.createElement(TabHeader, {
|
|
30709
30720
|
borderColor: borderColor
|
|
30710
30721
|
}, tabs.map(function (tab) {
|
|
30711
30722
|
return React__default.createElement(TabButton, {
|
|
30712
30723
|
key: tab.id,
|
|
30713
|
-
active:
|
|
30724
|
+
active: activeTabId === tab.id,
|
|
30714
30725
|
activeColor: activeColor,
|
|
30715
30726
|
activeTextColor: activeTextColor,
|
|
30716
30727
|
inactiveColor: inactiveColor,
|
|
30717
30728
|
borderColor: borderColor,
|
|
30718
30729
|
hoverColor: hoverColor,
|
|
30719
30730
|
onClick: function onClick() {
|
|
30720
|
-
return
|
|
30731
|
+
return onTabChange == null ? void 0 : onTabChange(tab.id);
|
|
30721
30732
|
}
|
|
30722
30733
|
}, tab.title);
|
|
30723
30734
|
})), React__default.createElement(ContentWrapper, null, (_tabs$find = tabs.find(function (tab) {
|
|
30724
|
-
return tab.id ===
|
|
30735
|
+
return tab.id === activeTabId;
|
|
30725
30736
|
})) == null ? void 0 : _tabs$find.content));
|
|
30726
30737
|
};
|
|
30727
30738
|
var TableWrapper = /*#__PURE__*/styled__default.div.withConfig({
|