wi-chat 0.3.0 → 0.5.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/dist/core/index.cjs +1 -1
- package/dist/core/index.js +129 -123
- package/dist/core/useChat.d.ts +11 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +101 -68
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +8 -3
- package/dist/mobile-ui/chat/ChatMessagesView.vue.d.ts +5 -0
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.d.ts +2 -2
- package/dist/mobile-ui/index.js +79 -71
- package/dist/mobile-ui/inputbox/Inputbox.vue.d.ts +1 -1
- package/dist/mobile-ui/style.css +1 -1
- package/dist/page-context/extArgs.d.ts +46 -0
- package/dist/page-context/index.cjs +2 -0
- package/dist/page-context/index.d.ts +18 -0
- package/dist/page-context/index.js +48 -0
- package/dist/page-context/state.d.ts +10 -0
- package/dist/page-context/types.d.ts +218 -0
- package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +38 -0
- package/dist/parser/answerCom/actionExecute/clarification.d.ts +67 -0
- package/dist/parser/answerCom/actionExecute/parseActionExecute.d.ts +28 -0
- package/dist/parser/answerCom/actionExecute/types.d.ts +153 -0
- package/dist/parser/answerCom/outputFile/parseOutputFile.d.ts +43 -0
- package/dist/parser/answerCom/outputFile/types.d.ts +17 -0
- package/dist/parser/index.cjs +2 -2
- package/dist/parser/index.d.ts +12 -0
- package/dist/parser/index.js +537 -211
- package/dist/parser/registry.d.ts +8 -1
- package/dist/parser/title.d.ts +27 -0
- package/dist/renderers/clarification/ClarificationCard.vue.d.ts +19 -0
- package/dist/renderers/index.cjs +1 -1
- package/dist/renderers/index.d.ts +4 -0
- package/dist/renderers/index.js +796 -143
- package/dist/renderers/outputFile/OutputFile.vue.d.ts +19 -0
- package/dist/renderers/outputFile/useOutputFile.d.ts +85 -0
- package/dist/renderers/style.css +1 -1
- package/dist/right-panel/RightPanel.vue.d.ts +43 -0
- package/dist/right-panel/RightPanelIcon.vue.d.ts +38 -0
- package/dist/right-panel/RightPanelTabs.vue.d.ts +39 -0
- package/dist/right-panel/icons.d.ts +48 -0
- package/dist/right-panel/index.cjs +2 -0
- package/dist/right-panel/index.d.ts +43 -0
- package/dist/right-panel/index.js +1004 -0
- package/dist/right-panel/panels/index.d.ts +7 -0
- package/dist/right-panel/panels/newtab/NewTabPanel.vue.d.ts +27 -0
- package/dist/right-panel/panels/newtab/defaults.d.ts +6 -0
- package/dist/right-panel/panels/newtab/index.d.ts +4 -0
- package/dist/right-panel/panels/web/WebPanel.vue.d.ts +28 -0
- package/dist/right-panel/panels/web/index.d.ts +4 -0
- package/dist/right-panel/panels/web/useWebview.d.ts +59 -0
- package/dist/right-panel/registry.d.ts +24 -0
- package/dist/right-panel/runtime.d.ts +45 -0
- package/dist/right-panel/scope.d.ts +34 -0
- package/dist/right-panel/shared/BrowserToolbar.vue.d.ts +23 -0
- package/dist/right-panel/shared/RightPanelToolList.vue.d.ts +48 -0
- package/dist/right-panel/style.css +1 -0
- package/dist/right-panel/types.d.ts +363 -0
- package/dist/right-panel/useRightPanel.d.ts +39 -0
- package/dist/right-panel/useRightPanelTabs.d.ts +14 -0
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +182 -162
- package/dist/tools/markdown/index.d.ts +1 -1
- package/dist/tools/markdown/renderMarkdown.d.ts +25 -0
- package/dist/web-ui/attach/AttachmentList.vue.d.ts +1 -1
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +8 -3
- package/dist/web-ui/chat/ChatMessagesView.vue.d.ts +5 -0
- package/dist/web-ui/envswitch/EnvSwitch.vue.d.ts +2 -2
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.d.ts +2 -2
- package/dist/web-ui/index.js +428 -408
- package/dist/web-ui/inputbox/Inputbox.vue.d.ts +4 -7
- package/dist/web-ui/style.css +1 -1
- package/package.json +13 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
export { AuthExpiredError, isCancelError, createRequest, pwdEncrypt, login, createChatApi, fileToBase64, formDataToJson, buildChatWsUrl, resolveMessageData, sendPayloadInChunks, openChatWebSocketStream } from 'wi-chat/request';
|
|
3
3
|
export type { RequestOptions, RequestClient, LoginParams, LoginResult, HistoryGroup, HistoryGroupsResult, HistoryDetailItem, AgentEntryItem, ChatApi, FileJsonValue, ChatWsStreamOptions, WsChunkSender } from 'wi-chat/request';
|
|
4
|
-
export { normalizeAnswer, applyAnswerChunk, normalizeAnswerReport, RoleEnum, nextLocalMessageId, parseSseLine, createLineSplitter, consumeStream, IMAGE_EXTENSIONS, formatFileSize, isImageAttachment, resolveRemoteFileUrl, resolveAttachDownloadUrl, resolveAttachPreviewUrl, parseRealtimeAttachment, parseHistoryAttachment, extractHistoryAttachments, normalizeAttachment, createEmptyAnswerValues, applyKnowledgeStreamChunk, normalizeKnowledgeStreamReport, knowledgeStreamParser, IFRAME_RESIZER_CHILD_SCRIPT, injectIframeResizerScript, applyIframePageChunk, normalizeIframePageReport, iframePageParser, RECORDSET_ANSWER_TYPE, readRecordsetPayload, applyRecordsetChunk, normalizeRecordsetReport, recordsetParser, applyDeepThinkingChunk, collectDeepThinkingSteps, collectThinkingSteps, deepThinkingParser, extractAttachmentsFromHistory, getHistoryGroups, createHistoryGroup, deleteHistoryGroup, setHistoryGroupTitle, loadGroupMessages, loadGroupMessagesByStep } from 'wi-chat/parser';
|
|
5
|
-
export type { AiAnswerReport, AiAnswerValues, AnswerParser, AnswerParseOptions, Role, UserMessage, AssistantMessage, Message, StreamChunk, LineSplitter, ChatAttachment, FileAttachContent, AttachmentType, KnowledgeStreamValue, BeforeKnowledgeRender, KnowledgeRenderOptions, IframePageValue, RecordsetColumn, RecordsetValue, ExecProcessItem, GroupMessagesProgress } from 'wi-chat/parser';
|
|
4
|
+
export { normalizeAnswer, applyAnswerChunk, normalizeAnswerReport, RoleEnum, nextLocalMessageId, parseSseLine, createLineSplitter, consumeStream, IMAGE_EXTENSIONS, formatFileSize, isImageAttachment, resolveRemoteFileUrl, resolveAttachDownloadUrl, resolveAttachPreviewUrl, parseRealtimeAttachment, parseHistoryAttachment, extractHistoryAttachments, normalizeAttachment, createEmptyAnswerValues, applyKnowledgeStreamChunk, normalizeKnowledgeStreamReport, knowledgeStreamParser, IFRAME_RESIZER_CHILD_SCRIPT, injectIframeResizerScript, applyIframePageChunk, normalizeIframePageReport, iframePageParser, RECORDSET_ANSWER_TYPE, readRecordsetPayload, applyRecordsetChunk, normalizeRecordsetReport, recordsetParser, OUTPUT_FILE_ANSWER_TYPE, readOutputFilePayload, applyOutputFileChunk, normalizeOutputFileReport, outputFileParser, ACTION_EXECUTE_ANSWER_TYPE, applyActionExecuteChunk, normalizeActionExecuteReport, actionExecuteParser, createFailureResult, normalizeActionResult, parseActionExecuteCommand, wrapActionFrame, normalizeActionDefinition, parseClarificationArguments, nextClarificationRequestId, registerClarification, hasPendingClarification, submitClarification, cancelClarification, clearPendingClarifications, applyDeepThinkingChunk, collectDeepThinkingSteps, collectThinkingSteps, deepThinkingParser, extractAttachmentsFromHistory, getHistoryGroups, createHistoryGroup, deleteHistoryGroup, setHistoryGroupTitle, loadGroupMessages, loadGroupMessagesByStep, buildChatTitle, CHAT_TITLE_MAX_LENGTH } from 'wi-chat/parser';
|
|
5
|
+
export type { AiAnswerReport, AiAnswerValues, AnswerParser, AnswerParseOptions, Role, UserMessage, AssistantMessage, Message, StreamChunk, LineSplitter, ChatAttachment, FileAttachContent, AttachmentType, KnowledgeStreamValue, BeforeKnowledgeRender, KnowledgeRenderOptions, IframePageValue, RecordsetColumn, RecordsetValue, OutputFileValue, ExecProcessItem, GroupMessagesProgress, ActionExecutor, ActionDefinition, ActionExecuteCommand, ActionResult, WaitReplyPayload, FrontReplyOptions, ParsedClarificationArguments, ClarificationInputType, ClarificationAnswerMode, ClarificationOption, ClarificationBinding, ClarificationInput, ClarificationItem, ClarificationAnswer, ClarificationStatus, ClarificationViewModel } from 'wi-chat/parser';
|
|
6
|
+
export { PAGE_CONTEXT_EXT_ARGS_KEY, PAGE_CONTEXT_SCHEMA_VERSION, createPageContext, toPageContextExtArgs, parsePageContextExtArgs, isAgentPageContext, AGENT_TABLE_STATE_ROW_LIMIT, normalizeAgentPageState } from 'wi-chat/page-context';
|
|
7
|
+
export type { PageContextExtArgs, CreatePageContextOptions, AgentSchemaBase, AgentStringSchemaOption, AgentStringSchema, AgentNumberSchema, AgentBooleanSchema, AgentParameterSchema, AgentSchemaProperties, AgentObjectSchema, AgentArraySchema, AgentActionExecution, AgentAction, AgentNavigationScalarSchema, AgentNavigationArraySchema, AgentNavigationValueSchema, AgentNavigationSchemaProperties, AgentNavigationObjectSchema, AgentNavigationParameterSchemas, AgentRouteNavigationMeta, AgentNavigationParameterValues, AgentMenu, AgentNavigationContext, AgentTableColumnType, AgentTableColumn, AgentTableStateInput, AgentTableState, AgentPageState, AgentPageContext } from 'wi-chat/page-context';
|
|
6
8
|
export { DEFAULT_PRIMARY, createChatTheme, applyTheme } from 'wi-chat/theme';
|
|
7
9
|
export type { ChatThemeOptions, ChatThemeTokens } from 'wi-chat/theme';
|
|
8
10
|
export { useChat, useHistory, useAgent, useChatSession } from 'wi-chat/core';
|
|
9
11
|
export type { SubmitQuestionOptions, UseChatOptions, UseChatReturn, UseHistoryOptions, UseHistoryReturn, UseAgentOptions, UseAgentReturn, UseChatSessionAgentOptions, UseChatSessionChatOptions, UseChatSessionErrorScope, UseChatSessionHistoryOptions, UseChatSessionOptions, UseChatSessionReturn } from 'wi-chat/core';
|
|
10
|
-
export { renderMarkdown, openImagePreview, closeImagePreview, downloadAttachment, useAutoScroll } from 'wi-chat/tools';
|
|
12
|
+
export { renderMarkdown, createStyleScope, openImagePreview, closeImagePreview, downloadAttachment, useAutoScroll } from 'wi-chat/tools';
|
|
11
13
|
export type { MarkdownRenderOptions, DownloadAttachmentOptions, OnReachTopOptions, UseAutoScrollReturn } from 'wi-chat/tools';
|
package/dist/index.js
CHANGED
|
@@ -1,76 +1,109 @@
|
|
|
1
1
|
import "wi-chat/style.css";
|
|
2
|
-
import { AuthExpiredError as a, buildChatWsUrl as o, createChatApi as
|
|
3
|
-
import { IFRAME_RESIZER_CHILD_SCRIPT as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { AuthExpiredError as a, buildChatWsUrl as o, createChatApi as i, createRequest as n, fileToBase64 as s, formDataToJson as l, isCancelError as p, login as c, openChatWebSocketStream as m, pwdEncrypt as u, resolveMessageData as A, sendPayloadInChunks as E } from "wi-chat/request";
|
|
3
|
+
import { ACTION_EXECUTE_ANSWER_TYPE as T, CHAT_TITLE_MAX_LENGTH as g, IFRAME_RESIZER_CHILD_SCRIPT as h, IMAGE_EXTENSIONS as d, OUTPUT_FILE_ANSWER_TYPE as R, RECORDSET_ANSWER_TYPE as P, RoleEnum as S, actionExecuteParser as _, applyActionExecuteChunk as y, applyAnswerChunk as I, applyDeepThinkingChunk as f, applyIframePageChunk as x, applyKnowledgeStreamChunk as k, applyOutputFileChunk as w, applyRecordsetChunk as z, buildChatTitle as F, cancelClarification as G, clearPendingClarifications as H, collectDeepThinkingSteps as M, collectThinkingSteps as N, consumeStream as O, createEmptyAnswerValues as L, createFailureResult as D, createHistoryGroup as U, createLineSplitter as v, deepThinkingParser as W, deleteHistoryGroup as X, extractAttachmentsFromHistory as Y, extractHistoryAttachments as b, formatFileSize as B, getHistoryGroups as K, hasPendingClarification as q, iframePageParser as V, injectIframeResizerScript as j, isImageAttachment as J, knowledgeStreamParser as Z, loadGroupMessages as Q, loadGroupMessagesByStep as $, nextClarificationRequestId as ee, nextLocalMessageId as te, normalizeActionDefinition as re, normalizeActionExecuteReport as ae, normalizeActionResult as oe, normalizeAnswer as ie, normalizeAnswerReport as ne, normalizeAttachment as se, normalizeIframePageReport as le, normalizeKnowledgeStreamReport as pe, normalizeOutputFileReport as ce, normalizeRecordsetReport as me, outputFileParser as ue, parseActionExecuteCommand as Ae, parseClarificationArguments as Ee, parseHistoryAttachment as Ce, parseRealtimeAttachment as Te, parseSseLine as ge, readOutputFilePayload as he, readRecordsetPayload as de, recordsetParser as Re, registerClarification as Pe, resolveAttachDownloadUrl as Se, resolveAttachPreviewUrl as _e, resolveRemoteFileUrl as ye, setHistoryGroupTitle as Ie, submitClarification as fe, wrapActionFrame as xe } from "wi-chat/parser";
|
|
4
|
+
import { AGENT_TABLE_STATE_ROW_LIMIT as we, PAGE_CONTEXT_EXT_ARGS_KEY as ze, PAGE_CONTEXT_SCHEMA_VERSION as Fe, createPageContext as Ge, isAgentPageContext as He, normalizeAgentPageState as Me, parsePageContextExtArgs as Ne, toPageContextExtArgs as Oe } from "wi-chat/page-context";
|
|
5
|
+
import { DEFAULT_PRIMARY as De, applyTheme as Ue, createChatTheme as ve } from "wi-chat/theme";
|
|
6
|
+
import { useAgent as Xe, useChat as Ye, useChatSession as be, useHistory as Be } from "wi-chat/core";
|
|
7
|
+
import { closeImagePreview as qe, createStyleScope as Ve, downloadAttachment as je, openImagePreview as Je, renderMarkdown as Ze, useAutoScroll as Qe } from "wi-chat/tools";
|
|
7
8
|
export {
|
|
9
|
+
T as ACTION_EXECUTE_ANSWER_TYPE,
|
|
10
|
+
we as AGENT_TABLE_STATE_ROW_LIMIT,
|
|
8
11
|
a as AuthExpiredError,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
g as CHAT_TITLE_MAX_LENGTH,
|
|
13
|
+
De as DEFAULT_PRIMARY,
|
|
14
|
+
h as IFRAME_RESIZER_CHILD_SCRIPT,
|
|
15
|
+
d as IMAGE_EXTENSIONS,
|
|
16
|
+
R as OUTPUT_FILE_ANSWER_TYPE,
|
|
17
|
+
ze as PAGE_CONTEXT_EXT_ARGS_KEY,
|
|
18
|
+
Fe as PAGE_CONTEXT_SCHEMA_VERSION,
|
|
19
|
+
P as RECORDSET_ANSWER_TYPE,
|
|
20
|
+
S as RoleEnum,
|
|
21
|
+
_ as actionExecuteParser,
|
|
22
|
+
y as applyActionExecuteChunk,
|
|
23
|
+
I as applyAnswerChunk,
|
|
24
|
+
f as applyDeepThinkingChunk,
|
|
25
|
+
x as applyIframePageChunk,
|
|
26
|
+
k as applyKnowledgeStreamChunk,
|
|
27
|
+
w as applyOutputFileChunk,
|
|
28
|
+
z as applyRecordsetChunk,
|
|
29
|
+
Ue as applyTheme,
|
|
30
|
+
F as buildChatTitle,
|
|
20
31
|
o as buildChatWsUrl,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
G as cancelClarification,
|
|
33
|
+
H as clearPendingClarifications,
|
|
34
|
+
qe as closeImagePreview,
|
|
35
|
+
M as collectDeepThinkingSteps,
|
|
36
|
+
N as collectThinkingSteps,
|
|
37
|
+
O as consumeStream,
|
|
38
|
+
i as createChatApi,
|
|
39
|
+
ve as createChatTheme,
|
|
40
|
+
L as createEmptyAnswerValues,
|
|
41
|
+
D as createFailureResult,
|
|
42
|
+
U as createHistoryGroup,
|
|
43
|
+
v as createLineSplitter,
|
|
44
|
+
Ge as createPageContext,
|
|
30
45
|
n as createRequest,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
Ve as createStyleScope,
|
|
47
|
+
W as deepThinkingParser,
|
|
48
|
+
X as deleteHistoryGroup,
|
|
49
|
+
je as downloadAttachment,
|
|
50
|
+
Y as extractAttachmentsFromHistory,
|
|
51
|
+
b as extractHistoryAttachments,
|
|
52
|
+
s as fileToBase64,
|
|
53
|
+
l as formDataToJson,
|
|
54
|
+
B as formatFileSize,
|
|
55
|
+
K as getHistoryGroups,
|
|
56
|
+
q as hasPendingClarification,
|
|
57
|
+
V as iframePageParser,
|
|
58
|
+
j as injectIframeResizerScript,
|
|
59
|
+
He as isAgentPageContext,
|
|
42
60
|
p as isCancelError,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
J as isImageAttachment,
|
|
62
|
+
Z as knowledgeStreamParser,
|
|
63
|
+
Q as loadGroupMessages,
|
|
64
|
+
$ as loadGroupMessagesByStep,
|
|
65
|
+
c as login,
|
|
66
|
+
ee as nextClarificationRequestId,
|
|
67
|
+
te as nextLocalMessageId,
|
|
68
|
+
re as normalizeActionDefinition,
|
|
69
|
+
ae as normalizeActionExecuteReport,
|
|
70
|
+
oe as normalizeActionResult,
|
|
71
|
+
Me as normalizeAgentPageState,
|
|
72
|
+
ie as normalizeAnswer,
|
|
73
|
+
ne as normalizeAnswerReport,
|
|
74
|
+
se as normalizeAttachment,
|
|
75
|
+
le as normalizeIframePageReport,
|
|
76
|
+
pe as normalizeKnowledgeStreamReport,
|
|
77
|
+
ce as normalizeOutputFileReport,
|
|
78
|
+
me as normalizeRecordsetReport,
|
|
79
|
+
m as openChatWebSocketStream,
|
|
80
|
+
Je as openImagePreview,
|
|
81
|
+
ue as outputFileParser,
|
|
82
|
+
Ae as parseActionExecuteCommand,
|
|
83
|
+
Ee as parseClarificationArguments,
|
|
84
|
+
Ce as parseHistoryAttachment,
|
|
85
|
+
Ne as parsePageContextExtArgs,
|
|
86
|
+
Te as parseRealtimeAttachment,
|
|
87
|
+
ge as parseSseLine,
|
|
88
|
+
u as pwdEncrypt,
|
|
89
|
+
he as readOutputFilePayload,
|
|
90
|
+
de as readRecordsetPayload,
|
|
91
|
+
Re as recordsetParser,
|
|
92
|
+
Pe as registerClarification,
|
|
93
|
+
Ze as renderMarkdown,
|
|
94
|
+
Se as resolveAttachDownloadUrl,
|
|
95
|
+
_e as resolveAttachPreviewUrl,
|
|
96
|
+
A as resolveMessageData,
|
|
97
|
+
ye as resolveRemoteFileUrl,
|
|
98
|
+
E as sendPayloadInChunks,
|
|
99
|
+
Ie as setHistoryGroupTitle,
|
|
100
|
+
fe as submitClarification,
|
|
101
|
+
Oe as toPageContextExtArgs,
|
|
102
|
+
Xe as useAgent,
|
|
103
|
+
Qe as useAutoScroll,
|
|
104
|
+
Ye as useChat,
|
|
105
|
+
be as useChatSession,
|
|
106
|
+
Be as useHistory,
|
|
107
|
+
xe as wrapActionFrame
|
|
75
108
|
};
|
|
76
109
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnswerParser, AssistantMessage, Message } from 'wi-chat/parser';
|
|
2
|
+
import { OutputFileConfig } from 'wi-chat/renderers';
|
|
2
3
|
import { ChatSubmitPayload } from './types';
|
|
3
4
|
|
|
4
5
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
@@ -6,6 +7,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
6
7
|
messages: Message[];
|
|
7
8
|
/** 自定义回答类型 parser */
|
|
8
9
|
parsers?: AnswerParser<any>[];
|
|
10
|
+
/** output_file 文件加载 / 预览配置 */
|
|
11
|
+
outputFileConfig?: OutputFileConfig;
|
|
9
12
|
/** 历史消息是否加载中 */
|
|
10
13
|
loading?: boolean;
|
|
11
14
|
/** 流式回答是否进行中 */
|
|
@@ -47,6 +50,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
47
50
|
messages: Message[];
|
|
48
51
|
/** 自定义回答类型 parser */
|
|
49
52
|
parsers?: AnswerParser<any>[];
|
|
53
|
+
/** output_file 文件加载 / 预览配置 */
|
|
54
|
+
outputFileConfig?: OutputFileConfig;
|
|
50
55
|
/** 历史消息是否加载中 */
|
|
51
56
|
loading?: boolean;
|
|
52
57
|
/** 流式回答是否进行中 */
|
|
@@ -84,14 +89,14 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
84
89
|
onStop?: () => any;
|
|
85
90
|
"onUpdate:question"?: (value: string) => any;
|
|
86
91
|
}, {
|
|
87
|
-
|
|
92
|
+
placeholder: string;
|
|
88
93
|
question: string;
|
|
94
|
+
parsers: AnswerParser<any>[];
|
|
89
95
|
loading: boolean;
|
|
96
|
+
disabled: boolean;
|
|
90
97
|
messages: Message[];
|
|
91
98
|
emptyTitle: string;
|
|
92
99
|
emptyDescription: string;
|
|
93
|
-
placeholder: string;
|
|
94
|
-
disabled: boolean;
|
|
95
100
|
talking: boolean;
|
|
96
101
|
session: string;
|
|
97
102
|
hasMore: boolean;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { AnswerParser, AssistantMessage, Message } from 'wi-chat/parser';
|
|
2
|
+
import { OutputFileConfig } from 'wi-chat/renderers';
|
|
2
3
|
|
|
3
4
|
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
5
|
/** 当前分组消息列表 */
|
|
5
6
|
messages: Message[];
|
|
6
7
|
/** 自定义回答类型 parser(component 字段会注册进共享 contentMap) */
|
|
7
8
|
parsers?: AnswerParser[];
|
|
9
|
+
/** output_file 文件加载 / 预览配置(移动端宿主通常需注入 loadFile) */
|
|
10
|
+
outputFileConfig?: OutputFileConfig;
|
|
8
11
|
/** 历史消息是否加载中 */
|
|
9
12
|
loading?: boolean;
|
|
10
13
|
/** 空态主标题 */
|
|
@@ -30,6 +33,8 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
30
33
|
messages: Message[];
|
|
31
34
|
/** 自定义回答类型 parser(component 字段会注册进共享 contentMap) */
|
|
32
35
|
parsers?: AnswerParser[];
|
|
36
|
+
/** output_file 文件加载 / 预览配置(移动端宿主通常需注入 loadFile) */
|
|
37
|
+
outputFileConfig?: OutputFileConfig;
|
|
33
38
|
/** 历史消息是否加载中 */
|
|
34
39
|
loading?: boolean;
|
|
35
40
|
/** 空态主标题 */
|
package/dist/mobile-ui/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("wi-chat/renderers"),e=require("vue"),B=require("vant"),I=require("wi-chat/tools"),S={class:"wi-mobile-inputbox"},T=e.defineComponent({__name:"Inputbox",props:{modelValue:{default:""},placeholder:{default:"请输入问题(Enter 发送)"},disabled:{type:Boolean,default:!1},disabledSend:{type:Boolean,default:!1},enterExact:{type:Boolean,default:!0},submitText:{default:"发送"},stopText:{default:"停止"},talking:{type:Boolean,default:!1},buttonType:{default:"primary"}},emits:["update:modelValue","submit","stop"],setup(r,{emit:u}){const a=r,o=u,i=()=>{if(a.talking){o("stop");return}a.disabled||a.disabledSend||o("submit")},m=t=>{t.isComposing||t.keyCode===229||!a.enterExact||a.talking||(t.preventDefault(),i())};return(t,l)=>(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(e.unref(B.Field),{"model-value":t.modelValue,type:"textarea",rows:"2",autosize:"",placeholder:t.placeholder,disabled:t.disabled,"onUpdate:modelValue":l[0]||(l[0]=d=>o("update:modelValue",String(d??""))),onKeydown:e.withKeys(e.withModifiers(m,["exact"]),["enter"])},null,8,["model-value","placeholder","disabled","onKeydown"]),e.createVNode(e.unref(B.Button),{class:"wi-mobile-inputbox__btn",type:t.talking?"danger":t.buttonType,size:"small",disabled:t.disabled,onClick:i},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.talking?t.stopText:t.submitText),1)]),_:1},8,["type","disabled"])]))}}),h=(r,u)=>{const a=r.__vccOpts||r;for(const[o,i]of u)a[o]=i;return a},v=h(T,[["__scopeId","data-v-02f9c6a0"]]),V=r=>(e.pushScopeId("data-v-9400261b"),r=r(),e.popScopeId(),r),O={key:0,class:"wi-mobile-chat-messages__loading"},P={key:1,class:"wi-mobile-chat-messages__empty"},N=V(()=>e.createElementVNode("div",{class:"wi-mobile-chat-messages__empty-logo"},"WI",-1)),j={class:"wi-mobile-chat-messages__empty-title"},F={class:"wi-mobile-chat-messages__empty-description"},A={key:0,class:"wi-mobile-chat-messages__user"},D={class:"wi-mobile-chat-messages__user-wrapper"},q={key:0,class:"wi-mobile-chat-messages__attachments"},M={class:"wi-mobile-chat-messages__user-bubble"},$={key:1,class:"wi-mobile-chat-messages__assistant"},x=e.defineComponent({__name:"ChatMessagesView",props:{messages:{default:()=>[]},parsers:{default:()=>[]},outputFileConfig:{},loading:{type:Boolean,default:!1},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"}},emits:["loadOlder","updateThinkingExpanded"],setup(r,{expose:u,emit:a}){var _,w;const o=r,i=a;n.provideOutputFileConfig(o.outputFileConfig??{});const m=e.ref(),{showScrollToBottom:t,forceScrollToBottom:l,requestScrollToBottom:d,onReachTop:b}=I.useAutoScroll(m),E=e.computed(()=>n.createAnswerContentMap(o.parsers));let y=((_=o.messages[0])==null?void 0:_.id)??"",k=((w=o.messages[o.messages.length-1])==null?void 0:w.id)??"";return e.watch(()=>o.messages,()=>{var g,c;const p=((g=o.messages[0])==null?void 0:g.id)??"",f=((c=o.messages[o.messages.length-1])==null?void 0:c.id)??"",s=p!==y&&f===k;y=p,k=f,!s&&d()},{deep:!0}),b(()=>i("loadOlder")),u({forceScrollToBottom:l,requestScrollToBottom:d}),(p,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:m,class:"wi-mobile-chat-messages"},[p.loading?(e.openBlock(),e.createElementBlock("div",O,"历史加载中...")):p.messages.length===0?(e.openBlock(),e.createElementBlock("div",P,[N,e.createElementVNode("div",j,e.toDisplayString(p.emptyTitle),1),e.createElementVNode("div",F,e.toDisplayString(p.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.messages,s=>{var g;return e.openBlock(),e.createElementBlock(e.Fragment,{key:s.id},[s.role==="user"?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",D,[(g=s.attachments)!=null&&g.length?(e.openBlock(),e.createElementBlock("div",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.attachments,c=>(e.openBlock(),e.createElementBlock("span",{key:c.name,class:"wi-mobile-chat-messages__attachment"},e.toDisplayString(c.name),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",M,e.toDisplayString(s.content),1)])])):(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(n.DeepThinkingSteps),{steps:s.thinking.steps,expanded:s.thinking.expanded,"onUpdate:expanded":c=>i("updateThinkingExpanded",s,c)},null,8,["steps","expanded","onUpdate:expanded"]),e.createVNode(e.unref(n.AiAnswerBubble),{answer:s.answer,error:s.error,stopped:s.stopped,"content-map":E.value},null,8,["answer","error","stopped","content-map"])]))],64)}),128)),e.createVNode(e.Transition,{name:"wi-mobile-chat-messages-fade"},{default:e.withCtx(()=>[e.unref(t)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-mobile-chat-messages__bottom",onClick:f[0]||(f[0]=(...s)=>e.unref(l)&&e.unref(l)(...s))}," 回到底部 ")):e.createCommentVNode("",!0)]),_:1})],512))}}),C=h(x,[["__scopeId","data-v-9400261b"]]),K={class:"wi-mobile-chat-container"},R=e.defineComponent({__name:"ChatContainer",props:{messages:{default:()=>[]},parsers:{default:()=>[]},outputFileConfig:{},loading:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},session:{default:""},question:{default:""},placeholder:{default:"请输入问题,按 Enter 发送"},hasMore:{type:Boolean,default:!0},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"},disabled:{type:Boolean,default:!1}},emits:["update:question","submit","stop","loadOlder","updateThinkingExpanded"],setup(r,{emit:u}){const a=r,o=u,i=()=>{a.hasMore&&o("loadOlder")},m=()=>{o("submit",{text:a.question})};return(t,l)=>(e.openBlock(),e.createElementBlock("section",K,[e.renderSlot(t.$slots,"messages",{},()=>[e.createVNode(C,{messages:t.messages,parsers:t.parsers,"output-file-config":t.outputFileConfig,loading:t.loading,"empty-title":t.emptyTitle,"empty-description":t.emptyDescription,onLoadOlder:i,onUpdateThinkingExpanded:l[0]||(l[0]=(d,b)=>o("updateThinkingExpanded",d,b))},null,8,["messages","parsers","output-file-config","loading","empty-title","empty-description"])],!0),e.renderSlot(t.$slots,"above-input",{},void 0,!0),e.createVNode(v,{"model-value":t.question,placeholder:t.placeholder,disabled:t.disabled||!t.session,"disabled-send":!t.question.trim(),talking:t.talking,"onUpdate:modelValue":l[1]||(l[1]=d=>o("update:question",d)),onSubmit:m,onStop:l[2]||(l[2]=d=>o("stop"))},null,8,["model-value","placeholder","disabled","disabled-send","talking"])]))}}),U=h(R,[["__scopeId","data-v-9bd22d00"]]);Object.defineProperty(exports,"AiAnswerBubble",{enumerable:!0,get:()=>n.AiAnswerBubble});Object.defineProperty(exports,"ClarificationCard",{enumerable:!0,get:()=>n.ClarificationCard});Object.defineProperty(exports,"DeepThinkingSteps",{enumerable:!0,get:()=>n.DeepThinkingSteps});Object.defineProperty(exports,"IframePage",{enumerable:!0,get:()=>n.IframePage});Object.defineProperty(exports,"KnowledgeStreamResult",{enumerable:!0,get:()=>n.KnowledgeStreamResult});Object.defineProperty(exports,"OutputFile",{enumerable:!0,get:()=>n.OutputFile});Object.defineProperty(exports,"createAnswerContentMap",{enumerable:!0,get:()=>n.createAnswerContentMap});Object.defineProperty(exports,"injectIframeResizerChild",{enumerable:!0,get:()=>n.injectIframeResizerChild});Object.defineProperty(exports,"provideIframePageConfig",{enumerable:!0,get:()=>n.provideIframePageConfig});Object.defineProperty(exports,"provideOutputFileConfig",{enumerable:!0,get:()=>n.provideOutputFileConfig});Object.defineProperty(exports,"resolveIframePlaceholders",{enumerable:!0,get:()=>n.resolveIframePlaceholders});Object.defineProperty(exports,"useIframePage",{enumerable:!0,get:()=>n.useIframePage});exports.ChatContainer=U;exports.ChatMessagesView=C;exports.Inputbox=v;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -3,5 +3,5 @@ export { default as Inputbox } from './inputbox/Inputbox.vue';
|
|
|
3
3
|
export { default as ChatMessagesView } from './chat/ChatMessagesView.vue';
|
|
4
4
|
export { default as ChatContainer } from './chat/ChatContainer.vue';
|
|
5
5
|
export type { ChatSubmitPayload } from './chat/types';
|
|
6
|
-
export { AiAnswerBubble, createAnswerContentMap, DeepThinkingSteps, IframePage, injectIframeResizerChild, KnowledgeStreamResult, provideIframePageConfig, resolveIframePlaceholders, useIframePage, } from 'wi-chat/renderers';
|
|
7
|
-
export type { AnswerContentMap, IframePageConfig, UseIframePageReturn } from 'wi-chat/renderers';
|
|
6
|
+
export { AiAnswerBubble, ClarificationCard, createAnswerContentMap, DeepThinkingSteps, IframePage, injectIframeResizerChild, KnowledgeStreamResult, OutputFile, provideIframePageConfig, provideOutputFileConfig, resolveIframePlaceholders, useIframePage, } from 'wi-chat/renderers';
|
|
7
|
+
export type { AnswerContentMap, IframePageConfig, OutputFileConfig, OutputFilePreviewKind, OutputFilePreviewRequest, UseIframePageReturn, } from 'wi-chat/renderers';
|
package/dist/mobile-ui/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createAnswerContentMap as
|
|
2
|
-
import { AiAnswerBubble as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { Field as
|
|
5
|
-
import { useAutoScroll as
|
|
6
|
-
const
|
|
1
|
+
import { provideOutputFileConfig as D, createAnswerContentMap as M, DeepThinkingSteps as q, AiAnswerBubble as $ } from "wi-chat/renderers";
|
|
2
|
+
import { AiAnswerBubble as we, ClarificationCard as ke, DeepThinkingSteps as ve, IframePage as Ce, KnowledgeStreamResult as Te, OutputFile as Ie, createAnswerContentMap as Be, injectIframeResizerChild as Se, provideIframePageConfig as Ee, provideOutputFileConfig as Ve, resolveIframePlaceholders as Ae, useIframePage as Fe } from "wi-chat/renderers";
|
|
3
|
+
import { defineComponent as C, openBlock as i, createElementBlock as n, createVNode as f, unref as c, withKeys as x, withModifiers as P, withCtx as F, createTextVNode as U, toDisplayString as y, ref as K, computed as N, watch as z, createElementVNode as _, createCommentVNode as k, Fragment as v, renderList as V, Transition as L, pushScopeId as R, popScopeId as j, renderSlot as A } from "vue";
|
|
4
|
+
import { Field as W, Button as G } from "vant";
|
|
5
|
+
import { useAutoScroll as H } from "wi-chat/tools";
|
|
6
|
+
const J = { class: "wi-mobile-inputbox" }, Q = /* @__PURE__ */ C({
|
|
7
7
|
__name: "Inputbox",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: { default: "" },
|
|
@@ -17,8 +17,8 @@ const H = { class: "wi-mobile-inputbox" }, J = /* @__PURE__ */ T({
|
|
|
17
17
|
buttonType: { default: "primary" }
|
|
18
18
|
},
|
|
19
19
|
emits: ["update:modelValue", "submit", "stop"],
|
|
20
|
-
setup(
|
|
21
|
-
const o =
|
|
20
|
+
setup(l, { emit: u }) {
|
|
21
|
+
const o = l, t = u, d = () => {
|
|
22
22
|
if (o.talking) {
|
|
23
23
|
t("stop");
|
|
24
24
|
return;
|
|
@@ -27,8 +27,8 @@ const H = { class: "wi-mobile-inputbox" }, J = /* @__PURE__ */ T({
|
|
|
27
27
|
}, g = (e) => {
|
|
28
28
|
e.isComposing || e.keyCode === 229 || !o.enterExact || o.talking || (e.preventDefault(), d());
|
|
29
29
|
};
|
|
30
|
-
return (e, a) => (
|
|
31
|
-
f(c(
|
|
30
|
+
return (e, a) => (i(), n("div", J, [
|
|
31
|
+
f(c(W), {
|
|
32
32
|
"model-value": e.modelValue,
|
|
33
33
|
type: "textarea",
|
|
34
34
|
rows: "2",
|
|
@@ -36,116 +36,119 @@ const H = { class: "wi-mobile-inputbox" }, J = /* @__PURE__ */ T({
|
|
|
36
36
|
placeholder: e.placeholder,
|
|
37
37
|
disabled: e.disabled,
|
|
38
38
|
"onUpdate:modelValue": a[0] || (a[0] = (r) => t("update:modelValue", String(r ?? ""))),
|
|
39
|
-
onKeydown:
|
|
39
|
+
onKeydown: x(P(g, ["exact"]), ["enter"])
|
|
40
40
|
}, null, 8, ["model-value", "placeholder", "disabled", "onKeydown"]),
|
|
41
|
-
f(c(
|
|
41
|
+
f(c(G), {
|
|
42
42
|
class: "wi-mobile-inputbox__btn",
|
|
43
43
|
type: e.talking ? "danger" : e.buttonType,
|
|
44
44
|
size: "small",
|
|
45
45
|
disabled: e.disabled,
|
|
46
46
|
onClick: d
|
|
47
47
|
}, {
|
|
48
|
-
default:
|
|
48
|
+
default: F(() => [
|
|
49
49
|
U(y(e.talking ? e.stopText : e.submitText), 1)
|
|
50
50
|
]),
|
|
51
51
|
_: 1
|
|
52
52
|
}, 8, ["type", "disabled"])
|
|
53
53
|
]));
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
56
|
-
const o =
|
|
57
|
-
for (const [t, d] of
|
|
55
|
+
}), T = (l, u) => {
|
|
56
|
+
const o = l.__vccOpts || l;
|
|
57
|
+
for (const [t, d] of u)
|
|
58
58
|
o[t] = d;
|
|
59
59
|
return o;
|
|
60
|
-
},
|
|
60
|
+
}, X = /* @__PURE__ */ T(Q, [["__scopeId", "data-v-02f9c6a0"]]), Y = (l) => (R("data-v-9400261b"), l = l(), j(), l), Z = {
|
|
61
61
|
key: 0,
|
|
62
62
|
class: "wi-mobile-chat-messages__loading"
|
|
63
|
-
},
|
|
63
|
+
}, ee = {
|
|
64
64
|
key: 1,
|
|
65
65
|
class: "wi-mobile-chat-messages__empty"
|
|
66
|
-
},
|
|
66
|
+
}, te = /* @__PURE__ */ Y(() => /* @__PURE__ */ _("div", { class: "wi-mobile-chat-messages__empty-logo" }, "WI", -1)), se = { class: "wi-mobile-chat-messages__empty-title" }, oe = { class: "wi-mobile-chat-messages__empty-description" }, ae = {
|
|
67
67
|
key: 0,
|
|
68
68
|
class: "wi-mobile-chat-messages__user"
|
|
69
|
-
},
|
|
69
|
+
}, ie = { class: "wi-mobile-chat-messages__user-wrapper" }, ne = {
|
|
70
70
|
key: 0,
|
|
71
71
|
class: "wi-mobile-chat-messages__attachments"
|
|
72
|
-
}, le = { class: "wi-mobile-chat-messages__user-bubble" },
|
|
72
|
+
}, le = { class: "wi-mobile-chat-messages__user-bubble" }, de = {
|
|
73
73
|
key: 1,
|
|
74
74
|
class: "wi-mobile-chat-messages__assistant"
|
|
75
|
-
},
|
|
75
|
+
}, re = /* @__PURE__ */ C({
|
|
76
76
|
__name: "ChatMessagesView",
|
|
77
77
|
props: {
|
|
78
78
|
messages: { default: () => [] },
|
|
79
79
|
parsers: { default: () => [] },
|
|
80
|
+
outputFileConfig: {},
|
|
80
81
|
loading: { type: Boolean, default: !1 },
|
|
81
82
|
emptyTitle: { default: "输入问题,开始与 AI 对话" },
|
|
82
83
|
emptyDescription: { default: "回答内容由共享渲染层统一分发" }
|
|
83
84
|
},
|
|
84
85
|
emits: ["loadOlder", "updateThinkingExpanded"],
|
|
85
|
-
setup(
|
|
86
|
+
setup(l, { expose: u, emit: o }) {
|
|
86
87
|
var S, E;
|
|
87
|
-
const t =
|
|
88
|
-
|
|
88
|
+
const t = l, d = o;
|
|
89
|
+
D(t.outputFileConfig ?? {});
|
|
90
|
+
const g = K(), { showScrollToBottom: e, forceScrollToBottom: a, requestScrollToBottom: r, onReachTop: w } = H(g), O = N(() => M(t.parsers));
|
|
91
|
+
let I = ((S = t.messages[0]) == null ? void 0 : S.id) ?? "", B = ((E = t.messages[t.messages.length - 1]) == null ? void 0 : E.id) ?? "";
|
|
89
92
|
return z(
|
|
90
93
|
() => t.messages,
|
|
91
94
|
() => {
|
|
92
|
-
var
|
|
93
|
-
const p = ((
|
|
94
|
-
|
|
95
|
+
var h, m;
|
|
96
|
+
const p = ((h = t.messages[0]) == null ? void 0 : h.id) ?? "", b = ((m = t.messages[t.messages.length - 1]) == null ? void 0 : m.id) ?? "", s = p !== I && b === B;
|
|
97
|
+
I = p, B = b, !s && r();
|
|
95
98
|
},
|
|
96
99
|
{ deep: !0 }
|
|
97
|
-
), w(() => d("loadOlder")),
|
|
100
|
+
), w(() => d("loadOlder")), u({
|
|
98
101
|
/** 强制滚动到底部 */
|
|
99
102
|
forceScrollToBottom: a,
|
|
100
103
|
/** 自动滚动开启时请求滚动到底部 */
|
|
101
104
|
requestScrollToBottom: r
|
|
102
|
-
}), (p,
|
|
105
|
+
}), (p, b) => (i(), n("div", {
|
|
103
106
|
ref_key: "scrollEl",
|
|
104
107
|
ref: g,
|
|
105
108
|
class: "wi-mobile-chat-messages"
|
|
106
109
|
}, [
|
|
107
|
-
p.loading ? (
|
|
108
|
-
|
|
109
|
-
_("div",
|
|
110
|
-
_("div",
|
|
110
|
+
p.loading ? (i(), n("div", Z, "历史加载中...")) : p.messages.length === 0 ? (i(), n("div", ee, [
|
|
111
|
+
te,
|
|
112
|
+
_("div", se, y(p.emptyTitle), 1),
|
|
113
|
+
_("div", oe, y(p.emptyDescription), 1)
|
|
111
114
|
])) : k("", !0),
|
|
112
|
-
(
|
|
113
|
-
var
|
|
114
|
-
return
|
|
115
|
+
(i(!0), n(v, null, V(p.messages, (s) => {
|
|
116
|
+
var h;
|
|
117
|
+
return i(), n(v, {
|
|
115
118
|
key: s.id
|
|
116
119
|
}, [
|
|
117
|
-
s.role === "user" ? (
|
|
118
|
-
_("div",
|
|
119
|
-
(
|
|
120
|
-
(
|
|
121
|
-
key:
|
|
120
|
+
s.role === "user" ? (i(), n("div", ae, [
|
|
121
|
+
_("div", ie, [
|
|
122
|
+
(h = s.attachments) != null && h.length ? (i(), n("div", ne, [
|
|
123
|
+
(i(!0), n(v, null, V(s.attachments, (m) => (i(), n("span", {
|
|
124
|
+
key: m.name,
|
|
122
125
|
class: "wi-mobile-chat-messages__attachment"
|
|
123
|
-
}, y(
|
|
126
|
+
}, y(m.name), 1))), 128))
|
|
124
127
|
])) : k("", !0),
|
|
125
128
|
_("div", le, y(s.content), 1)
|
|
126
129
|
])
|
|
127
|
-
])) : (
|
|
128
|
-
f(c(
|
|
130
|
+
])) : (i(), n("div", de, [
|
|
131
|
+
f(c(q), {
|
|
129
132
|
steps: s.thinking.steps,
|
|
130
133
|
expanded: s.thinking.expanded,
|
|
131
|
-
"onUpdate:expanded": (
|
|
134
|
+
"onUpdate:expanded": (m) => d("updateThinkingExpanded", s, m)
|
|
132
135
|
}, null, 8, ["steps", "expanded", "onUpdate:expanded"]),
|
|
133
|
-
f(c(
|
|
136
|
+
f(c($), {
|
|
134
137
|
answer: s.answer,
|
|
135
138
|
error: s.error,
|
|
136
139
|
stopped: s.stopped,
|
|
137
|
-
"content-map":
|
|
140
|
+
"content-map": O.value
|
|
138
141
|
}, null, 8, ["answer", "error", "stopped", "content-map"])
|
|
139
142
|
]))
|
|
140
143
|
], 64);
|
|
141
144
|
}), 128)),
|
|
142
|
-
f(
|
|
143
|
-
default:
|
|
144
|
-
c(e) ? (
|
|
145
|
+
f(L, { name: "wi-mobile-chat-messages-fade" }, {
|
|
146
|
+
default: F(() => [
|
|
147
|
+
c(e) ? (i(), n("button", {
|
|
145
148
|
key: 0,
|
|
146
149
|
type: "button",
|
|
147
150
|
class: "wi-mobile-chat-messages__bottom",
|
|
148
|
-
onClick:
|
|
151
|
+
onClick: b[0] || (b[0] = //@ts-ignore
|
|
149
152
|
(...s) => c(a) && c(a)(...s))
|
|
150
153
|
}, " 回到底部 ")) : k("", !0)
|
|
151
154
|
]),
|
|
@@ -153,11 +156,12 @@ const H = { class: "wi-mobile-inputbox" }, J = /* @__PURE__ */ T({
|
|
|
153
156
|
})
|
|
154
157
|
], 512));
|
|
155
158
|
}
|
|
156
|
-
}),
|
|
159
|
+
}), pe = /* @__PURE__ */ T(re, [["__scopeId", "data-v-9400261b"]]), ue = { class: "wi-mobile-chat-container" }, me = /* @__PURE__ */ C({
|
|
157
160
|
__name: "ChatContainer",
|
|
158
161
|
props: {
|
|
159
162
|
messages: { default: () => [] },
|
|
160
163
|
parsers: { default: () => [] },
|
|
164
|
+
outputFileConfig: {},
|
|
161
165
|
loading: { type: Boolean, default: !1 },
|
|
162
166
|
talking: { type: Boolean, default: !1 },
|
|
163
167
|
session: { default: "" },
|
|
@@ -169,26 +173,27 @@ const H = { class: "wi-mobile-inputbox" }, J = /* @__PURE__ */ T({
|
|
|
169
173
|
disabled: { type: Boolean, default: !1 }
|
|
170
174
|
},
|
|
171
175
|
emits: ["update:question", "submit", "stop", "loadOlder", "updateThinkingExpanded"],
|
|
172
|
-
setup(
|
|
173
|
-
const o =
|
|
176
|
+
setup(l, { emit: u }) {
|
|
177
|
+
const o = l, t = u, d = () => {
|
|
174
178
|
o.hasMore && t("loadOlder");
|
|
175
179
|
}, g = () => {
|
|
176
180
|
t("submit", { text: o.question });
|
|
177
181
|
};
|
|
178
|
-
return (e, a) => (
|
|
182
|
+
return (e, a) => (i(), n("section", ue, [
|
|
179
183
|
A(e.$slots, "messages", {}, () => [
|
|
180
|
-
f(
|
|
184
|
+
f(pe, {
|
|
181
185
|
messages: e.messages,
|
|
182
186
|
parsers: e.parsers,
|
|
187
|
+
"output-file-config": e.outputFileConfig,
|
|
183
188
|
loading: e.loading,
|
|
184
189
|
"empty-title": e.emptyTitle,
|
|
185
190
|
"empty-description": e.emptyDescription,
|
|
186
191
|
onLoadOlder: d,
|
|
187
192
|
onUpdateThinkingExpanded: a[0] || (a[0] = (r, w) => t("updateThinkingExpanded", r, w))
|
|
188
|
-
}, null, 8, ["messages", "parsers", "loading", "empty-title", "empty-description"])
|
|
193
|
+
}, null, 8, ["messages", "parsers", "output-file-config", "loading", "empty-title", "empty-description"])
|
|
189
194
|
], !0),
|
|
190
195
|
A(e.$slots, "above-input", {}, void 0, !0),
|
|
191
|
-
f(
|
|
196
|
+
f(X, {
|
|
192
197
|
"model-value": e.question,
|
|
193
198
|
placeholder: e.placeholder,
|
|
194
199
|
disabled: e.disabled || !e.session,
|
|
@@ -200,19 +205,22 @@ const H = { class: "wi-mobile-inputbox" }, J = /* @__PURE__ */ T({
|
|
|
200
205
|
}, null, 8, ["model-value", "placeholder", "disabled", "disabled-send", "talking"])
|
|
201
206
|
]));
|
|
202
207
|
}
|
|
203
|
-
}), he = /* @__PURE__ */
|
|
208
|
+
}), he = /* @__PURE__ */ T(me, [["__scopeId", "data-v-9bd22d00"]]);
|
|
204
209
|
export {
|
|
205
|
-
|
|
210
|
+
we as AiAnswerBubble,
|
|
206
211
|
he as ChatContainer,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
Te as
|
|
213
|
-
Ie as
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
pe as ChatMessagesView,
|
|
213
|
+
ke as ClarificationCard,
|
|
214
|
+
ve as DeepThinkingSteps,
|
|
215
|
+
Ce as IframePage,
|
|
216
|
+
X as Inputbox,
|
|
217
|
+
Te as KnowledgeStreamResult,
|
|
218
|
+
Ie as OutputFile,
|
|
219
|
+
Be as createAnswerContentMap,
|
|
220
|
+
Se as injectIframeResizerChild,
|
|
221
|
+
Ee as provideIframePageConfig,
|
|
222
|
+
Ve as provideOutputFileConfig,
|
|
223
|
+
Ae as resolveIframePlaceholders,
|
|
224
|
+
Fe as useIframePage
|
|
217
225
|
};
|
|
218
226
|
//# sourceMappingURL=index.js.map
|