@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IChatMessage } from '@rpg-engine/shared';
|
|
1
|
+
import { IChatMessage, IPrivateChatMessage } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
interface IStyles {
|
|
3
|
+
export interface IStyles {
|
|
4
4
|
textColor?: string;
|
|
5
5
|
buttonColor?: string;
|
|
6
6
|
buttonBackgroundColor?: string;
|
|
@@ -8,7 +8,7 @@ interface IStyles {
|
|
|
8
8
|
height?: string;
|
|
9
9
|
}
|
|
10
10
|
export interface IChatProps {
|
|
11
|
-
chatMessages: IChatMessage[];
|
|
11
|
+
chatMessages: IChatMessage[] | IPrivateChatMessage[];
|
|
12
12
|
onSendChatMessage: (message: string) => void;
|
|
13
13
|
onCloseButton: () => void;
|
|
14
14
|
onFocus?: () => void;
|
|
@@ -18,4 +18,3 @@ export interface IChatProps {
|
|
|
18
18
|
styles?: IStyles;
|
|
19
19
|
}
|
|
20
20
|
export declare const Chat: React.FC<IChatProps>;
|
|
21
|
-
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ICharacter, IChatMessage, IPrivateChatMessage } from '@rpg-engine/shared';
|
|
3
|
+
import { IStyles } from '../Chat/Chat';
|
|
4
|
+
export interface ITabStyles {
|
|
5
|
+
width?: string;
|
|
6
|
+
height?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare type PrivateChatCharacter = Pick<ICharacter, '_id' | 'name'>;
|
|
9
|
+
export interface IChatRevampProps {
|
|
10
|
+
chatMessages: IChatMessage[] | IPrivateChatMessage[];
|
|
11
|
+
onSendGlobalChatMessage: (message: string) => void;
|
|
12
|
+
onCloseButton: () => void;
|
|
13
|
+
onFocus?: () => void;
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
opacity?: number;
|
|
16
|
+
styles?: IStyles;
|
|
17
|
+
tabs: {
|
|
18
|
+
label: string;
|
|
19
|
+
id: string;
|
|
20
|
+
}[];
|
|
21
|
+
activeTab: string;
|
|
22
|
+
onChangeTab: (tabId: string) => void;
|
|
23
|
+
privateChatCharacters?: PrivateChatCharacter[];
|
|
24
|
+
onChangeCharacterName: (characterName: string) => void;
|
|
25
|
+
onCharacterClick?: (character: PrivateChatCharacter) => void;
|
|
26
|
+
onSendPrivateChatMessage: (message: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const ChatRevamp: ({ chatMessages, onSendGlobalChatMessage, onChangeCharacterName, onFocus, onBlur, onCloseButton, styles, tabs, onChangeTab, activeTab, privateChatCharacters, onCharacterClick, onSendPrivateChatMessage, }: IChatRevampProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IStyles } from '../Chat/Chat';
|
|
3
|
+
import type { PrivateChatCharacter } from './ChatRevamp';
|
|
4
|
+
interface ISearchCharacterProps {
|
|
5
|
+
onFocus?: () => void;
|
|
6
|
+
onBlur?: () => void;
|
|
7
|
+
onChangeCharacterName: (characterName: string) => void;
|
|
8
|
+
styles?: IStyles;
|
|
9
|
+
recentCharacters?: PrivateChatCharacter[];
|
|
10
|
+
setShowSearchCharacter: (show: boolean) => void;
|
|
11
|
+
onCharacterClick?: (character: PrivateChatCharacter) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const SearchCharacter: ({ onChangeCharacterName, onBlur, onFocus, recentCharacters, setShowSearchCharacter, onCharacterClick, styles, }: ISearchCharacterProps) => JSX.Element;
|
|
14
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './components/Button';
|
|
2
2
|
export * from './components/Character/CharacterSelection';
|
|
3
3
|
export * from './components/Chat/Chat';
|
|
4
|
+
export * from './components/ChatRevamp/ChatRevamp';
|
|
4
5
|
export * from './components/Chatdeprecated/ChatDeprecated';
|
|
5
6
|
export * from './components/CheckButton';
|
|
6
7
|
export * from './components/CircularController/CircularController';
|
|
@@ -12559,15 +12559,11 @@ var Chat = function Chat(_ref) {
|
|
|
12559
12559
|
return dayjs(createdAt || new Date()).format('HH:mm') + " " + (emitter != null && emitter.name ? emitter.name + ": " : 'Unknown: ') + " " + message;
|
|
12560
12560
|
};
|
|
12561
12561
|
var onRenderChatMessages = function onRenderChatMessages(chatMessages) {
|
|
12562
|
-
return chatMessages != null && chatMessages.length ? chatMessages == null ? void 0 : chatMessages.map(function (
|
|
12563
|
-
var _id = _ref2._id,
|
|
12564
|
-
createdAt = _ref2.createdAt,
|
|
12565
|
-
emitter = _ref2.emitter,
|
|
12566
|
-
message = _ref2.message;
|
|
12562
|
+
return chatMessages != null && chatMessages.length ? chatMessages == null ? void 0 : chatMessages.map(function (chatMessage, index) {
|
|
12567
12563
|
return React__default.createElement(Message, {
|
|
12568
12564
|
color: (styles == null ? void 0 : styles.textColor) || '#c65102',
|
|
12569
|
-
key: _id + "_" + index
|
|
12570
|
-
}, onRenderMessageLines(emitter, createdAt, message));
|
|
12565
|
+
key: chatMessage._id + "_" + index
|
|
12566
|
+
}, onRenderMessageLines(chatMessage.emitter, chatMessage.createdAt, chatMessage.message));
|
|
12571
12567
|
}) : React__default.createElement(Message, {
|
|
12572
12568
|
color: (styles == null ? void 0 : styles.textColor) || '#c65102'
|
|
12573
12569
|
}, "No messages available.");
|
|
@@ -12614,8 +12610,8 @@ var ChatContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
12614
12610
|
componentId: "sc-1bk05n6-0"
|
|
12615
12611
|
})(["height:", ";width:", ";padding:10px;background-color:rgba(0,0,0,0.2);height:auto;"], function (props) {
|
|
12616
12612
|
return props.height;
|
|
12617
|
-
}, function (
|
|
12618
|
-
var width =
|
|
12613
|
+
}, function (_ref2) {
|
|
12614
|
+
var width = _ref2.width;
|
|
12619
12615
|
return width;
|
|
12620
12616
|
});
|
|
12621
12617
|
var TextField = /*#__PURE__*/styled.input.withConfig({
|
|
@@ -12629,8 +12625,8 @@ var MessagesContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
12629
12625
|
var Message = /*#__PURE__*/styled.div.withConfig({
|
|
12630
12626
|
displayName: "Chat__Message",
|
|
12631
12627
|
componentId: "sc-1bk05n6-3"
|
|
12632
|
-
})(["margin-bottom:8px;color:", ";"], function (
|
|
12633
|
-
var color =
|
|
12628
|
+
})(["margin-bottom:8px;color:", ";"], function (_ref3) {
|
|
12629
|
+
var color = _ref3.color;
|
|
12634
12630
|
return color;
|
|
12635
12631
|
});
|
|
12636
12632
|
var Form = /*#__PURE__*/styled.form.withConfig({
|
|
@@ -12640,11 +12636,11 @@ var Form = /*#__PURE__*/styled.form.withConfig({
|
|
|
12640
12636
|
var Button$1 = /*#__PURE__*/styled.button.withConfig({
|
|
12641
12637
|
displayName: "Chat__Button",
|
|
12642
12638
|
componentId: "sc-1bk05n6-5"
|
|
12643
|
-
})(["color:", ";background-color:", ";width:28px;height:28px;border:none !important;"], function (
|
|
12644
|
-
var buttonColor =
|
|
12639
|
+
})(["color:", ";background-color:", ";width:28px;height:28px;border:none !important;"], function (_ref4) {
|
|
12640
|
+
var buttonColor = _ref4.buttonColor;
|
|
12645
12641
|
return buttonColor;
|
|
12646
|
-
}, function (
|
|
12647
|
-
var buttonBackgroundColor =
|
|
12642
|
+
}, function (_ref5) {
|
|
12643
|
+
var buttonBackgroundColor = _ref5.buttonBackgroundColor;
|
|
12648
12644
|
return buttonBackgroundColor;
|
|
12649
12645
|
});
|
|
12650
12646
|
|
|
@@ -12670,6 +12666,174 @@ var uiColors = {
|
|
|
12670
12666
|
white: '#fff'
|
|
12671
12667
|
};
|
|
12672
12668
|
|
|
12669
|
+
var SearchCharacter = function SearchCharacter(_ref) {
|
|
12670
|
+
var onChangeCharacterName = _ref.onChangeCharacterName,
|
|
12671
|
+
onBlur = _ref.onBlur,
|
|
12672
|
+
onFocus = _ref.onFocus,
|
|
12673
|
+
recentCharacters = _ref.recentCharacters,
|
|
12674
|
+
setShowSearchCharacter = _ref.setShowSearchCharacter,
|
|
12675
|
+
onCharacterClick = _ref.onCharacterClick,
|
|
12676
|
+
_ref$styles = _ref.styles,
|
|
12677
|
+
styles = _ref$styles === void 0 ? {
|
|
12678
|
+
textColor: '#c65102',
|
|
12679
|
+
buttonColor: '#005b96',
|
|
12680
|
+
buttonBackgroundColor: 'rgba(0,0,0,.2)',
|
|
12681
|
+
width: '80%',
|
|
12682
|
+
height: 'auto'
|
|
12683
|
+
} : _ref$styles;
|
|
12684
|
+
var _useState = React.useState(''),
|
|
12685
|
+
characterName = _useState[0],
|
|
12686
|
+
setCharacterName = _useState[1];
|
|
12687
|
+
var handleSubmit = function handleSubmit(event) {
|
|
12688
|
+
event.preventDefault();
|
|
12689
|
+
if (!characterName || characterName.trim() === '') return;
|
|
12690
|
+
onChangeCharacterName(characterName);
|
|
12691
|
+
};
|
|
12692
|
+
var handleCharacterClick = function handleCharacterClick(character) {
|
|
12693
|
+
if (!onCharacterClick) return;
|
|
12694
|
+
setCharacterName('');
|
|
12695
|
+
onCharacterClick(character);
|
|
12696
|
+
setShowSearchCharacter(false);
|
|
12697
|
+
};
|
|
12698
|
+
return React__default.createElement(SearchCharacterContainer, {
|
|
12699
|
+
width: (styles == null ? void 0 : styles.width) || '80%',
|
|
12700
|
+
height: (styles == null ? void 0 : styles.height) || 'auto'
|
|
12701
|
+
}, React__default.createElement(Form$1, {
|
|
12702
|
+
onSubmit: handleSubmit
|
|
12703
|
+
}, React__default.createElement(Column, {
|
|
12704
|
+
flex: 70
|
|
12705
|
+
}, React__default.createElement(TextField$1, {
|
|
12706
|
+
value: characterName,
|
|
12707
|
+
id: "inputCharacterName",
|
|
12708
|
+
onChange: function onChange(e) {
|
|
12709
|
+
setCharacterName(e.target.value);
|
|
12710
|
+
onChangeCharacterName(e.target.value);
|
|
12711
|
+
},
|
|
12712
|
+
height: 20,
|
|
12713
|
+
type: "text",
|
|
12714
|
+
autoComplete: "off",
|
|
12715
|
+
onFocus: onFocus,
|
|
12716
|
+
onBlur: onBlur,
|
|
12717
|
+
onPointerDown: onFocus,
|
|
12718
|
+
autoFocus: true
|
|
12719
|
+
})), React__default.createElement(Column, {
|
|
12720
|
+
justifyContent: "flex-end"
|
|
12721
|
+
}, React__default.createElement(SearchButton, {
|
|
12722
|
+
buttonColor: (styles == null ? void 0 : styles.buttonColor) || '#005b96',
|
|
12723
|
+
buttonBackgroundColor: (styles == null ? void 0 : styles.buttonBackgroundColor) || 'rgba(0,0,0,.5)',
|
|
12724
|
+
id: "chat-send-button",
|
|
12725
|
+
style: {
|
|
12726
|
+
borderRadius: '20%'
|
|
12727
|
+
}
|
|
12728
|
+
}, React__default.createElement(rx.RxMagnifyingGlass, {
|
|
12729
|
+
size: 15
|
|
12730
|
+
})))), recentCharacters && recentCharacters.length > 0 && React__default.createElement(ListContainer, null, recentCharacters.map(function (character) {
|
|
12731
|
+
return React__default.createElement(ListElement, {
|
|
12732
|
+
onPointerDown: function onPointerDown() {
|
|
12733
|
+
return handleCharacterClick(character);
|
|
12734
|
+
},
|
|
12735
|
+
key: character._id
|
|
12736
|
+
}, character.name);
|
|
12737
|
+
})));
|
|
12738
|
+
};
|
|
12739
|
+
var SearchCharacterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
12740
|
+
displayName: "SearchCharacter__SearchCharacterContainer",
|
|
12741
|
+
componentId: "sc-172lyfr-0"
|
|
12742
|
+
})(["height:", ";width:", ";padding:10px;background-color:rgba(0,0,0,0.2);height:auto;"], function (props) {
|
|
12743
|
+
return props.height;
|
|
12744
|
+
}, function (_ref2) {
|
|
12745
|
+
var width = _ref2.width;
|
|
12746
|
+
return width;
|
|
12747
|
+
});
|
|
12748
|
+
var Form$1 = /*#__PURE__*/styled.form.withConfig({
|
|
12749
|
+
displayName: "SearchCharacter__Form",
|
|
12750
|
+
componentId: "sc-172lyfr-1"
|
|
12751
|
+
})(["display:flex;width:100%;justify-content:center;align-items:center;"]);
|
|
12752
|
+
var TextField$1 = /*#__PURE__*/styled.input.withConfig({
|
|
12753
|
+
displayName: "SearchCharacter__TextField",
|
|
12754
|
+
componentId: "sc-172lyfr-2"
|
|
12755
|
+
})(["width:100%;background-color:rgba(0,0,0,0.25) !important;border:none !important;max-height:28px !important;"]);
|
|
12756
|
+
var SearchButton = /*#__PURE__*/styled.button.withConfig({
|
|
12757
|
+
displayName: "SearchCharacter__SearchButton",
|
|
12758
|
+
componentId: "sc-172lyfr-3"
|
|
12759
|
+
})(["color:", ";background-color:", ";width:28px;height:28px;border:none !important;"], function (_ref3) {
|
|
12760
|
+
var buttonColor = _ref3.buttonColor;
|
|
12761
|
+
return buttonColor;
|
|
12762
|
+
}, function (_ref4) {
|
|
12763
|
+
var buttonBackgroundColor = _ref4.buttonBackgroundColor;
|
|
12764
|
+
return buttonBackgroundColor;
|
|
12765
|
+
});
|
|
12766
|
+
var ListContainer = /*#__PURE__*/styled.ul.withConfig({
|
|
12767
|
+
displayName: "SearchCharacter__ListContainer",
|
|
12768
|
+
componentId: "sc-172lyfr-4"
|
|
12769
|
+
})(["border:none;overflow-y:scroll;list-style:none;padding:0;"]);
|
|
12770
|
+
var ListElement = /*#__PURE__*/styled.li.withConfig({
|
|
12771
|
+
displayName: "SearchCharacter__ListElement",
|
|
12772
|
+
componentId: "sc-172lyfr-5"
|
|
12773
|
+
})(["margin:0.5rem 0 !important;font-size:", ";&:hover{color:#ff0;background-color:", ";}button{all:unset;}"], uiFonts.size.small, uiColors.darkGray);
|
|
12774
|
+
|
|
12775
|
+
var ChatRevamp = function ChatRevamp(_ref) {
|
|
12776
|
+
var chatMessages = _ref.chatMessages,
|
|
12777
|
+
onSendGlobalChatMessage = _ref.onSendGlobalChatMessage,
|
|
12778
|
+
onChangeCharacterName = _ref.onChangeCharacterName,
|
|
12779
|
+
onFocus = _ref.onFocus,
|
|
12780
|
+
onBlur = _ref.onBlur,
|
|
12781
|
+
onCloseButton = _ref.onCloseButton,
|
|
12782
|
+
styles = _ref.styles,
|
|
12783
|
+
tabs = _ref.tabs,
|
|
12784
|
+
onChangeTab = _ref.onChangeTab,
|
|
12785
|
+
activeTab = _ref.activeTab,
|
|
12786
|
+
privateChatCharacters = _ref.privateChatCharacters,
|
|
12787
|
+
onCharacterClick = _ref.onCharacterClick,
|
|
12788
|
+
onSendPrivateChatMessage = _ref.onSendPrivateChatMessage;
|
|
12789
|
+
var _useState = React.useState(true),
|
|
12790
|
+
showSearchCharacter = _useState[0],
|
|
12791
|
+
setShowSearchCharacter = _useState[1];
|
|
12792
|
+
React.useEffect(function () {
|
|
12793
|
+
setShowSearchCharacter(true);
|
|
12794
|
+
}, [activeTab]);
|
|
12795
|
+
var isPrivate = activeTab === 'private';
|
|
12796
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(TabContainer, null, tabs.map(function (tab, index) {
|
|
12797
|
+
return React__default.createElement(Tab, {
|
|
12798
|
+
key: tab.label + "_" + index,
|
|
12799
|
+
active: tab.id === activeTab,
|
|
12800
|
+
onPointerDown: function onPointerDown() {
|
|
12801
|
+
return onChangeTab(tab.id);
|
|
12802
|
+
}
|
|
12803
|
+
}, tab.label);
|
|
12804
|
+
})), isPrivate && showSearchCharacter ? React__default.createElement(SearchCharacter, {
|
|
12805
|
+
onFocus: onFocus,
|
|
12806
|
+
onBlur: onBlur,
|
|
12807
|
+
onChangeCharacterName: onChangeCharacterName,
|
|
12808
|
+
styles: styles,
|
|
12809
|
+
recentCharacters: privateChatCharacters,
|
|
12810
|
+
setShowSearchCharacter: setShowSearchCharacter,
|
|
12811
|
+
onCharacterClick: onCharacterClick
|
|
12812
|
+
}) : React__default.createElement(Chat, {
|
|
12813
|
+
chatMessages: chatMessages,
|
|
12814
|
+
onSendChatMessage: isPrivate ? onSendPrivateChatMessage : onSendGlobalChatMessage,
|
|
12815
|
+
sendMessage: true,
|
|
12816
|
+
onCloseButton: onCloseButton,
|
|
12817
|
+
styles: styles,
|
|
12818
|
+
onFocus: onFocus,
|
|
12819
|
+
onBlur: onBlur
|
|
12820
|
+
}));
|
|
12821
|
+
};
|
|
12822
|
+
var TabContainer = /*#__PURE__*/styled.div.withConfig({
|
|
12823
|
+
displayName: "ChatRevamp__TabContainer",
|
|
12824
|
+
componentId: "sc-1sdiknw-0"
|
|
12825
|
+
})(["width:100%;display:flex;gap:10px;"]);
|
|
12826
|
+
var Tab = /*#__PURE__*/styled.button.withConfig({
|
|
12827
|
+
displayName: "ChatRevamp__Tab",
|
|
12828
|
+
componentId: "sc-1sdiknw-1"
|
|
12829
|
+
})(["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) {
|
|
12830
|
+
return props.active ? '#c65102' : uiColors.gray;
|
|
12831
|
+
}, function (props) {
|
|
12832
|
+
return props.active ? uiColors.orange : 'transparent';
|
|
12833
|
+
}, function (props) {
|
|
12834
|
+
return props.active ? 'white' : uiColors.raisinBlack;
|
|
12835
|
+
});
|
|
12836
|
+
|
|
12673
12837
|
var _excluded$2 = ["innerRef"];
|
|
12674
12838
|
var Input = function Input(_ref) {
|
|
12675
12839
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
@@ -12772,7 +12936,7 @@ var ChatDeprecated = function ChatDeprecated(_ref) {
|
|
|
12772
12936
|
width: '100%',
|
|
12773
12937
|
height: '80%',
|
|
12774
12938
|
className: "chat-body dark-background"
|
|
12775
|
-
}, onRenderChatMessages(chatMessages)), React__default.createElement(Form$
|
|
12939
|
+
}, onRenderChatMessages(chatMessages)), React__default.createElement(Form$2, {
|
|
12776
12940
|
onSubmit: handleSubmit
|
|
12777
12941
|
}, React__default.createElement(Column, {
|
|
12778
12942
|
flex: 70
|
|
@@ -12813,7 +12977,7 @@ var CustomContainer = /*#__PURE__*/styled(RPGUIContainer).withConfig({
|
|
|
12813
12977
|
})(["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) {
|
|
12814
12978
|
return props.opacity;
|
|
12815
12979
|
}, uiColors.darkGray);
|
|
12816
|
-
var Form$
|
|
12980
|
+
var Form$2 = /*#__PURE__*/styled.form.withConfig({
|
|
12817
12981
|
displayName: "ChatDeprecated__Form",
|
|
12818
12982
|
componentId: "sc-fuuod3-4"
|
|
12819
12983
|
})(["display:flex;width:100%;justify-content:center;align-items:center;"]);
|
|
@@ -13257,7 +13421,7 @@ var RelativeListMenu = function RelativeListMenu(_ref) {
|
|
|
13257
13421
|
overflow: 'hidden'
|
|
13258
13422
|
}
|
|
13259
13423
|
}, options.map(function (params, index) {
|
|
13260
|
-
return React__default.createElement(ListElement, {
|
|
13424
|
+
return React__default.createElement(ListElement$1, {
|
|
13261
13425
|
key: (params == null ? void 0 : params.id) || index,
|
|
13262
13426
|
onPointerDown: function onPointerDown() {
|
|
13263
13427
|
onSelected(params == null ? void 0 : params.id);
|
|
@@ -13275,7 +13439,7 @@ var Container$8 = /*#__PURE__*/styled.div.withConfig({
|
|
|
13275
13439
|
}, function (props) {
|
|
13276
13440
|
return props.fontSize;
|
|
13277
13441
|
});
|
|
13278
|
-
var ListElement = /*#__PURE__*/styled.li.withConfig({
|
|
13442
|
+
var ListElement$1 = /*#__PURE__*/styled.li.withConfig({
|
|
13279
13443
|
displayName: "RelativeListMenu__ListElement",
|
|
13280
13444
|
componentId: "sc-7hohf-1"
|
|
13281
13445
|
})(["margin-right:0.5rem;"]);
|
|
@@ -15580,7 +15744,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15580
15744
|
isDepotSystem = _ref.isDepotSystem,
|
|
15581
15745
|
onPositionChangeEnd = _ref.onPositionChangeEnd,
|
|
15582
15746
|
onPositionChangeStart = _ref.onPositionChangeStart;
|
|
15583
|
-
var MAX_SLOTS_PER_PAGE = 20;
|
|
15584
15747
|
var _useState = React.useState({
|
|
15585
15748
|
isOpen: false,
|
|
15586
15749
|
maxQuantity: 1,
|
|
@@ -15591,10 +15754,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15591
15754
|
var _useState2 = React.useState(-1),
|
|
15592
15755
|
settingShortcutIndex = _useState2[0],
|
|
15593
15756
|
setSettingShortcutIndex = _useState2[1];
|
|
15594
|
-
var _useState3 = React.useState(1),
|
|
15595
|
-
currentPage = _useState3[0],
|
|
15596
|
-
setCurrentPage = _useState3[1];
|
|
15597
|
-
var totalPages = Math.ceil(itemContainer.slotQty / MAX_SLOTS_PER_PAGE);
|
|
15598
15757
|
var handleSetShortcut = function handleSetShortcut(item, index) {
|
|
15599
15758
|
if (item.type === shared.ItemType.Consumable || item.type === shared.ItemType.Tool) {
|
|
15600
15759
|
setItemShortcut == null ? void 0 : setItemShortcut(item.key, index);
|
|
@@ -15602,11 +15761,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15602
15761
|
};
|
|
15603
15762
|
var onRenderSlots = function onRenderSlots() {
|
|
15604
15763
|
var slots = [];
|
|
15605
|
-
var
|
|
15606
|
-
var end = start + MAX_SLOTS_PER_PAGE;
|
|
15607
|
-
for (var i = start; i < end && i < itemContainer.slotQty; i++) {
|
|
15764
|
+
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
15608
15765
|
var _itemContainer$slots;
|
|
15609
|
-
console.log(itemContainer);
|
|
15610
15766
|
slots.push(React__default.createElement(ItemSlot, {
|
|
15611
15767
|
isContextMenuDisabled: disableContextMenu,
|
|
15612
15768
|
key: i,
|
|
@@ -15657,16 +15813,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15657
15813
|
}
|
|
15658
15814
|
return slots;
|
|
15659
15815
|
};
|
|
15660
|
-
var goToNextPage = function goToNextPage() {
|
|
15661
|
-
setCurrentPage(function (current) {
|
|
15662
|
-
return Math.min(current + 1, totalPages);
|
|
15663
|
-
});
|
|
15664
|
-
};
|
|
15665
|
-
var goToPreviousPage = function goToPreviousPage() {
|
|
15666
|
-
setCurrentPage(function (current) {
|
|
15667
|
-
return Math.max(current - 1, 1);
|
|
15668
|
-
});
|
|
15669
|
-
};
|
|
15670
15816
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(SlotsContainer, {
|
|
15671
15817
|
title: itemContainer.name || 'Container',
|
|
15672
15818
|
onClose: onClose,
|
|
@@ -15683,23 +15829,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15683
15829
|
atlasJSON: atlasJSON
|
|
15684
15830
|
}), React__default.createElement(ItemsContainer, {
|
|
15685
15831
|
className: "item-container-body"
|
|
15686
|
-
}, onRenderSlots()),
|
|
15687
|
-
className: 'arrow .arrow-up',
|
|
15688
|
-
direction: "left",
|
|
15689
|
-
onPointerDown: function onPointerDown() {
|
|
15690
|
-
if (currentPage > 1) {
|
|
15691
|
-
goToPreviousPage();
|
|
15692
|
-
}
|
|
15693
|
-
}
|
|
15694
|
-
}), currentPage < totalPages && React__default.createElement(SelectArrow, {
|
|
15695
|
-
className: 'arrow .arrow-down',
|
|
15696
|
-
direction: "right",
|
|
15697
|
-
onPointerDown: function onPointerDown() {
|
|
15698
|
-
if (currentPage < totalPages) {
|
|
15699
|
-
goToNextPage();
|
|
15700
|
-
}
|
|
15701
|
-
}
|
|
15702
|
-
}))), quantitySelect.isOpen && React__default.createElement(ModalPortal, null, React__default.createElement(QuantitySelectorContainer, null, React__default.createElement(ItemQuantitySelector, {
|
|
15832
|
+
}, onRenderSlots())), quantitySelect.isOpen && React__default.createElement(ModalPortal, null, React__default.createElement(QuantitySelectorContainer, null, React__default.createElement(ItemQuantitySelector, {
|
|
15703
15833
|
quantity: quantitySelect.maxQuantity,
|
|
15704
15834
|
onConfirm: function onConfirm(quantity) {
|
|
15705
15835
|
quantitySelect.callback(quantity);
|
|
@@ -15722,15 +15852,11 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15722
15852
|
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
15723
15853
|
displayName: "ItemContainer__ItemsContainer",
|
|
15724
15854
|
componentId: "sc-15y5p9l-0"
|
|
15725
|
-
})(["display:flex;justify-content:center;flex-wrap:wrap;"]);
|
|
15855
|
+
})(["display:flex;justify-content:center;flex-wrap:wrap;max-height:270px;overflow-y:auto;"]);
|
|
15726
15856
|
var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
15727
15857
|
displayName: "ItemContainer__QuantitySelectorContainer",
|
|
15728
15858
|
componentId: "sc-15y5p9l-1"
|
|
15729
15859
|
})(["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);"]);
|
|
15730
|
-
var ArrowContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
15731
|
-
displayName: "ItemContainer__ArrowContainer",
|
|
15732
|
-
componentId: "sc-15y5p9l-2"
|
|
15733
|
-
})(["margin-top:10px;margin-bottom:30px;span:first-child{margin-left:20px;}span:last-child{margin-right:20px;}"]);
|
|
15734
15860
|
|
|
15735
15861
|
var LeaderboardTable = function LeaderboardTable(props) {
|
|
15736
15862
|
var items = props.items,
|
|
@@ -15864,7 +15990,7 @@ var ListMenu = function ListMenu(_ref) {
|
|
|
15864
15990
|
overflow: 'hidden'
|
|
15865
15991
|
}
|
|
15866
15992
|
}, options.map(function (params, index) {
|
|
15867
|
-
return React__default.createElement(ListElement$
|
|
15993
|
+
return React__default.createElement(ListElement$2, {
|
|
15868
15994
|
key: (params == null ? void 0 : params.id) || index,
|
|
15869
15995
|
onPointerDown: function onPointerDown() {
|
|
15870
15996
|
onSelected(params == null ? void 0 : params.id);
|
|
@@ -15880,7 +16006,7 @@ var Container$j = /*#__PURE__*/styled.div.withConfig({
|
|
|
15880
16006
|
}, function (props) {
|
|
15881
16007
|
return props.x || 0;
|
|
15882
16008
|
}, uiFonts.size.xsmall);
|
|
15883
|
-
var ListElement$
|
|
16009
|
+
var ListElement$2 = /*#__PURE__*/styled.li.withConfig({
|
|
15884
16010
|
displayName: "ListMenu__ListElement",
|
|
15885
16011
|
componentId: "sc-i9097t-1"
|
|
15886
16012
|
})(["margin-right:0.5rem;"]);
|
|
@@ -18001,7 +18127,8 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18001
18127
|
traderItem = _ref.traderItem,
|
|
18002
18128
|
selectedQty = _ref.selectedQty,
|
|
18003
18129
|
equipmentSet = _ref.equipmentSet,
|
|
18004
|
-
scale = _ref.scale
|
|
18130
|
+
scale = _ref.scale,
|
|
18131
|
+
isBuy = _ref.isBuy;
|
|
18005
18132
|
var onLeftClick = function onLeftClick(qty) {
|
|
18006
18133
|
if (qty === void 0) {
|
|
18007
18134
|
qty = 1;
|
|
@@ -18015,6 +18142,39 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18015
18142
|
}
|
|
18016
18143
|
onQuantityChange(traderItem, Math.min((_traderItem$stackQty = traderItem.stackQty) != null ? _traderItem$stackQty : 999, selectedQty + qty));
|
|
18017
18144
|
};
|
|
18145
|
+
var renderAccountTypeIndicator = function renderAccountTypeIndicator() {
|
|
18146
|
+
if (isBuy && traderItem.canBePurchasedOnlyByPremiumPlans) {
|
|
18147
|
+
return traderItem.canBePurchasedOnlyByPremiumPlans.map(function (accountType) {
|
|
18148
|
+
if (accountType !== shared.UserAccountTypes.Free) {
|
|
18149
|
+
var backgroundColor;
|
|
18150
|
+
var textColor = 'black';
|
|
18151
|
+
switch (accountType) {
|
|
18152
|
+
case shared.UserAccountTypes.PremiumBronze:
|
|
18153
|
+
backgroundColor = '#CD7F32';
|
|
18154
|
+
break;
|
|
18155
|
+
case shared.UserAccountTypes.PremiumSilver:
|
|
18156
|
+
backgroundColor = '#C0C0C0';
|
|
18157
|
+
break;
|
|
18158
|
+
case shared.UserAccountTypes.PremiumGold:
|
|
18159
|
+
backgroundColor = '#FFD700';
|
|
18160
|
+
break;
|
|
18161
|
+
case shared.UserAccountTypes.PremiumUltimate:
|
|
18162
|
+
backgroundColor = '#002E99';
|
|
18163
|
+
break;
|
|
18164
|
+
default:
|
|
18165
|
+
return null;
|
|
18166
|
+
}
|
|
18167
|
+
return React__default.createElement(PremiumLabel, {
|
|
18168
|
+
backgroundColor: backgroundColor,
|
|
18169
|
+
textColor: textColor,
|
|
18170
|
+
key: accountType
|
|
18171
|
+
}, capitalize(accountType) + ' PA');
|
|
18172
|
+
}
|
|
18173
|
+
return null;
|
|
18174
|
+
});
|
|
18175
|
+
}
|
|
18176
|
+
return null;
|
|
18177
|
+
};
|
|
18018
18178
|
return React__default.createElement(ItemWrapper, null, React__default.createElement(ItemIconContainer$1, null, React__default.createElement(SpriteContainer$2, null, React__default.createElement(ItemInfoWrapper, {
|
|
18019
18179
|
atlasIMG: atlasIMG,
|
|
18020
18180
|
atlasJSON: atlasJSON,
|
|
@@ -18034,7 +18194,7 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18034
18194
|
})))), React__default.createElement(ItemNameContainer, null, React__default.createElement(NameValue, null, React__default.createElement("p", null, React__default.createElement(Ellipsis, {
|
|
18035
18195
|
maxLines: 1,
|
|
18036
18196
|
maxWidth: "250px"
|
|
18037
|
-
}, capitalize(traderItem.name))), React__default.createElement("p", null, "$", traderItem.price))), React__default.createElement(QuantityContainer$1, null, React__default.createElement(SelectArrow, {
|
|
18197
|
+
}, capitalize(traderItem.name))), React__default.createElement("p", null, "$", traderItem.price), React__default.createElement("p", null, renderAccountTypeIndicator()))), React__default.createElement(QuantityContainer$1, null, React__default.createElement(SelectArrow, {
|
|
18038
18198
|
size: 32,
|
|
18039
18199
|
className: "arrow-selector",
|
|
18040
18200
|
direction: "left",
|
|
@@ -18056,45 +18216,55 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18056
18216
|
onPointerDown: onRightClick.bind(null, outerQty)
|
|
18057
18217
|
})));
|
|
18058
18218
|
};
|
|
18219
|
+
var PremiumLabel = /*#__PURE__*/styled.span.withConfig({
|
|
18220
|
+
displayName: "TradingItemRow__PremiumLabel",
|
|
18221
|
+
componentId: "sc-mja0b5-0"
|
|
18222
|
+
})(["background-color:", ";color:", ";font-weight:bold;padding:2px 5px;border-radius:5px;margin-right:5px;margin-bottom:5px;display:inline-block;"], function (_ref2) {
|
|
18223
|
+
var backgroundColor = _ref2.backgroundColor;
|
|
18224
|
+
return backgroundColor;
|
|
18225
|
+
}, function (_ref3) {
|
|
18226
|
+
var textColor = _ref3.textColor;
|
|
18227
|
+
return textColor;
|
|
18228
|
+
});
|
|
18059
18229
|
var StyledArrow = /*#__PURE__*/styled(SelectArrow).withConfig({
|
|
18060
18230
|
displayName: "TradingItemRow__StyledArrow",
|
|
18061
|
-
componentId: "sc-mja0b5-
|
|
18231
|
+
componentId: "sc-mja0b5-1"
|
|
18062
18232
|
})(["margin:40px;"]);
|
|
18063
18233
|
var ItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
18064
18234
|
displayName: "TradingItemRow__ItemWrapper",
|
|
18065
|
-
componentId: "sc-mja0b5-
|
|
18235
|
+
componentId: "sc-mja0b5-2"
|
|
18066
18236
|
})(["width:100%;margin:auto;display:flex;justify-content:space-between;margin-bottom:1rem;&:hover{background-color:", ";}padding:0.5rem;"], uiColors.darkGray);
|
|
18067
18237
|
var ItemNameContainer = /*#__PURE__*/styled.div.withConfig({
|
|
18068
18238
|
displayName: "TradingItemRow__ItemNameContainer",
|
|
18069
|
-
componentId: "sc-mja0b5-
|
|
18239
|
+
componentId: "sc-mja0b5-3"
|
|
18070
18240
|
})(["flex:60%;"]);
|
|
18071
18241
|
var ItemIconContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
18072
18242
|
displayName: "TradingItemRow__ItemIconContainer",
|
|
18073
|
-
componentId: "sc-mja0b5-
|
|
18243
|
+
componentId: "sc-mja0b5-4"
|
|
18074
18244
|
})(["display:flex;justify-content:flex-start;align-items:center;flex:0 0 58px;"]);
|
|
18075
18245
|
var SpriteContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
18076
18246
|
displayName: "TradingItemRow__SpriteContainer",
|
|
18077
|
-
componentId: "sc-mja0b5-
|
|
18247
|
+
componentId: "sc-mja0b5-5"
|
|
18078
18248
|
})(["position:relative;top:-0.5rem;left:0.5rem;"]);
|
|
18079
18249
|
var NameValue = /*#__PURE__*/styled.div.withConfig({
|
|
18080
18250
|
displayName: "TradingItemRow__NameValue",
|
|
18081
|
-
componentId: "sc-mja0b5-
|
|
18251
|
+
componentId: "sc-mja0b5-6"
|
|
18082
18252
|
})(["p{font-size:0.75rem;margin:0;}"]);
|
|
18083
18253
|
var Item$1 = /*#__PURE__*/styled.span.withConfig({
|
|
18084
18254
|
displayName: "TradingItemRow__Item",
|
|
18085
|
-
componentId: "sc-mja0b5-
|
|
18255
|
+
componentId: "sc-mja0b5-7"
|
|
18086
18256
|
})(["color:white;text-align:center;z-index:1;width:100%;"]);
|
|
18087
18257
|
var TextOverlay$2 = /*#__PURE__*/styled.div.withConfig({
|
|
18088
18258
|
displayName: "TradingItemRow__TextOverlay",
|
|
18089
|
-
componentId: "sc-mja0b5-
|
|
18259
|
+
componentId: "sc-mja0b5-8"
|
|
18090
18260
|
})(["width:100%;position:relative;"]);
|
|
18091
18261
|
var QuantityContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
18092
18262
|
displayName: "TradingItemRow__QuantityContainer",
|
|
18093
|
-
componentId: "sc-mja0b5-
|
|
18263
|
+
componentId: "sc-mja0b5-9"
|
|
18094
18264
|
})(["position:relative;display:flex;min-width:100px;width:40%;justify-content:center;align-items:center;flex:40%;"]);
|
|
18095
18265
|
var QuantityDisplay = /*#__PURE__*/styled.div.withConfig({
|
|
18096
18266
|
displayName: "TradingItemRow__QuantityDisplay",
|
|
18097
|
-
componentId: "sc-mja0b5-
|
|
18267
|
+
componentId: "sc-mja0b5-10"
|
|
18098
18268
|
})(["font-size:", ";"], uiFonts.size.small);
|
|
18099
18269
|
|
|
18100
18270
|
var TradingMenu = function TradingMenu(_ref) {
|
|
@@ -18180,7 +18350,8 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
18180
18350
|
traderItem: tradeItem,
|
|
18181
18351
|
selectedQty: (_qtyMap$get = qtyMap.get(tradeItem.key)) != null ? _qtyMap$get : 0,
|
|
18182
18352
|
equipmentSet: equipmentSet,
|
|
18183
|
-
scale: scale
|
|
18353
|
+
scale: scale,
|
|
18354
|
+
isBuy: isBuy()
|
|
18184
18355
|
}));
|
|
18185
18356
|
})), React__default.createElement(GoldWrapper, null, React__default.createElement("p", null, "Available Gold:"), React__default.createElement("p", null, "$", characterAvailableGold)), React__default.createElement(TotalWrapper, null, React__default.createElement("p", null, "Total:"), React__default.createElement("p", null, "$", sum)), !hasGoldForSale() ? React__default.createElement(AlertWrapper, null, React__default.createElement("p", null, " Sorry, not enough money.")) : React__default.createElement(GoldWrapper, null, React__default.createElement("p", null, "Final Gold:"), React__default.createElement("p", null, "$", getFinalGold())), React__default.createElement(ButtonWrapper$2, null, React__default.createElement(Button, {
|
|
18186
18357
|
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
@@ -18330,6 +18501,7 @@ exports.Button = Button;
|
|
|
18330
18501
|
exports.CharacterSelection = CharacterSelection;
|
|
18331
18502
|
exports.Chat = Chat;
|
|
18332
18503
|
exports.ChatDeprecated = ChatDeprecated;
|
|
18504
|
+
exports.ChatRevamp = ChatRevamp;
|
|
18333
18505
|
exports.CheckButton = CheckButton;
|
|
18334
18506
|
exports.CircularController = CircularController;
|
|
18335
18507
|
exports.CraftBook = CraftBook;
|