@rpg-engine/long-bow 0.8.212 → 0.8.214
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 -0
- package/dist/long-bow.cjs.development.js +36 -30
- 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 +36 -30
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Marketplace/Marketplace.tsx +2 -1
- package/src/components/Store/Store.tsx +45 -24
- package/src/components/shared/Tabs/Tabs.tsx +5 -0
- package/src/stories/Features/store/Store.stories.tsx +43 -3
|
@@ -26,6 +26,10 @@ export interface IStoreProps {
|
|
|
26
26
|
customHistoryContent?: React.ReactNode;
|
|
27
27
|
/** When true the store renders full-screen (useful on mobile). */
|
|
28
28
|
fullScreen?: boolean;
|
|
29
|
+
/** Override the DraggableContainer width (e.g. "90vw"). Defaults to "1000px". */
|
|
30
|
+
containerWidth?: string;
|
|
31
|
+
/** Override the DraggableContainer height (e.g. "80vh"). Defaults to "auto". */
|
|
32
|
+
containerHeight?: string;
|
|
29
33
|
packsBadge?: string;
|
|
30
34
|
featuredItems?: IFeaturedItem[];
|
|
31
35
|
onQuickBuy?: (item: IProductBlueprint, quantity?: number) => void;
|
|
@@ -10874,7 +10874,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
10874
10874
|
var TabsContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
10875
10875
|
displayName: "Tabs__TabsContainer",
|
|
10876
10876
|
componentId: "sc-n35er2-0"
|
|
10877
|
-
})(["display:flex;gap:10px;width:95%;margin:0 auto 15px auto;border-bottom:2px solid rgba(255,255,255,0.1);padding-bottom:10px;"]);
|
|
10877
|
+
})(["display:flex;gap:10px;width:95%;margin:0 auto 15px auto;border-bottom:2px solid rgba(255,255,255,0.1);padding-bottom:10px;overflow-x:auto;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]);
|
|
10878
10878
|
var TabButton$1 = /*#__PURE__*/styled__default.button.withConfig({
|
|
10879
10879
|
displayName: "Tabs__TabButton",
|
|
10880
10880
|
componentId: "sc-n35er2-1"
|
|
@@ -14442,7 +14442,8 @@ var Marketplace = function Marketplace(props) {
|
|
|
14442
14442
|
if (onClose) onClose();
|
|
14443
14443
|
},
|
|
14444
14444
|
isFullScreen: fullScreen,
|
|
14445
|
-
width: "
|
|
14445
|
+
width: "1050px",
|
|
14446
|
+
minWidth: "750px",
|
|
14446
14447
|
cancelDrag: "#MarketContainer, .rpgui-dropdown-imp, input, .empty-slot, button",
|
|
14447
14448
|
scale: scale
|
|
14448
14449
|
}, React__default.createElement(Tabs, {
|
|
@@ -39709,6 +39710,8 @@ var Store = function Store(_ref) {
|
|
|
39709
39710
|
customHistoryContent = _ref.customHistoryContent,
|
|
39710
39711
|
_ref$fullScreen = _ref.fullScreen,
|
|
39711
39712
|
fullScreen = _ref$fullScreen === void 0 ? false : _ref$fullScreen,
|
|
39713
|
+
containerWidth = _ref.containerWidth,
|
|
39714
|
+
containerHeight = _ref.containerHeight,
|
|
39712
39715
|
_ref$packsTabLabel = _ref.packsTabLabel,
|
|
39713
39716
|
packsTabLabel = _ref$packsTabLabel === void 0 ? 'Packs' : _ref$packsTabLabel,
|
|
39714
39717
|
packsBadge = _ref.packsBadge,
|
|
@@ -39737,14 +39740,15 @@ var Store = function Store(_ref) {
|
|
|
39737
39740
|
selectedPack = _useState[0],
|
|
39738
39741
|
setSelectedPack = _useState[1];
|
|
39739
39742
|
var _useState2 = React.useState(function () {
|
|
39740
|
-
var
|
|
39741
|
-
var
|
|
39743
|
+
var _validTabs$;
|
|
39744
|
+
var allTabIds = [].concat(tabOrder != null ? tabOrder : defaultTabOrder, customCharactersContent ? ['characters'] : [], onRedeem ? ['redeem'] : [], onShowWallet || customWalletContent ? ['wallet'] : [], onShowHistory || customHistoryContent ? ['history'] : []);
|
|
39745
|
+
var validTabs = Array.from(new Set(allTabIds.filter(function (id) {
|
|
39742
39746
|
return !(hidePremiumTab && id === 'premium');
|
|
39743
|
-
});
|
|
39744
|
-
if (defaultActiveTab &&
|
|
39747
|
+
})));
|
|
39748
|
+
if (defaultActiveTab && validTabs.includes(defaultActiveTab)) {
|
|
39745
39749
|
return defaultActiveTab;
|
|
39746
39750
|
}
|
|
39747
|
-
return (
|
|
39751
|
+
return (_validTabs$ = validTabs[0]) != null ? _validTabs$ : hidePremiumTab ? 'items' : 'premium';
|
|
39748
39752
|
}),
|
|
39749
39753
|
activeTab = _useState2[0],
|
|
39750
39754
|
setActiveTab = _useState2[1];
|
|
@@ -39997,7 +40001,7 @@ var Store = function Store(_ref) {
|
|
|
39997
40001
|
},
|
|
39998
40002
|
characters: {
|
|
39999
40003
|
id: 'characters',
|
|
40000
|
-
title: '
|
|
40004
|
+
title: 'Char Trade',
|
|
40001
40005
|
icon: React__default.createElement(fa.FaUsers, {
|
|
40002
40006
|
size: 16
|
|
40003
40007
|
}),
|
|
@@ -40045,9 +40049,9 @@ var Store = function Store(_ref) {
|
|
|
40045
40049
|
return React__default.createElement(DraggableContainer, {
|
|
40046
40050
|
title: "Store",
|
|
40047
40051
|
onCloseButton: onClose,
|
|
40048
|
-
width: "
|
|
40049
|
-
minWidth: "
|
|
40050
|
-
height: "auto",
|
|
40052
|
+
width: containerWidth != null ? containerWidth : "1000px",
|
|
40053
|
+
minWidth: "700px",
|
|
40054
|
+
height: containerHeight != null ? containerHeight : "auto",
|
|
40051
40055
|
type: exports.RPGUIContainerTypes.Framed,
|
|
40052
40056
|
cancelDrag: "[class*='Store__Container'], [class*='CartView'], [class*='StoreItemDetails'], .close-button",
|
|
40053
40057
|
isFullScreen: fullScreen
|
|
@@ -40065,11 +40069,9 @@ var Store = function Store(_ref) {
|
|
|
40065
40069
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
40066
40070
|
while (1) switch (_context4.prev = _context4.next) {
|
|
40067
40071
|
case 0:
|
|
40068
|
-
|
|
40069
|
-
return handleCartPurchase(_onPurchase4);
|
|
40070
|
-
case 2:
|
|
40072
|
+
handleCartPurchase(_onPurchase4);
|
|
40071
40073
|
return _context4.abrupt("return", true);
|
|
40072
|
-
case
|
|
40074
|
+
case 2:
|
|
40073
40075
|
case "end":
|
|
40074
40076
|
return _context4.stop();
|
|
40075
40077
|
}
|
|
@@ -40154,7 +40156,7 @@ var Store = function Store(_ref) {
|
|
|
40154
40156
|
}
|
|
40155
40157
|
}
|
|
40156
40158
|
} : undefined
|
|
40157
|
-
}), React__default.createElement(MainContent$1, null, React__default.createElement(HeaderRow, null, React__default.createElement(Tabs, {
|
|
40159
|
+
}), React__default.createElement(MainContent$1, null, React__default.createElement(HeaderRow, null, React__default.createElement(TabsFlexWrapper, null, React__default.createElement(Tabs, {
|
|
40158
40160
|
options: availableTabIds.map(function (id) {
|
|
40159
40161
|
var _tabsMap$id, _tabsMap$id2;
|
|
40160
40162
|
return {
|
|
@@ -40172,7 +40174,7 @@ var Store = function Store(_ref) {
|
|
|
40172
40174
|
_onTabChange(nextTab, itemCount);
|
|
40173
40175
|
}
|
|
40174
40176
|
}
|
|
40175
|
-
}), React__default.createElement(CartButtonWrapper, null, React__default.createElement(CTAButton, {
|
|
40177
|
+
})), React__default.createElement(CartButtonWrapper, null, React__default.createElement(CTAButton, {
|
|
40176
40178
|
icon: React__default.createElement(fa.FaShoppingCart, null),
|
|
40177
40179
|
onClick: handleOpenCart
|
|
40178
40180
|
}), getTotalItems() > 0 && React__default.createElement(CartBadge, null, getTotalItems()))), React__default.createElement(TabContent, null, (_tabsMap$activeTab = tabsMap[activeTab]) == null ? void 0 : _tabsMap$activeTab.content)), cartItems.length > 0 && React__default.createElement(Footer$3, null, React__default.createElement(CartSummary, null, React__default.createElement(CartInfo, null, React__default.createElement("span", null, "Items in cart:"), React__default.createElement("span", null, getTotalItems())), React__default.createElement(CartInfo, null, React__default.createElement("span", null, "Total:"), React__default.createElement("span", null, currencySymbol, getTotalPrice().toFixed(2)))), React__default.createElement(CTAButton, {
|
|
@@ -40189,50 +40191,54 @@ var Container$Q = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
40189
40191
|
var HeaderRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
40190
40192
|
displayName: "Store__HeaderRow",
|
|
40191
40193
|
componentId: "sc-64dj00-1"
|
|
40192
|
-
})(["display:flex;align-items:
|
|
40194
|
+
})(["display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:0.25rem;padding-top:10px;padding-right:12px;"]);
|
|
40195
|
+
var TabsFlexWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
40196
|
+
displayName: "Store__TabsFlexWrapper",
|
|
40197
|
+
componentId: "sc-64dj00-2"
|
|
40198
|
+
})(["flex:1;min-width:0;"]);
|
|
40193
40199
|
var CartButtonWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
40194
40200
|
displayName: "Store__CartButtonWrapper",
|
|
40195
|
-
componentId: "sc-64dj00-
|
|
40196
|
-
})(["position:relative;"]);
|
|
40201
|
+
componentId: "sc-64dj00-3"
|
|
40202
|
+
})(["position:relative;flex-shrink:0;"]);
|
|
40197
40203
|
var CartBadge = /*#__PURE__*/styled__default.div.withConfig({
|
|
40198
40204
|
displayName: "Store__CartBadge",
|
|
40199
|
-
componentId: "sc-64dj00-
|
|
40205
|
+
componentId: "sc-64dj00-4"
|
|
40200
40206
|
})(["position:absolute;top:-8px;right:-8px;background:#ef4444;color:white;font-family:'Press Start 2P',cursive;font-size:0.5rem;padding:4px;border-radius:50%;border:2px solid #000;display:flex;align-items:center;justify-content:center;min-width:16px;min-height:16px;box-sizing:content-box;"]);
|
|
40201
40207
|
var MainContent$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
40202
40208
|
displayName: "Store__MainContent",
|
|
40203
|
-
componentId: "sc-64dj00-
|
|
40209
|
+
componentId: "sc-64dj00-5"
|
|
40204
40210
|
})(["flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden;"]);
|
|
40205
40211
|
var TabContent = /*#__PURE__*/styled__default.div.withConfig({
|
|
40206
40212
|
displayName: "Store__TabContent",
|
|
40207
|
-
componentId: "sc-64dj00-
|
|
40213
|
+
componentId: "sc-64dj00-6"
|
|
40208
40214
|
})(["flex:1;overflow-y:auto;"]);
|
|
40209
40215
|
var Footer$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
40210
40216
|
displayName: "Store__Footer",
|
|
40211
|
-
componentId: "sc-64dj00-
|
|
40217
|
+
componentId: "sc-64dj00-7"
|
|
40212
40218
|
})(["display:flex;flex-direction:column;gap:1rem;padding:1rem;border-top:2px solid #f59e0b;background:rgba(0,0,0,0.2);flex-shrink:0;"]);
|
|
40213
40219
|
var CartSummary = /*#__PURE__*/styled__default.div.withConfig({
|
|
40214
40220
|
displayName: "Store__CartSummary",
|
|
40215
|
-
componentId: "sc-64dj00-
|
|
40221
|
+
componentId: "sc-64dj00-8"
|
|
40216
40222
|
})(["display:flex;flex-direction:column;gap:0.5rem;"]);
|
|
40217
40223
|
var CartInfo = /*#__PURE__*/styled__default.div.withConfig({
|
|
40218
40224
|
displayName: "Store__CartInfo",
|
|
40219
|
-
componentId: "sc-64dj00-
|
|
40225
|
+
componentId: "sc-64dj00-9"
|
|
40220
40226
|
})(["display:flex;align-items:center;gap:0.75rem;font-family:'Press Start 2P',cursive;font-size:0.75rem;color:#ffffff;span:last-child{color:#fef08a;}"]);
|
|
40221
40227
|
var TabLabelWithBadge = /*#__PURE__*/styled__default.span.withConfig({
|
|
40222
40228
|
displayName: "Store__TabLabelWithBadge",
|
|
40223
|
-
componentId: "sc-64dj00-
|
|
40229
|
+
componentId: "sc-64dj00-10"
|
|
40224
40230
|
})(["display:inline-flex;align-items:center;gap:5px;"]);
|
|
40225
40231
|
var LoadingMessage$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
40226
40232
|
displayName: "Store__LoadingMessage",
|
|
40227
|
-
componentId: "sc-64dj00-
|
|
40233
|
+
componentId: "sc-64dj00-11"
|
|
40228
40234
|
})(["text-align:center;color:", ";padding:2rem;"], uiColors.white);
|
|
40229
40235
|
var ErrorMessage$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
40230
40236
|
displayName: "Store__ErrorMessage",
|
|
40231
|
-
componentId: "sc-64dj00-
|
|
40237
|
+
componentId: "sc-64dj00-12"
|
|
40232
40238
|
})(["text-align:center;color:", ";padding:2rem;"], uiColors.red);
|
|
40233
40239
|
var CenteredContent = /*#__PURE__*/styled__default.div.withConfig({
|
|
40234
40240
|
displayName: "Store__CenteredContent",
|
|
40235
|
-
componentId: "sc-64dj00-
|
|
40241
|
+
componentId: "sc-64dj00-13"
|
|
40236
40242
|
})(["display:flex;align-items:center;justify-content:center;height:100%;padding:2rem;"]);
|
|
40237
40243
|
|
|
40238
40244
|
var TextArea = function TextArea(_ref) {
|