@mxmweb/aichat 1.1.8 → 1.2.0
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/assets/aichat.css +1 -0
- package/{dist/components → components}/AiChat.d.ts +1 -11
- package/{dist/index.js → index.js} +7 -7
- package/package.json +10 -41
- package/.editorconfig +0 -38
- package/.github/workflows/release.yml +0 -60
- package/.prettierignore +0 -16
- package/.prettierrc +0 -17
- package/.releaserc.json +0 -36
- package/CHANGELOG.md +0 -58
- package/CONTRIBUTING.md +0 -111
- package/NPMREADME.md +0 -215
- package/bash.exe.stackdump +0 -40
- package/components.json +0 -21
- package/demo.txt +0 -134
- package/dist/README.md +0 -216
- package/dist/assets/aichat.css +0 -1
- package/dist/package.json +0 -19
- package/eslint.config.js +0 -92
- package/index.html +0 -14
- package/postcss.config.cjs +0 -19
- package/public/icons/answerAwartar.png +0 -0
- package/public/icons/docx-file.png +0 -0
- package/public/icons/folder.png +0 -0
- package/public/icons/html.png +0 -0
- package/public/icons/image.png +0 -0
- package/public/icons/jpg-file.png +0 -0
- package/public/icons/json.png +0 -0
- package/public/icons/md.png +0 -0
- package/public/icons/pdf.png +0 -0
- package/public/icons/pptx.png +0 -0
- package/public/icons/questionAwartar.png +0 -0
- package/public/icons/sheets.png +0 -0
- package/public/icons/txt.png +0 -0
- package/public/icons/xlsx.png +0 -0
- package/public/libs/luckysheet/fontAwesome.otf +0 -0
- package/public/libs/luckysheet/fontawesome-webfont.eot +0 -0
- package/public/libs/luckysheet/fontawesome-webfont.svg +0 -2671
- package/public/libs/luckysheet/fontawesome-webfont.ttf +0 -0
- package/public/libs/luckysheet/fontawesome-webfont.woff +0 -0
- package/public/libs/luckysheet/fontawesome-webfont.woff2 +0 -0
- package/public/libs/luckysheet/fonts/fontawesome-webfont.ttf +0 -0
- package/public/libs/luckysheet/fonts/fontawesome-webfont.woff +0 -0
- package/public/libs/luckysheet/fonts/fontawesome-webfont.woff2 +0 -0
- package/public/libs/luckysheet/iconfont.css +0 -461
- package/public/libs/luckysheet/jquery.min.js +0 -2
- package/public/libs/luckysheet/luckysheet.css +0 -1
- package/public/libs/luckysheet/luckysheet.umd.js +0 -27
- package/public/libs/luckysheet/plugin.js +0 -1
- package/public/libs/luckysheet/plugins.css +0 -10
- package/public/libs/luckysheet/pluginsCss.css +0 -1
- package/public/vite.svg +0 -1
- package/public/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/public/vs/base/common/worker/simpleWorker.nls.de.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.es.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.fr.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.it.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.ja.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.ko.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.ru.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.zh-cn.js +0 -8
- package/public/vs/base/common/worker/simpleWorker.nls.zh-tw.js +0 -8
- package/public/vs/base/worker/workerMain.js +0 -27
- package/public/vs/basic-languages/abap/abap.js +0 -10
- package/public/vs/basic-languages/apex/apex.js +0 -10
- package/public/vs/basic-languages/azcli/azcli.js +0 -10
- package/public/vs/basic-languages/bat/bat.js +0 -10
- package/public/vs/basic-languages/bicep/bicep.js +0 -11
- package/public/vs/basic-languages/cameligo/cameligo.js +0 -10
- package/public/vs/basic-languages/clojure/clojure.js +0 -10
- package/public/vs/basic-languages/coffee/coffee.js +0 -10
- package/public/vs/basic-languages/cpp/cpp.js +0 -10
- package/public/vs/basic-languages/csharp/csharp.js +0 -10
- package/public/vs/basic-languages/csp/csp.js +0 -10
- package/public/vs/basic-languages/css/css.js +0 -12
- package/public/vs/basic-languages/cypher/cypher.js +0 -10
- package/public/vs/basic-languages/dart/dart.js +0 -10
- package/public/vs/basic-languages/dockerfile/dockerfile.js +0 -10
- package/public/vs/basic-languages/ecl/ecl.js +0 -10
- package/public/vs/basic-languages/elixir/elixir.js +0 -10
- package/public/vs/basic-languages/flow9/flow9.js +0 -10
- package/public/vs/basic-languages/freemarker2/freemarker2.js +0 -12
- package/public/vs/basic-languages/fsharp/fsharp.js +0 -10
- package/public/vs/basic-languages/go/go.js +0 -10
- package/public/vs/basic-languages/graphql/graphql.js +0 -10
- package/public/vs/basic-languages/handlebars/handlebars.js +0 -10
- package/public/vs/basic-languages/hcl/hcl.js +0 -10
- package/public/vs/basic-languages/html/html.js +0 -10
- package/public/vs/basic-languages/ini/ini.js +0 -10
- package/public/vs/basic-languages/java/java.js +0 -10
- package/public/vs/basic-languages/javascript/javascript.js +0 -10
- package/public/vs/basic-languages/julia/julia.js +0 -10
- package/public/vs/basic-languages/kotlin/kotlin.js +0 -10
- package/public/vs/basic-languages/less/less.js +0 -11
- package/public/vs/basic-languages/lexon/lexon.js +0 -10
- package/public/vs/basic-languages/liquid/liquid.js +0 -10
- package/public/vs/basic-languages/lua/lua.js +0 -10
- package/public/vs/basic-languages/m3/m3.js +0 -10
- package/public/vs/basic-languages/markdown/markdown.js +0 -10
- package/public/vs/basic-languages/mdx/mdx.js +0 -10
- package/public/vs/basic-languages/mips/mips.js +0 -10
- package/public/vs/basic-languages/msdax/msdax.js +0 -10
- package/public/vs/basic-languages/mysql/mysql.js +0 -10
- package/public/vs/basic-languages/objective-c/objective-c.js +0 -10
- package/public/vs/basic-languages/pascal/pascal.js +0 -10
- package/public/vs/basic-languages/pascaligo/pascaligo.js +0 -10
- package/public/vs/basic-languages/perl/perl.js +0 -10
- package/public/vs/basic-languages/pgsql/pgsql.js +0 -10
- package/public/vs/basic-languages/php/php.js +0 -10
- package/public/vs/basic-languages/pla/pla.js +0 -10
- package/public/vs/basic-languages/postiats/postiats.js +0 -10
- package/public/vs/basic-languages/powerquery/powerquery.js +0 -10
- package/public/vs/basic-languages/powershell/powershell.js +0 -10
- package/public/vs/basic-languages/protobuf/protobuf.js +0 -11
- package/public/vs/basic-languages/pug/pug.js +0 -10
- package/public/vs/basic-languages/python/python.js +0 -10
- package/public/vs/basic-languages/qsharp/qsharp.js +0 -10
- package/public/vs/basic-languages/r/r.js +0 -10
- package/public/vs/basic-languages/razor/razor.js +0 -10
- package/public/vs/basic-languages/redis/redis.js +0 -10
- package/public/vs/basic-languages/redshift/redshift.js +0 -10
- package/public/vs/basic-languages/restructuredtext/restructuredtext.js +0 -10
- package/public/vs/basic-languages/ruby/ruby.js +0 -10
- package/public/vs/basic-languages/rust/rust.js +0 -10
- package/public/vs/basic-languages/sb/sb.js +0 -10
- package/public/vs/basic-languages/scala/scala.js +0 -10
- package/public/vs/basic-languages/scheme/scheme.js +0 -10
- package/public/vs/basic-languages/scss/scss.js +0 -12
- package/public/vs/basic-languages/shell/shell.js +0 -10
- package/public/vs/basic-languages/solidity/solidity.js +0 -10
- package/public/vs/basic-languages/sophia/sophia.js +0 -10
- package/public/vs/basic-languages/sparql/sparql.js +0 -10
- package/public/vs/basic-languages/sql/sql.js +0 -10
- package/public/vs/basic-languages/st/st.js +0 -10
- package/public/vs/basic-languages/swift/swift.js +0 -13
- package/public/vs/basic-languages/systemverilog/systemverilog.js +0 -10
- package/public/vs/basic-languages/tcl/tcl.js +0 -10
- package/public/vs/basic-languages/twig/twig.js +0 -10
- package/public/vs/basic-languages/typescript/typescript.js +0 -10
- package/public/vs/basic-languages/vb/vb.js +0 -10
- package/public/vs/basic-languages/wgsl/wgsl.js +0 -307
- package/public/vs/basic-languages/xml/xml.js +0 -10
- package/public/vs/basic-languages/yaml/yaml.js +0 -10
- package/public/vs/editor/editor.main.css +0 -6
- package/public/vs/editor/editor.main.js +0 -745
- package/public/vs/editor/editor.main.js.gz +0 -0
- package/public/vs/editor/editor.main.nls.de.js +0 -31
- package/public/vs/editor/editor.main.nls.es.js +0 -31
- package/public/vs/editor/editor.main.nls.fr.js +0 -29
- package/public/vs/editor/editor.main.nls.it.js +0 -29
- package/public/vs/editor/editor.main.nls.ja.js +0 -31
- package/public/vs/editor/editor.main.nls.js +0 -29
- package/public/vs/editor/editor.main.nls.ko.js +0 -29
- package/public/vs/editor/editor.main.nls.ru.js +0 -31
- package/public/vs/editor/editor.main.nls.zh-cn.js +0 -31
- package/public/vs/editor/editor.main.nls.zh-tw.js +0 -29
- package/public/vs/language/css/cssMode.js +0 -13
- package/public/vs/language/css/cssWorker.js +0 -81
- package/public/vs/language/css/cssWorker.js.gz +0 -0
- package/public/vs/language/html/htmlMode.js +0 -13
- package/public/vs/language/html/htmlWorker.js +0 -453
- package/public/vs/language/json/jsonMode.js +0 -15
- package/public/vs/language/json/jsonWorker.js +0 -36
- package/public/vs/language/typescript/tsMode.js +0 -20
- package/public/vs/language/typescript/tsWorker.js +0 -37016
- package/public/vs/language/typescript/tsWorker.js.gz +0 -0
- package/public/vs/loader.js +0 -11
- package/public/worker/pdf.worker.min.js +0 -32
- package/src/HeadlessChat.tsx +0 -250
- package/src/LoginPage/components/Login/LoginBox/index.tsx +0 -103
- package/src/LoginPage/components/Login/RegisterBox/index.tsx +0 -181
- package/src/LoginPage/components/Login/index.tsx +0 -101
- package/src/LoginPage/index.tsx +0 -103
- package/src/LoginPage/useServices.ts +0 -53
- package/src/LoginPage/utils.ts +0 -42
- package/src/Preview.tsx +0 -278
- package/src/UseLogingHeadless.tsx +0 -238
- package/src/adopters/GientechChat/Conversations/Item.tsx +0 -132
- package/src/adopters/GientechChat/Conversations/List.tsx +0 -127
- package/src/adopters/GientechChat/Conversations/groupByTime.ts +0 -39
- package/src/adopters/GientechChat/Conversations/index.tsx +0 -102
- package/src/adopters/GientechChat/constants.tsx +0 -33
- package/src/adopters/GientechChat/index.tsx +0 -1242
- package/src/adopters/GientechChat/types.ts +0 -17
- package/src/adopters/HeadLessChat/constants.tsx +0 -32
- package/src/adopters/HeadLessChat/index.tsx +0 -1038
- package/src/adopters/HeadLessChat/types.ts +0 -23
- package/src/adopters/gientechCommon/components/AppError.tsx +0 -32
- package/src/adopters/gientechCommon/components/AppLoading.tsx +0 -75
- package/src/adopters/gientechCommon/components/DisplayError.tsx +0 -33
- package/src/adopters/gientechCommon/components/DisplayLoading.tsx +0 -38
- package/src/adopters/gientechCommon/components/FeedBackModal.tsx +0 -310
- package/src/adopters/gientechCommon/components/FileManager/index.tsx +0 -381
- package/src/adopters/gientechCommon/components/FileManager/style.css +0 -5
- package/src/adopters/gientechCommon/components/Messages/AiChatBox.tsx +0 -530
- package/src/adopters/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +0 -245
- package/src/adopters/gientechCommon/components/Messages/ReferenceCard.tsx +0 -302
- package/src/adopters/gientechCommon/components/Messages/RetriveItem.tsx +0 -194
- package/src/adopters/gientechCommon/components/Messages/UserChatBox.tsx +0 -211
- package/src/adopters/gientechCommon/components/RenameModal.tsx +0 -75
- package/src/adopters/gientechCommon/components/style.less +0 -11
- package/src/adopters/gientechCommon/configs/commonConfig.ts +0 -2
- package/src/adopters/gientechCommon/configs/senderConfig.ts +0 -0
- package/src/adopters/gientechCommon/configs/stylesConfig.ts +0 -142
- package/src/adopters/gientechCommon/hooks/AichatUseController.tsx +0 -308
- package/src/adopters/gientechCommon/slate/converters/deserializers.ts +0 -757
- package/src/adopters/gientechCommon/slate/converters/mockData.ts +0 -232
- package/src/adopters/gientechCommon/slate/converters/slateConverters.ts +0 -258
- package/src/adopters/gientechCommon/slate/richElements/index.tsx +0 -476
- package/src/adopters/gientechCommon/utils/request.ts +0 -37
- package/src/adopters/gientechCommon/utils/serverFn.ts +0 -143
- package/src/assets/img/downArrow.png +0 -0
- package/src/assets/img/excel.png +0 -0
- package/src/assets/img/img.png +0 -0
- package/src/assets/img/pdf.png +0 -0
- package/src/assets/img/ppt.png +0 -0
- package/src/assets/img/txt.png +0 -0
- package/src/assets/img/word.png +0 -0
- package/src/assets/login/homeBg.png +0 -0
- package/src/assets/login/left.jpg +0 -0
- package/src/assets/login/logoImg.png +0 -0
- package/src/assets/style.css +0 -1
- package/src/components/AiChat.tsx +0 -647
- package/src/components/AiChat.types.tsx +0 -110
- package/src/components/DefaultAppError.tsx +0 -7
- package/src/components/DefaultAppLoading.tsx +0 -7
- package/src/components/DefaultDisplayError.tsx +0 -7
- package/src/components/DefaultDisplayLoading.tsx +0 -7
- package/src/components/DefaultNewChatWelcome.tsx +0 -10
- package/src/components/Displayer/DefaultAiChatBox.tsx +0 -64
- package/src/components/Displayer/DefaultUserChatBox.tsx +0 -34
- package/src/components/Displayer/index.tsx +0 -107
- package/src/components/Displayer/slate/converters/deserializers.ts +0 -427
- package/src/components/Displayer/slate/converters/mockData.ts +0 -190
- package/src/components/Displayer/slate/converters/slateConverters.ts +0 -258
- package/src/components/Displayer/slate/richElements/index.tsx +0 -308
- package/src/components/DrawerContent.tsx +0 -105
- package/src/components/DrawerPreview.tsx +0 -36
- package/src/components/DynamicForm.tsx +0 -29
- package/src/components/Loading.tsx +0 -0
- package/src/components/RetrieveTest/components/ChatInput.tsx +0 -198
- package/src/components/RetrieveTest/components/ChatMessage.tsx +0 -894
- package/src/components/RetrieveTest/components/ConfigPanel.tsx +0 -472
- package/src/components/RetrieveTest/components/RichTextEditor.tsx +0 -97
- package/src/components/RetrieveTest/components/VoiceInput.tsx +0 -257
- package/src/components/RetrieveTest/components/config/index.ts +0 -0
- package/src/components/RetrieveTest/components/converters/deserializers.ts +0 -393
- package/src/components/RetrieveTest/components/converters/mockData.ts +0 -190
- package/src/components/RetrieveTest/components/converters/slateConverters.ts +0 -164
- package/src/components/RetrieveTest/components/richElements/index.tsx +0 -339
- package/src/components/RetrieveTest/components/style.css +0 -3
- package/src/components/RetrieveTest/index.tsx +0 -679
- package/src/components/Sender/FileUpload.tsx +0 -76
- package/src/components/Sender/FilesDisplay.tsx +0 -103
- package/src/components/Sender/VoiceInput.tsx +0 -81
- package/src/components/Sender/contexts/BadgeContext.tsx +0 -36
- package/src/components/Sender/index.tsx +0 -545
- package/src/components/Sidebar/Loading.tsx +0 -0
- package/src/components/Sidebar/RetriveConfigPanel.tsx +0 -41
- package/src/components/Sidebar/useDynamicFormItems.tsx +0 -176
- package/src/components/SidebarProp.ts +0 -41
- package/src/components/common/FileCardCommon.tsx +0 -82
- package/src/components/defaultStyleSet.tsx +0 -142
- package/src/components/styles.config.ts +0 -4
- package/src/lib_enter.ts +0 -12
- package/src/main.tsx +0 -12
- package/src/mockForm.ts +0 -91
- package/src/servers/chatApi.ts +0 -43
- package/src/servers/fileApi.ts +0 -12
- package/src/servers/modelApi.ts +0 -19
- package/src/style.css +0 -22
- package/src/testj.js +0 -3
- package/src/type.d.ts +0 -0
- package/src/utils/commonFn.tsx +0 -111
- package/src/utils/index.tsx +0 -94
- package/src/vite-env.d.ts +0 -11
- package/tailwind.config.js +0 -18
- package/tsconfig.app.json +0 -29
- package/tsconfig.app.tsbuildinfo +0 -11
- package/tsconfig.json +0 -13
- package/tsconfig.node.json +0 -22
- package/tsconfig.node.tsbuildinfo +0 -1
- package/vite.config.ts +0 -138
- package/vite.config_mainapp.ts +0 -126
- /package/{dist/HeadlessChat.d.ts → HeadlessChat.d.ts} +0 -0
- /package/{dist/LoginPage → LoginPage}/components/Login/LoginBox/index.d.ts +0 -0
- /package/{dist/LoginPage → LoginPage}/components/Login/RegisterBox/index.d.ts +0 -0
- /package/{dist/LoginPage → LoginPage}/components/Login/index.d.ts +0 -0
- /package/{dist/LoginPage → LoginPage}/index.d.ts +0 -0
- /package/{dist/LoginPage → LoginPage}/useServices.d.ts +0 -0
- /package/{dist/LoginPage → LoginPage}/utils.d.ts +0 -0
- /package/{dist/Preview.d.ts → Preview.d.ts} +0 -0
- /package/{dist/UseLogingHeadless.d.ts → UseLogingHeadless.d.ts} +0 -0
- /package/{dist/adopters → adopters}/GientechChat/Conversations/Item.d.ts +0 -0
- /package/{dist/adopters → adopters}/GientechChat/Conversations/List.d.ts +0 -0
- /package/{dist/adopters → adopters}/GientechChat/Conversations/groupByTime.d.ts +0 -0
- /package/{dist/adopters → adopters}/GientechChat/Conversations/index.d.ts +0 -0
- /package/{dist/adopters → adopters}/GientechChat/constants.d.ts +0 -0
- /package/{dist/adopters → adopters}/GientechChat/index.d.ts +0 -0
- /package/{dist/adopters → adopters}/GientechChat/types.d.ts +0 -0
- /package/{dist/adopters → adopters}/HeadLessChat/constants.d.ts +0 -0
- /package/{dist/adopters → adopters}/HeadLessChat/index.d.ts +0 -0
- /package/{dist/adopters → adopters}/HeadLessChat/types.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/AppError.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/AppLoading.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/DisplayError.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/DisplayLoading.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/FeedBackModal.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/FileManager/index.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/Messages/AiChatBox.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/Messages/GientechNewChatWelcome.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/Messages/ReferenceCard.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/Messages/RetriveItem.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/Messages/UserChatBox.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/components/RenameModal.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/configs/commonConfig.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/configs/senderConfig.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/configs/stylesConfig.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/hooks/AichatUseController.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/slate/converters/deserializers.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/slate/converters/mockData.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/slate/converters/slateConverters.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/slate/richElements/index.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/utils/request.d.ts +0 -0
- /package/{dist/adopters → adopters}/gientechCommon/utils/serverFn.d.ts +0 -0
- /package/{dist/components → components}/AiChat.types.d.ts +0 -0
- /package/{dist/components → components}/DefaultAppError.d.ts +0 -0
- /package/{dist/components → components}/DefaultAppLoading.d.ts +0 -0
- /package/{dist/components → components}/DefaultDisplayError.d.ts +0 -0
- /package/{dist/components → components}/DefaultDisplayLoading.d.ts +0 -0
- /package/{dist/components → components}/DefaultNewChatWelcome.d.ts +0 -0
- /package/{dist/components → components}/Displayer/DefaultAiChatBox.d.ts +0 -0
- /package/{dist/components → components}/Displayer/DefaultUserChatBox.d.ts +0 -0
- /package/{dist/components → components}/Displayer/index.d.ts +0 -0
- /package/{dist/components → components}/Displayer/slate/converters/deserializers.d.ts +0 -0
- /package/{dist/components → components}/Displayer/slate/converters/mockData.d.ts +0 -0
- /package/{dist/components → components}/Displayer/slate/converters/slateConverters.d.ts +0 -0
- /package/{dist/components → components}/Displayer/slate/richElements/index.d.ts +0 -0
- /package/{dist/components → components}/DrawerContent.d.ts +0 -0
- /package/{dist/components → components}/DrawerPreview.d.ts +0 -0
- /package/{dist/components → components}/DynamicForm.d.ts +0 -0
- /package/{dist/components → components}/Loading.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/ChatInput.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/ChatMessage.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/ConfigPanel.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/RichTextEditor.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/VoiceInput.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/config/index.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/converters/deserializers.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/converters/mockData.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/converters/slateConverters.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/components/richElements/index.d.ts +0 -0
- /package/{dist/components → components}/RetrieveTest/index.d.ts +0 -0
- /package/{dist/components → components}/Sender/FileUpload.d.ts +0 -0
- /package/{dist/components → components}/Sender/FilesDisplay.d.ts +0 -0
- /package/{dist/components → components}/Sender/VoiceInput.d.ts +0 -0
- /package/{dist/components → components}/Sender/contexts/BadgeContext.d.ts +0 -0
- /package/{dist/components → components}/Sender/index.d.ts +0 -0
- /package/{dist/components → components}/Sidebar/Loading.d.ts +0 -0
- /package/{dist/components → components}/Sidebar/RetriveConfigPanel.d.ts +0 -0
- /package/{dist/components → components}/Sidebar/useDynamicFormItems.d.ts +0 -0
- /package/{dist/components → components}/SidebarProp.d.ts +0 -0
- /package/{dist/components → components}/common/FileCardCommon.d.ts +0 -0
- /package/{dist/components → components}/defaultStyleSet.d.ts +0 -0
- /package/{dist/components → components}/styles.config.d.ts +0 -0
- /package/{dist/icons → icons}/answerAwartar.png +0 -0
- /package/{dist/icons → icons}/docx-file.png +0 -0
- /package/{dist/icons → icons}/folder.png +0 -0
- /package/{dist/icons → icons}/html.png +0 -0
- /package/{dist/icons → icons}/image.png +0 -0
- /package/{dist/icons → icons}/jpg-file.png +0 -0
- /package/{dist/icons → icons}/json.png +0 -0
- /package/{dist/icons → icons}/md.png +0 -0
- /package/{dist/icons → icons}/pdf.png +0 -0
- /package/{dist/icons → icons}/pptx.png +0 -0
- /package/{dist/icons → icons}/questionAwartar.png +0 -0
- /package/{dist/icons → icons}/sheets.png +0 -0
- /package/{dist/icons → icons}/txt.png +0 -0
- /package/{dist/icons → icons}/xlsx.png +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/lib_enter.d.ts → lib_enter.d.ts} +0 -0
- /package/{dist/libs → libs}/luckysheet/fontAwesome.otf +0 -0
- /package/{dist/libs → libs}/luckysheet/fontawesome-webfont.eot +0 -0
- /package/{dist/libs → libs}/luckysheet/fontawesome-webfont.svg +0 -0
- /package/{dist/libs → libs}/luckysheet/fontawesome-webfont.ttf +0 -0
- /package/{dist/libs → libs}/luckysheet/fontawesome-webfont.woff +0 -0
- /package/{dist/libs → libs}/luckysheet/fontawesome-webfont.woff2 +0 -0
- /package/{dist/libs → libs}/luckysheet/fonts/fontawesome-webfont.ttf +0 -0
- /package/{dist/libs → libs}/luckysheet/fonts/fontawesome-webfont.woff +0 -0
- /package/{dist/libs → libs}/luckysheet/fonts/fontawesome-webfont.woff2 +0 -0
- /package/{dist/libs → libs}/luckysheet/iconfont.css +0 -0
- /package/{dist/libs → libs}/luckysheet/jquery.min.js +0 -0
- /package/{dist/libs → libs}/luckysheet/luckysheet.css +0 -0
- /package/{dist/libs → libs}/luckysheet/luckysheet.umd.js +0 -0
- /package/{dist/libs → libs}/luckysheet/plugin.js +0 -0
- /package/{dist/libs → libs}/luckysheet/plugins.css +0 -0
- /package/{dist/libs → libs}/luckysheet/pluginsCss.css +0 -0
- /package/{dist/main.d.ts → main.d.ts} +0 -0
- /package/{dist/mockForm.d.ts → mockForm.d.ts} +0 -0
- /package/{dist/servers → servers}/chatApi.d.ts +0 -0
- /package/{dist/servers → servers}/fileApi.d.ts +0 -0
- /package/{dist/servers → servers}/modelApi.d.ts +0 -0
- /package/{dist/utils → utils}/commonFn.d.ts +0 -0
- /package/{dist/utils → utils}/index.d.ts +0 -0
- /package/{dist/vite.svg → vite.svg} +0 -0
- /package/{dist/vs → vs}/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.de.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.es.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.fr.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.it.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.ja.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.ko.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.ru.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.zh-cn.js +0 -0
- /package/{dist/vs → vs}/base/common/worker/simpleWorker.nls.zh-tw.js +0 -0
- /package/{dist/vs → vs}/base/worker/workerMain.js +0 -0
- /package/{dist/vs → vs}/basic-languages/abap/abap.js +0 -0
- /package/{dist/vs → vs}/basic-languages/apex/apex.js +0 -0
- /package/{dist/vs → vs}/basic-languages/azcli/azcli.js +0 -0
- /package/{dist/vs → vs}/basic-languages/bat/bat.js +0 -0
- /package/{dist/vs → vs}/basic-languages/bicep/bicep.js +0 -0
- /package/{dist/vs → vs}/basic-languages/cameligo/cameligo.js +0 -0
- /package/{dist/vs → vs}/basic-languages/clojure/clojure.js +0 -0
- /package/{dist/vs → vs}/basic-languages/coffee/coffee.js +0 -0
- /package/{dist/vs → vs}/basic-languages/cpp/cpp.js +0 -0
- /package/{dist/vs → vs}/basic-languages/csharp/csharp.js +0 -0
- /package/{dist/vs → vs}/basic-languages/csp/csp.js +0 -0
- /package/{dist/vs → vs}/basic-languages/css/css.js +0 -0
- /package/{dist/vs → vs}/basic-languages/cypher/cypher.js +0 -0
- /package/{dist/vs → vs}/basic-languages/dart/dart.js +0 -0
- /package/{dist/vs → vs}/basic-languages/dockerfile/dockerfile.js +0 -0
- /package/{dist/vs → vs}/basic-languages/ecl/ecl.js +0 -0
- /package/{dist/vs → vs}/basic-languages/elixir/elixir.js +0 -0
- /package/{dist/vs → vs}/basic-languages/flow9/flow9.js +0 -0
- /package/{dist/vs → vs}/basic-languages/freemarker2/freemarker2.js +0 -0
- /package/{dist/vs → vs}/basic-languages/fsharp/fsharp.js +0 -0
- /package/{dist/vs → vs}/basic-languages/go/go.js +0 -0
- /package/{dist/vs → vs}/basic-languages/graphql/graphql.js +0 -0
- /package/{dist/vs → vs}/basic-languages/handlebars/handlebars.js +0 -0
- /package/{dist/vs → vs}/basic-languages/hcl/hcl.js +0 -0
- /package/{dist/vs → vs}/basic-languages/html/html.js +0 -0
- /package/{dist/vs → vs}/basic-languages/ini/ini.js +0 -0
- /package/{dist/vs → vs}/basic-languages/java/java.js +0 -0
- /package/{dist/vs → vs}/basic-languages/javascript/javascript.js +0 -0
- /package/{dist/vs → vs}/basic-languages/julia/julia.js +0 -0
- /package/{dist/vs → vs}/basic-languages/kotlin/kotlin.js +0 -0
- /package/{dist/vs → vs}/basic-languages/less/less.js +0 -0
- /package/{dist/vs → vs}/basic-languages/lexon/lexon.js +0 -0
- /package/{dist/vs → vs}/basic-languages/liquid/liquid.js +0 -0
- /package/{dist/vs → vs}/basic-languages/lua/lua.js +0 -0
- /package/{dist/vs → vs}/basic-languages/m3/m3.js +0 -0
- /package/{dist/vs → vs}/basic-languages/markdown/markdown.js +0 -0
- /package/{dist/vs → vs}/basic-languages/mdx/mdx.js +0 -0
- /package/{dist/vs → vs}/basic-languages/mips/mips.js +0 -0
- /package/{dist/vs → vs}/basic-languages/msdax/msdax.js +0 -0
- /package/{dist/vs → vs}/basic-languages/mysql/mysql.js +0 -0
- /package/{dist/vs → vs}/basic-languages/objective-c/objective-c.js +0 -0
- /package/{dist/vs → vs}/basic-languages/pascal/pascal.js +0 -0
- /package/{dist/vs → vs}/basic-languages/pascaligo/pascaligo.js +0 -0
- /package/{dist/vs → vs}/basic-languages/perl/perl.js +0 -0
- /package/{dist/vs → vs}/basic-languages/pgsql/pgsql.js +0 -0
- /package/{dist/vs → vs}/basic-languages/php/php.js +0 -0
- /package/{dist/vs → vs}/basic-languages/pla/pla.js +0 -0
- /package/{dist/vs → vs}/basic-languages/postiats/postiats.js +0 -0
- /package/{dist/vs → vs}/basic-languages/powerquery/powerquery.js +0 -0
- /package/{dist/vs → vs}/basic-languages/powershell/powershell.js +0 -0
- /package/{dist/vs → vs}/basic-languages/protobuf/protobuf.js +0 -0
- /package/{dist/vs → vs}/basic-languages/pug/pug.js +0 -0
- /package/{dist/vs → vs}/basic-languages/python/python.js +0 -0
- /package/{dist/vs → vs}/basic-languages/qsharp/qsharp.js +0 -0
- /package/{dist/vs → vs}/basic-languages/r/r.js +0 -0
- /package/{dist/vs → vs}/basic-languages/razor/razor.js +0 -0
- /package/{dist/vs → vs}/basic-languages/redis/redis.js +0 -0
- /package/{dist/vs → vs}/basic-languages/redshift/redshift.js +0 -0
- /package/{dist/vs → vs}/basic-languages/restructuredtext/restructuredtext.js +0 -0
- /package/{dist/vs → vs}/basic-languages/ruby/ruby.js +0 -0
- /package/{dist/vs → vs}/basic-languages/rust/rust.js +0 -0
- /package/{dist/vs → vs}/basic-languages/sb/sb.js +0 -0
- /package/{dist/vs → vs}/basic-languages/scala/scala.js +0 -0
- /package/{dist/vs → vs}/basic-languages/scheme/scheme.js +0 -0
- /package/{dist/vs → vs}/basic-languages/scss/scss.js +0 -0
- /package/{dist/vs → vs}/basic-languages/shell/shell.js +0 -0
- /package/{dist/vs → vs}/basic-languages/solidity/solidity.js +0 -0
- /package/{dist/vs → vs}/basic-languages/sophia/sophia.js +0 -0
- /package/{dist/vs → vs}/basic-languages/sparql/sparql.js +0 -0
- /package/{dist/vs → vs}/basic-languages/sql/sql.js +0 -0
- /package/{dist/vs → vs}/basic-languages/st/st.js +0 -0
- /package/{dist/vs → vs}/basic-languages/swift/swift.js +0 -0
- /package/{dist/vs → vs}/basic-languages/systemverilog/systemverilog.js +0 -0
- /package/{dist/vs → vs}/basic-languages/tcl/tcl.js +0 -0
- /package/{dist/vs → vs}/basic-languages/twig/twig.js +0 -0
- /package/{dist/vs → vs}/basic-languages/typescript/typescript.js +0 -0
- /package/{dist/vs → vs}/basic-languages/vb/vb.js +0 -0
- /package/{dist/vs → vs}/basic-languages/wgsl/wgsl.js +0 -0
- /package/{dist/vs → vs}/basic-languages/xml/xml.js +0 -0
- /package/{dist/vs → vs}/basic-languages/yaml/yaml.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.css +0 -0
- /package/{dist/vs → vs}/editor/editor.main.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.js.gz +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.de.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.es.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.fr.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.it.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.ja.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.ko.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.ru.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.zh-cn.js +0 -0
- /package/{dist/vs → vs}/editor/editor.main.nls.zh-tw.js +0 -0
- /package/{dist/vs → vs}/language/css/cssMode.js +0 -0
- /package/{dist/vs → vs}/language/css/cssWorker.js +0 -0
- /package/{dist/vs → vs}/language/css/cssWorker.js.gz +0 -0
- /package/{dist/vs → vs}/language/html/htmlMode.js +0 -0
- /package/{dist/vs → vs}/language/html/htmlWorker.js +0 -0
- /package/{dist/vs → vs}/language/json/jsonMode.js +0 -0
- /package/{dist/vs → vs}/language/json/jsonWorker.js +0 -0
- /package/{dist/vs → vs}/language/typescript/tsMode.js +0 -0
- /package/{dist/vs → vs}/language/typescript/tsWorker.js +0 -0
- /package/{dist/vs → vs}/language/typescript/tsWorker.js.gz +0 -0
- /package/{dist/vs → vs}/loader.js +0 -0
- /package/{dist/worker → worker}/pdf.worker.min.js +0 -0
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
// 富文本元素渲染统一出口
|
|
2
|
-
|
|
3
|
-
// 迁移自ChatMessage.tsx
|
|
4
|
-
import React, { useMemo } from 'react';
|
|
5
|
-
|
|
6
|
-
// 新增工具函数:判断 heading 是否在 li 内
|
|
7
|
-
function isInListItem(attributes: any) {
|
|
8
|
-
return (
|
|
9
|
-
attributes &&
|
|
10
|
-
attributes['data-slate-node'] === 'element' &&
|
|
11
|
-
attributes['data-slate-leaf'] !== undefined &&
|
|
12
|
-
attributes['data-slate-list-item'] === 'true'
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// 优化 heading 渲染,li 内外样式区分
|
|
17
|
-
const HeadingOne = ({ attributes, children, inListItem }: any) => (
|
|
18
|
-
<h1
|
|
19
|
-
{...attributes}
|
|
20
|
-
className={
|
|
21
|
-
inListItem
|
|
22
|
-
? 'text-base font-bold mt-2 mb-1 text-gray-900'
|
|
23
|
-
: 'text-xl font-bold mb-6 text-gradient bg-clip-text text-transparent bg-gradient-to-r from-blue-600 to-cyan-500'
|
|
24
|
-
}
|
|
25
|
-
style={inListItem ? { marginTop: 12, marginBottom: 4 } : {}}
|
|
26
|
-
>
|
|
27
|
-
{children}
|
|
28
|
-
</h1>
|
|
29
|
-
);
|
|
30
|
-
const HeadingTwo = ({ attributes, children, inListItem }: any) => (
|
|
31
|
-
<h2
|
|
32
|
-
{...attributes}
|
|
33
|
-
className={
|
|
34
|
-
inListItem
|
|
35
|
-
? 'text-base font-semibold mt-2 mb-1 text-gray-800'
|
|
36
|
-
: 'text-lg font-semibold mb-4 text-gray-600 border-l-4 pl-3'
|
|
37
|
-
}
|
|
38
|
-
style={inListItem ? { marginTop: 10, marginBottom: 4 } : {}}
|
|
39
|
-
>
|
|
40
|
-
{children}
|
|
41
|
-
</h2>
|
|
42
|
-
);
|
|
43
|
-
const HeadingThree = ({ attributes, children, inListItem }: any) => (
|
|
44
|
-
<h3
|
|
45
|
-
{...attributes}
|
|
46
|
-
className={
|
|
47
|
-
inListItem
|
|
48
|
-
? 'text-base font-medium mt-2 mb-1 text-gray-700'
|
|
49
|
-
: "text-lg font-medium mb-3 text-gray-600 flex items-center before:content-[''] before:w-2 before:h-2 before:rounded-full before:bg-blue-500 before:mr-2"
|
|
50
|
-
}
|
|
51
|
-
style={inListItem ? { marginTop: 8, marginBottom: 2 } : {}}
|
|
52
|
-
>
|
|
53
|
-
{children}
|
|
54
|
-
</h3>
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
export const renderElement = (props: any) => {
|
|
58
|
-
const { element, children, attributes, finish } = props;
|
|
59
|
-
//console.log('------------------renderElement element:', props);
|
|
60
|
-
// const respTime = useMemo(() => {
|
|
61
|
-
// if (element.type === 'think') {
|
|
62
|
-
// if (element.children?.length) {
|
|
63
|
-
// // console.log('element.children[0].respTime', element.children[0].respTime);
|
|
64
|
-
|
|
65
|
-
// return element.children[0].respTime;
|
|
66
|
-
// } else {
|
|
67
|
-
// return null;
|
|
68
|
-
// }
|
|
69
|
-
// } else {
|
|
70
|
-
// return null;
|
|
71
|
-
// }
|
|
72
|
-
// }, [element]);
|
|
73
|
-
// 判断是否在 list-item 内
|
|
74
|
-
const inListItem =
|
|
75
|
-
element &&
|
|
76
|
-
element.type &&
|
|
77
|
-
element.type.startsWith('heading') &&
|
|
78
|
-
props.parent &&
|
|
79
|
-
props.parent.type === 'list-item';
|
|
80
|
-
switch (element.type) {
|
|
81
|
-
case 'paragraph':
|
|
82
|
-
// 渲染文章尾部所有retrive-tag图片
|
|
83
|
-
if (props.isLast) {
|
|
84
|
-
// 收集所有retrive-tag的imageUrls
|
|
85
|
-
const allImageUrls: string[] = [];
|
|
86
|
-
function collectImages(nodes: any[]) {
|
|
87
|
-
for (const node of nodes) {
|
|
88
|
-
if (node && typeof node === 'object') {
|
|
89
|
-
if (Array.isArray(node)) {
|
|
90
|
-
collectImages(node);
|
|
91
|
-
} else {
|
|
92
|
-
if (node.retrive && node.imageUrls && Array.isArray(node.imageUrls)) {
|
|
93
|
-
allImageUrls.push(...node.imageUrls);
|
|
94
|
-
}
|
|
95
|
-
if (node.children) collectImages(node.children);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
collectImages([props.editor?.children || element]);
|
|
101
|
-
if (allImageUrls.length > 0) {
|
|
102
|
-
return (
|
|
103
|
-
<div>
|
|
104
|
-
<p {...attributes} className="mb-4 leading-7 text-gray-700 font-normal">{children}</p>
|
|
105
|
-
<div className="mt-4 flex flex-wrap gap-3">
|
|
106
|
-
{allImageUrls.map((url, idx) => (
|
|
107
|
-
<div key={url+idx} className="w-32 h-32 bg-gray-100 flex items-center justify-center rounded overflow-hidden relative">
|
|
108
|
-
<img
|
|
109
|
-
src={url}
|
|
110
|
-
alt="retrive-img"
|
|
111
|
-
className="object-contain w-full h-full"
|
|
112
|
-
style={{ display: 'block' }}
|
|
113
|
-
onLoad={e => { e.currentTarget.style.background = 'none'; }}
|
|
114
|
-
onError={e => { e.currentTarget.style.background = '#f00'; }}
|
|
115
|
-
/>
|
|
116
|
-
<span className="absolute left-0 right-0 top-0 bottom-0 flex items-center justify-center text-xs text-gray-400" style={{display:'none'}}>加载中...</span>
|
|
117
|
-
</div>
|
|
118
|
-
))}
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return (
|
|
125
|
-
<p {...attributes} className="mb-4 leading-7 text-gray-700 font-normal">
|
|
126
|
-
{children}
|
|
127
|
-
</p>
|
|
128
|
-
);
|
|
129
|
-
case 'heading-one':
|
|
130
|
-
return <HeadingOne attributes={attributes} children={children} inListItem={inListItem} />;
|
|
131
|
-
case 'heading-two':
|
|
132
|
-
return <HeadingTwo attributes={attributes} children={children} inListItem={inListItem} />;
|
|
133
|
-
case 'heading-three':
|
|
134
|
-
return <HeadingThree attributes={attributes} children={children} inListItem={inListItem} />;
|
|
135
|
-
case 'bulleted-list':
|
|
136
|
-
return (
|
|
137
|
-
<ul {...attributes} className="mb-4 space-y-2 list-none pl-4">
|
|
138
|
-
{children}
|
|
139
|
-
</ul>
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
case 'numbered-list':
|
|
143
|
-
return (
|
|
144
|
-
<ol {...attributes} className="mb-1 space-y-2 list-decimal pl-5 marker:text-gray-500 ">
|
|
145
|
-
{children}
|
|
146
|
-
</ol>
|
|
147
|
-
);
|
|
148
|
-
case 'list-item':
|
|
149
|
-
//console.log(3333,props,parent)
|
|
150
|
-
return (
|
|
151
|
-
<li {...attributes} className="relative pl-2">
|
|
152
|
-
{children}
|
|
153
|
-
</li>
|
|
154
|
-
);
|
|
155
|
-
case 'table':
|
|
156
|
-
return (
|
|
157
|
-
<div
|
|
158
|
-
style={{
|
|
159
|
-
display: 'flex',
|
|
160
|
-
msOverflowX: 'scroll',
|
|
161
|
-
width: '100%',
|
|
162
|
-
maxWidth: '65vw',
|
|
163
|
-
overflowX: 'auto',
|
|
164
|
-
margin: '1rem 0',
|
|
165
|
-
}}
|
|
166
|
-
>
|
|
167
|
-
<table
|
|
168
|
-
style={{
|
|
169
|
-
minWidth: 380,
|
|
170
|
-
maxwidth: '100%',
|
|
171
|
-
borderCollapse: 'collapse',
|
|
172
|
-
border: '1px solid #e5e7eb',
|
|
173
|
-
}}
|
|
174
|
-
{...attributes}
|
|
175
|
-
>
|
|
176
|
-
<tbody>{children}</tbody>
|
|
177
|
-
</table>
|
|
178
|
-
</div>
|
|
179
|
-
);
|
|
180
|
-
case 'table-row':
|
|
181
|
-
return (
|
|
182
|
-
<tr style={{ borderBottom: '1px solid #e5e7eb' }} {...attributes}>
|
|
183
|
-
{children}
|
|
184
|
-
</tr>
|
|
185
|
-
);
|
|
186
|
-
case 'table-cell':
|
|
187
|
-
if (element.header) {
|
|
188
|
-
return (
|
|
189
|
-
<th
|
|
190
|
-
style={{
|
|
191
|
-
padding: '0.75rem 1.5rem',
|
|
192
|
-
textAlign: 'left',
|
|
193
|
-
fontSize: '0.875rem',
|
|
194
|
-
fontWeight: 600,
|
|
195
|
-
color: '#1e3a8a',
|
|
196
|
-
textTransform: 'uppercase',
|
|
197
|
-
letterSpacing: '0.05em',
|
|
198
|
-
borderRight: '1px solid #93c5fd',
|
|
199
|
-
backgroundColor: '#f0f9ff',
|
|
200
|
-
}}
|
|
201
|
-
{...attributes}
|
|
202
|
-
>
|
|
203
|
-
{children}
|
|
204
|
-
</th>
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
return (
|
|
208
|
-
<td
|
|
209
|
-
style={{
|
|
210
|
-
padding: '0.75rem 1.5rem',
|
|
211
|
-
fontSize: '0.875rem',
|
|
212
|
-
color: '#374151',
|
|
213
|
-
borderRight: '1px solid #e5e7eb',
|
|
214
|
-
}}
|
|
215
|
-
{...attributes}
|
|
216
|
-
>
|
|
217
|
-
{children}
|
|
218
|
-
</td>
|
|
219
|
-
);
|
|
220
|
-
case 'block-quote':
|
|
221
|
-
return (
|
|
222
|
-
<blockquote
|
|
223
|
-
{...attributes}
|
|
224
|
-
className="border-l-4 border-blue-500 bg-blue-50 pl-4 py-2 mb-4 rounded-r-lg italic text-gray-700"
|
|
225
|
-
>
|
|
226
|
-
{children}
|
|
227
|
-
</blockquote>
|
|
228
|
-
);
|
|
229
|
-
case 'code-block':
|
|
230
|
-
const codeLines = element.children[0]?.text?.split('\n') || [''];
|
|
231
|
-
return (
|
|
232
|
-
<div
|
|
233
|
-
{...attributes}
|
|
234
|
-
className="mb-4 w-full rounded-lg overflow-x-scroll bg-[#f6f8fa] border border-[#d0d7de]"
|
|
235
|
-
>
|
|
236
|
-
<div className="flex w-full">
|
|
237
|
-
{/* 行号区域 */}
|
|
238
|
-
<div className="py-4 pr-4 pl-3 text-right select-none bg-[#f6f8fa] border-r border-[#d0d7de] text-gray-400 font-mono text-xs">
|
|
239
|
-
{codeLines.map((_: string, i: number) => (
|
|
240
|
-
<div key={i} className="leading-5">
|
|
241
|
-
{i + 1}
|
|
242
|
-
</div>
|
|
243
|
-
))}
|
|
244
|
-
</div>
|
|
245
|
-
{/* 代码区域 */}
|
|
246
|
-
<pre className="flex-1 p-4 m-0 overflow-x-auto bg-[#f6f8fa] text-[#1f2328]">
|
|
247
|
-
<code className="font-mono text-sm leading-5">{children}</code>
|
|
248
|
-
</pre>
|
|
249
|
-
</div>
|
|
250
|
-
</div>
|
|
251
|
-
);
|
|
252
|
-
case 'think':
|
|
253
|
-
if (!element.thinkContent) return <></>;
|
|
254
|
-
// 1. 获取唯一 key
|
|
255
|
-
const thinkKey =
|
|
256
|
-
element.id ||
|
|
257
|
-
element.queryId ||
|
|
258
|
-
props.parentIndex ||
|
|
259
|
-
element.key ||
|
|
260
|
-
Math.random().toString(36).slice(2);
|
|
261
|
-
// 2. 获取展开状态和 toggle 回调
|
|
262
|
-
console.log('props.thinkExpandMap', props.thinkExpandMap);
|
|
263
|
-
|
|
264
|
-
const expanded =
|
|
265
|
-
props.thinkExpandMap?.[thinkKey] === undefined
|
|
266
|
-
? element.finish
|
|
267
|
-
? false
|
|
268
|
-
: true
|
|
269
|
-
: props.thinkExpandMap?.[thinkKey];
|
|
270
|
-
|
|
271
|
-
const onToggle = props.onThinkToggle;
|
|
272
|
-
// 3. 展示内容
|
|
273
|
-
let displayChildren = children;
|
|
274
|
-
const arr = React.Children.toArray(children);
|
|
275
|
-
const needExpand = arr.length > 3;
|
|
276
|
-
if (!needExpand) {
|
|
277
|
-
displayChildren = arr;
|
|
278
|
-
} else if (!expanded) {
|
|
279
|
-
displayChildren = (
|
|
280
|
-
<>
|
|
281
|
-
{arr.slice(0, 2)}
|
|
282
|
-
<span style={{ color: '#aaa' }}> ... </span>
|
|
283
|
-
</>
|
|
284
|
-
);
|
|
285
|
-
} else {
|
|
286
|
-
displayChildren = arr;
|
|
287
|
-
}
|
|
288
|
-
return (
|
|
289
|
-
<div
|
|
290
|
-
{...attributes}
|
|
291
|
-
style={{
|
|
292
|
-
background: '#f8fafc',
|
|
293
|
-
borderRadius: '8px',
|
|
294
|
-
border: '1px dashed #e0e7ef',
|
|
295
|
-
color: '#b0b8c9',
|
|
296
|
-
margin: '16px 0',
|
|
297
|
-
padding: '0',
|
|
298
|
-
position: 'relative',
|
|
299
|
-
fontStyle: 'italic',
|
|
300
|
-
overflow: 'hidden',
|
|
301
|
-
display: 'flex',
|
|
302
|
-
}}
|
|
303
|
-
className="relative my-4"
|
|
304
|
-
>
|
|
305
|
-
<div
|
|
306
|
-
style={{
|
|
307
|
-
width: 4,
|
|
308
|
-
background: 'linear-gradient(to bottom, #e0e7ef 60%, #f1f5f9 100%)',
|
|
309
|
-
borderRadius: '2px',
|
|
310
|
-
marginRight: 12,
|
|
311
|
-
minHeight: '100%',
|
|
312
|
-
padding: '12px 0',
|
|
313
|
-
}}
|
|
314
|
-
/>
|
|
315
|
-
<div style={{ flex: 1 }}>
|
|
316
|
-
<div
|
|
317
|
-
style={{ color: '#b0b8c9', fontSize: '13px', lineHeight: 1.7, padding: '8px 12px' }}
|
|
318
|
-
>
|
|
319
|
-
{displayChildren}
|
|
320
|
-
{needExpand && (
|
|
321
|
-
<button
|
|
322
|
-
style={{
|
|
323
|
-
color: '#1890ff',
|
|
324
|
-
marginLeft: 8,
|
|
325
|
-
fontSize: 12,
|
|
326
|
-
background: 'none',
|
|
327
|
-
border: 'none',
|
|
328
|
-
cursor: 'pointer',
|
|
329
|
-
}}
|
|
330
|
-
onClick={e => {
|
|
331
|
-
e.stopPropagation();
|
|
332
|
-
onToggle && onToggle(thinkKey);
|
|
333
|
-
}}
|
|
334
|
-
>
|
|
335
|
-
{expanded ? '收起' : '展开'}
|
|
336
|
-
</button>
|
|
337
|
-
)}
|
|
338
|
-
</div>
|
|
339
|
-
</div>
|
|
340
|
-
</div>
|
|
341
|
-
);
|
|
342
|
-
|
|
343
|
-
default:
|
|
344
|
-
return (
|
|
345
|
-
<div {...attributes} className="mb-4">
|
|
346
|
-
{children}
|
|
347
|
-
</div>
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
export const renderLeaf = (props: any) => {
|
|
353
|
-
const { attributes, children, leaf } = props;
|
|
354
|
-
let el = children;
|
|
355
|
-
|
|
356
|
-
// retrive-tag 行内高亮渲染
|
|
357
|
-
if (leaf.retrive) {
|
|
358
|
-
// 获取全局编号映射
|
|
359
|
-
let retriveTagIndexMap = props.retriveTagIndexMap;
|
|
360
|
-
if (!retriveTagIndexMap && props.editor && props.editor.children && props.editor.children._retriveTagIndexMap) {
|
|
361
|
-
retriveTagIndexMap = props.editor.children._retriveTagIndexMap;
|
|
362
|
-
}
|
|
363
|
-
// 只渲染indexId,阿拉伯数字
|
|
364
|
-
let num = leaf.indexId;
|
|
365
|
-
if (!num && leaf.id && retriveTagIndexMap && retriveTagIndexMap[leaf.id]) {
|
|
366
|
-
num = retriveTagIndexMap[leaf.id];
|
|
367
|
-
}
|
|
368
|
-
el = (
|
|
369
|
-
<span
|
|
370
|
-
{...attributes}
|
|
371
|
-
style={{
|
|
372
|
-
display: 'inline-block',
|
|
373
|
-
background: '#e6f7ff',
|
|
374
|
-
color: '#1890ff',
|
|
375
|
-
border: '1px solid rgba(114,187,255,0.3)',
|
|
376
|
-
borderRadius: 6,
|
|
377
|
-
padding: '1px 6px',
|
|
378
|
-
margin: '0 2px',
|
|
379
|
-
fontWeight: 600,
|
|
380
|
-
fontSize: 12,
|
|
381
|
-
lineHeight: '17px',
|
|
382
|
-
cursor: 'pointer',
|
|
383
|
-
verticalAlign: 'middle',
|
|
384
|
-
}}
|
|
385
|
-
onClick={() => {
|
|
386
|
-
if (props.onRetriveTagClick) {
|
|
387
|
-
props.onRetriveTagClick(leaf, attributes);
|
|
388
|
-
}
|
|
389
|
-
}}
|
|
390
|
-
onMouseEnter={e => (e.currentTarget.style.background = '#bae7ff')}
|
|
391
|
-
onMouseLeave={e => (e.currentTarget.style.background = '#e6f7ff')}
|
|
392
|
-
>
|
|
393
|
-
{num}
|
|
394
|
-
</span>
|
|
395
|
-
);
|
|
396
|
-
return el;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
if (leaf.code) {
|
|
400
|
-
el = (
|
|
401
|
-
<code
|
|
402
|
-
style={{
|
|
403
|
-
padding: '0.125rem 0.375rem',
|
|
404
|
-
margin: '0 0.125rem',
|
|
405
|
-
borderRadius: '0.25rem',
|
|
406
|
-
backgroundColor: '#f6f8fa',
|
|
407
|
-
color: '#1f2328',
|
|
408
|
-
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace',
|
|
409
|
-
fontSize: '0.875rem',
|
|
410
|
-
border: '1px solid #d0d7de',
|
|
411
|
-
fontWeight: leaf.bold ? 600 : 'normal',
|
|
412
|
-
fontStyle: leaf.italic ? 'italic' : 'normal',
|
|
413
|
-
textDecoration:
|
|
414
|
-
[leaf.underline && 'underline', leaf.strikethrough && 'line-through']
|
|
415
|
-
.filter(Boolean)
|
|
416
|
-
.join(' ') || 'none',
|
|
417
|
-
}}
|
|
418
|
-
>
|
|
419
|
-
{el}
|
|
420
|
-
</code>
|
|
421
|
-
);
|
|
422
|
-
} else {
|
|
423
|
-
const style: React.CSSProperties = {
|
|
424
|
-
fontWeight: leaf.bold ? 600 : 'normal',
|
|
425
|
-
fontStyle: leaf.italic ? 'italic' : 'normal',
|
|
426
|
-
textDecoration:
|
|
427
|
-
[leaf.underline && 'underline', leaf.strikethrough && 'line-through']
|
|
428
|
-
.filter(Boolean)
|
|
429
|
-
.join(' ') || 'none',
|
|
430
|
-
color: leaf.strikethrough ? '#6b7280' : 'inherit',
|
|
431
|
-
};
|
|
432
|
-
el = <span style={style}>{el}</span>;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
if (leaf.link) {
|
|
436
|
-
el = (
|
|
437
|
-
<a
|
|
438
|
-
href={leaf.link}
|
|
439
|
-
target="_blank"
|
|
440
|
-
rel="noopener noreferrer"
|
|
441
|
-
style={{
|
|
442
|
-
color: '#3b82f6',
|
|
443
|
-
textDecoration: 'underline',
|
|
444
|
-
}}
|
|
445
|
-
onMouseEnter={e => {
|
|
446
|
-
e.currentTarget.style.color = '#2563eb';
|
|
447
|
-
}}
|
|
448
|
-
onMouseLeave={e => {
|
|
449
|
-
e.currentTarget.style.color = '#3b82f6';
|
|
450
|
-
}}
|
|
451
|
-
>
|
|
452
|
-
{el}
|
|
453
|
-
</a>
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
return <span {...attributes}>{el}</span>;
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
// 递归渲染,传递 parent
|
|
461
|
-
export function renderNodesWithParent(nodes: any[], parent: any = null): React.ReactNode[] {
|
|
462
|
-
return nodes.map((node: any, i: number) =>
|
|
463
|
-
React.cloneElement(
|
|
464
|
-
renderElement({
|
|
465
|
-
element: node,
|
|
466
|
-
attributes: {},
|
|
467
|
-
children:
|
|
468
|
-
node.children && Array.isArray(node.children)
|
|
469
|
-
? renderNodesWithParent(node.children, node)
|
|
470
|
-
: node.children,
|
|
471
|
-
parent,
|
|
472
|
-
}),
|
|
473
|
-
{ key: i }
|
|
474
|
-
)
|
|
475
|
-
);
|
|
476
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import { message } from 'antd';
|
|
3
|
-
|
|
4
|
-
const request = axios.create({
|
|
5
|
-
timeout: 15000,
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
// 响应拦截器统一处理错误
|
|
9
|
-
request.interceptors.response.use(
|
|
10
|
-
response => {
|
|
11
|
-
if (response.data && response.data.success === false) {
|
|
12
|
-
message.error(response.data.errorMsg || '请求失败');
|
|
13
|
-
return Promise.reject(response.data);
|
|
14
|
-
}
|
|
15
|
-
return response;
|
|
16
|
-
},
|
|
17
|
-
error => {
|
|
18
|
-
// 401 特殊处理
|
|
19
|
-
if (error?.response?.status === 401) {
|
|
20
|
-
const authError = new Error('Unauthorized');
|
|
21
|
-
(authError as any).isAuthError = true;
|
|
22
|
-
(authError as any).origin = error;
|
|
23
|
-
return Promise.reject(authError);
|
|
24
|
-
}
|
|
25
|
-
if (error?.response?.status === 500) {
|
|
26
|
-
const authError = new Error('Server Error');
|
|
27
|
-
(authError as any).isAuthError = true;
|
|
28
|
-
(authError as any).origin = error;
|
|
29
|
-
return Promise.reject(authError);
|
|
30
|
-
}
|
|
31
|
-
// 其它错误可以弹窗
|
|
32
|
-
// message.error(error?.response?.data?.errorMsg || error.message || '网络错误');
|
|
33
|
-
return Promise.reject(error);
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
export default request;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { message } from 'antd';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const handleFeedBack = async (
|
|
6
|
-
config: { url: string; token: string },
|
|
7
|
-
data: { restult: number; queryId: string },
|
|
8
|
-
cb: () => void
|
|
9
|
-
) => {
|
|
10
|
-
try {
|
|
11
|
-
axios
|
|
12
|
-
.post(`${config.url}/qa/feedback`, data, {
|
|
13
|
-
headers: { Authorization: config.token },
|
|
14
|
-
})
|
|
15
|
-
.then(res => {
|
|
16
|
-
if (res.data.success) {
|
|
17
|
-
cb && cb();
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
} catch (error) {
|
|
21
|
-
console.log('error', error);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const handleCancelFeedBack = async (
|
|
26
|
-
config: { url: string; token: string },
|
|
27
|
-
data: { queryId: string },
|
|
28
|
-
cb: () => void
|
|
29
|
-
) => {
|
|
30
|
-
try {
|
|
31
|
-
axios
|
|
32
|
-
.delete(`${config.url}/qa/feedback/cancel?queryId=${data.queryId}`, {
|
|
33
|
-
headers: { Authorization: config.token },
|
|
34
|
-
})
|
|
35
|
-
.then(res => {
|
|
36
|
-
if (res.data.success) {
|
|
37
|
-
cb && cb();
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
} catch (error) {
|
|
41
|
-
console.log('error', error);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
///qa/feedback/que/list
|
|
45
|
-
export const getFeedbackList = (config: { url: string; token: string }, cb: (arg: any) => void) => {
|
|
46
|
-
try {
|
|
47
|
-
axios
|
|
48
|
-
.get(`${config.url}/qa/feedback/que/list`, {
|
|
49
|
-
headers: { Authorization: config.token },
|
|
50
|
-
})
|
|
51
|
-
.then(res => {
|
|
52
|
-
if (res.data.success) {
|
|
53
|
-
cb && cb(res.data.data);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.log('error', error);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const handleRename = async (
|
|
62
|
-
config: { url: string; token: string },
|
|
63
|
-
data: { label: string; sessionId: string },
|
|
64
|
-
cb: (arg: any) => void
|
|
65
|
-
) => {
|
|
66
|
-
try {
|
|
67
|
-
axios
|
|
68
|
-
.post(`${config.url}/qa/dialogue/reName`, data, {
|
|
69
|
-
headers: { Authorization: config.token },
|
|
70
|
-
})
|
|
71
|
-
.then(res => {
|
|
72
|
-
if (res.data.success) {
|
|
73
|
-
cb && cb(res);
|
|
74
|
-
} else {
|
|
75
|
-
message.error('编辑名字失败');
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
.catch(res => {
|
|
79
|
-
if (res?.response?.data?.errorMsg) {
|
|
80
|
-
message.error(res.response.data.errorMsg);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
} catch (error) {
|
|
84
|
-
console.log('error', error);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const handleDeleteConversation = async (
|
|
89
|
-
config: { url: string; token: string },
|
|
90
|
-
data: { sessionId: string },
|
|
91
|
-
cb: (arg: any) => void
|
|
92
|
-
) => {
|
|
93
|
-
try {
|
|
94
|
-
axios
|
|
95
|
-
.delete(`${config.url}/qa/dialogue/delete?sessionId=${data.sessionId}`, {
|
|
96
|
-
headers: { Authorization: config.token },
|
|
97
|
-
})
|
|
98
|
-
.then(res => {
|
|
99
|
-
if (res.data.success) {
|
|
100
|
-
cb && cb(res.data);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.log('error', error);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// 删除临时上传文件
|
|
109
|
-
export const removeFilefromTempUpload = async (
|
|
110
|
-
config: { url: string; token: string },
|
|
111
|
-
params: { uid: string; queryId?: string },
|
|
112
|
-
cb?: (success: boolean, res?: any) => void
|
|
113
|
-
) => {
|
|
114
|
-
try {
|
|
115
|
-
const { uid, queryId } = params;
|
|
116
|
-
let url = `${config.url}/index/knowledgeBase/file/deleteByUid?uid=${uid}`;
|
|
117
|
-
if (queryId) url += `&queryId=${queryId}`;
|
|
118
|
-
console.log('[DEBUG] removeFilefromTempUpload 请求', { url, token: config.token, uid, queryId });
|
|
119
|
-
axios
|
|
120
|
-
.delete(url, {
|
|
121
|
-
headers: { Authorization: config.token },
|
|
122
|
-
})
|
|
123
|
-
.then(res => {
|
|
124
|
-
console.log('[DEBUG] removeFilefromTempUpload 响应', res);
|
|
125
|
-
if (res.data.success) {
|
|
126
|
-
console.log('[DEBUG] removeFilefromTempUpload 回调 true', res);
|
|
127
|
-
cb && cb(true, res);
|
|
128
|
-
} else {
|
|
129
|
-
console.log('[DEBUG] removeFilefromTempUpload 回调 false', res);
|
|
130
|
-
cb && cb(false, res);
|
|
131
|
-
}
|
|
132
|
-
})
|
|
133
|
-
.catch((err) => {
|
|
134
|
-
console.log('[DEBUG] removeFilefromTempUpload 请求异常', err);
|
|
135
|
-
cb && cb(false, err);
|
|
136
|
-
});
|
|
137
|
-
} catch (error) {
|
|
138
|
-
console.log('[DEBUG] removeFilefromTempUpload try/catch 异常', error);
|
|
139
|
-
cb && cb(false, error);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
|
|
Binary file
|
package/src/assets/img/excel.png
DELETED
|
Binary file
|
package/src/assets/img/img.png
DELETED
|
Binary file
|
package/src/assets/img/pdf.png
DELETED
|
Binary file
|
package/src/assets/img/ppt.png
DELETED
|
Binary file
|
package/src/assets/img/txt.png
DELETED
|
Binary file
|
package/src/assets/img/word.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|