@tencentcloud/ai-desk-customer-vue 0.1.0 → 0.1.2

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.
@@ -84,6 +84,15 @@ watchEffect(() => {
84
84
  }
85
85
 
86
86
  .text {
87
+ white-space: pre-wrap;
88
+ font-size: 14px;
89
+ text-size-adjust: none;
90
+ font-family: PingFangSC-Regular;
91
+ overflow-wrap: break-word;
92
+ word-break: break-all;
93
+ }
94
+
95
+ .text:lang(en) {
87
96
  white-space: pre-wrap;
88
97
  font-size: 14px;
89
98
  text-size-adjust: none;
@@ -1,6 +1,7 @@
1
1
  .tui-chat-h5 {
2
2
  flex: 1;
3
3
  position: static;
4
+ max-height: 100%;
4
5
 
5
6
  .tui-chat-main {
6
7
  .tui-message-list {
@@ -14,8 +14,7 @@
14
14
  }
15
15
 
16
16
  &-message-input {
17
- height: auto;
18
- padding: 10px 10px 0;
17
+ height: 100px;
19
18
  }
20
19
 
21
20
  &-message-input-toolbar {
@@ -1,7 +1,6 @@
1
1
  .tui-chat-uni {
2
2
  &-message-input {
3
- max-height: 370px;
4
- padding: 10px;
3
+ max-height: 70px;
5
4
  }
6
5
  &-message-input-hide{
7
6
  display: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/ai-desk-customer-vue",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "chat uikit ai-desk-customer",
5
5
  "main": "index",
6
6
  "keywords": [
package/server.ts CHANGED
@@ -44,15 +44,15 @@ export default class TUICustomerServer {
44
44
  }
45
45
  }
46
46
 
47
- static loginCustomerUIKit = (sdkappid:number, userid:string, usersig:string) => {
48
- TUILogin.login({
49
- SDKAppID: sdkappid,
50
- userID:userid,
51
- userSig:usersig,
47
+ static loginCustomerUIKit(SDKAppID:number, userID:string, userSig:string) {
48
+ TUIChatEngine.login({
49
+ SDKAppID,
50
+ userID,
51
+ userSig,
52
52
  useUploadPlugin: true,
53
53
  }).then(() => {
54
54
  console.log("login success");
55
- TUIConversationService.switchConversation('C2C@customer_service_account');
55
+ TUIConversationService.switchConversation('C2C@customer_service_account');
56
56
  })
57
57
  .catch((error) => {
58
58
  console.log(error);
@@ -62,14 +62,14 @@ export default class TUICustomerServer {
62
62
  /**
63
63
  * init
64
64
  */
65
- public static init(sdkappid:number, userid:string, usersig:string) {
65
+ public static init(SDKAppID:number, userID:string, userSig:string) {
66
66
  // Backward compatibility, the new version executes the init operation by default in index.ts
67
67
  if (TUICustomerServer.isInitialized) {
68
68
  return;
69
69
  }
70
70
  TUICustomerServer.isInitialized = true;
71
71
  // Execute call server when native plugin TUICallKit exists
72
- this.loginCustomerUIKit(sdkappid, userid, usersig);
72
+ this.loginCustomerUIKit(SDKAppID, userID, userSig);
73
73
  }
74
74
 
75
75
  // Set customer service number
@@ -117,7 +117,7 @@ export default class TUICustomerServer {
117
117
  if (this.isCustomerConversation(params.conversationID)) {
118
118
  TUIChatService.sendCustomMessage({
119
119
  to: params.conversationID.slice(3),
120
- conversationType: 'C2C',
120
+ conversationType: TUIChatEngine.TYPES.CONV_C2C,
121
121
  payload: {
122
122
  data: JSON.stringify({src: '7', customerServicePlugin: 0}),
123
123
  },
package/logger/index.ts DELETED
@@ -1,12 +0,0 @@
1
- import Logger from './main';
2
-
3
- const logger = new Logger({
4
- url: `https://otlp.tccc.qcloud.com/v1/logs`,
5
- id: 'tccc',
6
- name: 'webCustomerUIKit',
7
- attributes: {
8
- origin: 'webCustomerUIKit',
9
- },
10
- });
11
-
12
- export default logger;
package/logger/main.ts DELETED
@@ -1,120 +0,0 @@
1
- import * as logsAPI from '@opentelemetry/api-logs';
2
- import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
3
- import { LoggerProvider, BatchLogRecordProcessor } from '@opentelemetry/sdk-logs';
4
- import { Resource } from '@opentelemetry/resources';
5
- type LogBody =
6
- | string
7
- | {
8
- msg: string;
9
- attributes?: logsAPI.LogAttributes;
10
- };
11
-
12
- const getLogBody = (args: LogBody, defaultAttributes: logsAPI.LogAttributes) => ({
13
- body: typeof args === 'string' ? args : args.msg,
14
- attributes:
15
- typeof args === 'string'
16
- ? defaultAttributes
17
- : {
18
- ...defaultAttributes,
19
- ...args.attributes,
20
- },
21
- });
22
-
23
- export default class Logger {
24
- logger: logsAPI.Logger;
25
- attributes: logsAPI.LogAttributes;
26
- logLevel: logsAPI.SeverityNumber;
27
- name: string;
28
- constructor({
29
- name,
30
- id,
31
- url,
32
- version = 'latest',
33
- attributes,
34
- logLevel = logsAPI.SeverityNumber.ERROR2,
35
- }: {
36
- name: string;
37
- id: string;
38
- url: URL | string;
39
- version?: string;
40
- attributes: logsAPI.LogAttributes;
41
- logLevel?: logsAPI.SeverityNumber;
42
- }) {
43
- this.name = name;
44
- this.logLevel = logLevel;
45
- const loggerProvider = new LoggerProvider({
46
- resource: new Resource({
47
- 'service.name': name,
48
- 'tps.tenant.id': id,
49
- }),
50
- });
51
- loggerProvider.addLogRecordProcessor(
52
- new BatchLogRecordProcessor(
53
- new OTLPLogExporter({
54
- url: url.toString(),
55
- headers: {
56
- 'X-Tps-TenantID': id,
57
- },
58
- }),
59
- ),
60
- );
61
- const logger = loggerProvider.getLogger(name, version);
62
- this.attributes = attributes;
63
- this.logger = logger;
64
- }
65
-
66
- debug = (args: LogBody) => {
67
- if (this.logLevel <= logsAPI.SeverityNumber.DEBUG) {
68
- console.debug(`[${this.name}]`, args);
69
- }
70
- this.logger.emit({
71
- severityNumber: logsAPI.SeverityNumber.DEBUG,
72
- severityText: 'debug',
73
- ...getLogBody(args, this.attributes),
74
- });
75
- };
76
-
77
- info(args: LogBody) {
78
- if (this.logLevel <= logsAPI.SeverityNumber.INFO) {
79
- console.info(`[${this.name}]`, args);
80
- }
81
-
82
- return this.logger.emit({
83
- severityNumber: logsAPI.SeverityNumber.INFO,
84
- severityText: 'info',
85
- ...getLogBody(args, this.attributes),
86
- });
87
- }
88
-
89
- warn = (args: LogBody) => {
90
- if (this.logLevel <= logsAPI.SeverityNumber.WARN) {
91
- console.warn(`[${this.name}]`, args);
92
- }
93
- this.logger.emit({
94
- severityNumber: logsAPI.SeverityNumber.WARN,
95
- severityText: 'warn',
96
- ...getLogBody(args, this.attributes),
97
- });
98
- };
99
-
100
- error = (args: LogBody) => {
101
- if (this.logLevel <= logsAPI.SeverityNumber.ERROR) {
102
- console.error(`[${this.name}]`, args);
103
- }
104
- this.logger.emit({
105
- severityNumber: logsAPI.SeverityNumber.ERROR,
106
- severityText: 'error',
107
- ...getLogBody(args, this.attributes),
108
- });
109
- };
110
-
111
- setAttribute = (key: string, value: string | number) => {
112
- Object.assign(this.attributes, {
113
- [key]: value,
114
- });
115
- };
116
-
117
- setAttributes = (attributes: logsAPI.LogAttributes) => {
118
- Object.assign(this.attributes, attributes);
119
- };
120
- }