wi-chat 0.4.0 → 0.5.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/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 +102 -74
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +3 -3
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.d.ts +1 -1
- package/dist/mobile-ui/index.js +89 -82
- 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/index.cjs +2 -2
- package/dist/parser/index.d.ts +9 -0
- package/dist/parser/index.js +537 -251
- 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 +1 -0
- package/dist/renderers/index.js +641 -354
- 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 +200 -165
- package/dist/tools/markdown/index.d.ts +1 -1
- package/dist/tools/markdown/renderMarkdown.d.ts +25 -0
- package/dist/tools/useAutoScroll.d.ts +11 -3
- package/dist/web-ui/attach/AttachmentList.vue.d.ts +1 -1
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +3 -3
- 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 +1 -1
- package/dist/web-ui/index.js +403 -392
- 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, OUTPUT_FILE_ANSWER_TYPE, readOutputFilePayload, applyOutputFileChunk, normalizeOutputFileReport, outputFileParser, 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, OutputFileValue, 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,81 +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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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,
|
|
22
31
|
o as buildChatWsUrl,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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,
|
|
45
|
+
n as createRequest,
|
|
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,
|
|
60
|
+
p as isCancelError,
|
|
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,
|
|
64
88
|
u as pwdEncrypt,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
80
108
|
};
|
|
81
109
|
//# sourceMappingURL=index.js.map
|
|
@@ -89,14 +89,14 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
89
89
|
onStop?: () => any;
|
|
90
90
|
"onUpdate:question"?: (value: string) => any;
|
|
91
91
|
}, {
|
|
92
|
-
|
|
92
|
+
placeholder: string;
|
|
93
93
|
question: string;
|
|
94
|
+
parsers: AnswerParser<any>[];
|
|
94
95
|
loading: boolean;
|
|
96
|
+
disabled: boolean;
|
|
95
97
|
messages: Message[];
|
|
96
98
|
emptyTitle: string;
|
|
97
99
|
emptyDescription: string;
|
|
98
|
-
placeholder: string;
|
|
99
|
-
disabled: boolean;
|
|
100
100
|
talking: boolean;
|
|
101
101
|
session: string;
|
|
102
102
|
hasMore: boolean;
|
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"),T={class:"wi-mobile-inputbox"},V=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,d=()=>{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(),d())};return(t,l)=>(e.openBlock(),e.createElementBlock("div",T,[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]=p=>o("update:modelValue",String(p??""))),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:d},{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,d]of u)a[o]=d;return a},v=h(V,[["__scopeId","data-v-02f9c6a0"]]),O=r=>(e.pushScopeId("data-v-04e966f6"),r=r(),e.popScopeId(),r),P={key:0,class:"wi-mobile-chat-messages__loading"},N={key:1,class:"wi-mobile-chat-messages__empty"},j=O(()=>e.createElementVNode("div",{class:"wi-mobile-chat-messages__empty-logo"},"WI",-1)),F={class:"wi-mobile-chat-messages__empty-title"},A={class:"wi-mobile-chat-messages__empty-description"},D={key:0,class:"wi-mobile-chat-messages__user"},q={class:"wi-mobile-chat-messages__user-wrapper"},M={key:0,class:"wi-mobile-chat-messages__attachments"},$={class:"wi-mobile-chat-messages__user-bubble"},x={key:1,class:"wi-mobile-chat-messages__assistant"},K=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,d=a;n.provideOutputFileConfig(o.outputFileConfig??{});const m=e.ref(),{showScrollToBottom:t,forceScrollToBottom:l,requestScrollToBottom:p,resetScrollState:b,onReachTop:E}=I.useAutoScroll(m),S=e.computed(()=>n.createAnswerContentMap(o.parsers));e.watch(()=>o.messages.length===0,i=>{i&&b()});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 i=((g=o.messages[0])==null?void 0:g.id)??"",f=((c=o.messages[o.messages.length-1])==null?void 0:c.id)??"",s=i!==y&&f===k;y=i,k=f,!s&&p()},{deep:!0}),E(()=>d("loadOlder")),u({forceScrollToBottom:l,requestScrollToBottom:p}),(i,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:m,class:"wi-mobile-chat-messages"},[i.loading?(e.openBlock(),e.createElementBlock("div",P,"历史加载中...")):i.messages.length===0?(e.openBlock(),e.createElementBlock("div",N,[j,e.createElementVNode("div",F,e.toDisplayString(i.emptyTitle),1),e.createElementVNode("div",A,e.toDisplayString(i.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.messages,s=>{var g;return e.openBlock(),e.createElementBlock(e.Fragment,{key:s.id},[s.role==="user"?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",q,[(g=s.attachments)!=null&&g.length?(e.openBlock(),e.createElementBlock("div",M,[(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",$,e.toDisplayString(s.content),1)])])):(e.openBlock(),e.createElementBlock("div",x,[e.createVNode(e.unref(n.DeepThinkingSteps),{steps:s.thinking.steps,expanded:s.thinking.expanded,"onUpdate:expanded":c=>d("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":S.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(K,[["__scopeId","data-v-04e966f6"]]),R={class:"wi-mobile-chat-container"},U=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,d=()=>{a.hasMore&&o("loadOlder")},m=()=>{o("submit",{text:a.question})};return(t,l)=>(e.openBlock(),e.createElementBlock("section",R,[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:d,onUpdateThinkingExpanded:l[0]||(l[0]=(p,b)=>o("updateThinkingExpanded",p,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]=p=>o("update:question",p)),onSubmit:m,onStop:l[2]||(l[2]=p=>o("stop"))},null,8,["model-value","placeholder","disabled","disabled-send","talking"])]))}}),z=h(U,[["__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=z;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, OutputFile, provideIframePageConfig, provideOutputFileConfig, resolveIframePlaceholders, useIframePage, } from 'wi-chat/renderers';
|
|
6
|
+
export { AiAnswerBubble, ClarificationCard, createAnswerContentMap, DeepThinkingSteps, IframePage, injectIframeResizerChild, KnowledgeStreamResult, OutputFile, provideIframePageConfig, provideOutputFileConfig, resolveIframePlaceholders, useIframePage, } from 'wi-chat/renderers';
|
|
7
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 { provideOutputFileConfig as
|
|
2
|
-
import { AiAnswerBubble as
|
|
3
|
-
import { defineComponent as C, openBlock as
|
|
4
|
-
import { Field as
|
|
5
|
-
import { useAutoScroll as
|
|
6
|
-
const
|
|
1
|
+
import { provideOutputFileConfig as q, createAnswerContentMap as $, DeepThinkingSteps as x, AiAnswerBubble as P } from "wi-chat/renderers";
|
|
2
|
+
import { AiAnswerBubble as ke, ClarificationCard as ve, DeepThinkingSteps as Ce, IframePage as Te, KnowledgeStreamResult as Ie, OutputFile as Se, createAnswerContentMap as Be, injectIframeResizerChild as Ee, provideIframePageConfig as Ve, provideOutputFileConfig as Ae, resolveIframePlaceholders as Fe, useIframePage as Oe } from "wi-chat/renderers";
|
|
3
|
+
import { defineComponent as C, openBlock as i, createElementBlock as n, createVNode as f, unref as c, withKeys as U, withModifiers as K, withCtx as O, createTextVNode as N, toDisplayString as y, ref as z, computed as L, watch as V, createElementVNode as _, createCommentVNode as k, Fragment as v, renderList as A, Transition as R, pushScopeId as j, popScopeId as W, renderSlot as F } from "vue";
|
|
4
|
+
import { Field as G, Button as H } from "vant";
|
|
5
|
+
import { useAutoScroll as J } from "wi-chat/tools";
|
|
6
|
+
const Q = { class: "wi-mobile-inputbox" }, X = /* @__PURE__ */ C({
|
|
7
7
|
__name: "Inputbox",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: { default: "" },
|
|
@@ -18,35 +18,35 @@ const J = { class: "wi-mobile-inputbox" }, Q = /* @__PURE__ */ C({
|
|
|
18
18
|
},
|
|
19
19
|
emits: ["update:modelValue", "submit", "stop"],
|
|
20
20
|
setup(l, { emit: u }) {
|
|
21
|
-
const o = l, t = u,
|
|
21
|
+
const o = l, t = u, r = () => {
|
|
22
22
|
if (o.talking) {
|
|
23
23
|
t("stop");
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
o.disabled || o.disabledSend || t("submit");
|
|
27
27
|
}, g = (e) => {
|
|
28
|
-
e.isComposing || e.keyCode === 229 || !o.enterExact || o.talking || (e.preventDefault(),
|
|
28
|
+
e.isComposing || e.keyCode === 229 || !o.enterExact || o.talking || (e.preventDefault(), r());
|
|
29
29
|
};
|
|
30
|
-
return (e, a) => (
|
|
31
|
-
f(c(
|
|
30
|
+
return (e, a) => (i(), n("div", Q, [
|
|
31
|
+
f(c(G), {
|
|
32
32
|
"model-value": e.modelValue,
|
|
33
33
|
type: "textarea",
|
|
34
34
|
rows: "2",
|
|
35
35
|
autosize: "",
|
|
36
36
|
placeholder: e.placeholder,
|
|
37
37
|
disabled: e.disabled,
|
|
38
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
39
|
-
onKeydown:
|
|
38
|
+
"onUpdate:modelValue": a[0] || (a[0] = (p) => t("update:modelValue", String(p ?? ""))),
|
|
39
|
+
onKeydown: U(K(g, ["exact"]), ["enter"])
|
|
40
40
|
}, null, 8, ["model-value", "placeholder", "disabled", "onKeydown"]),
|
|
41
|
-
f(c(
|
|
41
|
+
f(c(H), {
|
|
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
|
-
onClick:
|
|
46
|
+
onClick: r
|
|
47
47
|
}, {
|
|
48
|
-
default:
|
|
49
|
-
|
|
48
|
+
default: O(() => [
|
|
49
|
+
N(y(e.talking ? e.stopText : e.submitText), 1)
|
|
50
50
|
]),
|
|
51
51
|
_: 1
|
|
52
52
|
}, 8, ["type", "disabled"])
|
|
@@ -54,25 +54,25 @@ const J = { class: "wi-mobile-inputbox" }, Q = /* @__PURE__ */ C({
|
|
|
54
54
|
}
|
|
55
55
|
}), T = (l, u) => {
|
|
56
56
|
const o = l.__vccOpts || l;
|
|
57
|
-
for (const [t,
|
|
58
|
-
o[t] =
|
|
57
|
+
for (const [t, r] of u)
|
|
58
|
+
o[t] = r;
|
|
59
59
|
return o;
|
|
60
|
-
},
|
|
60
|
+
}, Y = /* @__PURE__ */ T(X, [["__scopeId", "data-v-02f9c6a0"]]), Z = (l) => (j("data-v-04e966f6"), l = l(), W(), l), ee = {
|
|
61
61
|
key: 0,
|
|
62
62
|
class: "wi-mobile-chat-messages__loading"
|
|
63
|
-
},
|
|
63
|
+
}, te = {
|
|
64
64
|
key: 1,
|
|
65
65
|
class: "wi-mobile-chat-messages__empty"
|
|
66
|
-
},
|
|
66
|
+
}, se = /* @__PURE__ */ Z(() => /* @__PURE__ */ _("div", { class: "wi-mobile-chat-messages__empty-logo" }, "WI", -1)), oe = { class: "wi-mobile-chat-messages__empty-title" }, ae = { class: "wi-mobile-chat-messages__empty-description" }, ie = {
|
|
67
67
|
key: 0,
|
|
68
68
|
class: "wi-mobile-chat-messages__user"
|
|
69
|
-
}, ne = { class: "wi-mobile-chat-messages__user-wrapper" },
|
|
69
|
+
}, ne = { class: "wi-mobile-chat-messages__user-wrapper" }, le = {
|
|
70
70
|
key: 0,
|
|
71
71
|
class: "wi-mobile-chat-messages__attachments"
|
|
72
|
-
},
|
|
72
|
+
}, de = { class: "wi-mobile-chat-messages__user-bubble" }, re = {
|
|
73
73
|
key: 1,
|
|
74
74
|
class: "wi-mobile-chat-messages__assistant"
|
|
75
|
-
},
|
|
75
|
+
}, pe = /* @__PURE__ */ C({
|
|
76
76
|
__name: "ChatMessagesView",
|
|
77
77
|
props: {
|
|
78
78
|
messages: { default: () => [] },
|
|
@@ -84,71 +84,77 @@ const J = { class: "wi-mobile-inputbox" }, Q = /* @__PURE__ */ C({
|
|
|
84
84
|
},
|
|
85
85
|
emits: ["loadOlder", "updateThinkingExpanded"],
|
|
86
86
|
setup(l, { expose: u, emit: o }) {
|
|
87
|
-
var
|
|
88
|
-
const t = l,
|
|
89
|
-
|
|
90
|
-
const g =
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
var B, E;
|
|
88
|
+
const t = l, r = o;
|
|
89
|
+
q(t.outputFileConfig ?? {});
|
|
90
|
+
const g = z(), { showScrollToBottom: e, forceScrollToBottom: a, requestScrollToBottom: p, resetScrollState: w, onReachTop: D } = J(g), M = L(() => $(t.parsers));
|
|
91
|
+
V(
|
|
92
|
+
() => t.messages.length === 0,
|
|
93
|
+
(d) => {
|
|
94
|
+
d && w();
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
let I = ((B = t.messages[0]) == null ? void 0 : B.id) ?? "", S = ((E = t.messages[t.messages.length - 1]) == null ? void 0 : E.id) ?? "";
|
|
98
|
+
return V(
|
|
93
99
|
() => t.messages,
|
|
94
100
|
() => {
|
|
95
|
-
var
|
|
96
|
-
const
|
|
97
|
-
I =
|
|
101
|
+
var b, m;
|
|
102
|
+
const d = ((b = t.messages[0]) == null ? void 0 : b.id) ?? "", h = ((m = t.messages[t.messages.length - 1]) == null ? void 0 : m.id) ?? "", s = d !== I && h === S;
|
|
103
|
+
I = d, S = h, !s && p();
|
|
98
104
|
},
|
|
99
105
|
{ deep: !0 }
|
|
100
|
-
),
|
|
106
|
+
), D(() => r("loadOlder")), u({
|
|
101
107
|
/** 强制滚动到底部 */
|
|
102
108
|
forceScrollToBottom: a,
|
|
103
109
|
/** 自动滚动开启时请求滚动到底部 */
|
|
104
|
-
requestScrollToBottom:
|
|
105
|
-
}), (
|
|
110
|
+
requestScrollToBottom: p
|
|
111
|
+
}), (d, h) => (i(), n("div", {
|
|
106
112
|
ref_key: "scrollEl",
|
|
107
113
|
ref: g,
|
|
108
114
|
class: "wi-mobile-chat-messages"
|
|
109
115
|
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
_("div",
|
|
113
|
-
_("div",
|
|
116
|
+
d.loading ? (i(), n("div", ee, "历史加载中...")) : d.messages.length === 0 ? (i(), n("div", te, [
|
|
117
|
+
se,
|
|
118
|
+
_("div", oe, y(d.emptyTitle), 1),
|
|
119
|
+
_("div", ae, y(d.emptyDescription), 1)
|
|
114
120
|
])) : k("", !0),
|
|
115
|
-
(
|
|
116
|
-
var
|
|
117
|
-
return
|
|
121
|
+
(i(!0), n(v, null, A(d.messages, (s) => {
|
|
122
|
+
var b;
|
|
123
|
+
return i(), n(v, {
|
|
118
124
|
key: s.id
|
|
119
125
|
}, [
|
|
120
|
-
s.role === "user" ? (
|
|
126
|
+
s.role === "user" ? (i(), n("div", ie, [
|
|
121
127
|
_("div", ne, [
|
|
122
|
-
(
|
|
123
|
-
(
|
|
128
|
+
(b = s.attachments) != null && b.length ? (i(), n("div", le, [
|
|
129
|
+
(i(!0), n(v, null, A(s.attachments, (m) => (i(), n("span", {
|
|
124
130
|
key: m.name,
|
|
125
131
|
class: "wi-mobile-chat-messages__attachment"
|
|
126
132
|
}, y(m.name), 1))), 128))
|
|
127
133
|
])) : k("", !0),
|
|
128
|
-
_("div",
|
|
134
|
+
_("div", de, y(s.content), 1)
|
|
129
135
|
])
|
|
130
|
-
])) : (
|
|
131
|
-
f(c(
|
|
136
|
+
])) : (i(), n("div", re, [
|
|
137
|
+
f(c(x), {
|
|
132
138
|
steps: s.thinking.steps,
|
|
133
139
|
expanded: s.thinking.expanded,
|
|
134
|
-
"onUpdate:expanded": (m) =>
|
|
140
|
+
"onUpdate:expanded": (m) => r("updateThinkingExpanded", s, m)
|
|
135
141
|
}, null, 8, ["steps", "expanded", "onUpdate:expanded"]),
|
|
136
|
-
f(c(
|
|
142
|
+
f(c(P), {
|
|
137
143
|
answer: s.answer,
|
|
138
144
|
error: s.error,
|
|
139
145
|
stopped: s.stopped,
|
|
140
|
-
"content-map":
|
|
146
|
+
"content-map": M.value
|
|
141
147
|
}, null, 8, ["answer", "error", "stopped", "content-map"])
|
|
142
148
|
]))
|
|
143
149
|
], 64);
|
|
144
150
|
}), 128)),
|
|
145
|
-
f(
|
|
146
|
-
default:
|
|
147
|
-
c(e) ? (
|
|
151
|
+
f(R, { name: "wi-mobile-chat-messages-fade" }, {
|
|
152
|
+
default: O(() => [
|
|
153
|
+
c(e) ? (i(), n("button", {
|
|
148
154
|
key: 0,
|
|
149
155
|
type: "button",
|
|
150
156
|
class: "wi-mobile-chat-messages__bottom",
|
|
151
|
-
onClick:
|
|
157
|
+
onClick: h[0] || (h[0] = //@ts-ignore
|
|
152
158
|
(...s) => c(a) && c(a)(...s))
|
|
153
159
|
}, " 回到底部 ")) : k("", !0)
|
|
154
160
|
]),
|
|
@@ -156,7 +162,7 @@ const J = { class: "wi-mobile-inputbox" }, Q = /* @__PURE__ */ C({
|
|
|
156
162
|
})
|
|
157
163
|
], 512));
|
|
158
164
|
}
|
|
159
|
-
}),
|
|
165
|
+
}), ue = /* @__PURE__ */ T(pe, [["__scopeId", "data-v-04e966f6"]]), me = { class: "wi-mobile-chat-container" }, ce = /* @__PURE__ */ C({
|
|
160
166
|
__name: "ChatContainer",
|
|
161
167
|
props: {
|
|
162
168
|
messages: { default: () => [] },
|
|
@@ -174,52 +180,53 @@ const J = { class: "wi-mobile-inputbox" }, Q = /* @__PURE__ */ C({
|
|
|
174
180
|
},
|
|
175
181
|
emits: ["update:question", "submit", "stop", "loadOlder", "updateThinkingExpanded"],
|
|
176
182
|
setup(l, { emit: u }) {
|
|
177
|
-
const o = l, t = u,
|
|
183
|
+
const o = l, t = u, r = () => {
|
|
178
184
|
o.hasMore && t("loadOlder");
|
|
179
185
|
}, g = () => {
|
|
180
186
|
t("submit", { text: o.question });
|
|
181
187
|
};
|
|
182
|
-
return (e, a) => (
|
|
183
|
-
|
|
184
|
-
f(
|
|
188
|
+
return (e, a) => (i(), n("section", me, [
|
|
189
|
+
F(e.$slots, "messages", {}, () => [
|
|
190
|
+
f(ue, {
|
|
185
191
|
messages: e.messages,
|
|
186
192
|
parsers: e.parsers,
|
|
187
193
|
"output-file-config": e.outputFileConfig,
|
|
188
194
|
loading: e.loading,
|
|
189
195
|
"empty-title": e.emptyTitle,
|
|
190
196
|
"empty-description": e.emptyDescription,
|
|
191
|
-
onLoadOlder:
|
|
192
|
-
onUpdateThinkingExpanded: a[0] || (a[0] = (
|
|
197
|
+
onLoadOlder: r,
|
|
198
|
+
onUpdateThinkingExpanded: a[0] || (a[0] = (p, w) => t("updateThinkingExpanded", p, w))
|
|
193
199
|
}, null, 8, ["messages", "parsers", "output-file-config", "loading", "empty-title", "empty-description"])
|
|
194
200
|
], !0),
|
|
195
|
-
|
|
196
|
-
f(
|
|
201
|
+
F(e.$slots, "above-input", {}, void 0, !0),
|
|
202
|
+
f(Y, {
|
|
197
203
|
"model-value": e.question,
|
|
198
204
|
placeholder: e.placeholder,
|
|
199
205
|
disabled: e.disabled || !e.session,
|
|
200
206
|
"disabled-send": !e.question.trim(),
|
|
201
207
|
talking: e.talking,
|
|
202
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
208
|
+
"onUpdate:modelValue": a[1] || (a[1] = (p) => t("update:question", p)),
|
|
203
209
|
onSubmit: g,
|
|
204
|
-
onStop: a[2] || (a[2] = (
|
|
210
|
+
onStop: a[2] || (a[2] = (p) => t("stop"))
|
|
205
211
|
}, null, 8, ["model-value", "placeholder", "disabled", "disabled-send", "talking"])
|
|
206
212
|
]));
|
|
207
213
|
}
|
|
208
|
-
}),
|
|
214
|
+
}), ye = /* @__PURE__ */ T(ce, [["__scopeId", "data-v-9bd22d00"]]);
|
|
209
215
|
export {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
Be as
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
216
|
+
ke as AiAnswerBubble,
|
|
217
|
+
ye as ChatContainer,
|
|
218
|
+
ue as ChatMessagesView,
|
|
219
|
+
ve as ClarificationCard,
|
|
220
|
+
Ce as DeepThinkingSteps,
|
|
221
|
+
Te as IframePage,
|
|
222
|
+
Y as Inputbox,
|
|
223
|
+
Ie as KnowledgeStreamResult,
|
|
224
|
+
Se as OutputFile,
|
|
225
|
+
Be as createAnswerContentMap,
|
|
226
|
+
Ee as injectIframeResizerChild,
|
|
227
|
+
Ve as provideIframePageConfig,
|
|
228
|
+
Ae as provideOutputFileConfig,
|
|
229
|
+
Fe as resolveIframePlaceholders,
|
|
230
|
+
Oe as useIframePage
|
|
224
231
|
};
|
|
225
232
|
//# sourceMappingURL=index.js.map
|
|
@@ -65,9 +65,9 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
65
65
|
onStop?: () => any;
|
|
66
66
|
"onUpdate:modelValue"?: (value: string) => any;
|
|
67
67
|
}, {
|
|
68
|
-
modelValue: string;
|
|
69
68
|
placeholder: string;
|
|
70
69
|
disabled: boolean;
|
|
70
|
+
modelValue: string;
|
|
71
71
|
disabledSend: boolean;
|
|
72
72
|
enterExact: boolean;
|
|
73
73
|
submitText: string;
|
package/dist/mobile-ui/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wi-mobile-inputbox[data-v-02f9c6a0]{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--wi-chat-border, #e1e4e8);background:#f7f8fa}.wi-mobile-inputbox[data-v-02f9c6a0] .van-field__control{font-size:14px;line-height:1.75}.wi-mobile-inputbox__btn[data-v-02f9c6a0]{flex-shrink:0}.wi-mobile-chat-messages[data-v-
|
|
1
|
+
.wi-mobile-inputbox[data-v-02f9c6a0]{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--wi-chat-border, #e1e4e8);background:#f7f8fa}.wi-mobile-inputbox[data-v-02f9c6a0] .van-field__control{font-size:14px;line-height:1.75}.wi-mobile-inputbox__btn[data-v-02f9c6a0]{flex-shrink:0}.wi-mobile-chat-messages[data-v-04e966f6]{position:relative;flex:1;min-height:0;overflow-y:auto;padding:14px 12px;background:#f5f7fb;-webkit-overflow-scrolling:touch}.wi-mobile-chat-messages__loading[data-v-04e966f6],.wi-mobile-chat-messages__empty[data-v-04e966f6]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:8px;color:#8a93a6;font-size:13px}.wi-mobile-chat-messages__empty-logo[data-v-04e966f6]{display:flex;align-items:center;justify-content:center;width:52px;height:52px;border-radius:16px;background:linear-gradient(135deg,var(--wi-chat-primary),color-mix(in srgb,var(--wi-chat-primary) 55%,#7b61ff));color:#fff;font-size:19px;font-weight:700}.wi-mobile-chat-messages__empty-title[data-v-04e966f6]{color:#2c3653;font-size:16px;font-weight:600}.wi-mobile-chat-messages__user[data-v-04e966f6]{display:flex;justify-content:flex-end;margin:12px 0}.wi-mobile-chat-messages__user-wrapper[data-v-04e966f6]{display:flex;flex-direction:column;align-items:flex-end;max-width:86%;gap:6px}.wi-mobile-chat-messages__attachments[data-v-04e966f6]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}.wi-mobile-chat-messages__attachment[data-v-04e966f6]{max-width:100%;padding:4px 8px;border:1px solid #dfe4ee;border-radius:6px;background:#fff;color:#53617c;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wi-mobile-chat-messages__user-bubble[data-v-04e966f6]{max-width:100%;padding:9px 12px;border-radius:14px 4px 14px 14px;background:var(--wi-chat-primary);color:#fff;font-size:14px;line-height:1.65;white-space:pre-wrap;word-break:break-word}.wi-mobile-chat-messages__assistant[data-v-04e966f6]{width:fit-content;max-width:100%;margin:12px 0;padding:10px 11px;border:1px solid #e7eaf2;border-radius:4px 12px 12px;background:#fff;box-shadow:0 4px 14px #3137570d;color:#27344d;font-size:14px;line-height:1.7;word-break:break-word}.wi-mobile-chat-messages__bottom[data-v-04e966f6]{position:sticky;bottom:10px;left:100%;padding:5px 12px;border:1px solid #e1e4e8;border-radius:999px;background:#fff;box-shadow:0 4px 12px #31375724;color:#53617c;font-size:12px}.wi-mobile-chat-messages-fade-enter-active[data-v-04e966f6],.wi-mobile-chat-messages-fade-leave-active[data-v-04e966f6]{transition:opacity .2s ease}.wi-mobile-chat-messages-fade-enter-from[data-v-04e966f6],.wi-mobile-chat-messages-fade-leave-to[data-v-04e966f6]{opacity:0}.wi-mobile-chat-container[data-v-9bd22d00]{display:flex;flex-direction:column;height:100%;min-height:0;background:#f5f7fb}
|