@clikvn/agent-widget-embedded 1.0.33-dev → 1.0.35-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,12 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(yarn lint:fix)",
5
+ "Bash(yarn build)",
6
+ "Bash(yarn lint src/components/Chat/Message.tsx src/utils/toolUtils.ts src/utils/messageUtils.ts)",
7
+ "Bash(yarn lint src/components/Chat/ProductList.tsx)"
8
+ ],
9
+ "deny": [],
10
+ "ask": []
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,59 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <HTMLCodeStyleSettings>
4
+ <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
+ </HTMLCodeStyleSettings>
6
+ <JSCodeStyleSettings version="0">
7
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
8
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
9
+ <option name="USE_DOUBLE_QUOTES" value="false" />
10
+ <option name="FORCE_QUOTE_STYlE" value="true" />
11
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
12
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
+ </JSCodeStyleSettings>
15
+ <TypeScriptCodeStyleSettings version="0">
16
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
+ <option name="USE_DOUBLE_QUOTES" value="false" />
19
+ <option name="FORCE_QUOTE_STYlE" value="true" />
20
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
21
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
22
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
23
+ </TypeScriptCodeStyleSettings>
24
+ <VueCodeStyleSettings>
25
+ <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
26
+ <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
27
+ </VueCodeStyleSettings>
28
+ <codeStyleSettings language="HTML">
29
+ <option name="SOFT_MARGINS" value="80" />
30
+ <indentOptions>
31
+ <option name="INDENT_SIZE" value="2" />
32
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
33
+ <option name="TAB_SIZE" value="2" />
34
+ </indentOptions>
35
+ </codeStyleSettings>
36
+ <codeStyleSettings language="JavaScript">
37
+ <option name="SOFT_MARGINS" value="80" />
38
+ <indentOptions>
39
+ <option name="INDENT_SIZE" value="2" />
40
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
41
+ <option name="TAB_SIZE" value="2" />
42
+ </indentOptions>
43
+ </codeStyleSettings>
44
+ <codeStyleSettings language="TypeScript">
45
+ <option name="SOFT_MARGINS" value="80" />
46
+ <indentOptions>
47
+ <option name="INDENT_SIZE" value="2" />
48
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
49
+ <option name="TAB_SIZE" value="2" />
50
+ </indentOptions>
51
+ </codeStyleSettings>
52
+ <codeStyleSettings language="Vue">
53
+ <option name="SOFT_MARGINS" value="80" />
54
+ <indentOptions>
55
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
56
+ </indentOptions>
57
+ </codeStyleSettings>
58
+ </code_scheme>
59
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,6 @@
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
+ </component>
6
+ </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,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PrettierConfiguration">
4
+ <option name="myConfigurationMode" value="AUTOMATIC" />
5
+ </component>
6
+ </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="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
package/CLAUDE.md CHANGED
@@ -18,6 +18,7 @@ This is `@clikvn/agent-widget-embedded`, a React-based TypeScript library that c
18
18
  ## Build System
19
19
 
20
20
  The project uses **Rollup** as the primary build tool (not Webpack or Vite). Key configuration:
21
+
21
22
  - Entry point: `src/web.ts` → outputs to `dist/web.js` as ESM module
22
23
  - Custom web component registration system using `customElements.define()`
23
24
  - Supports TypeScript, PostCSS with Tailwind, and React JSX
@@ -26,12 +27,14 @@ The project uses **Rollup** as the primary build tool (not Webpack or Vite). Key
26
27
  ## Architecture
27
28
 
28
29
  ### Core Entry Points
30
+
29
31
  - `src/web.ts` - Main library entry point that exports the widget API
30
32
  - `src/window.ts` - Contains `initWidget()` function and window object injection
31
33
  - `src/register.tsx` - Web component registration and custom element definition
32
34
  - `src/features/AgentWidget/index.tsx` - Main React component with providers
33
35
 
34
36
  ### Component Structure
37
+
35
38
  - **Custom Web Component**: `AgentWidgetComponent` class extends `HTMLElement`
36
39
  - **React Integration**: Uses ReactDOM.render to mount React app inside web component
37
40
  - **Provider Pattern**: Multiple context providers wrap the main Agent component:
@@ -40,6 +43,7 @@ The project uses **Rollup** as the primary build tool (not Webpack or Vite). Key
40
43
  - `AudioMessagePlayerProvider` - Audio message playback functionality
41
44
 
42
45
  ### Key Features
46
+
43
47
  - **Voice Integration**: Built-in audio recording and playback with LiveKit support
44
48
  - **Theming System**: Comprehensive theme configuration for messages, buttons, input placeholders
45
49
  - **Event System**: Custom event listeners using `EVENT_TYPE` enum
@@ -48,11 +52,13 @@ The project uses **Rollup** as the primary build tool (not Webpack or Vite). Key
48
52
  ## Code Conventions
49
53
 
50
54
  ### TypeScript Configuration
55
+
51
56
  - Strict mode enabled with comprehensive type checking
52
57
  - Base configuration in `base.json`, extended by `tsconfig.json`
53
58
  - Target: ES2015, Module: ESNext with React JSX transform
54
59
 
55
60
  ### Code Style (enforced by ESLint + Prettier)
61
+
56
62
  - Single quotes, semicolons required
57
63
  - 2-space indentation, 80 character line width
58
64
  - Trailing commas in ES5 contexts
@@ -60,6 +66,7 @@ The project uses **Rollup** as the primary build tool (not Webpack or Vite). Key
60
66
  - Console usage limited to info/warn/error methods
61
67
 
62
68
  ### File Organization
69
+
63
70
  - `src/components/` - Reusable UI components (Agent/, Chat/)
64
71
  - `src/hooks/` - Custom React hooks (useChat, useAudioRecording, etc.)
65
72
  - `src/services/` - API layer and external service integrations
@@ -70,6 +77,7 @@ The project uses **Rollup** as the primary build tool (not Webpack or Vite). Key
70
77
  ## Styling
71
78
 
72
79
  Uses **TailwindCSS** with custom configuration:
80
+
73
81
  - Font family: "Be Vietnam Pro" for both sans and mono
74
82
  - Custom rem-to-px conversion function for precise sizing
75
83
  - Dark mode support via class strategy
@@ -86,6 +94,7 @@ Uses **Yarn** as the package manager (yarn.lock present). Always use `yarn` inst
86
94
  ## Browser Support
87
95
 
88
96
  Configured for modern browsers:
97
+
89
98
  - Production: >0.2% usage, not dead, not Opera Mini
90
99
  - Development: Latest Chrome, Firefox, Safari versions
91
100
  - Minimum Node.js version: 18.18.0
@@ -93,58 +102,68 @@ Configured for modern browsers:
93
102
  ## Development Guidelines
94
103
 
95
104
  ### Component Development
105
+
96
106
  - Follow the existing provider pattern for state management
97
107
  - Use TypeScript interfaces for all props and component types
98
108
  - Implement proper error boundaries for chat components
99
109
  - Components should be responsive and work within the widget constraints
100
110
 
101
111
  ### Tool Integration
112
+
102
113
  - **Command Tools**: Tools that trigger UI actions should be added to `isCommandTool()` in `src/components/Chat/Message.tsx`
103
114
  - **Display Tools**: Tools that render content should be added to the custom tool results logic
104
115
  - **Event System**: Use the `EVENT_TYPE` enum and listeners pattern for component communication
105
116
 
106
117
  ### State Management Patterns
118
+
107
119
  - Use React Context providers for shared state (Configuration, ChatData, AudioPlayer)
108
120
  - Implement custom hooks for complex state logic (useChat, useAudioRecording)
109
121
  - Keep component state minimal and lift state up when needed
110
122
 
111
123
  ### API Integration
124
+
112
125
  - All API calls should go through the services layer (`src/services/`)
113
126
  - Use proper error handling and loading states
114
127
  - Implement request utilities for consistent API interaction patterns
115
128
 
116
129
  ### Styling Guidelines
130
+
117
131
  - Use TailwindCSS classes for all styling
118
132
  - Follow the existing color and spacing conventions
119
133
  - Implement responsive design using Tailwind's responsive prefixes
120
134
  - Use CSS-in-JS only when dynamic styling based on theme props is required
121
135
 
122
136
  ### Audio/Voice Features
137
+
123
138
  - Audio recording utilities are in `src/utils/audioRecording.ts`
124
139
  - Use the AudioMessagePlayerProvider for playback functionality
125
140
  - Implement proper permissions handling for microphone access
126
141
  - Follow the existing patterns for LiveKit integration
127
142
 
128
143
  ### Theme System
144
+
129
145
  - Theme configuration is handled through the ConfigurationProvider
130
146
  - Support both light and dark themes via CSS classes
131
147
  - Use theme props for customizable colors, fonts, and layouts
132
148
  - Maintain backward compatibility when adding new theme options
133
149
 
134
150
  ### Testing Practices
151
+
135
152
  - Since no test framework is configured, prefer manual testing during development
136
153
  - Test widget integration in different environments (various websites)
137
154
  - Verify responsive behavior across different screen sizes
138
155
  - Test audio features with different browser permissions
139
156
 
140
157
  ### Performance Considerations
158
+
141
159
  - The widget is embedded in external websites, so bundle size matters
142
160
  - Use dynamic imports for heavy features when possible
143
161
  - Implement proper loading states for async operations
144
162
  - Optimize images and assets for web delivery
145
163
 
146
164
  ### Error Handling
165
+
147
166
  - Implement graceful degradation for failed API calls
148
167
  - Provide meaningful error messages to users
149
168
  - Log errors appropriately for debugging (console.error/warn allowed)
150
- - Handle network connectivity issues gracefully
169
+ - Handle network connectivity issues gracefully
@@ -1 +1 @@
1
- {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Message.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACL,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAalC,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAUF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,SAAS,CAwRxC,CAAC;AAEF,eAAO,MAAM,eAAe,YAAa;IAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,4CAyC/D,CAAC"}
1
+ {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Message.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAa,MAAM,0BAA0B,CAAC;AAkCtE,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,SAAS,CA6JxC,CAAC;AAEF,eAAO,MAAM,eAAe,YAAa;IAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,4CAyC/D,CAAC"}
@@ -6,13 +6,37 @@ interface ProductType {
6
6
  price: number;
7
7
  rating: number;
8
8
  description: string;
9
+ brand: string;
9
10
  icon: {
10
11
  url: string;
11
12
  };
13
+ logo: {
14
+ url: string;
15
+ };
16
+ gallery: Array<{
17
+ file: {
18
+ url: string;
19
+ };
20
+ }>;
21
+ collections: Array<{
22
+ color: string;
23
+ icon: {
24
+ url: string;
25
+ };
26
+ gallery: Array<{
27
+ file: {
28
+ url: string;
29
+ };
30
+ }>;
31
+ }>;
12
32
  virtualTourUrl: string;
13
33
  }
14
34
  interface PropTypes {
15
35
  content?: ProductType | string;
36
+ productCode?: string;
37
+ tourCode?: string;
38
+ languageCode?: string;
39
+ apiUrl?: string;
16
40
  }
17
41
  export declare const ProductDetail: FC<PropTypes>;
18
42
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ProductDetail.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ProductDetail.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAQxD,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,SAAS,CAiHvC,CAAC"}
1
+ {"version":3,"file":"ProductDetail.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ProductDetail.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AASxD,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE;YACJ,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;KACH,CAAC,CAAC;IACH,WAAW,EAAE,KAAK,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE;YACJ,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,OAAO,EAAE,KAAK,CAAC;YACb,IAAI,EAAE;gBACJ,GAAG,EAAE,MAAM,CAAC;aACb,CAAC;SACH,CAAC,CAAC;KACJ,CAAC,CAAC;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,SAAS,CA2avC,CAAC"}
@@ -8,6 +8,8 @@ interface ProductType {
8
8
  name: string;
9
9
  url: string;
10
10
  price: number;
11
+ originalPrice?: number;
12
+ discountPercent?: number;
11
13
  rating: number;
12
14
  description: string;
13
15
  icon: {
@@ -1 +1 @@
1
- {"version":3,"file":"ProductList.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ProductList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAQxD,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;CAC1C;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,SAAS,CA2KrC,CAAC"}
1
+ {"version":3,"file":"ProductList.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ProductList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAQxD,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;CAC1C;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,SAAS,CAsQrC,CAAC"}
@@ -2,7 +2,7 @@ import { type VariantProps } from 'class-variance-authority';
2
2
  import { ButtonHTMLAttributes } from 'react';
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
5
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
5
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
6
6
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
7
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
8
  asChild?: boolean;
@@ -0,0 +1,75 @@
1
+ export declare const WEATHER_TOOLS: {
2
+ readonly GET_WEATHER: "getWeather";
3
+ };
4
+ export declare const LOCATION_TOOLS: {
5
+ readonly GET_ASSIGNED_LOCATION_DETAIL: "get_assigned_location_detail";
6
+ readonly SEARCH_TRAVELING_PLACES: "search-traveling-places";
7
+ };
8
+ export declare const PRODUCT_LIST_TOOL_PREFIXES: {
9
+ readonly SEARCH_PRODUCTS: "search_products";
10
+ readonly SHOW_PRODUCTS: "show_products";
11
+ readonly GET_PRODUCTS: "get_products";
12
+ };
13
+ export declare const PRODUCT_DETAIL_TOOL_PREFIXES: {
14
+ readonly SEARCH_PRODUCT: "search_product";
15
+ readonly SHOW_PRODUCT: "show_product";
16
+ readonly GET_PRODUCT: "get_product";
17
+ };
18
+ export declare const SCENARIO_TOOLS: {
19
+ readonly SEARCH_SCENARIOS_IN_VIRTUAL_TOUR: "search_scenarios_in_virtual_tour";
20
+ };
21
+ export declare const PRODUCT_COMMAND_TOOLS: {
22
+ readonly SHOW_HOTSPOT_GUIDED_TOUR: "show_hotspot_guided_tour";
23
+ readonly SHOW_PRODUCT_AR: "show_product_AR";
24
+ readonly SHOW_PRODUCT_360_IMAGE: "show_product_360_image";
25
+ readonly SHOW_PRODUCT_IMAGE_GALLERY: "show_product_image_gallery";
26
+ readonly SHOW_PRODUCT_INFO: "show_product_info";
27
+ };
28
+ export declare const COMMAND_TOOLS: {
29
+ readonly CHANGE_ROOM_STYLE: "change_room_style";
30
+ readonly SWAP_PRODUCT_MATERIAL: "swap_product_material";
31
+ readonly OPEN_CLOSE_DOOR: "open_close_door";
32
+ readonly CHANGE_ROOM_LIGHTING: "change_room_lighting";
33
+ readonly OPEN_SCENE_PRODUCT_LIST: "open_scene_product_list";
34
+ readonly PLAY_SCENE_GUIDED_TOUR: "play_scene_guided_tour";
35
+ readonly SHOW_HOTSPOT_GUIDED_TOUR: "show_hotspot_guided_tour";
36
+ readonly SHOW_PRODUCT_AR: "show_product_AR";
37
+ readonly SHOW_PRODUCT_360_IMAGE: "show_product_360_image";
38
+ readonly SHOW_PRODUCT_IMAGE_GALLERY: "show_product_image_gallery";
39
+ readonly SHOW_PRODUCT_INFO: "show_product_info";
40
+ readonly PLAY_SCENARIO: "play_scenario";
41
+ readonly MOVE_TO_HOTSPOT: "move_to_hotspot";
42
+ readonly MOVE_TO_SCENE: "move_to_scene";
43
+ };
44
+ export declare const WEATHER_TOOL_VALUES: "getWeather"[];
45
+ export declare const LOCATION_TOOL_VALUES: ("get_assigned_location_detail" | "search-traveling-places")[];
46
+ export declare const SCENARIO_TOOL_VALUES: "search_scenarios_in_virtual_tour"[];
47
+ export declare const COMMAND_TOOL_VALUES: ("show_hotspot_guided_tour" | "show_product_AR" | "show_product_360_image" | "show_product_image_gallery" | "show_product_info" | "play_scenario" | "move_to_hotspot" | "move_to_scene" | "change_room_style" | "swap_product_material" | "open_close_door" | "change_room_lighting" | "open_scene_product_list" | "play_scene_guided_tour")[];
48
+ export declare const PRODUCT_COMMAND_TOOL_VALUES: ("show_hotspot_guided_tour" | "show_product_AR" | "show_product_360_image" | "show_product_image_gallery" | "show_product_info")[];
49
+ export declare const ALL_TOOLS: {
50
+ readonly SHOW_HOTSPOT_GUIDED_TOUR: "show_hotspot_guided_tour";
51
+ readonly SHOW_PRODUCT_AR: "show_product_AR";
52
+ readonly SHOW_PRODUCT_360_IMAGE: "show_product_360_image";
53
+ readonly SHOW_PRODUCT_IMAGE_GALLERY: "show_product_image_gallery";
54
+ readonly SHOW_PRODUCT_INFO: "show_product_info";
55
+ readonly CHANGE_ROOM_STYLE: "change_room_style";
56
+ readonly SWAP_PRODUCT_MATERIAL: "swap_product_material";
57
+ readonly OPEN_CLOSE_DOOR: "open_close_door";
58
+ readonly CHANGE_ROOM_LIGHTING: "change_room_lighting";
59
+ readonly OPEN_SCENE_PRODUCT_LIST: "open_scene_product_list";
60
+ readonly PLAY_SCENE_GUIDED_TOUR: "play_scene_guided_tour";
61
+ readonly PLAY_SCENARIO: "play_scenario";
62
+ readonly MOVE_TO_HOTSPOT: "move_to_hotspot";
63
+ readonly MOVE_TO_SCENE: "move_to_scene";
64
+ readonly SEARCH_SCENARIOS_IN_VIRTUAL_TOUR: "search_scenarios_in_virtual_tour";
65
+ readonly GET_ASSIGNED_LOCATION_DETAIL: "get_assigned_location_detail";
66
+ readonly SEARCH_TRAVELING_PLACES: "search-traveling-places";
67
+ readonly GET_WEATHER: "getWeather";
68
+ };
69
+ export type WeatherTool = (typeof WEATHER_TOOLS)[keyof typeof WEATHER_TOOLS];
70
+ export type LocationTool = (typeof LOCATION_TOOLS)[keyof typeof LOCATION_TOOLS];
71
+ export type ScenarioTool = (typeof SCENARIO_TOOLS)[keyof typeof SCENARIO_TOOLS];
72
+ export type CommandTool = (typeof COMMAND_TOOLS)[keyof typeof COMMAND_TOOLS];
73
+ export type ProductCommandTool = (typeof PRODUCT_COMMAND_TOOLS)[keyof typeof PRODUCT_COMMAND_TOOLS];
74
+ export type AllTools = (typeof ALL_TOOLS)[keyof typeof ALL_TOOLS];
75
+ //# sourceMappingURL=toolNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolNames.d.ts","sourceRoot":"","sources":["../../src/constants/toolNames.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;CAEhB,CAAC;AAGX,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAGX,eAAO,MAAM,0BAA0B;;;;CAI7B,CAAC;AAGX,eAAO,MAAM,4BAA4B;;;;CAI/B,CAAC;AAGX,eAAO,MAAM,cAAc;;CAEjB,CAAC;AAGX,eAAO,MAAM,qBAAqB;;;;;;CAMxB,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;CAgBhB,CAAC;AAGX,eAAO,MAAM,mBAAmB,gBAA+B,CAAC;AAChE,eAAO,MAAM,oBAAoB,gEAAgC,CAAC;AAClE,eAAO,MAAM,oBAAoB,sCAAgC,CAAC;AAClE,eAAO,MAAM,mBAAmB,gVAA+B,CAAC;AAChE,eAAO,MAAM,2BAA2B,oIAAuC,CAAC;AAGhF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;CAMZ,CAAC;AAGX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAC7E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAChF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAC7E,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AACrE,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC"}
package/dist/index.html CHANGED
@@ -1,46 +1,42 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
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: 'fe4cf6a9-fa43-4986-bc6f-df67092568c6',
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title></title>
6
+ <style>
7
+ clik-agent-widget {
8
+ display: block;
9
+ height: 100vh;
10
+ }
11
+ </style>
12
+ <script type="module">
13
+ import Agent from 'http://localhost:3000/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
14
+ Agent.initWidget({
15
+ apiHost: 'https://ci-api.clik.vn/chatbot',
16
+ agentId: '697a9f37-2ed6-4d90-b540-6682eabdc5eb',
17
+ overrideConfig: {
18
+ chatId: 'e13e4df8-4e30-41e0-9df3-b0337feec6ee',
13
19
  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
- },
20
+ vars: {
21
+ SHOWROOM_CODE: 'SHR_9FVXUTV62G47',
22
+ TOUR_CODE: 'TOUR_7YUL2ALGFL94',
23
+ PRODUCT_CODE: 'ITEM27GETN2D2M94',
24
+ LANGUAGE: 'VN',
25
+ CLIK_GRAPHQL_API: 'https://ci-api.clik.vn/graphql',
26
+ CLIK_VIRTUALTOUR_API: 'https://ci-api.clik.vn/vt360',
27
+ BRAND_API: 'https://ci-api.clik.vn/showroom',
28
+ }
24
29
  },
25
- listeners: {
26
- ON_LINK_CLICK: console.log,
27
- },
28
- theme: {
29
- // simplified: true,
30
- autoCloseAudioPlayer: true,
31
- hideAudioMetadata: true,
32
- modeButtonChat: true,
33
- gapInput: 30,
34
- },
35
- onLoaded: (tool) => {
36
- window.tool = tool;
37
- },
38
- });
39
- </script>
40
- </head>
41
- <body>
42
- <div style="width: 100vw; height: 100vh">
43
- <clik-agent-widget></clik-agent-widget>
44
- </div>
45
- </body>
46
- </html>
30
+ },
31
+ listeners: {
32
+ ON_LINK_CLICK: console.log,
33
+ CMD_CALLBACK: console.log,
34
+ }
35
+ });
36
+ </script>
37
+
38
+ </head>
39
+ <body>
40
+ <clik-agent-widget></clik-agent-widget>
41
+ </body>
42
+ </html>
@@ -0,0 +1,5 @@
1
+ declare const getProductDetails: (productCode: string, tourCode: string, languageCode: string, options?: {
2
+ api: string;
3
+ }) => Promise<any>;
4
+ export { getProductDetails };
5
+ //# sourceMappingURL=vt360.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vt360.service.d.ts","sourceRoot":"","sources":["../../src/services/vt360.service.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,gBACR,MAAM,YACT,MAAM,gBACF,MAAM,YACV;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,iBA+D1B,CAAC;AAoGF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { MessageRoleType } from '../types/flowise.type';
2
+ /**
3
+ * Get the standardized role from a message role type
4
+ * @param role - The message role type
5
+ * @returns Standardized role string ('user' or 'assistant')
6
+ */
7
+ export declare const getRole: (role?: MessageRoleType) => "user" | "assistant";
8
+ /**
9
+ * Get the appropriate avatar source based on role and theme
10
+ * @param role - The user role ('user' or 'assistant')
11
+ * @param theme - Theme configuration object
12
+ * @param botAvatar - Bot avatar fallback
13
+ * @returns Avatar source URL or undefined
14
+ */
15
+ export declare const getAvatarSource: (role: "user" | "assistant", theme: any, botAvatar?: string) => string | undefined;
16
+ /**
17
+ * Get message background color based on role and theme
18
+ * @param role - The user role ('user' or 'assistant')
19
+ * @param theme - Theme configuration object
20
+ * @returns Background color or undefined
21
+ */
22
+ export declare const getMessageBackgroundColor: (role: "user" | "assistant", theme: any) => string | undefined;
23
+ /**
24
+ * Get message text color based on role and theme
25
+ * @param role - The user role ('user' or 'assistant')
26
+ * @param theme - Theme configuration object
27
+ * @returns Text color or undefined
28
+ */
29
+ export declare const getMessageTextColor: (role: "user" | "assistant", theme: any) => string | undefined;
30
+ /**
31
+ * Check if avatar should be shown based on theme and message role
32
+ * @param theme - Theme configuration object
33
+ * @param messageRole - The message role type
34
+ * @returns True if avatar should be shown
35
+ */
36
+ export declare const shouldShowAvatar: (theme: any, messageRole: MessageRoleType) => boolean;
37
+ //# sourceMappingURL=messageUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageUtils.d.ts","sourceRoot":"","sources":["../../src/utils/messageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,OAAO,UAAW,eAAe,KAAG,MAAM,GAAG,WAKzD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,WAAW,SACnB,GAAG,cACE,MAAM,KACjB,MAAM,GAAG,SAIX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,SAC9B,MAAM,GAAG,WAAW,SACnB,GAAG,KACT,MAAM,GAAG,SAIX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SACxB,MAAM,GAAG,WAAW,SACnB,GAAG,KACT,MAAM,GAAG,SAIX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UACpB,GAAG,eACG,eAAe,KAC3B,OAEF,CAAC"}