@rpg-engine/long-bow 0.6.66 → 0.6.68

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.
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
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 {
@@ -16,5 +16,5 @@ interface IFriendListProps {
16
16
  onAcceptRequest: (character: IFriend) => void;
17
17
  onRejectRequest: (character: IFriend) => void;
18
18
  }
19
- export declare const FriendList: (props: IFriendListProps) => JSX.Element;
19
+ export declare const FriendList: React.FC<IFriendListProps>;
20
20
  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,22 @@ 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(props) {
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;
28881
28913
  var _useState = React.useState(false),
28882
28914
  isAddFriendUI = _useState[0],
28883
28915
  setIsAddFriendUI = _useState[1];
28884
- var scale = props.scale,
28885
- friends = props.friends,
28886
- friendRequests = props.friendRequests,
28887
- searchedCharacters = props.searchedCharacters,
28888
- onBlur = props.onBlur,
28889
- onFocus = props.onFocus,
28890
- onClose = props.onClose,
28891
- onSearch = props.onSearch,
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, {
28916
+ return React__default.createElement(ListWrapper, null, isAddFriendUI ? React__default.createElement(SearchFriend, {
28906
28917
  searchedCharacters: searchedCharacters,
28907
28918
  onSendFriendRequest: onSendFriendRequest,
28908
28919
  onAcceptRequest: onAcceptRequest,
@@ -28911,58 +28922,58 @@ var FriendList = function FriendList(props) {
28911
28922
  onSearch: onSearch,
28912
28923
  onBlur: onBlur,
28913
28924
  onFocus: onFocus
28914
- }) : React__default.createElement(ListContainer$2, null, React__default.createElement(FriendsTitle, null, "Friends"), friends.map(function (friend) {
28915
- return React__default.createElement(ListElement$4, {
28925
+ }) : 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) {
28926
+ return React__default.createElement(TableRow, {
28916
28927
  key: friend._id
28917
- }, React__default.createElement("div", null, React__default.createElement(IsOnlineBadge, {
28928
+ }, React__default.createElement(TableCell, null, React__default.createElement(IsOnlineBadge, {
28918
28929
  "$isOnline": friend.isOnline
28919
- }), friend.name), React__default.createElement(MessageAndDeleteContainer, null, React__default.createElement(Button, {
28920
- buttonType: exports.ButtonTypes.RPGUIButton,
28921
- onPointerDown: function onPointerDown() {
28930
+ })), React__default.createElement(TableCell, null, friend.name), React__default.createElement(TableCell, null, React__default.createElement(ActionButtons, null, React__default.createElement(UserAction, {
28931
+ color: uiColors.yellow,
28932
+ onClick: function onClick() {
28922
28933
  return onOpenPrivateMessage(friend);
28923
28934
  }
28924
- }, "Message"), React__default.createElement(Button, {
28925
- buttonType: exports.ButtonTypes.RPGUIButton,
28926
- onPointerDown: function onPointerDown() {
28935
+ }, "Chat"), React__default.createElement(UserAction, {
28936
+ color: uiColors.red,
28937
+ onClick: function onClick() {
28927
28938
  return onRemoveFriend(friend);
28928
28939
  }
28929
- }, "Remove")));
28930
- })), React__default.createElement(ButtonContainer$1, null, React__default.createElement(Button, {
28940
+ }, "Remove"))));
28941
+ }))))), React__default.createElement(ButtonContainer$1, null, React__default.createElement(Button, {
28931
28942
  buttonType: exports.ButtonTypes.RPGUIButton,
28932
28943
  onClick: function onClick() {
28933
- return setIsAddFriendUI(function (t) {
28934
- return !t;
28944
+ return setIsAddFriendUI(function (prev) {
28945
+ return !prev;
28935
28946
  });
28936
28947
  }
28937
28948
  }, isAddFriendUI ? 'Back' : 'Add New Friend')));
28938
28949
  };
28939
- var FriendsTitle = /*#__PURE__*/styled__default.h2.withConfig({
28940
- displayName: "FriendList__FriendsTitle",
28950
+ // Styled components for FriendList UI
28951
+ var ListWrapper = /*#__PURE__*/styled__default.div.withConfig({
28952
+ displayName: "FriendList__ListWrapper",
28941
28953
  componentId: "sc-3jf9vt-0"
28942
- })(["font-size:", ";margin:0;padding:0;text-align:center;"], uiFonts.size.medium);
28943
- var ListContainer$2 = /*#__PURE__*/styled__default.ul.withConfig({
28944
- displayName: "FriendList__ListContainer",
28954
+ })(["margin-top:1rem;max-height:350px;display:flex;flex-direction:column;"]);
28955
+ var ScrollableArea = /*#__PURE__*/styled__default.div.withConfig({
28956
+ displayName: "FriendList__ScrollableArea",
28945
28957
  componentId: "sc-3jf9vt-1"
28946
- })(["border:none;overflow-y:scroll;list-style:none;padding:0;width:100%;height:50vh;@media (max-width:768px){max-height:90wh;}"]);
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);
28958
+ })(["overflow-y:auto;max-height:300px;"]);
28951
28959
  var IsOnlineBadge = /*#__PURE__*/styled__default.div.withConfig({
28952
28960
  displayName: "FriendList__IsOnlineBadge",
28953
- componentId: "sc-3jf9vt-3"
28954
- })(["width:10px;height:10px;border-radius:50%;background-color:", ";margin-right:1rem;"], function (_ref) {
28955
- var $isOnline = _ref.$isOnline;
28961
+ componentId: "sc-3jf9vt-2"
28962
+ })(["width:10px;height:10px;border-radius:50%;background-color:", ";margin-right:1rem;"], function (_ref2) {
28963
+ var $isOnline = _ref2.$isOnline;
28956
28964
  return $isOnline ? uiColors.lightGreen : uiColors.red;
28957
28965
  });
28958
28966
  var ButtonContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
28959
28967
  displayName: "FriendList__ButtonContainer",
28960
- componentId: "sc-3jf9vt-4"
28968
+ componentId: "sc-3jf9vt-3"
28961
28969
  })(["display:flex;justify-content:center;align-items:center;width:100%;margin-top:1rem;"]);
28962
- var MessageAndDeleteContainer = /*#__PURE__*/styled__default.div.withConfig({
28963
- displayName: "FriendList__MessageAndDeleteContainer",
28964
- componentId: "sc-3jf9vt-5"
28965
- })(["display:flex;justify-content:space-between;gap:0.5rem;"]);
28970
+ var UserAction = /*#__PURE__*/styled__default.span.withConfig({
28971
+ displayName: "FriendList__UserAction",
28972
+ componentId: "sc-3jf9vt-4"
28973
+ })(["color:", " !important;cursor:pointer;margin-right:0.5rem;&:hover{text-decoration:underline;}"], function (_ref3) {
28974
+ var color = _ref3.color;
28975
+ return color;
28976
+ });
28966
28977
 
28967
28978
  var IS_MOBILE_OR_TABLET = /*#__PURE__*/shared.isMobileOrTablet();
28968
28979
 
@@ -30475,7 +30486,7 @@ var ListMenu = function ListMenu(_ref) {
30475
30486
  overflow: 'hidden'
30476
30487
  }
30477
30488
  }, options.map(function (params, index) {
30478
- return React__default.createElement(ListElement$5, {
30489
+ return React__default.createElement(ListElement$4, {
30479
30490
  key: (params == null ? void 0 : params.id) || index,
30480
30491
  onPointerDown: function onPointerDown() {
30481
30492
  onSelected(params == null ? void 0 : params.id);
@@ -30491,7 +30502,7 @@ var Container$l = /*#__PURE__*/styled__default.div.withConfig({
30491
30502
  }, function (props) {
30492
30503
  return props.x || 0;
30493
30504
  }, uiFonts.size.xsmall);
30494
- var ListElement$5 = /*#__PURE__*/styled__default.li.withConfig({
30505
+ var ListElement$4 = /*#__PURE__*/styled__default.li.withConfig({
30495
30506
  displayName: "ListMenu__ListElement",
30496
30507
  componentId: "sc-i9097t-1"
30497
30508
  })(["margin-right:0.5rem;"]);
@@ -33428,6 +33439,7 @@ var LessonContainer = /*#__PURE__*/styled__default.div.withConfig({
33428
33439
  componentId: "sc-7tgzv2-6"
33429
33440
  })(["display:flex;flex-direction:column;justify-content:space-between;min-height:200px;p{font-size:0.7rem !important;}"]);
33430
33441
 
33442
+ exports.ActionButtons = ActionButtons;
33431
33443
  exports.AsyncDropdown = AsyncDropdown;
33432
33444
  exports.Button = Button;
33433
33445
  exports.CharacterSelection = CharacterSelection;
@@ -33482,6 +33494,10 @@ exports.Spellbook = Spellbook;
33482
33494
  exports.SpriteFromAtlas = SpriteFromAtlas;
33483
33495
  exports.Stepper = Stepper;
33484
33496
  exports.TabBody = TabBody;
33497
+ exports.Table = Table;
33498
+ exports.TableCell = TableCell;
33499
+ exports.TableHeader = TableHeader;
33500
+ exports.TableRow = TableRow;
33485
33501
  exports.TableTab = TableTab;
33486
33502
  exports.TabsContainer = TabsContainer;
33487
33503
  exports.TextArea = TextArea;