@rpg-engine/long-bow 0.8.129 → 0.8.131
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/Store/Store.d.ts +4 -1
- package/dist/long-bow.cjs.development.js +60 -92
- 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 +61 -93
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Store/Store.tsx +28 -8
- package/src/components/Store/sections/StorePacksSection.tsx +86 -36
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IItemPack, IPurchase, IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
declare type TabId = 'premium' | 'packs' | 'items';
|
|
3
|
+
declare type TabId = 'premium' | 'packs' | 'items' | 'wallet';
|
|
4
4
|
export interface IStoreProps {
|
|
5
5
|
items: IProductBlueprint[];
|
|
6
6
|
packs?: IItemPack[];
|
|
@@ -8,6 +8,8 @@ export interface IStoreProps {
|
|
|
8
8
|
atlasIMG: string;
|
|
9
9
|
onPurchase: (purchase: Partial<IPurchase>) => Promise<boolean>;
|
|
10
10
|
onShowHistory?: () => void;
|
|
11
|
+
onShowWallet?: () => void;
|
|
12
|
+
walletLabel?: string;
|
|
11
13
|
userAccountType: UserAccountTypes;
|
|
12
14
|
loading?: boolean;
|
|
13
15
|
error?: string;
|
|
@@ -17,6 +19,7 @@ export interface IStoreProps {
|
|
|
17
19
|
defaultActiveTab?: TabId;
|
|
18
20
|
textInputItemKeys?: string[];
|
|
19
21
|
customPacksContent?: React.ReactNode;
|
|
22
|
+
customWalletContent?: React.ReactNode;
|
|
20
23
|
}
|
|
21
24
|
export declare const Store: React.FC<IStoreProps>;
|
|
22
25
|
export {};
|
|
@@ -58850,69 +58850,6 @@ var DropdownContainer$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
58850
58850
|
componentId: "sc-l6f466-3"
|
|
58851
58851
|
})(["flex:0.25;min-width:140px;"]);
|
|
58852
58852
|
|
|
58853
|
-
var ShoppingCardHorizontal = function ShoppingCardHorizontal(_ref) {
|
|
58854
|
-
var title = _ref.title,
|
|
58855
|
-
description = _ref.description,
|
|
58856
|
-
imageUrl = _ref.imageUrl,
|
|
58857
|
-
onClick = _ref.onClick,
|
|
58858
|
-
footer = _ref.footer,
|
|
58859
|
-
className = _ref.className;
|
|
58860
|
-
var getImageSrc = function getImageSrc() {
|
|
58861
|
-
if (!imageUrl) return '/placeholder-thumbnail.png';
|
|
58862
|
-
if (typeof imageUrl === 'string') return imageUrl;
|
|
58863
|
-
return imageUrl["default"] || imageUrl.src;
|
|
58864
|
-
};
|
|
58865
|
-
return React__default.createElement(CardContainer, {
|
|
58866
|
-
onClick: onClick,
|
|
58867
|
-
className: className
|
|
58868
|
-
}, React__default.createElement(LeftSection, null, imageUrl && React__default.createElement(CardThumbnail, null, React__default.createElement("img", {
|
|
58869
|
-
src: getImageSrc(),
|
|
58870
|
-
alt: title
|
|
58871
|
-
}))), React__default.createElement(RightSection, null, React__default.createElement(CardTitle, null, React__default.createElement(Ellipsis, {
|
|
58872
|
-
maxLines: 1,
|
|
58873
|
-
maxWidth: "100%"
|
|
58874
|
-
}, title)), React__default.createElement(CardDescription, null, React__default.createElement(Ellipsis, {
|
|
58875
|
-
maxLines: 3,
|
|
58876
|
-
maxWidth: "100%"
|
|
58877
|
-
}, description)), footer && React__default.createElement(CardFooter, {
|
|
58878
|
-
onClick: function onClick(e) {
|
|
58879
|
-
return e.stopPropagation();
|
|
58880
|
-
}
|
|
58881
|
-
}, footer)));
|
|
58882
|
-
};
|
|
58883
|
-
var CardContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
58884
|
-
displayName: "CartCardHorizontal__CardContainer",
|
|
58885
|
-
componentId: "sc-ngkh06-0"
|
|
58886
|
-
})(["display:flex;background:rgba(0,0,0,0.3);border-radius:4px;border:1px solid ", ";cursor:", ";transition:transform 0.2s ease;&:hover{transform:", ";}max-width:380px;"], uiColors.darkGray, function (props) {
|
|
58887
|
-
return props.onClick ? 'pointer' : 'default';
|
|
58888
|
-
}, function (props) {
|
|
58889
|
-
return props.onClick ? 'translateY(-2px)' : 'none';
|
|
58890
|
-
});
|
|
58891
|
-
var LeftSection = /*#__PURE__*/styled__default.div.withConfig({
|
|
58892
|
-
displayName: "CartCardHorizontal__LeftSection",
|
|
58893
|
-
componentId: "sc-ngkh06-1"
|
|
58894
|
-
})(["width:120px;flex-shrink:0;"]);
|
|
58895
|
-
var RightSection = /*#__PURE__*/styled__default.div.withConfig({
|
|
58896
|
-
displayName: "CartCardHorizontal__RightSection",
|
|
58897
|
-
componentId: "sc-ngkh06-2"
|
|
58898
|
-
})(["flex:1;display:flex;flex-direction:column;padding:12px;min-width:0;max-width:100%;"]);
|
|
58899
|
-
var CardThumbnail = /*#__PURE__*/styled__default.div.withConfig({
|
|
58900
|
-
displayName: "CartCardHorizontal__CardThumbnail",
|
|
58901
|
-
componentId: "sc-ngkh06-3"
|
|
58902
|
-
})(["width:100%;height:100%;background:rgba(0,0,0,0.2);overflow:hidden;img{width:100%;height:100%;object-fit:cover;}"]);
|
|
58903
|
-
var CardTitle = /*#__PURE__*/styled__default.h3.withConfig({
|
|
58904
|
-
displayName: "CartCardHorizontal__CardTitle",
|
|
58905
|
-
componentId: "sc-ngkh06-4"
|
|
58906
|
-
})(["margin:0;font-size:0.6rem;color:", ";font-family:'Press Start 2P',cursive;margin-bottom:8px;"], uiColors.yellow);
|
|
58907
|
-
var CardDescription = /*#__PURE__*/styled__default.p.withConfig({
|
|
58908
|
-
displayName: "CartCardHorizontal__CardDescription",
|
|
58909
|
-
componentId: "sc-ngkh06-5"
|
|
58910
|
-
})(["margin:0;font-size:0.55rem;color:", ";font-family:'Press Start 2P',cursive;line-height:1.4;margin-bottom:8px;"], uiColors.lightGray);
|
|
58911
|
-
var CardFooter = /*#__PURE__*/styled__default.div.withConfig({
|
|
58912
|
-
displayName: "CartCardHorizontal__CardFooter",
|
|
58913
|
-
componentId: "sc-ngkh06-6"
|
|
58914
|
-
})(["margin-top:auto;padding-top:8px;border-top:1px solid rgba(255,255,255,0.1);"]);
|
|
58915
|
-
|
|
58916
58853
|
var usePackFiltering = function usePackFiltering(packs) {
|
|
58917
58854
|
var _useState = React.useState(''),
|
|
58918
58855
|
searchQuery = _useState[0],
|
|
@@ -58937,28 +58874,28 @@ var StorePacksSection = function StorePacksSection(_ref) {
|
|
|
58937
58874
|
searchQuery = _usePackFiltering.searchQuery,
|
|
58938
58875
|
setSearchQuery = _usePackFiltering.setSearchQuery,
|
|
58939
58876
|
filteredPacks = _usePackFiltering.filteredPacks;
|
|
58940
|
-
var
|
|
58941
|
-
|
|
58877
|
+
var getImageSrc = function getImageSrc(imageUrl) {
|
|
58878
|
+
if (typeof imageUrl === 'string') return imageUrl;
|
|
58879
|
+
return imageUrl["default"] || imageUrl.src;
|
|
58880
|
+
};
|
|
58881
|
+
var renderPack = React.useCallback(function (pack) {
|
|
58882
|
+
return React__default.createElement(PackRow, {
|
|
58883
|
+
key: pack.key,
|
|
58884
|
+
onClick: function onClick() {
|
|
58885
|
+
return onSelectPack == null ? void 0 : onSelectPack(pack);
|
|
58886
|
+
}
|
|
58887
|
+
}, React__default.createElement(PackIconContainer, null, React__default.createElement("img", {
|
|
58888
|
+
src: getImageSrc(pack.image),
|
|
58889
|
+
alt: pack.title
|
|
58890
|
+
})), React__default.createElement(PackDetails, null, React__default.createElement(PackName, null, pack.title), React__default.createElement(PackPrice, null, "$", pack.priceUSD), pack.description && React__default.createElement(PackDescription, null, pack.description)), React__default.createElement(Controls$2, null, React__default.createElement(CTAButton, {
|
|
58942
58891
|
icon: React__default.createElement(fa.FaCartPlus, null),
|
|
58943
58892
|
label: "Add",
|
|
58944
58893
|
onClick: function onClick(e) {
|
|
58945
58894
|
e.stopPropagation();
|
|
58946
58895
|
onAddToCart(pack);
|
|
58947
58896
|
}
|
|
58948
|
-
}));
|
|
58949
|
-
}, [onAddToCart]);
|
|
58950
|
-
var renderPack = React.useCallback(function (pack) {
|
|
58951
|
-
return React__default.createElement(ShoppingCardHorizontal, {
|
|
58952
|
-
key: pack.key,
|
|
58953
|
-
title: pack.title,
|
|
58954
|
-
description: pack.description,
|
|
58955
|
-
imageUrl: pack.image,
|
|
58956
|
-
footer: renderPackFooter(pack),
|
|
58957
|
-
onClick: function onClick() {
|
|
58958
|
-
return onSelectPack == null ? void 0 : onSelectPack(pack);
|
|
58959
|
-
}
|
|
58960
|
-
});
|
|
58961
|
-
}, [onSelectPack, renderPackFooter]);
|
|
58897
|
+
})));
|
|
58898
|
+
}, [onSelectPack, onAddToCart]);
|
|
58962
58899
|
return React__default.createElement(ScrollableContent, {
|
|
58963
58900
|
items: filteredPacks,
|
|
58964
58901
|
renderItem: renderPack,
|
|
@@ -58968,19 +58905,38 @@ var StorePacksSection = function StorePacksSection(_ref) {
|
|
|
58968
58905
|
onChange: setSearchQuery,
|
|
58969
58906
|
placeholder: 'Search packs...'
|
|
58970
58907
|
},
|
|
58971
|
-
layout: "
|
|
58972
|
-
gridColumns: 2,
|
|
58908
|
+
layout: "list",
|
|
58973
58909
|
maxHeight: "420px"
|
|
58974
58910
|
});
|
|
58975
58911
|
};
|
|
58976
|
-
var
|
|
58977
|
-
displayName: "
|
|
58912
|
+
var PackRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
58913
|
+
displayName: "StorePacksSection__PackRow",
|
|
58978
58914
|
componentId: "sc-ulazq3-0"
|
|
58979
|
-
})(["display:flex;align-items:center;
|
|
58980
|
-
var
|
|
58981
|
-
displayName: "
|
|
58915
|
+
})(["display:flex;align-items:center;gap:0.75rem;padding:0.5rem 1rem;border-bottom:1px solid rgba(255,255,255,0.1);cursor:pointer;&:last-child{border-bottom:none;}&:hover{background:rgba(255,255,255,0.04);}"]);
|
|
58916
|
+
var PackIconContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
58917
|
+
displayName: "StorePacksSection__PackIconContainer",
|
|
58982
58918
|
componentId: "sc-ulazq3-1"
|
|
58983
|
-
})(["
|
|
58919
|
+
})(["width:40px;height:40px;flex-shrink:0;display:flex;align-items:center;justify-content:center;img{width:100%;height:100%;object-fit:cover;}"]);
|
|
58920
|
+
var PackDetails = /*#__PURE__*/styled__default.div.withConfig({
|
|
58921
|
+
displayName: "StorePacksSection__PackDetails",
|
|
58922
|
+
componentId: "sc-ulazq3-2"
|
|
58923
|
+
})(["flex:1;display:flex;flex-direction:column;gap:0.25rem;min-width:0;"]);
|
|
58924
|
+
var PackName = /*#__PURE__*/styled__default.div.withConfig({
|
|
58925
|
+
displayName: "StorePacksSection__PackName",
|
|
58926
|
+
componentId: "sc-ulazq3-3"
|
|
58927
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.75rem;color:#ffffff;"]);
|
|
58928
|
+
var PackPrice = /*#__PURE__*/styled__default.div.withConfig({
|
|
58929
|
+
displayName: "StorePacksSection__PackPrice",
|
|
58930
|
+
componentId: "sc-ulazq3-4"
|
|
58931
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.625rem;color:#fef08a;"]);
|
|
58932
|
+
var PackDescription = /*#__PURE__*/styled__default.div.withConfig({
|
|
58933
|
+
displayName: "StorePacksSection__PackDescription",
|
|
58934
|
+
componentId: "sc-ulazq3-5"
|
|
58935
|
+
})(["font-family:'Press Start 2P',cursive;font-size:0.625rem;color:rgba(255,255,255,0.7);line-height:1.4;"]);
|
|
58936
|
+
var Controls$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
58937
|
+
displayName: "StorePacksSection__Controls",
|
|
58938
|
+
componentId: "sc-ulazq3-6"
|
|
58939
|
+
})(["display:flex;align-items:center;flex-shrink:0;"]);
|
|
58984
58940
|
|
|
58985
58941
|
var StoreItemDetails = function StoreItemDetails(_ref) {
|
|
58986
58942
|
var item = _ref.item,
|
|
@@ -59059,6 +59015,8 @@ var Store = function Store(_ref) {
|
|
|
59059
59015
|
atlasIMG = _ref.atlasIMG,
|
|
59060
59016
|
_onPurchase2 = _ref.onPurchase,
|
|
59061
59017
|
onShowHistory = _ref.onShowHistory,
|
|
59018
|
+
onShowWallet = _ref.onShowWallet,
|
|
59019
|
+
walletLabel = _ref.walletLabel,
|
|
59062
59020
|
userAccountType = _ref.userAccountType,
|
|
59063
59021
|
_ref$loading = _ref.loading,
|
|
59064
59022
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
@@ -59070,7 +59028,8 @@ var Store = function Store(_ref) {
|
|
|
59070
59028
|
defaultActiveTab = _ref.defaultActiveTab,
|
|
59071
59029
|
_ref$textInputItemKey = _ref.textInputItemKeys,
|
|
59072
59030
|
textInputItemKeys = _ref$textInputItemKey === void 0 ? [] : _ref$textInputItemKey,
|
|
59073
|
-
customPacksContent = _ref.customPacksContent
|
|
59031
|
+
customPacksContent = _ref.customPacksContent,
|
|
59032
|
+
customWalletContent = _ref.customWalletContent;
|
|
59074
59033
|
var _useState = React.useState(null),
|
|
59075
59034
|
selectedPack = _useState[0],
|
|
59076
59035
|
setSelectedPack = _useState[1];
|
|
@@ -59214,6 +59173,11 @@ var Store = function Store(_ref) {
|
|
|
59214
59173
|
userAccountType: userAccountType,
|
|
59215
59174
|
textInputItemKeys: textInputItemKeys
|
|
59216
59175
|
})
|
|
59176
|
+
},
|
|
59177
|
+
wallet: {
|
|
59178
|
+
id: 'wallet',
|
|
59179
|
+
title: 'Wallet',
|
|
59180
|
+
content: customWalletContent != null ? customWalletContent : null
|
|
59217
59181
|
}
|
|
59218
59182
|
};
|
|
59219
59183
|
var tabs = availableTabIds.map(function (id) {
|
|
@@ -59270,10 +59234,14 @@ var Store = function Store(_ref) {
|
|
|
59270
59234
|
onAddToCart: function onAddToCart() {
|
|
59271
59235
|
return handleAddPackToCart(selectedPack);
|
|
59272
59236
|
}
|
|
59273
|
-
}) : React__default.createElement(Container$N, null, React__default.createElement(TopBar$1, null, React__default.createElement(
|
|
59237
|
+
}) : React__default.createElement(Container$N, null, React__default.createElement(TopBar$1, null, React__default.createElement(LeftButtons, null, onShowHistory && React__default.createElement(CTAButton, {
|
|
59274
59238
|
icon: React__default.createElement(fa.FaHistory, null),
|
|
59275
59239
|
label: "History",
|
|
59276
59240
|
onClick: onShowHistory
|
|
59241
|
+
}), onShowWallet && React__default.createElement(CTAButton, {
|
|
59242
|
+
icon: React__default.createElement(fa.FaWallet, null),
|
|
59243
|
+
label: walletLabel != null ? walletLabel : 'DC Wallet',
|
|
59244
|
+
onClick: onShowWallet
|
|
59277
59245
|
})), React__default.createElement(CartButton, null, React__default.createElement(CTAButton, {
|
|
59278
59246
|
icon: React__default.createElement(fa.FaShoppingCart, null),
|
|
59279
59247
|
label: getTotalItems() + " items ($" + getTotalPrice().toFixed(2) + ")",
|
|
@@ -59304,10 +59272,10 @@ var TopBar$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
59304
59272
|
displayName: "Store__TopBar",
|
|
59305
59273
|
componentId: "sc-64dj00-1"
|
|
59306
59274
|
})(["display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:0 1rem;flex-shrink:0;margin-top:0.5rem;"]);
|
|
59307
|
-
var
|
|
59308
|
-
displayName: "
|
|
59275
|
+
var LeftButtons = /*#__PURE__*/styled__default.div.withConfig({
|
|
59276
|
+
displayName: "Store__LeftButtons",
|
|
59309
59277
|
componentId: "sc-64dj00-2"
|
|
59310
|
-
})(["min-width:fit-content;margin-right:auto;"]);
|
|
59278
|
+
})(["display:flex;gap:0.5rem;min-width:fit-content;margin-right:auto;"]);
|
|
59311
59279
|
var CartButton = /*#__PURE__*/styled__default.div.withConfig({
|
|
59312
59280
|
displayName: "Store__CartButton",
|
|
59313
59281
|
componentId: "sc-64dj00-3"
|