@rpg-engine/long-bow 0.8.128 → 0.8.130
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 +3 -1
- package/dist/long-bow.cjs.development.js +52 -89
- 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 +52 -89
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Store/Store.tsx +12 -3
- 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[];
|
|
@@ -16,6 +16,8 @@ export interface IStoreProps {
|
|
|
16
16
|
tabOrder?: TabId[];
|
|
17
17
|
defaultActiveTab?: TabId;
|
|
18
18
|
textInputItemKeys?: string[];
|
|
19
|
+
customPacksContent?: React.ReactNode;
|
|
20
|
+
customWalletContent?: React.ReactNode;
|
|
19
21
|
}
|
|
20
22
|
export declare const Store: React.FC<IStoreProps>;
|
|
21
23
|
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,
|
|
@@ -59069,7 +59025,9 @@ var Store = function Store(_ref) {
|
|
|
59069
59025
|
tabOrder = _ref.tabOrder,
|
|
59070
59026
|
defaultActiveTab = _ref.defaultActiveTab,
|
|
59071
59027
|
_ref$textInputItemKey = _ref.textInputItemKeys,
|
|
59072
|
-
textInputItemKeys = _ref$textInputItemKey === void 0 ? [] : _ref$textInputItemKey
|
|
59028
|
+
textInputItemKeys = _ref$textInputItemKey === void 0 ? [] : _ref$textInputItemKey,
|
|
59029
|
+
customPacksContent = _ref.customPacksContent,
|
|
59030
|
+
customWalletContent = _ref.customWalletContent;
|
|
59073
59031
|
var _useState = React.useState(null),
|
|
59074
59032
|
selectedPack = _useState[0],
|
|
59075
59033
|
setSelectedPack = _useState[1];
|
|
@@ -59194,7 +59152,7 @@ var Store = function Store(_ref) {
|
|
|
59194
59152
|
packs: {
|
|
59195
59153
|
id: 'packs',
|
|
59196
59154
|
title: 'Packs',
|
|
59197
|
-
content: React__default.createElement(StorePacksSection, {
|
|
59155
|
+
content: customPacksContent != null ? customPacksContent : React__default.createElement(StorePacksSection, {
|
|
59198
59156
|
packs: packs.filter(function (pack) {
|
|
59199
59157
|
return pack.priceUSD < 9.99;
|
|
59200
59158
|
}),
|
|
@@ -59213,6 +59171,11 @@ var Store = function Store(_ref) {
|
|
|
59213
59171
|
userAccountType: userAccountType,
|
|
59214
59172
|
textInputItemKeys: textInputItemKeys
|
|
59215
59173
|
})
|
|
59174
|
+
},
|
|
59175
|
+
wallet: {
|
|
59176
|
+
id: 'wallet',
|
|
59177
|
+
title: 'Wallet',
|
|
59178
|
+
content: customWalletContent != null ? customWalletContent : null
|
|
59216
59179
|
}
|
|
59217
59180
|
};
|
|
59218
59181
|
var tabs = availableTabIds.map(function (id) {
|