@tencentcloud/ai-desk-customer-vue 0.2.0 → 0.2.1

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.
@@ -13,7 +13,7 @@ import vue from '../../../../../../adapter-vue';
13
13
  import { customerServicePayloadType } from '../../../../../../interface';
14
14
  import { parseMarkdown } from './marked'
15
15
 
16
- const { ref, watchEffect, onBeforeUnmount, onMounted } = vue;
16
+ const { ref, watchEffect, onMounted } = vue;
17
17
 
18
18
  interface Props {
19
19
  payload: customerServicePayloadType;
@@ -27,14 +27,12 @@ export default {
27
27
  },
28
28
  },
29
29
  setup(props: Props) {
30
- const content = ref<string>('');
31
30
  const displayedContent = ref<string>('');
32
31
  const isFinished = ref<boolean>(false);
33
32
  let currentIndex = 0;
34
33
 
35
34
  onMounted(() => {
36
- content.value = props?.payload?.chunks?.join('') ?? '';
37
- displayedContent.value = parseMarkdown(content.value);
35
+ displayedContent.value = parseMarkdown(props?.payload?.chunks?.join('') ?? '');
38
36
  currentIndex = displayedContent.value.length;
39
37
  });
40
38
 
@@ -43,6 +41,7 @@ export default {
43
41
  const parsedContent = parseMarkdown(newContent);
44
42
  if (parsedContent.length > currentIndex) {
45
43
  displayedContent.value = parsedContent;
44
+ currentIndex = parsedContent.length;
46
45
  }
47
46
  });
48
47
 
@@ -51,7 +50,6 @@ export default {
51
50
  });
52
51
 
53
52
  return {
54
- content,
55
53
  props,
56
54
  isFinished,
57
55
  displayedContent,
@@ -69,21 +67,15 @@ export default {
69
67
  .blinking-cursor {
70
68
  display: inline-block;
71
69
  width: 1px;
72
- height: 16px;
70
+ height: 1em;
73
71
  background-color: black;
74
72
  animation: blink 1s step-end infinite;
75
73
  vertical-align: sub;
76
74
  }
77
75
 
78
76
  @keyframes blink {
79
- 0%,
80
- 100% {
81
- background-color: transparent;
82
- }
83
-
84
- 50% {
85
- background-color: black;
86
- }
77
+ 0%, 100% { opacity: 1; }
78
+ 50% { opacity: 0; }
87
79
  }
88
80
  }
89
81
  </style>
@@ -124,6 +124,7 @@
124
124
  justify-content: flex-start;
125
125
  margin: 0;
126
126
  padding: 0;
127
+ font-family: PingFangSC-Regular;
127
128
 
128
129
  .message-marked_code-container {
129
130
  display: flex;
@@ -176,3 +177,7 @@
176
177
  cursor: pointer;
177
178
  }
178
179
  }
180
+
181
+ .message-marked >*:last-child {
182
+ margin-bottom: 0;
183
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/ai-desk-customer-vue",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "chat uikit ai-desk-customer",
5
5
  "main": "index",
6
6
  "keywords": [