@rpg-engine/long-bow 0.5.13 → 0.5.15
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/Chat/Chat.d.ts +3 -4
- package/dist/components/ChatRevamp/ChatRevamp.d.ts +28 -0
- package/dist/components/ChatRevamp/SearchCharacter.d.ts +14 -0
- package/dist/components/Multitab/TabBody.d.ts +2 -0
- package/dist/components/TradingMenu/TradingItemRow.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +247 -75
- 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 +249 -78
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/ChatRevamp.stories.d.ts +6 -0
- package/package.json +2 -2
- package/src/components/Chat/Chat.tsx +16 -7
- package/src/components/ChatRevamp/ChatRevamp.tsx +121 -0
- package/src/components/ChatRevamp/SearchCharacter.tsx +163 -0
- package/src/components/Item/Inventory/ItemContainer.tsx +3 -56
- package/src/components/Multitab/Tab.tsx +3 -2
- package/src/components/Multitab/TabBody.tsx +17 -3
- package/src/components/Multitab/TabsContainer.tsx +2 -2
- package/src/components/Spellbook/mockSpells.ts +10 -5
- package/src/components/TradingMenu/TradingItemRow.tsx +58 -0
- package/src/components/TradingMenu/TradingMenu.tsx +1 -0
- package/src/index.tsx +1 -0
- package/src/mocks/itemContainer.mocks.ts +35 -31
- package/src/stories/ChatRevamp.stories.tsx +248 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component, useState, useEffect, useRef, useMemo, Fragment } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemRarities, ItemSubType, ItemSlotType, isMobileOrTablet, CharacterClass, getSPForLevel, getXPForLevel, PeriodOfDay } from '@rpg-engine/shared';
|
|
3
|
+
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemRarities, ItemSubType, ItemSlotType, isMobileOrTablet, CharacterClass, getSPForLevel, getXPForLevel, PeriodOfDay, UserAccountTypes } from '@rpg-engine/shared';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
6
|
-
import { RxPaperPlane } from 'react-icons/rx';
|
|
6
|
+
import { RxPaperPlane, RxMagnifyingGlass } from 'react-icons/rx';
|
|
7
7
|
import Draggable from 'react-draggable';
|
|
8
8
|
import ReactDOM from 'react-dom';
|
|
9
9
|
import { camelCase } from 'lodash-es';
|
|
@@ -12553,15 +12553,11 @@ var Chat = function Chat(_ref) {
|
|
|
12553
12553
|
return dayjs(createdAt || new Date()).format('HH:mm') + " " + (emitter != null && emitter.name ? emitter.name + ": " : 'Unknown: ') + " " + message;
|
|
12554
12554
|
};
|
|
12555
12555
|
var onRenderChatMessages = function onRenderChatMessages(chatMessages) {
|
|
12556
|
-
return chatMessages != null && chatMessages.length ? chatMessages == null ? void 0 : chatMessages.map(function (
|
|
12557
|
-
var _id = _ref2._id,
|
|
12558
|
-
createdAt = _ref2.createdAt,
|
|
12559
|
-
emitter = _ref2.emitter,
|
|
12560
|
-
message = _ref2.message;
|
|
12556
|
+
return chatMessages != null && chatMessages.length ? chatMessages == null ? void 0 : chatMessages.map(function (chatMessage, index) {
|
|
12561
12557
|
return React.createElement(Message, {
|
|
12562
12558
|
color: (styles == null ? void 0 : styles.textColor) || '#c65102',
|
|
12563
|
-
key: _id + "_" + index
|
|
12564
|
-
}, onRenderMessageLines(emitter, createdAt, message));
|
|
12559
|
+
key: chatMessage._id + "_" + index
|
|
12560
|
+
}, onRenderMessageLines(chatMessage.emitter, chatMessage.createdAt, chatMessage.message));
|
|
12565
12561
|
}) : React.createElement(Message, {
|
|
12566
12562
|
color: (styles == null ? void 0 : styles.textColor) || '#c65102'
|
|
12567
12563
|
}, "No messages available.");
|
|
@@ -12608,8 +12604,8 @@ var ChatContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
12608
12604
|
componentId: "sc-1bk05n6-0"
|
|
12609
12605
|
})(["height:", ";width:", ";padding:10px;background-color:rgba(0,0,0,0.2);height:auto;"], function (props) {
|
|
12610
12606
|
return props.height;
|
|
12611
|
-
}, function (
|
|
12612
|
-
var width =
|
|
12607
|
+
}, function (_ref2) {
|
|
12608
|
+
var width = _ref2.width;
|
|
12613
12609
|
return width;
|
|
12614
12610
|
});
|
|
12615
12611
|
var TextField = /*#__PURE__*/styled.input.withConfig({
|
|
@@ -12623,8 +12619,8 @@ var MessagesContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
12623
12619
|
var Message = /*#__PURE__*/styled.div.withConfig({
|
|
12624
12620
|
displayName: "Chat__Message",
|
|
12625
12621
|
componentId: "sc-1bk05n6-3"
|
|
12626
|
-
})(["margin-bottom:8px;color:", ";"], function (
|
|
12627
|
-
var color =
|
|
12622
|
+
})(["margin-bottom:8px;color:", ";"], function (_ref3) {
|
|
12623
|
+
var color = _ref3.color;
|
|
12628
12624
|
return color;
|
|
12629
12625
|
});
|
|
12630
12626
|
var Form = /*#__PURE__*/styled.form.withConfig({
|
|
@@ -12634,11 +12630,11 @@ var Form = /*#__PURE__*/styled.form.withConfig({
|
|
|
12634
12630
|
var Button$1 = /*#__PURE__*/styled.button.withConfig({
|
|
12635
12631
|
displayName: "Chat__Button",
|
|
12636
12632
|
componentId: "sc-1bk05n6-5"
|
|
12637
|
-
})(["color:", ";background-color:", ";width:28px;height:28px;border:none !important;"], function (
|
|
12638
|
-
var buttonColor =
|
|
12633
|
+
})(["color:", ";background-color:", ";width:28px;height:28px;border:none !important;"], function (_ref4) {
|
|
12634
|
+
var buttonColor = _ref4.buttonColor;
|
|
12639
12635
|
return buttonColor;
|
|
12640
|
-
}, function (
|
|
12641
|
-
var buttonBackgroundColor =
|
|
12636
|
+
}, function (_ref5) {
|
|
12637
|
+
var buttonBackgroundColor = _ref5.buttonBackgroundColor;
|
|
12642
12638
|
return buttonBackgroundColor;
|
|
12643
12639
|
});
|
|
12644
12640
|
|
|
@@ -12664,6 +12660,174 @@ var uiColors = {
|
|
|
12664
12660
|
white: '#fff'
|
|
12665
12661
|
};
|
|
12666
12662
|
|
|
12663
|
+
var SearchCharacter = function SearchCharacter(_ref) {
|
|
12664
|
+
var onChangeCharacterName = _ref.onChangeCharacterName,
|
|
12665
|
+
onBlur = _ref.onBlur,
|
|
12666
|
+
onFocus = _ref.onFocus,
|
|
12667
|
+
recentCharacters = _ref.recentCharacters,
|
|
12668
|
+
setShowSearchCharacter = _ref.setShowSearchCharacter,
|
|
12669
|
+
onCharacterClick = _ref.onCharacterClick,
|
|
12670
|
+
_ref$styles = _ref.styles,
|
|
12671
|
+
styles = _ref$styles === void 0 ? {
|
|
12672
|
+
textColor: '#c65102',
|
|
12673
|
+
buttonColor: '#005b96',
|
|
12674
|
+
buttonBackgroundColor: 'rgba(0,0,0,.2)',
|
|
12675
|
+
width: '80%',
|
|
12676
|
+
height: 'auto'
|
|
12677
|
+
} : _ref$styles;
|
|
12678
|
+
var _useState = useState(''),
|
|
12679
|
+
characterName = _useState[0],
|
|
12680
|
+
setCharacterName = _useState[1];
|
|
12681
|
+
var handleSubmit = function handleSubmit(event) {
|
|
12682
|
+
event.preventDefault();
|
|
12683
|
+
if (!characterName || characterName.trim() === '') return;
|
|
12684
|
+
onChangeCharacterName(characterName);
|
|
12685
|
+
};
|
|
12686
|
+
var handleCharacterClick = function handleCharacterClick(character) {
|
|
12687
|
+
if (!onCharacterClick) return;
|
|
12688
|
+
setCharacterName('');
|
|
12689
|
+
onCharacterClick(character);
|
|
12690
|
+
setShowSearchCharacter(false);
|
|
12691
|
+
};
|
|
12692
|
+
return React.createElement(SearchCharacterContainer, {
|
|
12693
|
+
width: (styles == null ? void 0 : styles.width) || '80%',
|
|
12694
|
+
height: (styles == null ? void 0 : styles.height) || 'auto'
|
|
12695
|
+
}, React.createElement(Form$1, {
|
|
12696
|
+
onSubmit: handleSubmit
|
|
12697
|
+
}, React.createElement(Column, {
|
|
12698
|
+
flex: 70
|
|
12699
|
+
}, React.createElement(TextField$1, {
|
|
12700
|
+
value: characterName,
|
|
12701
|
+
id: "inputCharacterName",
|
|
12702
|
+
onChange: function onChange(e) {
|
|
12703
|
+
setCharacterName(e.target.value);
|
|
12704
|
+
onChangeCharacterName(e.target.value);
|
|
12705
|
+
},
|
|
12706
|
+
height: 20,
|
|
12707
|
+
type: "text",
|
|
12708
|
+
autoComplete: "off",
|
|
12709
|
+
onFocus: onFocus,
|
|
12710
|
+
onBlur: onBlur,
|
|
12711
|
+
onPointerDown: onFocus,
|
|
12712
|
+
autoFocus: true
|
|
12713
|
+
})), React.createElement(Column, {
|
|
12714
|
+
justifyContent: "flex-end"
|
|
12715
|
+
}, React.createElement(SearchButton, {
|
|
12716
|
+
buttonColor: (styles == null ? void 0 : styles.buttonColor) || '#005b96',
|
|
12717
|
+
buttonBackgroundColor: (styles == null ? void 0 : styles.buttonBackgroundColor) || 'rgba(0,0,0,.5)',
|
|
12718
|
+
id: "chat-send-button",
|
|
12719
|
+
style: {
|
|
12720
|
+
borderRadius: '20%'
|
|
12721
|
+
}
|
|
12722
|
+
}, React.createElement(RxMagnifyingGlass, {
|
|
12723
|
+
size: 15
|
|
12724
|
+
})))), recentCharacters && recentCharacters.length > 0 && React.createElement(ListContainer, null, recentCharacters.map(function (character) {
|
|
12725
|
+
return React.createElement(ListElement, {
|
|
12726
|
+
onPointerDown: function onPointerDown() {
|
|
12727
|
+
return handleCharacterClick(character);
|
|
12728
|
+
},
|
|
12729
|
+
key: character._id
|
|
12730
|
+
}, character.name);
|
|
12731
|
+
})));
|
|
12732
|
+
};
|
|
12733
|
+
var SearchCharacterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
12734
|
+
displayName: "SearchCharacter__SearchCharacterContainer",
|
|
12735
|
+
componentId: "sc-172lyfr-0"
|
|
12736
|
+
})(["height:", ";width:", ";padding:10px;background-color:rgba(0,0,0,0.2);height:auto;"], function (props) {
|
|
12737
|
+
return props.height;
|
|
12738
|
+
}, function (_ref2) {
|
|
12739
|
+
var width = _ref2.width;
|
|
12740
|
+
return width;
|
|
12741
|
+
});
|
|
12742
|
+
var Form$1 = /*#__PURE__*/styled.form.withConfig({
|
|
12743
|
+
displayName: "SearchCharacter__Form",
|
|
12744
|
+
componentId: "sc-172lyfr-1"
|
|
12745
|
+
})(["display:flex;width:100%;justify-content:center;align-items:center;"]);
|
|
12746
|
+
var TextField$1 = /*#__PURE__*/styled.input.withConfig({
|
|
12747
|
+
displayName: "SearchCharacter__TextField",
|
|
12748
|
+
componentId: "sc-172lyfr-2"
|
|
12749
|
+
})(["width:100%;background-color:rgba(0,0,0,0.25) !important;border:none !important;max-height:28px !important;"]);
|
|
12750
|
+
var SearchButton = /*#__PURE__*/styled.button.withConfig({
|
|
12751
|
+
displayName: "SearchCharacter__SearchButton",
|
|
12752
|
+
componentId: "sc-172lyfr-3"
|
|
12753
|
+
})(["color:", ";background-color:", ";width:28px;height:28px;border:none !important;"], function (_ref3) {
|
|
12754
|
+
var buttonColor = _ref3.buttonColor;
|
|
12755
|
+
return buttonColor;
|
|
12756
|
+
}, function (_ref4) {
|
|
12757
|
+
var buttonBackgroundColor = _ref4.buttonBackgroundColor;
|
|
12758
|
+
return buttonBackgroundColor;
|
|
12759
|
+
});
|
|
12760
|
+
var ListContainer = /*#__PURE__*/styled.ul.withConfig({
|
|
12761
|
+
displayName: "SearchCharacter__ListContainer",
|
|
12762
|
+
componentId: "sc-172lyfr-4"
|
|
12763
|
+
})(["border:none;overflow-y:scroll;list-style:none;padding:0;"]);
|
|
12764
|
+
var ListElement = /*#__PURE__*/styled.li.withConfig({
|
|
12765
|
+
displayName: "SearchCharacter__ListElement",
|
|
12766
|
+
componentId: "sc-172lyfr-5"
|
|
12767
|
+
})(["margin:0.5rem 0 !important;font-size:", ";&:hover{color:#ff0;background-color:", ";}button{all:unset;}"], uiFonts.size.small, uiColors.darkGray);
|
|
12768
|
+
|
|
12769
|
+
var ChatRevamp = function ChatRevamp(_ref) {
|
|
12770
|
+
var chatMessages = _ref.chatMessages,
|
|
12771
|
+
onSendGlobalChatMessage = _ref.onSendGlobalChatMessage,
|
|
12772
|
+
onChangeCharacterName = _ref.onChangeCharacterName,
|
|
12773
|
+
onFocus = _ref.onFocus,
|
|
12774
|
+
onBlur = _ref.onBlur,
|
|
12775
|
+
onCloseButton = _ref.onCloseButton,
|
|
12776
|
+
styles = _ref.styles,
|
|
12777
|
+
tabs = _ref.tabs,
|
|
12778
|
+
onChangeTab = _ref.onChangeTab,
|
|
12779
|
+
activeTab = _ref.activeTab,
|
|
12780
|
+
privateChatCharacters = _ref.privateChatCharacters,
|
|
12781
|
+
onCharacterClick = _ref.onCharacterClick,
|
|
12782
|
+
onSendPrivateChatMessage = _ref.onSendPrivateChatMessage;
|
|
12783
|
+
var _useState = useState(true),
|
|
12784
|
+
showSearchCharacter = _useState[0],
|
|
12785
|
+
setShowSearchCharacter = _useState[1];
|
|
12786
|
+
useEffect(function () {
|
|
12787
|
+
setShowSearchCharacter(true);
|
|
12788
|
+
}, [activeTab]);
|
|
12789
|
+
var isPrivate = activeTab === 'private';
|
|
12790
|
+
return React.createElement(React.Fragment, null, React.createElement(TabContainer, null, tabs.map(function (tab, index) {
|
|
12791
|
+
return React.createElement(Tab, {
|
|
12792
|
+
key: tab.label + "_" + index,
|
|
12793
|
+
active: tab.id === activeTab,
|
|
12794
|
+
onPointerDown: function onPointerDown() {
|
|
12795
|
+
return onChangeTab(tab.id);
|
|
12796
|
+
}
|
|
12797
|
+
}, tab.label);
|
|
12798
|
+
})), isPrivate && showSearchCharacter ? React.createElement(SearchCharacter, {
|
|
12799
|
+
onFocus: onFocus,
|
|
12800
|
+
onBlur: onBlur,
|
|
12801
|
+
onChangeCharacterName: onChangeCharacterName,
|
|
12802
|
+
styles: styles,
|
|
12803
|
+
recentCharacters: privateChatCharacters,
|
|
12804
|
+
setShowSearchCharacter: setShowSearchCharacter,
|
|
12805
|
+
onCharacterClick: onCharacterClick
|
|
12806
|
+
}) : React.createElement(Chat, {
|
|
12807
|
+
chatMessages: chatMessages,
|
|
12808
|
+
onSendChatMessage: isPrivate ? onSendPrivateChatMessage : onSendGlobalChatMessage,
|
|
12809
|
+
sendMessage: true,
|
|
12810
|
+
onCloseButton: onCloseButton,
|
|
12811
|
+
styles: styles,
|
|
12812
|
+
onFocus: onFocus,
|
|
12813
|
+
onBlur: onBlur
|
|
12814
|
+
}));
|
|
12815
|
+
};
|
|
12816
|
+
var TabContainer = /*#__PURE__*/styled.div.withConfig({
|
|
12817
|
+
displayName: "ChatRevamp__TabContainer",
|
|
12818
|
+
componentId: "sc-1sdiknw-0"
|
|
12819
|
+
})(["width:100%;display:flex;gap:10px;"]);
|
|
12820
|
+
var Tab = /*#__PURE__*/styled.button.withConfig({
|
|
12821
|
+
displayName: "ChatRevamp__Tab",
|
|
12822
|
+
componentId: "sc-1sdiknw-1"
|
|
12823
|
+
})(["width:120px;color:white;font-size:0.8rem;all:unset;padding:0.6rem;font-size:0.8rem;border-radius:5px 5px 0 0;border-width:0.25rem 0.25rem 0 0.25rem;border-style:solid;border-color:", ";background-color:", ";color:", ";"], function (props) {
|
|
12824
|
+
return props.active ? '#c65102' : uiColors.gray;
|
|
12825
|
+
}, function (props) {
|
|
12826
|
+
return props.active ? uiColors.orange : 'transparent';
|
|
12827
|
+
}, function (props) {
|
|
12828
|
+
return props.active ? 'white' : uiColors.raisinBlack;
|
|
12829
|
+
});
|
|
12830
|
+
|
|
12667
12831
|
var _excluded$2 = ["innerRef"];
|
|
12668
12832
|
var Input = function Input(_ref) {
|
|
12669
12833
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
@@ -12767,7 +12931,7 @@ var ChatDeprecated = function ChatDeprecated(_ref) {
|
|
|
12767
12931
|
width: '100%',
|
|
12768
12932
|
height: '80%',
|
|
12769
12933
|
className: "chat-body dark-background"
|
|
12770
|
-
}, onRenderChatMessages(chatMessages)), React.createElement(Form$
|
|
12934
|
+
}, onRenderChatMessages(chatMessages)), React.createElement(Form$2, {
|
|
12771
12935
|
onSubmit: handleSubmit
|
|
12772
12936
|
}, React.createElement(Column, {
|
|
12773
12937
|
flex: 70
|
|
@@ -12808,7 +12972,7 @@ var CustomContainer = /*#__PURE__*/styled(RPGUIContainer).withConfig({
|
|
|
12808
12972
|
})(["display:block;opacity:", ";&:hover{opacity:1;}.dark-background{background-color:", " !important;}.chat-body{&.rpgui-container.framed-grey{background:unset;}max-height:170px;overflow-y:auto;}"], function (props) {
|
|
12809
12973
|
return props.opacity;
|
|
12810
12974
|
}, uiColors.darkGray);
|
|
12811
|
-
var Form$
|
|
12975
|
+
var Form$2 = /*#__PURE__*/styled.form.withConfig({
|
|
12812
12976
|
displayName: "ChatDeprecated__Form",
|
|
12813
12977
|
componentId: "sc-fuuod3-4"
|
|
12814
12978
|
})(["display:flex;width:100%;justify-content:center;align-items:center;"]);
|
|
@@ -13252,7 +13416,7 @@ var RelativeListMenu = function RelativeListMenu(_ref) {
|
|
|
13252
13416
|
overflow: 'hidden'
|
|
13253
13417
|
}
|
|
13254
13418
|
}, options.map(function (params, index) {
|
|
13255
|
-
return React.createElement(ListElement, {
|
|
13419
|
+
return React.createElement(ListElement$1, {
|
|
13256
13420
|
key: (params == null ? void 0 : params.id) || index,
|
|
13257
13421
|
onPointerDown: function onPointerDown() {
|
|
13258
13422
|
onSelected(params == null ? void 0 : params.id);
|
|
@@ -13270,7 +13434,7 @@ var Container$8 = /*#__PURE__*/styled.div.withConfig({
|
|
|
13270
13434
|
}, function (props) {
|
|
13271
13435
|
return props.fontSize;
|
|
13272
13436
|
});
|
|
13273
|
-
var ListElement = /*#__PURE__*/styled.li.withConfig({
|
|
13437
|
+
var ListElement$1 = /*#__PURE__*/styled.li.withConfig({
|
|
13274
13438
|
displayName: "RelativeListMenu__ListElement",
|
|
13275
13439
|
componentId: "sc-7hohf-1"
|
|
13276
13440
|
})(["margin-right:0.5rem;"]);
|
|
@@ -15578,7 +15742,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15578
15742
|
isDepotSystem = _ref.isDepotSystem,
|
|
15579
15743
|
onPositionChangeEnd = _ref.onPositionChangeEnd,
|
|
15580
15744
|
onPositionChangeStart = _ref.onPositionChangeStart;
|
|
15581
|
-
var MAX_SLOTS_PER_PAGE = 20;
|
|
15582
15745
|
var _useState = useState({
|
|
15583
15746
|
isOpen: false,
|
|
15584
15747
|
maxQuantity: 1,
|
|
@@ -15589,10 +15752,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15589
15752
|
var _useState2 = useState(-1),
|
|
15590
15753
|
settingShortcutIndex = _useState2[0],
|
|
15591
15754
|
setSettingShortcutIndex = _useState2[1];
|
|
15592
|
-
var _useState3 = useState(1),
|
|
15593
|
-
currentPage = _useState3[0],
|
|
15594
|
-
setCurrentPage = _useState3[1];
|
|
15595
|
-
var totalPages = Math.ceil(itemContainer.slotQty / MAX_SLOTS_PER_PAGE);
|
|
15596
15755
|
var handleSetShortcut = function handleSetShortcut(item, index) {
|
|
15597
15756
|
if (item.type === ItemType.Consumable || item.type === ItemType.Tool) {
|
|
15598
15757
|
setItemShortcut == null ? void 0 : setItemShortcut(item.key, index);
|
|
@@ -15600,11 +15759,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15600
15759
|
};
|
|
15601
15760
|
var onRenderSlots = function onRenderSlots() {
|
|
15602
15761
|
var slots = [];
|
|
15603
|
-
var
|
|
15604
|
-
var end = start + MAX_SLOTS_PER_PAGE;
|
|
15605
|
-
for (var i = start; i < end && i < itemContainer.slotQty; i++) {
|
|
15762
|
+
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
15606
15763
|
var _itemContainer$slots;
|
|
15607
|
-
console.log(itemContainer);
|
|
15608
15764
|
slots.push(React.createElement(ItemSlot, {
|
|
15609
15765
|
isContextMenuDisabled: disableContextMenu,
|
|
15610
15766
|
key: i,
|
|
@@ -15655,16 +15811,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15655
15811
|
}
|
|
15656
15812
|
return slots;
|
|
15657
15813
|
};
|
|
15658
|
-
var goToNextPage = function goToNextPage() {
|
|
15659
|
-
setCurrentPage(function (current) {
|
|
15660
|
-
return Math.min(current + 1, totalPages);
|
|
15661
|
-
});
|
|
15662
|
-
};
|
|
15663
|
-
var goToPreviousPage = function goToPreviousPage() {
|
|
15664
|
-
setCurrentPage(function (current) {
|
|
15665
|
-
return Math.max(current - 1, 1);
|
|
15666
|
-
});
|
|
15667
|
-
};
|
|
15668
15814
|
return React.createElement(React.Fragment, null, React.createElement(SlotsContainer, {
|
|
15669
15815
|
title: itemContainer.name || 'Container',
|
|
15670
15816
|
onClose: onClose,
|
|
@@ -15681,23 +15827,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15681
15827
|
atlasJSON: atlasJSON
|
|
15682
15828
|
}), React.createElement(ItemsContainer, {
|
|
15683
15829
|
className: "item-container-body"
|
|
15684
|
-
}, onRenderSlots()),
|
|
15685
|
-
className: 'arrow .arrow-up',
|
|
15686
|
-
direction: "left",
|
|
15687
|
-
onPointerDown: function onPointerDown() {
|
|
15688
|
-
if (currentPage > 1) {
|
|
15689
|
-
goToPreviousPage();
|
|
15690
|
-
}
|
|
15691
|
-
}
|
|
15692
|
-
}), currentPage < totalPages && React.createElement(SelectArrow, {
|
|
15693
|
-
className: 'arrow .arrow-down',
|
|
15694
|
-
direction: "right",
|
|
15695
|
-
onPointerDown: function onPointerDown() {
|
|
15696
|
-
if (currentPage < totalPages) {
|
|
15697
|
-
goToNextPage();
|
|
15698
|
-
}
|
|
15699
|
-
}
|
|
15700
|
-
}))), quantitySelect.isOpen && React.createElement(ModalPortal, null, React.createElement(QuantitySelectorContainer, null, React.createElement(ItemQuantitySelector, {
|
|
15830
|
+
}, onRenderSlots())), quantitySelect.isOpen && React.createElement(ModalPortal, null, React.createElement(QuantitySelectorContainer, null, React.createElement(ItemQuantitySelector, {
|
|
15701
15831
|
quantity: quantitySelect.maxQuantity,
|
|
15702
15832
|
onConfirm: function onConfirm(quantity) {
|
|
15703
15833
|
quantitySelect.callback(quantity);
|
|
@@ -15720,15 +15850,11 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15720
15850
|
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
15721
15851
|
displayName: "ItemContainer__ItemsContainer",
|
|
15722
15852
|
componentId: "sc-15y5p9l-0"
|
|
15723
|
-
})(["display:flex;justify-content:center;flex-wrap:wrap;"]);
|
|
15853
|
+
})(["display:flex;justify-content:center;flex-wrap:wrap;max-height:270px;overflow-y:auto;"]);
|
|
15724
15854
|
var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
15725
15855
|
displayName: "ItemContainer__QuantitySelectorContainer",
|
|
15726
15856
|
componentId: "sc-15y5p9l-1"
|
|
15727
15857
|
})(["position:absolute;top:0;left:0;width:100vw;height:100vh;z-index:100;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.5);"]);
|
|
15728
|
-
var ArrowContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
15729
|
-
displayName: "ItemContainer__ArrowContainer",
|
|
15730
|
-
componentId: "sc-15y5p9l-2"
|
|
15731
|
-
})(["margin-top:10px;margin-bottom:30px;span:first-child{margin-left:20px;}span:last-child{margin-right:20px;}"]);
|
|
15732
15858
|
|
|
15733
15859
|
var LeaderboardTable = function LeaderboardTable(props) {
|
|
15734
15860
|
var items = props.items,
|
|
@@ -15862,7 +15988,7 @@ var ListMenu = function ListMenu(_ref) {
|
|
|
15862
15988
|
overflow: 'hidden'
|
|
15863
15989
|
}
|
|
15864
15990
|
}, options.map(function (params, index) {
|
|
15865
|
-
return React.createElement(ListElement$
|
|
15991
|
+
return React.createElement(ListElement$2, {
|
|
15866
15992
|
key: (params == null ? void 0 : params.id) || index,
|
|
15867
15993
|
onPointerDown: function onPointerDown() {
|
|
15868
15994
|
onSelected(params == null ? void 0 : params.id);
|
|
@@ -15878,7 +16004,7 @@ var Container$j = /*#__PURE__*/styled.div.withConfig({
|
|
|
15878
16004
|
}, function (props) {
|
|
15879
16005
|
return props.x || 0;
|
|
15880
16006
|
}, uiFonts.size.xsmall);
|
|
15881
|
-
var ListElement$
|
|
16007
|
+
var ListElement$2 = /*#__PURE__*/styled.li.withConfig({
|
|
15882
16008
|
displayName: "ListMenu__ListElement",
|
|
15883
16009
|
componentId: "sc-i9097t-1"
|
|
15884
16010
|
})(["margin-right:0.5rem;"]);
|
|
@@ -17999,7 +18125,8 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
17999
18125
|
traderItem = _ref.traderItem,
|
|
18000
18126
|
selectedQty = _ref.selectedQty,
|
|
18001
18127
|
equipmentSet = _ref.equipmentSet,
|
|
18002
|
-
scale = _ref.scale
|
|
18128
|
+
scale = _ref.scale,
|
|
18129
|
+
isBuy = _ref.isBuy;
|
|
18003
18130
|
var onLeftClick = function onLeftClick(qty) {
|
|
18004
18131
|
if (qty === void 0) {
|
|
18005
18132
|
qty = 1;
|
|
@@ -18013,6 +18140,39 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18013
18140
|
}
|
|
18014
18141
|
onQuantityChange(traderItem, Math.min((_traderItem$stackQty = traderItem.stackQty) != null ? _traderItem$stackQty : 999, selectedQty + qty));
|
|
18015
18142
|
};
|
|
18143
|
+
var renderAccountTypeIndicator = function renderAccountTypeIndicator() {
|
|
18144
|
+
if (isBuy && traderItem.canBePurchasedOnlyByPremiumPlans) {
|
|
18145
|
+
return traderItem.canBePurchasedOnlyByPremiumPlans.map(function (accountType) {
|
|
18146
|
+
if (accountType !== UserAccountTypes.Free) {
|
|
18147
|
+
var backgroundColor;
|
|
18148
|
+
var textColor = 'black';
|
|
18149
|
+
switch (accountType) {
|
|
18150
|
+
case UserAccountTypes.PremiumBronze:
|
|
18151
|
+
backgroundColor = '#CD7F32';
|
|
18152
|
+
break;
|
|
18153
|
+
case UserAccountTypes.PremiumSilver:
|
|
18154
|
+
backgroundColor = '#C0C0C0';
|
|
18155
|
+
break;
|
|
18156
|
+
case UserAccountTypes.PremiumGold:
|
|
18157
|
+
backgroundColor = '#FFD700';
|
|
18158
|
+
break;
|
|
18159
|
+
case UserAccountTypes.PremiumUltimate:
|
|
18160
|
+
backgroundColor = '#002E99';
|
|
18161
|
+
break;
|
|
18162
|
+
default:
|
|
18163
|
+
return null;
|
|
18164
|
+
}
|
|
18165
|
+
return React.createElement(PremiumLabel, {
|
|
18166
|
+
backgroundColor: backgroundColor,
|
|
18167
|
+
textColor: textColor,
|
|
18168
|
+
key: accountType
|
|
18169
|
+
}, capitalize(accountType) + ' PA');
|
|
18170
|
+
}
|
|
18171
|
+
return null;
|
|
18172
|
+
});
|
|
18173
|
+
}
|
|
18174
|
+
return null;
|
|
18175
|
+
};
|
|
18016
18176
|
return React.createElement(ItemWrapper, null, React.createElement(ItemIconContainer$1, null, React.createElement(SpriteContainer$2, null, React.createElement(ItemInfoWrapper, {
|
|
18017
18177
|
atlasIMG: atlasIMG,
|
|
18018
18178
|
atlasJSON: atlasJSON,
|
|
@@ -18032,7 +18192,7 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18032
18192
|
})))), React.createElement(ItemNameContainer, null, React.createElement(NameValue, null, React.createElement("p", null, React.createElement(Ellipsis, {
|
|
18033
18193
|
maxLines: 1,
|
|
18034
18194
|
maxWidth: "250px"
|
|
18035
|
-
}, capitalize(traderItem.name))), React.createElement("p", null, "$", traderItem.price))), React.createElement(QuantityContainer$1, null, React.createElement(SelectArrow, {
|
|
18195
|
+
}, capitalize(traderItem.name))), React.createElement("p", null, "$", traderItem.price), React.createElement("p", null, renderAccountTypeIndicator()))), React.createElement(QuantityContainer$1, null, React.createElement(SelectArrow, {
|
|
18036
18196
|
size: 32,
|
|
18037
18197
|
className: "arrow-selector",
|
|
18038
18198
|
direction: "left",
|
|
@@ -18054,45 +18214,55 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18054
18214
|
onPointerDown: onRightClick.bind(null, outerQty)
|
|
18055
18215
|
})));
|
|
18056
18216
|
};
|
|
18217
|
+
var PremiumLabel = /*#__PURE__*/styled.span.withConfig({
|
|
18218
|
+
displayName: "TradingItemRow__PremiumLabel",
|
|
18219
|
+
componentId: "sc-mja0b5-0"
|
|
18220
|
+
})(["background-color:", ";color:", ";font-weight:bold;padding:2px 5px;border-radius:5px;margin-right:5px;margin-bottom:5px;display:inline-block;"], function (_ref2) {
|
|
18221
|
+
var backgroundColor = _ref2.backgroundColor;
|
|
18222
|
+
return backgroundColor;
|
|
18223
|
+
}, function (_ref3) {
|
|
18224
|
+
var textColor = _ref3.textColor;
|
|
18225
|
+
return textColor;
|
|
18226
|
+
});
|
|
18057
18227
|
var StyledArrow = /*#__PURE__*/styled(SelectArrow).withConfig({
|
|
18058
18228
|
displayName: "TradingItemRow__StyledArrow",
|
|
18059
|
-
componentId: "sc-mja0b5-
|
|
18229
|
+
componentId: "sc-mja0b5-1"
|
|
18060
18230
|
})(["margin:40px;"]);
|
|
18061
18231
|
var ItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
18062
18232
|
displayName: "TradingItemRow__ItemWrapper",
|
|
18063
|
-
componentId: "sc-mja0b5-
|
|
18233
|
+
componentId: "sc-mja0b5-2"
|
|
18064
18234
|
})(["width:100%;margin:auto;display:flex;justify-content:space-between;margin-bottom:1rem;&:hover{background-color:", ";}padding:0.5rem;"], uiColors.darkGray);
|
|
18065
18235
|
var ItemNameContainer = /*#__PURE__*/styled.div.withConfig({
|
|
18066
18236
|
displayName: "TradingItemRow__ItemNameContainer",
|
|
18067
|
-
componentId: "sc-mja0b5-
|
|
18237
|
+
componentId: "sc-mja0b5-3"
|
|
18068
18238
|
})(["flex:60%;"]);
|
|
18069
18239
|
var ItemIconContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
18070
18240
|
displayName: "TradingItemRow__ItemIconContainer",
|
|
18071
|
-
componentId: "sc-mja0b5-
|
|
18241
|
+
componentId: "sc-mja0b5-4"
|
|
18072
18242
|
})(["display:flex;justify-content:flex-start;align-items:center;flex:0 0 58px;"]);
|
|
18073
18243
|
var SpriteContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
18074
18244
|
displayName: "TradingItemRow__SpriteContainer",
|
|
18075
|
-
componentId: "sc-mja0b5-
|
|
18245
|
+
componentId: "sc-mja0b5-5"
|
|
18076
18246
|
})(["position:relative;top:-0.5rem;left:0.5rem;"]);
|
|
18077
18247
|
var NameValue = /*#__PURE__*/styled.div.withConfig({
|
|
18078
18248
|
displayName: "TradingItemRow__NameValue",
|
|
18079
|
-
componentId: "sc-mja0b5-
|
|
18249
|
+
componentId: "sc-mja0b5-6"
|
|
18080
18250
|
})(["p{font-size:0.75rem;margin:0;}"]);
|
|
18081
18251
|
var Item$1 = /*#__PURE__*/styled.span.withConfig({
|
|
18082
18252
|
displayName: "TradingItemRow__Item",
|
|
18083
|
-
componentId: "sc-mja0b5-
|
|
18253
|
+
componentId: "sc-mja0b5-7"
|
|
18084
18254
|
})(["color:white;text-align:center;z-index:1;width:100%;"]);
|
|
18085
18255
|
var TextOverlay$2 = /*#__PURE__*/styled.div.withConfig({
|
|
18086
18256
|
displayName: "TradingItemRow__TextOverlay",
|
|
18087
|
-
componentId: "sc-mja0b5-
|
|
18257
|
+
componentId: "sc-mja0b5-8"
|
|
18088
18258
|
})(["width:100%;position:relative;"]);
|
|
18089
18259
|
var QuantityContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
18090
18260
|
displayName: "TradingItemRow__QuantityContainer",
|
|
18091
|
-
componentId: "sc-mja0b5-
|
|
18261
|
+
componentId: "sc-mja0b5-9"
|
|
18092
18262
|
})(["position:relative;display:flex;min-width:100px;width:40%;justify-content:center;align-items:center;flex:40%;"]);
|
|
18093
18263
|
var QuantityDisplay = /*#__PURE__*/styled.div.withConfig({
|
|
18094
18264
|
displayName: "TradingItemRow__QuantityDisplay",
|
|
18095
|
-
componentId: "sc-mja0b5-
|
|
18265
|
+
componentId: "sc-mja0b5-10"
|
|
18096
18266
|
})(["font-size:", ";"], uiFonts.size.small);
|
|
18097
18267
|
|
|
18098
18268
|
var TradingMenu = function TradingMenu(_ref) {
|
|
@@ -18178,7 +18348,8 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
18178
18348
|
traderItem: tradeItem,
|
|
18179
18349
|
selectedQty: (_qtyMap$get = qtyMap.get(tradeItem.key)) != null ? _qtyMap$get : 0,
|
|
18180
18350
|
equipmentSet: equipmentSet,
|
|
18181
|
-
scale: scale
|
|
18351
|
+
scale: scale,
|
|
18352
|
+
isBuy: isBuy()
|
|
18182
18353
|
}));
|
|
18183
18354
|
})), React.createElement(GoldWrapper, null, React.createElement("p", null, "Available Gold:"), React.createElement("p", null, "$", characterAvailableGold)), React.createElement(TotalWrapper, null, React.createElement("p", null, "Total:"), React.createElement("p", null, "$", sum)), !hasGoldForSale() ? React.createElement(AlertWrapper, null, React.createElement("p", null, " Sorry, not enough money.")) : React.createElement(GoldWrapper, null, React.createElement("p", null, "Final Gold:"), React.createElement("p", null, "$", getFinalGold())), React.createElement(ButtonWrapper$2, null, React.createElement(Button, {
|
|
18184
18355
|
buttonType: ButtonTypes.RPGUIButton,
|
|
@@ -18324,5 +18495,5 @@ var ButtonWrapper$3 = /*#__PURE__*/styled.div.withConfig({
|
|
|
18324
18495
|
componentId: "sc-gptoxp-5"
|
|
18325
18496
|
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;"]);
|
|
18326
18497
|
|
|
18327
|
-
export { Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, CheckButton, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, EquipmentSlotSpriteByType, ErrorBoundary, HistoryDialog, ImageCarousel, ImgSide, Input, InputRadio$1 as InputRadio, ItemContainer$1 as ItemContainer, ItemSelector, ItemSlot, Leaderboard, ListMenu, Marketplace, MarketplaceRows, NPCDialog, NPCDialogType, NPCMultiDialog, PartyCreate, PartyDashboard, PartyInvite, PartyManager, PartyManagerRow, PartyRow, PlayersRow, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, Shortcuts, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, TextArea, TimeWidget, TradingMenu, Truncate, _RPGUI, mockedPartyManager, mockedPartyRows, mockedPlayersRows, mockedPlayersRows2, rarityColor, useEventListener };
|
|
18498
|
+
export { Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, ChatRevamp, CheckButton, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, EquipmentSlotSpriteByType, ErrorBoundary, HistoryDialog, ImageCarousel, ImgSide, Input, InputRadio$1 as InputRadio, ItemContainer$1 as ItemContainer, ItemSelector, ItemSlot, Leaderboard, ListMenu, Marketplace, MarketplaceRows, NPCDialog, NPCDialogType, NPCMultiDialog, PartyCreate, PartyDashboard, PartyInvite, PartyManager, PartyManagerRow, PartyRow, PlayersRow, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, Shortcuts, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, TextArea, TimeWidget, TradingMenu, Truncate, _RPGUI, mockedPartyManager, mockedPartyRows, mockedPlayersRows, mockedPlayersRows2, rarityColor, useEventListener };
|
|
18328
18499
|
//# sourceMappingURL=long-bow.esm.js.map
|