pcm-agents 0.3.0 → 0.3.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.
- package/LICENSE +21 -21
- package/dist/cjs/index-BFPEnLbS.js +195 -0
- package/dist/cjs/index-BFPEnLbS.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/my-component.cjs.entry.js +2 -2
- package/dist/cjs/my-component.cjs.entry.js.map +1 -1
- package/dist/cjs/my-component.entry.cjs.js.map +1 -1
- package/dist/cjs/pcm-agents.cjs.js +1 -1
- package/dist/cjs/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.cjs.js.map +1 -0
- package/dist/cjs/pcm-app-chat-modal_7.cjs.entry.js +6560 -0
- package/dist/cjs/pcm-app-chat-modal_7.cjs.entry.js.map +1 -0
- package/dist/cjs/pcm-chat-modal.cjs.entry.js +17 -32
- package/dist/cjs/pcm-chat-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/pcm-chat-modal.entry.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/my-component/my-component.css +3 -3
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +2 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +137 -159
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.css +66 -12
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.js +106 -13
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.js.map +1 -1
- package/dist/collection/components/pcm-chat-modal/pcm-chat-modal.js +39 -34
- package/dist/collection/components/pcm-chat-modal/pcm-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +76 -105
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.css +162 -0
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.js +616 -0
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.js.map +1 -0
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.css +0 -79
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +133 -81
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
- package/dist/collection/components/pcm-video-chat-modal/pcm-video-chat-modal.js +77 -101
- package/dist/collection/components/pcm-video-chat-modal/pcm-video-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.css +273 -0
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js +613 -0
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js.map +1 -0
- package/dist/collection/global/global.css +324 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/interfaces/chat.js.map +1 -1
- package/dist/collection/utils/utils.js +54 -113
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +1298 -11280
- package/dist/components/index.js.map +1 -1
- package/dist/components/my-component.js +2 -3
- package/dist/components/my-component.js.map +1 -1
- package/dist/components/{p-C4l_DOnx.js → p-BctfuDvG.js} +106 -147
- package/dist/components/p-BctfuDvG.js.map +1 -0
- package/dist/components/{p-D0s1Q-3O.js → p-LkDC0SN2.js} +343 -16
- package/dist/components/p-LkDC0SN2.js.map +1 -0
- package/dist/components/pcm-app-chat-modal.js +1 -1
- package/dist/components/pcm-chat-message.js +1 -1
- package/dist/components/pcm-chat-modal.js +19 -34
- package/dist/components/pcm-chat-modal.js.map +1 -1
- package/dist/components/pcm-hr-chat-modal.js +70 -100
- package/dist/components/pcm-hr-chat-modal.js.map +1 -1
- package/dist/components/pcm-jlpx-modal.d.ts +11 -0
- package/dist/components/pcm-jlpx-modal.js +339 -0
- package/dist/components/pcm-jlpx-modal.js.map +1 -0
- package/dist/components/pcm-mnms-modal.js +109 -57
- package/dist/components/pcm-mnms-modal.js.map +1 -1
- package/dist/components/pcm-video-chat-modal.js +74 -99
- package/dist/components/pcm-video-chat-modal.js.map +1 -1
- package/dist/components/pcm-zygh-modal.d.ts +11 -0
- package/dist/components/pcm-zygh-modal.js +330 -0
- package/dist/components/pcm-zygh-modal.js.map +1 -0
- package/dist/esm/index-nVjZGfA8.js +189 -0
- package/dist/esm/index-nVjZGfA8.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/my-component.entry.js +2 -2
- package/dist/esm/my-component.entry.js.map +1 -1
- package/dist/esm/pcm-agents.js +1 -1
- package/dist/esm/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.js.map +1 -0
- package/dist/esm/pcm-app-chat-modal_7.entry.js +6552 -0
- package/dist/esm/pcm-app-chat-modal_7.entry.js.map +1 -0
- package/dist/esm/pcm-chat-modal.entry.js +17 -32
- package/dist/esm/pcm-chat-modal.entry.js.map +1 -1
- package/dist/pcm-agents/index.esm.js +1 -1
- package/dist/pcm-agents/my-component.entry.esm.js.map +1 -1
- package/dist/pcm-agents/p-55417392.entry.js +2 -0
- package/dist/pcm-agents/p-55417392.entry.js.map +1 -0
- package/dist/pcm-agents/p-a698b59f.entry.js +2 -0
- package/dist/pcm-agents/p-a698b59f.entry.js.map +1 -0
- package/dist/pcm-agents/p-f3ca99b4.entry.js +2 -0
- package/dist/pcm-agents/p-f3ca99b4.entry.js.map +1 -0
- package/dist/pcm-agents/p-nVjZGfA8.js +2 -0
- package/dist/pcm-agents/p-nVjZGfA8.js.map +1 -0
- package/dist/pcm-agents/pcm-agents.esm.js +1 -1
- package/dist/pcm-agents/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.esm.js.map +1 -0
- package/dist/pcm-agents/pcm-chat-modal.entry.esm.js.map +1 -1
- package/dist/types/components/pcm-app-chat-modal/pcm-app-chat-modal.d.ts +13 -8
- package/dist/types/components/pcm-chat-message/pcm-chat-message.d.ts +5 -0
- package/dist/types/components/pcm-chat-modal/pcm-chat-modal.d.ts +8 -8
- package/dist/types/components/pcm-hr-chat-modal/pcm-hr-chat-modal.d.ts +6 -12
- package/dist/types/components/pcm-jlpx-modal/pcm-jlpx-modal.d.ts +113 -0
- package/dist/types/components/pcm-mnms-modal/pcm-mnms-modal.d.ts +19 -20
- package/dist/types/components/pcm-video-chat-modal/pcm-video-chat-modal.d.ts +4 -4
- package/dist/types/components/pcm-zygh-modal/pcm-zygh-modal.d.ts +117 -0
- package/dist/types/components.d.ts +429 -80
- package/dist/types/interfaces/chat.d.ts +0 -4
- package/dist/types/utils/utils.d.ts +29 -83
- package/package.json +61 -60
- package/readme.md +307 -307
- package/dist/cjs/index-DfIUl99H.js +0 -11413
- package/dist/cjs/index-DfIUl99H.js.map +0 -1
- package/dist/cjs/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/pcm-app-chat-modal_3.cjs.entry.js +0 -3734
- package/dist/cjs/pcm-app-chat-modal_3.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +0 -1078
- package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-hr-chat-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/pcm-video-chat-modal.cjs.entry.js +0 -927
- package/dist/cjs/pcm-video-chat-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-video-chat-modal.entry.cjs.js.map +0 -1
- package/dist/components/p-C4l_DOnx.js.map +0 -1
- package/dist/components/p-CgDy4pJp.js +0 -1244
- package/dist/components/p-CgDy4pJp.js.map +0 -1
- package/dist/components/p-D0s1Q-3O.js.map +0 -1
- package/dist/esm/index-B2EtEi7v.js +0 -11409
- package/dist/esm/index-B2EtEi7v.js.map +0 -1
- package/dist/esm/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.js.map +0 -1
- package/dist/esm/pcm-app-chat-modal_3.entry.js +0 -3730
- package/dist/esm/pcm-app-chat-modal_3.entry.js.map +0 -1
- package/dist/esm/pcm-hr-chat-modal.entry.js +0 -1076
- package/dist/esm/pcm-hr-chat-modal.entry.js.map +0 -1
- package/dist/esm/pcm-video-chat-modal.entry.js +0 -925
- package/dist/esm/pcm-video-chat-modal.entry.js.map +0 -1
- package/dist/pcm-agents/p-0ddd5c47.entry.js +0 -2
- package/dist/pcm-agents/p-0ddd5c47.entry.js.map +0 -1
- package/dist/pcm-agents/p-5f624943.entry.js +0 -2
- package/dist/pcm-agents/p-5f624943.entry.js.map +0 -1
- package/dist/pcm-agents/p-6c07f155.entry.js +0 -2
- package/dist/pcm-agents/p-6c07f155.entry.js.map +0 -1
- package/dist/pcm-agents/p-9a1fb6ca.entry.js +0 -2
- package/dist/pcm-agents/p-9a1fb6ca.entry.js.map +0 -1
- package/dist/pcm-agents/p-B2EtEi7v.js +0 -146
- package/dist/pcm-agents/p-B2EtEi7v.js.map +0 -1
- package/dist/pcm-agents/p-e21bc169.entry.js +0 -2
- package/dist/pcm-agents/p-e21bc169.entry.js.map +0 -1
- package/dist/pcm-agents/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.esm.js.map +0 -1
- package/dist/pcm-agents/pcm-hr-chat-modal.entry.esm.js.map +0 -1
- package/dist/pcm-agents/pcm-video-chat-modal.entry.esm.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './
|
|
2
|
-
import { format } from './index.js';
|
|
1
|
+
import { p as proxyCustomElement, H, format, h } from './index.js';
|
|
3
2
|
|
|
4
3
|
const myComponentCss = ":host{display:block}";
|
|
5
4
|
|
|
@@ -25,7 +24,7 @@ const MyComponent$1 = /*@__PURE__*/ proxyCustomElement(class MyComponent extends
|
|
|
25
24
|
return format(this.first, this.middle, this.last);
|
|
26
25
|
}
|
|
27
26
|
render() {
|
|
28
|
-
return h("div", { key: '
|
|
27
|
+
return h("div", { key: '4cf44ed05360697e1aa7fbb8a80f14e1e129e13c' }, "Hello, World! I'm ", this.getText());
|
|
29
28
|
}
|
|
30
29
|
static get style() { return myComponentCss; }
|
|
31
30
|
}, [1, "my-component", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"my-component.js","mappings":"
|
|
1
|
+
{"file":"my-component.js","mappings":";;AAAA,MAAM,cAAc,GAAG,sBAAsB;;MCQhCA,aAAW,iBAAAC,kBAAA,CAAA,MAAA,WAAA,SAAAC,CAAA,CAAA;;;;;;AACtB;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;AACK,IAAA,MAAM;AAEd;;AAEG;AACK,IAAA,IAAI;IAEJ,OAAO,GAAA;AACb,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;;IAGnD,MAAM,GAAA;AACJ,QAAA,OAAO,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,wBAAwB,IAAI,CAAC,OAAO,EAAE,CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MyComponent","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/my-component/my-component.css?tag=my-component&encapsulation=shadow","src/components/my-component/my-component.tsx"],"sourcesContent":[":host {\r\n display: block;\r\n}\r\n","import { Component, Prop, h } from '@stencil/core';\r\nimport { format } from '../../utils/utils';\r\n\r\n@Component({\r\n tag: 'my-component',\r\n styleUrl: 'my-component.css',\r\n shadow: true,\r\n})\r\nexport class MyComponent {\r\n /**\r\n * The first name\r\n */\r\n @Prop() first: string;\r\n\r\n /**\r\n * The middle name\r\n */\r\n @Prop() middle: string;\r\n\r\n /**\r\n * The last name\r\n */\r\n @Prop() last: string;\r\n\r\n private getText(): string {\r\n return format(this.first, this.middle, this.last);\r\n }\r\n\r\n render() {\r\n return <div>Hello, World! I'm {this.getText()}</div>;\r\n }\r\n}\r\n"],"version":3}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent, h } from './
|
|
2
|
-
import {
|
|
3
|
-
import { d as defineCustomElement$1 } from './p-D0s1Q-3O.js';
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, s as sendSSERequest, a as sendHttpRequest, u as uploadFileToBackend, A as API_DOMAIN, h } from './index.js';
|
|
2
|
+
import { d as defineCustomElement$1 } from './p-LkDC0SN2.js';
|
|
4
3
|
|
|
5
|
-
const pcmAppChatModalCss = ":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:900px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.mobile-layout{width:100%;height:100%;border-radius:0}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;
|
|
4
|
+
const pcmAppChatModalCss = ":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:900px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.mobile-layout{width:100%;height:100%;border-radius:0}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;height:400px;background:url(https://pcm-resource-1312611446.cos.ap-guangzhou.myqcloud.com/web/sdk/chat_bg.png);background-size:100%}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.file-info{display:flex;align-items:center;justify-content:space-between;padding:8px;background:white;border:1px solid #e8e8e8;border-radius:4px}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:0.8rem;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:1rem;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:1rem}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}.text-input-area{display:flex;flex-direction:column;width:100%;height:100%;padding:16px;border-radius:8px;border:none;}.text-answer-input{flex:1;min-height:80px;padding:12px 12px 0px 12px;border:1px solid #ddd;border-radius:8px 8px 0 0;resize:none;font-size:16px;background-color:#fff;border-bottom:none;outline:none;}.input-toolbar{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;background-color:#fff;border:1px solid #ddd;border-top:none;border-radius:0 0 8px 8px}.text-answer-input:focus{border-color:rgb(74, 144, 226);border-bottom:none}.text-answer-input:focus+.input-toolbar{border-color:rgb(74, 144, 226);border-top:none}.toolbar-actions{display:flex;gap:8px}.toolbar-button{background:transparent;border:none;color:#666;padding:4px;cursor:pointer;border-radius:4px}.toolbar-button:hover{background-color:#f0f0f0}.submit-text-button{padding:6px 16px;background-color:#4a90e2;color:white;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:background-color 0.2s}.submit-text-button:hover:not(.disabled){background-color:#3a7bc8}.submit-text-button.disabled{background-color:#b3b3b3;cursor:not-allowed}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}.chat-history{min-height:200px;max-height:350px}}";
|
|
6
5
|
|
|
7
6
|
const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends H {
|
|
8
7
|
constructor() {
|
|
@@ -23,7 +22,7 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
23
22
|
/**
|
|
24
23
|
* API鉴权密钥
|
|
25
24
|
*/
|
|
26
|
-
|
|
25
|
+
token = '';
|
|
27
26
|
/**
|
|
28
27
|
* 是否显示聊天模态框
|
|
29
28
|
*/
|
|
@@ -53,7 +52,7 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
53
52
|
*/
|
|
54
53
|
isNeedClose = true;
|
|
55
54
|
/**
|
|
56
|
-
* 会话ID
|
|
55
|
+
* 会话ID,传入继续对话,否则创建新会话
|
|
57
56
|
*/
|
|
58
57
|
conversationId;
|
|
59
58
|
/**
|
|
@@ -128,7 +127,7 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
128
127
|
countdownWarningTime = 30;
|
|
129
128
|
showCountdownWarning = false;
|
|
130
129
|
/**
|
|
131
|
-
*
|
|
130
|
+
* 是否以全屏模式打开,移动端建议设置为true
|
|
132
131
|
*/
|
|
133
132
|
fullscreen = false;
|
|
134
133
|
// 添加新的状态来跟踪视频上传
|
|
@@ -145,20 +144,22 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
145
144
|
* 录制状态变化事件
|
|
146
145
|
*/
|
|
147
146
|
recordingStatusChange;
|
|
147
|
+
/**
|
|
148
|
+
* 是否启用语音播报功能
|
|
149
|
+
* true: 启用语音合成
|
|
150
|
+
* false: 禁用语音合成
|
|
151
|
+
*/
|
|
152
|
+
enableTTS = false;
|
|
148
153
|
/**
|
|
149
154
|
* 是否自动播放语音问题
|
|
150
155
|
*/
|
|
151
|
-
enableVoice =
|
|
156
|
+
enableVoice = false;
|
|
152
157
|
/**
|
|
153
158
|
* 是否显示题干内容
|
|
154
159
|
* 1: 显示题干内容
|
|
155
160
|
* 0: 不显示题干内容
|
|
156
161
|
*/
|
|
157
162
|
displayContentStatus = "1";
|
|
158
|
-
/**
|
|
159
|
-
* 用户ID
|
|
160
|
-
*/
|
|
161
|
-
userId = '';
|
|
162
163
|
/**
|
|
163
164
|
* 面试模式
|
|
164
165
|
* video: 视频面试模式
|
|
@@ -172,6 +173,10 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
172
173
|
* 自定义智能体inputs输入参数
|
|
173
174
|
*/
|
|
174
175
|
customInputs = {};
|
|
176
|
+
/**
|
|
177
|
+
* 机器人ID
|
|
178
|
+
*/
|
|
179
|
+
botId;
|
|
175
180
|
handleClose = () => {
|
|
176
181
|
this.stopRecording();
|
|
177
182
|
this.modalClosed.emit();
|
|
@@ -194,7 +199,7 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
194
199
|
answer: '',
|
|
195
200
|
isStreaming: true, // 是否正在流式输出
|
|
196
201
|
conversation_id: this.conversationId, // 会话ID
|
|
197
|
-
inputs:
|
|
202
|
+
inputs: this.customInputs, // 输入参数
|
|
198
203
|
status: "normal", // 消息状态
|
|
199
204
|
error: null // 错误信息
|
|
200
205
|
};
|
|
@@ -220,7 +225,7 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
220
225
|
response_mode: 'streaming',
|
|
221
226
|
conversation_id: this.conversationId,
|
|
222
227
|
query: queryText,
|
|
223
|
-
|
|
228
|
+
bot_id: this.botId // 添加 botId 到请求数据中
|
|
224
229
|
};
|
|
225
230
|
// 合并基本输入参数和自定义输入参数
|
|
226
231
|
requestData.inputs = {
|
|
@@ -232,10 +237,10 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
232
237
|
requestData.inputs.video_url = videoUrl;
|
|
233
238
|
}
|
|
234
239
|
await sendSSERequest({
|
|
235
|
-
url:
|
|
240
|
+
url: `/sdk/v1/chat/chat-messages`,
|
|
236
241
|
method: 'POST',
|
|
237
242
|
headers: {
|
|
238
|
-
'authorization': 'Bearer ' + this.
|
|
243
|
+
'authorization': 'Bearer ' + this.token
|
|
239
244
|
},
|
|
240
245
|
data: requestData,
|
|
241
246
|
onMessage: (data) => {
|
|
@@ -303,19 +308,26 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
303
308
|
if (latestAIMessage && latestAIMessage.answer) {
|
|
304
309
|
// 优先使用 LLMText,如果没有则使用 answer
|
|
305
310
|
const textForSynthesis = llmText || latestAIMessage.answer;
|
|
306
|
-
if (textForSynthesis) {
|
|
311
|
+
if (textForSynthesis && this.enableTTS) {
|
|
307
312
|
// 合成语音
|
|
308
313
|
const audioUrl = await this.synthesizeAudio(textForSynthesis);
|
|
309
314
|
if (this.enableVoice) {
|
|
310
315
|
// 自动播放语音
|
|
311
316
|
await this.playAudio(audioUrl);
|
|
312
|
-
//
|
|
313
|
-
this.
|
|
317
|
+
// 自动播放模式下,只在视频模式时开始等待录制
|
|
318
|
+
if (this.interviewMode === 'video') {
|
|
319
|
+
this.startWaitingToRecord();
|
|
320
|
+
}
|
|
314
321
|
}
|
|
315
322
|
else {
|
|
316
323
|
// 只保存音频URL,不自动播放
|
|
317
324
|
this.audioUrl = audioUrl;
|
|
318
|
-
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
// 如果禁用了语音合成,只在视频模式时开始等待录制
|
|
329
|
+
if (this.interviewMode === 'video') {
|
|
330
|
+
this.startWaitingToRecord();
|
|
319
331
|
}
|
|
320
332
|
}
|
|
321
333
|
}
|
|
@@ -357,57 +369,46 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
357
369
|
this.isLoadingHistory = true;
|
|
358
370
|
console.log('加载历史消息...');
|
|
359
371
|
try {
|
|
360
|
-
await sendHttpRequest({
|
|
361
|
-
url:
|
|
372
|
+
const result = await sendHttpRequest({
|
|
373
|
+
url: '/sdk/v1/chat/messages',
|
|
362
374
|
method: 'GET',
|
|
363
375
|
headers: {
|
|
364
|
-
'authorization': 'Bearer ' + this.
|
|
376
|
+
'authorization': 'Bearer ' + this.token
|
|
365
377
|
},
|
|
366
378
|
data: {
|
|
367
379
|
conversation_id: this.conversationId,
|
|
380
|
+
bot_id: this.botId,
|
|
368
381
|
limit: 20
|
|
369
|
-
},
|
|
370
|
-
onMessage: (data) => {
|
|
371
|
-
if (data.data) {
|
|
372
|
-
const historyData = data.data || [];
|
|
373
|
-
const formattedMessages = historyData.map(msg => {
|
|
374
|
-
const time = new Date(msg.created_at * 1000);
|
|
375
|
-
const hours = time.getHours().toString().padStart(2, '0');
|
|
376
|
-
const minutes = time.getMinutes().toString().padStart(2, '0');
|
|
377
|
-
const timeStr = `${hours}:${minutes}`;
|
|
378
|
-
// 创建新的消息对象,不包含 inputs 字段
|
|
379
|
-
const { inputs, ...msgWithoutInputs } = msg;
|
|
380
|
-
return {
|
|
381
|
-
...msgWithoutInputs,
|
|
382
|
-
time: timeStr,
|
|
383
|
-
isStreaming: false,
|
|
384
|
-
status: msg.status === 'error' ? 'error' : 'normal'
|
|
385
|
-
};
|
|
386
|
-
});
|
|
387
|
-
this.messages = formattedMessages;
|
|
388
|
-
this.isLoadingHistory = false;
|
|
389
|
-
requestAnimationFrame(() => {
|
|
390
|
-
this.shouldAutoScroll = true;
|
|
391
|
-
this.scrollToBottom();
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
else {
|
|
395
|
-
this.isLoadingHistory = false;
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
onError: (error) => {
|
|
399
|
-
console.error('加载历史消息失败:', error);
|
|
400
|
-
alert(error instanceof Error ? error.message : '加载历史消息失败,请刷新重试');
|
|
401
|
-
this.isLoadingHistory = false;
|
|
402
|
-
},
|
|
403
|
-
onComplete: () => {
|
|
404
|
-
this.isLoadingHistory = false;
|
|
405
382
|
}
|
|
406
383
|
});
|
|
384
|
+
if (result.success && result.data) {
|
|
385
|
+
const historyData = result.data.data || [];
|
|
386
|
+
const formattedMessages = historyData.map(msg => {
|
|
387
|
+
const time = new Date(msg.created_at * 1000);
|
|
388
|
+
const hours = time.getHours().toString().padStart(2, '0');
|
|
389
|
+
const minutes = time.getMinutes().toString().padStart(2, '0');
|
|
390
|
+
const timeStr = `${hours}:${minutes}`;
|
|
391
|
+
// 创建新的消息对象,不包含 inputs 字段
|
|
392
|
+
const { inputs, ...msgWithoutInputs } = msg;
|
|
393
|
+
return {
|
|
394
|
+
...msgWithoutInputs,
|
|
395
|
+
time: timeStr,
|
|
396
|
+
isStreaming: false,
|
|
397
|
+
status: msg.status === 'error' ? 'error' : 'normal'
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
this.messages = formattedMessages;
|
|
401
|
+
requestAnimationFrame(() => {
|
|
402
|
+
this.shouldAutoScroll = true;
|
|
403
|
+
this.scrollToBottom();
|
|
404
|
+
});
|
|
405
|
+
}
|
|
407
406
|
}
|
|
408
407
|
catch (error) {
|
|
409
408
|
console.error('加载历史消息失败:', error);
|
|
410
409
|
alert(error instanceof Error ? error.message : '加载历史消息失败,请刷新重试');
|
|
410
|
+
}
|
|
411
|
+
finally {
|
|
411
412
|
this.isLoadingHistory = false;
|
|
412
413
|
}
|
|
413
414
|
}
|
|
@@ -435,6 +436,10 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
435
436
|
}
|
|
436
437
|
// 开始等待录制
|
|
437
438
|
startWaitingToRecord() {
|
|
439
|
+
// 如果不是视频模式,直接返回
|
|
440
|
+
if (this.interviewMode !== 'video') {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
438
443
|
// 清除可能存在的计时器
|
|
439
444
|
if (this.waitingTimer) {
|
|
440
445
|
clearInterval(this.waitingTimer);
|
|
@@ -690,34 +695,23 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
690
695
|
// 修改音频转文字方法
|
|
691
696
|
async convertAudioToText(cosKey) {
|
|
692
697
|
try {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
data: {
|
|
703
|
-
cos_key: cosKey
|
|
704
|
-
},
|
|
705
|
-
onMessage: (data) => {
|
|
706
|
-
// 检查返回结果中是否包含转换后的文本
|
|
707
|
-
if (data && data.text) {
|
|
708
|
-
resolve(data.text);
|
|
709
|
-
}
|
|
710
|
-
else {
|
|
711
|
-
console.warn('音频转文字返回结果格式不正确');
|
|
712
|
-
resolve(null);
|
|
713
|
-
}
|
|
714
|
-
},
|
|
715
|
-
onError: (error) => {
|
|
716
|
-
console.error('音频转文字请求失败:', error);
|
|
717
|
-
reject(error);
|
|
718
|
-
}
|
|
719
|
-
});
|
|
698
|
+
const result = await sendHttpRequest({
|
|
699
|
+
url: '/sdk/v1/tts/audio_to_text',
|
|
700
|
+
method: 'POST',
|
|
701
|
+
headers: {
|
|
702
|
+
'authorization': 'Bearer ' + this.token
|
|
703
|
+
},
|
|
704
|
+
data: {
|
|
705
|
+
cos_key: cosKey
|
|
706
|
+
}
|
|
720
707
|
});
|
|
708
|
+
if (result.success && result.data && result.data.text) {
|
|
709
|
+
return result.data.text;
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
console.warn('音频转文字返回结果格式不正确');
|
|
713
|
+
return null;
|
|
714
|
+
}
|
|
721
715
|
}
|
|
722
716
|
catch (error) {
|
|
723
717
|
console.error('音频转文字错误:', error);
|
|
@@ -734,27 +728,16 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
734
728
|
// 根据Blob类型确定文件扩展名
|
|
735
729
|
const fileExtension = this.recordedBlob.type.includes('webm') ? 'webm' : 'mp4';
|
|
736
730
|
const fileName = `answer.${fileExtension}`;
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
'authorization': 'Bearer ' + this.apiKey
|
|
743
|
-
},
|
|
744
|
-
body: formData
|
|
731
|
+
// 创建File对象
|
|
732
|
+
const file = new File([this.recordedBlob], fileName, { type: this.recordedBlob.type });
|
|
733
|
+
// 使用uploadFileToBackend上传文件
|
|
734
|
+
const fileInfo = await uploadFileToBackend(file, {
|
|
735
|
+
'authorization': 'Bearer ' + this.token
|
|
745
736
|
});
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
// 保存视频答案
|
|
751
|
-
await this.saveVideoAnswer(result.cos_key);
|
|
752
|
-
// 发送"下一题"请求,可以附带转录文本
|
|
753
|
-
this.sendMessageToAPI(transcriptionText || "下一题");
|
|
754
|
-
}
|
|
755
|
-
else {
|
|
756
|
-
throw new Error('视频上传失败');
|
|
757
|
-
}
|
|
737
|
+
// 调用音频转文字API
|
|
738
|
+
const transcriptionText = await this.convertAudioToText(fileInfo.cos_key);
|
|
739
|
+
// 发送"下一题"请求,可以附带转录文本
|
|
740
|
+
this.sendMessageToAPI(transcriptionText || "下一题");
|
|
758
741
|
}
|
|
759
742
|
catch (error) {
|
|
760
743
|
console.error('视频上传或处理错误:', error);
|
|
@@ -771,32 +754,6 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
771
754
|
this.recordedBlob = null;
|
|
772
755
|
}
|
|
773
756
|
}
|
|
774
|
-
// 保存视频答案
|
|
775
|
-
async saveVideoAnswer(cosKey) {
|
|
776
|
-
if (!this.conversationId)
|
|
777
|
-
return;
|
|
778
|
-
try {
|
|
779
|
-
const lastAIMessage = this.messages.length > 0 ? this.messages[this.messages.length - 1] : null;
|
|
780
|
-
if (!lastAIMessage)
|
|
781
|
-
return;
|
|
782
|
-
await sendHttpRequest({
|
|
783
|
-
url: 'https://pcm_api.ylzhaopin.com/agents/hr_competition/answer',
|
|
784
|
-
method: 'POST',
|
|
785
|
-
headers: {
|
|
786
|
-
'authorization': 'Bearer ' + this.apiKey
|
|
787
|
-
},
|
|
788
|
-
data: {
|
|
789
|
-
conversation_id: this.conversationId,
|
|
790
|
-
user: this.userId, // 使用传入的 userId
|
|
791
|
-
question: lastAIMessage.answer,
|
|
792
|
-
file_url: cosKey
|
|
793
|
-
},
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
catch (error) {
|
|
797
|
-
console.error('保存视频答案失败:', error);
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
757
|
/**
|
|
801
758
|
* 发送面试完成请求
|
|
802
759
|
*/
|
|
@@ -808,20 +765,19 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
808
765
|
response_mode: 'streaming',
|
|
809
766
|
conversation_id: this.conversationId,
|
|
810
767
|
query: "面试完成",
|
|
811
|
-
user: this.userId,
|
|
812
768
|
inputs: {
|
|
813
769
|
// 合并自定义输入参数
|
|
814
770
|
...this.customInputs
|
|
815
771
|
}
|
|
816
772
|
};
|
|
817
|
-
//
|
|
818
|
-
|
|
819
|
-
url:
|
|
773
|
+
// 使用sendHttpRequest发送请求
|
|
774
|
+
sendHttpRequest({
|
|
775
|
+
url: '/sdk/v1/chat/chat-messages',
|
|
820
776
|
method: 'POST',
|
|
821
777
|
headers: {
|
|
822
|
-
'authorization': 'Bearer ' + this.
|
|
778
|
+
'authorization': 'Bearer ' + this.token
|
|
823
779
|
},
|
|
824
|
-
data: requestData
|
|
780
|
+
data: requestData
|
|
825
781
|
}).catch(error => {
|
|
826
782
|
console.error('发送面试完成请求失败:', error);
|
|
827
783
|
});
|
|
@@ -833,11 +789,11 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
833
789
|
// 添加TTS合成音频的方法
|
|
834
790
|
async synthesizeAudio(text) {
|
|
835
791
|
try {
|
|
836
|
-
const response = await fetch(
|
|
792
|
+
const response = await fetch(`${API_DOMAIN}/sdk/v1/tts/synthesize_audio`, {
|
|
837
793
|
method: 'POST',
|
|
838
794
|
headers: {
|
|
839
795
|
'Content-Type': 'application/json',
|
|
840
|
-
'authorization': 'Bearer ' + this.
|
|
796
|
+
'authorization': 'Bearer ' + this.token
|
|
841
797
|
},
|
|
842
798
|
body: JSON.stringify({ text })
|
|
843
799
|
});
|
|
@@ -916,8 +872,10 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
916
872
|
handlePlayAudio = async () => {
|
|
917
873
|
if (this.audioUrl) {
|
|
918
874
|
await this.playAudio(this.audioUrl);
|
|
919
|
-
//
|
|
920
|
-
this.
|
|
875
|
+
// 手动播放完成后只在视频模式时开始等待录制
|
|
876
|
+
if (this.interviewMode === 'video') {
|
|
877
|
+
this.startWaitingToRecord();
|
|
878
|
+
}
|
|
921
879
|
}
|
|
922
880
|
};
|
|
923
881
|
// 处理文本输入变化
|
|
@@ -1011,7 +969,7 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
1011
969
|
return (h("div", { class: "placeholder-status default-status" }, h("p", null, "\u51C6\u5907\u4E2D...")));
|
|
1012
970
|
};
|
|
1013
971
|
// 修改文本输入区域渲染函数
|
|
1014
|
-
const renderTextInputArea = () => (h("div", { class: "text-input-area" }, h("textarea", { class: "text-answer-input", placeholder: "\u8BF7\u8F93\u5165
|
|
972
|
+
const renderTextInputArea = () => (h("div", { class: "text-input-area" }, h("textarea", { class: "text-answer-input", placeholder: "\u8BF7\u8F93\u5165...(\u6309\u56DE\u8F66\u53D1\u9001\uFF0CCtrl+\u56DE\u8F66\u6362\u884C)", value: this.textAnswer, onInput: this.handleTextInputChange, onKeyDown: this.handleKeyDown, disabled: this.isSubmittingText || this.isLoading || !!this.currentStreamingMessage || this.waitingToRecord || this.isPlayingAudio }), h("div", { class: "input-toolbar" }, h("div", { class: "toolbar-actions" }), h("button", { class: {
|
|
1015
973
|
'submit-text-button': true,
|
|
1016
974
|
'disabled': !this.textAnswer.trim() || this.isSubmittingText || this.isLoading || !!this.currentStreamingMessage || this.waitingToRecord || this.isPlayingAudio
|
|
1017
975
|
}, disabled: !this.textAnswer.trim() || this.isSubmittingText || this.isLoading || !!this.currentStreamingMessage || this.waitingToRecord || this.isPlayingAudio, onClick: this.submitTextAnswer }, this.isSubmittingText ? '发送中...' : '发送'))));
|
|
@@ -1032,7 +990,7 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
1032
990
|
static get style() { return pcmAppChatModalCss; }
|
|
1033
991
|
}, [1, "pcm-app-chat-modal", {
|
|
1034
992
|
"modalTitle": [1, "modal-title"],
|
|
1035
|
-
"
|
|
993
|
+
"token": [1],
|
|
1036
994
|
"isOpen": [1028, "is-open"],
|
|
1037
995
|
"icon": [1],
|
|
1038
996
|
"zIndex": [2, "z-index"],
|
|
@@ -1044,11 +1002,12 @@ const ChatAPPModal = /*@__PURE__*/ proxyCustomElement(class ChatAPPModal extends
|
|
|
1044
1002
|
"maxRecordingTime": [2, "max-recording-time"],
|
|
1045
1003
|
"countdownWarningTime": [2, "countdown-warning-time"],
|
|
1046
1004
|
"fullscreen": [4],
|
|
1005
|
+
"enableTTS": [4, "enable-t-t-s"],
|
|
1047
1006
|
"enableVoice": [4, "enable-voice"],
|
|
1048
1007
|
"displayContentStatus": [1, "display-content-status"],
|
|
1049
|
-
"userId": [1, "user-id"],
|
|
1050
1008
|
"interviewMode": [1, "interview-mode"],
|
|
1051
1009
|
"customInputs": [16],
|
|
1010
|
+
"botId": [1, "bot-id"],
|
|
1052
1011
|
"messages": [32],
|
|
1053
1012
|
"currentAssistantMessage": [32],
|
|
1054
1013
|
"isLoading": [32],
|
|
@@ -1100,6 +1059,6 @@ function defineCustomElement() {
|
|
|
1100
1059
|
defineCustomElement();
|
|
1101
1060
|
|
|
1102
1061
|
export { ChatAPPModal as C, defineCustomElement as d };
|
|
1103
|
-
//# sourceMappingURL=p-
|
|
1062
|
+
//# sourceMappingURL=p-BctfuDvG.js.map
|
|
1104
1063
|
|
|
1105
|
-
//# sourceMappingURL=p-
|
|
1064
|
+
//# sourceMappingURL=p-BctfuDvG.js.map
|