sg-paisou 0.0.0 → 0.0.1
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/README.npm.md +322 -0
- package/dist/ai-chat-sdk.es.js +22610 -0
- package/dist/ai-chat-sdk.es.js.map +1 -0
- package/dist/ai-chat-sdk.umd.js +300 -0
- package/dist/ai-chat-sdk.umd.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +48 -0
- package/package.json +58 -11
- package/.idea/GitCommitMessageStorage.xml +0 -8
- package/.idea/modules.xml +0 -8
- package/.idea/sg-paisou-web.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.vscode/settings.json +0 -2
- package/auto-imports.d.ts +0 -10
- package/components.d.ts +0 -18
- package/index.html +0 -21
- package/src/App.vue +0 -38
- package/src/assets/images/Camera-icon.png +0 -0
- package/src/assets/images/anger.png +0 -0
- package/src/assets/images/answer-icon.png +0 -0
- package/src/assets/images/back.png +0 -0
- package/src/assets/images/bg-img.png +0 -0
- package/src/assets/images/collect.png +0 -0
- package/src/assets/images/collected.png +0 -0
- package/src/assets/images/empty-bookmark.png +0 -0
- package/src/assets/images/empty-history.png +0 -0
- package/src/assets/images/feedback-thinkie-img.png +0 -0
- package/src/assets/images/history.png +0 -0
- package/src/assets/images/image 5.png +0 -0
- package/src/assets/images/insolubility.png +0 -0
- package/src/assets/images/key-points.png +0 -0
- package/src/assets/images/photograph-icon.png +0 -0
- package/src/assets/images/praise-icon.png +0 -0
- package/src/assets/images/praiseing-icon.png +0 -0
- package/src/assets/images/question.png +0 -0
- package/src/assets/images/smiling.png +0 -0
- package/src/assets/images/solution-icon.png +0 -0
- package/src/assets/images/star-icon.png +0 -0
- package/src/assets/images/trample-icon.png +0 -0
- package/src/assets/images/trampleing-icon.png +0 -0
- package/src/assets/images/volume-icon.png +0 -0
- package/src/assets/images/volumeing-icon.png +0 -0
- package/src/components/AIChatSDK/AIChatComponent.vue +0 -963
- package/src/components/AIChatSDK/component/Dialogs.vue +0 -340
- package/src/components/AIChatSDK/component/SpecialQuestions.vue +0 -208
- package/src/components/AIChatSDK/index.ts +0 -146
- package/src/components/AIChatSDK/style.scss +0 -432
- package/src/components/AIChatSDK/utils/imageUtils.ts +0 -61
- package/src/components/AIChatSDK/utils/latex.ts +0 -34
- package/src/components/AIChatSDK/utils/mergeConfig.ts +0 -125
- package/src/components/ImagePreview.vue +0 -62
- package/src/components/PageHeader/index.vue +0 -121
- package/src/config.ts +0 -11
- package/src/env.d.ts +0 -11
- package/src/main.ts +0 -12
- package/src/router.ts +0 -20
- package/src/style.css +0 -33
- package/src/type.ts +0 -106
- package/src/utils/TTS_README.md +0 -232
- package/src/utils/bridge.ts +0 -42
- package/src/utils/index.ts +0 -8
- package/src/utils/listenOsEvent.ts +0 -3
- package/src/utils/messageToast.ts +0 -43
- package/src/utils/render.ts +0 -81
- package/src/utils/request.ts +0 -87
- package/src/utils/tts.ts +0 -319
- package/src/utils/typewriter.ts +0 -61
- package/src/utils/useSSE.ts +0 -113
- package/src/views/History/index.vue +0 -419
- package/src/views/QuestionChatPage/index.vue +0 -480
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.app.json +0 -24
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -22
- package/vite.config.ts +0 -41
- /package/{public → dist}/mathjax/all-packages.js +0 -0
- /package/{public → dist}/mathjax/talEditorConfig.js +0 -0
- /package/{public → dist}/mathjax/tex-svg.js +0 -0
- /package/{src/components/AIChatSDK/types.ts → dist/types/types.d.ts} +0 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.special-questions[data-v-a74f60d6]{padding:20px;display:flex;flex-direction:column;gap:20px}.special-questions img[data-v-a74f60d6]{width:24px;transition:transform .1s ease}.special-questions .solution-content[data-v-a74f60d6],.special-questions .answer-content[data-v-a74f60d6]{display:flex;flex-direction:column;justify-content:center;gap:12px}.special-questions .solution-content .solution-content-title[data-v-a74f60d6],.special-questions .solution-content .answer-content-title[data-v-a74f60d6],.special-questions .answer-content .solution-content-title[data-v-a74f60d6],.special-questions .answer-content .answer-content-title[data-v-a74f60d6]{display:flex;align-items:center;gap:8px}.special-questions .solution-content .solution-content-title .solution-content-title-text[data-v-a74f60d6],.special-questions .solution-content .solution-content-title .answer-content-title-text[data-v-a74f60d6],.special-questions .solution-content .answer-content-title .solution-content-title-text[data-v-a74f60d6],.special-questions .solution-content .answer-content-title .answer-content-title-text[data-v-a74f60d6],.special-questions .answer-content .solution-content-title .solution-content-title-text[data-v-a74f60d6],.special-questions .answer-content .solution-content-title .answer-content-title-text[data-v-a74f60d6],.special-questions .answer-content .answer-content-title .solution-content-title-text[data-v-a74f60d6],.special-questions .answer-content .answer-content-title .answer-content-title-text[data-v-a74f60d6]{font-size:20px;font-weight:600;line-height:32px}.special-questions .solution-content .solution-content-description[data-v-a74f60d6],.special-questions .solution-content .answer-content-description[data-v-a74f60d6],.special-questions .answer-content .solution-content-description[data-v-a74f60d6],.special-questions .answer-content .answer-content-description[data-v-a74f60d6]{padding:12px 16px;background:#f8f7f6;border-radius:12px;line-height:24px}.special-questions .feedback-content[data-v-a74f60d6]{display:flex;align-items:center;justify-content:flex-end;gap:12px}.special-questions .feedback-content img[data-v-a74f60d6]:active{transform:scale(1.2)}.dialogs[data-v-fc423d4c]{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#00000080;z-index:1000}.dialogs .insolubility-content[data-v-fc423d4c]{width:350px}.dialogs .insolubility-content .insolubility-content-img[data-v-fc423d4c]{width:100%;vertical-align:top}.dialogs .insolubility-content .insolubility-content-text[data-v-fc423d4c]{width:100%;font-weight:500;color:#222;background:#fff;display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px 0;text-transform:capitalize;border-radius:0 0 20px 20px}.dialogs .insolubility-content .insolubility-content-text span[data-v-fc423d4c]{font-size:20px;line-height:24px}.dialogs .insolubility-content .insolubility-content-text .insolubility-content-text-subtext[data-v-fc423d4c]{font-size:16px;color:#999}.dialogs .insolubility-content .insolubility-content-text .insolubility-content-button[data-v-fc423d4c]{padding:8px 16px;background:linear-gradient(91.95deg,#ffcb00,#ffab03);border-radius:70px;display:flex;align-items:center}.dialogs .insolubility-content .insolubility-content-text .insolubility-content-button img[data-v-fc423d4c]{width:20px;margin-right:8px}.dialogs .insolubility-content .insolubility-content-text .insolubility-content-button span[data-v-fc423d4c]{font-size:16px;color:#fff}.dialogs .feedback-dialog[data-v-fc423d4c]{width:420px;overflow:hidden;display:flex;flex-direction:column}.dialogs .feedback-dialog .feedback-header[data-v-fc423d4c]{position:relative}.dialogs .feedback-dialog .feedback-header .feedback-robot-img[data-v-fc423d4c]{width:100%;vertical-align:top}.dialogs .feedback-dialog .feedback-header .close-button[data-v-fc423d4c]{position:absolute;top:37px;right:12px}.dialogs .feedback-dialog .feedback-content[data-v-fc423d4c]{padding:12px 20px 20px;background:#fff;border-radius:0 0 20px 20px;display:flex;flex-direction:column}.dialogs .feedback-dialog .feedback-content .feedback-title[data-v-fc423d4c]{font-size:20px;font-weight:500;line-height:24px;color:#222;text-align:center}.dialogs .feedback-dialog .feedback-content .feedback-subtitle[data-v-fc423d4c]{line-height:24px;color:#999;text-align:center;margin-top:8px}.dialogs .feedback-dialog .feedback-content .feedback-tags[data-v-fc423d4c]{display:flex;flex-wrap:wrap;gap:12px;margin-top:8px;justify-content:center}.dialogs .feedback-dialog .feedback-content .feedback-tags .feedback-tag[data-v-fc423d4c]{font-size:14px;padding:6px 8px 6px 12px;background:#00000008;border:1px solid transparent;border-radius:38px;color:#666;-webkit-user-select:none;user-select:none;line-height:100%}.dialogs .feedback-dialog .feedback-content .feedback-tags .feedback-tag.active[data-v-fc423d4c]{background:#fff;border-color:#ff9d004d;color:#ff9d00}.dialogs .feedback-dialog .feedback-content .feedback-tags .feedback-tag[data-v-fc423d4c]:active{transform:scale(.98)}.dialogs .feedback-dialog .feedback-content .feedback-textarea[data-v-fc423d4c]{height:94px;margin-top:12px;padding:12px;background:#f7f7f7;border:1px solid transparent;border-radius:12px;font-size:14px;line-height:24px;color:#222;resize:none;outline:none;transition:all .2s;font-family:inherit}.dialogs .feedback-dialog .feedback-content .feedback-textarea[data-v-fc423d4c]::placeholder{color:#999}.dialogs .feedback-dialog .feedback-content .feedback-textarea[data-v-fc423d4c]:focus{background:#fff;border-color:#ffab03}.dialogs .feedback-dialog .feedback-content .feedback-submit[data-v-fc423d4c]{margin-top:16px;padding:8px 24px;background:linear-gradient(91.95deg,#ffcb00,#ffab03);border:none;border-radius:70px;font-size:16px;font-weight:500;line-height:24px;color:#fff;transition:all .2s}.dialogs .feedback-dialog .feedback-content .feedback-submit.disabled[data-v-fc423d4c]{opacity:.2}.image-preview-overlay[data-v-5465193a]{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000;cursor:zoom-out}.image-preview-container[data-v-5465193a]{position:relative;max-width:90vw;max-height:90vh;cursor:default}.preview-image[data-v-5465193a]{max-width:100%;max-height:100%;object-fit:contain;border-radius:8px;box-shadow:0 4px 20px #0000004d}.ai-chat-container[data-v-b9d51315]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.ai-chat-container .ai-avatar[data-v-b9d51315]{flex-shrink:0}.ai-chat-container .ai-avatar img[data-v-b9d51315]{object-fit:cover}.ai-chat-container .ai-info[data-v-b9d51315]{flex:1}.ai-chat-container .chat-content[data-v-b9d51315]{background:#fff}.ai-chat-container .chat-content .chat-messages[data-v-b9d51315]{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column}.ai-chat-container .chat-content .chat-messages .message[data-v-b9d51315]{display:flex;flex-direction:column;width:100%}.ai-chat-container .chat-content .chat-messages .message .message-wrapper[data-v-b9d51315]{display:flex;align-items:flex-start;gap:12px;width:80%}.ai-chat-container .chat-content .chat-messages .message .user-message-wrapper[data-v-b9d51315]{align-self:flex-end;margin-left:auto;justify-content:flex-end}.ai-chat-container .chat-content .chat-messages .message .message-avatar[data-v-b9d51315]{flex-shrink:0}.ai-chat-container .chat-content .chat-messages .message .message-avatar img[data-v-b9d51315]{object-fit:cover;display:block}.ai-chat-container .chat-content .chat-messages .message .message-content[data-v-b9d51315]{font-size:16px;line-height:24px;max-width:calc(100% - 60px)}.ai-chat-container .chat-content .chat-messages .message .message-content .message-text-wrapper[data-v-b9d51315]{display:inline}.ai-chat-container .chat-content .chat-messages .message .message-content .message-text-wrapper .typing-indicator[data-v-b9d51315]{display:inline-block;width:8px;height:8px;margin-left:4px;background-color:#ff9d00;border-radius:50%;animation:breathing-b9d51315 1.5s ease-in-out infinite;vertical-align:middle}.ai-chat-container .chat-content .chat-messages .message .message-content .message-image[data-v-b9d51315]{margin-bottom:8px;border-radius:12px;overflow:hidden;max-width:100%}.ai-chat-container .chat-content .chat-messages .message .message-content .message-image img[data-v-b9d51315]{width:100%;height:auto;display:block}.ai-chat-container .chat-content .chat-messages .message .message-content .message-buttons[data-v-b9d51315]{display:flex;gap:20px;margin-top:16px;justify-content:flex-end}.ai-chat-container .chat-content .chat-messages .message .message-content .message-buttons button[data-v-b9d51315]{padding:8px 16px;border:none;border-radius:70px;font-weight:500;line-height:24px;font-size:16px;background:transparent}.ai-chat-container .chat-content .chat-messages .message .message-content .message-buttons .btn-primary[data-v-b9d51315]{background:linear-gradient(91.95deg,#ffcb00,#ffab03);color:#fff}.ai-chat-container .chat-content .chat-messages .message .message-content .message-buttons .btn-primary[data-v-b9d51315]:hover{transform:translateY(-1px);box-shadow:0 4px 12px #ffab034d}.ai-chat-container .chat-content .chat-messages .message .message-content .message-buttons .btn-primary[data-v-b9d51315]:active{transform:translateY(0)}.ai-chat-container .chat-content .chat-messages .message .message-content .message-buttons .btn-secondary[data-v-b9d51315]{color:#999}.ai-chat-container .chat-content .chat-messages .message .message-content .message-buttons .btn-secondary[data-v-b9d51315]:hover{color:#666}.ai-chat-container .chat-content .chat-messages .message .message-content .feedback-actions-only[data-v-b9d51315]{display:flex;gap:20px;margin-top:16px}.ai-chat-container .chat-content .chat-messages .message .message-content .feedback-actions-only img[data-v-b9d51315]{width:20px}.ai-chat-container .chat-content .chat-messages .message .message-content .feedback-and-continue[data-v-b9d51315]{display:flex;align-items:center;justify-content:space-between;margin-top:16px;gap:16px}.ai-chat-container .chat-content .chat-messages .message .message-content .feedback-and-continue .feedback-actions[data-v-b9d51315]{display:flex;gap:16px}.ai-chat-container .chat-content .chat-messages .message .message-content .feedback-and-continue .feedback-actions img[data-v-b9d51315]{width:20px}.ai-chat-container .chat-content .chat-messages .message .message-content .feedback-and-continue .btn-continue[data-v-b9d51315]{padding:8px 16px;border:none;border-radius:70px;font-weight:500;line-height:24px;font-size:16px;background:#ff9d001a;color:#ff9d00;white-space:nowrap;letter-spacing:1px}@keyframes breathing-b9d51315{0%,to{opacity:1;transform:scale(1)}50%{opacity:.3;transform:scale(.8)}}@keyframes blinking-b9d51315{0%,to{opacity:1}50%{opacity:.2}}.ai-chat-container .chat-content .chat-messages .message .completion-section[data-v-b9d51315]{margin-top:12px;width:100%}.ai-chat-container .chat-content .chat-messages .message .completion-section .helpful-section[data-v-b9d51315]{display:flex;align-items:center;justify-content:center;gap:12px;padding-bottom:12px}.ai-chat-container .chat-content .chat-messages .message .completion-section .helpful-section .helpful-text[data-v-b9d51315]{color:#666}.ai-chat-container .chat-content .chat-messages .message .completion-section .helpful-section img[data-v-b9d51315]{width:24px}.ai-chat-container .chat-content .chat-messages .message .completion-section .follow-up-questions[data-v-b9d51315]{display:flex;flex-direction:column;gap:12px}.ai-chat-container .chat-content .chat-messages .message .completion-section .follow-up-questions .follow-up-item[data-v-b9d51315]{width:max-content;display:flex;align-items:flex-start;gap:8px;padding:7px 12px;background:#fff;border-radius:70px;border:1px solid #EEEEEE}.ai-chat-container .chat-content .chat-messages .message .completion-section .follow-up-questions .follow-up-item img[data-v-b9d51315]{width:20px}.ai-chat-container .chat-content .chat-messages .message .completion-section .follow-up-questions .follow-up-item .question-text[data-v-b9d51315]{color:#222;line-height:24px}.ai-chat-container .chat-content .chat-messages .message .completion-section .btn-snap-another[data-v-b9d51315]{width:max-content;margin-top:12px;padding:8px 16px;border:none;border-radius:70px;font-weight:500;line-height:24px;font-size:16px;background:#ff9d001a;color:#ff9d00;display:flex;align-items:center;justify-content:center;gap:8px}.ai-chat-container .chat-content .chat-messages .message .completion-section .btn-snap-another img[data-v-b9d51315]{width:20px}.ai-chat-container .chat-content .chat-messages .message[data-v-b9d51315]:last-child{margin-bottom:0!important}.ai-chat-container .feedback-buttons[data-v-b9d51315]{display:flex;gap:12px}.ai-chat-container .feedback-buttons .feedback-btn[data-v-b9d51315]{padding:6px 12px 6px 8px;border:none;background:#00000008;border-radius:38px;font-size:14px;color:#222;display:flex;align-items:center;transition:all .2s}.ai-chat-container .input-wrapper[data-v-b9d51315]{background:#fff}.ai-chat-container .input-wrapper .chat-input[data-v-b9d51315]::placeholder{color:#adb5bd}.ai-chat-container .input-wrapper .send-button.disabled[data-v-b9d51315]{opacity:.5}.ai-message[data-v-b9d51315]{align-items:flex-start}.user-message[data-v-b9d51315]{align-items:flex-end}.options[data-v-b9d51315]{margin-top:8px;display:flex;flex-wrap:wrap;gap:8px}.options span[data-v-b9d51315]{padding:4px 8px;background:#fff3;border-radius:6px;font-size:12px;display:flex;align-items:center}[data-v-b9d51315] .katex{font-size:1em}[data-v-b9d51315] .katex-display{margin:.5em 0}.background-transparent[data-v-b9d51315]{background:transparent!important}.chat-input[data-v-b9d51315]:disabled{background-color:#f5f5f5;cursor:not-allowed;opacity:.6}.feedback-buttons.disabled[data-v-b9d51315]{opacity:.5;pointer-events:none}.feedback-buttons.disabled button[data-v-b9d51315]{cursor:not-allowed}.feedback-overlay[data-v-b9d51315]{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;z-index:999}.message-feedback-popup[data-v-b9d51315]{position:fixed;z-index:1000}.message-feedback-popup .popup-arrow[data-v-b9d51315]{position:absolute;left:50%;transform:translate(-50%);width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent}.message-feedback-popup .popup-buttons[data-v-b9d51315]{display:flex;gap:20px;background:#fff;border-radius:12px;box-shadow:0 4px 16px #00000026;padding:12px}.message-feedback-popup:not(.show-above) .popup-arrow[data-v-b9d51315]{top:0;border-bottom:8px solid #FFFFFF;filter:drop-shadow(0 -2px 2px rgba(0,0,0,.05))}.message-feedback-popup:not(.show-above) .popup-buttons[data-v-b9d51315]{margin-top:8px}.message-feedback-popup.show-above .popup-arrow[data-v-b9d51315]{bottom:0;border-top:8px solid #FFFFFF;filter:drop-shadow(0 2px 2px rgba(0,0,0,.05))}.message-feedback-popup.show-above .popup-buttons[data-v-b9d51315]{margin-bottom:8px}.message-feedback-popup .helpful-section img[data-v-b9d51315],.message-feedback-popup .feedback-actions img[data-v-b9d51315],.message-feedback-popup .feedback-actions-only img[data-v-b9d51315],.message-feedback-popup .popup-buttons img[data-v-b9d51315]{transition:transform .1s ease}.message-feedback-popup .helpful-section img[data-v-b9d51315]:active,.message-feedback-popup .feedback-actions img[data-v-b9d51315]:active,.message-feedback-popup .feedback-actions-only img[data-v-b9d51315]:active,.message-feedback-popup .popup-buttons img[data-v-b9d51315]:active{transform:scale(1.2)}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// AI Chat SDK 类型定义文件
|
|
2
|
+
import type { Component } from 'vue'
|
|
3
|
+
|
|
4
|
+
// 导出所有类型
|
|
5
|
+
export * from './types'
|
|
6
|
+
|
|
7
|
+
// 导出组件
|
|
8
|
+
export declare const AIChatComponent: Component
|
|
9
|
+
|
|
10
|
+
// 导出图片工具
|
|
11
|
+
export declare const IMAGE_ASSETS: {
|
|
12
|
+
maskGroup: string
|
|
13
|
+
soundOn: string
|
|
14
|
+
soundOff: string
|
|
15
|
+
smile: string
|
|
16
|
+
confused: string
|
|
17
|
+
lightbulb: string
|
|
18
|
+
voiceTube: string
|
|
19
|
+
userAvatar: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare function getImageUrl(imageName: keyof typeof IMAGE_ASSETS): string
|
|
23
|
+
export declare function hasImage(imageName: string): imageName is keyof typeof IMAGE_ASSETS
|
|
24
|
+
export declare function createImageConfig(customImages?: Partial<typeof IMAGE_ASSETS>): typeof IMAGE_ASSETS
|
|
25
|
+
|
|
26
|
+
// 导出配置工厂函数
|
|
27
|
+
export declare function createAIChatConfig(config?: Partial<import('./types').IAIChatConfig>): import('./types').IAIChatConfig
|
|
28
|
+
|
|
29
|
+
// 导出预设配置
|
|
30
|
+
export declare const PRESET_CONFIGS: {
|
|
31
|
+
default: import('./types').IAIChatConfig
|
|
32
|
+
minimal: import('./types').IAIChatConfig
|
|
33
|
+
dark: import('./types').IAIChatConfig
|
|
34
|
+
compact: import('./types').IAIChatConfig
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 导出默认配置
|
|
38
|
+
export declare const DEFAULT_CONFIG: import('./types').IAIChatConfig
|
|
39
|
+
|
|
40
|
+
// 默认导出
|
|
41
|
+
declare const _default: {
|
|
42
|
+
AIChatComponent: Component
|
|
43
|
+
createAIChatConfig: typeof createAIChatConfig
|
|
44
|
+
PRESET_CONFIGS: typeof PRESET_CONFIGS
|
|
45
|
+
DEFAULT_CONFIG: typeof DEFAULT_CONFIG
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default _default
|
package/package.json
CHANGED
|
@@ -1,32 +1,77 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sg-paisou",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"main": "./dist/ai-chat-sdk.umd.js",
|
|
6
|
+
"module": "./dist/ai-chat-sdk.es.js",
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/ai-chat-sdk.es.js",
|
|
11
|
+
"require": "./dist/ai-chat-sdk.umd.js",
|
|
12
|
+
"types": "./dist/types/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./style.css": "./dist/style.css"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.npm.md"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"vue",
|
|
22
|
+
"vue3",
|
|
23
|
+
"ai",
|
|
24
|
+
"chat",
|
|
25
|
+
"chatbot",
|
|
26
|
+
"tts",
|
|
27
|
+
"text-to-speech",
|
|
28
|
+
"component",
|
|
29
|
+
"ui"
|
|
30
|
+
],
|
|
31
|
+
"author": "TAL Education",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/tal-tech/ai-chat-sdk.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/tal-tech/ai-chat-sdk/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/tal-tech/ai-chat-sdk#readme",
|
|
5
41
|
"scripts": {
|
|
6
42
|
"dev": "vite --host --port 3001",
|
|
7
43
|
"build": "vite build",
|
|
8
|
-
"
|
|
44
|
+
"build:lib": "vite build --config vite.config.lib.ts && npm run build:types",
|
|
45
|
+
"build:types": "mkdir -p dist/types && cp src/components/AIChatSDK/index.d.ts dist/types/index.d.ts && cp src/components/AIChatSDK/types.ts dist/types/types.d.ts",
|
|
46
|
+
"preview": "vite preview",
|
|
47
|
+
"prepublishOnly": "npm run build:lib"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"vue": "^3.4.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"vue": {
|
|
54
|
+
"optional": false
|
|
55
|
+
}
|
|
9
56
|
},
|
|
10
57
|
"dependencies": {
|
|
11
|
-
"@aliyun-sls/web-track-browser": "^0.3.8",
|
|
12
|
-
"@genie/sea.uni.jsbridge": "^0.3.13",
|
|
13
58
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
14
59
|
"axios": "^1.7.7",
|
|
15
|
-
"
|
|
16
|
-
"events": "^3.3.0",
|
|
17
|
-
"katex": "^0.16.11",
|
|
18
|
-
"pinia": "^2.2.2",
|
|
19
|
-
"tal-mathgpt-render": "^1.2.7-1",
|
|
20
|
-
"vue": "^3.4.35",
|
|
21
|
-
"vue-router": "^4.6.3"
|
|
60
|
+
"katex": "^0.16.11"
|
|
22
61
|
},
|
|
23
62
|
"devDependencies": {
|
|
63
|
+
"@aliyun-sls/web-track-browser": "^0.3.8",
|
|
64
|
+
"@genie/sea.uni.jsbridge": "^0.3.13",
|
|
24
65
|
"@types/crypto-js": "^4.2.2",
|
|
25
66
|
"@types/events": "^3.0.3",
|
|
26
67
|
"@types/katex": "^0.16.7",
|
|
27
68
|
"@types/node": "^22.9.0",
|
|
28
69
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
70
|
+
"crypto-js": "^4.2.0",
|
|
71
|
+
"events": "^3.3.0",
|
|
72
|
+
"pinia": "^2.2.2",
|
|
29
73
|
"sass": "^1.78.0",
|
|
74
|
+
"tal-mathgpt-render": "^1.2.7-1",
|
|
30
75
|
"typescript": "^5.5.3",
|
|
31
76
|
"unplugin-auto-import": "^0.18.3",
|
|
32
77
|
"unplugin-element-plus": "^0.8.0",
|
|
@@ -34,6 +79,8 @@
|
|
|
34
79
|
"vite": "^5.4.0",
|
|
35
80
|
"vite-plugin-html": "^3.2.2",
|
|
36
81
|
"vite-plugin-singlefile": "^2.0.2",
|
|
82
|
+
"vue": "^3.4.35",
|
|
83
|
+
"vue-router": "^4.6.3",
|
|
37
84
|
"vue-tsc": "^2.0.29"
|
|
38
85
|
}
|
|
39
86
|
}
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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/sg-paisou-web.iml" filepath="$PROJECT_DIR$/.idea/sg-paisou-web.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/sg-paisou-web.iml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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>
|
package/.idea/vcs.xml
DELETED
package/.vscode/settings.json
DELETED
package/auto-imports.d.ts
DELETED
package/components.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
// Generated by unplugin-vue-components
|
|
4
|
-
// Read more: https://github.com/vuejs/core/pull/3399
|
|
5
|
-
export {}
|
|
6
|
-
|
|
7
|
-
/* prettier-ignore */
|
|
8
|
-
declare module 'vue' {
|
|
9
|
-
export interface GlobalComponents {
|
|
10
|
-
AIChatComponent: typeof import('./src/components/AIChatSDK/AIChatComponent.vue')['default']
|
|
11
|
-
Dialogs: typeof import('./src/components/AIChatSDK/component/Dialogs.vue')['default']
|
|
12
|
-
ImagePreview: typeof import('./src/components/ImagePreview.vue')['default']
|
|
13
|
-
PageHeader: typeof import('./src/components/PageHeader/index.vue')['default']
|
|
14
|
-
RouterLink: typeof import('vue-router')['RouterLink']
|
|
15
|
-
RouterView: typeof import('vue-router')['RouterView']
|
|
16
|
-
SpecialQuestions: typeof import('./src/components/AIChatSDK/component/SpecialQuestions.vue')['default']
|
|
17
|
-
}
|
|
18
|
-
}
|
package/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" href="data:,">
|
|
6
|
-
<meta
|
|
7
|
-
name="viewport"
|
|
8
|
-
content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0"
|
|
9
|
-
/>
|
|
10
|
-
<title>SG拍搜</title>
|
|
11
|
-
<script id="EditorConfig" src="./mathjax/talEditorConfig.js"></script>
|
|
12
|
-
<script id="MathJax-script" src="./mathjax/tex-svg.js"></script>
|
|
13
|
-
<script id="allPackages" src="./mathjax/all-packages.js"></script>
|
|
14
|
-
<link href="https://static.speiyou.com/_cdn_/talqs-template4.0/1.0.27/talqsTemplate.min.css" rel="stylesheet" />
|
|
15
|
-
<script src="https://static.speiyou.com/_cdn_/talqs-template4.0/1.0.27/talqsTemplate.min.js"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body>
|
|
18
|
-
<div id="app"></div>
|
|
19
|
-
<script type="module" src="/src/main.ts"></script>
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
package/src/App.vue
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<router-view />
|
|
3
|
-
</template>
|
|
4
|
-
<script lang="ts" setup>
|
|
5
|
-
import { onMounted } from "vue";
|
|
6
|
-
import { IUserInfo } from "./type";
|
|
7
|
-
import { requestToken } from "@genie/sea.uni.jsbridge";
|
|
8
|
-
import "katex/dist/katex.min.css";
|
|
9
|
-
|
|
10
|
-
// 获取用户登录信息
|
|
11
|
-
const getUserInfo = () => {
|
|
12
|
-
requestToken({
|
|
13
|
-
onSuccess: (data: string) => {
|
|
14
|
-
console.log("用户登录 token:", data);
|
|
15
|
-
const res = JSON.parse(data);
|
|
16
|
-
// 将 token 和相关信息存储
|
|
17
|
-
const userInfoData: IUserInfo = {
|
|
18
|
-
secure: res.secure || '',
|
|
19
|
-
token: res.token || '',
|
|
20
|
-
talId: res.talId || '',
|
|
21
|
-
avatar: res.avatar || '',
|
|
22
|
-
sn: res.sn,
|
|
23
|
-
channel: res.channel || '',
|
|
24
|
-
pkgName: res.pkgName || '',
|
|
25
|
-
};
|
|
26
|
-
sessionStorage.setItem('userInfo', JSON.stringify(userInfoData));
|
|
27
|
-
},
|
|
28
|
-
onFail: (error: any) => {
|
|
29
|
-
console.error("获取用户登录信息失败:", error);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
onMounted(() => {
|
|
35
|
-
// 获取用户登录信息
|
|
36
|
-
getUserInfo();
|
|
37
|
-
});
|
|
38
|
-
</script>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|