@rpg-engine/long-bow 0.8.162 → 0.8.163
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 +1 -0
- package/dist/components/Store/sections/StorePacksSection.d.ts +1 -1
- package/dist/long-bow.cjs.development.js +77 -28
- 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 +77 -28
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Store/Store.tsx +19 -4
- package/src/components/Store/sections/StorePacksSection.tsx +90 -30
- package/src/stories/Features/store/Store.stories.tsx +2 -1
package/dist/long-bow.esm.js
CHANGED
|
@@ -70444,12 +70444,48 @@ var usePackFiltering = function usePackFiltering(packs) {
|
|
|
70444
70444
|
};
|
|
70445
70445
|
};
|
|
70446
70446
|
|
|
70447
|
-
var
|
|
70448
|
-
var
|
|
70447
|
+
var PackRowItem = function PackRowItem(_ref) {
|
|
70448
|
+
var pack = _ref.pack,
|
|
70449
70449
|
onAddToCart = _ref.onAddToCart,
|
|
70450
|
-
|
|
70451
|
-
|
|
70452
|
-
|
|
70450
|
+
renderPackIcon = _ref.renderPackIcon;
|
|
70451
|
+
var _useQuantityControl = useQuantityControl(),
|
|
70452
|
+
quantity = _useQuantityControl.quantity,
|
|
70453
|
+
handleQuantityChange = _useQuantityControl.handleQuantityChange,
|
|
70454
|
+
handleBlur = _useQuantityControl.handleBlur,
|
|
70455
|
+
incrementQuantity = _useQuantityControl.incrementQuantity,
|
|
70456
|
+
decrementQuantity = _useQuantityControl.decrementQuantity,
|
|
70457
|
+
resetQuantity = _useQuantityControl.resetQuantity;
|
|
70458
|
+
var handleAdd = function handleAdd() {
|
|
70459
|
+
onAddToCart(pack, quantity);
|
|
70460
|
+
resetQuantity();
|
|
70461
|
+
};
|
|
70462
|
+
return React.createElement(PackRow, null, React.createElement(LeftSection$1, null, React.createElement(PackIconContainer, null, renderPackIcon(pack)), React.createElement(PackDetails, null, React.createElement(PackName, null, pack.title), React.createElement(PackPrice, null, "$", pack.priceUSD), pack.description && React.createElement(PackDescription, null, pack.description))), React.createElement(Controls$2, null, React.createElement(ArrowsContainer$1, null, React.createElement(SelectArrow, {
|
|
70463
|
+
direction: "left",
|
|
70464
|
+
onPointerDown: decrementQuantity,
|
|
70465
|
+
size: 24
|
|
70466
|
+
}), React.createElement(QuantityInput$1, {
|
|
70467
|
+
type: "number",
|
|
70468
|
+
value: quantity,
|
|
70469
|
+
onChange: handleQuantityChange,
|
|
70470
|
+
onBlur: handleBlur,
|
|
70471
|
+
min: 1,
|
|
70472
|
+
max: 99,
|
|
70473
|
+
className: "rpgui-input"
|
|
70474
|
+
}), React.createElement(SelectArrow, {
|
|
70475
|
+
direction: "right",
|
|
70476
|
+
onPointerDown: incrementQuantity,
|
|
70477
|
+
size: 24
|
|
70478
|
+
})), React.createElement(CTAButton, {
|
|
70479
|
+
icon: React.createElement(FaCartPlus, null),
|
|
70480
|
+
label: "Add",
|
|
70481
|
+
onClick: handleAdd
|
|
70482
|
+
})));
|
|
70483
|
+
};
|
|
70484
|
+
var StorePacksSection = function StorePacksSection(_ref2) {
|
|
70485
|
+
var packs = _ref2.packs,
|
|
70486
|
+
onAddToCart = _ref2.onAddToCart,
|
|
70487
|
+
atlasJSON = _ref2.atlasJSON,
|
|
70488
|
+
atlasIMG = _ref2.atlasIMG;
|
|
70453
70489
|
var _usePackFiltering = usePackFiltering(packs),
|
|
70454
70490
|
searchQuery = _usePackFiltering.searchQuery,
|
|
70455
70491
|
setSearchQuery = _usePackFiltering.setSearchQuery,
|
|
@@ -70478,20 +70514,13 @@ var StorePacksSection = function StorePacksSection(_ref) {
|
|
|
70478
70514
|
});
|
|
70479
70515
|
}, [atlasJSON, atlasIMG]);
|
|
70480
70516
|
var renderPack = useCallback(function (pack) {
|
|
70481
|
-
return React.createElement(
|
|
70517
|
+
return React.createElement(PackRowItem, {
|
|
70482
70518
|
key: pack.key,
|
|
70483
|
-
|
|
70484
|
-
|
|
70485
|
-
|
|
70486
|
-
}
|
|
70487
|
-
|
|
70488
|
-
label: "Add",
|
|
70489
|
-
onClick: function onClick(e) {
|
|
70490
|
-
e.stopPropagation();
|
|
70491
|
-
onAddToCart(pack);
|
|
70492
|
-
}
|
|
70493
|
-
})));
|
|
70494
|
-
}, [onSelectPack, onAddToCart]);
|
|
70519
|
+
pack: pack,
|
|
70520
|
+
onAddToCart: onAddToCart,
|
|
70521
|
+
renderPackIcon: renderPackIcon
|
|
70522
|
+
});
|
|
70523
|
+
}, [onAddToCart, renderPackIcon]);
|
|
70495
70524
|
return React.createElement(ScrollableContent, {
|
|
70496
70525
|
items: filteredPacks,
|
|
70497
70526
|
renderItem: renderPack,
|
|
@@ -70508,7 +70537,7 @@ var StorePacksSection = function StorePacksSection(_ref) {
|
|
|
70508
70537
|
var PackRow = /*#__PURE__*/styled(ItemRowWrapper).withConfig({
|
|
70509
70538
|
displayName: "StorePacksSection__PackRow",
|
|
70510
70539
|
componentId: "sc-ulazq3-0"
|
|
70511
|
-
})(["
|
|
70540
|
+
})([""]);
|
|
70512
70541
|
var LeftSection$1 = /*#__PURE__*/styled.div.withConfig({
|
|
70513
70542
|
displayName: "StorePacksSection__LeftSection",
|
|
70514
70543
|
componentId: "sc-ulazq3-1"
|
|
@@ -70536,7 +70565,15 @@ var PackDescription = /*#__PURE__*/styled.div.withConfig({
|
|
|
70536
70565
|
var Controls$2 = /*#__PURE__*/styled.div.withConfig({
|
|
70537
70566
|
displayName: "StorePacksSection__Controls",
|
|
70538
70567
|
componentId: "sc-ulazq3-7"
|
|
70539
|
-
})(["display:flex;align-items:center;flex-shrink:0;"]);
|
|
70568
|
+
})(["display:flex;align-items:center;gap:0.5rem;flex-shrink:0;"]);
|
|
70569
|
+
var ArrowsContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
70570
|
+
displayName: "StorePacksSection__ArrowsContainer",
|
|
70571
|
+
componentId: "sc-ulazq3-8"
|
|
70572
|
+
})(["position:relative;display:flex;align-items:center;width:120px;height:42px;justify-content:space-between;"]);
|
|
70573
|
+
var QuantityInput$1 = /*#__PURE__*/styled.input.withConfig({
|
|
70574
|
+
displayName: "StorePacksSection__QuantityInput",
|
|
70575
|
+
componentId: "sc-ulazq3-9"
|
|
70576
|
+
})(["width:40px;text-align:center;margin:0 auto;font-size:0.875rem;background:rgba(0,0,0,0.2);color:#ffffff;border:none;padding:0.25rem;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}"]);
|
|
70540
70577
|
|
|
70541
70578
|
var StoreItemDetails = function StoreItemDetails(_ref) {
|
|
70542
70579
|
var item = _ref.item,
|
|
@@ -70632,7 +70669,8 @@ var Store = function Store(_ref) {
|
|
|
70632
70669
|
customPacksContent = _ref.customPacksContent,
|
|
70633
70670
|
customWalletContent = _ref.customWalletContent,
|
|
70634
70671
|
_ref$packsTabLabel = _ref.packsTabLabel,
|
|
70635
|
-
packsTabLabel = _ref$packsTabLabel === void 0 ? 'Packs' : _ref$packsTabLabel
|
|
70672
|
+
packsTabLabel = _ref$packsTabLabel === void 0 ? 'Packs' : _ref$packsTabLabel,
|
|
70673
|
+
packsBadge = _ref.packsBadge;
|
|
70636
70674
|
var _useState = useState(null),
|
|
70637
70675
|
selectedPack = _useState[0],
|
|
70638
70676
|
setSelectedPack = _useState[1];
|
|
@@ -70663,7 +70701,10 @@ var Store = function Store(_ref) {
|
|
|
70663
70701
|
var _useState4 = useState(null),
|
|
70664
70702
|
currentMetadataItem = _useState4[0],
|
|
70665
70703
|
setCurrentMetadataItem = _useState4[1];
|
|
70666
|
-
var handleAddPackToCart = function handleAddPackToCart(pack) {
|
|
70704
|
+
var handleAddPackToCart = function handleAddPackToCart(pack, quantity) {
|
|
70705
|
+
if (quantity === void 0) {
|
|
70706
|
+
quantity = 1;
|
|
70707
|
+
}
|
|
70667
70708
|
var packItem = {
|
|
70668
70709
|
key: pack.key,
|
|
70669
70710
|
name: pack.title,
|
|
@@ -70695,7 +70736,7 @@ var Store = function Store(_ref) {
|
|
|
70695
70736
|
maxStackSize: 1,
|
|
70696
70737
|
isUsable: false
|
|
70697
70738
|
};
|
|
70698
|
-
handleAddToCart(packItem,
|
|
70739
|
+
handleAddToCart(packItem, quantity);
|
|
70699
70740
|
};
|
|
70700
70741
|
var filterItems = function filterItems(itemsToFilter, type) {
|
|
70701
70742
|
return itemsToFilter.filter(function (item) {
|
|
@@ -70762,7 +70803,11 @@ var Store = function Store(_ref) {
|
|
|
70762
70803
|
},
|
|
70763
70804
|
packs: {
|
|
70764
70805
|
id: 'packs',
|
|
70765
|
-
title: packsTabLabel,
|
|
70806
|
+
title: packsBadge ? React.createElement(TabLabelWithBadge, null, packsTabLabel, React.createElement(LabelPill, {
|
|
70807
|
+
background: "#f59e0b",
|
|
70808
|
+
borderColor: "#f59e0b",
|
|
70809
|
+
color: "#000"
|
|
70810
|
+
}, packsBadge)) : packsTabLabel,
|
|
70766
70811
|
icon: React.createElement(Gift, {
|
|
70767
70812
|
width: 18,
|
|
70768
70813
|
height: 18
|
|
@@ -70920,13 +70965,17 @@ var CartInfo = /*#__PURE__*/styled.div.withConfig({
|
|
|
70920
70965
|
displayName: "Store__CartInfo",
|
|
70921
70966
|
componentId: "sc-64dj00-8"
|
|
70922
70967
|
})(["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;}"]);
|
|
70968
|
+
var TabLabelWithBadge = /*#__PURE__*/styled.span.withConfig({
|
|
70969
|
+
displayName: "Store__TabLabelWithBadge",
|
|
70970
|
+
componentId: "sc-64dj00-9"
|
|
70971
|
+
})(["display:inline-flex;align-items:center;gap:5px;"]);
|
|
70923
70972
|
var LoadingMessage$1 = /*#__PURE__*/styled.div.withConfig({
|
|
70924
70973
|
displayName: "Store__LoadingMessage",
|
|
70925
|
-
componentId: "sc-64dj00-
|
|
70974
|
+
componentId: "sc-64dj00-10"
|
|
70926
70975
|
})(["text-align:center;color:", ";padding:2rem;"], uiColors.white);
|
|
70927
70976
|
var ErrorMessage$3 = /*#__PURE__*/styled.div.withConfig({
|
|
70928
70977
|
displayName: "Store__ErrorMessage",
|
|
70929
|
-
componentId: "sc-64dj00-
|
|
70978
|
+
componentId: "sc-64dj00-11"
|
|
70930
70979
|
})(["text-align:center;color:", ";padding:2rem;"], uiColors.red);
|
|
70931
70980
|
|
|
70932
70981
|
var PaymentMethodModal = function PaymentMethodModal(_ref) {
|
|
@@ -71252,7 +71301,7 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
71252
71301
|
onPointerDown: function onPointerDown() {
|
|
71253
71302
|
return onLeftClick();
|
|
71254
71303
|
}
|
|
71255
|
-
}), React.createElement(QuantityInput$
|
|
71304
|
+
}), React.createElement(QuantityInput$2, {
|
|
71256
71305
|
type: "text",
|
|
71257
71306
|
value: inputQty,
|
|
71258
71307
|
onChange: handleQuantityChange,
|
|
@@ -71302,7 +71351,7 @@ var QuantityContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
71302
71351
|
displayName: "TradingItemRow__QuantityContainer",
|
|
71303
71352
|
componentId: "sc-mja0b5-6"
|
|
71304
71353
|
})(["display:flex;min-width:90px;width:40%;justify-content:flex-end;align-items:center;flex:30%;gap:2px;position:relative;"]);
|
|
71305
|
-
var QuantityInput$
|
|
71354
|
+
var QuantityInput$2 = /*#__PURE__*/styled.input.withConfig({
|
|
71306
71355
|
displayName: "TradingItemRow__QuantityInput",
|
|
71307
71356
|
componentId: "sc-mja0b5-7"
|
|
71308
71357
|
})(["width:30px;text-align:center;background-color:", ";color:white;border:none;padding:1px;font-size:", ";position:relative;right:4px;"], uiColors.darkGray, uiFonts.size.small);
|