@rpg-engine/long-bow 0.8.162 → 0.8.165

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.
@@ -46137,8 +46137,6 @@ var BuyPanel = function BuyPanel(_ref) {
46137
46137
  dcToGoldSwapRate = _ref$dcToGoldSwapRate === void 0 ? 0 : _ref$dcToGoldSwapRate,
46138
46138
  _ref$openBuyOrders = _ref.openBuyOrders,
46139
46139
  openBuyOrders = _ref$openBuyOrders === void 0 ? [] : _ref$openBuyOrders,
46140
- _ref$openBuyOrdersTot = _ref.openBuyOrdersTotal,
46141
- openBuyOrdersTotal = _ref$openBuyOrdersTot === void 0 ? 0 : _ref$openBuyOrdersTot,
46142
46140
  _ref$openBuyOrdersPag = _ref.openBuyOrdersPage,
46143
46141
  openBuyOrdersPage = _ref$openBuyOrdersPag === void 0 ? 1 : _ref$openBuyOrdersPag,
46144
46142
  onOpenBuyOrdersPageChange = _ref.onOpenBuyOrdersPageChange,
@@ -46249,6 +46247,10 @@ var BuyPanel = function BuyPanel(_ref) {
46249
46247
  return totalGold(b) - totalGold(a);
46250
46248
  });
46251
46249
  }, [visibleBuyOrders]);
46250
+ var paginatedGroupedBuyOrders = useMemo(function () {
46251
+ var start = (openBuyOrdersPage - 1) * BUY_REQUESTS_PER_PAGE;
46252
+ return groupedBuyOrders.slice(start, start + BUY_REQUESTS_PER_PAGE);
46253
+ }, [groupedBuyOrders, openBuyOrdersPage]);
46252
46254
  var showSellSection = browseMode === 'sell';
46253
46255
  var showBuySection = browseMode === 'buy';
46254
46256
  var hasVisibleContent = showSellSection && groupedItems.length > 0 || showBuySection && groupedBuyOrders.length > 0;
@@ -46422,7 +46424,7 @@ var BuyPanel = function BuyPanel(_ref) {
46422
46424
  onBuy: setBuyingItemId,
46423
46425
  onDCCoinClick: onDCCoinClick
46424
46426
  });
46425
- })), showBuySection && React.createElement(MarketSection, null, React.createElement(SectionHeader, null, React.createElement(SectionTitle$2, null, "Buy Requests"), React.createElement(SectionMeta, null, groupedBuyOrders.length, " groups")), groupedBuyOrders.length === 0 ? React.createElement(SectionEmpty, null, "No public buy requests found.") : groupedBuyOrders.map(function (_ref3) {
46427
+ })), showBuySection && React.createElement(MarketSection, null, React.createElement(SectionHeader, null, React.createElement(SectionTitle$2, null, "Buy Requests"), React.createElement(SectionMeta, null, groupedBuyOrders.length, " groups")), groupedBuyOrders.length === 0 ? React.createElement(SectionEmpty, null, "No public buy requests found.") : paginatedGroupedBuyOrders.map(function (_ref3) {
46426
46428
  var bestOrder = _ref3.bestOrder,
46427
46429
  otherOrders = _ref3.otherOrders;
46428
46430
  return React.createElement(GroupedBuyOrderRow, {
@@ -46438,8 +46440,8 @@ var BuyPanel = function BuyPanel(_ref) {
46438
46440
  currentPage: currentPage,
46439
46441
  itemsPerPage: itemsPerPage,
46440
46442
  onPageChange: onPageChange
46441
- }), showBuySection && openBuyOrdersTotal > BUY_REQUESTS_PER_PAGE && React.createElement(Pager, {
46442
- totalItems: openBuyOrdersTotal,
46443
+ }), showBuySection && groupedBuyOrders.length > BUY_REQUESTS_PER_PAGE && React.createElement(Pager, {
46444
+ totalItems: groupedBuyOrders.length,
46443
46445
  currentPage: openBuyOrdersPage,
46444
46446
  itemsPerPage: BUY_REQUESTS_PER_PAGE,
46445
46447
  onPageChange: onOpenBuyOrdersPageChange != null ? onOpenBuyOrdersPageChange : function () {}
@@ -70444,12 +70446,48 @@ var usePackFiltering = function usePackFiltering(packs) {
70444
70446
  };
70445
70447
  };
70446
70448
 
70447
- var StorePacksSection = function StorePacksSection(_ref) {
70448
- var packs = _ref.packs,
70449
+ var PackRowItem = function PackRowItem(_ref) {
70450
+ var pack = _ref.pack,
70449
70451
  onAddToCart = _ref.onAddToCart,
70450
- onSelectPack = _ref.onSelectPack,
70451
- atlasJSON = _ref.atlasJSON,
70452
- atlasIMG = _ref.atlasIMG;
70452
+ renderPackIcon = _ref.renderPackIcon;
70453
+ var _useQuantityControl = useQuantityControl(),
70454
+ quantity = _useQuantityControl.quantity,
70455
+ handleQuantityChange = _useQuantityControl.handleQuantityChange,
70456
+ handleBlur = _useQuantityControl.handleBlur,
70457
+ incrementQuantity = _useQuantityControl.incrementQuantity,
70458
+ decrementQuantity = _useQuantityControl.decrementQuantity,
70459
+ resetQuantity = _useQuantityControl.resetQuantity;
70460
+ var handleAdd = function handleAdd() {
70461
+ onAddToCart(pack, quantity);
70462
+ resetQuantity();
70463
+ };
70464
+ 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, {
70465
+ direction: "left",
70466
+ onPointerDown: decrementQuantity,
70467
+ size: 24
70468
+ }), React.createElement(QuantityInput$1, {
70469
+ type: "number",
70470
+ value: quantity,
70471
+ onChange: handleQuantityChange,
70472
+ onBlur: handleBlur,
70473
+ min: 1,
70474
+ max: 99,
70475
+ className: "rpgui-input"
70476
+ }), React.createElement(SelectArrow, {
70477
+ direction: "right",
70478
+ onPointerDown: incrementQuantity,
70479
+ size: 24
70480
+ })), React.createElement(CTAButton, {
70481
+ icon: React.createElement(FaCartPlus, null),
70482
+ label: "Add",
70483
+ onClick: handleAdd
70484
+ })));
70485
+ };
70486
+ var StorePacksSection = function StorePacksSection(_ref2) {
70487
+ var packs = _ref2.packs,
70488
+ onAddToCart = _ref2.onAddToCart,
70489
+ atlasJSON = _ref2.atlasJSON,
70490
+ atlasIMG = _ref2.atlasIMG;
70453
70491
  var _usePackFiltering = usePackFiltering(packs),
70454
70492
  searchQuery = _usePackFiltering.searchQuery,
70455
70493
  setSearchQuery = _usePackFiltering.setSearchQuery,
@@ -70478,20 +70516,13 @@ var StorePacksSection = function StorePacksSection(_ref) {
70478
70516
  });
70479
70517
  }, [atlasJSON, atlasIMG]);
70480
70518
  var renderPack = useCallback(function (pack) {
70481
- return React.createElement(PackRow, {
70519
+ return React.createElement(PackRowItem, {
70482
70520
  key: pack.key,
70483
- onClick: function onClick() {
70484
- return onSelectPack == null ? void 0 : onSelectPack(pack);
70485
- }
70486
- }, 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(CTAButton, {
70487
- icon: React.createElement(FaCartPlus, null),
70488
- label: "Add",
70489
- onClick: function onClick(e) {
70490
- e.stopPropagation();
70491
- onAddToCart(pack);
70492
- }
70493
- })));
70494
- }, [onSelectPack, onAddToCart]);
70521
+ pack: pack,
70522
+ onAddToCart: onAddToCart,
70523
+ renderPackIcon: renderPackIcon
70524
+ });
70525
+ }, [onAddToCart, renderPackIcon]);
70495
70526
  return React.createElement(ScrollableContent, {
70496
70527
  items: filteredPacks,
70497
70528
  renderItem: renderPack,
@@ -70508,7 +70539,7 @@ var StorePacksSection = function StorePacksSection(_ref) {
70508
70539
  var PackRow = /*#__PURE__*/styled(ItemRowWrapper).withConfig({
70509
70540
  displayName: "StorePacksSection__PackRow",
70510
70541
  componentId: "sc-ulazq3-0"
70511
- })(["cursor:pointer;"]);
70542
+ })([""]);
70512
70543
  var LeftSection$1 = /*#__PURE__*/styled.div.withConfig({
70513
70544
  displayName: "StorePacksSection__LeftSection",
70514
70545
  componentId: "sc-ulazq3-1"
@@ -70536,7 +70567,15 @@ var PackDescription = /*#__PURE__*/styled.div.withConfig({
70536
70567
  var Controls$2 = /*#__PURE__*/styled.div.withConfig({
70537
70568
  displayName: "StorePacksSection__Controls",
70538
70569
  componentId: "sc-ulazq3-7"
70539
- })(["display:flex;align-items:center;flex-shrink:0;"]);
70570
+ })(["display:flex;align-items:center;gap:0.5rem;flex-shrink:0;"]);
70571
+ var ArrowsContainer$1 = /*#__PURE__*/styled.div.withConfig({
70572
+ displayName: "StorePacksSection__ArrowsContainer",
70573
+ componentId: "sc-ulazq3-8"
70574
+ })(["position:relative;display:flex;align-items:center;width:120px;height:42px;justify-content:space-between;"]);
70575
+ var QuantityInput$1 = /*#__PURE__*/styled.input.withConfig({
70576
+ displayName: "StorePacksSection__QuantityInput",
70577
+ componentId: "sc-ulazq3-9"
70578
+ })(["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
70579
 
70541
70580
  var StoreItemDetails = function StoreItemDetails(_ref) {
70542
70581
  var item = _ref.item,
@@ -70632,7 +70671,8 @@ var Store = function Store(_ref) {
70632
70671
  customPacksContent = _ref.customPacksContent,
70633
70672
  customWalletContent = _ref.customWalletContent,
70634
70673
  _ref$packsTabLabel = _ref.packsTabLabel,
70635
- packsTabLabel = _ref$packsTabLabel === void 0 ? 'Packs' : _ref$packsTabLabel;
70674
+ packsTabLabel = _ref$packsTabLabel === void 0 ? 'Packs' : _ref$packsTabLabel,
70675
+ packsBadge = _ref.packsBadge;
70636
70676
  var _useState = useState(null),
70637
70677
  selectedPack = _useState[0],
70638
70678
  setSelectedPack = _useState[1];
@@ -70663,7 +70703,10 @@ var Store = function Store(_ref) {
70663
70703
  var _useState4 = useState(null),
70664
70704
  currentMetadataItem = _useState4[0],
70665
70705
  setCurrentMetadataItem = _useState4[1];
70666
- var handleAddPackToCart = function handleAddPackToCart(pack) {
70706
+ var handleAddPackToCart = function handleAddPackToCart(pack, quantity) {
70707
+ if (quantity === void 0) {
70708
+ quantity = 1;
70709
+ }
70667
70710
  var packItem = {
70668
70711
  key: pack.key,
70669
70712
  name: pack.title,
@@ -70695,7 +70738,7 @@ var Store = function Store(_ref) {
70695
70738
  maxStackSize: 1,
70696
70739
  isUsable: false
70697
70740
  };
70698
- handleAddToCart(packItem, 1);
70741
+ handleAddToCart(packItem, quantity);
70699
70742
  };
70700
70743
  var filterItems = function filterItems(itemsToFilter, type) {
70701
70744
  return itemsToFilter.filter(function (item) {
@@ -70762,7 +70805,11 @@ var Store = function Store(_ref) {
70762
70805
  },
70763
70806
  packs: {
70764
70807
  id: 'packs',
70765
- title: packsTabLabel,
70808
+ title: packsBadge ? React.createElement(TabLabelWithBadge, null, packsTabLabel, React.createElement(LabelPill, {
70809
+ background: "#f59e0b",
70810
+ borderColor: "#f59e0b",
70811
+ color: "#000"
70812
+ }, packsBadge)) : packsTabLabel,
70766
70813
  icon: React.createElement(Gift, {
70767
70814
  width: 18,
70768
70815
  height: 18
@@ -70920,13 +70967,17 @@ var CartInfo = /*#__PURE__*/styled.div.withConfig({
70920
70967
  displayName: "Store__CartInfo",
70921
70968
  componentId: "sc-64dj00-8"
70922
70969
  })(["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;}"]);
70970
+ var TabLabelWithBadge = /*#__PURE__*/styled.span.withConfig({
70971
+ displayName: "Store__TabLabelWithBadge",
70972
+ componentId: "sc-64dj00-9"
70973
+ })(["display:inline-flex;align-items:center;gap:5px;"]);
70923
70974
  var LoadingMessage$1 = /*#__PURE__*/styled.div.withConfig({
70924
70975
  displayName: "Store__LoadingMessage",
70925
- componentId: "sc-64dj00-9"
70976
+ componentId: "sc-64dj00-10"
70926
70977
  })(["text-align:center;color:", ";padding:2rem;"], uiColors.white);
70927
70978
  var ErrorMessage$3 = /*#__PURE__*/styled.div.withConfig({
70928
70979
  displayName: "Store__ErrorMessage",
70929
- componentId: "sc-64dj00-10"
70980
+ componentId: "sc-64dj00-11"
70930
70981
  })(["text-align:center;color:", ";padding:2rem;"], uiColors.red);
70931
70982
 
70932
70983
  var PaymentMethodModal = function PaymentMethodModal(_ref) {
@@ -71252,7 +71303,7 @@ var TradingItemRow = function TradingItemRow(_ref) {
71252
71303
  onPointerDown: function onPointerDown() {
71253
71304
  return onLeftClick();
71254
71305
  }
71255
- }), React.createElement(QuantityInput$1, {
71306
+ }), React.createElement(QuantityInput$2, {
71256
71307
  type: "text",
71257
71308
  value: inputQty,
71258
71309
  onChange: handleQuantityChange,
@@ -71302,7 +71353,7 @@ var QuantityContainer$1 = /*#__PURE__*/styled.div.withConfig({
71302
71353
  displayName: "TradingItemRow__QuantityContainer",
71303
71354
  componentId: "sc-mja0b5-6"
71304
71355
  })(["display:flex;min-width:90px;width:40%;justify-content:flex-end;align-items:center;flex:30%;gap:2px;position:relative;"]);
71305
- var QuantityInput$1 = /*#__PURE__*/styled.input.withConfig({
71356
+ var QuantityInput$2 = /*#__PURE__*/styled.input.withConfig({
71306
71357
  displayName: "TradingItemRow__QuantityInput",
71307
71358
  componentId: "sc-mja0b5-7"
71308
71359
  })(["width:30px;text-align:center;background-color:", ";color:white;border:none;padding:1px;font-size:", ";position:relative;right:4px;"], uiColors.darkGray, uiFonts.size.small);