@ibiz-template/vue3-components 0.7.41-alpha.40 → 0.7.41-alpha.42
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/ibiz-markdown-editor-pEdb_gS_.js +1 -0
- package/dist/index-BObZTN7-.js +11 -0
- package/dist/{index-BewO9StC.js → index-CD2XM6M6.js} +1 -1
- package/dist/{index-ClxO69TM.js → index-CaWTEUU1.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-Ck-JCWqK.js +1 -0
- package/dist/{xlsx-util-Cg5zMYCC.js → xlsx-util-B1eGfH7d.js} +1 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.mjs +18 -7
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
- package/es/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.mjs +12 -2
- package/es/editor/code/monaco-editor/monaco-editor.mjs +48 -33
- package/es/editor/html/wang-editor/config/index.mjs +3 -0
- package/es/editor/html/wang-editor/config/toolbar.mjs +90 -0
- package/es/editor/html/wang-editor/constants/svg.mjs +8 -0
- package/es/editor/html/wang-editor/wang-editor.css +1 -1
- package/es/editor/html/wang-editor/wang-editor.mjs +63 -40
- package/es/editor/markdown/ibiz-markdown-editor/custom-menu.mjs +274 -3
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +40 -7
- package/es/editor/markdown/ibiz-markdown-editor/render-util.mjs +33 -4
- package/es/editor/text-box/input/input.mjs +41 -32
- package/es/index.mjs +1 -1
- package/es/locale/en/index.mjs +3 -1
- package/es/locale/zh-CN/index.mjs +3 -1
- package/es/util/ai-chat-util/ai-chat-util.mjs +215 -0
- package/es/util/app-util/app-util.mjs +20 -48
- package/es/util/index.mjs +1 -1
- package/es/util/inline-ai-util/inline-ai-textarea/icon.mjs +75 -1
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.mjs +140 -43
- package/es/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.mjs +132 -48
- package/es/util/inline-ai-util/inline-ai-util.mjs +2 -1
- package/es/web-app/main.mjs +2 -0
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.cjs +12 -2
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.controller.cjs +18 -7
- package/lib/control/form/form-detail/form-item/composite-form-item-ex/composite-form-item-ex.css +1 -1
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +47 -32
- package/lib/editor/html/wang-editor/config/index.cjs +7 -0
- package/lib/editor/html/wang-editor/config/toolbar.cjs +92 -0
- package/lib/editor/html/wang-editor/constants/svg.cjs +14 -0
- package/lib/editor/html/wang-editor/wang-editor.cjs +62 -39
- package/lib/editor/html/wang-editor/wang-editor.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/custom-menu.cjs +274 -3
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +40 -7
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/render-util.cjs +33 -4
- package/lib/editor/text-box/input/input.cjs +40 -31
- package/lib/index.cjs +2 -2
- package/lib/locale/en/index.cjs +3 -1
- package/lib/locale/zh-CN/index.cjs +3 -1
- package/lib/util/ai-chat-util/ai-chat-util.cjs +217 -0
- package/lib/util/app-util/app-util.cjs +19 -47
- package/lib/util/index.cjs +2 -2
- package/lib/util/inline-ai-util/inline-ai-textarea/icon.cjs +78 -0
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.cjs +131 -47
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.css +1 -1
- package/lib/util/inline-ai-util/inline-ai-textarea/inline-ai-textarea.hook.cjs +139 -42
- package/lib/util/inline-ai-util/inline-ai-util.cjs +2 -1
- package/lib/web-app/main.cjs +2 -0
- package/package.json +5 -5
- package/dist/ibiz-markdown-editor-CxFS8frQ.js +0 -1
- package/dist/index-2eZnbrr4.js +0 -11
- package/dist/wang-editor-BPl509oX.js +0 -1
- package/es/util/ai-util/ai-util.mjs +0 -68
- package/lib/util/ai-util/ai-util.cjs +0 -71
|
@@ -17,6 +17,10 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
|
|
|
17
17
|
type: Object,
|
|
18
18
|
required: true
|
|
19
19
|
},
|
|
20
|
+
editorParams: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
20
24
|
data: {
|
|
21
25
|
type: Object,
|
|
22
26
|
required: true
|
|
@@ -55,21 +59,28 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
|
|
|
55
59
|
const containerRef = vue.ref();
|
|
56
60
|
const actionsRef = vue.ref();
|
|
57
61
|
const textareaRef = vue.ref();
|
|
58
|
-
const
|
|
62
|
+
const message = vue.ref({
|
|
63
|
+
role: "USER",
|
|
64
|
+
error: void 0,
|
|
65
|
+
think: void 0,
|
|
66
|
+
content: props.content
|
|
67
|
+
});
|
|
59
68
|
let question;
|
|
60
|
-
|
|
69
|
+
let answerContent;
|
|
61
70
|
const isLoading = vue.ref(false);
|
|
71
|
+
const isCollapse = vue.ref(false);
|
|
62
72
|
const disabled = vue.computed(() => {
|
|
63
|
-
return
|
|
73
|
+
return message.value.role === "ASSISTANT" || isLoading.value;
|
|
64
74
|
});
|
|
65
75
|
const isShow = vue.computed(() => {
|
|
66
|
-
return
|
|
76
|
+
return message.value.role === "ASSISTANT" && !isLoading.value;
|
|
67
77
|
});
|
|
68
78
|
const {
|
|
69
|
-
srfaiappendcurdata,
|
|
70
|
-
srfaiautoappend,
|
|
71
79
|
srfmode,
|
|
72
|
-
srfaiagent
|
|
80
|
+
srfaiagent,
|
|
81
|
+
autoquestion,
|
|
82
|
+
srfaiappendcurdata,
|
|
83
|
+
inlinecompletionmode
|
|
73
84
|
} = inlineAiTextarea_hook.computedInLineAIParams(props);
|
|
74
85
|
const {
|
|
75
86
|
theme,
|
|
@@ -77,34 +88,75 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
|
|
|
77
88
|
actionStyle,
|
|
78
89
|
containerStyle,
|
|
79
90
|
contentStyle
|
|
80
|
-
} = inlineAiTextarea_hook.useBase(props,
|
|
91
|
+
} = inlineAiTextarea_hook.useBase(props, {
|
|
92
|
+
containerRef,
|
|
93
|
+
actionsRef,
|
|
94
|
+
textareaRef
|
|
95
|
+
}, message);
|
|
81
96
|
const {
|
|
82
|
-
|
|
97
|
+
syncAskAI,
|
|
98
|
+
asyncAskAI,
|
|
99
|
+
parseContent,
|
|
100
|
+
loadAiHistory,
|
|
83
101
|
abortController
|
|
84
102
|
} = inlineAiTextarea_hook.useAI(props, {
|
|
85
|
-
srfaiappendcurdata,
|
|
86
103
|
srfmode,
|
|
87
|
-
srfaiagent
|
|
104
|
+
srfaiagent,
|
|
105
|
+
srfaiappendcurdata
|
|
88
106
|
});
|
|
107
|
+
inlineAiTextarea_hook.useInLineAIContainerClick(props, message, isLoading);
|
|
89
108
|
const stopQuestionAndClose = () => {
|
|
90
109
|
var _a;
|
|
91
110
|
(_a = abortController.value) == null ? void 0 : _a.abort();
|
|
92
111
|
props.unMountAIChat();
|
|
93
112
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
113
|
+
const handleAnswer = (answer) => {
|
|
114
|
+
switch (answer.state) {
|
|
115
|
+
case 20:
|
|
116
|
+
answerContent += answer.content;
|
|
117
|
+
Object.assign(message.value, parseContent(answerContent));
|
|
118
|
+
break;
|
|
119
|
+
case 30:
|
|
120
|
+
answerContent = answer.content;
|
|
121
|
+
Object.assign(message.value, parseContent(answerContent));
|
|
122
|
+
break;
|
|
123
|
+
case 40:
|
|
124
|
+
isCollapse.value = true;
|
|
125
|
+
Object.assign(message.value, {
|
|
126
|
+
error: answer.content,
|
|
127
|
+
think: void 0,
|
|
128
|
+
content: void 0
|
|
129
|
+
});
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
message.value.role = "ASSISTANT";
|
|
99
135
|
};
|
|
100
136
|
const sendQuestion = async (content) => {
|
|
137
|
+
var _a;
|
|
138
|
+
if (!content || isLoading.value)
|
|
139
|
+
return;
|
|
140
|
+
isLoading.value = true;
|
|
101
141
|
try {
|
|
102
|
-
|
|
103
|
-
|
|
142
|
+
(_a = textareaRef.value) == null ? void 0 : _a.blur();
|
|
143
|
+
props.restoreSelection();
|
|
104
144
|
question = content;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
145
|
+
answerContent = void 0;
|
|
146
|
+
Object.assign(message.value, {
|
|
147
|
+
error: void 0,
|
|
148
|
+
think: void 0,
|
|
149
|
+
content: void 0
|
|
150
|
+
});
|
|
151
|
+
isCollapse.value = false;
|
|
152
|
+
if (inlinecompletionmode === "async") {
|
|
153
|
+
await asyncAskAI(question, handleAnswer, () => {
|
|
154
|
+
isLoading.value = false;
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
const answer = await syncAskAI(question);
|
|
158
|
+
handleAnswer(answer);
|
|
159
|
+
}
|
|
108
160
|
} catch (error) {
|
|
109
161
|
ibiz.log.error(error);
|
|
110
162
|
} finally {
|
|
@@ -114,13 +166,15 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
|
|
|
114
166
|
const onKeydown = (e) => {
|
|
115
167
|
if (e.code === "Enter" && !e.isComposing) {
|
|
116
168
|
e.stopPropagation();
|
|
117
|
-
if (e.shiftKey === false)
|
|
118
|
-
sendQuestion(
|
|
119
|
-
}
|
|
169
|
+
if (e.shiftKey === false)
|
|
170
|
+
sendQuestion(message.value.content);
|
|
120
171
|
}
|
|
121
172
|
};
|
|
173
|
+
const onCollapseChange = () => {
|
|
174
|
+
isCollapse.value = !isCollapse.value;
|
|
175
|
+
};
|
|
122
176
|
const handleAction = (_e, actionName) => {
|
|
123
|
-
const content =
|
|
177
|
+
const content = message.value.content;
|
|
124
178
|
switch (actionName) {
|
|
125
179
|
case "regenerate":
|
|
126
180
|
sendQuestion(question);
|
|
@@ -144,32 +198,69 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
|
|
|
144
198
|
break;
|
|
145
199
|
}
|
|
146
200
|
};
|
|
147
|
-
vue.onMounted(() => {
|
|
201
|
+
vue.onMounted(async () => {
|
|
148
202
|
var _a;
|
|
149
|
-
|
|
150
|
-
|
|
203
|
+
await loadAiHistory();
|
|
204
|
+
if (autoquestion) {
|
|
205
|
+
await sendQuestion(message.value.content);
|
|
151
206
|
} else {
|
|
152
207
|
(_a = textareaRef.value) == null ? void 0 : _a.focus();
|
|
153
208
|
}
|
|
154
209
|
});
|
|
210
|
+
const renderLoading = () => {
|
|
211
|
+
const value = message.value.error || message.value.content || message.value.think;
|
|
212
|
+
if (!isLoading.value || value)
|
|
213
|
+
return;
|
|
214
|
+
return vue.createVNode("div", {
|
|
215
|
+
"class": ns.e("loading")
|
|
216
|
+
}, [vue.createVNode("div", {
|
|
217
|
+
"class": ns.em("loading", "dot")
|
|
218
|
+
}, null), vue.createVNode("div", {
|
|
219
|
+
"class": ns.em("loading", "dot")
|
|
220
|
+
}, null), vue.createVNode("div", {
|
|
221
|
+
"class": ns.em("loading", "dot")
|
|
222
|
+
}, null)]);
|
|
223
|
+
};
|
|
224
|
+
const renderContent = () => {
|
|
225
|
+
if (message.value.error)
|
|
226
|
+
return vue.createVNode("div", {
|
|
227
|
+
"class": ns.e("error")
|
|
228
|
+
}, [message.value.error]);
|
|
229
|
+
if (message.value.think)
|
|
230
|
+
return vue.createVNode("div", {
|
|
231
|
+
"class": ns.e("think")
|
|
232
|
+
}, [vue.createVNode("div", {
|
|
233
|
+
"class": ns.em("think", "header"),
|
|
234
|
+
"onClick": onCollapseChange
|
|
235
|
+
}, [vue.createVNode("div", {
|
|
236
|
+
"class": [ns.em("think", "state-icon"), ns.is("loading", isLoading.value)]
|
|
237
|
+
}, [isLoading.value ? icon.LoadingIcon : icon.ThinkSuccessIcon]), vue.createVNode("div", {
|
|
238
|
+
"class": ns.em("think", "title")
|
|
239
|
+
}, [isLoading.value ? ibiz.i18n.t("util.inlineAiUtil.thinking") : ibiz.i18n.t("util.inlineAiUtil.thinked")]), vue.createVNode("div", {
|
|
240
|
+
"class": ns.em("think", "collapse-icon")
|
|
241
|
+
}, [isCollapse.value ? icon.DownIcon : icon.UpIcon])]), !isCollapse.value && vue.createVNode("div", {
|
|
242
|
+
"class": ns.em("think", "content")
|
|
243
|
+
}, [message.value.think])]);
|
|
244
|
+
};
|
|
155
245
|
return {
|
|
156
246
|
ns,
|
|
157
247
|
theme,
|
|
158
248
|
isShow,
|
|
159
249
|
actions,
|
|
250
|
+
message,
|
|
160
251
|
disabled,
|
|
161
252
|
isLoading,
|
|
162
253
|
actionsRef,
|
|
163
254
|
textareaRef,
|
|
164
255
|
actionStyle,
|
|
165
|
-
contentType,
|
|
166
256
|
containerRef,
|
|
167
257
|
contentStyle,
|
|
168
258
|
containerStyle,
|
|
169
|
-
textareaContent,
|
|
170
259
|
onKeydown,
|
|
171
260
|
sendQuestion,
|
|
172
261
|
handleAction,
|
|
262
|
+
renderLoading,
|
|
263
|
+
renderContent,
|
|
173
264
|
stopQuestionAndClose
|
|
174
265
|
};
|
|
175
266
|
},
|
|
@@ -187,33 +278,26 @@ const InlineAITextArea = /* @__PURE__ */ vue.defineComponent({
|
|
|
187
278
|
"class": this.ns.em("content", "ai-icon")
|
|
188
279
|
}, [icon.AIIcon])]), vue.createVNode("div", {
|
|
189
280
|
"class": this.ns.em("content", "textarea")
|
|
190
|
-
}, [this.
|
|
191
|
-
"class": this.ns.e("loading")
|
|
192
|
-
}, [vue.createVNode("div", {
|
|
193
|
-
"class": this.ns.em("loading", "dot")
|
|
194
|
-
}, null), vue.createVNode("div", {
|
|
195
|
-
"class": this.ns.em("loading", "dot")
|
|
196
|
-
}, null), vue.createVNode("div", {
|
|
197
|
-
"class": this.ns.em("loading", "dot")
|
|
198
|
-
}, null)]), vue.withDirectives(vue.createVNode("textarea", {
|
|
281
|
+
}, [this.renderLoading(), this.renderContent(), vue.withDirectives(vue.createVNode("textarea", {
|
|
199
282
|
"ref": "textareaRef",
|
|
200
283
|
"disabled": this.disabled,
|
|
201
284
|
"onKeydown": this.onKeydown,
|
|
202
|
-
"onUpdate:modelValue": ($event) => this.
|
|
203
|
-
|
|
285
|
+
"onUpdate:modelValue": ($event) => this.message.content = $event,
|
|
286
|
+
"class": this.ns.is("hidden", !!this.message.error)
|
|
287
|
+
}, null), [[vue.vModelText, this.message.content]])]), vue.createVNode("div", {
|
|
204
288
|
"class": this.ns.em("content", "suffix")
|
|
205
289
|
}, [this.isLoading && vue.createVNode("div", {
|
|
206
290
|
"class": this.ns.em("content", "stop-icon"),
|
|
207
291
|
"onClick": () => this.stopQuestionAndClose()
|
|
208
292
|
}, [icon.StopIcon, vue.createVNode("span", null, [ibiz.i18n.t("util.inlineAiUtil.stopEdit")])]), !this.disabled && vue.createVNode("div", {
|
|
209
293
|
"class": this.ns.em("content", "sand-icon"),
|
|
210
|
-
"onClick": () => this.sendQuestion(this.
|
|
211
|
-
}, [icon.SendIcon])])]), vue.createVNode("div", {
|
|
212
|
-
"class":
|
|
213
|
-
}, [ibiz.i18n.t("util.inlineAiUtil.info")]), vue.createVNode("div", {
|
|
294
|
+
"onClick": () => this.sendQuestion(this.message.content)
|
|
295
|
+
}, [icon.SendIcon])])]), this.isShow && vue.createVNode("div", {
|
|
296
|
+
"class": this.ns.e("footer")
|
|
297
|
+
}, [ibiz.i18n.t("util.inlineAiUtil.info")]), this.isShow && vue.createVNode("div", {
|
|
214
298
|
"ref": "actionsRef",
|
|
215
|
-
"
|
|
216
|
-
"
|
|
299
|
+
"style": this.actionStyle,
|
|
300
|
+
"class": this.ns.e("actions")
|
|
217
301
|
}, [this.actions.map((action) => {
|
|
218
302
|
if (action.itemType === "divider")
|
|
219
303
|
return vue.createVNode("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-inline-ai-container-context-menu{--ibiz-inline-ai-context-menu-color-bg:var(--ibiz-color-bg-2);--ibiz-inline-ai-context-menu-color-text:var(--ibiz-color-text-0);--ibiz-inline-ai-context-menu-color-bg-active:var(--ibiz-color-fill-0);--mx-menu-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-backgroud:var(--ibiz-inline-ai-context-menu-color-bg);--mx-menu-hover-backgroud:var(--ibiz-inline-ai-context-menu-color-bg-active);--mx-menu-hover-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-open-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-open-backgroud:var(--ibiz-inline-ai-context-menu-color-bg-active);--mx-menu-open-hover-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-open-hover-backgroud:var(--ibiz-inline-ai-context-menu-color-bg-active);--mx-menu-active-backgroud:var(--ibiz-inline-ai-context-menu-color-bg-active);--mx-menu-active-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-backgroud-radius:0}.ibiz-inline-ai-container-context-menu .scroll-content{pointer-events:unset}.ibiz-inline-ai-container-context-menu .mx-context-menu-item{cursor:pointer}.ibiz-inline-ai-textarea-container{--ibiz-inline-ai-textarea-container-color-bg-0:rgb(255, 255, 255);--ibiz-inline-ai-textarea-container-color-bg-1:rgb(249, 249, 249);--ibiz-inline-ai-textarea-container-color-border:rgba(29, 31, 35, 0.1);--ibiz-inline-ai-textarea-container-color-text-0:rgb(29, 31, 35);--ibiz-inline-ai-textarea-container-color-text-1:rgba(
|
|
1
|
+
.ibiz-inline-ai-container-context-menu{--ibiz-inline-ai-context-menu-color-bg:var(--ibiz-color-bg-2);--ibiz-inline-ai-context-menu-color-text:var(--ibiz-color-text-0);--ibiz-inline-ai-context-menu-color-bg-active:var(--ibiz-color-fill-0);--mx-menu-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-backgroud:var(--ibiz-inline-ai-context-menu-color-bg);--mx-menu-hover-backgroud:var(--ibiz-inline-ai-context-menu-color-bg-active);--mx-menu-hover-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-open-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-open-backgroud:var(--ibiz-inline-ai-context-menu-color-bg-active);--mx-menu-open-hover-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-open-hover-backgroud:var(--ibiz-inline-ai-context-menu-color-bg-active);--mx-menu-active-backgroud:var(--ibiz-inline-ai-context-menu-color-bg-active);--mx-menu-active-text:var(--ibiz-inline-ai-context-menu-color-text);--mx-menu-backgroud-radius:0}.ibiz-inline-ai-container-context-menu .scroll-content{pointer-events:unset}.ibiz-inline-ai-container-context-menu .mx-context-menu-item{cursor:pointer}.ibiz-inline-ai-textarea-container{--ibiz-inline-ai-textarea-container-color-bg-0:rgb(255, 255, 255);--ibiz-inline-ai-textarea-container-color-bg-1:rgb(249, 249, 249);--ibiz-inline-ai-textarea-container-color-border:rgba(29, 31, 35, 0.1);--ibiz-inline-ai-textarea-container-color-text-0:rgb(29, 31, 35);--ibiz-inline-ai-textarea-container-color-text-1:rgba(0, 0, 0, 0.45);--ibiz-inline-ai-textarea-container-color-text-2:rgb(85, 125, 165);--ibiz-inline-ai-textarea-container-color-text-hove-1:rgb(105, 148, 190);--ibiz-inline-ai-textarea-container-color-bg-hover-1:rgb(217, 236, 255);--ibiz-inline-ai-textarea-container-color-bg-hover-2:rgba(46, 50, 55, 0.05);--ibiz-inline-ai-textarea-container-color-loading:#65b3fc}.ibiz-inline-ai-textarea-container--dark{--ibiz-inline-ai-textarea-container-color-bg-0:rgb(28, 28, 28);--ibiz-inline-ai-textarea-container-color-bg-1:rgb(53, 54, 60);--ibiz-inline-ai-textarea-container-color-border:rgba(255, 255, 255, 0.08);--ibiz-inline-ai-textarea-container-color-text-0:rgb(255, 255, 255);--ibiz-inline-ai-textarea-container-color-text-1:rgba(249, 249, 249, 0.35);--ibiz-inline-ai-textarea-container-color-text-2:rgb(70, 107, 144);--ibiz-inline-ai-textarea-container-color-text-hove-1:rgb(105, 148, 190);--ibiz-inline-ai-textarea-container-color-bg-hover-1:rgba(85, 125, 165, 0.2);--ibiz-inline-ai-textarea-container-color-bg-hover-2:rgb(67, 68, 74);--ibiz-inline-ai-textarea-container-color-loading:rgba(204, 204, 204, 0.6)}.ibiz-inline-ai-textarea-container{position:absolute;color:var(--ibiz-inline-ai-textarea-container-color-text-0);-webkit-user-select:none;-moz-user-select:none;user-select:none}.ibiz-inline-ai-textarea-container .ibiz-inline-ai-textarea-container__content{border:1px solid var(--ibiz-inline-ai-textarea-container-color-border);border-radius:var(--ibiz-border-radius-small);box-shadow:0 0 16px var(--ibiz-color-shadow)}.ibiz-inline-ai-textarea-container.is-show-ai{border:1px solid var(--ibiz-inline-ai-textarea-container-color-border);border-radius:var(--ibiz-border-radius-small);box-shadow:0 0 16px var(--ibiz-color-shadow)}.ibiz-inline-ai-textarea-container.is-show-ai .ibiz-inline-ai-textarea-container__content{border:none;border-radius:var(--ibiz-border-radius-small) var(--ibiz-border-radius-small) 0 0;box-shadow:none}.ibiz-inline-ai-textarea-container.is-show-ai .ibiz-inline-ai-textarea-container__footer{border-radius:0 0 var(--ibiz-border-radius-small) var(--ibiz-border-radius-small)}.ibiz-inline-ai-textarea-container__content{position:relative;display:flex;gap:var(--ibiz-spacing-tight);padding:var(--ibiz-spacing-base-tight);background-color:var(--ibiz-inline-ai-textarea-container-color-bg-0)}.ibiz-inline-ai-textarea-container__content--prefix{flex-shrink:0;color:var(--ibiz-inline-ai-textarea-container-color-text-1)}.ibiz-inline-ai-textarea-container__content--textarea{position:relative;display:flex;flex-direction:column;flex-grow:1;gap:var(--ibiz-spacing-tight);overflow-y:auto}.ibiz-inline-ai-textarea-container__content--textarea textarea{flex-shrink:0;padding:0;overflow:hidden;color:var(--ibiz-inline-ai-textarea-container-color-text-0);resize:none;background-color:var(--ibiz-inline-ai-textarea-container-color-bg-0);border:none;outline:0;transition:height .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}.ibiz-inline-ai-textarea-container__content--textarea textarea:disabled{background-color:var(--ibiz-inline-ai-textarea-container-color-bg-0)}.ibiz-inline-ai-textarea-container__content--textarea textarea.is-hidden{display:none}.ibiz-inline-ai-textarea-container__content--suffix{display:flex;flex-direction:column-reverse;flex-shrink:0}.ibiz-inline-ai-textarea-container__content--sand-icon{display:flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--ibiz-inline-ai-textarea-container-color-text-2);cursor:pointer;border-radius:var(--ibiz-spacing-extra-tight)}.ibiz-inline-ai-textarea-container__content--sand-icon:hover{background-color:var(--ibiz-inline-ai-textarea-container-color-bg-hover-1)}.ibiz-inline-ai-textarea-container__content--stop-icon{display:flex;gap:var(--ibiz-spacing-extra-tight);align-items:center;font-size:var(--ibiz-font-size-small);color:var(--ibiz-inline-ai-textarea-container-color-text-1);cursor:pointer}.ibiz-inline-ai-textarea-container__content--stop-icon:hover{color:var(--ibiz-inline-ai-textarea-container-color-text-hove-1)}.ibiz-inline-ai-textarea-container__footer{padding:var(--ibiz-spacing-base-tight) var(--ibiz-spacing-base);font-size:var(--ibiz-font-size-small);color:var(--ibiz-inline-ai-textarea-container-color-text-1);background-color:var(--ibiz-inline-ai-textarea-container-color-bg-1);border-top:1px solid var(--ibiz-inline-ai-textarea-container-color-border)}.ibiz-inline-ai-textarea-container__actions{position:absolute;width:240px;padding:var(--ibiz-spacing-base-tight) 0;font-size:var(--ibiz-font-size-regular);background-color:var(--ibiz-inline-ai-textarea-container-color-bg-0);border:1px solid var(--ibiz-inline-ai-textarea-container-color-border);border-radius:var(--ibiz-border-radius-small);box-shadow:0 0 16px var(--ibiz-color-shadow)}.ibiz-inline-ai-textarea-container__actions--action{display:flex;gap:var(--ibiz-spacing-tight);align-items:center;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base-loose);cursor:pointer}.ibiz-inline-ai-textarea-container__actions--action:hover{background-color:var(--ibiz-inline-ai-textarea-container-color-bg-hover-2)}.ibiz-inline-ai-textarea-container__actions--action.is-danger:hover{color:var(--ibiz-color-danger)}.ibiz-inline-ai-textarea-container__actions--divider{margin:var(--ibiz-spacing-extra-tight) var(--ibiz-spacing-base-loose);border-top:1px solid var(--ibiz-inline-ai-textarea-container-color-border)}.ibiz-inline-ai-textarea-container__error{flex-grow:1;color:var(--ibiz-color-danger)}.ibiz-inline-ai-textarea-container__think{flex-shrink:0;width:100%;height:auto;font-size:var(--ibiz-font-size-small);color:var(--ibiz-inline-ai-textarea-container-color-text-1)}.ibiz-inline-ai-textarea-container__think--header{display:flex;gap:var(--ibiz-spacing-extra-tight);align-items:center;margin-bottom:var(--ibiz-spacing-tight);cursor:pointer}.ibiz-inline-ai-textarea-container__think--header:hover{color:var(--ibiz-inline-ai-textarea-container-color-text-hove-1)}.ibiz-inline-ai-textarea-container__think--state-icon{display:flex;align-items:center;color:var(--ibiz-color-success)}.ibiz-inline-ai-textarea-container__think--state-icon.is-loading{color:var(--ibiz-inline-ai-textarea-container-color-loading)}.ibiz-inline-ai-textarea-container__think--collapse-icon{display:flex;align-items:center}.ibiz-inline-ai-textarea-container__think--content{position:relative;padding-left:var(--ibiz-spacing-tight);word-wrap:break-word;white-space:pre-wrap;transition:height .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}.ibiz-inline-ai-textarea-container__think--content::before{position:absolute;top:0;bottom:0;left:0;width:2px;content:"";background-color:var(--ibiz-inline-ai-textarea-container-color-border)}.ibiz-inline-ai-textarea-container__loading{position:absolute;top:0;left:0;display:flex;gap:8px;align-items:center;width:100%;height:100%;overflow:hidden}@keyframes bounce{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.ibiz-inline-ai-textarea-container__loading--dot{width:12px;height:12px;background:var(--ibiz-inline-ai-textarea-container-color-loading);border-radius:50%;animation:bounce 1.5s infinite ease-in-out}.ibiz-inline-ai-textarea-container__loading--dot:nth-child(2){animation-delay:.2s}.ibiz-inline-ai-textarea-container__loading--dot:nth-child(3){animation-delay:.4s}
|
|
@@ -2,21 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
var qs = require('qs');
|
|
4
4
|
var qxUtil = require('qx-util');
|
|
5
|
+
var vue3Util = require('@ibiz-template/vue3-util');
|
|
5
6
|
var vue = require('vue');
|
|
6
7
|
var runtime = require('@ibiz-template/runtime');
|
|
7
8
|
var icon = require('./icon.cjs');
|
|
8
9
|
|
|
9
10
|
"use strict";
|
|
10
11
|
const computedInLineAIParams = (props) => {
|
|
11
|
-
var _a;
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
13
|
+
const { params, context, editorParams } = props;
|
|
14
|
+
const getBooleanValue = (value) => {
|
|
15
|
+
if (value === "false")
|
|
16
|
+
return false;
|
|
17
|
+
if (value === "true")
|
|
18
|
+
return true;
|
|
19
|
+
return null;
|
|
20
|
+
};
|
|
12
21
|
return {
|
|
13
|
-
srfaiappendcurdata: (_a =
|
|
14
|
-
|
|
15
|
-
srfmode:
|
|
16
|
-
srfaiagent:
|
|
22
|
+
srfaiappendcurdata: (_c = (_b = (_a = getBooleanValue(context.srfaiappendcurdata)) != null ? _a : getBooleanValue(params.srfaiappendcurdata)) != null ? _b : getBooleanValue(editorParams.srfaiappendcurdata)) != null ? _c : true,
|
|
23
|
+
autoquestion: (_e = (_d = getBooleanValue(params.autoquestion)) != null ? _d : getBooleanValue(editorParams.autoquestion)) != null ? _e : false,
|
|
24
|
+
srfmode: params.srfmode,
|
|
25
|
+
srfaiagent: params.srfaiagent,
|
|
26
|
+
inlinecompletionmode: (_g = (_f = params.inlinecompletionmode) != null ? _f : editorParams.inlinecompletionmode) != null ? _g : "async"
|
|
17
27
|
};
|
|
18
28
|
};
|
|
19
|
-
const useInLineAIContainerClick = (props,
|
|
29
|
+
const useInLineAIContainerClick = (props, message, isLoading) => {
|
|
20
30
|
const handclick = async (evt) => {
|
|
21
31
|
const target = evt.target;
|
|
22
32
|
if (!target.closest(".ibiz-inline-ai-textarea-container") && !target.closest(".ibiz-inline-ai-alert")) {
|
|
@@ -24,7 +34,7 @@ const useInLineAIContainerClick = (props, content, isLoading) => {
|
|
|
24
34
|
evt.stopPropagation();
|
|
25
35
|
return;
|
|
26
36
|
}
|
|
27
|
-
const isChange = props.content !==
|
|
37
|
+
const isChange = props.content !== message.value.content;
|
|
28
38
|
let isClose = true;
|
|
29
39
|
if (isChange) {
|
|
30
40
|
isClose = await ibiz.confirm.warning({
|
|
@@ -52,21 +62,24 @@ const useAI = (props, opts) => {
|
|
|
52
62
|
const params = { srfactag: deACMode.codeName };
|
|
53
63
|
const app = ibiz.hub.getApp(deACMode.appId);
|
|
54
64
|
let history = [];
|
|
55
|
-
|
|
65
|
+
let appDataEntity;
|
|
66
|
+
const calcAIPath = (isHistories = false, isAsync = false) => {
|
|
67
|
+
if (!appDataEntity)
|
|
68
|
+
return "";
|
|
56
69
|
const srfkey = context[appDataEntity.codeName.toLowerCase()];
|
|
57
|
-
const curPath = "/".concat(appDataEntity.deapicodeName2, "/chatcompletion").concat(isHistories ? "/histories" : "").concat(srfkey ? "/".concat(srfkey) : "");
|
|
70
|
+
const curPath = "/".concat(appDataEntity.deapicodeName2, "/").concat(isAsync ? "sse" : "", "chatcompletion").concat(isHistories ? "/histories" : "").concat(srfkey ? "/".concat(srfkey) : "");
|
|
58
71
|
const resPath = runtime.calcResPath(context, appDataEntity);
|
|
59
72
|
return resPath ? "/".concat(resPath).concat(curPath) : "".concat(curPath);
|
|
60
73
|
};
|
|
61
74
|
const loadAiHistory = async () => {
|
|
62
|
-
|
|
75
|
+
appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
63
76
|
deACMode.appDataEntityId,
|
|
64
77
|
deACMode.appId
|
|
65
78
|
);
|
|
66
|
-
const path = calcAIPath(
|
|
79
|
+
const path = calcAIPath(true);
|
|
67
80
|
const body = {};
|
|
68
81
|
if (srfaiappendcurdata)
|
|
69
|
-
Object.assign(body,
|
|
82
|
+
Object.assign(body, data);
|
|
70
83
|
if (srfmode)
|
|
71
84
|
Object.assign(body, { mode: srfmode });
|
|
72
85
|
if (srfaiagent)
|
|
@@ -99,14 +112,13 @@ const useAI = (props, opts) => {
|
|
|
99
112
|
}
|
|
100
113
|
return url;
|
|
101
114
|
};
|
|
102
|
-
const
|
|
103
|
-
var _a, _b;
|
|
115
|
+
const prepareData = (question, isAsync = false) => {
|
|
104
116
|
const body = {
|
|
105
117
|
messages: [
|
|
106
118
|
...history,
|
|
107
119
|
{
|
|
108
120
|
role: "USER",
|
|
109
|
-
content
|
|
121
|
+
content: question
|
|
110
122
|
}
|
|
111
123
|
]
|
|
112
124
|
};
|
|
@@ -114,32 +126,96 @@ const useAI = (props, opts) => {
|
|
|
114
126
|
Object.assign(body, { mode: srfmode });
|
|
115
127
|
if (srfaiagent)
|
|
116
128
|
Object.assign(body, { srfaiagent });
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
let url = calcAIPath(false, isAsync);
|
|
130
|
+
if (!isAsync)
|
|
131
|
+
url = attachUrlParam(url);
|
|
132
|
+
return { body, url };
|
|
133
|
+
};
|
|
134
|
+
const parseContent = (text) => {
|
|
135
|
+
let think;
|
|
136
|
+
let content;
|
|
137
|
+
if (!text)
|
|
138
|
+
return { think, content };
|
|
139
|
+
const openThinkIndex = text.indexOf("<think>");
|
|
140
|
+
const closeThinkIndex = text.indexOf("</think>");
|
|
141
|
+
if (openThinkIndex !== -1) {
|
|
142
|
+
think = closeThinkIndex === -1 ? text.slice(openThinkIndex + 7) : text.slice(openThinkIndex + 7, closeThinkIndex);
|
|
143
|
+
content = closeThinkIndex === -1 ? void 0 : text.slice(closeThinkIndex + 8);
|
|
144
|
+
} else {
|
|
145
|
+
content = text;
|
|
146
|
+
}
|
|
147
|
+
return { think, content };
|
|
148
|
+
};
|
|
149
|
+
const asyncAskAI = (question, callBack, errorBack) => {
|
|
150
|
+
return new Promise((resolve) => {
|
|
151
|
+
abortController.value = new AbortController();
|
|
152
|
+
const { body, url } = prepareData(question, true);
|
|
153
|
+
app.net.sse(url, params, {
|
|
154
|
+
headers: {
|
|
155
|
+
"Content-Type": "application/json"
|
|
156
|
+
},
|
|
157
|
+
body: JSON.stringify(body),
|
|
158
|
+
onmessage: (e) => {
|
|
159
|
+
var _a;
|
|
160
|
+
try {
|
|
161
|
+
if (e.data) {
|
|
162
|
+
const msg = JSON.parse(e.data);
|
|
163
|
+
let content = msg.actionresult;
|
|
164
|
+
if (msg.actionstate === 30 && content)
|
|
165
|
+
content = (_a = JSON.parse(content).choices) == null ? void 0 : _a[0].content;
|
|
166
|
+
callBack({ state: msg.actionstate, content });
|
|
167
|
+
}
|
|
168
|
+
} catch (error) {
|
|
169
|
+
ibiz.log.error(error);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
onclose: () => resolve(),
|
|
173
|
+
onerror: (error) => {
|
|
174
|
+
callBack({ state: 40, content: error.message });
|
|
175
|
+
errorBack();
|
|
176
|
+
throw error;
|
|
177
|
+
},
|
|
178
|
+
signal: abortController.value.signal
|
|
179
|
+
});
|
|
127
180
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
181
|
+
};
|
|
182
|
+
const syncAskAI = async (question) => {
|
|
183
|
+
var _a, _b;
|
|
184
|
+
abortController.value = new AbortController();
|
|
185
|
+
const { body, url } = prepareData(question);
|
|
186
|
+
const answer = {
|
|
187
|
+
state: 10,
|
|
188
|
+
content: ""
|
|
189
|
+
};
|
|
190
|
+
try {
|
|
191
|
+
const response = await app.net.request(url, {
|
|
192
|
+
method: "post",
|
|
193
|
+
data: body,
|
|
194
|
+
signal: abortController.value.signal
|
|
195
|
+
});
|
|
196
|
+
if (response.ok)
|
|
197
|
+
Object.assign(answer, {
|
|
198
|
+
state: 30,
|
|
199
|
+
content: (_b = (_a = response.data.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.content
|
|
200
|
+
});
|
|
201
|
+
return answer;
|
|
202
|
+
} catch (error) {
|
|
203
|
+
Object.assign(answer, {
|
|
204
|
+
state: 40,
|
|
205
|
+
content: error.message
|
|
206
|
+
});
|
|
207
|
+
return answer;
|
|
131
208
|
}
|
|
132
|
-
return "";
|
|
133
209
|
};
|
|
134
|
-
vue.onMounted(() => {
|
|
135
|
-
loadAiHistory();
|
|
136
|
-
});
|
|
137
210
|
return {
|
|
138
|
-
|
|
211
|
+
syncAskAI,
|
|
212
|
+
asyncAskAI,
|
|
213
|
+
parseContent,
|
|
214
|
+
loadAiHistory,
|
|
139
215
|
abortController
|
|
140
216
|
};
|
|
141
217
|
};
|
|
142
|
-
const useBase = (props,
|
|
218
|
+
const useBase = (props, element, message) => {
|
|
143
219
|
const actions = [
|
|
144
220
|
{
|
|
145
221
|
title: ibiz.i18n.t("util.inlineAiUtil.regenerate"),
|
|
@@ -175,7 +251,9 @@ const useBase = (props, container, target) => {
|
|
|
175
251
|
actionName: "cancel"
|
|
176
252
|
}
|
|
177
253
|
];
|
|
254
|
+
const { zIndex } = vue3Util.useUIStore();
|
|
178
255
|
const { options } = props;
|
|
256
|
+
const { containerRef, actionsRef, textareaRef } = element;
|
|
179
257
|
const editorRect = options.editorElement.getBoundingClientRect();
|
|
180
258
|
const offsetX = options.left - editorRect.left;
|
|
181
259
|
const offsetY = options.top - editorRect.top;
|
|
@@ -184,20 +262,32 @@ const useBase = (props, container, target) => {
|
|
|
184
262
|
const containerStyle = vue.ref({
|
|
185
263
|
width: "".concat(options.width, "px"),
|
|
186
264
|
left: "".concat(options.left, "px"),
|
|
187
|
-
top: "".concat(options.top, "px")
|
|
265
|
+
top: "".concat(options.top, "px"),
|
|
266
|
+
zIndex: zIndex.increment()
|
|
188
267
|
});
|
|
189
268
|
const contentStyle = vue.ref({
|
|
190
|
-
height: "".concat(options.height
|
|
191
|
-
"max-height": "".concat(options.maxHeight, "px")
|
|
269
|
+
height: options.height ? "".concat(options.height, "px") : "auto",
|
|
270
|
+
"max-height": "".concat(options.maxHeight || (options.height && options.height > 300 ? options.height : 300), "px")
|
|
192
271
|
});
|
|
272
|
+
vue.watch(
|
|
273
|
+
() => message.value.content,
|
|
274
|
+
() => {
|
|
275
|
+
vue.nextTick(() => {
|
|
276
|
+
if (!textareaRef.value)
|
|
277
|
+
return;
|
|
278
|
+
textareaRef.value.style.height = "auto";
|
|
279
|
+
textareaRef.value.style.height = "".concat(textareaRef.value.scrollHeight, "px");
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
);
|
|
193
283
|
const updatePosition = () => {
|
|
194
|
-
if (!
|
|
284
|
+
if (!containerRef.value || !actionsRef.value)
|
|
195
285
|
return;
|
|
196
286
|
const rect = options.editorElement.getBoundingClientRect();
|
|
197
287
|
let top = rect.top + offsetY;
|
|
198
288
|
let left = rect.left + offsetX;
|
|
199
|
-
const containerWidth =
|
|
200
|
-
const containerHeight =
|
|
289
|
+
const containerWidth = containerRef.value.offsetWidth;
|
|
290
|
+
const containerHeight = containerRef.value.offsetHeight;
|
|
201
291
|
const windowWidth = window.innerWidth;
|
|
202
292
|
const windowHeight = window.innerHeight;
|
|
203
293
|
const margin = 8;
|
|
@@ -214,7 +304,7 @@ const useBase = (props, container, target) => {
|
|
|
214
304
|
containerStyle.value.top = "".concat(top, "px");
|
|
215
305
|
containerStyle.value.left = "".concat(left, "px");
|
|
216
306
|
const position = containerHeight + 4;
|
|
217
|
-
const targetHeight =
|
|
307
|
+
const targetHeight = actionsRef.value.offsetHeight;
|
|
218
308
|
if (windowHeight - (top + containerHeight + targetHeight) > margin) {
|
|
219
309
|
actionStyle.value.top = "".concat(position, "px");
|
|
220
310
|
actionStyle.value.bottom = "auto";
|
|
@@ -233,18 +323,25 @@ const useBase = (props, container, target) => {
|
|
|
233
323
|
ticking = true;
|
|
234
324
|
}
|
|
235
325
|
};
|
|
326
|
+
let observer;
|
|
236
327
|
vue.onMounted(() => {
|
|
237
|
-
updatePosition();
|
|
238
328
|
document.addEventListener("scroll", optimizedUpdatePosition, {
|
|
239
329
|
capture: true
|
|
240
330
|
});
|
|
241
331
|
window.addEventListener("resize", optimizedUpdatePosition);
|
|
332
|
+
if (containerRef.value) {
|
|
333
|
+
observer = new ResizeObserver(optimizedUpdatePosition);
|
|
334
|
+
observer.observe(containerRef.value);
|
|
335
|
+
}
|
|
242
336
|
});
|
|
243
337
|
vue.onUnmounted(() => {
|
|
338
|
+
zIndex.decrement();
|
|
244
339
|
document.removeEventListener("scroll", optimizedUpdatePosition, {
|
|
245
340
|
capture: true
|
|
246
341
|
});
|
|
247
342
|
window.removeEventListener("resize", optimizedUpdatePosition);
|
|
343
|
+
observer == null ? void 0 : observer.disconnect();
|
|
344
|
+
observer = null;
|
|
248
345
|
});
|
|
249
346
|
return { theme, actions, actionStyle, containerStyle, contentStyle };
|
|
250
347
|
};
|
|
@@ -118,7 +118,7 @@ class InLineAIUtil {
|
|
|
118
118
|
this.container.className = this.ns.b();
|
|
119
119
|
document.body.appendChild(this.container);
|
|
120
120
|
const { editor } = params;
|
|
121
|
-
const { insertText, replaceSelectionText, restoreSelection } = editor;
|
|
121
|
+
const { insertText, replaceSelectionText, restoreSelection, editorParams } = editor;
|
|
122
122
|
delete params.editor;
|
|
123
123
|
const unMountAIChat = () => {
|
|
124
124
|
this.destroyInlineAIComponent();
|
|
@@ -127,6 +127,7 @@ class InLineAIUtil {
|
|
|
127
127
|
context,
|
|
128
128
|
params,
|
|
129
129
|
data,
|
|
130
|
+
editorParams,
|
|
130
131
|
content: selectText,
|
|
131
132
|
deACMode,
|
|
132
133
|
options,
|
package/lib/web-app/main.cjs
CHANGED
|
@@ -24,6 +24,7 @@ var loadingUtil = require('../util/loading-util/loading-util.cjs');
|
|
|
24
24
|
var noticeUtil = require('../util/notice-util/notice-util.cjs');
|
|
25
25
|
var overlayController = require('../util/overlay-controller/overlay-controller.cjs');
|
|
26
26
|
var inlineAiUtil = require('../util/inline-ai-util/inline-ai-util.cjs');
|
|
27
|
+
var aiChatUtil = require('../util/ai-chat-util/ai-chat-util.cjs');
|
|
27
28
|
var fullscreenUtil = require('../util/fullscreen/fullscreen-util.cjs');
|
|
28
29
|
|
|
29
30
|
"use strict";
|
|
@@ -85,6 +86,7 @@ async function runApp(plugins, opts) {
|
|
|
85
86
|
ibiz.notice = new noticeUtil.NoticeUtil();
|
|
86
87
|
ibiz.overlay = new overlayController.OverlayController();
|
|
87
88
|
ibiz.inLineAIUtil = new inlineAiUtil.InLineAIUtil();
|
|
89
|
+
ibiz.aiChatUtil = new aiChatUtil.AIChatUtil();
|
|
88
90
|
ibiz.util.text.format = (value, code) => {
|
|
89
91
|
return app.config.globalProperties.$textFormat(value, code);
|
|
90
92
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.42",
|
|
4
4
|
"description": "web端组件库(vue3)",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
32
32
|
"@floating-ui/dom": "^1.5.3",
|
|
33
|
-
"@ibiz-template-plugin/ai-chat": "^0.0.
|
|
33
|
+
"@ibiz-template-plugin/ai-chat": "^0.0.35",
|
|
34
34
|
"@ibiz-template-plugin/gantt": "0.1.8-alpha.316",
|
|
35
35
|
"@ibiz-template-plugin/bi-report": "0.0.30",
|
|
36
36
|
"@ibiz-template-plugin/data-view": "0.0.6",
|
|
37
37
|
"@ibiz-template/core": "0.7.41-alpha.35",
|
|
38
38
|
"@ibiz-template/devtool": "0.0.13",
|
|
39
|
-
"@ibiz-template/model-helper": "0.7.41-alpha.
|
|
40
|
-
"@ibiz-template/runtime": "0.7.41-alpha.
|
|
39
|
+
"@ibiz-template/model-helper": "0.7.41-alpha.41",
|
|
40
|
+
"@ibiz-template/runtime": "0.7.41-alpha.41",
|
|
41
41
|
"@ibiz-template/theme": "0.7.39",
|
|
42
|
-
"@ibiz-template/vue3-util": "0.7.41-alpha.
|
|
42
|
+
"@ibiz-template/vue3-util": "0.7.41-alpha.41",
|
|
43
43
|
"@ibiz-template/web-theme": "3.9.0",
|
|
44
44
|
"@ibiz/model-core": "^0.1.83",
|
|
45
45
|
"@imengyu/vue3-context-menu": "^1.3.5",
|