@buerokratt-ria/common-gui-components 0.0.6 → 0.0.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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
  All changes to this project will be documented in this file.
3
3
  ## Template [MajorVersion.MediterraneanVersion.MinorVersion] - DD-MM-YYYY
4
4
 
5
+ ## [0.0.8] - 21-03-2025
6
+
7
+ - Fixated markdown-to-jsx to version 7.7.3
8
+
9
+ ## [0.0.7] - 19-03-2025
10
+
11
+ - Fixed End-user messages not visible in chat history
12
+
5
13
  ## [0.0.6] - 11-03-2025
6
14
 
7
15
  - Enhanced Markdownify List Rendering
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
@@ -34,7 +34,7 @@
34
34
  "linkify-react": "^4.1.1",
35
35
  "linkifyjs": "^4.1.1",
36
36
  "lodash": "^4.17.21",
37
- "markdown-to-jsx": "^7.5.0",
37
+ "markdown-to-jsx": "7.7.3",
38
38
  "react": "^18.2.0",
39
39
  "react-color": "^2.19.3",
40
40
  "react-cookie": "^4.1.1",
@@ -88,7 +88,7 @@
88
88
  "linkify-react": "^4.1.1",
89
89
  "linkifyjs": "^4.1.1",
90
90
  "lodash": "^4.17.21",
91
- "markdown-to-jsx": "^7.5.0",
91
+ "markdown-to-jsx": "7.7.3",
92
92
  "react": "^18.2.0",
93
93
  "react-color": "^2.19.3",
94
94
  "react-cookie": "^4.1.1",
@@ -135,7 +135,8 @@
135
135
  }
136
136
  }
137
137
 
138
- &__group-initials {
138
+ &__group-initials,
139
+ &__group-event-initials {
139
140
  display: flex;
140
141
  align-items: center;
141
142
  justify-content: center;
@@ -149,10 +150,18 @@
149
150
  color: get-color(black-coral-6);
150
151
  position: absolute;
151
152
  right: 0;
153
+ }
154
+
155
+ &__group-initials {
152
156
  top: 0;
153
157
  }
154
158
 
155
- &__group-name {
159
+ &__group-event-initials {
160
+ bottom: 23px;
161
+ }
162
+
163
+ &__group-name,
164
+ &__group-event-name {
156
165
  font-size: $veera-font-size-100;
157
166
  line-height: $veera-line-height-500;
158
167
  font-weight: $veera-font-weight-delta;
@@ -163,6 +172,10 @@
163
172
  padding-top: 7px;
164
173
  }
165
174
 
175
+ &__group-event-name {
176
+ padding-bottom: 4px;
177
+ }
178
+
166
179
  &__messages {
167
180
  display: flex;
168
181
  flex-direction: column;
@@ -222,4 +235,4 @@
222
235
  font-size: 14px;
223
236
  color: get-color(black-coral-6);
224
237
  padding-top: 4px;
225
- }
238
+ }
@@ -164,9 +164,47 @@ const HistoricalChat: FC<ChatProps> = ({
164
164
  }, [messageGroups]);
165
165
 
166
166
  const isEvent = (group: GroupedMessage) => {
167
- return (
168
- group.type === "event" || group.name.trim() === "" || (!group.messages[0].content && group.messages[0].event)
169
- );
167
+ return (group.type === "event" || group.name.trim() === "" || group.messages.some((message) => message.event && !message.content));
168
+ };
169
+
170
+ const eventGroup = (group: GroupedMessage) => {
171
+ return group.messages.map((message) => {
172
+ if (message.event && !message.content) {
173
+ return <ChatEvent key={message.id} message={message} />;
174
+ } else {
175
+ return (
176
+ <div key={message.id}>
177
+ <div className="historical-chat__group-event-initials">
178
+ {group.type === "buerokratt" || group.type === "chatbot" ? (
179
+ <BykLogoWhite height={24} />
180
+ ) : (
181
+ <>
182
+ {group.name
183
+ .split(" ")
184
+ .map((n) => n[0])
185
+ .join("")
186
+ .toUpperCase()}
187
+ </>
188
+ )}
189
+ </div>
190
+ <div className="historical-chat__group-event-name">
191
+ {group.name}
192
+ {group.title.length > 0 && <div className="title">{group.title}</div>}
193
+ </div>
194
+ <div className="historical-chat__messages">
195
+ <ChatMessage
196
+ message={message}
197
+ key={`${message.id ?? ""}`}
198
+ toastContext={toastContext}
199
+ onMessageClick={(message) => {
200
+ onMessageClick?.(message);
201
+ }}
202
+ />
203
+ </div>
204
+ </div>
205
+ );
206
+ }
207
+ });
170
208
  };
171
209
 
172
210
  return (
@@ -180,7 +218,7 @@ const HistoricalChat: FC<ChatProps> = ({
180
218
  key={`${group.name}-${index}`}
181
219
  >
182
220
  {isEvent(group) ? (
183
- <ChatEvent message={group.messages[0]} />
221
+ eventGroup(group)
184
222
  ) : (
185
223
  <>
186
224
  <div className="historical-chat__group-initials">