@rpg-engine/long-bow 0.3.28 → 0.3.30
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 +9 -5
- package/dist/components/Equipment/EquipmentSet.d.ts +1 -0
- package/dist/components/Item/Inventory/ItemContainer.d.ts +1 -0
- package/dist/components/Item/Inventory/ItemSlot.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +29 -24
- 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 +29 -24
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/mocks/skills.mocks.d.ts +2 -121
- package/package.json +2 -2
- package/src/components/Chat/Chat.tsx +37 -23
- package/src/components/Chatdeprecated/ChatDeprecated.tsx +1 -1
- package/src/components/Equipment/EquipmentSet.tsx +3 -0
- package/src/components/Item/Inventory/ItemContainer.tsx +3 -0
- package/src/components/Item/Inventory/ItemSlot.tsx +3 -0
- package/src/mocks/equipmentSet.mocks.ts +20 -9
- package/src/mocks/itemContainer.mocks.ts +16 -2
- package/src/mocks/skills.mocks.ts +8 -2
- package/src/stories/Chat.stories.tsx +3 -1
- package/src/.DS_Store +0 -0
- package/src/components/NPCDialog/.DS_Store +0 -0
- package/src/components/NPCDialog/img/.DS_Store +0 -0
- package/src/mocks/.DS_Store +0 -0
- package/src/mocks/atlas/.DS_Store +0 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { IChatMessage } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
interface IStyles {
|
|
4
|
+
textColor?: string;
|
|
5
|
+
buttonColor?: string;
|
|
6
|
+
buttonBackgroundColor?: string;
|
|
7
|
+
width?: string;
|
|
8
|
+
height?: string;
|
|
9
|
+
}
|
|
3
10
|
export interface IChatProps {
|
|
4
11
|
chatMessages: IChatMessage[];
|
|
5
12
|
onSendChatMessage: (message: string) => void;
|
|
@@ -7,11 +14,8 @@ export interface IChatProps {
|
|
|
7
14
|
onFocus?: () => void;
|
|
8
15
|
onBlur?: () => void;
|
|
9
16
|
opacity?: number;
|
|
10
|
-
width?: string;
|
|
11
|
-
height?: string;
|
|
12
17
|
sendMessage: boolean;
|
|
13
|
-
|
|
14
|
-
buttonColor?: string;
|
|
15
|
-
buttonBackgroundColor?: string;
|
|
18
|
+
styles?: IStyles;
|
|
16
19
|
}
|
|
17
20
|
export declare const Chat: React.FC<IChatProps>;
|
|
21
|
+
export {};
|
|
@@ -9,6 +9,7 @@ export interface IEquipmentSetProps {
|
|
|
9
9
|
onItemDragEnd?: (quantity?: number) => void;
|
|
10
10
|
onItemPlaceDrop?: (item: IItem | null, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
|
|
11
11
|
onItemOutsideDrop?: (item: IItem, position: IPosition) => void;
|
|
12
|
+
dragScale?: number;
|
|
12
13
|
checkIfItemCanBeMoved: () => boolean;
|
|
13
14
|
checkIfItemShouldDragEnd?: () => boolean;
|
|
14
15
|
onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
|
|
@@ -9,6 +9,7 @@ export interface IItemContainerProps {
|
|
|
9
9
|
onItemDragEnd?: (quantity?: number) => void;
|
|
10
10
|
onOutsideDrop?: (item: IItem, position: IPosition) => void;
|
|
11
11
|
onItemPlaceDrop?: (item: IItem | null, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
|
|
12
|
+
dragScale?: number;
|
|
12
13
|
checkIfItemCanBeMoved: () => boolean;
|
|
13
14
|
checkIfItemShouldDragEnd?: () => boolean;
|
|
14
15
|
onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
|
|
@@ -14,6 +14,7 @@ interface IProps {
|
|
|
14
14
|
onDragStart: (item: IItem, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
|
|
15
15
|
onDragEnd: (quantity?: number) => void;
|
|
16
16
|
onOutsideDrop?: (item: IItem, position: IPosition) => void;
|
|
17
|
+
dragScale?: number;
|
|
17
18
|
checkIfItemCanBeMoved: () => boolean;
|
|
18
19
|
checkIfItemShouldDragEnd?: () => boolean;
|
|
19
20
|
openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;
|
|
@@ -10,7 +10,7 @@ var styled = _interopDefault(require('styled-components'));
|
|
|
10
10
|
var shared = require('@rpg-engine/shared');
|
|
11
11
|
var dayjs = _interopDefault(require('dayjs'));
|
|
12
12
|
var reactErrorBoundary = require('react-error-boundary');
|
|
13
|
-
var
|
|
13
|
+
var rx = require('react-icons/rx');
|
|
14
14
|
var Draggable = _interopDefault(require('react-draggable'));
|
|
15
15
|
var uuid = require('uuid');
|
|
16
16
|
var mobxReactLite = require('mobx-react-lite');
|
|
@@ -32720,18 +32720,16 @@ var Column = /*#__PURE__*/styled.div.withConfig({
|
|
|
32720
32720
|
var Chat = function Chat(_ref) {
|
|
32721
32721
|
var chatMessages = _ref.chatMessages,
|
|
32722
32722
|
onSendChatMessage = _ref.onSendChatMessage,
|
|
32723
|
-
_ref$width = _ref.width,
|
|
32724
|
-
width = _ref$width === void 0 ? '80%' : _ref$width,
|
|
32725
|
-
_ref$height = _ref.height,
|
|
32726
|
-
height = _ref$height === void 0 ? '250px' : _ref$height,
|
|
32727
32723
|
onFocus = _ref.onFocus,
|
|
32728
32724
|
onBlur = _ref.onBlur,
|
|
32729
|
-
_ref$
|
|
32730
|
-
|
|
32731
|
-
|
|
32732
|
-
|
|
32733
|
-
|
|
32734
|
-
|
|
32725
|
+
_ref$styles = _ref.styles,
|
|
32726
|
+
styles = _ref$styles === void 0 ? {
|
|
32727
|
+
textColor: '#c65102',
|
|
32728
|
+
buttonColor: '#005b96',
|
|
32729
|
+
buttonBackgroundColor: 'rgba(0,0,0,.2)',
|
|
32730
|
+
width: '80%',
|
|
32731
|
+
height: 'auto'
|
|
32732
|
+
} : _ref$styles;
|
|
32735
32733
|
var _useState = React.useState(''),
|
|
32736
32734
|
message = _useState[0],
|
|
32737
32735
|
setMessage = _useState[1];
|
|
@@ -32765,16 +32763,16 @@ var Chat = function Chat(_ref) {
|
|
|
32765
32763
|
emitter = _ref2.emitter,
|
|
32766
32764
|
message = _ref2.message;
|
|
32767
32765
|
return React__default.createElement(Message, {
|
|
32768
|
-
color:
|
|
32766
|
+
color: (styles == null ? void 0 : styles.textColor) || '#c65102',
|
|
32769
32767
|
key: _id + "_" + index
|
|
32770
32768
|
}, onRenderMessageLines(emitter, createdAt, message));
|
|
32771
32769
|
}) : React__default.createElement(Message, {
|
|
32772
|
-
color:
|
|
32770
|
+
color: (styles == null ? void 0 : styles.textColor) || '#c65102'
|
|
32773
32771
|
}, "No messages available.");
|
|
32774
32772
|
};
|
|
32775
32773
|
return React__default.createElement(ChatContainer, {
|
|
32776
|
-
width: width,
|
|
32777
|
-
height: height
|
|
32774
|
+
width: (styles == null ? void 0 : styles.width) || '80%',
|
|
32775
|
+
height: (styles == null ? void 0 : styles.height) || 'auto'
|
|
32778
32776
|
}, React__default.createElement(reactErrorBoundary.ErrorBoundary, {
|
|
32779
32777
|
fallback: React__default.createElement("p", null, "Oops! Your chat has crashed.")
|
|
32780
32778
|
}, React__default.createElement(MessagesContainer, {
|
|
@@ -32793,24 +32791,25 @@ var Chat = function Chat(_ref) {
|
|
|
32793
32791
|
type: "text",
|
|
32794
32792
|
autoComplete: "off",
|
|
32795
32793
|
onFocus: onFocus,
|
|
32796
|
-
onBlur: onBlur
|
|
32794
|
+
onBlur: onBlur,
|
|
32795
|
+
onTouchStart: onFocus
|
|
32797
32796
|
})), React__default.createElement(Column, {
|
|
32798
32797
|
justifyContent: "flex-end"
|
|
32799
32798
|
}, React__default.createElement(Button$1, {
|
|
32800
|
-
buttonColor: buttonColor,
|
|
32801
|
-
buttonBackgroundColor: buttonBackgroundColor,
|
|
32799
|
+
buttonColor: (styles == null ? void 0 : styles.buttonColor) || '#005b96',
|
|
32800
|
+
buttonBackgroundColor: (styles == null ? void 0 : styles.buttonBackgroundColor) || 'rgba(0,0,0,.5)',
|
|
32802
32801
|
id: "chat-send-button",
|
|
32803
32802
|
style: {
|
|
32804
32803
|
borderRadius: '20%'
|
|
32805
32804
|
}
|
|
32806
|
-
}, React__default.createElement(
|
|
32805
|
+
}, React__default.createElement(rx.RxPaperPlane, {
|
|
32807
32806
|
size: 15
|
|
32808
32807
|
}))))));
|
|
32809
32808
|
};
|
|
32810
32809
|
var ChatContainer = /*#__PURE__*/styled.div.withConfig({
|
|
32811
32810
|
displayName: "Chat__ChatContainer",
|
|
32812
32811
|
componentId: "sc-1bk05n6-0"
|
|
32813
|
-
})(["height:", ";width:", ";padding:10px;
|
|
32812
|
+
})(["height:", ";width:", ";padding:10px;background-color:rgba(0,0,0,0.2);height:auto;"], function (props) {
|
|
32814
32813
|
return props.height;
|
|
32815
32814
|
}, function (_ref3) {
|
|
32816
32815
|
var width = _ref3.width;
|
|
@@ -32823,7 +32822,7 @@ var TextField = /*#__PURE__*/styled.input.withConfig({
|
|
|
32823
32822
|
var MessagesContainer = /*#__PURE__*/styled.div.withConfig({
|
|
32824
32823
|
displayName: "Chat__MessagesContainer",
|
|
32825
32824
|
componentId: "sc-1bk05n6-2"
|
|
32826
|
-
})(["height:70%;margin-bottom:10px;"]);
|
|
32825
|
+
})(["height:70%;margin-bottom:10px;.chat-body{max-height:auto;overflow-y:auto;}"]);
|
|
32827
32826
|
var Message = /*#__PURE__*/styled.div.withConfig({
|
|
32828
32827
|
displayName: "Chat__Message",
|
|
32829
32828
|
componentId: "sc-1bk05n6-3"
|
|
@@ -33619,7 +33618,8 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
33619
33618
|
onDrop = _ref.onOutsideDrop,
|
|
33620
33619
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33621
33620
|
openQuantitySelector = _ref.openQuantitySelector,
|
|
33622
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
33621
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
33622
|
+
dragScale = _ref.dragScale;
|
|
33623
33623
|
var _useState = React.useState(false),
|
|
33624
33624
|
isTooltipVisible = _useState[0],
|
|
33625
33625
|
setTooltipVisible = _useState[1];
|
|
@@ -33783,6 +33783,7 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
33783
33783
|
}
|
|
33784
33784
|
}, React__default.createElement(Draggable, {
|
|
33785
33785
|
defaultClassName: item ? 'draggable' : 'empty-slot',
|
|
33786
|
+
scale: dragScale,
|
|
33786
33787
|
onStop: function onStop(e, data) {
|
|
33787
33788
|
if (wasDragged && item) {
|
|
33788
33789
|
var _e$target;
|
|
@@ -33902,7 +33903,8 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33902
33903
|
onItemPlaceDrop = _ref.onItemPlaceDrop,
|
|
33903
33904
|
onItemOutsideDrop = _ref.onItemOutsideDrop,
|
|
33904
33905
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33905
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
33906
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
33907
|
+
dragScale = _ref.dragScale;
|
|
33906
33908
|
var neck = equipmentSet.neck,
|
|
33907
33909
|
leftHand = equipmentSet.leftHand,
|
|
33908
33910
|
ring = equipmentSet.ring,
|
|
@@ -33947,6 +33949,7 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33947
33949
|
onDragEnd: function onDragEnd(quantity) {
|
|
33948
33950
|
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
33949
33951
|
},
|
|
33952
|
+
dragScale: dragScale,
|
|
33950
33953
|
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
33951
33954
|
checkIfItemShouldDragEnd: checkIfItemShouldDragEnd,
|
|
33952
33955
|
onPlaceDrop: function onPlaceDrop(item, slotIndex, itemContainerType) {
|
|
@@ -34725,7 +34728,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34725
34728
|
_onOutsideDrop = _ref.onOutsideDrop,
|
|
34726
34729
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
34727
34730
|
initialPosition = _ref.initialPosition,
|
|
34728
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
34731
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
34732
|
+
dragScale = _ref.dragScale;
|
|
34729
34733
|
var _useState = React.useState({
|
|
34730
34734
|
isOpen: false,
|
|
34731
34735
|
maxQuantity: 1,
|
|
@@ -34758,6 +34762,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34758
34762
|
onDragEnd: function onDragEnd(quantity) {
|
|
34759
34763
|
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
34760
34764
|
},
|
|
34765
|
+
dragScale: dragScale,
|
|
34761
34766
|
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
34762
34767
|
checkIfItemShouldDragEnd: checkIfItemShouldDragEnd,
|
|
34763
34768
|
openQuantitySelector: function openQuantitySelector(maxQuantity, callback) {
|