@rpg-engine/long-bow 0.8.154 → 0.8.156
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/Marketplace/BuyPanel.d.ts +1 -0
- package/dist/components/Marketplace/Marketplace.d.ts +1 -0
- package/dist/components/Marketplace/MarketplaceRows.d.ts +2 -0
- package/dist/long-bow.cjs.development.js +44 -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 +44 -30
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Marketplace/BuyPanel.tsx +38 -28
- package/src/components/Marketplace/Marketplace.tsx +1 -0
- package/src/components/Marketplace/MarketplaceRows.tsx +16 -3
- package/src/stories/Features/trading/Marketplace.stories.tsx +7 -1
|
@@ -17,6 +17,7 @@ export interface IBuyPanelProps {
|
|
|
17
17
|
equipmentSet?: IEquipmentSet | null;
|
|
18
18
|
onMarketPlaceItemBuy?: (marketPlaceItemId: string, paymentMethod?: MarketplacePaymentMethod) => void;
|
|
19
19
|
onFulfillBuyOrder?: (buyOrderId: string) => void;
|
|
20
|
+
onDCCoinClick?: () => void;
|
|
20
21
|
characterId: string;
|
|
21
22
|
enableHotkeys?: () => void;
|
|
22
23
|
disableHotkeys?: () => void;
|
|
@@ -18,6 +18,7 @@ export interface IMarketPlaceProps {
|
|
|
18
18
|
equipmentSet?: IEquipmentSet | null;
|
|
19
19
|
onMarketPlaceItemBuy?: (marketPlaceItemId: string, paymentMethod?: MarketplacePaymentMethod) => void;
|
|
20
20
|
onFulfillBuyOrder?: (buyOrderId: string) => void;
|
|
21
|
+
onDCCoinClick?: () => void;
|
|
21
22
|
onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;
|
|
22
23
|
availableGold: number;
|
|
23
24
|
selectedItemToSell: IItem | null;
|
|
@@ -10,6 +10,7 @@ export interface IMarketPlaceRowsPropos {
|
|
|
10
10
|
scale?: number;
|
|
11
11
|
onMarketPlaceItemBuy?: () => void;
|
|
12
12
|
onMarketPlaceItemRemove?: () => void;
|
|
13
|
+
onDCCoinClick?: () => void;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare const MarketplaceRows: React.FC<IMarketPlaceRowsPropos>;
|
|
@@ -23,5 +24,6 @@ export interface IGroupedMarketplaceRowProps {
|
|
|
23
24
|
getDCEquivalentPrice: (goldPrice: number) => number;
|
|
24
25
|
characterId: string;
|
|
25
26
|
onBuy: (id: string) => void;
|
|
27
|
+
onDCCoinClick?: () => void;
|
|
26
28
|
}
|
|
27
29
|
export declare const GroupedMarketplaceRow: React.FC<IGroupedMarketplaceRowProps>;
|
|
@@ -45704,6 +45704,7 @@ var MarketplaceRows = function MarketplaceRows(_ref) {
|
|
|
45704
45704
|
scale = _ref.scale,
|
|
45705
45705
|
onMarketPlaceItemBuy = _ref.onMarketPlaceItemBuy,
|
|
45706
45706
|
onMarketPlaceItemRemove = _ref.onMarketPlaceItemRemove,
|
|
45707
|
+
onDCCoinClick = _ref.onDCCoinClick,
|
|
45707
45708
|
disabled = _ref.disabled;
|
|
45708
45709
|
var renderGems = function renderGems(item) {
|
|
45709
45710
|
return item.attachedGems && onRenderGems(item);
|
|
@@ -45739,8 +45740,11 @@ var MarketplaceRows = function MarketplaceRows(_ref) {
|
|
|
45739
45740
|
atlasJSON: atlasJSON,
|
|
45740
45741
|
spriteKey: "others/gold-coin-qty-5.png",
|
|
45741
45742
|
imgScale: 1
|
|
45742
|
-
}))), React__default.createElement(GoldPrice$1, null, itemPrice)), dcEquivalentPrice !== undefined && React__default.createElement(DCPriceRow,
|
|
45743
|
-
|
|
45743
|
+
}))), React__default.createElement(GoldPrice$1, null, itemPrice)), dcEquivalentPrice !== undefined && React__default.createElement(DCPriceRow, {
|
|
45744
|
+
"$clickable": !!onDCCoinClick,
|
|
45745
|
+
onPointerDown: onDCCoinClick
|
|
45746
|
+
}, React__default.createElement(DCCoinWrapper, null, React__default.createElement(SimpleTooltip, {
|
|
45747
|
+
content: onDCCoinClick ? 'Buy Definya Coin' : 'Definya Coin',
|
|
45744
45748
|
direction: "top"
|
|
45745
45749
|
}, React__default.createElement(SpriteFromAtlas, {
|
|
45746
45750
|
atlasIMG: atlasIMG,
|
|
@@ -45775,7 +45779,8 @@ var GroupedMarketplaceRow = function GroupedMarketplaceRow(_ref2) {
|
|
|
45775
45779
|
dcToGoldSwapRate = _ref2$dcToGoldSwapRat === void 0 ? 0 : _ref2$dcToGoldSwapRat,
|
|
45776
45780
|
getDCEquivalentPrice = _ref2.getDCEquivalentPrice,
|
|
45777
45781
|
characterId = _ref2.characterId,
|
|
45778
|
-
onBuy = _ref2.onBuy
|
|
45782
|
+
onBuy = _ref2.onBuy,
|
|
45783
|
+
onDCCoinClick = _ref2.onDCCoinClick;
|
|
45779
45784
|
var _useState = React.useState(false),
|
|
45780
45785
|
expanded = _useState[0],
|
|
45781
45786
|
setExpanded = _useState[1];
|
|
@@ -45796,6 +45801,7 @@ var GroupedMarketplaceRow = function GroupedMarketplaceRow(_ref2) {
|
|
|
45796
45801
|
onMarketPlaceItemBuy: function onMarketPlaceItemBuy() {
|
|
45797
45802
|
return onBuy(bestListing._id);
|
|
45798
45803
|
},
|
|
45804
|
+
onDCCoinClick: onDCCoinClick,
|
|
45799
45805
|
disabled: bestListing.owner === characterId
|
|
45800
45806
|
}), hasMultiple && React__default.createElement(GroupMeta, null, React__default.createElement(OfferBadge, null, totalOffers, " offers"), React__default.createElement(Chevron, {
|
|
45801
45807
|
expanded: expanded
|
|
@@ -45811,6 +45817,7 @@ var GroupedMarketplaceRow = function GroupedMarketplaceRow(_ref2) {
|
|
|
45811
45817
|
onMarketPlaceItemBuy: function onMarketPlaceItemBuy() {
|
|
45812
45818
|
return onBuy(listing._id);
|
|
45813
45819
|
},
|
|
45820
|
+
onDCCoinClick: onDCCoinClick,
|
|
45814
45821
|
disabled: listing.owner === characterId
|
|
45815
45822
|
});
|
|
45816
45823
|
})));
|
|
@@ -45884,7 +45891,13 @@ var GoldPrice$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
|
45884
45891
|
var DCPriceRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
45885
45892
|
displayName: "MarketplaceRows__DCPriceRow",
|
|
45886
45893
|
componentId: "sc-wmpr1o-15"
|
|
45887
|
-
})(["display:flex;align-items:center;gap:0.3rem;margin-left:0.5rem;"])
|
|
45894
|
+
})(["display:flex;align-items:center;gap:0.3rem;margin-left:0.5rem;cursor:", ";border-radius:4px;transition:opacity 0.15s;&:hover{opacity:", ";}"], function (_ref5) {
|
|
45895
|
+
var $clickable = _ref5.$clickable;
|
|
45896
|
+
return $clickable ? 'pointer' : 'default';
|
|
45897
|
+
}, function (_ref6) {
|
|
45898
|
+
var $clickable = _ref6.$clickable;
|
|
45899
|
+
return $clickable ? '0.75' : '1';
|
|
45900
|
+
});
|
|
45888
45901
|
var DCCoinWrapper = /*#__PURE__*/styled__default.span.withConfig({
|
|
45889
45902
|
displayName: "MarketplaceRows__DCCoinWrapper",
|
|
45890
45903
|
componentId: "sc-wmpr1o-16"
|
|
@@ -45908,14 +45921,14 @@ var GemContainer = /*#__PURE__*/styled__default.p.withConfig({
|
|
|
45908
45921
|
var RarityContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
45909
45922
|
displayName: "MarketplaceRows__RarityContainer",
|
|
45910
45923
|
componentId: "sc-wmpr1o-21"
|
|
45911
|
-
})(["border-color:", ";box-shadow:", " inset,", ";width:32px;height:32px;"], function (
|
|
45912
|
-
var item =
|
|
45924
|
+
})(["border-color:", ";box-shadow:", " inset,", ";width:32px;height:32px;"], function (_ref7) {
|
|
45925
|
+
var item = _ref7.item;
|
|
45913
45926
|
return rarityColor(item);
|
|
45914
|
-
}, function (
|
|
45915
|
-
var item =
|
|
45927
|
+
}, function (_ref8) {
|
|
45928
|
+
var item = _ref8.item;
|
|
45916
45929
|
return "0 0 5px 8px " + rarityColor(item);
|
|
45917
|
-
}, function (
|
|
45918
|
-
var item =
|
|
45930
|
+
}, function (_ref9) {
|
|
45931
|
+
var item = _ref9.item;
|
|
45919
45932
|
return "0 0 8px 6px " + rarityColor(item);
|
|
45920
45933
|
});
|
|
45921
45934
|
|
|
@@ -45983,6 +45996,7 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
45983
45996
|
equipmentSet = _ref.equipmentSet,
|
|
45984
45997
|
onMarketPlaceItemBuy = _ref.onMarketPlaceItemBuy,
|
|
45985
45998
|
onFulfillBuyOrder = _ref.onFulfillBuyOrder,
|
|
45999
|
+
onDCCoinClick = _ref.onDCCoinClick,
|
|
45986
46000
|
characterId = _ref.characterId,
|
|
45987
46001
|
enableHotkeys = _ref.enableHotkeys,
|
|
45988
46002
|
disableHotkeys = _ref.disableHotkeys,
|
|
@@ -46000,14 +46014,16 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46000
46014
|
openBuyOrdersTotal = _ref$openBuyOrdersTot === void 0 ? 0 : _ref$openBuyOrdersTot,
|
|
46001
46015
|
_ref$openBuyOrdersPag = _ref.openBuyOrdersPage,
|
|
46002
46016
|
openBuyOrdersPage = _ref$openBuyOrdersPag === void 0 ? 1 : _ref$openBuyOrdersPag,
|
|
46003
|
-
onOpenBuyOrdersPageChange = _ref.onOpenBuyOrdersPageChange
|
|
46017
|
+
onOpenBuyOrdersPageChange = _ref.onOpenBuyOrdersPageChange,
|
|
46018
|
+
_ref$isLoading = _ref.isLoading,
|
|
46019
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
46004
46020
|
var _useState = React.useState(''),
|
|
46005
46021
|
name = _useState[0],
|
|
46006
46022
|
setName = _useState[1];
|
|
46007
46023
|
var _useState2 = React.useState(false),
|
|
46008
46024
|
showFilters = _useState2[0],
|
|
46009
46025
|
setShowFilters = _useState2[1];
|
|
46010
|
-
var _useState3 = React.useState('
|
|
46026
|
+
var _useState3 = React.useState('sell'),
|
|
46011
46027
|
browseMode = _useState3[0],
|
|
46012
46028
|
setBrowseMode = _useState3[1];
|
|
46013
46029
|
var _useState4 = React.useState(''),
|
|
@@ -46081,8 +46097,8 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46081
46097
|
return true;
|
|
46082
46098
|
});
|
|
46083
46099
|
}, [name, openBuyOrders, price, selectedRarity]);
|
|
46084
|
-
var showSellSection = browseMode === '
|
|
46085
|
-
var showBuySection = browseMode === '
|
|
46100
|
+
var showSellSection = browseMode === 'sell';
|
|
46101
|
+
var showBuySection = browseMode === 'buy';
|
|
46086
46102
|
var hasVisibleContent = showSellSection && groupedItems.length > 0 || showBuySection && visibleBuyOrders.length > 0;
|
|
46087
46103
|
return React__default.createElement(React__default.Fragment, null, buyingItemId && buyingItem && hasDCBalance && React__default.createElement(MarketplaceBuyModal, {
|
|
46088
46104
|
goldPrice: buyingItem.price,
|
|
@@ -46118,9 +46134,6 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46118
46134
|
return setBrowseMode(value);
|
|
46119
46135
|
},
|
|
46120
46136
|
options: [{
|
|
46121
|
-
id: 'all',
|
|
46122
|
-
label: 'All'
|
|
46123
|
-
}, {
|
|
46124
46137
|
id: 'sell',
|
|
46125
46138
|
label: 'Sell Offers'
|
|
46126
46139
|
}, {
|
|
@@ -46239,7 +46252,7 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46239
46252
|
}))))), React__default.createElement(ItemComponentScrollWrapper$1, {
|
|
46240
46253
|
id: "MarketContainer",
|
|
46241
46254
|
ref: itemsContainer
|
|
46242
|
-
},
|
|
46255
|
+
}, isLoading ? React__default.createElement(LoadingState, null, React__default.createElement(Spinner$2, null), React__default.createElement(LoadingText$1, null, "Loading marketplace...")) : !hasVisibleContent ? React__default.createElement(LoadingState, null, React__default.createElement(LoadingText$1, null, "No items listed.")) : React__default.createElement(React__default.Fragment, null, showSellSection && React__default.createElement(MarketSection, null, React__default.createElement(SectionHeader, null, React__default.createElement(SectionTitle$2, null, "Sell Offers"), React__default.createElement(SectionMeta, null, groupedItems.length, " groups")), groupedItems.length === 0 ? React__default.createElement(SectionEmpty, null, "No sell offers found.") : groupedItems.map(function (_ref2) {
|
|
46243
46256
|
var bestListing = _ref2.bestListing,
|
|
46244
46257
|
otherListings = _ref2.otherListings;
|
|
46245
46258
|
return React__default.createElement(GroupedMarketplaceRow, {
|
|
@@ -46252,14 +46265,10 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46252
46265
|
dcToGoldSwapRate: dcToGoldSwapRate,
|
|
46253
46266
|
getDCEquivalentPrice: getDCEquivalentPrice,
|
|
46254
46267
|
characterId: characterId,
|
|
46255
|
-
onBuy: setBuyingItemId
|
|
46268
|
+
onBuy: setBuyingItemId,
|
|
46269
|
+
onDCCoinClick: onDCCoinClick
|
|
46256
46270
|
});
|
|
46257
|
-
}),
|
|
46258
|
-
totalItems: totalItems,
|
|
46259
|
-
currentPage: currentPage,
|
|
46260
|
-
itemsPerPage: itemsPerPage,
|
|
46261
|
-
onPageChange: onPageChange
|
|
46262
|
-
}))), showBuySection && React__default.createElement(MarketSection, null, React__default.createElement(SectionHeader, null, React__default.createElement(SectionTitle$2, null, "Buy Requests"), React__default.createElement(SectionMeta, null, visibleBuyOrders.length, " visible")), visibleBuyOrders.length === 0 ? React__default.createElement(SectionEmpty, null, "No public buy requests found.") : visibleBuyOrders.map(function (order) {
|
|
46271
|
+
})), showBuySection && React__default.createElement(MarketSection, null, React__default.createElement(SectionHeader, null, React__default.createElement(SectionTitle$2, null, "Buy Requests"), React__default.createElement(SectionMeta, null, visibleBuyOrders.length, " visible")), visibleBuyOrders.length === 0 ? React__default.createElement(SectionEmpty, null, "No public buy requests found.") : visibleBuyOrders.map(function (order) {
|
|
46263
46272
|
return React__default.createElement(BuyOrderRow, {
|
|
46264
46273
|
key: order._id,
|
|
46265
46274
|
buyOrder: order,
|
|
@@ -46268,12 +46277,17 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46268
46277
|
onFulfill: setFulfillingBuyOrderId,
|
|
46269
46278
|
showRequestTag: true
|
|
46270
46279
|
});
|
|
46271
|
-
}),
|
|
46280
|
+
})))), React__default.createElement(PagerFooter, null, showSellSection && totalItems > itemsPerPage && React__default.createElement(Pager, {
|
|
46281
|
+
totalItems: totalItems,
|
|
46282
|
+
currentPage: currentPage,
|
|
46283
|
+
itemsPerPage: itemsPerPage,
|
|
46284
|
+
onPageChange: onPageChange
|
|
46285
|
+
}), showBuySection && openBuyOrdersTotal > BUY_REQUESTS_PER_PAGE && React__default.createElement(Pager, {
|
|
46272
46286
|
totalItems: openBuyOrdersTotal,
|
|
46273
46287
|
currentPage: openBuyOrdersPage,
|
|
46274
46288
|
itemsPerPage: BUY_REQUESTS_PER_PAGE,
|
|
46275
46289
|
onPageChange: onOpenBuyOrdersPageChange != null ? onOpenBuyOrdersPageChange : function () {}
|
|
46276
|
-
})))
|
|
46290
|
+
})));
|
|
46277
46291
|
};
|
|
46278
46292
|
var ToolbarRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
46279
46293
|
displayName: "BuyPanel__ToolbarRow",
|
|
@@ -46339,10 +46353,10 @@ var SectionEmpty = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
46339
46353
|
displayName: "BuyPanel__SectionEmpty",
|
|
46340
46354
|
componentId: "sc-1si8t7i-12"
|
|
46341
46355
|
})(["min-height:56px;display:flex;align-items:center;justify-content:center;color:#71717a;font-size:0.48rem;text-transform:uppercase;letter-spacing:1px;background:rgba(255,255,255,0.03);border:1px dashed rgba(255,255,255,0.08);border-radius:6px;"]);
|
|
46342
|
-
var
|
|
46343
|
-
displayName: "
|
|
46356
|
+
var PagerFooter = /*#__PURE__*/styled__default.div.withConfig({
|
|
46357
|
+
displayName: "BuyPanel__PagerFooter",
|
|
46344
46358
|
componentId: "sc-1si8t7i-13"
|
|
46345
|
-
})(["display:flex;justify-content:center;
|
|
46359
|
+
})(["display:flex;justify-content:center;align-items:center;padding:8px 0 4px;min-height:36px;width:95%;margin:0 auto;"]);
|
|
46346
46360
|
var StyledDropdown$4 = /*#__PURE__*/styled__default(Dropdown).withConfig({
|
|
46347
46361
|
displayName: "BuyPanel__StyledDropdown",
|
|
46348
46362
|
componentId: "sc-1si8t7i-14"
|