@clikvn/agent-widget-embedded 1.0.21-dev → 1.0.22-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.
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default copy" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,36 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="AngularAmbiguousComponentTag" enabled="false" level="ERROR" enabled_by_default="false" />
5
+ <inspection_tool class="AngularCliAddDependency" enabled="false" level="WARNING" enabled_by_default="false" />
6
+ <inspection_tool class="AngularInaccessibleComponentMemberInAotMode" enabled="false" level="WARNING" enabled_by_default="false" />
7
+ <inspection_tool class="AngularIncorrectTemplateDefinition" enabled="false" level="ERROR" enabled_by_default="false" />
8
+ <inspection_tool class="AngularInsecureBindingToEvent" enabled="false" level="WARNING" enabled_by_default="false" />
9
+ <inspection_tool class="AngularInvalidAnimationTriggerAssignment" enabled="false" level="ERROR" enabled_by_default="false" />
10
+ <inspection_tool class="AngularInvalidEntryComponent" enabled="false" level="ERROR" enabled_by_default="false" />
11
+ <inspection_tool class="AngularInvalidI18nAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
12
+ <inspection_tool class="AngularInvalidImportedOrDeclaredSymbol" enabled="false" level="ERROR" enabled_by_default="false" />
13
+ <inspection_tool class="AngularInvalidSelector" enabled="false" level="ERROR" enabled_by_default="false" />
14
+ <inspection_tool class="AngularInvalidTemplateReferenceVariable" enabled="false" level="ERROR" enabled_by_default="false" />
15
+ <inspection_tool class="AngularMissingEventHandler" enabled="false" level="ERROR" enabled_by_default="false" />
16
+ <inspection_tool class="AngularMissingOrInvalidDeclarationInModule" enabled="false" level="ERROR" enabled_by_default="false" />
17
+ <inspection_tool class="AngularMissingRequiredDirectiveInputBinding" enabled="false" level="ERROR" enabled_by_default="false" />
18
+ <inspection_tool class="AngularMultipleStructuralDirectives" enabled="false" level="ERROR" enabled_by_default="false" />
19
+ <inspection_tool class="AngularNgOptimizedImage" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
20
+ <inspection_tool class="AngularNonEmptyNgContent" enabled="false" level="ERROR" enabled_by_default="false" />
21
+ <inspection_tool class="AngularRecursiveModuleImportExport" enabled="false" level="ERROR" enabled_by_default="false" />
22
+ <inspection_tool class="AngularUndefinedBinding" enabled="false" level="ERROR" enabled_by_default="false" />
23
+ <inspection_tool class="AngularUndefinedModuleExport" enabled="false" level="ERROR" enabled_by_default="false" />
24
+ <inspection_tool class="AngularUndefinedTag" enabled="false" level="ERROR" enabled_by_default="false" />
25
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
26
+ <inspection_tool class="MicronautDataMethodInconsistency" enabled="false" level="ERROR" enabled_by_default="false" />
27
+ <inspection_tool class="MicronautDataRepositoryMethodParameters" enabled="false" level="WARNING" enabled_by_default="false" />
28
+ <inspection_tool class="MicronautDataRepositoryMethodReturnType" enabled="false" level="WARNING" enabled_by_default="false" />
29
+ <inspection_tool class="MnCacheAnnotationParameters" enabled="false" level="ERROR" enabled_by_default="false" />
30
+ <inspection_tool class="MnInjectionPoints" enabled="false" level="WARNING" enabled_by_default="false" />
31
+ <inspection_tool class="MnPropertiesConfig" enabled="false" level="WARNING" enabled_by_default="false" />
32
+ <inspection_tool class="MnUnresolvedPathVariable" enabled="false" level="WARNING" enabled_by_default="false" />
33
+ <inspection_tool class="MnYamlConfig" enabled="false" level="WARNING" enabled_by_default="false" />
34
+ <inspection_tool class="TsLint" enabled="true" level="WARNING" enabled_by_default="true" />
35
+ </profile>
36
+ </component>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="EslintConfiguration">
4
+ <custom-configuration-file used="true" path="$PROJECT_DIR$/.eslintrc" />
5
+ <option name="fix-on-save" value="true" />
6
+ </component>
7
+ </project>
package/.idea/misc.xml ADDED
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ComposerSettings">
4
+ <execution />
5
+ </component>
6
+ <component name="ProjectRootManager">
7
+ <output url="file://$PROJECT_DIR$/out" />
8
+ </component>
9
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/clik-ai-chatbot-embedded.iml" filepath="$PROJECT_DIR$/.idea/clik-ai-chatbot-embedded.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PrettierConfiguration">
4
+ <option name="myConfigurationMode" value="MANUAL" />
5
+ <option name="myRunOnSave" value="true" />
6
+ <option name="myRunOnReformat" value="true" />
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,9 @@
1
+ import { ChatMessageType } from '../../types/flowise.type';
2
+ declare const AudioPlayerSimple: ({ message, chatId, autoplay, onClose, }: {
3
+ message: ChatMessageType;
4
+ chatId?: string;
5
+ autoplay?: boolean;
6
+ onClose: () => void;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export default AudioPlayerSimple;
9
+ //# sourceMappingURL=AudioPlayerSimple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioPlayerSimple.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/AudioPlayerSimple.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,QAAA,MAAM,iBAAiB,4CAKpB;IACD,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,4CAoRA,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { FC } from 'react';
2
+ import { BotType } from '../../types/bot.type';
3
+ import { ChatMessageType, IFileUpload } from '../../types/flowise.type';
4
+ type PropsType = {
5
+ input: string;
6
+ setInput: (value: string) => void;
7
+ isLoading: boolean;
8
+ stop: () => void;
9
+ message?: ChatMessageType;
10
+ chatId: string;
11
+ handleSubmit: (event?: {
12
+ preventDefault?: () => void;
13
+ }, files?: IFileUpload[]) => void;
14
+ className?: string;
15
+ bot: BotType | null;
16
+ apiHost: string;
17
+ setEnableTTS: (value: boolean) => void;
18
+ enableTTS: boolean;
19
+ };
20
+ export declare const MultimodalInputSimple: FC<PropsType>;
21
+ export {};
22
+ //# sourceMappingURL=MultimodalInputSimple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultimodalInputSimple.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/MultimodalInputSimple.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EAKH,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAgBxE,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CACZ,KAAK,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,EACvC,KAAK,CAAC,EAAE,WAAW,EAAE,KAClB,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,SAAS,CA2V/C,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ interface SidebarProps {
3
+ isOpen: boolean;
4
+ onToggle: () => void;
5
+ }
6
+ export declare const Sidebar: FC<SidebarProps>;
7
+ export default Sidebar;
8
+ //# sourceMappingURL=Sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAGrC,UAAU,YAAY;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AASD,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAsJpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MultimodalInputSimplified.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/Simplified/MultimodalInputSimplified.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EAKH,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAe3E,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CACZ,KAAK,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,EACvC,KAAK,CAAC,EAAE,WAAW,EAAE,KAClB,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAcF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,SAAS,CAiiBnD,CAAC"}
1
+ {"version":3,"file":"MultimodalInputSimplified.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/Simplified/MultimodalInputSimplified.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,EAAE,EAKH,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAe3E,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CACZ,KAAK,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,EACvC,KAAK,CAAC,EAAE,WAAW,EAAE,KAClB,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAcF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,SAAS,CA6jBnD,CAAC"}
package/dist/index.html CHANGED
@@ -1,10 +1,11 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
6
  <title>Title</title>
6
7
  <script type="module">
7
- import Agent from 'http://localhost:3000/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
8
+ import Agent from 'https://626d1ebdcb1d.ngrok-free.app/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
8
9
  Agent.initWidget({
9
10
  apiHost: 'https://ci-api.clik.vn/chatbot',
10
11
  agentId: 'fe4cf6a9-fa43-4986-bc6f-df67092568c6',
@@ -16,27 +17,55 @@
16
17
  TOUR_CODE: 'TOUR_K9EK76KTX7K4',
17
18
  LANGUAGE: 'VN',
18
19
  CLIK_GRAPHQL_API: 'https://api.clik.vn/graphql',
19
- CLIK_VIRTUALTOUR_API: 'https://api.clik.vn/vt360',
20
- },
21
- },
20
+ CLIK_VIRTUALTOUR_API: 'https://api.clik.vn/vt360'
21
+ }
22
+ }
22
23
  },
23
24
  listeners: {
24
25
  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
+ }
25
53
  },
26
54
  theme: {
55
+ modeButtonChat: true,
27
56
  simplified: true,
28
57
  autoCloseAudioPlayer: true,
29
58
  hideAudioMetadata: true,
30
- modeButtonChat: true,
31
- gapInput: 30,
59
+ noAutoplayMessage: true
32
60
  },
33
61
  onLoaded: (tool) => {
62
+ console.log('Chatbot loaded!!!');
34
63
  window.tool = tool;
35
- },
64
+ }
36
65
  });
37
66
  </script>
38
- </head>
39
- <body>
40
- <clik-agent-widget></clik-agent-widget>
41
- </body>
42
- </html>
67
+ </head>
68
+ <body style="background-color: #717182">
69
+ <clik-agent-widget></clik-agent-widget>
70
+ </body>
71
+ </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
+ }