@rpg-engine/long-bow 0.3.29 → 0.3.33
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 +49 -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 +49 -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 +31 -18
- package/src/components/Chatdeprecated/ChatDeprecated.tsx +1 -1
- package/src/components/CraftBook/CraftBook.tsx +14 -2
- package/src/components/Dropdown.tsx +6 -0
- 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 ? 'auto' : _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,13 +32795,13 @@ 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
|
};
|
|
@@ -33213,6 +33211,11 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
33213
33211
|
return setOpened(function (prev) {
|
|
33214
33212
|
return !prev;
|
|
33215
33213
|
});
|
|
33214
|
+
},
|
|
33215
|
+
onTouchStart: function onTouchStart() {
|
|
33216
|
+
return setOpened(function (prev) {
|
|
33217
|
+
return !prev;
|
|
33218
|
+
});
|
|
33216
33219
|
}
|
|
33217
33220
|
}, React__default.createElement("label", null, "\u25BC"), " ", selectedOption), React__default.createElement(DropdownOptions, {
|
|
33218
33221
|
className: "rpgui-dropdown-imp",
|
|
@@ -33224,6 +33227,11 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
33224
33227
|
setSelectedValue(option.value);
|
|
33225
33228
|
setSelectedOption(option.option);
|
|
33226
33229
|
setOpened(false);
|
|
33230
|
+
},
|
|
33231
|
+
onTouchStart: function onTouchStart() {
|
|
33232
|
+
setSelectedValue(option.value);
|
|
33233
|
+
setSelectedOption(option.option);
|
|
33234
|
+
setOpened(false);
|
|
33227
33235
|
}
|
|
33228
33236
|
}, option.option);
|
|
33229
33237
|
})));
|
|
@@ -33337,7 +33345,14 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
33337
33345
|
}
|
|
33338
33346
|
}), React__default.createElement("label", {
|
|
33339
33347
|
onClick: function onClick() {
|
|
33340
|
-
|
|
33348
|
+
handleClick(option.key);
|
|
33349
|
+
},
|
|
33350
|
+
onTouchStart: function onTouchStart() {
|
|
33351
|
+
handleClick(option.key);
|
|
33352
|
+
setIsShown({
|
|
33353
|
+
show: true,
|
|
33354
|
+
index: index
|
|
33355
|
+
});
|
|
33341
33356
|
},
|
|
33342
33357
|
style: {
|
|
33343
33358
|
display: 'flex',
|
|
@@ -33367,11 +33382,15 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
33367
33382
|
})));
|
|
33368
33383
|
})), React__default.createElement(ButtonWrapper, null, React__default.createElement(Button, {
|
|
33369
33384
|
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
33370
|
-
onClick: onClose
|
|
33385
|
+
onClick: onClose,
|
|
33386
|
+
onTouchStart: onClose
|
|
33371
33387
|
}, "Cancel"), React__default.createElement(Button, {
|
|
33372
33388
|
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
33373
33389
|
onClick: function onClick() {
|
|
33374
33390
|
return onCraftItem(craftItem);
|
|
33391
|
+
},
|
|
33392
|
+
onTouchStart: function onTouchStart() {
|
|
33393
|
+
return onCraftItem(craftItem);
|
|
33375
33394
|
}
|
|
33376
33395
|
}, "Craft")));
|
|
33377
33396
|
};
|
|
@@ -33394,7 +33413,7 @@ var Subtitle = /*#__PURE__*/styled.h1.withConfig({
|
|
|
33394
33413
|
var RadioInputScroller = /*#__PURE__*/styled.div.withConfig({
|
|
33395
33414
|
displayName: "CraftBook__RadioInputScroller",
|
|
33396
33415
|
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;"]);
|
|
33416
|
+
})(["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
33417
|
var SpriteAtlasWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
33399
33418
|
displayName: "CraftBook__SpriteAtlasWrapper",
|
|
33400
33419
|
componentId: "sc-19q95ue-5"
|
|
@@ -33619,7 +33638,8 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
33619
33638
|
onDrop = _ref.onOutsideDrop,
|
|
33620
33639
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33621
33640
|
openQuantitySelector = _ref.openQuantitySelector,
|
|
33622
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
33641
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
33642
|
+
dragScale = _ref.dragScale;
|
|
33623
33643
|
var _useState = React.useState(false),
|
|
33624
33644
|
isTooltipVisible = _useState[0],
|
|
33625
33645
|
setTooltipVisible = _useState[1];
|
|
@@ -33783,6 +33803,7 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
33783
33803
|
}
|
|
33784
33804
|
}, React__default.createElement(Draggable, {
|
|
33785
33805
|
defaultClassName: item ? 'draggable' : 'empty-slot',
|
|
33806
|
+
scale: dragScale,
|
|
33786
33807
|
onStop: function onStop(e, data) {
|
|
33787
33808
|
if (wasDragged && item) {
|
|
33788
33809
|
var _e$target;
|
|
@@ -33902,7 +33923,8 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33902
33923
|
onItemPlaceDrop = _ref.onItemPlaceDrop,
|
|
33903
33924
|
onItemOutsideDrop = _ref.onItemOutsideDrop,
|
|
33904
33925
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33905
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
33926
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
33927
|
+
dragScale = _ref.dragScale;
|
|
33906
33928
|
var neck = equipmentSet.neck,
|
|
33907
33929
|
leftHand = equipmentSet.leftHand,
|
|
33908
33930
|
ring = equipmentSet.ring,
|
|
@@ -33947,6 +33969,7 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33947
33969
|
onDragEnd: function onDragEnd(quantity) {
|
|
33948
33970
|
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
33949
33971
|
},
|
|
33972
|
+
dragScale: dragScale,
|
|
33950
33973
|
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
33951
33974
|
checkIfItemShouldDragEnd: checkIfItemShouldDragEnd,
|
|
33952
33975
|
onPlaceDrop: function onPlaceDrop(item, slotIndex, itemContainerType) {
|
|
@@ -34725,7 +34748,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34725
34748
|
_onOutsideDrop = _ref.onOutsideDrop,
|
|
34726
34749
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
34727
34750
|
initialPosition = _ref.initialPosition,
|
|
34728
|
-
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd
|
|
34751
|
+
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
34752
|
+
dragScale = _ref.dragScale;
|
|
34729
34753
|
var _useState = React.useState({
|
|
34730
34754
|
isOpen: false,
|
|
34731
34755
|
maxQuantity: 1,
|
|
@@ -34758,6 +34782,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34758
34782
|
onDragEnd: function onDragEnd(quantity) {
|
|
34759
34783
|
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
34760
34784
|
},
|
|
34785
|
+
dragScale: dragScale,
|
|
34761
34786
|
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
34762
34787
|
checkIfItemShouldDragEnd: checkIfItemShouldDragEnd,
|
|
34763
34788
|
openQuantitySelector: function openQuantitySelector(maxQuantity, callback) {
|