@rpg-engine/long-bow 0.6.66 → 0.6.69
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/Friends/FriendList.d.ts +4 -2
- package/dist/components/Table/Table.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +81 -56
- 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 +77 -57
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Friends/FriendList.tsx +99 -95
- package/src/components/Table/Table.tsx +33 -0
- package/src/index.tsx +2 -0
- package/src/stories/FriendList.stories.tsx +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ICharacter } from '@rpg-engine/shared';
|
|
3
3
|
export declare type IFriend = Pick<ICharacter, 'name' | '_id' | 'isOnline'>;
|
|
4
4
|
interface IFriendListProps {
|
|
@@ -15,6 +15,8 @@ interface IFriendListProps {
|
|
|
15
15
|
onSearch: (characterName: string) => void;
|
|
16
16
|
onAcceptRequest: (character: IFriend) => void;
|
|
17
17
|
onRejectRequest: (character: IFriend) => void;
|
|
18
|
+
onAddFriend?: () => void;
|
|
19
|
+
onBackFriendList?: () => void;
|
|
18
20
|
}
|
|
19
|
-
export declare const FriendList:
|
|
21
|
+
export declare const FriendList: React.FC<IFriendListProps>;
|
|
20
22
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const Table: import("styled-components").StyledComponent<"table", any, {}, never>;
|
|
2
|
+
export declare const TableRow: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
3
|
+
export declare const TableHeader: import("styled-components").StyledComponent<"th", any, {}, never>;
|
|
4
|
+
export declare const TableCell: import("styled-components").StyledComponent<"td", any, {}, never>;
|
|
5
|
+
export declare const ActionButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/dist/index.d.ts
CHANGED
|
@@ -52,4 +52,5 @@ export * from './components/TradingMenu/TradingMenu';
|
|
|
52
52
|
export * from './components/Truncate';
|
|
53
53
|
export * from './components/Tutorial/TutorialStepper';
|
|
54
54
|
export * from './components/typography/DynamicText';
|
|
55
|
+
export * from './components/Table/Table';
|
|
55
56
|
export { useEventListener } from './hooks/useEventListener';
|
|
@@ -28787,6 +28787,27 @@ var EquipmentColumn = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
28787
28787
|
componentId: "sc-1wuddg2-1"
|
|
28788
28788
|
})(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;touch-action:none;"]);
|
|
28789
28789
|
|
|
28790
|
+
var Table = /*#__PURE__*/styled__default.table.withConfig({
|
|
28791
|
+
displayName: "Table",
|
|
28792
|
+
componentId: "sc-1c24pcj-0"
|
|
28793
|
+
})(["width:100%;border-collapse:collapse;margin-top:1rem;"]);
|
|
28794
|
+
var TableRow = /*#__PURE__*/styled__default.tr.withConfig({
|
|
28795
|
+
displayName: "Table__TableRow",
|
|
28796
|
+
componentId: "sc-1c24pcj-1"
|
|
28797
|
+
})(["&:nth-child(even){background-color:rgba(255,255,255,0.05) !important;}"]);
|
|
28798
|
+
var TableHeader = /*#__PURE__*/styled__default.th.withConfig({
|
|
28799
|
+
displayName: "Table__TableHeader",
|
|
28800
|
+
componentId: "sc-1c24pcj-2"
|
|
28801
|
+
})(["text-align:left;padding:0.5rem;color:", " !important;border-bottom:1px solid ", ";"], uiColors.yellow, uiColors.lightGray);
|
|
28802
|
+
var TableCell = /*#__PURE__*/styled__default.td.withConfig({
|
|
28803
|
+
displayName: "Table__TableCell",
|
|
28804
|
+
componentId: "sc-1c24pcj-3"
|
|
28805
|
+
})(["padding:0.5rem;color:", ";border-bottom:1px solid ", ";"], uiColors.white, uiColors.lightGray);
|
|
28806
|
+
var ActionButtons = /*#__PURE__*/styled__default.div.withConfig({
|
|
28807
|
+
displayName: "Table__ActionButtons",
|
|
28808
|
+
componentId: "sc-1c24pcj-4"
|
|
28809
|
+
})(["display:flex;gap:10px;align-items:center;"]);
|
|
28810
|
+
|
|
28790
28811
|
var SearchFriend = function SearchFriend(props) {
|
|
28791
28812
|
var searchedCharacters = props.searchedCharacters,
|
|
28792
28813
|
friendRequests = props.friendRequests,
|
|
@@ -28877,32 +28898,31 @@ var AcceptRejectButtonContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
28877
28898
|
componentId: "sc-1lt1ols-5"
|
|
28878
28899
|
})(["display:flex;justify-content:space-between;gap:0.5rem;"]);
|
|
28879
28900
|
|
|
28880
|
-
var FriendList = function FriendList(
|
|
28901
|
+
var FriendList = function FriendList(_ref) {
|
|
28902
|
+
var friends = _ref.friends,
|
|
28903
|
+
friendRequests = _ref.friendRequests,
|
|
28904
|
+
searchedCharacters = _ref.searchedCharacters,
|
|
28905
|
+
onFocus = _ref.onFocus,
|
|
28906
|
+
onBlur = _ref.onBlur,
|
|
28907
|
+
onSearch = _ref.onSearch,
|
|
28908
|
+
onAcceptRequest = _ref.onAcceptRequest,
|
|
28909
|
+
onSendFriendRequest = _ref.onSendFriendRequest,
|
|
28910
|
+
onRemoveFriend = _ref.onRemoveFriend,
|
|
28911
|
+
onOpenPrivateMessage = _ref.onOpenPrivateMessage,
|
|
28912
|
+
onRejectRequest = _ref.onRejectRequest,
|
|
28913
|
+
onAddFriend = _ref.onAddFriend,
|
|
28914
|
+
onBackFriendList = _ref.onBackFriendList;
|
|
28881
28915
|
var _useState = React.useState(false),
|
|
28882
28916
|
isAddFriendUI = _useState[0],
|
|
28883
28917
|
setIsAddFriendUI = _useState[1];
|
|
28884
|
-
|
|
28885
|
-
|
|
28886
|
-
|
|
28887
|
-
|
|
28888
|
-
|
|
28889
|
-
|
|
28890
|
-
|
|
28891
|
-
|
|
28892
|
-
onAcceptRequest = props.onAcceptRequest,
|
|
28893
|
-
onSendFriendRequest = props.onSendFriendRequest,
|
|
28894
|
-
onRemoveFriend = props.onRemoveFriend,
|
|
28895
|
-
onOpenPrivateMessage = props.onOpenPrivateMessage,
|
|
28896
|
-
onRejectRequest = props.onRejectRequest;
|
|
28897
|
-
return React__default.createElement(DraggableContainer, {
|
|
28898
|
-
type: exports.RPGUIContainerTypes.Framed,
|
|
28899
|
-
onCloseButton: function onCloseButton() {
|
|
28900
|
-
if (onClose) onClose();
|
|
28901
|
-
},
|
|
28902
|
-
width: "800px",
|
|
28903
|
-
cancelDrag: "#FriendListContainer, .rpgui-dropdown-imp, input, .empty-slot, button",
|
|
28904
|
-
scale: scale
|
|
28905
|
-
}, isAddFriendUI ? React__default.createElement(SearchFriend, {
|
|
28918
|
+
React.useEffect(function () {
|
|
28919
|
+
if (isAddFriendUI) {
|
|
28920
|
+
onAddFriend == null ? void 0 : onAddFriend();
|
|
28921
|
+
} else {
|
|
28922
|
+
onBackFriendList == null ? void 0 : onBackFriendList();
|
|
28923
|
+
}
|
|
28924
|
+
}, [isAddFriendUI]);
|
|
28925
|
+
return React__default.createElement(ListWrapper, null, isAddFriendUI ? React__default.createElement(SearchFriend, {
|
|
28906
28926
|
searchedCharacters: searchedCharacters,
|
|
28907
28927
|
onSendFriendRequest: onSendFriendRequest,
|
|
28908
28928
|
onAcceptRequest: onAcceptRequest,
|
|
@@ -28911,58 +28931,58 @@ var FriendList = function FriendList(props) {
|
|
|
28911
28931
|
onSearch: onSearch,
|
|
28912
28932
|
onBlur: onBlur,
|
|
28913
28933
|
onFocus: onFocus
|
|
28914
|
-
}) : React__default.createElement(
|
|
28915
|
-
return React__default.createElement(
|
|
28934
|
+
}) : React__default.createElement(React__default.Fragment, null, React__default.createElement(ScrollableArea, null, React__default.createElement(Table, null, React__default.createElement("thead", null, React__default.createElement(TableRow, null, React__default.createElement(TableHeader, null, "Online"), React__default.createElement(TableHeader, null, "Name"), React__default.createElement(TableHeader, null, "Actions"))), React__default.createElement("tbody", null, friends.map(function (friend) {
|
|
28935
|
+
return React__default.createElement(TableRow, {
|
|
28916
28936
|
key: friend._id
|
|
28917
|
-
}, React__default.createElement(
|
|
28937
|
+
}, React__default.createElement(TableCell, null, React__default.createElement(IsOnlineBadge, {
|
|
28918
28938
|
"$isOnline": friend.isOnline
|
|
28919
|
-
}), friend.name), React__default.createElement(
|
|
28920
|
-
|
|
28921
|
-
|
|
28939
|
+
})), React__default.createElement(TableCell, null, friend.name), React__default.createElement(TableCell, null, React__default.createElement(ActionButtons, null, React__default.createElement(UserAction, {
|
|
28940
|
+
color: uiColors.yellow,
|
|
28941
|
+
onClick: function onClick() {
|
|
28922
28942
|
return onOpenPrivateMessage(friend);
|
|
28923
28943
|
}
|
|
28924
|
-
}, "
|
|
28925
|
-
|
|
28926
|
-
|
|
28944
|
+
}, "Chat"), React__default.createElement(UserAction, {
|
|
28945
|
+
color: uiColors.red,
|
|
28946
|
+
onClick: function onClick() {
|
|
28927
28947
|
return onRemoveFriend(friend);
|
|
28928
28948
|
}
|
|
28929
|
-
}, "Remove")));
|
|
28930
|
-
})), React__default.createElement(ButtonContainer$1, null, React__default.createElement(Button, {
|
|
28949
|
+
}, "Remove"))));
|
|
28950
|
+
}))))), React__default.createElement(ButtonContainer$1, null, React__default.createElement(Button, {
|
|
28931
28951
|
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
28932
28952
|
onClick: function onClick() {
|
|
28933
|
-
return setIsAddFriendUI(function (
|
|
28934
|
-
return !
|
|
28953
|
+
return setIsAddFriendUI(function (prev) {
|
|
28954
|
+
return !prev;
|
|
28935
28955
|
});
|
|
28936
28956
|
}
|
|
28937
28957
|
}, isAddFriendUI ? 'Back' : 'Add New Friend')));
|
|
28938
28958
|
};
|
|
28939
|
-
|
|
28940
|
-
|
|
28959
|
+
// Styled components for FriendList UI
|
|
28960
|
+
var ListWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
28961
|
+
displayName: "FriendList__ListWrapper",
|
|
28941
28962
|
componentId: "sc-3jf9vt-0"
|
|
28942
|
-
})(["
|
|
28943
|
-
var
|
|
28944
|
-
displayName: "
|
|
28963
|
+
})(["margin-top:1rem;max-height:350px;display:flex;flex-direction:column;"]);
|
|
28964
|
+
var ScrollableArea = /*#__PURE__*/styled__default.div.withConfig({
|
|
28965
|
+
displayName: "FriendList__ScrollableArea",
|
|
28945
28966
|
componentId: "sc-3jf9vt-1"
|
|
28946
|
-
})(["
|
|
28947
|
-
var ListElement$4 = /*#__PURE__*/styled__default.li.withConfig({
|
|
28948
|
-
displayName: "FriendList__ListElement",
|
|
28949
|
-
componentId: "sc-3jf9vt-2"
|
|
28950
|
-
})(["margin:0.5rem 0 !important;font-size:", ";padding:0.5rem 4px;display:flex;align-items:center;justify-content:space-between;border-radius:4px;& div{display:flex;align-items:center;}"], uiFonts.size.small);
|
|
28967
|
+
})(["overflow-y:auto;max-height:300px;"]);
|
|
28951
28968
|
var IsOnlineBadge = /*#__PURE__*/styled__default.div.withConfig({
|
|
28952
28969
|
displayName: "FriendList__IsOnlineBadge",
|
|
28953
|
-
componentId: "sc-3jf9vt-
|
|
28954
|
-
})(["width:10px;height:10px;border-radius:50%;background-color:", ";margin-right:1rem;"], function (
|
|
28955
|
-
var $isOnline =
|
|
28970
|
+
componentId: "sc-3jf9vt-2"
|
|
28971
|
+
})(["width:10px;height:10px;border-radius:50%;background-color:", ";margin-right:1rem;"], function (_ref2) {
|
|
28972
|
+
var $isOnline = _ref2.$isOnline;
|
|
28956
28973
|
return $isOnline ? uiColors.lightGreen : uiColors.red;
|
|
28957
28974
|
});
|
|
28958
28975
|
var ButtonContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
28959
28976
|
displayName: "FriendList__ButtonContainer",
|
|
28960
|
-
componentId: "sc-3jf9vt-
|
|
28977
|
+
componentId: "sc-3jf9vt-3"
|
|
28961
28978
|
})(["display:flex;justify-content:center;align-items:center;width:100%;margin-top:1rem;"]);
|
|
28962
|
-
var
|
|
28963
|
-
displayName: "
|
|
28964
|
-
componentId: "sc-3jf9vt-
|
|
28965
|
-
})(["
|
|
28979
|
+
var UserAction = /*#__PURE__*/styled__default.span.withConfig({
|
|
28980
|
+
displayName: "FriendList__UserAction",
|
|
28981
|
+
componentId: "sc-3jf9vt-4"
|
|
28982
|
+
})(["color:", " !important;cursor:pointer;margin-right:0.5rem;&:hover{text-decoration:underline;}"], function (_ref3) {
|
|
28983
|
+
var color = _ref3.color;
|
|
28984
|
+
return color;
|
|
28985
|
+
});
|
|
28966
28986
|
|
|
28967
28987
|
var IS_MOBILE_OR_TABLET = /*#__PURE__*/shared.isMobileOrTablet();
|
|
28968
28988
|
|
|
@@ -30475,7 +30495,7 @@ var ListMenu = function ListMenu(_ref) {
|
|
|
30475
30495
|
overflow: 'hidden'
|
|
30476
30496
|
}
|
|
30477
30497
|
}, options.map(function (params, index) {
|
|
30478
|
-
return React__default.createElement(ListElement$
|
|
30498
|
+
return React__default.createElement(ListElement$4, {
|
|
30479
30499
|
key: (params == null ? void 0 : params.id) || index,
|
|
30480
30500
|
onPointerDown: function onPointerDown() {
|
|
30481
30501
|
onSelected(params == null ? void 0 : params.id);
|
|
@@ -30491,7 +30511,7 @@ var Container$l = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
30491
30511
|
}, function (props) {
|
|
30492
30512
|
return props.x || 0;
|
|
30493
30513
|
}, uiFonts.size.xsmall);
|
|
30494
|
-
var ListElement$
|
|
30514
|
+
var ListElement$4 = /*#__PURE__*/styled__default.li.withConfig({
|
|
30495
30515
|
displayName: "ListMenu__ListElement",
|
|
30496
30516
|
componentId: "sc-i9097t-1"
|
|
30497
30517
|
})(["margin-right:0.5rem;"]);
|
|
@@ -33428,6 +33448,7 @@ var LessonContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
33428
33448
|
componentId: "sc-7tgzv2-6"
|
|
33429
33449
|
})(["display:flex;flex-direction:column;justify-content:space-between;min-height:200px;p{font-size:0.7rem !important;}"]);
|
|
33430
33450
|
|
|
33451
|
+
exports.ActionButtons = ActionButtons;
|
|
33431
33452
|
exports.AsyncDropdown = AsyncDropdown;
|
|
33432
33453
|
exports.Button = Button;
|
|
33433
33454
|
exports.CharacterSelection = CharacterSelection;
|
|
@@ -33482,6 +33503,10 @@ exports.Spellbook = Spellbook;
|
|
|
33482
33503
|
exports.SpriteFromAtlas = SpriteFromAtlas;
|
|
33483
33504
|
exports.Stepper = Stepper;
|
|
33484
33505
|
exports.TabBody = TabBody;
|
|
33506
|
+
exports.Table = Table;
|
|
33507
|
+
exports.TableCell = TableCell;
|
|
33508
|
+
exports.TableHeader = TableHeader;
|
|
33509
|
+
exports.TableRow = TableRow;
|
|
33485
33510
|
exports.TableTab = TableTab;
|
|
33486
33511
|
exports.TabsContainer = TabsContainer;
|
|
33487
33512
|
exports.TextArea = TextArea;
|