@rpg-engine/long-bow 0.7.5 → 0.7.8

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.5",
3
+ "version": "0.7.8",
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%',
@@ -125,82 +125,89 @@ interface IMessageProps {
125
125
  }
126
126
 
127
127
  const ChatContainer = styled.div<IContainerProps>`
128
- width: 100%;
129
- background-color: #1e1e1e81;
130
-
128
+ width: ${props => props.width};
129
+ height: ${props => props.height};
130
+ background-color: rgba(30, 30, 30, 0.3);
131
131
  display: flex;
132
132
  flex-direction: column;
133
- 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);
136
+ overflow: hidden;
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;
134
149
  `;
135
150
 
136
151
  const MessagesContainer = styled.div`
137
152
  flex-grow: 1;
138
153
  overflow-y: auto;
139
- padding: 10px;
140
- margin-left: 0.9rem;
154
+ padding: 12px;
155
+ margin-bottom: 8px;
156
+
157
+ scrollbar-width: thin;
158
+ scrollbar-color: rgba(51, 51, 51, 0.4) rgba(30, 30, 30, 0.4);
141
159
 
142
160
  &::-webkit-scrollbar {
143
161
  width: 6px;
144
162
  }
145
163
 
146
164
  &::-webkit-scrollbar-track {
147
- background: #333;
165
+ background: rgba(30, 30, 30, 0.4);
148
166
  }
149
167
 
150
168
  &::-webkit-scrollbar-thumb {
151
- background: transparent;
169
+ background-color: rgba(51, 51, 51, 0.4);
152
170
  border-radius: 3px;
153
171
  }
154
-
155
- &::-webkit-scrollbar-thumb:hover {
156
- background: #222;
157
- }
158
-
159
- &::-webkit-scrollbar-corner {
160
- background: #333;
161
- }
162
-
163
- &::-webkit-scrollbar-button {
164
- background: #333;
165
- }
166
-
167
- &::-webkit-scrollbar-button:hover {
168
- background: #222;
169
- }
170
172
  `;
171
173
 
172
174
  const Message = styled.div<IMessageProps>`
173
- margin-bottom: 4px;
175
+ margin-bottom: 6px;
174
176
  color: ${({ color }) => color};
175
177
  font-family: 'Press Start 2P', cursive;
176
- font-size: 0.7rem; // Adjusted font size for pixel font
177
- white-space: pre-wrap; // Preserve line breaks and spaces
178
- word-break: break-word; // Break long words if necessary
178
+ font-size: 0.7rem;
179
+ line-height: 1.4;
180
+ word-break: break-word;
179
181
  `;
180
182
 
181
183
  const Form = styled.form`
182
184
  display: flex;
183
- width: 100%;
184
- padding: 5px;
185
+ padding: 8px;
186
+ background-color: rgba(42, 42, 42, 0.4);
185
187
  `;
186
188
 
187
189
  const TextField = styled.input`
188
190
  flex-grow: 1;
189
- background-color: transparent;
191
+ background-color: rgba(26, 26, 26, 0.6);
190
192
  color: #ff6600;
191
- border: none;
193
+ border: 1px solid rgba(51, 51, 51, 0.6);
194
+ border-radius: 4px;
195
+ padding: 8px;
196
+ margin-right: 8px;
192
197
  font-family: 'Press Start 2P', cursive;
193
- font-size: 0.7rem; // Matching the font size of messages
194
- border-radius: 5px;
195
- margin-left: 0.9rem;
198
+ font-size: 0.7rem;
199
+ height: 32px;
200
+ transition: border-color 0.3s, background-color 0.3s;
196
201
 
197
202
  &::placeholder {
198
- color: ${uiColors.lightGray};
199
- font-size: 0.7rem;
203
+ color: rgba(255, 255, 255, 0.5);
204
+ font-size: 0.6rem;
200
205
  }
201
206
 
202
207
  &:focus {
203
208
  outline: none;
209
+ border-color: #ff6600;
210
+ background-color: rgba(42, 42, 42, 0.9);
204
211
  }
205
212
  `;
206
213
 
@@ -208,37 +215,13 @@ const SendButton = styled.button`
208
215
  background-color: transparent;
209
216
  color: #ff6600;
210
217
  border: none;
211
- padding: 0 10px;
212
- font-size: 18px;
218
+ padding: 8px 12px;
219
+ font-size: 14px;
213
220
  cursor: pointer;
214
- transition: color 0.3s ease;
215
-
216
- &:hover {
217
- color: #ff8533;
218
- }
221
+ transition: opacity 0.3s ease;
219
222
 
220
223
  &:disabled {
221
- color: #666;
224
+ opacity: 0.5;
222
225
  cursor: not-allowed;
223
226
  }
224
227
  `;
225
-
226
- const CloseButton = styled.button`
227
- position: absolute;
228
- top: 0;
229
- right: 0;
230
- background-color: transparent;
231
- border: none;
232
- color: white;
233
- font-size: 16px;
234
- cursor: pointer;
235
- padding: 5px;
236
- display: flex;
237
- align-items: center;
238
- justify-content: center;
239
- transition: color 0.3s ease;
240
-
241
- &:hover {
242
- color: ${uiColors.darkYellow};
243
- }
244
- `;
@@ -207,11 +207,12 @@ const Tab = styled.button<{ active: boolean }>`
207
207
  border-radius: 5px 5px 0 0;
208
208
  border-width: 0.25rem 0.25rem 0 0.25rem;
209
209
  border-style: solid;
210
- border-color: ${props => (props.active ? '#c65102' : uiColors.gray)};
210
+ border-color: ${props =>
211
+ props.active ? 'rgba(198, 81, 2, 0.5)' : 'rgba(128, 128, 128, 0.5)'};
211
212
 
212
213
  background-color: ${props =>
213
- props.active ? uiColors.orange : 'transparent'};
214
- color: ${props => (props.active ? 'white' : uiColors.raisinBlack)};
214
+ props.active ? uiColors.orange : 'rgba(0, 0, 0, 0.2)'};
215
+ color: ${props => (props.active ? 'white' : uiColors.gray)};
215
216
  `;
216
217
 
217
218
  const PrivateChatContainer = styled.div<{ width: string; height: string }>`