@rpg-engine/long-bow 0.7.4 → 0.7.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.7.4",
3
+ "version": "0.7.7",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,7 +1,7 @@
1
- import dayjs from 'dayjs'; // Import dayjs for timestamp formatting
1
+ import dayjs from 'dayjs';
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import { ErrorBoundary } from 'react-error-boundary';
4
- import { FaTimes } from 'react-icons/fa'; // Import the close icon
4
+ import { FaTimes } from 'react-icons/fa';
5
5
  import styled from 'styled-components';
6
6
  import { uiColors } from '../../constants/uiColors';
7
7
  import { ChatMessage } from '../ChatRevamp/ChatRevamp';
@@ -33,11 +33,11 @@ export interface IChatProps {
33
33
  export const Chat: React.FC<IChatProps> = ({
34
34
  chatMessages,
35
35
  onSendChatMessage,
36
- onCloseButton, // Make sure this prop is being passed
36
+ onCloseButton,
37
37
  onFocus,
38
38
  onBlur,
39
39
  styles = {
40
- textColor: '#ff6600', // Keeping the original color
40
+ textColor: '#ff6600',
41
41
  buttonColor: '#ff6600',
42
42
  buttonBackgroundColor: '#333',
43
43
  width: '100%',
@@ -127,81 +127,86 @@ interface IMessageProps {
127
127
  const ChatContainer = styled.div<IContainerProps>`
128
128
  width: ${props => props.width};
129
129
  height: ${props => props.height};
130
- background-color: #1e1e1e81;
131
-
130
+ background-color: #1e1e1e;
132
131
  display: flex;
133
132
  flex-direction: column;
134
- position: relative; // Added for absolute positioning of close button
133
+ position: relative;
134
+ border-radius: 8px;
135
+ border: 1px solid rgba(0, 0, 0, 0.1); /* Slightly transparent border */
136
+ overflow: hidden; /* Remove border-radius */
137
+ `;
138
+
139
+ const CloseButton = styled.button`
140
+ position: absolute;
141
+ top: 8px;
142
+ right: 8px;
143
+ background-color: transparent;
144
+ border: none;
145
+ color: white;
146
+ font-size: 16px;
147
+ cursor: pointer;
148
+ z-index: 1;
135
149
  `;
136
150
 
137
151
  const MessagesContainer = styled.div`
138
152
  flex-grow: 1;
139
153
  overflow-y: auto;
140
- padding: 10px;
141
- margin-left: 0.9rem;
154
+ padding: 12px;
155
+ margin-bottom: 8px;
156
+
157
+ scrollbar-width: thin;
158
+ scrollbar-color: #333 #1e1e1e;
142
159
 
143
160
  &::-webkit-scrollbar {
144
161
  width: 6px;
145
162
  }
146
163
 
147
164
  &::-webkit-scrollbar-track {
148
- background: #333;
165
+ background: #1e1e1e;
149
166
  }
150
167
 
151
168
  &::-webkit-scrollbar-thumb {
152
- background: transparent;
169
+ background-color: #333;
153
170
  border-radius: 3px;
154
171
  }
155
-
156
- &::-webkit-scrollbar-thumb:hover {
157
- background: #222;
158
- }
159
-
160
- &::-webkit-scrollbar-corner {
161
- background: #333;
162
- }
163
-
164
- &::-webkit-scrollbar-button {
165
- background: #333;
166
- }
167
-
168
- &::-webkit-scrollbar-button:hover {
169
- background: #222;
170
- }
171
172
  `;
172
173
 
173
174
  const Message = styled.div<IMessageProps>`
174
- margin-bottom: 4px;
175
+ margin-bottom: 6px;
175
176
  color: ${({ color }) => color};
176
177
  font-family: 'Press Start 2P', cursive;
177
- font-size: 0.7rem; // Adjusted font size for pixel font
178
- white-space: pre-wrap; // Preserve line breaks and spaces
179
- word-break: break-word; // Break long words if necessary
178
+ font-size: 0.7rem;
179
+ line-height: 1.4;
180
+ word-break: break-word;
180
181
  `;
181
182
 
182
183
  const Form = styled.form`
183
184
  display: flex;
184
- width: 100%;
185
- padding: 5px;
185
+ padding: 8px;
186
+ background-color: #2a2a2a;
186
187
  `;
187
188
 
188
189
  const TextField = styled.input`
189
190
  flex-grow: 1;
190
- background-color: transparent;
191
+ background-color: #1a1a1a;
191
192
  color: #ff6600;
192
- border: none;
193
+ border: 1px solid #333;
194
+ border-radius: 4px;
195
+ padding: 8px;
196
+ margin-right: 8px;
193
197
  font-family: 'Press Start 2P', cursive;
194
- font-size: 0.7rem; // Matching the font size of messages
195
- border-radius: 5px;
196
- margin-left: 0.9rem;
198
+ font-size: 0.7rem;
199
+ height: 32px;
200
+ transition: border-color 0.3s, background-color 0.3s;
197
201
 
198
202
  &::placeholder {
199
- color: ${uiColors.lightGray};
200
- font-size: 0.7rem;
203
+ color: #666;
201
204
  }
202
205
 
203
206
  &:focus {
204
207
  outline: none;
208
+ border-color: #ff6600;
209
+ background-color: #2a2a2a;
205
210
  }
206
211
  `;
207
212
 
@@ -209,37 +214,13 @@ const SendButton = styled.button`
209
214
  background-color: transparent;
210
215
  color: #ff6600;
211
216
  border: none;
212
- padding: 0 10px;
213
- font-size: 18px;
217
+ padding: 8px 12px;
218
+ font-size: 14px;
214
219
  cursor: pointer;
215
- transition: color 0.3s ease;
216
-
217
- &:hover {
218
- color: #ff8533;
219
- }
220
+ transition: opacity 0.3s ease;
220
221
 
221
222
  &:disabled {
222
- color: #666;
223
+ opacity: 0.5;
223
224
  cursor: not-allowed;
224
225
  }
225
226
  `;
226
-
227
- const CloseButton = styled.button`
228
- position: absolute;
229
- top: 0;
230
- right: 0;
231
- background-color: transparent;
232
- border: none;
233
- color: white;
234
- font-size: 16px;
235
- cursor: pointer;
236
- padding: 5px;
237
- display: flex;
238
- align-items: center;
239
- justify-content: center;
240
- transition: color 0.3s ease;
241
-
242
- &:hover {
243
- color: ${uiColors.darkYellow};
244
- }
245
- `;
@@ -211,7 +211,7 @@ const Tab = styled.button<{ active: boolean }>`
211
211
 
212
212
  background-color: ${props =>
213
213
  props.active ? uiColors.orange : 'transparent'};
214
- color: ${props => (props.active ? 'white' : uiColors.raisinBlack)};
214
+ color: ${props => (props.active ? 'white' : uiColors.gray)};
215
215
  `;
216
216
 
217
217
  const PrivateChatContainer = styled.div<{ width: string; height: string }>`