@rpg-engine/long-bow 0.8.4 → 0.8.5
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 +19 -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 +19 -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 +13 -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,18 @@ var generateContextMenu = function generateContextMenu(item, itemContainerType,
|
|
|
27797
27797
|
text: 'Withdraw'
|
|
27798
27798
|
}];
|
|
27799
27799
|
}
|
|
27800
|
+
console.log(item.type === shared.ItemType.Container);
|
|
27801
|
+
if (item.type === shared.ItemType.Container) {
|
|
27802
|
+
var existInContextAction = contextActionMenu.some(function (item) {
|
|
27803
|
+
return item.text === shared.DepotSocketEvents.OpenContainer || item.id === shared.ItemSocketEvents.ContainerOpen || item.text === 'Open';
|
|
27804
|
+
});
|
|
27805
|
+
if (!existInContextAction) {
|
|
27806
|
+
contextActionMenu.push({
|
|
27807
|
+
id: shared.DepotSocketEvents.OpenContainer,
|
|
27808
|
+
text: 'Open'
|
|
27809
|
+
});
|
|
27810
|
+
}
|
|
27811
|
+
}
|
|
27800
27812
|
return contextActionMenu;
|
|
27801
27813
|
};
|
|
27802
27814
|
|
|
@@ -30701,27 +30713,27 @@ var InternalTabs = function InternalTabs(_ref) {
|
|
|
30701
30713
|
_ref$borderColor = _ref.borderColor,
|
|
30702
30714
|
borderColor = _ref$borderColor === void 0 ? '#f59e0b' : _ref$borderColor,
|
|
30703
30715
|
_ref$hoverColor = _ref.hoverColor,
|
|
30704
|
-
hoverColor = _ref$hoverColor === void 0 ? '#fef3c7' : _ref$hoverColor
|
|
30705
|
-
|
|
30706
|
-
|
|
30707
|
-
|
|
30716
|
+
hoverColor = _ref$hoverColor === void 0 ? '#fef3c7' : _ref$hoverColor,
|
|
30717
|
+
onTabChange = _ref.onTabChange,
|
|
30718
|
+
externalActiveTab = _ref.activeTab;
|
|
30719
|
+
var activeTabId = externalActiveTab != null ? externalActiveTab : tabs[0].id;
|
|
30708
30720
|
return React__default.createElement(TableWrapper, null, React__default.createElement(TabHeader, {
|
|
30709
30721
|
borderColor: borderColor
|
|
30710
30722
|
}, tabs.map(function (tab) {
|
|
30711
30723
|
return React__default.createElement(TabButton, {
|
|
30712
30724
|
key: tab.id,
|
|
30713
|
-
active:
|
|
30725
|
+
active: activeTabId === tab.id,
|
|
30714
30726
|
activeColor: activeColor,
|
|
30715
30727
|
activeTextColor: activeTextColor,
|
|
30716
30728
|
inactiveColor: inactiveColor,
|
|
30717
30729
|
borderColor: borderColor,
|
|
30718
30730
|
hoverColor: hoverColor,
|
|
30719
30731
|
onClick: function onClick() {
|
|
30720
|
-
return
|
|
30732
|
+
return onTabChange == null ? void 0 : onTabChange(tab.id);
|
|
30721
30733
|
}
|
|
30722
30734
|
}, tab.title);
|
|
30723
30735
|
})), React__default.createElement(ContentWrapper, null, (_tabs$find = tabs.find(function (tab) {
|
|
30724
|
-
return tab.id ===
|
|
30736
|
+
return tab.id === activeTabId;
|
|
30725
30737
|
})) == null ? void 0 : _tabs$find.content));
|
|
30726
30738
|
};
|
|
30727
30739
|
var TableWrapper = /*#__PURE__*/styled__default.div.withConfig({
|