@rpg-engine/long-bow 0.7.30 → 0.7.31

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.
@@ -5,3 +5,4 @@ export default meta;
5
5
  export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatRevampProps>;
6
6
  export declare const Private: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatRevampProps>;
7
7
  export declare const Trade: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatRevampProps>;
8
+ export declare const Guild: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatRevampProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.7.30",
3
+ "version": "0.7.31",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -22,6 +22,8 @@ interface ChatContentProps {
22
22
  privateChatCharacters?: PrivateChatCharacter[];
23
23
  hideSearchCharacterUI: () => void;
24
24
  onCharacterClick?: (character: PrivateChatCharacter) => void;
25
+ isGuild: boolean;
26
+ onSendGuildChatMessage: (message: string) => void;
25
27
  }
26
28
 
27
29
  export const ChatContent: React.FC<ChatContentProps> = ({
@@ -42,6 +44,8 @@ export const ChatContent: React.FC<ChatContentProps> = ({
42
44
  privateChatCharacters,
43
45
  hideSearchCharacterUI,
44
46
  onCharacterClick,
47
+ isGuild,
48
+ onSendGuildChatMessage,
45
49
  }) => {
46
50
  const handleSendMessage = (message: string) => {
47
51
  if (autoCloseOnSend) {
@@ -52,6 +56,8 @@ export const ChatContent: React.FC<ChatContentProps> = ({
52
56
  onSendPrivateChatMessage(message);
53
57
  } else if (isTrade) {
54
58
  onSendTradeMessage(message);
59
+ } else if (isGuild) {
60
+ onSendGuildChatMessage(message);
55
61
  } else {
56
62
  onSendGlobalChatMessage(message);
57
63
  }
@@ -11,6 +11,7 @@ import { IChatRevampProps } from './types';
11
11
  export const ChatRevamp: React.FC<IChatRevampProps> = ({
12
12
  chatMessages,
13
13
  onSendGlobalChatMessage,
14
+ onSendGuildChatMessage, // Add this new prop
14
15
  onChangeCharacterName,
15
16
  onFocus,
16
17
  onBlur,
@@ -36,6 +37,7 @@ export const ChatRevamp: React.FC<IChatRevampProps> = ({
36
37
  }) => {
37
38
  const isPrivate = activeTab === 'private';
38
39
  const isTrade = activeTab === 'trade';
40
+ const isGuild = activeTab === 'guild';
39
41
 
40
42
  const chatHook = useChat({
41
43
  minimizedByDefault,
@@ -88,11 +90,13 @@ export const ChatRevamp: React.FC<IChatRevampProps> = ({
88
90
  <ChatContent
89
91
  isPrivate={isPrivate}
90
92
  isTrade={isTrade}
93
+ isGuild={isGuild}
91
94
  searchCharacterUI={searchCharacterUI}
92
95
  chatMessages={chatMessages}
93
96
  onSendGlobalChatMessage={onSendGlobalChatMessage}
94
97
  onSendPrivateChatMessage={onSendPrivateChatMessage}
95
98
  onSendTradeMessage={onSendTradeMessage}
99
+ onSendGuildChatMessage={onSendGuildChatMessage}
96
100
  onCloseButton={onCloseButton}
97
101
  styles={styles}
98
102
  onFocus={onFocus}
@@ -38,4 +38,6 @@ export interface IChatRevampProps {
38
38
  showSearchCharacterUI: () => void;
39
39
  minimizedByDefault?: boolean;
40
40
  autoCloseOnSend?: boolean;
41
+ onSendGuildChatMessage: (message: string) => void;
42
+ isInGuild: boolean;
41
43
  }
@@ -132,6 +132,7 @@ const tabsMock = [
132
132
  { label: 'Global', id: 'global' },
133
133
  { label: 'Private', id: 'private' },
134
134
  { label: 'Trade', id: 'trade' },
135
+ { label: 'Guild', id: 'guild' }, // Add the Guild tab
135
136
  ];
136
137
 
137
138
  const recentPrivateChatCharactersMock = [
@@ -182,6 +183,9 @@ Default.args = {
182
183
  hideSearchCharacterUI: () => {
183
184
  console.log('Hiding search character UI...');
184
185
  },
186
+ onSendGuildChatMessage: value => {
187
+ console.log('Sending guild chat message:', value);
188
+ },
185
189
  };
186
190
 
187
191
  export const Private = Template.bind({});
@@ -230,3 +234,28 @@ Trade.args = {
230
234
  onChangeTab: () => {},
231
235
  onSendTradeMessage: () => {},
232
236
  };
237
+
238
+ export const Guild = Template.bind({});
239
+
240
+ Guild.args = {
241
+ onSendGlobalChatMessage: () => {
242
+ console.log('Sending global message...');
243
+ },
244
+ onSendPrivateChatMessage: () => {
245
+ console.log('Sending private message...');
246
+ },
247
+ onSendTradeMessage: () => {
248
+ console.log('Sending trade message...');
249
+ },
250
+ onSendGuildChatMessage: value => {
251
+ console.log('Sending guild chat message:', value);
252
+ },
253
+ onChangeCharacterName: () => {},
254
+ chatMessages: chatMessagesMock,
255
+ styles: { width: `calc(100% - 0.5rem * 2)`, height: '200px' },
256
+ onCloseButton: () => {},
257
+ tabs: tabsMock,
258
+ privateChatCharacters: recentPrivateChatCharactersMock,
259
+ activeTab: 'guild',
260
+ onChangeTab: () => {},
261
+ };