@bcc-code/vue-bcc-chat-ui 2.1.2 → 2.2.0

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
@@ -2,7 +2,7 @@
2
2
  "name": "@bcc-code/vue-bcc-chat-ui",
3
3
  "author": "bcc-code",
4
4
  "license": "Apache-2.0",
5
- "version": "2.1.2",
5
+ "version": "2.2.0",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "files": [
@@ -38,7 +38,7 @@
38
38
  "@cometchat/uikit-resources": "^4.2.2",
39
39
  "@cometchat/uikit-shared": "^4.2.2",
40
40
  "jwt-decode": "^4.0.0",
41
- "markdown-it": "npm:@esm-bundle/markdown-it@^13.0.1"
41
+ "markdown-it": "^14.1.0"
42
42
  },
43
43
  "scripts": {
44
44
  "dev": "vite",
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import markdownit from 'markdown-it/esm';
2
+ import MarkdownIt from 'markdown-it'
3
3
 
4
4
  defineProps<{
5
5
  text: string
@@ -22,7 +22,8 @@ function toMarkdownHtml(str: string) {
22
22
 
23
23
  // Replacing URLs in the string with Markdown links
24
24
  const outStr = str.replace(urlRegex, formatUrlToMarkdown);
25
- const md = new markdownit({
25
+ const md = new MarkdownIt({
26
+ breaks: true,
26
27
  typographer: true,
27
28
  });
28
29
 
@@ -48,6 +49,7 @@ function toMarkdownHtml(str: string) {
48
49
  word-break: break-word;
49
50
  text-align: left;
50
51
  white-space: pre-line;
52
+ margin: 8px 0;
51
53
  }
52
54
 
53
55
  p:first-child {
@@ -57,6 +59,23 @@ function toMarkdownHtml(str: string) {
57
59
  margin-bottom: 0;
58
60
  }
59
61
 
62
+ h1 {
63
+ font-size: 1.6em;
64
+ font-weight: 800;
65
+ }
66
+ h2 {
67
+ font-size: 1.4em;
68
+ font-weight: 700;
69
+ }
70
+ h3 {
71
+ font-size: 1.2em;
72
+ font-weight: 600;
73
+ }
74
+ h4 {
75
+ font-size: 1em;
76
+ font-weight: 500;
77
+ }
78
+
60
79
  a {
61
80
  color: var(--cc__link-color);
62
81
  text-decoration: underline;
@@ -65,6 +84,13 @@ function toMarkdownHtml(str: string) {
65
84
 
66
85
  ul {
67
86
  padding-left: 16px;
87
+ list-style: disc;
88
+ margin: 8px 0;
89
+ }
90
+ ol {
91
+ padding-left: 16px;
92
+ list-style: decimal;
93
+ margin: 8px 0;
68
94
  }
69
95
  }
70
96
  </style>