@rpg-engine/long-bow 0.7.22 → 0.7.23
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 +1 -1
- package/dist/components/ChatRevamp/ChatContent.d.ts +24 -0
- package/dist/components/ChatRevamp/ChatRevamp.d.ts +1 -33
- package/dist/components/ChatRevamp/ChatTabs.d.ts +11 -0
- package/dist/components/ChatRevamp/ExpandButton.d.ts +7 -0
- package/dist/components/ChatRevamp/RecentChats.d.ts +16 -0
- package/dist/components/ChatRevamp/SearchCharacter.d.ts +1 -1
- package/dist/components/ChatRevamp/types.d.ts +33 -0
- package/dist/hooks/useChat.d.ts +12 -0
- package/dist/long-bow.cjs.development.js +331 -212
- 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 +331 -212
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/ChatRevamp.stories.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Chat/Chat.tsx +1 -1
- package/src/components/ChatRevamp/ChatContent.tsx +94 -0
- package/src/components/ChatRevamp/ChatRevamp.tsx +119 -433
- package/src/components/ChatRevamp/ChatTabs.tsx +51 -0
- package/src/components/ChatRevamp/ExpandButton.tsx +40 -0
- package/src/components/ChatRevamp/RecentChats.tsx +239 -0
- package/src/components/ChatRevamp/SearchCharacter.tsx +17 -20
- package/src/components/ChatRevamp/types.ts +41 -0
- package/src/hooks/useChat.ts +62 -0
- package/src/stories/Chat.stories.tsx +1 -0
- package/src/stories/ChatRevamp.stories.tsx +18 -89
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IStyles } from '../Chat/Chat';
|
|
3
|
+
import { ChatMessage, PrivateChatCharacter } from './types';
|
|
4
|
+
interface ChatContentProps {
|
|
5
|
+
isPrivate: boolean;
|
|
6
|
+
isTrade: boolean;
|
|
7
|
+
searchCharacterUI: boolean;
|
|
8
|
+
chatMessages: ChatMessage[];
|
|
9
|
+
onSendGlobalChatMessage: (message: string) => void;
|
|
10
|
+
onSendPrivateChatMessage: (message: string) => void;
|
|
11
|
+
onSendTradeMessage: (message: string) => void;
|
|
12
|
+
onCloseButton: () => void;
|
|
13
|
+
styles?: IStyles;
|
|
14
|
+
onFocus?: () => void;
|
|
15
|
+
onBlur?: () => void;
|
|
16
|
+
isExpanded: boolean;
|
|
17
|
+
autoCloseOnSend: boolean;
|
|
18
|
+
onChangeCharacterName: (characterName: string) => void;
|
|
19
|
+
privateChatCharacters?: PrivateChatCharacter[];
|
|
20
|
+
hideSearchCharacterUI: () => void;
|
|
21
|
+
onCharacterClick?: (character: PrivateChatCharacter) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const ChatContent: React.FC<ChatContentProps>;
|
|
24
|
+
export {};
|
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
import { ICharacter, IChatMessage, IPrivateChatMessage, ITradeChatMessage } from '@rpg-engine/shared';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export declare type PrivateChatCharacter = Pick<ICharacter, '_id' | 'name'>;
|
|
5
|
-
export declare type ChatMessage = IChatMessage | IPrivateChatMessage | ITradeChatMessage;
|
|
6
|
-
export interface IChatRevampProps {
|
|
7
|
-
chatMessages: ChatMessage[];
|
|
8
|
-
onSendGlobalChatMessage: (message: string) => void;
|
|
9
|
-
onCloseButton: () => void;
|
|
10
|
-
onFocus?: () => void;
|
|
11
|
-
onBlur?: () => void;
|
|
12
|
-
styles?: IStyles;
|
|
13
|
-
tabs: {
|
|
14
|
-
label: string;
|
|
15
|
-
id: string;
|
|
16
|
-
}[];
|
|
17
|
-
activeTab: string;
|
|
18
|
-
onChangeTab: (tabId: string) => void;
|
|
19
|
-
privateChatCharacters?: PrivateChatCharacter[];
|
|
20
|
-
onChangeCharacterName: (characterName: string) => void;
|
|
21
|
-
onCharacterClick?: (character: PrivateChatCharacter) => void;
|
|
22
|
-
onSendPrivateChatMessage: (message: string) => void;
|
|
23
|
-
recentChatCharacters?: PrivateChatCharacter[];
|
|
24
|
-
recentSelectedChatCharacterId?: string;
|
|
25
|
-
onPreviousChatCharacterClick?: (character: PrivateChatCharacter) => void;
|
|
26
|
-
onRemoveRecentChatCharacter?: (character: PrivateChatCharacter) => void;
|
|
27
|
-
unseenMessageCharacterIds?: string[];
|
|
28
|
-
onSendTradeMessage: (message: string) => void;
|
|
29
|
-
searchCharacterUI: boolean;
|
|
30
|
-
hideSearchCharacterUI: () => void;
|
|
31
|
-
showSearchCharacterUI: () => void;
|
|
32
|
-
minimizedByDefault?: boolean;
|
|
33
|
-
autoCloseOnSend?: boolean;
|
|
34
|
-
}
|
|
2
|
+
import { IChatRevampProps } from './types';
|
|
35
3
|
export declare const ChatRevamp: React.FC<IChatRevampProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PrivateChatCharacter } from './types';
|
|
3
|
+
interface IRecentChatsProps {
|
|
4
|
+
showRecentChats: boolean;
|
|
5
|
+
toggleRecentChats: () => void;
|
|
6
|
+
hasUnseenMessages: boolean;
|
|
7
|
+
showSearchCharacterUI: () => void;
|
|
8
|
+
recentChatCharacters?: PrivateChatCharacter[];
|
|
9
|
+
recentSelectedChatCharacterId?: string;
|
|
10
|
+
unseenMessageCharacterIds?: string[];
|
|
11
|
+
onPreviousChatCharacterClick: (character: PrivateChatCharacter) => void;
|
|
12
|
+
onRemoveRecentChatCharacter?: (character: PrivateChatCharacter) => void;
|
|
13
|
+
isPrivate: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const RecentChats: React.FC<IRecentChatsProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ICharacter, IChatMessage, IPrivateChatMessage, ITradeChatMessage } from '@rpg-engine/shared';
|
|
2
|
+
import { IStyles } from '../Chat/Chat';
|
|
3
|
+
export declare type PrivateChatCharacter = Pick<ICharacter, '_id' | 'name'>;
|
|
4
|
+
export declare type ChatMessage = IChatMessage | IPrivateChatMessage | ITradeChatMessage;
|
|
5
|
+
export interface IChatRevampProps {
|
|
6
|
+
chatMessages: ChatMessage[];
|
|
7
|
+
onSendGlobalChatMessage: (message: string) => void;
|
|
8
|
+
onCloseButton: () => void;
|
|
9
|
+
onFocus?: () => void;
|
|
10
|
+
onBlur?: () => void;
|
|
11
|
+
styles?: IStyles;
|
|
12
|
+
tabs: {
|
|
13
|
+
label: string;
|
|
14
|
+
id: string;
|
|
15
|
+
}[];
|
|
16
|
+
activeTab: string;
|
|
17
|
+
onChangeTab: (tabId: string) => void;
|
|
18
|
+
privateChatCharacters?: PrivateChatCharacter[];
|
|
19
|
+
onChangeCharacterName: (characterName: string) => void;
|
|
20
|
+
onCharacterClick?: (character: PrivateChatCharacter) => void;
|
|
21
|
+
onSendPrivateChatMessage: (message: string) => void;
|
|
22
|
+
recentChatCharacters?: PrivateChatCharacter[];
|
|
23
|
+
recentSelectedChatCharacterId?: string;
|
|
24
|
+
onPreviousChatCharacterClick?: (character: PrivateChatCharacter) => void;
|
|
25
|
+
onRemoveRecentChatCharacter?: (character: PrivateChatCharacter) => void;
|
|
26
|
+
unseenMessageCharacterIds?: string[];
|
|
27
|
+
onSendTradeMessage: (message: string) => void;
|
|
28
|
+
searchCharacterUI: boolean;
|
|
29
|
+
hideSearchCharacterUI: () => void;
|
|
30
|
+
showSearchCharacterUI: () => void;
|
|
31
|
+
minimizedByDefault?: boolean;
|
|
32
|
+
autoCloseOnSend?: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IChatRevampProps, PrivateChatCharacter } from '../components/ChatRevamp/types';
|
|
2
|
+
export declare const useChat: ({ minimizedByDefault, isPrivate, onChangeTab, onPreviousChatCharacterClick, hideSearchCharacterUI, unseenMessageCharacterIds, }: Pick<IChatRevampProps, "activeTab" | "minimizedByDefault" | "onChangeTab" | "onPreviousChatCharacterClick" | "hideSearchCharacterUI" | "unseenMessageCharacterIds"> & {
|
|
3
|
+
isPrivate: boolean;
|
|
4
|
+
}) => {
|
|
5
|
+
showRecentChats: boolean;
|
|
6
|
+
isExpanded: boolean;
|
|
7
|
+
toggleExpand: () => void;
|
|
8
|
+
toggleRecentChats: () => void;
|
|
9
|
+
handleTabChange: (tabId: string) => void;
|
|
10
|
+
handlePreviousChatCharacterClick: (character: PrivateChatCharacter) => void;
|
|
11
|
+
hasUnseenMessages: boolean | undefined;
|
|
12
|
+
};
|