@buerokratt-ria/common-gui-components 0.0.11 → 0.0.13

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
@@ -4,6 +4,14 @@ All changes to this project will be documented in this file.
4
4
 
5
5
  ## Template [MajorVersion.MediterraneanVersion.MinorVersion] - DD-MM-YYYY
6
6
 
7
+ ## [0.0.13] - 25-04-2025
8
+
9
+ - Adding double scrollbar to history page when size is small.
10
+
11
+ ## [0.0.12] - 22-04-2025
12
+
13
+ - Modified Markdowify Logic to handle the case only the list line ends with : followed by space
14
+
7
15
  ## [0.0.11] - 01-04-2025
8
16
 
9
17
  - Updated preference page loading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
@@ -744,7 +744,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({user, toastContext, o
744
744
  </Track>
745
745
  </Card>
746
746
 
747
- <div className="card-drawer-container">
747
+ <div className="card-drawer-container" style={{ height: 'auto', overflow: 'auto' }}>
748
748
  <div className="card-wrapper">
749
749
  <Card>
750
750
  <DataTable
@@ -41,6 +41,8 @@ const LinkPreview: React.FC<{
41
41
  );
42
42
  };
43
43
 
44
+ const hasSpecialFormat = (m: string) => m.includes("\n\n") && m.indexOf(".") > 0 && m.indexOf(":") > m.indexOf(".");
45
+
44
46
  const Markdownify: React.FC<MarkdownifyProps> = ({ message, sanitizeLinks = false }) => (
45
47
  <div className={"reset"}>
46
48
  <Markdown
@@ -58,10 +60,8 @@ const Markdownify: React.FC<MarkdownifyProps> = ({ message, sanitizeLinks = fals
58
60
  }}
59
61
  >
60
62
  {message
61
- ?.replace(/&#x([0-9A-Fa-f]+);/g, (_, hex) => {
62
- return String.fromCharCode(parseInt(hex, 16));
63
- })
64
- .replace(/(?<=\n)\d+\.\s/g, "\n\n$&") ?? ""}
63
+ ?.replace(/&#x([0-9A-Fa-f]+);/g, (_, hex) => String.fromCharCode(parseInt(hex, 16)))
64
+ ?.replace(/(?<=\n)\d+\.\s/g, hasSpecialFormat(message) ? "\n\n$&" : "$&") ?? ""}
65
65
  </Markdown>
66
66
  </div>
67
67
  );