@gientech/modual 1.4.7 → 1.5.2

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.
Files changed (65) hide show
  1. package/dist/assets/GientechStreamReader-KtCNi1G3.js +447 -0
  2. package/dist/assets/Input-CNqIA41v.js +236 -0
  3. package/dist/assets/index-Bof0D4vl.js +1088 -0
  4. package/dist/assets/{index-BVENTW1Q.js → index-C5RhLYRh.js} +1 -1
  5. package/dist/assets/index-COcmK9my.js +1 -0
  6. package/dist/assets/index-CysDmrpo.js +1798 -0
  7. package/dist/assets/{index-7rZAt9P3.js → index-DP8Ki8qW.js} +1 -1
  8. package/dist/assets/index-pybYlMAT.js +11 -0
  9. package/dist/assets/{plus-CrtEUXaQ.js → plus-CzbYbK8K.js} +1 -1
  10. package/dist/assets/style3.css +1 -1
  11. package/dist/assets/worker-BbpylX7l.js +13 -0
  12. package/dist/assets/{x-Dr3EBTzJ.js → x-DdRafKQU.js} +1 -1
  13. package/dist/chat.d.ts +17 -0
  14. package/dist/chat.js +2539 -52
  15. package/dist/database.js +2 -2
  16. package/dist/databaseId.js +1 -11
  17. package/dist/databaseTable.js +2 -2
  18. package/dist/index.d.ts +4 -0
  19. package/dist/index.js +1 -14
  20. package/dist/modelManage.js +1 -1
  21. package/dist/package.json +1 -1
  22. package/dist/sensitive.js +1 -1
  23. package/dist/streamFilesReader.js +1 -1
  24. package/dist/worker/pdf.worker1.min.js +23 -0
  25. package/package.json +6 -6
  26. package/public/worker/pdf.worker1.min.js +23 -0
  27. package/scripts/README.md +133 -133
  28. package/scripts/build-demo.js +88 -88
  29. package/scripts/demo-selector.js +216 -216
  30. package/scripts/preview-demo.js +130 -130
  31. package/scripts/run-demo.bat +34 -34
  32. package/src/assets/img/close.png +0 -0
  33. package/src/assets/img/database.png +0 -0
  34. package/src/assets/img/downLoad.png +0 -0
  35. package/src/assets/img/graphIcon.png +0 -0
  36. package/src/assets/img/pdf.png +0 -0
  37. package/src/assets/img/singleQa.png +0 -0
  38. package/src/assets/img/webSearch.png +0 -0
  39. package/src/examples/chat/index.tsx +5 -29
  40. package/src/main.tsx.backup +5 -5
  41. package/src/modules/chat/ReferenceBar.tsx +522 -0
  42. package/src/modules/chat/constants.tsx +29 -6
  43. package/src/modules/chat/index.tsx +118 -4
  44. package/src/modules/chat/referenceCom/DeleteModal.tsx +75 -0
  45. package/src/modules/chat/referenceCom/DrawerContent.tsx +136 -0
  46. package/src/modules/chat/referenceCom/DrawerDatabase.tsx +110 -0
  47. package/src/modules/chat/referenceCom/DrawerGraphPreview.tsx +86 -0
  48. package/src/modules/chat/referenceCom/DrawerPreview.tsx +73 -0
  49. package/src/modules/chat/referenceCom/DrawerTitle.tsx +26 -0
  50. package/src/modules/chat/referenceCom/RenameModal.tsx +86 -0
  51. package/src/modules/chat/referenceCom/TagCom.tsx +30 -0
  52. package/src/modules/chat/style.css +3 -0
  53. package/src/modules/chat/utils/index.ts +326 -0
  54. package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +231 -18
  55. package/src/utils/testconfigs/index.ts +1 -1
  56. package/stats.html +1 -1
  57. package/dist/assets/AppLoading-mci3gLZt.js +0 -414
  58. package/dist/assets/GientechStreamReader-4496nAm0.js +0 -446
  59. package/dist/assets/index-Bb8_WB-l.js +0 -1
  60. package/dist/assets/index-BpJ9Bm5x.js +0 -21
  61. package/dist/assets/index-CNxDI4h-.js +0 -1078
  62. package/dist/assets/index-CWzpBU29.js +0 -1
  63. package/dist/assets/index-D1m34Ij7.js +0 -1429
  64. package/dist/assets/index-_gBtdXQV.js +0 -585
  65. package/dist/assets/style4.css +0 -1
@@ -1,130 +1,130 @@
1
- #!/usr/bin/env node
2
-
3
- import { spawn } from 'child_process';
4
- import { main, restoreMainFile } from './demo-selector.js';
5
- import path from 'path';
6
- import { fileURLToPath } from 'url';
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
- // 检测操作系统
12
- const isWindows = process.platform === 'win32';
13
-
14
- /**
15
- * 执行打包
16
- */
17
- function runBuild() {
18
- return new Promise((resolve, reject) => {
19
- console.log('\n🔨 正在执行打包...\n');
20
- console.log('🔧 调试信息:');
21
- console.log(' 操作系统:', process.platform);
22
- console.log(' Windows 模式:', isWindows);
23
- console.log(' 工作目录:', path.resolve(__dirname, '..'));
24
- console.log('');
25
-
26
- const buildProcess = spawn('pnpm', ['run', 'build:app'], {
27
- stdio: 'inherit',
28
- shell: isWindows, // Windows 下需要 shell: true
29
- cwd: path.resolve(__dirname, '..'),
30
- env: {
31
- ...process.env,
32
- NODE_OPTIONS: '--max-old-space-size=16384'
33
- }
34
- });
35
-
36
- buildProcess.on('close', (code) => {
37
- if (code === 0) {
38
- console.log('\n✅ 打包完成!');
39
- console.log('📁 输出目录: dist-app/');
40
- resolve();
41
- } else {
42
- console.error(`\n❌ 打包失败 (退出码: ${code})`);
43
- reject(new Error(`打包失败,退出码: ${code}`));
44
- }
45
- });
46
-
47
- buildProcess.on('error', (error) => {
48
- console.error('❌ 执行打包失败:', error);
49
- reject(error);
50
- });
51
-
52
- // 处理进程退出信号
53
- process.on('SIGINT', () => {
54
- console.log('\n🔄 正在取消打包...');
55
- buildProcess.kill('SIGINT');
56
- });
57
-
58
- process.on('SIGTERM', () => {
59
- console.log('\n🔄 正在取消打包...');
60
- buildProcess.kill('SIGTERM');
61
- });
62
- });
63
- }
64
-
65
- /**
66
- * 启动预览服务
67
- */
68
- function startPreviewServer() {
69
- console.log('\n🚀 正在启动预览服务器...\n');
70
- console.log('🔧 调试信息:');
71
- console.log(' 操作系统:', process.platform);
72
- console.log(' Windows 模式:', isWindows);
73
- console.log(' 工作目录:', path.resolve(__dirname, '..'));
74
- console.log('');
75
-
76
- const previewProcess = spawn('pnpm', ['run', 'preview:app'], {
77
- stdio: 'inherit',
78
- shell: isWindows, // Windows 下需要 shell: true
79
- cwd: path.resolve(__dirname, '..')
80
- });
81
-
82
- previewProcess.on('close', (code) => {
83
- console.log(`\n🔄 预览服务器已关闭 (退出码: ${code})`);
84
- restoreMainFile();
85
- });
86
-
87
- previewProcess.on('error', (error) => {
88
- console.error('❌ 启动预览服务器失败:', error);
89
- restoreMainFile();
90
- process.exit(1);
91
- });
92
-
93
- // 处理进程退出信号
94
- process.on('SIGINT', () => {
95
- console.log('\n🔄 正在关闭预览服务器...');
96
- previewProcess.kill('SIGINT');
97
- });
98
-
99
- process.on('SIGTERM', () => {
100
- console.log('\n🔄 正在关闭预览服务器...');
101
- previewProcess.kill('SIGTERM');
102
- });
103
- }
104
-
105
- /**
106
- * 主函数
107
- */
108
- async function runPreviewDemo() {
109
- try {
110
- // 先选择示例
111
- await main();
112
-
113
- // 执行打包
114
- await runBuild();
115
-
116
- // 启动预览服务
117
- startPreviewServer();
118
- } catch (error) {
119
- console.error('❌ 预览模式启动失败:', error);
120
- restoreMainFile();
121
- process.exit(1);
122
- }
123
- }
124
-
125
- // 如果直接运行此脚本
126
- if (import.meta.url === `file://${process.argv[1]}`) {
127
- runPreviewDemo();
128
- }
129
-
130
- export { runPreviewDemo };
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from 'child_process';
4
+ import { main, restoreMainFile } from './demo-selector.js';
5
+ import path from 'path';
6
+ import { fileURLToPath } from 'url';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+ // 检测操作系统
12
+ const isWindows = process.platform === 'win32';
13
+
14
+ /**
15
+ * 执行打包
16
+ */
17
+ function runBuild() {
18
+ return new Promise((resolve, reject) => {
19
+ console.log('\n🔨 正在执行打包...\n');
20
+ console.log('🔧 调试信息:');
21
+ console.log(' 操作系统:', process.platform);
22
+ console.log(' Windows 模式:', isWindows);
23
+ console.log(' 工作目录:', path.resolve(__dirname, '..'));
24
+ console.log('');
25
+
26
+ const buildProcess = spawn('pnpm', ['run', 'build:app'], {
27
+ stdio: 'inherit',
28
+ shell: isWindows, // Windows 下需要 shell: true
29
+ cwd: path.resolve(__dirname, '..'),
30
+ env: {
31
+ ...process.env,
32
+ NODE_OPTIONS: '--max-old-space-size=16384'
33
+ }
34
+ });
35
+
36
+ buildProcess.on('close', (code) => {
37
+ if (code === 0) {
38
+ console.log('\n✅ 打包完成!');
39
+ console.log('📁 输出目录: dist-app/');
40
+ resolve();
41
+ } else {
42
+ console.error(`\n❌ 打包失败 (退出码: ${code})`);
43
+ reject(new Error(`打包失败,退出码: ${code}`));
44
+ }
45
+ });
46
+
47
+ buildProcess.on('error', (error) => {
48
+ console.error('❌ 执行打包失败:', error);
49
+ reject(error);
50
+ });
51
+
52
+ // 处理进程退出信号
53
+ process.on('SIGINT', () => {
54
+ console.log('\n🔄 正在取消打包...');
55
+ buildProcess.kill('SIGINT');
56
+ });
57
+
58
+ process.on('SIGTERM', () => {
59
+ console.log('\n🔄 正在取消打包...');
60
+ buildProcess.kill('SIGTERM');
61
+ });
62
+ });
63
+ }
64
+
65
+ /**
66
+ * 启动预览服务
67
+ */
68
+ function startPreviewServer() {
69
+ console.log('\n🚀 正在启动预览服务器...\n');
70
+ console.log('🔧 调试信息:');
71
+ console.log(' 操作系统:', process.platform);
72
+ console.log(' Windows 模式:', isWindows);
73
+ console.log(' 工作目录:', path.resolve(__dirname, '..'));
74
+ console.log('');
75
+
76
+ const previewProcess = spawn('pnpm', ['run', 'preview:app'], {
77
+ stdio: 'inherit',
78
+ shell: isWindows, // Windows 下需要 shell: true
79
+ cwd: path.resolve(__dirname, '..')
80
+ });
81
+
82
+ previewProcess.on('close', (code) => {
83
+ console.log(`\n🔄 预览服务器已关闭 (退出码: ${code})`);
84
+ restoreMainFile();
85
+ });
86
+
87
+ previewProcess.on('error', (error) => {
88
+ console.error('❌ 启动预览服务器失败:', error);
89
+ restoreMainFile();
90
+ process.exit(1);
91
+ });
92
+
93
+ // 处理进程退出信号
94
+ process.on('SIGINT', () => {
95
+ console.log('\n🔄 正在关闭预览服务器...');
96
+ previewProcess.kill('SIGINT');
97
+ });
98
+
99
+ process.on('SIGTERM', () => {
100
+ console.log('\n🔄 正在关闭预览服务器...');
101
+ previewProcess.kill('SIGTERM');
102
+ });
103
+ }
104
+
105
+ /**
106
+ * 主函数
107
+ */
108
+ async function runPreviewDemo() {
109
+ try {
110
+ // 先选择示例
111
+ await main();
112
+
113
+ // 执行打包
114
+ await runBuild();
115
+
116
+ // 启动预览服务
117
+ startPreviewServer();
118
+ } catch (error) {
119
+ console.error('❌ 预览模式启动失败:', error);
120
+ restoreMainFile();
121
+ process.exit(1);
122
+ }
123
+ }
124
+
125
+ // 如果直接运行此脚本
126
+ if (import.meta.url === `file://${process.argv[1]}`) {
127
+ runPreviewDemo();
128
+ }
129
+
130
+ export { runPreviewDemo };
@@ -1,34 +1,34 @@
1
- @echo off
2
- REM Windows 批处理文件用于运行演示脚本
3
- REM 使用方法: run-demo.bat [dev-demo|build-demo|preview-demo]
4
-
5
- set NODE_OPTIONS=--max-old-space-size=16384
6
-
7
- if "%1"=="" (
8
- echo 请指定要运行的脚本:
9
- echo run-demo.bat dev-demo
10
- echo run-demo.bat build-demo
11
- echo run-demo.bat preview-demo
12
- exit /b 1
13
- )
14
-
15
- echo 🔧 调试信息:
16
- echo Node.js 版本:
17
- node --version
18
- echo 操作系统: Windows
19
- echo 当前目录: %CD%
20
- echo 脚本参数: %1
21
- echo.
22
-
23
- node scripts\%1.js
24
-
25
- if %ERRORLEVEL% neq 0 (
26
- echo.
27
- echo ❌ 脚本执行失败,错误代码: %ERRORLEVEL%
28
- pause
29
- exit /b %ERRORLEVEL%
30
- )
31
-
32
- echo.
33
- echo ✅ 脚本执行完成
34
- pause
1
+ @echo off
2
+ REM Windows 批处理文件用于运行演示脚本
3
+ REM 使用方法: run-demo.bat [dev-demo|build-demo|preview-demo]
4
+
5
+ set NODE_OPTIONS=--max-old-space-size=16384
6
+
7
+ if "%1"=="" (
8
+ echo 请指定要运行的脚本:
9
+ echo run-demo.bat dev-demo
10
+ echo run-demo.bat build-demo
11
+ echo run-demo.bat preview-demo
12
+ exit /b 1
13
+ )
14
+
15
+ echo 🔧 调试信息:
16
+ echo Node.js 版本:
17
+ node --version
18
+ echo 操作系统: Windows
19
+ echo 当前目录: %CD%
20
+ echo 脚本参数: %1
21
+ echo.
22
+
23
+ node scripts\%1.js
24
+
25
+ if %ERRORLEVEL% neq 0 (
26
+ echo.
27
+ echo ❌ 脚本执行失败,错误代码: %ERRORLEVEL%
28
+ pause
29
+ exit /b %ERRORLEVEL%
30
+ )
31
+
32
+ echo.
33
+ echo ✅ 脚本执行完成
34
+ pause
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -89,14 +89,16 @@ export default function Preview() {
89
89
  },
90
90
  };
91
91
  return (
92
- <div className="w-screen h-screen relative">
92
+ <div className="w-screen h-screen relative overflow-hidden">
93
+ {/* 演示:侧栏折叠/展开开关(调用层触发全局事件) */}
94
+
93
95
  <GientechChat
94
96
  token={token}
95
97
  // sidebar={[]}
96
98
  CustomComponents={{
97
99
  LogoBox: null,
98
100
  }}
99
- senderConfig={mockSenderConfig}
101
+ //senderConfig={mockSenderConfig}
100
102
  appLoadingConfig={{
101
103
  // title: '"睿思"智能会话助手',
102
104
  subtitle: '让智能对话更简单',
@@ -104,7 +106,7 @@ export default function Preview() {
104
106
  url={url}
105
107
  styles={parsedStyles}
106
108
  eventsEmit={(eventName, data) => {
107
- console.log('事件触发:', event, data);
109
+ console.log('事件触发:', eventName, data);
108
110
  setCurFileInfo(data);
109
111
  setOpen(true);
110
112
  return;
@@ -146,32 +148,6 @@ export default function Preview() {
146
148
  productLogo={Logo as unknown as string}
147
149
  scrollOld={false}
148
150
  />
149
- <ConfigProvider
150
- drawer={{
151
- styles: {
152
- body: { padding: 0 },
153
- header: { display: 'none' },
154
- },
155
- }}
156
- >
157
- <Drawer
158
- autoFocus={false}
159
- onClose={() => setOpen(false)}
160
- open={open}
161
- width={600}
162
- className="overflow-x-hidden"
163
- destroyOnClose
164
- afterOpenChange={open => {
165
- if (!open) {
166
- setCurFileInfo(null);
167
- }
168
- }}
169
- >
170
- {drawerType === 'graphPreview' && (
171
- <DrawerGraphPreview curFileInfo={curFileInfo as any} onClose={() => setOpen(false)} />
172
- )}
173
- </Drawer>
174
- </ConfigProvider>
175
151
  </div>
176
152
  );
177
153
  }
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom/client';
3
- import Demo from './examples/Demo/index';
4
-
5
- ReactDOM.createRoot(document.getElementById('root')!).render(<Demo />);
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import Chat from './examples/chat/index';
4
+
5
+ ReactDOM.createRoot(document.getElementById('root')!).render(<Chat />);