@rpg-engine/long-bow 0.7.32 → 0.7.34

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,5 +1,5 @@
1
- import { IChatMessage } from '@rpg-engine/shared';
1
+ import { ILocalChatMessage } from '@rpg-engine/shared';
2
2
  import { Meta } from '@storybook/react';
3
3
  declare const meta: Meta;
4
4
  export default meta;
5
- export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatMessage>;
5
+ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ILocalChatMessage>;
@@ -1,5 +1,5 @@
1
- import { IChatMessage } from '@rpg-engine/shared';
1
+ import { ILocalChatMessage } from '@rpg-engine/shared';
2
2
  import { Meta } from '@storybook/react';
3
3
  declare const meta: Meta;
4
4
  export default meta;
5
- export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatMessage>;
5
+ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ILocalChatMessage[]>;
@@ -3,6 +3,7 @@ import { IChatRevampProps } from '../../../components/ChatRevamp/types';
3
3
  declare const meta: Meta;
4
4
  export default meta;
5
5
  export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatRevampProps>;
6
+ export declare const Global: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatRevampProps>;
6
7
  export declare const Private: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatRevampProps>;
7
8
  export declare const Trade: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IChatRevampProps>;
8
9
  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.32",
3
+ "version": "0.7.34",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -84,7 +84,7 @@
84
84
  "dependencies": {
85
85
  "@capacitor/core": "^6.1.0",
86
86
  "@rollup/plugin-image": "^2.1.1",
87
- "@rpg-engine/shared": "^0.9.65",
87
+ "@rpg-engine/shared": "^0.9.74",
88
88
  "dayjs": "^1.11.2",
89
89
  "font-awesome": "^4.7.0",
90
90
  "fs-extra": "^10.1.0",
@@ -7,9 +7,11 @@ import { ChatMessage, PrivateChatCharacter } from './types';
7
7
  interface ChatContentProps {
8
8
  isPrivate: boolean;
9
9
  isTrade: boolean;
10
+ isGlobal: boolean;
10
11
  searchCharacterUI: boolean;
11
12
  chatMessages: ChatMessage[];
12
13
  onSendGlobalChatMessage: (message: string) => void;
14
+ onSendLocalChatMessage: (message: string) => void;
13
15
  onSendPrivateChatMessage: (message: string) => void;
14
16
  onSendTradeMessage: (message: string) => void;
15
17
  onCloseButton: () => void;
@@ -29,8 +31,10 @@ interface ChatContentProps {
29
31
  export const ChatContent: React.FC<ChatContentProps> = ({
30
32
  isPrivate,
31
33
  isTrade,
34
+ isGlobal,
32
35
  searchCharacterUI,
33
36
  chatMessages,
37
+ onSendLocalChatMessage,
34
38
  onSendGlobalChatMessage,
35
39
  onSendPrivateChatMessage,
36
40
  onSendTradeMessage,
@@ -58,8 +62,10 @@ export const ChatContent: React.FC<ChatContentProps> = ({
58
62
  onSendTradeMessage(message);
59
63
  } else if (isGuild) {
60
64
  onSendGuildChatMessage(message);
61
- } else {
65
+ } else if (isGlobal) {
62
66
  onSendGlobalChatMessage(message);
67
+ } else {
68
+ onSendLocalChatMessage(message);
63
69
  }
64
70
  };
65
71
 
@@ -8,7 +8,7 @@ import { ExpandButton } from './ExpandButton';
8
8
  import { RecentChats } from './RecentChats';
9
9
  import { IChatRevampProps } from './types';
10
10
 
11
- export const ChatRevamp: React.FC<IChatRevampProps> = ({
11
+ export const ChatRevamp = ({
12
12
  chatMessages,
13
13
  onSendGlobalChatMessage,
14
14
  onSendGuildChatMessage, // Add this new prop
@@ -34,11 +34,12 @@ export const ChatRevamp: React.FC<IChatRevampProps> = ({
34
34
  showSearchCharacterUI,
35
35
  minimizedByDefault = false,
36
36
  autoCloseOnSend,
37
- }) => {
37
+ onSendLocalChatMessage,
38
+ }: IChatRevampProps) => {
38
39
  const isPrivate = activeTab === 'private';
39
40
  const isTrade = activeTab === 'trade';
40
41
  const isGuild = activeTab === 'guild';
41
-
42
+ const isGlobal = activeTab === 'global';
42
43
  const chatHook = useChat({
43
44
  minimizedByDefault,
44
45
  isPrivate,
@@ -91,12 +92,14 @@ export const ChatRevamp: React.FC<IChatRevampProps> = ({
91
92
  isPrivate={isPrivate}
92
93
  isTrade={isTrade}
93
94
  isGuild={isGuild}
95
+ isGlobal={isGlobal}
94
96
  searchCharacterUI={searchCharacterUI}
95
97
  chatMessages={chatMessages}
96
98
  onSendGlobalChatMessage={onSendGlobalChatMessage}
97
99
  onSendPrivateChatMessage={onSendPrivateChatMessage}
98
100
  onSendTradeMessage={onSendTradeMessage}
99
101
  onSendGuildChatMessage={onSendGuildChatMessage}
102
+ onSendLocalChatMessage={onSendLocalChatMessage}
100
103
  onCloseButton={onCloseButton}
101
104
  styles={styles}
102
105
  onFocus={onFocus}
@@ -114,7 +117,7 @@ export const ChatRevamp: React.FC<IChatRevampProps> = ({
114
117
  <CollapsedChatInput>
115
118
  <Chat
116
119
  chatMessages={[]}
117
- onSendChatMessage={onSendGlobalChatMessage}
120
+ onSendChatMessage={onSendLocalChatMessage}
118
121
  sendMessage={true}
119
122
  onCloseButton={onCloseButton}
120
123
  styles={styles}
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  ICharacter,
3
- IChatMessage,
3
+ IGlobalChatMessage,
4
+ ILocalChatMessage,
4
5
  IPrivateChatMessage,
5
6
  ITradeChatMessage,
6
7
  } from '@rpg-engine/shared';
@@ -9,9 +10,10 @@ import { IStyles } from '../Chat/Chat';
9
10
  export type PrivateChatCharacter = Pick<ICharacter, '_id' | 'name'>;
10
11
 
11
12
  export type ChatMessage =
12
- | IChatMessage
13
+ | ILocalChatMessage
13
14
  | IPrivateChatMessage
14
- | ITradeChatMessage;
15
+ | ITradeChatMessage
16
+ | IGlobalChatMessage;
15
17
 
16
18
  export interface IChatRevampProps {
17
19
  chatMessages: ChatMessage[];
@@ -40,4 +42,5 @@ export interface IChatRevampProps {
40
42
  autoCloseOnSend?: boolean;
41
43
  onSendGuildChatMessage: (message: string) => void;
42
44
  isInGuild: boolean;
45
+ onSendLocalChatMessage: (message: string) => void;
43
46
  }
@@ -1,4 +1,4 @@
1
- import { IChatMessage } from '@rpg-engine/shared';
1
+ import { ILocalChatMessage } from '@rpg-engine/shared';
2
2
  import dayjs from 'dayjs';
3
3
  import React, { useEffect, useState } from 'react';
4
4
  import { ErrorBoundary } from 'react-error-boundary';
@@ -15,7 +15,7 @@ interface IEmitter {
15
15
  name: string;
16
16
  }
17
17
  export interface IChatDeprecatedProps {
18
- chatMessages: IChatMessage[];
18
+ chatMessages: ILocalChatMessage[];
19
19
  onSendChatMessage: (message: string) => void;
20
20
  onCloseButton: () => void;
21
21
  onFocus?: () => void;
@@ -71,7 +71,7 @@ export const ChatDeprecated: React.FC<IChatDeprecatedProps> = ({
71
71
  } ${message}`;
72
72
  };
73
73
 
74
- const onRenderChatMessages = (chatMessages: IChatMessage[]) => {
74
+ const onRenderChatMessages = (chatMessages: ILocalChatMessage[]) => {
75
75
  return chatMessages?.length ? (
76
76
  chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (
77
77
  <MessageText key={`${_id}_${index}`}>
@@ -21,15 +21,10 @@ export const TimeWidget: React.FC<IClockWidgetProps> = ({
21
21
  scale,
22
22
  }) => {
23
23
  return (
24
- <Draggable
25
- scale={scale}
26
- cancel=".time-widget-close,.time-widget-container,.time-widget-container *"
27
- >
24
+ <Draggable scale={scale}>
28
25
  <WidgetContainer>
29
- <CloseButton onPointerDown={onClose} className="time-widget-close">
30
- X
31
- </CloseButton>
32
- <DayNightContainer className="time-widget-container">
26
+ <CloseButton onPointerDown={onClose}>X</CloseButton>
27
+ <DayNightContainer>
33
28
  <DayNightPeriod periodOfDay={periodOfDay} />
34
29
  </DayNightContainer>
35
30
  <Time>{TimeClock}</Time>
@@ -1,4 +1,4 @@
1
- import { ChatMessageType, IChatMessage } from '@rpg-engine/shared';
1
+ import { ChatMessageType, ILocalChatMessage } from '@rpg-engine/shared';
2
2
  import { Meta, Story } from '@storybook/react';
3
3
  import React from 'react';
4
4
  import { Chat } from '../../../components/Chat/Chat';
@@ -19,7 +19,7 @@ const chatMessagesMock = [
19
19
  _id: 'someid',
20
20
  name: 'Guilherme',
21
21
  },
22
- type: ChatMessageType.Global,
22
+ type: ChatMessageType.Local,
23
23
  x: 128,
24
24
  y: 128,
25
25
  scene: 'MainScene',
@@ -33,7 +33,7 @@ const chatMessagesMock = [
33
33
  _id: 'someid',
34
34
  name: 'Guilherme',
35
35
  },
36
- type: ChatMessageType.Global,
36
+ type: ChatMessageType.Local,
37
37
  x: 128,
38
38
  y: 128,
39
39
  scene: 'MainScene',
@@ -47,7 +47,7 @@ const chatMessagesMock = [
47
47
  _id: 'someid',
48
48
  name: 'Guilherme',
49
49
  },
50
- type: ChatMessageType.Global,
50
+ type: ChatMessageType.Local,
51
51
  x: 128,
52
52
  y: 128,
53
53
  scene: 'MainScene',
@@ -61,7 +61,7 @@ const chatMessagesMock = [
61
61
  _id: 'someid',
62
62
  name: 'Guilherme',
63
63
  },
64
- type: ChatMessageType.Global,
64
+ type: ChatMessageType.Local,
65
65
  x: 128,
66
66
  y: 128,
67
67
  scene: 'MainScene',
@@ -75,7 +75,7 @@ const chatMessagesMock = [
75
75
  _id: 'someid',
76
76
  name: 'Guilherme',
77
77
  },
78
- type: ChatMessageType.Global,
78
+ type: ChatMessageType.Local,
79
79
  x: 128,
80
80
  y: 128,
81
81
  scene: 'MainScene',
@@ -89,7 +89,7 @@ const chatMessagesMock = [
89
89
  _id: 'someid',
90
90
  name: 'Guilherme',
91
91
  },
92
- type: ChatMessageType.Global,
92
+ type: ChatMessageType.Local,
93
93
  x: 128,
94
94
  y: 128,
95
95
  scene: 'MainScene',
@@ -103,7 +103,7 @@ const chatMessagesMock = [
103
103
  _id: 'someid',
104
104
  name: 'Guilherme',
105
105
  },
106
- type: ChatMessageType.Global,
106
+ type: ChatMessageType.Local,
107
107
  x: 128,
108
108
  y: 128,
109
109
  scene: 'MainScene',
@@ -117,7 +117,7 @@ const chatMessagesMock = [
117
117
  _id: 'someid',
118
118
  name: 'Guilherme',
119
119
  },
120
- type: ChatMessageType.Global,
120
+ type: ChatMessageType.Local,
121
121
  x: 128,
122
122
  y: 128,
123
123
  scene: 'MainScene',
@@ -131,7 +131,7 @@ const chatMessagesMock = [
131
131
  _id: 'someid',
132
132
  name: 'Guilherme',
133
133
  },
134
- type: ChatMessageType.Global,
134
+ type: ChatMessageType.Local,
135
135
  x: 128,
136
136
  y: 128,
137
137
  scene: 'MainScene',
@@ -145,7 +145,7 @@ const chatMessagesMock = [
145
145
  _id: 'someid',
146
146
  name: 'Guilherme',
147
147
  },
148
- type: ChatMessageType.Global,
148
+ type: ChatMessageType.Local,
149
149
  x: 128,
150
150
  y: 128,
151
151
  scene: 'MainScene',
@@ -159,7 +159,7 @@ const chatMessagesMock = [
159
159
  _id: 'someid',
160
160
  name: 'Guilherme',
161
161
  },
162
- type: ChatMessageType.Global,
162
+ type: ChatMessageType.Local,
163
163
  x: 128,
164
164
  y: 128,
165
165
  scene: 'MainScene',
@@ -168,7 +168,7 @@ const chatMessagesMock = [
168
168
  },
169
169
  ];
170
170
 
171
- const Template: Story<IChatMessage> = args => (
171
+ const Template: Story<ILocalChatMessage> = args => (
172
172
  <RPGUIRoot>
173
173
  <Chat
174
174
  onSendChatMessage={msg => console.log(msg)}
@@ -1,4 +1,4 @@
1
- import { ChatMessageType, IChatMessage } from '@rpg-engine/shared';
1
+ import { ChatMessageType, ILocalChatMessage } from '@rpg-engine/shared';
2
2
  import { Meta, Story } from '@storybook/react';
3
3
  import React from 'react';
4
4
  import { ChatDeprecated } from '../../../components/Chatdeprecated/ChatDeprecated';
@@ -19,7 +19,7 @@ const chatMessagesMock = [
19
19
  _id: 'someid',
20
20
  name: 'Guilherme',
21
21
  },
22
- type: ChatMessageType.Global,
22
+ type: ChatMessageType.Local,
23
23
  x: 128,
24
24
  y: 128,
25
25
  scene: 'MainScene',
@@ -33,7 +33,7 @@ const chatMessagesMock = [
33
33
  _id: 'someid',
34
34
  name: 'Guilherme',
35
35
  },
36
- type: ChatMessageType.Global,
36
+ type: ChatMessageType.Local,
37
37
  x: 128,
38
38
  y: 128,
39
39
  scene: 'MainScene',
@@ -47,7 +47,7 @@ const chatMessagesMock = [
47
47
  _id: 'someid',
48
48
  name: 'Guilherme',
49
49
  },
50
- type: ChatMessageType.Global,
50
+ type: ChatMessageType.Local,
51
51
  x: 128,
52
52
  y: 128,
53
53
  scene: 'MainScene',
@@ -61,7 +61,7 @@ const chatMessagesMock = [
61
61
  _id: 'someid',
62
62
  name: 'Guilherme',
63
63
  },
64
- type: ChatMessageType.Global,
64
+ type: ChatMessageType.Local,
65
65
  x: 128,
66
66
  y: 128,
67
67
  scene: 'MainScene',
@@ -75,7 +75,7 @@ const chatMessagesMock = [
75
75
  _id: 'someid',
76
76
  name: 'Guilherme',
77
77
  },
78
- type: ChatMessageType.Global,
78
+ type: ChatMessageType.Local,
79
79
  x: 128,
80
80
  y: 128,
81
81
  scene: 'MainScene',
@@ -89,7 +89,7 @@ const chatMessagesMock = [
89
89
  _id: 'someid',
90
90
  name: 'Guilherme',
91
91
  },
92
- type: ChatMessageType.Global,
92
+ type: ChatMessageType.Local,
93
93
  x: 128,
94
94
  y: 128,
95
95
  scene: 'MainScene',
@@ -103,7 +103,7 @@ const chatMessagesMock = [
103
103
  _id: 'someid',
104
104
  name: 'Guilherme',
105
105
  },
106
- type: ChatMessageType.Global,
106
+ type: ChatMessageType.Local,
107
107
  x: 128,
108
108
  y: 128,
109
109
  scene: 'MainScene',
@@ -117,7 +117,7 @@ const chatMessagesMock = [
117
117
  _id: 'someid',
118
118
  name: 'Guilherme',
119
119
  },
120
- type: ChatMessageType.Global,
120
+ type: ChatMessageType.Local,
121
121
  x: 128,
122
122
  y: 128,
123
123
  scene: 'MainScene',
@@ -131,7 +131,7 @@ const chatMessagesMock = [
131
131
  _id: 'someid',
132
132
  name: 'Guilherme',
133
133
  },
134
- type: ChatMessageType.Global,
134
+ type: ChatMessageType.Local,
135
135
  x: 128,
136
136
  y: 128,
137
137
  scene: 'MainScene',
@@ -145,7 +145,7 @@ const chatMessagesMock = [
145
145
  _id: 'someid',
146
146
  name: 'Guilherme',
147
147
  },
148
- type: ChatMessageType.Global,
148
+ type: ChatMessageType.Local,
149
149
  x: 128,
150
150
  y: 128,
151
151
  scene: 'MainScene',
@@ -154,7 +154,7 @@ const chatMessagesMock = [
154
154
  },
155
155
  ];
156
156
 
157
- const Template: Story<IChatMessage> = args => (
157
+ const Template: Story<ILocalChatMessage[]> = args => (
158
158
  <RPGUIRoot>
159
159
  <ChatDeprecated
160
160
  onSendChatMessage={msg => console.log(msg)}
@@ -21,7 +21,7 @@ const chatMessagesMock = [
21
21
  _id: 'someid',
22
22
  name: 'Guilherme',
23
23
  },
24
- type: ChatMessageType.Global,
24
+ type: ChatMessageType.Local,
25
25
  x: 128,
26
26
  y: 128,
27
27
  scene: 'MainScene',
@@ -35,7 +35,7 @@ const chatMessagesMock = [
35
35
  _id: 'someid1',
36
36
  name: 'Guilherme',
37
37
  },
38
- type: ChatMessageType.Global,
38
+ type: ChatMessageType.Local,
39
39
  x: 128,
40
40
  y: 128,
41
41
  scene: 'MainScene',
@@ -49,7 +49,7 @@ const chatMessagesMock = [
49
49
  _id: 'someid2',
50
50
  name: 'Guilherme',
51
51
  },
52
- type: ChatMessageType.Global,
52
+ type: ChatMessageType.Local,
53
53
  x: 128,
54
54
  y: 128,
55
55
  scene: 'MainScene',
@@ -63,7 +63,7 @@ const chatMessagesMock = [
63
63
  _id: 'someid3',
64
64
  name: 'Guilherme',
65
65
  },
66
- type: ChatMessageType.Global,
66
+ type: ChatMessageType.Local,
67
67
  x: 128,
68
68
  y: 128,
69
69
  scene: 'MainScene',
@@ -77,7 +77,7 @@ const chatMessagesMock = [
77
77
  _id: 'someid4',
78
78
  name: 'Guilherme',
79
79
  },
80
- type: ChatMessageType.Global,
80
+ type: ChatMessageType.Local,
81
81
  x: 128,
82
82
  y: 128,
83
83
  scene: 'MainScene',
@@ -91,7 +91,7 @@ const chatMessagesMock = [
91
91
  _id: 'someid5',
92
92
  name: 'Guilherme',
93
93
  },
94
- type: ChatMessageType.Global,
94
+ type: ChatMessageType.Local,
95
95
  x: 128,
96
96
  y: 128,
97
97
  scene: 'MainScene',
@@ -105,7 +105,7 @@ const chatMessagesMock = [
105
105
  _id: 'someid6',
106
106
  name: 'Guilherme',
107
107
  },
108
- type: ChatMessageType.Global,
108
+ type: ChatMessageType.Local,
109
109
  x: 128,
110
110
  y: 128,
111
111
  scene: 'MainScene',
@@ -119,7 +119,7 @@ const chatMessagesMock = [
119
119
  _id: 'someid7',
120
120
  name: 'Guilherme',
121
121
  },
122
- type: ChatMessageType.Global,
122
+ type: ChatMessageType.Local,
123
123
  x: 128,
124
124
  y: 128,
125
125
  scene: 'MainScene',
@@ -129,10 +129,11 @@ const chatMessagesMock = [
129
129
  ];
130
130
 
131
131
  const tabsMock = [
132
+ { label: 'Local', id: 'local' },
132
133
  { label: 'Global', id: 'global' },
133
134
  { label: 'Private', id: 'private' },
134
135
  { label: 'Trade', id: 'trade' },
135
- { label: 'Guild', id: 'guild' }, // Add the Guild tab
136
+ { label: 'Guild', id: 'guild' },
136
137
  ];
137
138
 
138
139
  const recentPrivateChatCharactersMock = [
@@ -148,114 +149,60 @@ const recentPrivateChatCharactersMock = [
148
149
  { _id: 'someid10', name: 'Guilherme2' },
149
150
  ];
150
151
 
152
+ const defaultArgs = {
153
+ chatMessages: chatMessagesMock,
154
+ tabs: tabsMock,
155
+ privateChatCharacters: recentPrivateChatCharactersMock,
156
+ styles: { width: 'calc(100% - 0.5rem * 2)', height: '200px' },
157
+ onCloseButton: () => console.log('Closing chat...'),
158
+ onChangeTab: (tab: typeof tabsMock[number]['id']) =>
159
+ console.log('Changing tab to:', tab),
160
+ };
161
+
151
162
  const Template: Story<IChatRevampProps> = args => (
152
163
  <RPGUIRoot>
153
164
  <ChatRevamp {...args} />
154
165
  </RPGUIRoot>
155
166
  );
156
167
 
168
+ // Local
157
169
  export const Default = Template.bind({});
158
-
159
170
  Default.args = {
160
- onSendGlobalChatMessage: value => {
161
- console.log('Sending global chat message:', value);
162
- },
163
- onChangeCharacterName: value => {
164
- console.log('Changing character name to:', value);
165
- },
166
- chatMessages: chatMessagesMock,
167
- styles: { width: `calc(100% - 0.5rem * 2)`, height: '200px' },
168
- onCloseButton: () => {
169
- console.log('Closing chat...');
170
- },
171
- tabs: tabsMock,
172
- privateChatCharacters: recentPrivateChatCharactersMock,
171
+ ...defaultArgs,
172
+ activeTab: 'local',
173
+ onSendLocalChatMessage: value =>
174
+ console.log('Sending local chat message:', value),
175
+ };
176
+
177
+ export const Global = Template.bind({});
178
+ Global.args = {
179
+ ...defaultArgs,
173
180
  activeTab: 'global',
174
- onChangeTab: tab => {
175
- console.log('Changing tab to:', tab);
176
- },
177
- onSendPrivateChatMessage: value => {
178
- console.log('Sending private chat message:', value);
179
- },
180
- onSendTradeMessage: value => {
181
- console.log('Sending trade message:', value);
182
- },
183
- hideSearchCharacterUI: () => {
184
- console.log('Hiding search character UI...');
185
- },
186
- onSendGuildChatMessage: value => {
187
- console.log('Sending guild chat message:', value);
188
- },
181
+ onSendGlobalChatMessage: value =>
182
+ console.log('Sending global chat message:', value),
189
183
  };
190
184
 
191
185
  export const Private = Template.bind({});
192
-
193
186
  Private.args = {
194
- onSendGlobalChatMessage: () => {
195
- console.log('Sending private chat message...');
196
- },
197
- onSendPrivateChatMessage: () => {
198
- console.log('Sending private message...');
199
- },
200
- onChangeCharacterName: () => {},
201
- chatMessages: chatMessagesMock,
202
- styles: { width: `calc(100% - 0.5rem * 2)`, height: '200px' },
203
- onCloseButton: () => {},
204
- tabs: tabsMock,
205
- privateChatCharacters: recentPrivateChatCharactersMock,
187
+ ...defaultArgs,
206
188
  activeTab: 'private',
207
- onChangeTab: () => {
208
- console.log('Changing tab...');
209
- },
210
- recentChatCharacters: recentPrivateChatCharactersMock,
211
189
  recentSelectedChatCharacterId: recentPrivateChatCharactersMock[0]._id,
212
190
  unseenMessageCharacterIds: [recentPrivateChatCharactersMock[0]._id],
213
- onSendTradeMessage: () => {},
214
- searchCharacterUI: false,
215
- hideSearchCharacterUI: () => {},
191
+ onSendPrivateChatMessage: value =>
192
+ console.log('Sending private chat message:', value),
216
193
  };
217
194
 
218
195
  export const Trade = Template.bind({});
219
-
220
196
  Trade.args = {
221
- onSendGlobalChatMessage: () => {
222
- console.log('Sending global message...');
223
- },
224
- onSendPrivateChatMessage: () => {
225
- console.log('Sending private message...');
226
- },
227
- onChangeCharacterName: () => {},
228
- chatMessages: chatMessagesMock,
229
- styles: { width: `calc(100% - 0.5rem * 2)`, height: '200px' },
230
- onCloseButton: () => {},
231
- tabs: tabsMock,
232
- privateChatCharacters: recentPrivateChatCharactersMock,
197
+ ...defaultArgs,
233
198
  activeTab: 'trade',
234
- onChangeTab: () => {},
235
- onSendTradeMessage: () => {},
199
+ onSendTradeMessage: value => console.log('Sending trade message:', value),
236
200
  };
237
201
 
238
202
  export const Guild = Template.bind({});
239
-
240
203
  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,
204
+ ...defaultArgs,
259
205
  activeTab: 'guild',
260
- onChangeTab: () => {},
206
+ onSendGuildChatMessage: value =>
207
+ console.log('Sending guild chat message:', value),
261
208
  };