@clikvn/agent-widget-embedded 1.1.8-dev-06 → 1.1.8-dev-08
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/.idea/clik-ai-chatbot-embedded.iml +9 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +36 -0
- package/.idea/jsLinters/eslint.xml +7 -0
- package/.idea/misc.xml +9 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/CLAUDE.md +169 -169
- package/README.md +20 -20
- package/base.json +21 -21
- package/dist/components/Chat/AudioPlayerSimple.d.ts +9 -0
- package/dist/components/Chat/AudioPlayerSimple.d.ts.map +1 -0
- package/dist/components/Chat/MultimodalInputSimple.d.ts +22 -0
- package/dist/components/Chat/MultimodalInputSimple.d.ts.map +1 -0
- package/dist/components/Chat/Sidebar.d.ts +8 -0
- package/dist/components/Chat/Sidebar.d.ts.map +1 -0
- package/dist/hooks/useChat.d.ts.map +1 -1
- package/dist/index.html +71 -67
- package/dist/serve.json +11 -0
- package/dist/types/bot.type.d.ts +1 -0
- package/dist/types/bot.type.d.ts.map +1 -1
- package/dist/web.css +3680 -0
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +1 -1
- package/docs/agent-response-trace/agentflow.txt +62 -62
- package/docs/agent-response-trace/chatflow.txt +26 -26
- package/docs/brand-ui-command-actions-tools.md +269 -269
- package/package.json +1 -1
- package/public/index.html +54 -54
- package/rollup.config.js +67 -67
- package/tailwind.config.cjs +145 -145
package/rollup.config.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
2
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
-
import typescript from '@rollup/plugin-typescript';
|
|
4
|
-
import { terser } from 'rollup-plugin-terser';
|
|
5
|
-
import postcss from 'rollup-plugin-postcss';
|
|
6
|
-
import { babel } from '@rollup/plugin-babel';
|
|
7
|
-
import autoprefixer from 'autoprefixer';
|
|
8
|
-
import { typescriptPaths } from 'rollup-plugin-typescript-paths';
|
|
9
|
-
import json from '@rollup/plugin-json';
|
|
10
|
-
import { uglify } from 'rollup-plugin-uglify';
|
|
11
|
-
import replace from 'rollup-plugin-replace';
|
|
12
|
-
import tailwindcss from 'tailwindcss';
|
|
13
|
-
|
|
14
|
-
const extensions = ['.ts', '.tsx', '.js'];
|
|
15
|
-
|
|
16
|
-
const indexConfig = {
|
|
17
|
-
context: 'this',
|
|
18
|
-
onwarn(warning, warn) {
|
|
19
|
-
// Bỏ qua warning về "use client" directive
|
|
20
|
-
if (
|
|
21
|
-
warning.code === 'MODULE_LEVEL_DIRECTIVE' &&
|
|
22
|
-
warning.message.includes('"use client"')
|
|
23
|
-
) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
// Hiển thị các warning khác
|
|
27
|
-
warn(warning);
|
|
28
|
-
},
|
|
29
|
-
plugins: [
|
|
30
|
-
resolve({ extensions, browser: true }),
|
|
31
|
-
commonjs(),
|
|
32
|
-
uglify(),
|
|
33
|
-
json(),
|
|
34
|
-
babel({
|
|
35
|
-
babelHelpers: 'bundled',
|
|
36
|
-
exclude: 'node_modules/**',
|
|
37
|
-
extensions,
|
|
38
|
-
}),
|
|
39
|
-
replace({
|
|
40
|
-
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
41
|
-
}),
|
|
42
|
-
postcss({
|
|
43
|
-
plugins: [autoprefixer(), tailwindcss()],
|
|
44
|
-
extract: false,
|
|
45
|
-
modules: false,
|
|
46
|
-
autoModules: false,
|
|
47
|
-
minimize: true,
|
|
48
|
-
inject: false,
|
|
49
|
-
}),
|
|
50
|
-
typescript(),
|
|
51
|
-
typescriptPaths({ preserveExtensions: true }),
|
|
52
|
-
terser({ output: { comments: false } }),
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const configs = [
|
|
57
|
-
{
|
|
58
|
-
...indexConfig,
|
|
59
|
-
input: './src/web.ts',
|
|
60
|
-
output: {
|
|
61
|
-
file: 'dist/web.js',
|
|
62
|
-
format: 'esm',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
export default configs;
|
|
1
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
2
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
+
import typescript from '@rollup/plugin-typescript';
|
|
4
|
+
import { terser } from 'rollup-plugin-terser';
|
|
5
|
+
import postcss from 'rollup-plugin-postcss';
|
|
6
|
+
import { babel } from '@rollup/plugin-babel';
|
|
7
|
+
import autoprefixer from 'autoprefixer';
|
|
8
|
+
import { typescriptPaths } from 'rollup-plugin-typescript-paths';
|
|
9
|
+
import json from '@rollup/plugin-json';
|
|
10
|
+
import { uglify } from 'rollup-plugin-uglify';
|
|
11
|
+
import replace from 'rollup-plugin-replace';
|
|
12
|
+
import tailwindcss from 'tailwindcss';
|
|
13
|
+
|
|
14
|
+
const extensions = ['.ts', '.tsx', '.js'];
|
|
15
|
+
|
|
16
|
+
const indexConfig = {
|
|
17
|
+
context: 'this',
|
|
18
|
+
onwarn(warning, warn) {
|
|
19
|
+
// Bỏ qua warning về "use client" directive
|
|
20
|
+
if (
|
|
21
|
+
warning.code === 'MODULE_LEVEL_DIRECTIVE' &&
|
|
22
|
+
warning.message.includes('"use client"')
|
|
23
|
+
) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Hiển thị các warning khác
|
|
27
|
+
warn(warning);
|
|
28
|
+
},
|
|
29
|
+
plugins: [
|
|
30
|
+
resolve({ extensions, browser: true }),
|
|
31
|
+
commonjs(),
|
|
32
|
+
uglify(),
|
|
33
|
+
json(),
|
|
34
|
+
babel({
|
|
35
|
+
babelHelpers: 'bundled',
|
|
36
|
+
exclude: 'node_modules/**',
|
|
37
|
+
extensions,
|
|
38
|
+
}),
|
|
39
|
+
replace({
|
|
40
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
41
|
+
}),
|
|
42
|
+
postcss({
|
|
43
|
+
plugins: [autoprefixer(), tailwindcss()],
|
|
44
|
+
extract: false,
|
|
45
|
+
modules: false,
|
|
46
|
+
autoModules: false,
|
|
47
|
+
minimize: true,
|
|
48
|
+
inject: false,
|
|
49
|
+
}),
|
|
50
|
+
typescript(),
|
|
51
|
+
typescriptPaths({ preserveExtensions: true }),
|
|
52
|
+
terser({ output: { comments: false } }),
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const configs = [
|
|
57
|
+
{
|
|
58
|
+
...indexConfig,
|
|
59
|
+
input: './src/web.ts',
|
|
60
|
+
output: {
|
|
61
|
+
file: 'dist/web.js',
|
|
62
|
+
format: 'esm',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
export default configs;
|
package/tailwind.config.cjs
CHANGED
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
-
const defaultTheme = require('tailwindcss/defaultTheme');
|
|
3
|
-
const plugin = require('tailwindcss/plugin');
|
|
4
|
-
|
|
5
|
-
function rem2px(input, fontSize = 16) {
|
|
6
|
-
if (input == null) {
|
|
7
|
-
return input;
|
|
8
|
-
}
|
|
9
|
-
switch (typeof input) {
|
|
10
|
-
case 'object':
|
|
11
|
-
if (Array.isArray(input)) {
|
|
12
|
-
return input.map((val) => rem2px(val, fontSize));
|
|
13
|
-
}
|
|
14
|
-
// eslint-disable-next-line no-case-declarations
|
|
15
|
-
const ret = {};
|
|
16
|
-
for (const key in input) {
|
|
17
|
-
ret[key] = rem2px(input[key], fontSize);
|
|
18
|
-
}
|
|
19
|
-
return ret;
|
|
20
|
-
case 'string':
|
|
21
|
-
return input.replace(
|
|
22
|
-
/(\d*\.?\d+)rem$/,
|
|
23
|
-
(_, val) => `${parseFloat(val) * fontSize}px`
|
|
24
|
-
);
|
|
25
|
-
case 'function':
|
|
26
|
-
return eval(
|
|
27
|
-
input
|
|
28
|
-
.toString()
|
|
29
|
-
.replace(
|
|
30
|
-
/(\d*\.?\d+)rem/g,
|
|
31
|
-
(_, val) => `${parseFloat(val) * fontSize}px`
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
|
-
default:
|
|
35
|
-
return input;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** @type {import('tailwindcss').Config} */
|
|
40
|
-
module.exports = {
|
|
41
|
-
darkMode: ['class'],
|
|
42
|
-
content: ['./src/**/*.{js,jsx,ts,tsx}'],
|
|
43
|
-
theme: {
|
|
44
|
-
...rem2px(defaultTheme),
|
|
45
|
-
fontFamily: {
|
|
46
|
-
sans: ['Be Vietnam Pro', 'sans-serif'],
|
|
47
|
-
mono: ['Be Vietnam Pro', 'sans-serif'],
|
|
48
|
-
},
|
|
49
|
-
extend: {
|
|
50
|
-
keyframes: {
|
|
51
|
-
'fade-in': {
|
|
52
|
-
'0%': {
|
|
53
|
-
opacity: '0',
|
|
54
|
-
},
|
|
55
|
-
'100%': {
|
|
56
|
-
opacity: '1',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
animation: {
|
|
61
|
-
'fade-in': 'fade-in 0.3s ease-out',
|
|
62
|
-
},
|
|
63
|
-
borderRadius: {
|
|
64
|
-
lg: 'var(--radius)',
|
|
65
|
-
md: 'calc(var(--radius) - 2px)',
|
|
66
|
-
sm: 'calc(var(--radius) - 4px)',
|
|
67
|
-
},
|
|
68
|
-
colors: {
|
|
69
|
-
background: 'hsl(var(--background))',
|
|
70
|
-
foreground: 'hsl(var(--foreground))',
|
|
71
|
-
card: {
|
|
72
|
-
DEFAULT: 'hsl(var(--card))',
|
|
73
|
-
foreground: 'hsl(var(--card-foreground))',
|
|
74
|
-
},
|
|
75
|
-
popover: {
|
|
76
|
-
DEFAULT: 'hsl(var(--popover))',
|
|
77
|
-
foreground: 'hsl(var(--popover-foreground))',
|
|
78
|
-
},
|
|
79
|
-
primary: {
|
|
80
|
-
DEFAULT: 'hsl(var(--primary))',
|
|
81
|
-
foreground: 'hsl(var(--primary-foreground))',
|
|
82
|
-
},
|
|
83
|
-
secondary: {
|
|
84
|
-
DEFAULT: 'hsl(var(--secondary))',
|
|
85
|
-
foreground: 'hsl(var(--secondary-foreground))',
|
|
86
|
-
},
|
|
87
|
-
muted: {
|
|
88
|
-
DEFAULT: 'hsl(var(--muted))',
|
|
89
|
-
foreground: 'hsl(var(--muted-foreground))',
|
|
90
|
-
},
|
|
91
|
-
accent: {
|
|
92
|
-
DEFAULT: 'hsl(var(--accent))',
|
|
93
|
-
foreground: 'hsl(var(--accent-foreground))',
|
|
94
|
-
},
|
|
95
|
-
destructive: {
|
|
96
|
-
DEFAULT: 'hsl(var(--destructive))',
|
|
97
|
-
foreground: 'hsl(var(--destructive-foreground))',
|
|
98
|
-
},
|
|
99
|
-
border: 'hsl(var(--border))',
|
|
100
|
-
input: 'hsl(var(--input))',
|
|
101
|
-
ring: 'hsl(var(--ring))',
|
|
102
|
-
chart: {
|
|
103
|
-
1: 'hsl(var(--chart-1))',
|
|
104
|
-
2: 'hsl(var(--chart-2))',
|
|
105
|
-
3: 'hsl(var(--chart-3))',
|
|
106
|
-
4: 'hsl(var(--chart-4))',
|
|
107
|
-
5: 'hsl(var(--chart-5))',
|
|
108
|
-
},
|
|
109
|
-
sidebar: {
|
|
110
|
-
DEFAULT: 'hsl(var(--sidebar-background))',
|
|
111
|
-
foreground: 'hsl(var(--sidebar-foreground))',
|
|
112
|
-
primary: 'hsl(var(--sidebar-primary))',
|
|
113
|
-
'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
|
|
114
|
-
accent: 'hsl(var(--sidebar-accent))',
|
|
115
|
-
'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
|
|
116
|
-
border: 'hsl(var(--sidebar-border))',
|
|
117
|
-
ring: 'hsl(var(--sidebar-ring))',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
plugins: [
|
|
123
|
-
require('tailwindcss-animate'),
|
|
124
|
-
require('@tailwindcss/typography'),
|
|
125
|
-
plugin(function ({ addVariant }) {
|
|
126
|
-
addVariant('wrapped', ({ container }) => {
|
|
127
|
-
container.walkRules((rule) => {
|
|
128
|
-
rule.selector = `.clik-chatbot-wrapper ${rule.selector}`;
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}),
|
|
132
|
-
function ({ addUtilities }) {
|
|
133
|
-
const newUtilities = {
|
|
134
|
-
'.no-scrollbar': {
|
|
135
|
-
'-ms-overflow-style': 'none' /* IE and Edge */,
|
|
136
|
-
'scrollbar-width': 'none' /* Firefox */,
|
|
137
|
-
},
|
|
138
|
-
'.no-scrollbar::-webkit-scrollbar': {
|
|
139
|
-
display: 'none' /* Chrome, Safari, Opera */,
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
addUtilities(newUtilities, ['responsive']);
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
};
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
+
const defaultTheme = require('tailwindcss/defaultTheme');
|
|
3
|
+
const plugin = require('tailwindcss/plugin');
|
|
4
|
+
|
|
5
|
+
function rem2px(input, fontSize = 16) {
|
|
6
|
+
if (input == null) {
|
|
7
|
+
return input;
|
|
8
|
+
}
|
|
9
|
+
switch (typeof input) {
|
|
10
|
+
case 'object':
|
|
11
|
+
if (Array.isArray(input)) {
|
|
12
|
+
return input.map((val) => rem2px(val, fontSize));
|
|
13
|
+
}
|
|
14
|
+
// eslint-disable-next-line no-case-declarations
|
|
15
|
+
const ret = {};
|
|
16
|
+
for (const key in input) {
|
|
17
|
+
ret[key] = rem2px(input[key], fontSize);
|
|
18
|
+
}
|
|
19
|
+
return ret;
|
|
20
|
+
case 'string':
|
|
21
|
+
return input.replace(
|
|
22
|
+
/(\d*\.?\d+)rem$/,
|
|
23
|
+
(_, val) => `${parseFloat(val) * fontSize}px`
|
|
24
|
+
);
|
|
25
|
+
case 'function':
|
|
26
|
+
return eval(
|
|
27
|
+
input
|
|
28
|
+
.toString()
|
|
29
|
+
.replace(
|
|
30
|
+
/(\d*\.?\d+)rem/g,
|
|
31
|
+
(_, val) => `${parseFloat(val) * fontSize}px`
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
default:
|
|
35
|
+
return input;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** @type {import('tailwindcss').Config} */
|
|
40
|
+
module.exports = {
|
|
41
|
+
darkMode: ['class'],
|
|
42
|
+
content: ['./src/**/*.{js,jsx,ts,tsx}'],
|
|
43
|
+
theme: {
|
|
44
|
+
...rem2px(defaultTheme),
|
|
45
|
+
fontFamily: {
|
|
46
|
+
sans: ['Be Vietnam Pro', 'sans-serif'],
|
|
47
|
+
mono: ['Be Vietnam Pro', 'sans-serif'],
|
|
48
|
+
},
|
|
49
|
+
extend: {
|
|
50
|
+
keyframes: {
|
|
51
|
+
'fade-in': {
|
|
52
|
+
'0%': {
|
|
53
|
+
opacity: '0',
|
|
54
|
+
},
|
|
55
|
+
'100%': {
|
|
56
|
+
opacity: '1',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
animation: {
|
|
61
|
+
'fade-in': 'fade-in 0.3s ease-out',
|
|
62
|
+
},
|
|
63
|
+
borderRadius: {
|
|
64
|
+
lg: 'var(--radius)',
|
|
65
|
+
md: 'calc(var(--radius) - 2px)',
|
|
66
|
+
sm: 'calc(var(--radius) - 4px)',
|
|
67
|
+
},
|
|
68
|
+
colors: {
|
|
69
|
+
background: 'hsl(var(--background))',
|
|
70
|
+
foreground: 'hsl(var(--foreground))',
|
|
71
|
+
card: {
|
|
72
|
+
DEFAULT: 'hsl(var(--card))',
|
|
73
|
+
foreground: 'hsl(var(--card-foreground))',
|
|
74
|
+
},
|
|
75
|
+
popover: {
|
|
76
|
+
DEFAULT: 'hsl(var(--popover))',
|
|
77
|
+
foreground: 'hsl(var(--popover-foreground))',
|
|
78
|
+
},
|
|
79
|
+
primary: {
|
|
80
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
81
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
82
|
+
},
|
|
83
|
+
secondary: {
|
|
84
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
85
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
86
|
+
},
|
|
87
|
+
muted: {
|
|
88
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
89
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
90
|
+
},
|
|
91
|
+
accent: {
|
|
92
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
93
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
94
|
+
},
|
|
95
|
+
destructive: {
|
|
96
|
+
DEFAULT: 'hsl(var(--destructive))',
|
|
97
|
+
foreground: 'hsl(var(--destructive-foreground))',
|
|
98
|
+
},
|
|
99
|
+
border: 'hsl(var(--border))',
|
|
100
|
+
input: 'hsl(var(--input))',
|
|
101
|
+
ring: 'hsl(var(--ring))',
|
|
102
|
+
chart: {
|
|
103
|
+
1: 'hsl(var(--chart-1))',
|
|
104
|
+
2: 'hsl(var(--chart-2))',
|
|
105
|
+
3: 'hsl(var(--chart-3))',
|
|
106
|
+
4: 'hsl(var(--chart-4))',
|
|
107
|
+
5: 'hsl(var(--chart-5))',
|
|
108
|
+
},
|
|
109
|
+
sidebar: {
|
|
110
|
+
DEFAULT: 'hsl(var(--sidebar-background))',
|
|
111
|
+
foreground: 'hsl(var(--sidebar-foreground))',
|
|
112
|
+
primary: 'hsl(var(--sidebar-primary))',
|
|
113
|
+
'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
|
|
114
|
+
accent: 'hsl(var(--sidebar-accent))',
|
|
115
|
+
'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
|
|
116
|
+
border: 'hsl(var(--sidebar-border))',
|
|
117
|
+
ring: 'hsl(var(--sidebar-ring))',
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
plugins: [
|
|
123
|
+
require('tailwindcss-animate'),
|
|
124
|
+
require('@tailwindcss/typography'),
|
|
125
|
+
plugin(function ({ addVariant }) {
|
|
126
|
+
addVariant('wrapped', ({ container }) => {
|
|
127
|
+
container.walkRules((rule) => {
|
|
128
|
+
rule.selector = `.clik-chatbot-wrapper ${rule.selector}`;
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}),
|
|
132
|
+
function ({ addUtilities }) {
|
|
133
|
+
const newUtilities = {
|
|
134
|
+
'.no-scrollbar': {
|
|
135
|
+
'-ms-overflow-style': 'none' /* IE and Edge */,
|
|
136
|
+
'scrollbar-width': 'none' /* Firefox */,
|
|
137
|
+
},
|
|
138
|
+
'.no-scrollbar::-webkit-scrollbar': {
|
|
139
|
+
display: 'none' /* Chrome, Safari, Opera */,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
addUtilities(newUtilities, ['responsive']);
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
};
|