@rpg-engine/long-bow 0.8.146 → 0.8.149
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/BlueprintSearchModal.d.ts +2 -0
- package/dist/components/Marketplace/BuyOrderDetailsModal.d.ts +2 -0
- package/dist/components/Marketplace/BuyOrderPanel.d.ts +2 -0
- package/dist/components/Marketplace/BuyPanel.d.ts +1 -0
- package/dist/components/Marketplace/Marketplace.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +188 -88
- 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 +188 -88
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Marketplace/BlueprintSearchModal.tsx +79 -25
- package/src/components/Marketplace/BuyOrderDetailsModal.tsx +8 -0
- package/src/components/Marketplace/BuyOrderPanel.tsx +50 -15
- package/src/components/Marketplace/BuyPanel.tsx +40 -2
- package/src/components/Marketplace/HistoryPanel.tsx +1 -1
- package/src/components/Marketplace/Marketplace.tsx +7 -1
- package/src/stories/Features/marketplace/HistoryPanel.stories.tsx +3 -3
- package/src/stories/Features/trading/Marketplace.stories.tsx +3 -3
|
@@ -11,6 +11,8 @@ export interface IBlueprintSearchModalProps {
|
|
|
11
11
|
isLoading: boolean;
|
|
12
12
|
atlasJSON: any;
|
|
13
13
|
atlasIMG: any;
|
|
14
|
+
enableHotkeys?: () => void;
|
|
15
|
+
disableHotkeys?: () => void;
|
|
14
16
|
}
|
|
15
17
|
declare const BLUEPRINTS_PER_PAGE = 10;
|
|
16
18
|
export declare const BlueprintSearchModal: React.FC<IBlueprintSearchModalProps>;
|
|
@@ -18,6 +18,8 @@ export interface IBuyOrderPanelProps {
|
|
|
18
18
|
yourBuyOrdersPage: number;
|
|
19
19
|
onYourBuyOrdersPageChange: (page: number) => void;
|
|
20
20
|
onCancelBuyOrder: (buyOrderId: string) => void;
|
|
21
|
+
enableHotkeys?: () => void;
|
|
22
|
+
disableHotkeys?: () => void;
|
|
21
23
|
}
|
|
22
24
|
declare const BUY_ORDERS_PER_PAGE = 5;
|
|
23
25
|
export declare const BuyOrderPanel: React.FC<IBuyOrderPanelProps>;
|
|
@@ -37,6 +37,7 @@ export interface IMarketPlaceProps {
|
|
|
37
37
|
acceptedCurrency?: MarketplaceAcceptedCurrency;
|
|
38
38
|
onAcceptedCurrencyChange?: (value: MarketplaceAcceptedCurrency) => void;
|
|
39
39
|
onActiveTabChange?: (tab: string) => void;
|
|
40
|
+
isLoading?: boolean;
|
|
40
41
|
buyOrderSelectedBlueprint?: IMarketplaceBlueprintSummary;
|
|
41
42
|
buyOrderQuantity?: number;
|
|
42
43
|
buyOrderMaxPrice?: number;
|
|
@@ -44619,7 +44619,9 @@ var BlueprintSearchModal = function BlueprintSearchModal(_ref) {
|
|
|
44619
44619
|
currentPage = _ref.currentPage,
|
|
44620
44620
|
isLoading = _ref.isLoading,
|
|
44621
44621
|
atlasJSON = _ref.atlasJSON,
|
|
44622
|
-
atlasIMG = _ref.atlasIMG
|
|
44622
|
+
atlasIMG = _ref.atlasIMG,
|
|
44623
|
+
enableHotkeys = _ref.enableHotkeys,
|
|
44624
|
+
disableHotkeys = _ref.disableHotkeys;
|
|
44623
44625
|
var _useState = React.useState(''),
|
|
44624
44626
|
searchName = _useState[0],
|
|
44625
44627
|
setSearchName = _useState[1];
|
|
@@ -44629,24 +44631,40 @@ var BlueprintSearchModal = function BlueprintSearchModal(_ref) {
|
|
|
44629
44631
|
var _useState3 = React.useState(''),
|
|
44630
44632
|
selectedSubType = _useState3[0],
|
|
44631
44633
|
setSelectedSubType = _useState3[1];
|
|
44632
|
-
|
|
44633
|
-
var
|
|
44634
|
+
var searchNameRef = React.useRef(searchName);
|
|
44635
|
+
var selectedTypeRef = React.useRef(selectedType);
|
|
44636
|
+
var selectedSubTypeRef = React.useRef(selectedSubType);
|
|
44637
|
+
searchNameRef.current = searchName;
|
|
44638
|
+
selectedTypeRef.current = selectedType;
|
|
44639
|
+
selectedSubTypeRef.current = selectedSubType;
|
|
44640
|
+
var triggerSearch = React.useCallback(function (overrides) {
|
|
44634
44641
|
var _overrides$name, _overrides$itemType, _overrides$itemSubTyp, _overrides$page;
|
|
44635
44642
|
onSearch({
|
|
44636
44643
|
npcId: '',
|
|
44637
|
-
name: (_overrides$name = overrides == null ? void 0 : overrides.name) != null ? _overrides$name :
|
|
44638
|
-
itemType: (_overrides$itemType = overrides == null ? void 0 : overrides.itemType) != null ? _overrides$itemType :
|
|
44639
|
-
itemSubType: (_overrides$itemSubTyp = overrides == null ? void 0 : overrides.itemSubType) != null ? _overrides$itemSubTyp :
|
|
44644
|
+
name: (_overrides$name = overrides == null ? void 0 : overrides.name) != null ? _overrides$name : searchNameRef.current,
|
|
44645
|
+
itemType: (_overrides$itemType = overrides == null ? void 0 : overrides.itemType) != null ? _overrides$itemType : selectedTypeRef.current,
|
|
44646
|
+
itemSubType: (_overrides$itemSubTyp = overrides == null ? void 0 : overrides.itemSubType) != null ? _overrides$itemSubTyp : selectedSubTypeRef.current,
|
|
44640
44647
|
page: (_overrides$page = overrides == null ? void 0 : overrides.page) != null ? _overrides$page : 1,
|
|
44641
44648
|
limit: BLUEPRINTS_PER_PAGE
|
|
44642
44649
|
});
|
|
44643
|
-
};
|
|
44650
|
+
}, [onSearch]);
|
|
44651
|
+
var debouncedNameSearch = React.useMemo(function () {
|
|
44652
|
+
return lodash.debounce(function (name) {
|
|
44653
|
+
return triggerSearch({
|
|
44654
|
+
name: name,
|
|
44655
|
+
page: 1
|
|
44656
|
+
});
|
|
44657
|
+
}, 300);
|
|
44658
|
+
}, [triggerSearch]);
|
|
44659
|
+
React.useEffect(function () {
|
|
44660
|
+
return function () {
|
|
44661
|
+
debouncedNameSearch.cancel();
|
|
44662
|
+
};
|
|
44663
|
+
}, [debouncedNameSearch]);
|
|
44664
|
+
if (!isOpen) return null;
|
|
44644
44665
|
var handleNameChange = function handleNameChange(e) {
|
|
44645
44666
|
setSearchName(e.target.value);
|
|
44646
|
-
|
|
44647
|
-
name: e.target.value,
|
|
44648
|
-
page: 1
|
|
44649
|
-
});
|
|
44667
|
+
debouncedNameSearch(e.target.value);
|
|
44650
44668
|
};
|
|
44651
44669
|
var handleTypeChange = function handleTypeChange(value) {
|
|
44652
44670
|
setSelectedType(value);
|
|
@@ -44686,7 +44704,9 @@ var BlueprintSearchModal = function BlueprintSearchModal(_ref) {
|
|
|
44686
44704
|
}, React__default.createElement(fa.FaTimes, null))), React__default.createElement(InputWrapper, null, React__default.createElement("p", null, "SEARCH"), React__default.createElement(StyledInput$2, {
|
|
44687
44705
|
value: searchName,
|
|
44688
44706
|
onChange: handleNameChange,
|
|
44689
|
-
placeholder: "Search by name..."
|
|
44707
|
+
placeholder: "Search by name...",
|
|
44708
|
+
onFocus: disableHotkeys,
|
|
44709
|
+
onBlur: enableHotkeys
|
|
44690
44710
|
})), React__default.createElement(FiltersRow, null, React__default.createElement(StyledDropdown$2, {
|
|
44691
44711
|
key: "type-" + selectedType,
|
|
44692
44712
|
options: typeOptions,
|
|
@@ -44697,12 +44717,14 @@ var BlueprintSearchModal = function BlueprintSearchModal(_ref) {
|
|
|
44697
44717
|
options: subTypeOptions,
|
|
44698
44718
|
onChange: handleSubTypeChange,
|
|
44699
44719
|
width: "100%"
|
|
44700
|
-
})), React__default.createElement(ResultsWrapper, null,
|
|
44720
|
+
})), React__default.createElement(ResultsWrapper, null, blueprints.length === 0 && !isLoading ? React__default.createElement(EmptyState$2, null, "No items found") : React__default.createElement(ResultsContent, {
|
|
44721
|
+
"$dimmed": isLoading
|
|
44722
|
+
}, React__default.createElement(BlueprintTable, {
|
|
44701
44723
|
blueprints: blueprints,
|
|
44702
44724
|
atlasJSON: atlasJSON,
|
|
44703
44725
|
atlasIMG: atlasIMG,
|
|
44704
44726
|
onSelect: onSelect
|
|
44705
|
-
})), React__default.createElement(PagerContainer$1, null, React__default.createElement(Pager, {
|
|
44727
|
+
})), isLoading && React__default.createElement(LoadingOverlay, null, React__default.createElement(LoadingText, null, "Loading..."))), React__default.createElement(PagerContainer$1, null, React__default.createElement(Pager, {
|
|
44706
44728
|
totalItems: totalCount,
|
|
44707
44729
|
currentPage: currentPage,
|
|
44708
44730
|
itemsPerPage: BLUEPRINTS_PER_PAGE,
|
|
@@ -44752,16 +44774,66 @@ var StyledDropdown$2 = /*#__PURE__*/styled__default(Dropdown).withConfig({
|
|
|
44752
44774
|
var ResultsWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
44753
44775
|
displayName: "BlueprintSearchModal__ResultsWrapper",
|
|
44754
44776
|
componentId: "sc-i7bssq-10"
|
|
44755
|
-
})(["overflow-y:auto;
|
|
44777
|
+
})(["position:relative;overflow-y:auto;height:320px;background:rgba(0,0,0,0.2);border:1px solid rgba(255,255,255,0.05);border-radius:4px;"]);
|
|
44778
|
+
var ResultsContent = /*#__PURE__*/styled__default.div.withConfig({
|
|
44779
|
+
displayName: "BlueprintSearchModal__ResultsContent",
|
|
44780
|
+
componentId: "sc-i7bssq-11"
|
|
44781
|
+
})(["opacity:", ";transition:opacity 0.15s ease;"], function (p) {
|
|
44782
|
+
return p.$dimmed ? 0.4 : 1;
|
|
44783
|
+
});
|
|
44784
|
+
var LoadingOverlay = /*#__PURE__*/styled__default.div.withConfig({
|
|
44785
|
+
displayName: "BlueprintSearchModal__LoadingOverlay",
|
|
44786
|
+
componentId: "sc-i7bssq-12"
|
|
44787
|
+
})(["position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;"]);
|
|
44788
|
+
var LoadingText = /*#__PURE__*/styled__default.span.withConfig({
|
|
44789
|
+
displayName: "BlueprintSearchModal__LoadingText",
|
|
44790
|
+
componentId: "sc-i7bssq-13"
|
|
44791
|
+
})(["font-size:0.55rem;color:#f59e0b;text-transform:uppercase;letter-spacing:1px;"]);
|
|
44756
44792
|
var EmptyState$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44757
44793
|
displayName: "BlueprintSearchModal__EmptyState",
|
|
44758
|
-
componentId: "sc-i7bssq-
|
|
44759
|
-
})(["display:flex;align-items:center;justify-content:center;height:
|
|
44794
|
+
componentId: "sc-i7bssq-14"
|
|
44795
|
+
})(["display:flex;align-items:center;justify-content:center;height:100%;font-size:0.55rem;color:#666;text-transform:uppercase;letter-spacing:1px;"]);
|
|
44760
44796
|
var PagerContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
44761
44797
|
displayName: "BlueprintSearchModal__PagerContainer",
|
|
44762
|
-
componentId: "sc-i7bssq-
|
|
44798
|
+
componentId: "sc-i7bssq-15"
|
|
44763
44799
|
})(["display:flex;justify-content:center;align-items:center;"]);
|
|
44764
44800
|
|
|
44801
|
+
var SegmentedToggle = function SegmentedToggle(_ref) {
|
|
44802
|
+
var options = _ref.options,
|
|
44803
|
+
activeId = _ref.activeId,
|
|
44804
|
+
onChange = _ref.onChange,
|
|
44805
|
+
className = _ref.className;
|
|
44806
|
+
return React__default.createElement(Container$B, {
|
|
44807
|
+
className: className
|
|
44808
|
+
}, options.map(function (option) {
|
|
44809
|
+
return React__default.createElement(OptionButton, {
|
|
44810
|
+
key: option.id,
|
|
44811
|
+
type: "button",
|
|
44812
|
+
"$active": option.id === activeId,
|
|
44813
|
+
onClick: function onClick() {
|
|
44814
|
+
return onChange(option.id);
|
|
44815
|
+
}
|
|
44816
|
+
}, option.label);
|
|
44817
|
+
}));
|
|
44818
|
+
};
|
|
44819
|
+
var Container$B = /*#__PURE__*/styled__default.div.withConfig({
|
|
44820
|
+
displayName: "SegmentedToggle__Container",
|
|
44821
|
+
componentId: "sc-1itx2kn-0"
|
|
44822
|
+
})(["display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;"]);
|
|
44823
|
+
var OptionButton = /*#__PURE__*/styled__default.button.withConfig({
|
|
44824
|
+
displayName: "SegmentedToggle__OptionButton",
|
|
44825
|
+
componentId: "sc-1itx2kn-1"
|
|
44826
|
+
})(["border:1px solid ", ";background:", ";color:", ";border-radius:999px;padding:8px 12px;cursor:pointer;font-size:0.56rem;text-transform:uppercase;letter-spacing:0.8px;transition:background 0.15s ease,border-color 0.15s ease,color 0.15s ease;&:hover{border-color:rgba(245,158,11,0.45);color:#fde68a;}"], function (_ref2) {
|
|
44827
|
+
var $active = _ref2.$active;
|
|
44828
|
+
return $active ? 'rgba(245, 158, 11, 0.75)' : 'rgba(255, 255, 255, 0.08)';
|
|
44829
|
+
}, function (_ref3) {
|
|
44830
|
+
var $active = _ref3.$active;
|
|
44831
|
+
return $active ? 'rgba(245, 158, 11, 0.16)' : 'rgba(0, 0, 0, 0.18)';
|
|
44832
|
+
}, function (_ref4) {
|
|
44833
|
+
var $active = _ref4.$active;
|
|
44834
|
+
return $active ? '#fde68a' : '#cfcfcf';
|
|
44835
|
+
});
|
|
44836
|
+
|
|
44765
44837
|
var scaleIn$1 = /*#__PURE__*/styled.keyframes(["from{transform:scale(0.85);opacity:0;}to{transform:scale(1);opacity:1;}"]);
|
|
44766
44838
|
var rarityOptions = [{
|
|
44767
44839
|
id: 1,
|
|
@@ -44796,7 +44868,9 @@ var BuyOrderDetailsModal = function BuyOrderDetailsModal(_ref) {
|
|
|
44796
44868
|
onRarityChange = _ref.onRarityChange,
|
|
44797
44869
|
onConfirm = _ref.onConfirm,
|
|
44798
44870
|
atlasJSON = _ref.atlasJSON,
|
|
44799
|
-
atlasIMG = _ref.atlasIMG
|
|
44871
|
+
atlasIMG = _ref.atlasIMG,
|
|
44872
|
+
enableHotkeys = _ref.enableHotkeys,
|
|
44873
|
+
disableHotkeys = _ref.disableHotkeys;
|
|
44800
44874
|
if (!isOpen || !blueprint) return null;
|
|
44801
44875
|
var stopPropagation = function stopPropagation(e) {
|
|
44802
44876
|
e.stopPropagation();
|
|
@@ -44830,7 +44904,9 @@ var BuyOrderDetailsModal = function BuyOrderDetailsModal(_ref) {
|
|
|
44830
44904
|
},
|
|
44831
44905
|
placeholder: "Qty",
|
|
44832
44906
|
type: "number",
|
|
44833
|
-
min: 1
|
|
44907
|
+
min: 1,
|
|
44908
|
+
onFocus: disableHotkeys,
|
|
44909
|
+
onBlur: enableHotkeys
|
|
44834
44910
|
})), React__default.createElement(FieldRow, null, React__default.createElement(Label$4, null, "Max Gold"), React__default.createElement(StyledInput$3, {
|
|
44835
44911
|
value: maxPrice || '',
|
|
44836
44912
|
onChange: function onChange(e) {
|
|
@@ -44838,7 +44914,9 @@ var BuyOrderDetailsModal = function BuyOrderDetailsModal(_ref) {
|
|
|
44838
44914
|
},
|
|
44839
44915
|
placeholder: "Max gold",
|
|
44840
44916
|
type: "number",
|
|
44841
|
-
min: 1
|
|
44917
|
+
min: 1,
|
|
44918
|
+
onFocus: disableHotkeys,
|
|
44919
|
+
onBlur: enableHotkeys
|
|
44842
44920
|
})), React__default.createElement(FieldRow, null, React__default.createElement(Label$4, null, "Rarity"), React__default.createElement(StyledDropdown$3, {
|
|
44843
44921
|
key: rarity,
|
|
44844
44922
|
options: rarityOptions,
|
|
@@ -44961,9 +45039,9 @@ var Pill = /*#__PURE__*/styled__default.span.withConfig({
|
|
|
44961
45039
|
|
|
44962
45040
|
var RPGUIScrollbar = function RPGUIScrollbar(_ref) {
|
|
44963
45041
|
var children = _ref.children;
|
|
44964
|
-
return React__default.createElement(Container$
|
|
45042
|
+
return React__default.createElement(Container$C, null, children);
|
|
44965
45043
|
};
|
|
44966
|
-
var Container$
|
|
45044
|
+
var Container$C = /*#__PURE__*/styled__default.div.withConfig({
|
|
44967
45045
|
displayName: "RPGUIScrollbar__Container",
|
|
44968
45046
|
componentId: "sc-p3msmb-0"
|
|
44969
45047
|
})([".rpgui-content ::-webkit-scrollbar,.rpgui-content::-webkit-scrollbar{width:25px !important;}.rpgui-content ::-webkit-scrollbar-track,.rpgui-content::-webkit-scrollbar-track{background-size:25px 60px !important;}"]);
|
|
@@ -45292,7 +45370,9 @@ var BuyOrderPanel = function BuyOrderPanel(props) {
|
|
|
45292
45370
|
yourBuyOrdersTotal = props.yourBuyOrdersTotal,
|
|
45293
45371
|
yourBuyOrdersPage = props.yourBuyOrdersPage,
|
|
45294
45372
|
onYourBuyOrdersPageChange = props.onYourBuyOrdersPageChange,
|
|
45295
|
-
onCancelBuyOrder = props.onCancelBuyOrder
|
|
45373
|
+
onCancelBuyOrder = props.onCancelBuyOrder,
|
|
45374
|
+
enableHotkeys = props.enableHotkeys,
|
|
45375
|
+
disableHotkeys = props.disableHotkeys;
|
|
45296
45376
|
// Local blueprint display: cleared immediately on Place Request so the
|
|
45297
45377
|
// panel returns to "Select Item" without waiting for the consumer to update
|
|
45298
45378
|
// the prop. Cancel keeps it shown so the user can reopen the modal.
|
|
@@ -45302,6 +45382,9 @@ var BuyOrderPanel = function BuyOrderPanel(props) {
|
|
|
45302
45382
|
var _useState2 = React.useState(!!selectedBlueprint),
|
|
45303
45383
|
isDetailsOpen = _useState2[0],
|
|
45304
45384
|
setIsDetailsOpen = _useState2[1];
|
|
45385
|
+
var _useState3 = React.useState('Active'),
|
|
45386
|
+
statusFilter = _useState3[0],
|
|
45387
|
+
setStatusFilter = _useState3[1];
|
|
45305
45388
|
// Sync when consumer provides a new blueprint (e.g. after search selection)
|
|
45306
45389
|
React.useEffect(function () {
|
|
45307
45390
|
if (selectedBlueprint) {
|
|
@@ -45315,10 +45398,12 @@ var BuyOrderPanel = function BuyOrderPanel(props) {
|
|
|
45315
45398
|
setDisplayedBlueprint(undefined);
|
|
45316
45399
|
setIsDetailsOpen(false);
|
|
45317
45400
|
onCloseDetails == null ? void 0 : onCloseDetails();
|
|
45401
|
+
enableHotkeys == null ? void 0 : enableHotkeys();
|
|
45318
45402
|
};
|
|
45319
45403
|
// Cancel: just close the modal, keep blueprint displayed for reopening
|
|
45320
45404
|
var handleCloseDetails = function handleCloseDetails() {
|
|
45321
45405
|
setIsDetailsOpen(false);
|
|
45406
|
+
enableHotkeys == null ? void 0 : enableHotkeys();
|
|
45322
45407
|
};
|
|
45323
45408
|
return React__default.createElement(PanelWrapper, null, displayedBlueprint && isDetailsOpen && React__default.createElement(BuyOrderDetailsModal, {
|
|
45324
45409
|
isOpen: true,
|
|
@@ -45332,7 +45417,9 @@ var BuyOrderPanel = function BuyOrderPanel(props) {
|
|
|
45332
45417
|
onRarityChange: onRarityChange,
|
|
45333
45418
|
onConfirm: handleConfirm,
|
|
45334
45419
|
atlasJSON: atlasJSON,
|
|
45335
|
-
atlasIMG: atlasIMG
|
|
45420
|
+
atlasIMG: atlasIMG,
|
|
45421
|
+
enableHotkeys: enableHotkeys,
|
|
45422
|
+
disableHotkeys: disableHotkeys
|
|
45336
45423
|
}), React__default.createElement(FormRow, null, displayedBlueprint ? React__default.createElement(SelectedBlueprintDisplay, {
|
|
45337
45424
|
onPointerDown: onOpenBlueprintSearch
|
|
45338
45425
|
}, React__default.createElement(RarityContainer, {
|
|
@@ -45353,18 +45440,41 @@ var BuyOrderPanel = function BuyOrderPanel(props) {
|
|
|
45353
45440
|
label: "Select Item",
|
|
45354
45441
|
iconColor: "#f59e0b",
|
|
45355
45442
|
onClick: onOpenBlueprintSearch
|
|
45443
|
+
})), React__default.createElement(FilterRow$1, null, React__default.createElement(SectionTitle$1, null, "Your Buy Requests"), React__default.createElement(SegmentedToggle, {
|
|
45444
|
+
options: [{
|
|
45445
|
+
id: 'Active',
|
|
45446
|
+
label: 'Active'
|
|
45447
|
+
}, {
|
|
45448
|
+
id: 'Fulfilled',
|
|
45449
|
+
label: 'Fulfilled'
|
|
45450
|
+
}, {
|
|
45451
|
+
id: 'Expired',
|
|
45452
|
+
label: 'Expired'
|
|
45453
|
+
}, {
|
|
45454
|
+
id: 'All',
|
|
45455
|
+
label: 'All'
|
|
45456
|
+
}],
|
|
45457
|
+
activeId: statusFilter,
|
|
45458
|
+
onChange: function onChange(id) {
|
|
45459
|
+
return setStatusFilter(id);
|
|
45460
|
+
}
|
|
45356
45461
|
})), React__default.createElement(ScrollArea, {
|
|
45357
45462
|
id: "MarketContainer"
|
|
45358
|
-
}, React__default.createElement(Section$1, null,
|
|
45359
|
-
|
|
45360
|
-
|
|
45361
|
-
buyOrder: order,
|
|
45362
|
-
atlasJSON: atlasJSON,
|
|
45363
|
-
atlasIMG: atlasIMG,
|
|
45364
|
-
isOwn: true,
|
|
45365
|
-
onCancel: onCancelBuyOrder
|
|
45463
|
+
}, React__default.createElement(Section$1, null, function () {
|
|
45464
|
+
var filtered = statusFilter === 'All' ? yourBuyOrders : yourBuyOrders.filter(function (o) {
|
|
45465
|
+
return o.status === shared.MarketplaceBuyOrderStatus[statusFilter];
|
|
45366
45466
|
});
|
|
45367
|
-
|
|
45467
|
+
return filtered.length === 0 ? React__default.createElement(EmptyState$3, null, "No requests yet") : filtered.map(function (order) {
|
|
45468
|
+
return React__default.createElement(BuyOrderRow, {
|
|
45469
|
+
key: order._id,
|
|
45470
|
+
buyOrder: order,
|
|
45471
|
+
atlasJSON: atlasJSON,
|
|
45472
|
+
atlasIMG: atlasIMG,
|
|
45473
|
+
isOwn: true,
|
|
45474
|
+
onCancel: onCancelBuyOrder
|
|
45475
|
+
});
|
|
45476
|
+
});
|
|
45477
|
+
}(), yourBuyOrdersTotal > BUY_ORDERS_PER_PAGE && React__default.createElement(PagerRow, null, React__default.createElement(Pager, {
|
|
45368
45478
|
totalItems: yourBuyOrdersTotal,
|
|
45369
45479
|
currentPage: yourBuyOrdersPage,
|
|
45370
45480
|
itemsPerPage: BUY_ORDERS_PER_PAGE,
|
|
@@ -45379,25 +45489,29 @@ var FormRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
45379
45489
|
displayName: "BuyOrderPanel__FormRow",
|
|
45380
45490
|
componentId: "sc-1eb11ct-1"
|
|
45381
45491
|
})(["display:flex;gap:8px;align-items:center;background:rgba(0,0,0,0.15);border-radius:4px;border:1px solid rgba(255,255,255,0.05);padding:8px 12px;overflow:visible;"]);
|
|
45492
|
+
var FilterRow$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
45493
|
+
displayName: "BuyOrderPanel__FilterRow",
|
|
45494
|
+
componentId: "sc-1eb11ct-2"
|
|
45495
|
+
})(["display:flex;align-items:center;justify-content:space-between;padding:0 4px;"]);
|
|
45382
45496
|
var ScrollArea = /*#__PURE__*/styled__default.div.withConfig({
|
|
45383
45497
|
displayName: "BuyOrderPanel__ScrollArea",
|
|
45384
|
-
componentId: "sc-1eb11ct-
|
|
45498
|
+
componentId: "sc-1eb11ct-3"
|
|
45385
45499
|
})(["display:flex;flex-direction:column;gap:6px;overflow-y:scroll;max-height:420px;"]);
|
|
45386
45500
|
var Section$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
45387
45501
|
displayName: "BuyOrderPanel__Section",
|
|
45388
|
-
componentId: "sc-1eb11ct-
|
|
45502
|
+
componentId: "sc-1eb11ct-4"
|
|
45389
45503
|
})(["display:flex;flex-direction:column;gap:2px;"]);
|
|
45390
45504
|
var SectionTitle$1 = /*#__PURE__*/styled__default.p.withConfig({
|
|
45391
45505
|
displayName: "BuyOrderPanel__SectionTitle",
|
|
45392
|
-
componentId: "sc-1eb11ct-
|
|
45506
|
+
componentId: "sc-1eb11ct-5"
|
|
45393
45507
|
})(["margin:0 0 2px 0;font-size:0.45rem;color:#666;text-transform:uppercase;letter-spacing:1px;"]);
|
|
45394
45508
|
var SelectedBlueprintDisplay = /*#__PURE__*/styled__default.button.withConfig({
|
|
45395
45509
|
displayName: "BuyOrderPanel__SelectedBlueprintDisplay",
|
|
45396
|
-
componentId: "sc-1eb11ct-
|
|
45510
|
+
componentId: "sc-1eb11ct-6"
|
|
45397
45511
|
})(["background:rgba(245,158,11,0.08);border:1px solid rgba(245,158,11,0.4);border-radius:4px;padding:6px 10px;cursor:pointer;text-align:left;display:flex;align-items:center;gap:8px;transition:background 0.1s;> div:first-child{position:relative;top:2px;left:2px;}&:hover{background:rgba(245,158,11,0.15);}"]);
|
|
45398
45512
|
var RarityContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
45399
45513
|
displayName: "BuyOrderPanel__RarityContainer",
|
|
45400
|
-
componentId: "sc-1eb11ct-
|
|
45514
|
+
componentId: "sc-1eb11ct-7"
|
|
45401
45515
|
})(["border-color:", ";box-shadow:", " inset,", ";width:32px;height:32px;"], function (_ref) {
|
|
45402
45516
|
var $rarity = _ref.$rarity;
|
|
45403
45517
|
return rarityColor({
|
|
@@ -45416,61 +45530,25 @@ var RarityContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
45416
45530
|
});
|
|
45417
45531
|
var ChangeTextWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
45418
45532
|
displayName: "BuyOrderPanel__ChangeTextWrapper",
|
|
45419
|
-
componentId: "sc-1eb11ct-
|
|
45533
|
+
componentId: "sc-1eb11ct-8"
|
|
45420
45534
|
})(["display:flex;flex-direction:column;gap:2px;min-width:0;"]);
|
|
45421
45535
|
var BlueprintName$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
45422
45536
|
displayName: "BuyOrderPanel__BlueprintName",
|
|
45423
|
-
componentId: "sc-1eb11ct-
|
|
45537
|
+
componentId: "sc-1eb11ct-9"
|
|
45424
45538
|
})(["font-size:0.5rem;color:#ddd;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]);
|
|
45425
45539
|
var ChangeText = /*#__PURE__*/styled__default.span.withConfig({
|
|
45426
45540
|
displayName: "BuyOrderPanel__ChangeText",
|
|
45427
|
-
componentId: "sc-1eb11ct-
|
|
45541
|
+
componentId: "sc-1eb11ct-10"
|
|
45428
45542
|
})(["font-size:0.4rem;color:#f59e0b;"]);
|
|
45429
45543
|
var EmptyState$3 = /*#__PURE__*/styled__default.div.withConfig({
|
|
45430
45544
|
displayName: "BuyOrderPanel__EmptyState",
|
|
45431
|
-
componentId: "sc-1eb11ct-
|
|
45545
|
+
componentId: "sc-1eb11ct-11"
|
|
45432
45546
|
})(["display:flex;align-items:center;justify-content:center;height:45px;font-size:0.45rem;color:#555;text-transform:uppercase;letter-spacing:1px;background:rgba(0,0,0,0.15);border-radius:4px;"]);
|
|
45433
45547
|
var PagerRow = /*#__PURE__*/styled__default.div.withConfig({
|
|
45434
45548
|
displayName: "BuyOrderPanel__PagerRow",
|
|
45435
|
-
componentId: "sc-1eb11ct-
|
|
45549
|
+
componentId: "sc-1eb11ct-12"
|
|
45436
45550
|
})(["display:flex;justify-content:center;margin-top:4px;"]);
|
|
45437
45551
|
|
|
45438
|
-
var SegmentedToggle = function SegmentedToggle(_ref) {
|
|
45439
|
-
var options = _ref.options,
|
|
45440
|
-
activeId = _ref.activeId,
|
|
45441
|
-
onChange = _ref.onChange,
|
|
45442
|
-
className = _ref.className;
|
|
45443
|
-
return React__default.createElement(Container$C, {
|
|
45444
|
-
className: className
|
|
45445
|
-
}, options.map(function (option) {
|
|
45446
|
-
return React__default.createElement(OptionButton, {
|
|
45447
|
-
key: option.id,
|
|
45448
|
-
type: "button",
|
|
45449
|
-
"$active": option.id === activeId,
|
|
45450
|
-
onClick: function onClick() {
|
|
45451
|
-
return onChange(option.id);
|
|
45452
|
-
}
|
|
45453
|
-
}, option.label);
|
|
45454
|
-
}));
|
|
45455
|
-
};
|
|
45456
|
-
var Container$C = /*#__PURE__*/styled__default.div.withConfig({
|
|
45457
|
-
displayName: "SegmentedToggle__Container",
|
|
45458
|
-
componentId: "sc-1itx2kn-0"
|
|
45459
|
-
})(["display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;"]);
|
|
45460
|
-
var OptionButton = /*#__PURE__*/styled__default.button.withConfig({
|
|
45461
|
-
displayName: "SegmentedToggle__OptionButton",
|
|
45462
|
-
componentId: "sc-1itx2kn-1"
|
|
45463
|
-
})(["border:1px solid ", ";background:", ";color:", ";border-radius:999px;padding:8px 12px;cursor:pointer;font-size:0.56rem;text-transform:uppercase;letter-spacing:0.8px;transition:background 0.15s ease,border-color 0.15s ease,color 0.15s ease;&:hover{border-color:rgba(245,158,11,0.45);color:#fde68a;}"], function (_ref2) {
|
|
45464
|
-
var $active = _ref2.$active;
|
|
45465
|
-
return $active ? 'rgba(245, 158, 11, 0.75)' : 'rgba(255, 255, 255, 0.08)';
|
|
45466
|
-
}, function (_ref3) {
|
|
45467
|
-
var $active = _ref3.$active;
|
|
45468
|
-
return $active ? 'rgba(245, 158, 11, 0.16)' : 'rgba(0, 0, 0, 0.18)';
|
|
45469
|
-
}, function (_ref4) {
|
|
45470
|
-
var $active = _ref4.$active;
|
|
45471
|
-
return $active ? '#fde68a' : '#cfcfcf';
|
|
45472
|
-
});
|
|
45473
|
-
|
|
45474
45552
|
var MarketplaceBuyModal = function MarketplaceBuyModal(_ref) {
|
|
45475
45553
|
var goldPrice = _ref.goldPrice,
|
|
45476
45554
|
dcEquivalentPrice = _ref.dcEquivalentPrice,
|
|
@@ -45910,7 +45988,9 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
45910
45988
|
openBuyOrdersTotal = _ref$openBuyOrdersTot === void 0 ? 0 : _ref$openBuyOrdersTot,
|
|
45911
45989
|
_ref$openBuyOrdersPag = _ref.openBuyOrdersPage,
|
|
45912
45990
|
openBuyOrdersPage = _ref$openBuyOrdersPag === void 0 ? 1 : _ref$openBuyOrdersPag,
|
|
45913
|
-
onOpenBuyOrdersPageChange = _ref.onOpenBuyOrdersPageChange
|
|
45991
|
+
onOpenBuyOrdersPageChange = _ref.onOpenBuyOrdersPageChange,
|
|
45992
|
+
_ref$isLoading = _ref.isLoading,
|
|
45993
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
45914
45994
|
var _useState = React.useState(''),
|
|
45915
45995
|
name = _useState[0],
|
|
45916
45996
|
setName = _useState[1];
|
|
@@ -46149,7 +46229,7 @@ var BuyPanel = function BuyPanel(_ref) {
|
|
|
46149
46229
|
}))))), React__default.createElement(ItemComponentScrollWrapper$1, {
|
|
46150
46230
|
id: "MarketContainer",
|
|
46151
46231
|
ref: itemsContainer
|
|
46152
|
-
}, !hasVisibleContent && React__default.createElement(EmptyState$4, null, "No offers match the current filters."), 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) {
|
|
46232
|
+
}, isLoading && !hasVisibleContent && React__default.createElement(LoadingState, null, React__default.createElement(Spinner$2, null), React__default.createElement(LoadingText$1, null, "Loading marketplace...")), !isLoading && !hasVisibleContent && React__default.createElement(EmptyState$4, null, "No offers match the current filters."), 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) {
|
|
46153
46233
|
var bestListing = _ref2.bestListing,
|
|
46154
46234
|
otherListings = _ref2.otherListings;
|
|
46155
46235
|
return React__default.createElement(GroupedMarketplaceRow, {
|
|
@@ -46261,6 +46341,19 @@ var StyledDropdown$4 = /*#__PURE__*/styled__default(Dropdown).withConfig({
|
|
|
46261
46341
|
displayName: "BuyPanel__StyledDropdown",
|
|
46262
46342
|
componentId: "sc-1si8t7i-15"
|
|
46263
46343
|
})(["margin:0px !important;width:100% !important;"]);
|
|
46344
|
+
var spin = /*#__PURE__*/styled.keyframes(["to{transform:rotate(360deg);}"]);
|
|
46345
|
+
var LoadingState = /*#__PURE__*/styled__default.div.withConfig({
|
|
46346
|
+
displayName: "BuyPanel__LoadingState",
|
|
46347
|
+
componentId: "sc-1si8t7i-16"
|
|
46348
|
+
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;height:100%;min-height:160px;"]);
|
|
46349
|
+
var Spinner$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
46350
|
+
displayName: "BuyPanel__Spinner",
|
|
46351
|
+
componentId: "sc-1si8t7i-17"
|
|
46352
|
+
})(["width:28px;height:28px;border:3px solid rgba(245,158,11,0.2);border-top-color:#f59e0b;border-radius:50%;animation:", " 0.7s linear infinite;"], spin);
|
|
46353
|
+
var LoadingText$1 = /*#__PURE__*/styled__default.span.withConfig({
|
|
46354
|
+
displayName: "BuyPanel__LoadingText",
|
|
46355
|
+
componentId: "sc-1si8t7i-18"
|
|
46356
|
+
})(["font-size:0.48rem;color:#8a8a8a;text-transform:uppercase;letter-spacing:1px;"]);
|
|
46264
46357
|
|
|
46265
46358
|
var _TRANSACTION_TYPE_COL;
|
|
46266
46359
|
var HISTORY_ITEMS_PER_PAGE = 10;
|
|
@@ -46314,7 +46407,7 @@ var HistoryPanel = function HistoryPanel(_ref) {
|
|
|
46314
46407
|
var getDCEquivalentPrice = function getDCEquivalentPrice(goldPrice) {
|
|
46315
46408
|
return dcToGoldSwapRate > 0 ? shared.goldToDC(goldPrice) : 0;
|
|
46316
46409
|
};
|
|
46317
|
-
return React__default.createElement(PanelWrapper$1, null, React__default.createElement(FilterRow$
|
|
46410
|
+
return React__default.createElement(PanelWrapper$1, null, React__default.createElement(FilterRow$2, null, React__default.createElement(FilterLabel$1, null, "FILTER BY TYPE"), React__default.createElement(StyledDropdown$5, {
|
|
46318
46411
|
key: selectedType,
|
|
46319
46412
|
options: transactionTypeOptions,
|
|
46320
46413
|
onChange: onTypeChange,
|
|
@@ -46322,6 +46415,7 @@ var HistoryPanel = function HistoryPanel(_ref) {
|
|
|
46322
46415
|
})), React__default.createElement(ScrollArea$1, {
|
|
46323
46416
|
id: "MarketContainer"
|
|
46324
46417
|
}, transactions.length === 0 ? React__default.createElement(EmptyState$5, null, "No transactions yet") : transactions.map(function (tx, index) {
|
|
46418
|
+
var _tx$metadata;
|
|
46325
46419
|
return React__default.createElement(RowWrapper$1, {
|
|
46326
46420
|
key: index,
|
|
46327
46421
|
"$even": index % 2 === 0,
|
|
@@ -46332,7 +46426,7 @@ var HistoryPanel = function HistoryPanel(_ref) {
|
|
|
46332
46426
|
fontSize: "10px"
|
|
46333
46427
|
}, tx.itemName)) : React__default.createElement(ItemName$3, null, React__default.createElement(NoItemText, null, tx.type === shared.MarketplaceTransactionType.Withdrawal ? 'Gold Withdrawal' : '--')), React__default.createElement(MetaRow$1, null, React__default.createElement(Label$5, {
|
|
46334
46428
|
"$bg": TRANSACTION_TYPE_COLORS$1[tx.type]
|
|
46335
|
-
}, formatTransactionLabel(tx.type)), React__default.createElement(SecondaryText, null, formatDate(tx.createdAt)), tx.counterpartName && React__default.createElement(SecondaryText, null, "w/ ", tx.counterpartName)))), tx.goldAmount > 0 && React__default.createElement(PriceSection, null, tx.currency === 'dc' ?
|
|
46429
|
+
}, formatTransactionLabel(tx.type)), React__default.createElement(SecondaryText, null, formatDate(tx.createdAt)), tx.counterpartName && React__default.createElement(SecondaryText, null, "w/ ", tx.counterpartName)))), tx.goldAmount > 0 && React__default.createElement(PriceSection, null, ((_tx$metadata = tx.metadata) == null ? void 0 : _tx$metadata['currency']) === 'dc' ?
|
|
46336
46430
|
// Show DC only
|
|
46337
46431
|
React__default.createElement(DCPriceRow$1, null, atlasIMG && atlasJSON && React__default.createElement(DCCoinWrapper$1, null, React__default.createElement(SimpleTooltip, {
|
|
46338
46432
|
content: "Definya Coin",
|
|
@@ -46369,7 +46463,7 @@ var PanelWrapper$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
46369
46463
|
displayName: "HistoryPanel__PanelWrapper",
|
|
46370
46464
|
componentId: "sc-74mioa-0"
|
|
46371
46465
|
})(["display:flex;flex-direction:column;gap:8px;padding:0 2.5%;width:100%;box-sizing:border-box;"]);
|
|
46372
|
-
var FilterRow$
|
|
46466
|
+
var FilterRow$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
46373
46467
|
displayName: "HistoryPanel__FilterRow",
|
|
46374
46468
|
componentId: "sc-74mioa-1"
|
|
46375
46469
|
})(["display:flex;align-items:center;gap:12px;background:rgba(0,0,0,0.15);border-radius:4px;border:1px solid rgba(255,255,255,0.05);padding:8px 12px;"]);
|
|
@@ -46821,6 +46915,7 @@ var Marketplace = function Marketplace(props) {
|
|
|
46821
46915
|
};
|
|
46822
46916
|
var handleBlueprintSelect = function handleBlueprintSelect(blueprint) {
|
|
46823
46917
|
setIsBlueprintSearchOpen(false);
|
|
46918
|
+
props.enableHotkeys == null ? void 0 : props.enableHotkeys();
|
|
46824
46919
|
onBlueprintSelect == null ? void 0 : onBlueprintSelect(blueprint);
|
|
46825
46920
|
};
|
|
46826
46921
|
var showSharedPager = activeTab === 'sell';
|
|
@@ -46892,11 +46987,14 @@ var Marketplace = function Marketplace(props) {
|
|
|
46892
46987
|
yourBuyOrdersTotal: yourBuyOrdersTotal,
|
|
46893
46988
|
yourBuyOrdersPage: yourBuyOrdersPage,
|
|
46894
46989
|
onYourBuyOrdersPageChange: onYourBuyOrdersPageChange != null ? onYourBuyOrdersPageChange : function () {},
|
|
46895
|
-
onCancelBuyOrder: onCancelBuyOrder != null ? onCancelBuyOrder : function () {}
|
|
46990
|
+
onCancelBuyOrder: onCancelBuyOrder != null ? onCancelBuyOrder : function () {},
|
|
46991
|
+
enableHotkeys: props.enableHotkeys,
|
|
46992
|
+
disableHotkeys: props.disableHotkeys
|
|
46896
46993
|
}), React__default.createElement(BlueprintSearchModal, {
|
|
46897
46994
|
isOpen: isBlueprintSearchOpen,
|
|
46898
46995
|
onClose: function onClose() {
|
|
46899
|
-
|
|
46996
|
+
setIsBlueprintSearchOpen(false);
|
|
46997
|
+
props.enableHotkeys == null ? void 0 : props.enableHotkeys();
|
|
46900
46998
|
},
|
|
46901
46999
|
onSelect: handleBlueprintSelect,
|
|
46902
47000
|
onSearch: onBlueprintSearch != null ? onBlueprintSearch : function () {},
|
|
@@ -46905,7 +47003,9 @@ var Marketplace = function Marketplace(props) {
|
|
|
46905
47003
|
currentPage: blueprintSearchCurrentPage,
|
|
46906
47004
|
isLoading: blueprintSearchIsLoading,
|
|
46907
47005
|
atlasJSON: props.atlasJSON,
|
|
46908
|
-
atlasIMG: props.atlasIMG
|
|
47006
|
+
atlasIMG: props.atlasIMG,
|
|
47007
|
+
enableHotkeys: props.enableHotkeys,
|
|
47008
|
+
disableHotkeys: props.disableHotkeys
|
|
46909
47009
|
})), activeTab === 'history' && React__default.createElement(HistoryPanel, {
|
|
46910
47010
|
transactions: historyTransactions,
|
|
46911
47011
|
totalCount: historyTotalCount,
|