@rpg-engine/long-bow 0.6.851 → 0.7.0

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.
@@ -26455,7 +26455,10 @@ var SearchCharacter = function SearchCharacter(_ref) {
26455
26455
  return handleCharacterClick(character);
26456
26456
  },
26457
26457
  key: character._id
26458
- }, character.name);
26458
+ }, React.createElement(Ellipsis, {
26459
+ maxWidth: '150px',
26460
+ maxLines: 1
26461
+ }, character.name));
26459
26462
  })));
26460
26463
  };
26461
26464
  var SearchContainer = /*#__PURE__*/styled.div.withConfig({
@@ -26519,77 +26522,91 @@ var ChatRevamp = function ChatRevamp(_ref) {
26519
26522
  setShowRecentChats = _useState[1];
26520
26523
  var isPrivate = activeTab === 'private';
26521
26524
  var isTrade = activeTab === 'trade';
26525
+ var toggleRecentChats = function toggleRecentChats() {
26526
+ return setShowRecentChats(function (prev) {
26527
+ return !prev;
26528
+ });
26529
+ };
26522
26530
  var handlePreviousChatCharacterClick = function handlePreviousChatCharacterClick(character) {
26523
- if (!onPreviousChatCharacterClick) return;
26524
- onPreviousChatCharacterClick(character);
26531
+ onPreviousChatCharacterClick == null ? void 0 : onPreviousChatCharacterClick(character);
26525
26532
  hideSearchCharacterUI();
26526
26533
  };
26527
- return React.createElement(React.Fragment, null, React.createElement(TabContainer, null, tabs.map(function (tab, index) {
26528
- return React.createElement(Tab, {
26529
- key: tab.label + "_" + index,
26530
- active: tab.id === activeTab,
26531
- onPointerDown: function onPointerDown() {
26532
- return onChangeTab(tab.id);
26533
- }
26534
- }, tab.label);
26535
- })), React.createElement(PrivateChatContainer, {
26534
+ var renderTabs = function renderTabs() {
26535
+ return React.createElement(TabContainer, null, tabs.map(function (tab, index) {
26536
+ return React.createElement(Tab, {
26537
+ key: tab.label + "_" + index,
26538
+ active: tab.id === activeTab,
26539
+ onPointerDown: function onPointerDown() {
26540
+ return onChangeTab(tab.id);
26541
+ }
26542
+ }, tab.label);
26543
+ }));
26544
+ };
26545
+ var renderRecentChatTopBar = function renderRecentChatTopBar() {
26546
+ return React.createElement(RecentChatTopBar, null, React.createElement(BurgerIconContainer, {
26547
+ onPointerDown: toggleRecentChats,
26548
+ hasUnseenMessages: unseenMessageCharacterIds.length > 0
26549
+ }, React.createElement(BurgerLineIcon, null), React.createElement(BurgerLineIcon, null), React.createElement(BurgerLineIcon, null)), showRecentChats && React.createElement(SearchButton$1, {
26550
+ onPointerDown: showSearchCharacterUI
26551
+ }, React.createElement(RxMagnifyingGlass, {
26552
+ size: 16,
26553
+ color: uiColors.white
26554
+ })));
26555
+ };
26556
+ var renderRecentChatList = function renderRecentChatList() {
26557
+ return React.createElement(RecentChatLogContainer, {
26558
+ isOpen: showRecentChats
26559
+ }, recentChatCharacters == null ? void 0 : recentChatCharacters.map(function (character) {
26560
+ return React.createElement(ListElementContainer, {
26561
+ key: character._id
26562
+ }, React.createElement(ListElement$1, {
26563
+ active: character._id === recentSelectedChatCharacterId,
26564
+ onPointerDown: function onPointerDown() {
26565
+ return handlePreviousChatCharacterClick(character);
26566
+ }
26567
+ }, React.createElement(StatusDot, {
26568
+ isUnseen: unseenMessageCharacterIds.includes(character._id)
26569
+ }), React.createElement(Ellipsis, {
26570
+ maxWidth: "140px",
26571
+ maxLines: 1
26572
+ }, character.name)), React.createElement(CloseButton$1, {
26573
+ onPointerDown: function onPointerDown() {
26574
+ return onRemoveRecentChatCharacter == null ? void 0 : onRemoveRecentChatCharacter(character);
26575
+ }
26576
+ }, React.createElement(RxCross2, {
26577
+ size: 16
26578
+ })));
26579
+ }));
26580
+ };
26581
+ var renderChatContent = function renderChatContent() {
26582
+ if (isPrivate && searchCharacterUI) {
26583
+ return React.createElement(SearchCharacter, {
26584
+ onFocus: onFocus,
26585
+ onBlur: onBlur,
26586
+ onChangeCharacterName: onChangeCharacterName,
26587
+ styles: styles,
26588
+ recentCharacters: privateChatCharacters,
26589
+ hideSearchCharacterUI: hideSearchCharacterUI,
26590
+ onCharacterClick: onCharacterClick
26591
+ });
26592
+ }
26593
+ return React.createElement(Chat, {
26594
+ chatMessages: chatMessages,
26595
+ onSendChatMessage: isPrivate ? onSendPrivateChatMessage : isTrade ? onSendTradeMessage : onSendGlobalChatMessage,
26596
+ sendMessage: true,
26597
+ onCloseButton: onCloseButton,
26598
+ styles: styles,
26599
+ onFocus: onFocus,
26600
+ onBlur: onBlur
26601
+ });
26602
+ };
26603
+ return React.createElement(React.Fragment, null, renderTabs(), React.createElement(PrivateChatContainer, {
26536
26604
  width: (styles == null ? void 0 : styles.width) || '80%',
26537
26605
  height: (styles == null ? void 0 : styles.height) || 'auto'
26538
26606
  }, React.createElement(RecentChatTabContainer, {
26539
26607
  isPrivate: isPrivate,
26540
26608
  isOpen: showRecentChats
26541
- }, React.createElement(RecentChatTopBar, {
26542
- isOpen: showRecentChats
26543
- }, React.createElement(BurgerIconContainer, {
26544
- onPointerDown: function onPointerDown() {
26545
- return setShowRecentChats(function (t) {
26546
- return !t;
26547
- });
26548
- },
26549
- hasUnseenMessages: (unseenMessageCharacterIds == null ? void 0 : unseenMessageCharacterIds.length) > 0 || false
26550
- }, React.createElement(BurgerLineIcon, null), React.createElement(BurgerLineIcon, null), React.createElement(BurgerLineIcon, null)), showRecentChats && React.createElement(SearchButton$1, {
26551
- onPointerDown: function onPointerDown() {
26552
- return showSearchCharacterUI();
26553
- }
26554
- }, React.createElement(RxMagnifyingGlass, {
26555
- size: 16,
26556
- color: uiColors.white
26557
- }))), React.createElement(RecentChatLogContainer, {
26558
- isOpen: showRecentChats
26559
- }, recentChatCharacters == null ? void 0 : recentChatCharacters.map(function (character) {
26560
- return React.createElement(ListElementContainer, {
26561
- key: character._id
26562
- }, React.createElement(ListElement$1, {
26563
- active: character._id === recentSelectedChatCharacterId,
26564
- onPointerDown: function onPointerDown() {
26565
- return handlePreviousChatCharacterClick(character);
26566
- }
26567
- }, React.createElement(StatusDot, {
26568
- isUnseen: (unseenMessageCharacterIds == null ? void 0 : unseenMessageCharacterIds.includes(character._id)) || false
26569
- }), character.name), React.createElement(CloseButton$1, {
26570
- onPointerDown: function onPointerDown() {
26571
- return onRemoveRecentChatCharacter == null ? void 0 : onRemoveRecentChatCharacter(character);
26572
- }
26573
- }, React.createElement(RxCross2, {
26574
- size: 16
26575
- })));
26576
- }))), isPrivate && searchCharacterUI ? React.createElement(SearchCharacter, {
26577
- onFocus: onFocus,
26578
- onBlur: onBlur,
26579
- onChangeCharacterName: onChangeCharacterName,
26580
- styles: styles,
26581
- recentCharacters: privateChatCharacters,
26582
- hideSearchCharacterUI: hideSearchCharacterUI,
26583
- onCharacterClick: onCharacterClick
26584
- }) : React.createElement(Chat, {
26585
- chatMessages: chatMessages,
26586
- onSendChatMessage: isPrivate ? onSendPrivateChatMessage : isTrade ? onSendTradeMessage : onSendGlobalChatMessage,
26587
- sendMessage: true,
26588
- onCloseButton: onCloseButton,
26589
- styles: styles,
26590
- onFocus: onFocus,
26591
- onBlur: onBlur
26592
- })));
26609
+ }, renderRecentChatTopBar(), renderRecentChatList()), renderChatContent()));
26593
26610
  };
26594
26611
  var TabContainer = /*#__PURE__*/styled.div.withConfig({
26595
26612
  displayName: "ChatRevamp__TabContainer",
@@ -26618,12 +26635,16 @@ var PrivateChatContainer = /*#__PURE__*/styled.div.withConfig({
26618
26635
  var RecentChatTabContainer = /*#__PURE__*/styled.div.withConfig({
26619
26636
  displayName: "ChatRevamp__RecentChatTabContainer",
26620
26637
  componentId: "sc-1sdiknw-3"
26621
- })(["display:", ";flex-direction:column;border-right:1px solid ", ";outline:none;width:", " !important;transition:width 0.3s ease-in-out;overflow:hidden;@media (max-width:768px){width:", " !important;}"], function (props) {
26638
+ })(["display:", ";flex-direction:column;border-right:1px solid ", ";outline:none;width:", ";max-width:200px;min-width:", ";transition:all 0.3s ease-in-out;overflow:hidden;@media (max-width:768px){width:", ";min-width:", ";}"], function (props) {
26622
26639
  return props.isPrivate ? 'flex' : 'none';
26623
26640
  }, uiColors.gray, function (props) {
26624
- return props.isOpen ? '20%' : '30px';
26641
+ return props.isOpen ? '25%' : '30px';
26642
+ }, function (props) {
26643
+ return props.isOpen ? '180px' : '30px';
26644
+ }, function (props) {
26645
+ return props.isOpen ? '50%' : '30px';
26625
26646
  }, function (props) {
26626
- return props.isOpen ? '40%' : '30px';
26647
+ return props.isOpen ? '150px' : '30px';
26627
26648
  });
26628
26649
  var RecentChatTopBar = /*#__PURE__*/styled.div.withConfig({
26629
26650
  displayName: "ChatRevamp__RecentChatTopBar",
@@ -26656,7 +26677,7 @@ var ListElementContainer = /*#__PURE__*/styled.div.withConfig({
26656
26677
  var ListElement$1 = /*#__PURE__*/styled.button.withConfig({
26657
26678
  displayName: "ChatRevamp__ListElement",
26658
26679
  componentId: "sc-1sdiknw-10"
26659
- })(["margin:0.5rem 0 !important;font-size:", " !important;padding:2px;all:unset;color:", ";width:100%;position:relative;display:flex;align-items:center;gap:4px;&:hover{color:#ff0;}"], uiFonts.size.small, function (props) {
26680
+ })(["margin:0.5rem 0 !important;font-size:", " !important;padding:2px;all:unset;color:", ";width:100%;position:relative;display:flex;align-items:center;gap:4px;&:hover{color:#ff0;}max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"], uiFonts.size.small, function (props) {
26660
26681
  return props.active ? uiColors.yellow : uiColors.white;
26661
26682
  });
26662
26683
  var StatusDot = /*#__PURE__*/styled.span.withConfig({