@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.
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 +18 -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 +18 -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 +12 -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,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
- var _useState = React.useState(tabs[0].id),
30706
- activeTab = _useState[0],
30707
- setActiveTab = _useState[1];
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: activeTab === tab.id,
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 setActiveTab(tab.id);
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 === activeTab;
30735
+ return tab.id === activeTabId;
30725
30736
  })) == null ? void 0 : _tabs$find.content));
30726
30737
  };
30727
30738
  var TableWrapper = /*#__PURE__*/styled__default.div.withConfig({