@blueking/ai-blueking 2.1.0 → 2.1.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-blueking.vue.d.ts +1 -0
- package/dist/ai-blueking.vue.d.ts.map +1 -1
- package/dist/components/ai-header/index.vue.d.ts +10 -1
- package/dist/components/ai-header/index.vue.d.ts.map +1 -1
- package/dist/composables/use-panel-container.d.ts +2 -1
- package/dist/composables/use-panel-container.d.ts.map +1 -1
- package/dist/composables/use-session-handlers.d.ts +2 -1
- package/dist/composables/use-session-handlers.d.ts.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/vue2/index.es.min.js +129 -103
- package/dist/vue2/index.iife.min.js +202 -202
- package/dist/vue2/index.umd.min.js +3 -3
- package/dist/vue2/style.css +1 -1
- package/dist/vue2.d.ts.map +1 -1
- package/dist/vue3/index.es.min.js +170 -156
- package/dist/vue3/index.iife.min.js +3 -3
- package/dist/vue3/index.umd.min.js +3 -3
- package/dist/vue3/style.css +1 -1
- package/package.json +1 -1
package/dist/vue2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue2.d.ts","sourceRoot":"","sources":["../src/vue2.ts"],"names":[],"mappings":"AAiCA,mBAAmB,SAAS,CAAC;AAG7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8DxB;;GAEG;;AACH,
|
|
1
|
+
{"version":3,"file":"vue2.d.ts","sourceRoot":"","sources":["../src/vue2.ts"],"names":[],"mappings":"AAiCA,mBAAmB,SAAS,CAAC;AAG7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8DxB;;GAEG;;AACH,wBA6NG;AAwCH;;GAEG;AACH,eAAO,MAAM,SAAS,SA4EpB,CAAC"}
|
|
@@ -492,7 +492,7 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
492
492
|
"history-session-rename"
|
|
493
493
|
],
|
|
494
494
|
setup(e, { expose: n, emit: i }) {
|
|
495
|
-
let l = e, m = i, g = bkTooltips, _ = ref(null), v = ref(null), T = ref(null), E = ref(!1), k = ref(""), z = ref(null), B = null, H = /* @__PURE__ */ new Map(), G = null,
|
|
495
|
+
let l = e, m = i, g = bkTooltips, _ = ref(null), v = ref(null), T = ref(null), E = ref(!1), k = ref(""), z = ref(null), B = null, H = /* @__PURE__ */ new Map(), G = null, q = () => {
|
|
496
496
|
!v.value || !l.sessionBusinessManager || (G = useHistoryDropdown({
|
|
497
497
|
triggerRef: v,
|
|
498
498
|
sessionBusinessManager: l.sessionBusinessManager,
|
|
@@ -500,7 +500,7 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
500
500
|
onSessionDelete: (e) => m("history-session-delete", e),
|
|
501
501
|
onSessionRename: (e, n) => m("history-session-rename", e, n)
|
|
502
502
|
}));
|
|
503
|
-
},
|
|
503
|
+
}, J = computed(() => l.hasPermission ? l.enableChatSession ? l.title || `${l.agentName || ""}-${l.sessionName || ""}` : l.agentName : t("无智能体使用权限")), Z = computed(() => l.isCompressionHeight ? "bkai-morenchicun" : "bkai-yasuo"), Q = computed(() => l.isCompressionHeight ? t("恢复默认尺寸") : t("缩小高度")), $ = computed(() => l.hasPermission), vt = (e) => $.value ? e : t("暂无使用权限"), yt = () => ({ cursor: $.value ? "pointer" : "not-allowed" }), bt = computed(() => {
|
|
504
504
|
let e = !l.hasSessionContents, n = e ? "disabled" : "", r = e ? `data-tippy-content="${t("请先发起会话")}"` : "", i = "";
|
|
505
505
|
return l.dropdownMenuConfig?.showRename && (i += `
|
|
506
506
|
<div class="tippy-menu-item" data-action="rename">
|
|
@@ -532,18 +532,18 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
534
|
m("new-chat");
|
|
535
|
-
},
|
|
536
|
-
e.stopPropagation(), l.sessionBusinessManager ? (G ||
|
|
537
|
-
},
|
|
535
|
+
}, St = (e) => {
|
|
536
|
+
e.stopPropagation(), l.sessionBusinessManager ? (G || q(), G && G.handleTriggerClick(e)) : m("history-click", e);
|
|
537
|
+
}, Ct = () => {
|
|
538
538
|
m("help-click");
|
|
539
|
-
}, Ct = (e) => {
|
|
540
|
-
e.stopPropagation(), G && G.isVisible() && G.hide(), B && (B.state.isVisible ? B.hide() : B.show());
|
|
541
539
|
}, wt = (e) => {
|
|
540
|
+
e.stopPropagation(), G && G.isVisible() && G.hide(), B && (B.state.isVisible ? B.hide() : B.show());
|
|
541
|
+
}, Tt = (e) => {
|
|
542
542
|
e.stopPropagation(), e.preventDefault();
|
|
543
543
|
let n = e.currentTarget, r = n.dataset.action;
|
|
544
544
|
if (!n.classList.contains("disabled")) switch (B && B.hide(), r) {
|
|
545
545
|
case "rename":
|
|
546
|
-
|
|
546
|
+
Et();
|
|
547
547
|
break;
|
|
548
548
|
case "auto-generate":
|
|
549
549
|
m("auto-generate-name");
|
|
@@ -552,9 +552,9 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
552
552
|
m("share");
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
|
-
},
|
|
556
|
-
document.removeEventListener("click",
|
|
557
|
-
document.addEventListener("click",
|
|
555
|
+
}, Et = () => {
|
|
556
|
+
document.removeEventListener("click", Nt), k.value = l.sessionName || "", E.value = !0, setTimeout(() => {
|
|
557
|
+
document.addEventListener("click", Nt);
|
|
558
558
|
}, 100), setTimeout(() => {
|
|
559
559
|
if (z.value) try {
|
|
560
560
|
let e = z.value;
|
|
@@ -565,22 +565,22 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
565
565
|
console.warn("Failed to focus rename input:", e);
|
|
566
566
|
}
|
|
567
567
|
}, 100);
|
|
568
|
-
},
|
|
568
|
+
}, kt = () => {
|
|
569
569
|
let e = k.value.trim();
|
|
570
570
|
if (!e) {
|
|
571
|
-
|
|
571
|
+
At();
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
574
|
m("rename", e), E.value = !1, k.value = "";
|
|
575
|
-
},
|
|
575
|
+
}, At = () => {
|
|
576
576
|
E.value = !1, k.value = "";
|
|
577
|
-
},
|
|
578
|
-
k.value = e, n.key === "Enter" ?
|
|
579
|
-
},
|
|
577
|
+
}, Mt = (e, n) => {
|
|
578
|
+
k.value = e, n.key === "Enter" ? kt() : n.key === "Escape" && At();
|
|
579
|
+
}, Nt = (e) => {
|
|
580
580
|
if (!E.value) return;
|
|
581
581
|
let n = e.target, r = document.querySelector(".rename-tooltip");
|
|
582
|
-
r && !r.contains(n) &&
|
|
583
|
-
},
|
|
582
|
+
r && !r.contains(n) && At();
|
|
583
|
+
}, Pt = async () => {
|
|
584
584
|
if (!T.value) return;
|
|
585
585
|
let e = (await import("tippy.js")).default;
|
|
586
586
|
B &&= (B.destroy(), null), B = e(T.value, {
|
|
@@ -598,7 +598,7 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
598
598
|
let { default: e } = await import("tippy.js");
|
|
599
599
|
document.querySelectorAll(".tippy-menu-item").forEach((n) => {
|
|
600
600
|
let r = n;
|
|
601
|
-
r.addEventListener("click",
|
|
601
|
+
r.addEventListener("click", Tt);
|
|
602
602
|
let i = r.getAttribute("data-tippy-content");
|
|
603
603
|
if (i && !H.has(r)) {
|
|
604
604
|
let n = e(r, {
|
|
@@ -617,7 +617,7 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
617
617
|
onHide: () => {
|
|
618
618
|
document.querySelectorAll(".tippy-menu-item").forEach((e) => {
|
|
619
619
|
let n = e;
|
|
620
|
-
n.removeEventListener("click",
|
|
620
|
+
n.removeEventListener("click", Tt);
|
|
621
621
|
let r = H.get(n);
|
|
622
622
|
r && (r.destroy(), H.delete(n));
|
|
623
623
|
});
|
|
@@ -627,11 +627,11 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
627
627
|
return watch(() => [l.isCompressionHeight, l.hasSessionContents], () => {
|
|
628
628
|
B && B.setContent(bt.value);
|
|
629
629
|
}), onMounted(() => {
|
|
630
|
-
|
|
630
|
+
Pt(), l.sessionBusinessManager && q(), document.addEventListener("click", Nt);
|
|
631
631
|
}), onBeforeUnmount(() => {
|
|
632
632
|
B &&= (B.destroy(), null), H.forEach((e) => {
|
|
633
633
|
e.destroy();
|
|
634
|
-
}), H.clear(), G &&= (G.destroy(), null), document.removeEventListener("click",
|
|
634
|
+
}), H.clear(), G &&= (G.destroy(), null), document.removeEventListener("click", Nt);
|
|
635
635
|
}), n({
|
|
636
636
|
headerRef: _,
|
|
637
637
|
historyIconRef: v
|
|
@@ -639,94 +639,98 @@ var _hoisted_1$2 = { class: "left-section" }, _hoisted_2$1 = { class: "logo" },
|
|
|
639
639
|
ref_key: "headerRef",
|
|
640
640
|
ref: _,
|
|
641
641
|
class: normalizeClass(["ai-header drag-handle", { draggable: l.draggable }])
|
|
642
|
-
}, [
|
|
643
|
-
createElementVNode("div",
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
class: "
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
"
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
}
|
|
642
|
+
}, [
|
|
643
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
644
|
+
createElementVNode("div", _hoisted_2$1, [createElementVNode("img", {
|
|
645
|
+
alt: "logo",
|
|
646
|
+
src: unref(avatar_default)
|
|
647
|
+
}, null, 8, _hoisted_3)]),
|
|
648
|
+
createElementVNode("div", { class: normalizeClass(["title", { "title-with-tooltip": E.value }]) }, [
|
|
649
|
+
createTextVNode(toDisplayString(J.value) + " ", 1),
|
|
650
|
+
createCommentVNode(" 重命名 tooltip 直接绑定在 title 上 "),
|
|
651
|
+
E.value ? (openBlock(), createElementBlock("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [createVNode(unref(Input), {
|
|
652
|
+
ref_key: "renameInputRef",
|
|
653
|
+
ref: z,
|
|
654
|
+
modelValue: k.value,
|
|
655
|
+
"onUpdate:modelValue": r[0] ||= (e) => k.value = e,
|
|
656
|
+
class: "rename-input",
|
|
657
|
+
placeholder: unref(t)("请输入新的会话名称"),
|
|
658
|
+
onKeyup: Mt
|
|
659
|
+
}, null, 8, ["modelValue", "placeholder"]), createElementVNode("div", { class: "rename-buttons" }, [createElementVNode("i", {
|
|
660
|
+
class: "bkai-icon bkai-check-1 rename-btn confirm-btn",
|
|
661
|
+
onClick: kt
|
|
662
|
+
}), createElementVNode("i", {
|
|
663
|
+
class: "bkai-icon bkai-close rename-btn cancel-btn",
|
|
664
|
+
onClick: At
|
|
665
|
+
})])])])) : createCommentVNode("v-if", !0)
|
|
666
|
+
], 2),
|
|
667
|
+
l.showMoreIcon && $.value ? (openBlock(), createElementBlock("span", {
|
|
668
|
+
key: 0,
|
|
669
|
+
ref_key: "moreIconRef",
|
|
670
|
+
ref: T,
|
|
671
|
+
class: "bkai-icon bkai-more",
|
|
672
|
+
onClick: wt
|
|
673
|
+
}, null, 512)) : createCommentVNode("v-if", !0)
|
|
674
|
+
]),
|
|
675
|
+
renderSlot(n.$slots, "headerLeft", {}, void 0, !0),
|
|
676
|
+
createElementVNode("div", _hoisted_6, [
|
|
677
|
+
createCommentVNode(" 新增会话按钮 "),
|
|
678
|
+
l.showNewChatIcon && e.enableChatSession !== !1 ? withDirectives((openBlock(), createElementBlock("i", {
|
|
679
|
+
key: 0,
|
|
680
|
+
class: normalizeClass([
|
|
681
|
+
"bkai-icon",
|
|
682
|
+
"bkai-xinzengliaotian",
|
|
683
|
+
{ disabled: !$.value }
|
|
684
|
+
]),
|
|
685
|
+
style: normalizeStyle(yt()),
|
|
686
|
+
onClick: r[1] ||= (e) => $.value ? xt() : void 0
|
|
687
|
+
}, null, 6)), [[unref(g), {
|
|
688
|
+
content: vt(unref(t)("新增会话")),
|
|
689
|
+
boundary: "parent"
|
|
690
|
+
}]]) : createCommentVNode("v-if", !0),
|
|
691
|
+
createCommentVNode(" 历史会话按钮 "),
|
|
692
|
+
l.showHistoryIcon && e.enableChatSession !== !1 ? withDirectives((openBlock(), createElementBlock("i", {
|
|
693
|
+
key: 1,
|
|
694
|
+
ref_key: "historyIconRef",
|
|
695
|
+
ref: v,
|
|
696
|
+
class: normalizeClass([
|
|
697
|
+
"bkai-icon",
|
|
698
|
+
"bkai-history",
|
|
699
|
+
{ disabled: !$.value }
|
|
700
|
+
]),
|
|
701
|
+
style: normalizeStyle(yt()),
|
|
702
|
+
onClick: r[2] ||= (e) => $.value ? St(e) : void 0
|
|
703
|
+
}, null, 6)), [[unref(g), {
|
|
704
|
+
content: vt(unref(t)("历史会话")),
|
|
705
|
+
boundary: "parent"
|
|
706
|
+
}]]) : createCommentVNode("v-if", !0),
|
|
707
|
+
e.chatGroup?.enabled ? withDirectives((openBlock(), createElementBlock("i", {
|
|
708
|
+
key: 2,
|
|
709
|
+
class: "bkai-icon bkai-zhushou",
|
|
710
|
+
onClick: Ct
|
|
711
|
+
}, null, 512)), [[unref(g), {
|
|
712
|
+
content: unref(t)("转人工"),
|
|
713
|
+
boundary: "parent"
|
|
714
|
+
}]]) : createCommentVNode("v-if", !0),
|
|
715
|
+
l.showCompressionIcon ? withDirectives((openBlock(), createElementBlock("i", {
|
|
716
|
+
key: 3,
|
|
717
|
+
class: normalizeClass(["bkai-icon", Z.value]),
|
|
718
|
+
onClick: r[3] ||= (e) => m("toggle-compression")
|
|
719
|
+
}, null, 2)), [[unref(g), {
|
|
720
|
+
content: Q.value,
|
|
721
|
+
boundary: "parent"
|
|
722
|
+
}]]) : createCommentVNode("v-if", !0),
|
|
723
|
+
withDirectives(createElementVNode("i", {
|
|
724
|
+
class: "bkai-icon bkai-close-line-2",
|
|
725
|
+
onClick: r[4] ||= (e) => m("close")
|
|
726
|
+
}, null, 512), [[unref(g), {
|
|
727
|
+
content: unref(t)("关闭"),
|
|
728
|
+
boundary: "parent"
|
|
729
|
+
}]])
|
|
730
|
+
])
|
|
731
|
+
], 2));
|
|
732
|
+
}
|
|
733
|
+
}), [["__scopeId", "data-v-aa621291"]]), ChatBusinessManager = class {
|
|
730
734
|
_isGenerating;
|
|
731
735
|
_isStopLoading;
|
|
732
736
|
agentModule;
|
|
@@ -1929,7 +1933,7 @@ var chat_bot_default = /* @__PURE__ */ defineComponent({
|
|
|
1929
1933
|
props: a,
|
|
1930
1934
|
emit: s,
|
|
1931
1935
|
scrollToBottom: L
|
|
1932
|
-
}), { userInput: gt, cite:
|
|
1936
|
+
}), { userInput: gt, cite: _t, handleUpdateModelValue: vt, doSendMessage: yt, handleSendMessage: xt, handleUpload: Ct, handleStopSending: wt, stopGeneration: Tt } = useMessageSender({
|
|
1933
1937
|
emit: s,
|
|
1934
1938
|
chatHelper: B,
|
|
1935
1939
|
chatBusinessManager: J,
|
|
@@ -1940,7 +1944,7 @@ var chat_bot_default = /* @__PURE__ */ defineComponent({
|
|
|
1940
1944
|
emit: s,
|
|
1941
1945
|
chatHelper: B,
|
|
1942
1946
|
shortcutManager: Q,
|
|
1943
|
-
doSendMessage:
|
|
1947
|
+
doSendMessage: yt,
|
|
1944
1948
|
selectedShortcut: I
|
|
1945
1949
|
}), { messageStatus: Nt, messageToolsStatus: Pt, messages: Ft, isMessagesLoading: It, isGenerating: Lt, currentSession: Rt, isWelcomeState: zt, openingRemark: Bt, effectiveResources: Vt, effectivePrompts: Ht, effectiveSupportUpload: Ut, chatbotStyle: Wt, filteredShortcuts: Gt } = useChatbotState({
|
|
1946
1950
|
props: a,
|
|
@@ -1955,7 +1959,7 @@ var chat_bot_default = /* @__PURE__ */ defineComponent({
|
|
|
1955
1959
|
emit: s,
|
|
1956
1960
|
chatHelper: B,
|
|
1957
1961
|
chatBusinessManager: J,
|
|
1958
|
-
cite:
|
|
1962
|
+
cite: _t,
|
|
1959
1963
|
focusInput: z,
|
|
1960
1964
|
scrollToBottom: L,
|
|
1961
1965
|
getShortcutFromMessage: At,
|
|
@@ -1971,7 +1975,7 @@ var chat_bot_default = /* @__PURE__ */ defineComponent({
|
|
|
1971
1975
|
if (n?.task_id != null && n?.node_id) return B.value?.message.getFlowAgentTaskNodeInfo(n.task_id, n.node_id);
|
|
1972
1976
|
};
|
|
1973
1977
|
return n({
|
|
1974
|
-
sendMessage: (e) =>
|
|
1978
|
+
sendMessage: (e) => xt(e, [[]]),
|
|
1975
1979
|
stopGeneration: Tt,
|
|
1976
1980
|
switchSession: async (e) => {
|
|
1977
1981
|
if (!Z.value) {
|
|
@@ -1989,7 +1993,7 @@ var chat_bot_default = /* @__PURE__ */ defineComponent({
|
|
|
1989
1993
|
isGenerating: Lt,
|
|
1990
1994
|
getChatHelper: () => B.value,
|
|
1991
1995
|
setCiteText: (e) => {
|
|
1992
|
-
|
|
1996
|
+
_t.value = e;
|
|
1993
1997
|
},
|
|
1994
1998
|
focusInput: z,
|
|
1995
1999
|
enterShareMode: () => m.value?.enterShareMode(),
|
|
@@ -2008,8 +2012,8 @@ var chat_bot_default = /* @__PURE__ */ defineComponent({
|
|
|
2008
2012
|
}, [createVNode(unref(ChatContainer), {
|
|
2009
2013
|
ref_key: "chatContainerRef",
|
|
2010
2014
|
ref: m,
|
|
2011
|
-
cite: unref(
|
|
2012
|
-
"onUpdate:cite": r[0] ||= (e) => isRef(
|
|
2015
|
+
cite: unref(_t),
|
|
2016
|
+
"onUpdate:cite": r[0] ||= (e) => isRef(_t) ? _t.value = e : null,
|
|
2013
2017
|
"selected-shortcut": I.value,
|
|
2014
2018
|
"onUpdate:selectedShortcut": r[1] ||= (e) => I.value = e,
|
|
2015
2019
|
"chat-loading": Qt.value,
|
|
@@ -2021,7 +2025,7 @@ var chat_bot_default = /* @__PURE__ */ defineComponent({
|
|
|
2021
2025
|
"on-agent-action": unref(Kt),
|
|
2022
2026
|
"on-agent-feedback": unref(qt),
|
|
2023
2027
|
"on-custom-tab-change": tn,
|
|
2024
|
-
"on-send-message": unref(
|
|
2028
|
+
"on-send-message": unref(xt),
|
|
2025
2029
|
"on-stop-sending": unref(wt),
|
|
2026
2030
|
"on-upload": unref(Ct),
|
|
2027
2031
|
"on-user-action": unref(Jt),
|
|
@@ -2043,7 +2047,7 @@ var chat_bot_default = /* @__PURE__ */ defineComponent({
|
|
|
2043
2047
|
onShortcutClose: unref(Dt),
|
|
2044
2048
|
onShortcutSubmit: unref(Ot),
|
|
2045
2049
|
onStopStreaming: unref(Zt),
|
|
2046
|
-
"onUpdate:modelValue": unref(
|
|
2050
|
+
"onUpdate:modelValue": unref(vt)
|
|
2047
2051
|
}, {
|
|
2048
2052
|
message: withCtx(({ message: r, messageToolsStatus: i }) => [createVNode(unref(MessageRender), {
|
|
2049
2053
|
message: r,
|
|
@@ -2347,21 +2351,25 @@ function useNimbus(e, n = !1) {
|
|
|
2347
2351
|
}
|
|
2348
2352
|
var SIDE_PANEL_EXTRA_WIDTH = 420;
|
|
2349
2353
|
function usePanelContainer(e) {
|
|
2350
|
-
let { componentManager: n, chatBotRef: r, forwarders: i, forwardToManager: a } = e,
|
|
2354
|
+
let { componentManager: n, chatBotRef: r, forwarders: i, forwardToManager: a, beforeNimbusClick: o } = e, s = async (e) => {
|
|
2351
2355
|
n.showPanel(e), e && r.value && await r.value.switchSession(e);
|
|
2352
|
-
},
|
|
2353
|
-
await
|
|
2354
|
-
},
|
|
2356
|
+
}, l = async (e) => {
|
|
2357
|
+
await s(e);
|
|
2358
|
+
}, u = () => {
|
|
2355
2359
|
n.hidePanel();
|
|
2356
2360
|
};
|
|
2357
2361
|
return {
|
|
2358
|
-
show:
|
|
2359
|
-
handleShow:
|
|
2360
|
-
hide:
|
|
2362
|
+
show: s,
|
|
2363
|
+
handleShow: l,
|
|
2364
|
+
hide: u,
|
|
2361
2365
|
handleClose: () => {
|
|
2362
|
-
|
|
2366
|
+
u();
|
|
2363
2367
|
},
|
|
2364
|
-
handleNimbusClick: () => {
|
|
2368
|
+
handleNimbusClick: async () => {
|
|
2369
|
+
if (o && await o() === !1) {
|
|
2370
|
+
n.emit("nimbus-click", {});
|
|
2371
|
+
return;
|
|
2372
|
+
}
|
|
2365
2373
|
n.handleNimbusClick();
|
|
2366
2374
|
},
|
|
2367
2375
|
handleDragging: (e) => {
|
|
@@ -2495,7 +2503,7 @@ function useSessionHandlers(e) {
|
|
|
2495
2503
|
e && (l.value = e.sessionName || "", d.value = (e.sessionContentCount ?? 0) > 0 || m());
|
|
2496
2504
|
},
|
|
2497
2505
|
addNewSession: async (e) => {
|
|
2498
|
-
e ? await r.createSession(
|
|
2506
|
+
e ? await r.createSession(e) : await r.createNewSession();
|
|
2499
2507
|
},
|
|
2500
2508
|
switchToSession: async (e) => {
|
|
2501
2509
|
i.value && await i.value.switchSession(e);
|
|
@@ -3210,7 +3218,7 @@ function useDraggable(e = {}, n) {
|
|
|
3210
3218
|
})) : (_.value = window.innerHeight - s - l, v.value = u.value - l, T.value = r, O.value = s), j.value = !j.value;
|
|
3211
3219
|
}, gt = (e, n) => {
|
|
3212
3220
|
v.value = e, _.value = n, z.value = e - (window.innerWidth - T.value);
|
|
3213
|
-
},
|
|
3221
|
+
}, $ = (e, n) => {
|
|
3214
3222
|
T.value = Math.max(i, Math.min(e, k.value)), O.value = Math.max(a, n);
|
|
3215
3223
|
};
|
|
3216
3224
|
return onMounted(() => {
|
|
@@ -3233,9 +3241,9 @@ function useDraggable(e = {}, n) {
|
|
|
3233
3241
|
handleResizeStop: ht,
|
|
3234
3242
|
toggleCompression: Q,
|
|
3235
3243
|
updatePosition: gt,
|
|
3236
|
-
updateSize:
|
|
3244
|
+
updateSize: $,
|
|
3237
3245
|
updatePositionAndSize: (e, n, r, i) => {
|
|
3238
|
-
gt(e, n),
|
|
3246
|
+
gt(e, n), $(r, i);
|
|
3239
3247
|
},
|
|
3240
3248
|
expandForSidePanel: (e) => {
|
|
3241
3249
|
if (H.value) return;
|
|
@@ -3248,7 +3256,7 @@ function useDraggable(e = {}, n) {
|
|
|
3248
3256
|
height: n.height
|
|
3249
3257
|
});
|
|
3250
3258
|
gt(a.x, a.y), nextTick(() => {
|
|
3251
|
-
|
|
3259
|
+
$(a.width, a.height);
|
|
3252
3260
|
});
|
|
3253
3261
|
},
|
|
3254
3262
|
collapseSidePanel: () => {
|
|
@@ -3261,7 +3269,7 @@ function useDraggable(e = {}, n) {
|
|
|
3261
3269
|
width: r,
|
|
3262
3270
|
height: e.height
|
|
3263
3271
|
});
|
|
3264
|
-
|
|
3272
|
+
$(i.width, i.height), nextTick(() => {
|
|
3265
3273
|
gt(i.x, i.y);
|
|
3266
3274
|
});
|
|
3267
3275
|
}
|
|
@@ -3304,7 +3312,7 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3304
3312
|
"compression-change"
|
|
3305
3313
|
],
|
|
3306
3314
|
setup(e, { expose: n, emit: a }) {
|
|
3307
|
-
let o = e, l = a, u = ref(!1), { minWidth: d, minHeight: m, maxWidth: g, top: _, left: v, width: T, height: E, isCompressed: k, isSidePanelExpanded: I, handleDragging: L, handleResizing: z, handleDragStop: B, handleResizeStop: H, toggleCompression: G, updatePosition: q, updateSize: mt, updatePositionAndSize: J, expandForSidePanel: Z, collapseSidePanel:
|
|
3315
|
+
let o = e, l = a, u = ref(!1), { minWidth: d, minHeight: m, maxWidth: g, top: _, left: v, width: T, height: E, isCompressed: k, isSidePanelExpanded: I, handleDragging: L, handleResizing: z, handleDragStop: B, handleResizeStop: H, toggleCompression: G, updatePosition: q, updateSize: mt, updatePositionAndSize: J, expandForSidePanel: Z, collapseSidePanel: vt } = useDraggable({
|
|
3308
3316
|
initWidth: o.defaultWidth,
|
|
3309
3317
|
minWidth: o.minWidth,
|
|
3310
3318
|
minHeight: o.minHeight,
|
|
@@ -3319,15 +3327,15 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3319
3327
|
onResizeStop: (e) => l("resize-stop", e),
|
|
3320
3328
|
onDragging: (e) => l("dragging", e),
|
|
3321
3329
|
onResizing: (e) => l("resizing", e)
|
|
3322
|
-
}),
|
|
3330
|
+
}), yt = computed(() => {
|
|
3323
3331
|
let e = typeof o.maxWidth == "number" ? `${o.maxWidth}px` : o.maxWidth ?? `${g.value}px`;
|
|
3324
3332
|
return { "--draggable-max-width": e };
|
|
3325
|
-
}),
|
|
3333
|
+
}), bt = computed(() => ({
|
|
3326
3334
|
x: v.value,
|
|
3327
3335
|
y: _.value,
|
|
3328
3336
|
width: T.value,
|
|
3329
3337
|
height: E.value
|
|
3330
|
-
})),
|
|
3338
|
+
})), xt = () => {
|
|
3331
3339
|
document.querySelectorAll("iframe").forEach((e) => {
|
|
3332
3340
|
e.style.pointerEvents = "none";
|
|
3333
3341
|
});
|
|
@@ -3336,9 +3344,9 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3336
3344
|
e.style.pointerEvents = "";
|
|
3337
3345
|
});
|
|
3338
3346
|
}, Ct = (e, n) => {
|
|
3339
|
-
u.value || (u.value = !0,
|
|
3347
|
+
u.value || (u.value = !0, xt()), L(e, n);
|
|
3340
3348
|
}, wt = (e, n, r, i) => {
|
|
3341
|
-
u.value || (u.value = !0,
|
|
3349
|
+
u.value || (u.value = !0, xt()), z(e, n, r, i);
|
|
3342
3350
|
}, Tt = (e, n) => {
|
|
3343
3351
|
B(e, n), u.value = !1, St();
|
|
3344
3352
|
}, Et = (e, n, r, i) => {
|
|
@@ -3352,8 +3360,8 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3352
3360
|
updatePositionAndSize: J,
|
|
3353
3361
|
toggleCompression: G,
|
|
3354
3362
|
expandForSidePanel: Z,
|
|
3355
|
-
collapseSidePanel:
|
|
3356
|
-
positionAndSize:
|
|
3363
|
+
collapseSidePanel: vt,
|
|
3364
|
+
positionAndSize: bt,
|
|
3357
3365
|
isCompressed: k,
|
|
3358
3366
|
isSidePanelExpanded: I
|
|
3359
3367
|
}), (e, n) => withDirectives((openBlock(), createBlock(unref(U), {
|
|
@@ -3370,7 +3378,7 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3370
3378
|
parent: !0,
|
|
3371
3379
|
"prevent-deactivation": !0,
|
|
3372
3380
|
resizable: o.resizable,
|
|
3373
|
-
style: normalizeStyle(
|
|
3381
|
+
style: normalizeStyle(yt.value),
|
|
3374
3382
|
w: unref(T),
|
|
3375
3383
|
x: unref(v),
|
|
3376
3384
|
y: unref(_),
|
|
@@ -3524,6 +3532,7 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3524
3532
|
__name: "ai-blueking",
|
|
3525
3533
|
props: /* @__PURE__ */ mergeDefaults({
|
|
3526
3534
|
autoSwitchToInitialSession: { type: Boolean },
|
|
3535
|
+
beforeNimbusClick: { type: Function },
|
|
3527
3536
|
defaultChatInputPosition: {},
|
|
3528
3537
|
defaultHeight: {},
|
|
3529
3538
|
defaultLeft: {},
|
|
@@ -3586,37 +3595,38 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3586
3595
|
"share"
|
|
3587
3596
|
],
|
|
3588
3597
|
setup(e, { expose: r, emit: o }) {
|
|
3589
|
-
let u = e, { chatHelper: m, componentManager: _, sessionBusinessManager: T, shareBusinessManager: E, shortcutManager: I, forwarders: L, forwardToManager: z, chatBotRef: B, draggableContainerRef: pt, panelVisible: H, nimbusMinimized: G, normalizedUrl: q, agentName: mt, currentSession: J, isCompressed: Z, isWelcomeState: Q, messageToolsTippyOptions: gt, agentResources:
|
|
3598
|
+
let u = e, { chatHelper: m, componentManager: _, sessionBusinessManager: T, shareBusinessManager: E, shortcutManager: I, forwarders: L, forwardToManager: z, chatBotRef: B, draggableContainerRef: pt, panelVisible: H, nimbusMinimized: G, normalizedUrl: q, agentName: mt, currentSession: J, isCompressed: Z, isWelcomeState: Q, messageToolsTippyOptions: gt, agentResources: _t, agentPrompts: vt, handleError: bt } = useAiBluekingInit({
|
|
3590
3599
|
props: u,
|
|
3591
3600
|
emit: o
|
|
3592
|
-
}), { show:
|
|
3601
|
+
}), { show: xt, hide: St, handleShow: Ct, handleClose: wt, handleNimbusClick: Tt, handleDragging: Et, handleResizing: Dt, handleDragStop: Ot, handleResizeStop: kt, handleToggleCompression: At, handleCompressionChange: jt, handleExecutionPanelChange: Mt, sendMessage: Nt, handleReceiveStart: Pt, handleReceiveText: Ft, handleReceiveEnd: It, handleStop: Lt, stopGeneration: Rt, setCiteText: zt, focusInput: Bt, selectShortcut: Vt, sendShortcut: Ht, getChatHelper: Ut, updatePosition: Wt, updateSize: Gt, updatePositionAndSize: Kt, handleShortcutClick: qt } = usePanelContainer({
|
|
3593
3602
|
componentManager: _,
|
|
3594
3603
|
chatBotRef: B,
|
|
3595
3604
|
forwarders: L,
|
|
3596
|
-
forwardToManager: z
|
|
3605
|
+
forwardToManager: z,
|
|
3606
|
+
beforeNimbusClick: u.beforeNimbusClick
|
|
3597
3607
|
}), { sessionName: Jt, hasPermission: Yt, hasSessionContents: Xt, handleNewChat: Zt, handleHistoryClick: Qt, handleHistorySessionSwitch: $t, handleHistorySessionDelete: en, handleHistorySessionRename: tn, handleAutoGenerateName: nn, handleHelpClick: rn, handleRename: an, handleSessionSwitched: on, addNewSession: sn, switchToSession: cn, updateSessionName: ln } = useSessionHandlers({
|
|
3598
3608
|
chatHelper: m,
|
|
3599
3609
|
sessionBusinessManager: T,
|
|
3600
3610
|
chatBotRef: B,
|
|
3601
3611
|
forwarders: L,
|
|
3602
|
-
handleError:
|
|
3612
|
+
handleError: bt,
|
|
3603
3613
|
currentSession: J
|
|
3604
3614
|
}), { isShareLoading: un, handleShare: dn, handleCancelShare: fn, handleConfirmShare: pn } = useShareHandlers({
|
|
3605
3615
|
shareBusinessManager: E,
|
|
3606
3616
|
chatBotRef: B,
|
|
3607
3617
|
forwarders: L,
|
|
3608
|
-
handleError:
|
|
3618
|
+
handleError: bt
|
|
3609
3619
|
}), { aiSelectionVisible: mn, filteredPopupShortcuts: hn, handleSelectionChange: gn, handleAiSelectionShortcut: _n } = useAiSelection({
|
|
3610
3620
|
shortcutManager: I,
|
|
3611
3621
|
chatBotRef: B,
|
|
3612
3622
|
forwardToManager: z,
|
|
3613
|
-
show:
|
|
3623
|
+
show: xt,
|
|
3614
3624
|
props: u
|
|
3615
3625
|
}), vn = (e) => {
|
|
3616
3626
|
Xt.value = !0, L.sendMessage(e);
|
|
3617
3627
|
};
|
|
3618
3628
|
return r({
|
|
3619
|
-
show:
|
|
3629
|
+
show: xt,
|
|
3620
3630
|
handleShow: Ct,
|
|
3621
3631
|
handleClose: wt,
|
|
3622
3632
|
hide: St,
|
|
@@ -3684,7 +3694,11 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3684
3694
|
onRename: unref(an),
|
|
3685
3695
|
onShare: unref(dn),
|
|
3686
3696
|
onToggleCompression: unref(At)
|
|
3687
|
-
},
|
|
3697
|
+
}, createSlots({ _: 2 }, [e.$slots.headerLeft ? {
|
|
3698
|
+
name: "headerLeft",
|
|
3699
|
+
fn: withCtx(() => [renderSlot(e.$slots, "headerLeft", {}, void 0, !0)]),
|
|
3700
|
+
key: "0"
|
|
3701
|
+
} : void 0]), 1032, /* @__PURE__ */ "agent-name.chat-helper.draggable.dropdown-menu-config.enable-chat-session.has-permission.has-session-contents.is-compression-height.session-business-manager.session-name.show-compression-icon.show-history-icon.show-more-icon.show-new-chat-icon.title.onAutoGenerateName.onClose.onHelpClick.onHistoryClick.onHistorySessionDelete.onHistorySessionRename.onHistorySessionSwitch.onNewChat.onRename.onShare.onToggleCompression".split("."))),
|
|
3688
3702
|
createCommentVNode(" ChatBot 核心组件(仅聊天区域) "),
|
|
3689
3703
|
createVNode(chat_bot_default, {
|
|
3690
3704
|
ref_key: "chatBotRef",
|
|
@@ -3694,10 +3708,10 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3694
3708
|
"hello-text": u.helloText,
|
|
3695
3709
|
"message-tools-tippy-options": unref(gt),
|
|
3696
3710
|
placeholder: u.placeholder,
|
|
3697
|
-
prompts: unref(
|
|
3711
|
+
prompts: unref(vt),
|
|
3698
3712
|
"request-options": u.requestOptions,
|
|
3699
3713
|
"resize-props": u.resizeProps,
|
|
3700
|
-
resources: unref(
|
|
3714
|
+
resources: unref(_t),
|
|
3701
3715
|
"session-code": u.initialSessionCode,
|
|
3702
3716
|
"share-loading": unref(un),
|
|
3703
3717
|
shortcuts: u.shortcuts,
|
|
@@ -3705,7 +3719,7 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3705
3719
|
url: unref(q),
|
|
3706
3720
|
onCancelShare: unref(fn),
|
|
3707
3721
|
onConfirmShare: r[0] ||= (e) => unref(pn)(e),
|
|
3708
|
-
onError: r[1] ||= (e) => unref(
|
|
3722
|
+
onError: r[1] ||= (e) => unref(bt)(e),
|
|
3709
3723
|
onExecutionPanelChange: unref(Mt),
|
|
3710
3724
|
onReceiveEnd: unref(It),
|
|
3711
3725
|
onReceiveStart: unref(Pt),
|
|
@@ -3796,5 +3810,5 @@ var _hoisted_1$1 = { class: "draggable-container-content" }, draggable_container
|
|
|
3796
3810
|
])) : createCommentVNode("v-if", !0)
|
|
3797
3811
|
], 2)], 8, ["to"]));
|
|
3798
3812
|
}
|
|
3799
|
-
}), [["__scopeId", "data-v-
|
|
3813
|
+
}), [["__scopeId", "data-v-7e675400"]]);
|
|
3800
3814
|
export { AGUIProtocol, ai_blueking_default as AIBlueking, ai_blueking_default as default, BluekingProtocol, BootstrapPhase, chat_bot_default as ChatBot, ChatBusinessManager, ComponentManager, draggable_container_default as DraggableContainer, MessageContentType, SessionBusinessManager, ShortcutManager, UIStateManager, createBluekingProtocol, createComponentManager, defaultProps, useChatBootstrap, useChatHelper, useDraggable };
|