@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.
Files changed (34) hide show
  1. package/dist/components/InformationCenter/sections/bestiary/BestiarySection.d.ts +1 -0
  2. package/dist/components/InformationCenter/sections/faq/FaqSection.d.ts +1 -0
  3. package/dist/components/InformationCenter/sections/items/ItemsSection.d.ts +1 -0
  4. package/dist/components/InternalTabs/InternalTabs.d.ts +2 -0
  5. package/dist/components/Store/InternalStoreTab.d.ts +15 -0
  6. package/dist/components/Store/Store.d.ts +3 -0
  7. package/dist/components/Store/StoreItemRow.d.ts +13 -0
  8. package/dist/components/Store/StoreTabContent.d.ts +14 -0
  9. package/dist/components/Store/StoreTypes.d.ts +19 -0
  10. package/dist/components/shared/PaginatedContent/PaginatedContent.d.ts +24 -0
  11. package/dist/long-bow.cjs.development.js +19 -7
  12. package/dist/long-bow.cjs.development.js.map +1 -1
  13. package/dist/long-bow.cjs.production.min.js +1 -1
  14. package/dist/long-bow.cjs.production.min.js.map +1 -1
  15. package/dist/long-bow.esm.js +19 -7
  16. package/dist/long-bow.esm.js.map +1 -1
  17. package/dist/stories/Features/store/Store.stories.d.ts +1 -0
  18. package/dist/utils/itemUtils.d.ts +8 -0
  19. package/package.json +1 -1
  20. package/src/components/InformationCenter/InformationCenter.tsx +15 -1
  21. package/src/components/InformationCenter/InformationCenterCell.tsx +7 -0
  22. package/src/components/InformationCenter/sections/bestiary/BestiarySection.tsx +31 -42
  23. package/src/components/InformationCenter/sections/faq/FaqSection.tsx +14 -34
  24. package/src/components/InformationCenter/sections/items/ItemsSection.tsx +40 -40
  25. package/src/components/InternalTabs/InternalTabs.tsx +9 -5
  26. package/src/components/Item/Inventory/itemContainerHelper.ts +13 -0
  27. package/src/components/Store/InternalStoreTab.tsx +142 -0
  28. package/src/components/Store/Store.tsx +192 -0
  29. package/src/components/Store/StoreItemRow.tsx +198 -0
  30. package/src/components/Store/StoreTabContent.tsx +46 -0
  31. package/src/components/Store/StoreTypes.ts +21 -0
  32. package/src/components/shared/PaginatedContent/PaginatedContent.tsx +182 -0
  33. package/src/stories/Features/store/Store.stories.tsx +102 -0
  34. package/src/utils/itemUtils.ts +36 -0
@@ -7,6 +7,7 @@ interface IBestiarySectionProps {
7
7
  entitiesAtlasJSON: Record<string, any>;
8
8
  entitiesAtlasIMG: string;
9
9
  initialSearchQuery: string;
10
+ tabId: string;
10
11
  }
11
12
  export declare const BestiarySection: React.FC<IBestiarySectionProps>;
12
13
  export {};
@@ -3,6 +3,7 @@ import { IFaqItem } from '../../InformationCenter';
3
3
  interface IFaqSectionProps {
4
4
  faqItems: IFaqItem[];
5
5
  initialSearchQuery: string;
6
+ tabId: string;
6
7
  }
7
8
  export declare const FaqSection: React.FC<IFaqSectionProps>;
8
9
  export {};
@@ -6,6 +6,7 @@ interface IItemsSectionProps {
6
6
  itemsAtlasJSON: Record<string, any>;
7
7
  itemsAtlasIMG: string;
8
8
  initialSearchQuery: string;
9
+ tabId: string;
9
10
  }
10
11
  export declare const ItemsSection: React.FC<IItemsSectionProps>;
11
12
  export {};
@@ -11,6 +11,8 @@ export interface TableTabProps {
11
11
  inactiveColor?: string;
12
12
  borderColor?: string;
13
13
  hoverColor?: string;
14
+ onTabChange?: (tabId: string) => void;
15
+ activeTab?: string;
14
16
  }
15
17
  export declare const InternalTabs: React.FC<TableTabProps>;
16
18
  export {};
@@ -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,3 @@
1
+ import React from 'react';
2
+ import { IStoreProps } from './StoreTypes';
3
+ export declare const Store: React.FC<IStoreProps>;
@@ -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
- var _useState = React.useState(tabs[0].id),
30706
- activeTab = _useState[0],
30707
- setActiveTab = _useState[1];
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: activeTab === tab.id,
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 setActiveTab(tab.id);
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 === activeTab;
30736
+ return tab.id === activeTabId;
30725
30737
  })) == null ? void 0 : _tabs$find.content));
30726
30738
  };
30727
30739
  var TableWrapper = /*#__PURE__*/styled__default.div.withConfig({