@clikvn/agent-widget-embedded 1.0.26-dev → 1.0.28-dev

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Agent/index.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,KAAK,+CAsBV,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Agent/index.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,KAAK,+CAkBV,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;AAMxE,KAAK,SAAS,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAmF9B,CAAC"}
1
+ {"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;AAgBxE,KAAK,SAAS,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA4G9B,CAAC"}
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
+ declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
+ declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
8
+ declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
+ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
+ inset?: boolean;
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
+ inset?: boolean;
16
+ } & React.RefAttributes<HTMLDivElement>>;
17
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
20
+ inset?: boolean;
21
+ } & React.RefAttributes<HTMLDivElement>>;
22
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
+ declare const DropdownMenuShortcut: {
24
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ };
27
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
28
+ //# sourceMappingURL=DropdownMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/ui/DropdownMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAKvE,QAAA,MAAM,YAAY,mDAA6B,CAAC;AAEhD,QAAA,MAAM,mBAAmB,0HAAgC,CAAC;AAE1D,QAAA,MAAM,iBAAiB,qHAA8B,CAAC;AAEtD,QAAA,MAAM,kBAAkB,yDAA+B,CAAC;AAExD,QAAA,MAAM,eAAe,sDAA4B,CAAC;AAElD,QAAA,MAAM,sBAAsB,0HAAmC,CAAC;AAEhE,QAAA,MAAM,sBAAsB;YAGhB,OAAO;wCAejB,CAAC;AAIH,QAAA,MAAM,sBAAsB,6KAY1B,CAAC;AAIH,QAAA,MAAM,mBAAmB,0KAevB,CAAC;AAGH,QAAA,MAAM,gBAAgB;YAGV,OAAO;wCAYjB,CAAC;AAGH,QAAA,MAAM,wBAAwB,+KAoB5B,CAAC;AAIH,QAAA,MAAM,qBAAqB,4KAmBzB,CAAC;AAGH,QAAA,MAAM,iBAAiB;YAGX,OAAO;wCAYjB,CAAC;AAGH,QAAA,MAAM,qBAAqB,4KASzB,CAAC;AAGH,QAAA,MAAM,oBAAoB;8BAGvB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAOvC,CAAC;AAGF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC"}
@@ -0,0 +1,108 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title></title>
6
+ <script type="module">
7
+ import Agent from 'http://localhost:3000/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
8
+ Agent.initWidget({
9
+ apiHost: 'http://localhost:8085/chatbot',
10
+ agentId: '6d02b23f-465f-44ec-8766-27a82890a9b8',
11
+ theme: {
12
+ input: {
13
+ placeholder: 'Tin nhắn...',
14
+ },
15
+ overview: {
16
+ title: 'Van Mieu, Quoc Tu Giam',
17
+ description:
18
+ 'Your personal AI tutor by Khan Academy! Im Khanmigo Lite - here to help you with math, science, and humanities and questions.',
19
+ },
20
+ header: {
21
+ title: 'tung test',
22
+ },
23
+ language: {
24
+ code: 'global',
25
+ options: [
26
+ {
27
+ name: 'en',
28
+ code: 'global',
29
+ },
30
+ {
31
+ name: 'vi',
32
+ code: 'vi',
33
+ },
34
+ {
35
+ name: 'us',
36
+ code: 'en',
37
+ },
38
+ {
39
+ name: 'jp',
40
+ code: 'jp',
41
+ },
42
+ {
43
+ name: 'kr',
44
+ code: 'kr',
45
+ },
46
+ {
47
+ name: 'cn',
48
+ code: 'cn',
49
+ },
50
+ {
51
+ name: 'th',
52
+ code: 'th',
53
+ },
54
+ {
55
+ name: 'tw',
56
+ code: 'tw',
57
+ },
58
+ {
59
+ name: 'sg',
60
+ code: 'sg',
61
+ },
62
+ {
63
+ name: 'my',
64
+ code: 'my',
65
+ },
66
+ {
67
+ name: 'kh',
68
+ code: 'kh',
69
+ },
70
+ {
71
+ name: 'au',
72
+ code: 'au',
73
+ },
74
+ ],
75
+ },
76
+ },
77
+ overrideConfig: {
78
+ // chatId: '14342fe3-8991-4a67-afea-b1c4266da82b',
79
+ chatId: 'f547e5e3-363f-425c-adc1-7f618330d551',
80
+ overrideConfig: {
81
+ vars: {
82
+ POI_CODE: 'MLI_VKLVVAJEFHLH',
83
+ LANGUAGE: 'US',
84
+ },
85
+ },
86
+ // suggestedActions: [
87
+ // {
88
+ // title: 'How are you?',
89
+ // label: 'are you?',
90
+ // action: 'How are you?'
91
+ // }
92
+ // ]
93
+ },
94
+ });
95
+ </script>
96
+ <style>
97
+ .chatbox {
98
+ width: 100%;
99
+ height: 100vh;
100
+ }
101
+ </style>
102
+ </head>
103
+ <body>
104
+ <div class="chatbox">
105
+ <clik-agent-widget></clik-agent-widget>
106
+ </div>
107
+ </body>
108
+ </html>
package/dist/index.html CHANGED
@@ -1,11 +1,12 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
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>
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>
7
8
  <script type="module">
8
- import Agent from 'http://localhost:51747/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
9
+ import Agent from 'https://27cc5f0167f9.ngrok-free.app/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
9
10
  Agent.initWidget({
10
11
  apiHost: 'https://ci-api.clik.vn/chatbot',
11
12
  agentId: 'fe4cf6a9-fa43-4986-bc6f-df67092568c6',
@@ -17,55 +18,27 @@
17
18
  TOUR_CODE: 'TOUR_K9EK76KTX7K4',
18
19
  LANGUAGE: 'VN',
19
20
  CLIK_GRAPHQL_API: 'https://api.clik.vn/graphql',
20
- CLIK_VIRTUALTOUR_API: 'https://api.clik.vn/vt360'
21
- }
22
- }
21
+ CLIK_VIRTUALTOUR_API: 'https://api.clik.vn/vt360',
22
+ },
23
+ },
23
24
  },
24
25
  listeners: {
25
26
  ON_LINK_CLICK: console.log,
26
- ON_CLICK: (arg) => {
27
- console.log('ON_CLICK', arg);
28
- },
29
- 'ON_START_RECORDING': () => {
30
- console.log('ON_START_RECORDING');
31
- },
32
- 'ON_CANCEL_RECORDING': () => {
33
- console.log('ON_CANCEL_RECORDING');
34
- },
35
- 'ON_FINISHED_RECORDING': () => {
36
- console.log('ON_FINISHED_RECORDING');
37
- },
38
- 'ON_SUBMIT_MESSAGE': () => {
39
- console.log('ON_SUBMIT_MESSAGE');
40
- },
41
- 'ON_FINISHED_SUBMITTING_MESSAGE': () => {
42
- console.log('ON_FINISHED_SUBMITTING_MESSAGE');
43
- },
44
- 'ON_PLAY_AUDIO': () => {
45
- console.log('ON_PLAY_AUDIO');
46
- },
47
- 'ON_PAUSE_AUDIO': () => {
48
- console.log('ON_PAUSE_AUDIO');
49
- },
50
- 'ON_ENDED_AUDIO': () => {
51
- console.log('ON_ENDED_AUDIO');
52
- }
53
27
  },
54
28
  theme: {
55
- modeButtonChat: true,
56
29
  simplified: true,
57
30
  autoCloseAudioPlayer: true,
58
31
  hideAudioMetadata: true,
59
- noAutoplayMessage: true
32
+ modeButtonChat: true,
33
+ gapInput: 30,
60
34
  },
61
35
  onLoaded: (tool) => {
62
- console.log('Chatbot loaded!!!');
63
36
  window.tool = tool;
64
- }
37
+ },
65
38
  });
66
39
  </script>
67
- </head>
68
- <body style="background-color: #717182">
69
- <clik-agent-widget></clik-agent-widget>
70
- </body>
71
- </html>
40
+ </head>
41
+ <body>
42
+ <clik-agent-widget></clik-agent-widget>
43
+ </body>
44
+ </html>