@clikvn/agent-widget-embedded 1.2.0-dev-01 → 1.2.0-hotfix-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.
package/dist/index.html CHANGED
@@ -1,68 +1,65 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <!-- <meta charset="UTF-8" /> -->
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Clik Agent Widget - Dev</title>
8
- <script type="module">
9
- import Agent from 'http://localhost:3000/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
10
- Agent.initWidget({
11
- apiHost: 'https://ci-api.clik.vn/chatbot',
12
- agentId: '0cc79877-2957-46c5-898f-b5d09171361d',
13
- overrideConfig: {
14
- chatId: '5a614d0a-30e1-45b4-b01c-765124658520',
15
- skipSuggestion: true,
16
- overrideConfig: {
17
- vars: {
18
- TOUR_CODE: "TOUR_KUFGDEPDTJA4",
19
- LANGUAGE_CODE: 'VN',
20
- // CLIK_VIRTUALTOUR_API: 'https://api.clik.vn/vt360',
21
- SHOWROOM_CODE: 'SHR_4A7PG3JGKA97',
22
- SCENE_CODE: 'SCENARIO_KZ6HNJD6NHC4',
23
- CATEGORY_CODE: '',
24
- CLIK_GRAPHQL_API: 'https://ci-api.clik.vn/graphql',
25
- USER_LOCALE: 'EN',
26
- USER_IP: '192.168.1.11',
27
- PRODUCT_CODE: '',
28
- // USER_ID: 'c7cda5d9-7c6b-452f-b4a2-43a1e273bfaf',
29
- BRAND_ALIAS: 'an-cuong',
30
- },
31
- },
32
- },
33
- listeners: {
34
- ON_LINK_CLICK: console.log,
35
- ON_TOGGLE_FAVORITE: (productCode) => console.log('productCode', productCode),
36
- },
37
- theme: {
38
- // simplified: true,
39
- autoCloseAudioPlayer: true,
40
- hideAudioMetadata: true,
41
- modeButtonChat: true,
42
- gapInput: 30,
43
- // bookMeetingForm: {
44
- // labelDate: 'Booking Date',
45
- // labelTime: 'Booking Time',
46
- // labelDuration: 'Booking Duration',
47
- // labelChannel: 'Booking Channel',
48
- // labelHost: 'Host',
49
- // },
50
- },
51
- onLoaded: (tool) => {
52
- window.tool = tool;
53
- },
54
- });
55
- </script>
56
- </head>
57
- <body>
58
- <div style="width: 100vw; height: 100vh">
59
- <clik-agent-widget></clik-agent-widget>
60
- </div>
61
- </body>
62
- <style>
63
- html,
64
- body {
65
- font-size: 14px;
66
- }
67
- </style>
68
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Title</title>
7
+ <script type="module">
8
+ import Agent from 'http://localhost:49651/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
9
+ Agent.initWidget({
10
+ elementName: 'clik-agent-simplified-widget',
11
+ apiHost: 'https://ci-api.clik.vn/chatbot',
12
+ agentId: 'fe4cf6a9-fa43-4986-bc6f-df67092568c6',
13
+ overrideConfig: {
14
+ chatId: 'f6a855d2-7edc-4fb8-9dd3-74204aa1e2a2',
15
+ skipSuggestion: true,
16
+ overrideConfig: {
17
+ vars: {
18
+ TOUR_CODE: 'TOUR_K9EK76KTX7K4',
19
+ LANGUAGE: 'VN',
20
+ CLIK_GRAPHQL_API: 'https://api.clik.vn/graphql',
21
+ CLIK_VIRTUALTOUR_API: 'https://api.clik.vn/vt360'
22
+ }
23
+ }
24
+ },
25
+ listeners: {
26
+ ON_LINK_CLICK: console.log,
27
+ ON_CLICK: (arg) => {
28
+ console.log('ON_CLICK', arg);
29
+ },
30
+ 'ON_START_RECORDING': () => {
31
+ console.log('ON_START_RECORDING');
32
+ },
33
+ 'ON_CANCEL_RECORDING': () => {
34
+ console.log('ON_CANCEL_RECORDING');
35
+ },
36
+ 'ON_FINISHED_RECORDING': () => {
37
+ console.log('ON_FINISHED_RECORDING');
38
+ },
39
+ 'ON_SUBMIT_MESSAGE': () => {
40
+ console.log('ON_SUBMIT_MESSAGE');
41
+ },
42
+ 'ON_FINISHED_SUBMITTING_MESSAGE': () => {
43
+ console.log('ON_FINISHED_SUBMITTING_MESSAGE');
44
+ },
45
+ 'ON_PLAY_AUDIO': () => {
46
+ console.log('ON_PLAY_AUDIO');
47
+ },
48
+ 'ON_PAUSE_AUDIO': () => {
49
+ console.log('ON_PAUSE_AUDIO');
50
+ },
51
+ 'ON_ENDED_AUDIO': () => {
52
+ console.log('ON_ENDED_AUDIO');
53
+ }
54
+ },
55
+ onLoaded: (tool) => {
56
+ console.log('Chatbot loaded!!!');
57
+ window.tool = tool;
58
+ }
59
+ });
60
+ </script>
61
+ </head>
62
+ <body style="background-color: #717182">
63
+ <clik-agent-simplified-widget></clik-agent-simplified-widget>
64
+ </body>
65
+ </html>
@@ -0,0 +1,11 @@
1
+ {
2
+ "headers": [
3
+ {
4
+ "source" : "**/*.@(jpg|jpeg|gif|png|js)",
5
+ "headers" : [{
6
+ "key" : "Access-Control-Allow-Origin",
7
+ "value" : "*"
8
+ }]
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,53 @@
1
+ import { EVENT_TYPE } from './models';
2
+ import { AgentWidgetType } from './register';
3
+ import { SuggestionType } from './types/common.type';
4
+ type ToolType = {
5
+ setInput: (text?: string) => void;
6
+ };
7
+ export declare class AgentWidgetComponent extends HTMLElement {
8
+ apiHost?: string;
9
+ agentId?: string;
10
+ voice?: {
11
+ enable?: boolean;
12
+ livekitUrl: string;
13
+ };
14
+ overrideConfig?: {
15
+ chatId?: string | undefined;
16
+ overrideConfig?: Record<string, unknown>;
17
+ suggestedActions?: SuggestionType[];
18
+ skipSuggestion?: boolean;
19
+ } & Record<string, unknown>;
20
+ theme?: {
21
+ simplified?: boolean;
22
+ welcomeMessage?: string;
23
+ autoCloseAudioPlayer?: boolean;
24
+ hideAudioMetadata?: boolean;
25
+ avatar?: string;
26
+ input?: {
27
+ placeholder?: string;
28
+ recordingPlaceholder?: string;
29
+ transcribingPlaceholder?: string;
30
+ };
31
+ overview?: {
32
+ title: string;
33
+ description?: string;
34
+ };
35
+ buttons?: {
36
+ textBtnSpeak?: string;
37
+ textBtnTalk?: string;
38
+ textBtnSubmit?: string;
39
+ };
40
+ dropdown?: {
41
+ zIndex?: number;
42
+ };
43
+ } & Record<string, unknown>;
44
+ listeners?: Record<EVENT_TYPE, (props: any) => void>;
45
+ onLoaded?: (tool: ToolType) => void;
46
+ constructor();
47
+ updateAttributes(attributes: AgentWidgetType): void;
48
+ connectedCallback(): void;
49
+ render(): void;
50
+ }
51
+ export declare const registerWebComponents: (name?: string) => void;
52
+ export {};
53
+ //# sourceMappingURL=simplifiedRegister.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simplifiedRegister.d.ts","sourceRoot":"","sources":["../src/simplifiedRegister.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,KAAK,QAAQ,GAAG;IACd,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,cAAc,CAAC,EAAE;QACf,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACzC,gBAAgB,CAAC,EAAE,cAAc,EAAE,CAAC;QACpC,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,C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