@rpg-engine/long-bow 0.7.30 → 0.7.32
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/ChatRevamp/ChatContent.d.ts +2 -0
- package/dist/components/ChatRevamp/types.d.ts +2 -0
- package/dist/long-bow.cjs.development.js +16 -4
- 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 +16 -4
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Features/chat/ChatRevamp.stories.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ChatRevamp/ChatContent.tsx +6 -0
- package/src/components/ChatRevamp/ChatRevamp.tsx +4 -0
- package/src/components/ChatRevamp/types.ts +2 -0
- package/src/components/TimeWidget/TimeWidget.tsx +8 -3
- package/src/stories/Features/chat/ChatRevamp.stories.tsx +29 -0
|
@@ -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
|
@@ -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}
|
|
@@ -21,10 +21,15 @@ export const TimeWidget: React.FC<IClockWidgetProps> = ({
|
|
|
21
21
|
scale,
|
|
22
22
|
}) => {
|
|
23
23
|
return (
|
|
24
|
-
<Draggable
|
|
24
|
+
<Draggable
|
|
25
|
+
scale={scale}
|
|
26
|
+
cancel=".time-widget-close,.time-widget-container,.time-widget-container *"
|
|
27
|
+
>
|
|
25
28
|
<WidgetContainer>
|
|
26
|
-
<CloseButton onPointerDown={onClose}>
|
|
27
|
-
|
|
29
|
+
<CloseButton onPointerDown={onClose} className="time-widget-close">
|
|
30
|
+
X
|
|
31
|
+
</CloseButton>
|
|
32
|
+
<DayNightContainer className="time-widget-container">
|
|
28
33
|
<DayNightPeriod periodOfDay={periodOfDay} />
|
|
29
34
|
</DayNightContainer>
|
|
30
35
|
<Time>{TimeClock}</Time>
|
|
@@ -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
|
+
};
|