@clikvn/agent-widget-embedded 0.0.20-dev → 0.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>
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>
@@ -1,9 +1,15 @@
1
1
  import { ChatMessageType } from '../../types/flowise.type';
2
- declare const AudioPlayer: ({ message, chatId, autogen, autoplay, }: {
2
+ declare const AudioPlayer: ({ message, chatId, autogen, autoplay, playingAudio, audioDisabled, onFinishGeneratingAudio, onGenerateAudio, onPlayAudio, onEndAudio, }: {
3
3
  message: ChatMessageType;
4
4
  chatId?: string;
5
5
  autogen?: boolean;
6
6
  autoplay?: boolean;
7
+ playingAudio?: boolean;
8
+ onPlayAudio?: (messageId: string | null) => void;
9
+ onEndAudio?: () => void;
10
+ audioDisabled?: boolean;
11
+ onGenerateAudio?: () => void;
12
+ onFinishGeneratingAudio?: () => void;
7
13
  }) => import("react/jsx-runtime").JSX.Element;
8
14
  export default AudioPlayer;
9
15
  //# sourceMappingURL=AudioPlayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/AudioPlayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,QAAA,MAAM,WAAW,4CAKd;IACD,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,4CA+EA,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/AudioPlayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,QAAA,MAAM,WAAW,4IAWd;IACD,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;CACtC,4CAoGA,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
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;AASxE,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,CA2E9B,CAAC"}
1
+ {"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;AASxE,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,CAmG9B,CAAC"}
@@ -7,6 +7,12 @@ type PropsType = {
7
7
  isLoading: boolean;
8
8
  bot: BotType | null;
9
9
  enableTTS?: boolean;
10
+ playingAudio?: boolean;
11
+ onPlayAudio?: (messageId: string | null) => void;
12
+ onEndAudio?: () => void;
13
+ audioDisabled?: boolean;
14
+ onGenerateAudio?: () => void;
15
+ onFinishGeneratingAudio?: () => void;
10
16
  };
11
17
  export declare const PreviewMessage: FC<PropsType>;
12
18
  export declare const ThinkingMessage: ({ bot }: {
@@ -1 +1 @@
1
- {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Message.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAIpC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,E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,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,4CAyC/D,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { type RefObject } from 'react';
2
2
  export declare function useScrollToBottom<T extends HTMLElement>(): [
3
3
  RefObject<T>,
4
- RefObject<T>
4
+ RefObject<T>,
5
+ (bool: boolean) => void
5
6
  ];
6
7
  //# sourceMappingURL=useScrollToBottom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useScrollToBottom.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollToBottom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,KAAK;IAC1D,SAAS,CAAC,CAAC,CAAC;IACZ,SAAS,CAAC,CAAC,CAAC;CACb,CAyBA"}
1
+ {"version":3,"file":"useScrollToBottom.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollToBottom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,KAAK;IAC1D,SAAS,CAAC,CAAC,CAAC;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;CACxB,CAgCA"}
package/dist/index.html CHANGED
@@ -1,55 +1,22 @@
1
+ <!-- public/index.html -->
1
2
  <!doctype html>
2
3
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1">
5
7
  <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
- },
24
- overrideConfig: {
25
- // chatId: '14342fe3-8991-4a67-afea-b1c4266da82b',
26
- chatId: 'f547e5e3-363f-425c-adc1-7f618330d551',
27
- overrideConfig: {
28
- vars: {
29
- POI_CODE: 'MLI_VKLVVAJEFHLH',
30
- LANGUAGE: 'VN',
31
- },
32
- },
33
- // suggestedActions: [
34
- // {
35
- // title: 'How are you?',
36
- // label: 'are you?',
37
- // action: 'How are you?'
38
- // }
39
- // ]
40
- },
41
- });
42
- </script>
43
- <style>
44
- .chatbox {
45
- width: 100%;
46
- height: 100vh;
47
- }
48
- </style>
49
- </head>
50
- <body>
51
- <div class="chatbox">
52
- <clik-agent-widget></clik-agent-widget>
53
- </div>
54
- </body>
55
- </html>
8
+ </head>
9
+ <body>
10
+ <clik-agent-widget></clik-agent-widget>
11
+ <script type="module">
12
+ import Agent from 'https://bfb4-113-22-36-199.ngrok-free.app/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
13
+ Agent.initWidget({
14
+ apiHost: 'https://ci-api.clik.vn/chatbot',
15
+ agentId: '6d02b23f-465f-44ec-8766-27a82890a9b8',
16
+ overrideConfig: {
17
+ chatId: '76d283cb-90ee-4fcd-a490-041184935b4a',
18
+ },
19
+ });
20
+ </script>
21
+ </body>
22
+ </html>