@rpg-engine/long-bow 0.3.28 → 0.3.32
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 +41 -26
- 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 +41 -26
- 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 +36 -23
- package/src/components/Chatdeprecated/ChatDeprecated.tsx +1 -1
- package/src/components/CraftBook/CraftBook.tsx +14 -2
- 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
|
@@ -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, {
|
|
@@ -32797,20 +32795,20 @@ var Chat = function Chat(_ref) {
|
|
|
32797
32795
|
})), React__default.createElement(Column, {
|
|
32798
32796
|
justifyContent: "flex-end"
|
|
32799
32797
|
}, React__default.createElement(Button$1, {
|
|
32800
|
-
buttonColor: buttonColor,
|
|
32801
|
-
buttonBackgroundColor: buttonBackgroundColor,
|
|
32798
|
+
buttonColor: (styles == null ? void 0 : styles.buttonColor) || '#005b96',
|
|
32799
|
+
buttonBackgroundColor: (styles == null ? void 0 : styles.buttonBackgroundColor) || 'rgba(0,0,0,.5)',
|
|
32802
32800
|
id: "chat-send-button",
|
|
32803
32801
|
style: {
|
|
32804
32802
|
borderRadius: '20%'
|
|
32805
32803
|
}
|
|
32806
|
-
}, React__default.createElement(
|
|
32804
|
+
}, React__default.createElement(rx.RxPaperPlane, {
|
|
32807
32805
|
size: 15
|
|
32808
32806
|
}))))));
|
|
32809
32807
|
};
|
|
32810
32808
|
var ChatContainer = /*#__PURE__*/styled.div.withConfig({
|
|
32811
32809
|
displayName: "Chat__ChatContainer",
|
|
32812
32810
|
componentId: "sc-1bk05n6-0"
|
|
32813
|
-
})(["height:", ";width:", ";padding:10px;
|
|
32811
|
+
})(["height:", ";width:", ";padding:10px;background-color:rgba(0,0,0,0.2);height:auto;"], function (props) {
|
|
32814
32812
|
return props.height;
|
|
32815
32813
|
}, function (_ref3) {
|
|
32816
32814
|
var width = _ref3.width;
|
|
@@ -32823,7 +32821,7 @@ var TextField = /*#__PURE__*/styled.input.withConfig({
|
|
|
32823
32821
|
var MessagesContainer = /*#__PURE__*/styled.div.withConfig({
|
|
32824
32822
|
displayName: "Chat__MessagesContainer",
|
|
32825
32823
|
componentId: "sc-1bk05n6-2"
|
|
32826
|
-
})(["height:70%;margin-bottom:10px;"]);
|
|
32824
|
+
})(["height:70%;margin-bottom:10px;.chat-body{max-height:auto;overflow-y:auto;}"]);
|
|
32827
32825
|
var Message = /*#__PURE__*/styled.div.withConfig({
|
|
32828
32826
|
displayName: "Chat__Message",
|
|
32829
32827
|
componentId: "sc-1bk05n6-3"
|
|
@@ -33337,7 +33335,14 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
33337
33335
|
}
|
|
33338
33336
|
}), React__default.createElement("label", {
|
|
33339
33337
|
onClick: function onClick() {
|
|
33340
|
-
|
|
33338
|
+
handleClick(option.key);
|
|
33339
|
+
},
|
|
33340
|
+
onTouchStart: function onTouchStart() {
|
|
33341
|
+
handleClick(option.key);
|
|
33342
|
+
setIsShown({
|
|
33343
|
+
show: true,
|
|
33344
|
+
index: index
|
|
33345
|
+
});
|
|
33341
33346
|
},
|
|
33342
33347
|
style: {
|
|
33343
33348
|
display: 'flex',
|
|
@@ -33367,11 +33372,15 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
33367
33372
|
})));
|
|
33368
33373
|
})), React__default.createElement(ButtonWrapper, null, React__default.createElement(Button, {
|
|
33369
33374
|
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
33370
|
-
onClick: onClose
|
|
33375
|
+
onClick: onClose,
|
|
33376
|
+
onTouchStart: onClose
|
|
33371
33377
|
}, "Cancel"), React__default.createElement(Button, {
|
|
33372
33378
|
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
33373
33379
|
onClick: function onClick() {
|
|
33374
33380
|
return onCraftItem(craftItem);
|
|
33381
|
+
},
|
|
33382
|
+
onTouchStart: function onTouchStart() {
|
|
33383
|
+
return onCraftItem(craftItem);
|
|
33375
33384
|
}
|
|
33376
33385
|
}, "Craft")));
|
|
33377
33386
|
};
|
|
@@ -33394,7 +33403,7 @@ var Subtitle = /*#__PURE__*/styled.h1.withConfig({
|
|
|
33394
33403
|
var RadioInputScroller = /*#__PURE__*/styled.div.withConfig({
|
|
33395
33404
|
displayName: "CraftBook__RadioInputScroller",
|
|
33396
33405
|
componentId: "sc-19q95ue-4"
|
|
33397
|
-
})(["padding-left:15px;padding-top:10px;width:100%;margin-top:1rem;align-items:center;margin-left:20px;align-items:flex-start;overflow-y:scroll;height:360px;"]);
|
|
33406
|
+
})(["padding-left:15px;padding-top:10px;width:100%;margin-top:1rem;align-items:center;margin-left:20px;align-items:flex-start;overflow-y:scroll;height:360px;-webkit-overflow-scrolling:touch;"]);
|
|
33398
33407
|
var SpriteAtlasWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
33399
33408
|
displayName: "CraftBook__SpriteAtlasWrapper",
|
|
33400
33409
|
componentId: "sc-19q95ue-5"
|
|
@@ -33619,7 +33628,8 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
33619
33628
|
onDrop = _ref.onOutsideDrop,
|
|
33620
33629
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33621
33630
|
openQuantitySelector = _ref.openQuantitySelector,
|
|
33622
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
33631
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
33632
|
+
dragScale = _ref.dragScale;
|
|
33623
33633
|
var _useState = React.useState(false),
|
|
33624
33634
|
isTooltipVisible = _useState[0],
|
|
33625
33635
|
setTooltipVisible = _useState[1];
|
|
@@ -33783,6 +33793,7 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
33783
33793
|
}
|
|
33784
33794
|
}, React__default.createElement(Draggable, {
|
|
33785
33795
|
defaultClassName: item ? 'draggable' : 'empty-slot',
|
|
33796
|
+
scale: dragScale,
|
|
33786
33797
|
onStop: function onStop(e, data) {
|
|
33787
33798
|
if (wasDragged && item) {
|
|
33788
33799
|
var _e$target;
|
|
@@ -33902,7 +33913,8 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33902
33913
|
onItemPlaceDrop = _ref.onItemPlaceDrop,
|
|
33903
33914
|
onItemOutsideDrop = _ref.onItemOutsideDrop,
|
|
33904
33915
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33905
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
33916
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
33917
|
+
dragScale = _ref.dragScale;
|
|
33906
33918
|
var neck = equipmentSet.neck,
|
|
33907
33919
|
leftHand = equipmentSet.leftHand,
|
|
33908
33920
|
ring = equipmentSet.ring,
|
|
@@ -33947,6 +33959,7 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33947
33959
|
onDragEnd: function onDragEnd(quantity) {
|
|
33948
33960
|
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
33949
33961
|
},
|
|
33962
|
+
dragScale: dragScale,
|
|
33950
33963
|
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
33951
33964
|
checkIfItemShouldDragEnd: checkIfItemShouldDragEnd,
|
|
33952
33965
|
onPlaceDrop: function onPlaceDrop(item, slotIndex, itemContainerType) {
|
|
@@ -34725,7 +34738,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34725
34738
|
_onOutsideDrop = _ref.onOutsideDrop,
|
|
34726
34739
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
34727
34740
|
initialPosition = _ref.initialPosition,
|
|
34728
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
34741
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
34742
|
+
dragScale = _ref.dragScale;
|
|
34729
34743
|
var _useState = React.useState({
|
|
34730
34744
|
isOpen: false,
|
|
34731
34745
|
maxQuantity: 1,
|
|
@@ -34758,6 +34772,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34758
34772
|
onDragEnd: function onDragEnd(quantity) {
|
|
34759
34773
|
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
34760
34774
|
},
|
|
34775
|
+
dragScale: dragScale,
|
|
34761
34776
|
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
34762
34777
|
checkIfItemShouldDragEnd: checkIfItemShouldDragEnd,
|
|
34763
34778
|
openQuantitySelector: function openQuantitySelector(maxQuantity, callback) {
|