@blueking/chat-x 0.0.1-beta.10 → 0.0.1-beta.12
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/components/ai-buttons/file-upload-btn/file-upload-btn.vue.d.ts +1 -0
- package/dist/components/ai-buttons/tool-btn/tool-btn.vue.d.ts +1 -0
- package/dist/components/chat-content/reference-content/reference-content.vue.d.ts +1 -0
- package/dist/components/chat-input/input-attachment/input-attachment.vue.d.ts +1 -0
- package/dist/components/chat-message/message-container/message-container.vue.d.ts +23 -0
- package/dist/components/markdown-token/code-content/code-content.vue.d.ts +1 -0
- package/dist/components/message-tools/message-tools.vue.d.ts +1 -0
- package/dist/composables/use-container-scroll.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.js +57 -47
- package/dist/index.js.map +1 -1
- package/dist/types/shortcut.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2976,7 +2976,7 @@ var _hoisted_1$33 = ["src"], shortcut_btn_default = /* @__PURE__ */ defineCompon
|
|
|
2976
2976
|
class: normalizeClass(["ai-shortcut-btn", { "is-menu-mode": n.mode === "menu" }]),
|
|
2977
2977
|
onClick: i[0] || (i[0] = (e) => o(n.shortcut))
|
|
2978
2978
|
}, [renderSlot(r.$slots, "default", {}, () => {
|
|
2979
|
-
var r, i, a, o, f, p;
|
|
2979
|
+
var r, i, a, o, f, p, m;
|
|
2980
2980
|
return [(r = n.shortcut) != null && r.icon ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [typeof n.shortcut.icon == "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [n.shortcut.icon.startsWith("http") ? (openBlock(), createElementBlock("img", {
|
|
2981
2981
|
key: 0,
|
|
2982
2982
|
class: "ai-common-icon ai-shortcut-btn-icon",
|
|
@@ -2987,7 +2987,7 @@ var _hoisted_1$33 = ["src"], shortcut_btn_default = /* @__PURE__ */ defineCompon
|
|
|
2987
2987
|
}))], 64)) : n.shortcut && !((f = n.shortcut.components) != null && f.length) ? (openBlock(), createBlock(unref(AgentIcon), {
|
|
2988
2988
|
key: 1,
|
|
2989
2989
|
class: "ai-shortcut-btn-icon"
|
|
2990
|
-
})) : createCommentVNode("", !0), createTextVNode(" " + toDisplayString((p = n.shortcut) == null ? void 0 : p.name), 1)];
|
|
2990
|
+
})) : createCommentVNode("", !0), createTextVNode(" " + toDisplayString(((p = n.shortcut) == null ? void 0 : p.alias) || ((m = n.shortcut) == null ? void 0 : m.name)), 1)];
|
|
2991
2991
|
}), renderSlot(r.$slots, "append")], 2));
|
|
2992
2992
|
}
|
|
2993
2993
|
}), _hoisted_1$32 = { class: "ai-selection-popover-content" }, _hoisted_2$21 = {
|
|
@@ -3295,6 +3295,7 @@ function _objectWithoutProperties(e, n) {
|
|
|
3295
3295
|
var _excluded = ["options"], _excluded2 = ["options"], _hoisted_1$30 = { class: "shortcut-render" }, _hoisted_2$20 = { class: "shortcut-render-header" }, _hoisted_3$15 = { class: "header-name" }, _hoisted_4$13 = { class: "shortcut-render-content" }, _hoisted_5$10 = { class: "shortcut-footer" }, shortcut_render_default = /* @__PURE__ */ defineComponent({
|
|
3296
3296
|
__name: "shortcut-render",
|
|
3297
3297
|
props: {
|
|
3298
|
+
alias: {},
|
|
3298
3299
|
components: {},
|
|
3299
3300
|
description: {},
|
|
3300
3301
|
formModel: {},
|
|
@@ -3371,7 +3372,7 @@ var _excluded = ["options"], _excluded2 = ["options"], _hoisted_1$30 = { class:
|
|
|
3371
3372
|
};
|
|
3372
3373
|
return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$30, [createElementVNode("div", _hoisted_2$20, [
|
|
3373
3374
|
createVNode(unref(ThinkingIcon), { class: "header-icon" }),
|
|
3374
|
-
createElementVNode("span", _hoisted_3$15, toDisplayString(n.name), 1),
|
|
3375
|
+
createElementVNode("span", _hoisted_3$15, toDisplayString(n.alias || n.name), 1),
|
|
3375
3376
|
createVNode(unref(CloseIcon), {
|
|
3376
3377
|
class: "header-close",
|
|
3377
3378
|
onClick: x
|
|
@@ -3612,49 +3613,53 @@ const useClipboard = () => ({ copy: function() {
|
|
|
3612
3613
|
}
|
|
3613
3614
|
};
|
|
3614
3615
|
}, CONTAINER_SCROLL_TOKEN = Symbol("CONTAINER_SCROLL_TOKEN"), useContainerScrollProvider = (e, n) => {
|
|
3615
|
-
let r = shallowRef(!1), i = null, o = shallowRef(0);
|
|
3616
|
+
let r = shallowRef(!1), i = null, o = shallowRef(0), s = shallowRef(!0);
|
|
3616
3617
|
provide(CONTAINER_SCROLL_TOKEN, computed(() => ({
|
|
3618
|
+
autoScrollEnabled: s.value,
|
|
3617
3619
|
isScrollBottom: r,
|
|
3618
3620
|
scrollBottomHeight: o,
|
|
3619
|
-
toScrollBottom:
|
|
3620
|
-
toScrollTop:
|
|
3621
|
+
toScrollBottom: c,
|
|
3622
|
+
toScrollTop: l
|
|
3621
3623
|
})));
|
|
3622
|
-
let
|
|
3624
|
+
let c = () => {
|
|
3623
3625
|
var e;
|
|
3624
|
-
(e = toValue(n)) == null || e.scrollIntoView({
|
|
3626
|
+
s.value = !0, (e = toValue(n)) == null || e.scrollIntoView({
|
|
3625
3627
|
behavior: "smooth",
|
|
3626
3628
|
block: "end"
|
|
3627
3629
|
});
|
|
3628
|
-
},
|
|
3630
|
+
}, l = () => {
|
|
3629
3631
|
var n;
|
|
3630
3632
|
(n = toValue(e)) == null || n.scrollTo({
|
|
3631
3633
|
top: 0,
|
|
3632
3634
|
behavior: "smooth"
|
|
3633
3635
|
});
|
|
3634
|
-
},
|
|
3636
|
+
}, u = () => {
|
|
3635
3637
|
let n = toValue(e);
|
|
3636
3638
|
if (!n) return;
|
|
3637
3639
|
let { scrollHeight: r, scrollTop: i, clientHeight: a } = n, s = r - i - a;
|
|
3638
3640
|
o.value = Math.max(0, s);
|
|
3641
|
+
}, d = (e) => {
|
|
3642
|
+
e.deltaY < 0 && (s.value = !1);
|
|
3639
3643
|
};
|
|
3640
3644
|
return onMounted(() => {
|
|
3641
3645
|
watchEffect(() => {
|
|
3642
|
-
let a = toValue(e),
|
|
3643
|
-
!a || !
|
|
3646
|
+
let a = toValue(e), c = toValue(n);
|
|
3647
|
+
!a || !c || (i == null || i.disconnect(), a.removeEventListener("scroll", u), a.removeEventListener("wheel", d), u(), i = new IntersectionObserver((e) => {
|
|
3644
3648
|
e.forEach((e) => {
|
|
3645
|
-
e.isIntersecting ? (r.value = !0, o.value = 0) : (r.value = !1,
|
|
3649
|
+
e.isIntersecting ? (r.value = !0, o.value = 0, s.value = !0) : (r.value = !1, u());
|
|
3646
3650
|
});
|
|
3647
|
-
}), i.observe(
|
|
3651
|
+
}), i.observe(c), a.addEventListener("scroll", u, { passive: !0 }), a.addEventListener("wheel", d, { passive: !0 }));
|
|
3648
3652
|
});
|
|
3649
3653
|
}), onScopeDispose(() => {
|
|
3650
3654
|
i == null || i.disconnect();
|
|
3651
3655
|
let n = toValue(e);
|
|
3652
|
-
n && n.removeEventListener("scroll",
|
|
3656
|
+
n && (n.removeEventListener("scroll", u), n.removeEventListener("wheel", d));
|
|
3653
3657
|
}), {
|
|
3658
|
+
autoScrollEnabled: s,
|
|
3654
3659
|
isScrollBottom: r,
|
|
3655
3660
|
scrollBottomHeight: o,
|
|
3656
|
-
toScrollBottom:
|
|
3657
|
-
toScrollTop:
|
|
3661
|
+
toScrollBottom: c,
|
|
3662
|
+
toScrollTop: l
|
|
3658
3663
|
};
|
|
3659
3664
|
}, useContainerScrollConsumer = () => inject(CONTAINER_SCROLL_TOKEN), MESSAGE_SLOT_ID = "ai-blueking-message-slot", AI_BLUEKING_MESSAGE_SLOT_ID = Symbol(MESSAGE_SLOT_ID), getMessageSlotId = () => inject(AI_BLUEKING_MESSAGE_SLOT_ID), useGlobalConfig = () => {
|
|
3660
3665
|
let e = computed(() => `#${MESSAGE_SLOT_ID}`);
|
|
@@ -6817,15 +6822,12 @@ var _hoisted_1$29 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
|
|
|
6817
6822
|
onClick: c
|
|
6818
6823
|
}, [e.id in unref(ToolIconsMap) ? (openBlock(), createBlock(resolveDynamicComponent(unref(ToolIconsMap)[e.id]), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1$29, toDisplayString(e.name), 1))], 2)), [[unref(directive), o.value]]);
|
|
6819
6824
|
}
|
|
6820
|
-
}), _hoisted_1$28 = { class: "code-content-wrapper" }, _hoisted_2$19 = { class: "code-content-header" }, _hoisted_3$14 = { class: "code-header-language" }, _hoisted_4$12 = { class: "hljs-pre" }, _hoisted_5$9 = ["innerHTML"], _hoisted_6$4 = {
|
|
6821
|
-
key: 0,
|
|
6822
|
-
class: "code-line current-line"
|
|
6823
|
-
}, MAX_CACHE_SIZE = 500, code_content_default = /* @__PURE__ */ defineComponent({
|
|
6825
|
+
}), _hoisted_1$28 = { class: "code-content-wrapper" }, _hoisted_2$19 = { class: "code-content-header" }, _hoisted_3$14 = { class: "code-header-language" }, _hoisted_4$12 = { class: "hljs-pre" }, _hoisted_5$9 = ["innerHTML"], _hoisted_6$4 = ["innerHTML"], MAX_CACHE_SIZE = 500, code_content_default = /* @__PURE__ */ defineComponent({
|
|
6824
6826
|
__name: "code-content",
|
|
6825
6827
|
props: { token: {} },
|
|
6826
6828
|
emits: ["mounted"],
|
|
6827
6829
|
setup(n, { emit: r }) {
|
|
6828
|
-
let i = n, o = r, s = useTemplateRef("codeRef"), p = shallowRef(""), { copy: m } = useClipboard(), g = shallowRef([]), _ = shallowRef(""), v = /* @__PURE__ */ new Map(),
|
|
6830
|
+
let i = n, o = r, s = useTemplateRef("codeRef"), p = shallowRef(""), { copy: m } = useClipboard(), g = shallowRef([]), _ = shallowRef(""), v = shallowRef(""), y = /* @__PURE__ */ new Map(), b = (e) => {
|
|
6829
6831
|
for (let r of e) if (r.type === "fence" || r.type === "code_block") {
|
|
6830
6832
|
var n;
|
|
6831
6833
|
return {
|
|
@@ -6838,16 +6840,18 @@ var _hoisted_1$29 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
|
|
|
6838
6840
|
language: ""
|
|
6839
6841
|
};
|
|
6840
6842
|
}, x = (e) => {
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6843
|
+
var n;
|
|
6844
|
+
let r = MarkdownLanguageMap[e] || e;
|
|
6845
|
+
if (hljs.getLanguage(r)) return r;
|
|
6846
|
+
let i = (n = e.match(/\.\w+$/)) == null ? void 0 : n[0];
|
|
6847
|
+
if (i) {
|
|
6848
|
+
let e = i.slice(1);
|
|
6849
|
+
if (hljs.getLanguage(e)) return e;
|
|
6846
6850
|
}
|
|
6847
|
-
return
|
|
6851
|
+
return null;
|
|
6848
6852
|
}, S = (e, n) => {
|
|
6849
6853
|
if (!e) return "";
|
|
6850
|
-
let r = `${n || ""}:${e}`, i =
|
|
6854
|
+
let r = `${n || ""}:${e}`, i = y.get(r);
|
|
6851
6855
|
if (i !== void 0) return i;
|
|
6852
6856
|
let a;
|
|
6853
6857
|
if (n) try {
|
|
@@ -6859,13 +6863,15 @@ var _hoisted_1$29 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
|
|
|
6859
6863
|
a = C(e);
|
|
6860
6864
|
}
|
|
6861
6865
|
else a = C(e);
|
|
6862
|
-
return
|
|
6866
|
+
return y.set(r, a), y.size > MAX_CACHE_SIZE && Array.from(y.keys()).slice(0, Math.floor(MAX_CACHE_SIZE / 2)).forEach((e) => y.delete(e)), a;
|
|
6863
6867
|
}, C = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), w = (e, n) => {
|
|
6864
6868
|
var r;
|
|
6865
6869
|
let i = x(n), a = e.split("\n");
|
|
6866
6870
|
if (a.length === 1) {
|
|
6867
6871
|
var o;
|
|
6868
|
-
g.value = []
|
|
6872
|
+
g.value = [];
|
|
6873
|
+
let e = (o = a[0]) == null ? "" : o;
|
|
6874
|
+
_.value = e, v.value = e ? S(e, i) : "";
|
|
6869
6875
|
return;
|
|
6870
6876
|
}
|
|
6871
6877
|
let s = a.slice(0, -1), c = (r = a[a.length - 1]) == null ? "" : r, l = g.value, u = [];
|
|
@@ -6877,14 +6883,8 @@ var _hoisted_1$29 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
|
|
|
6877
6883
|
html: S(n, i)
|
|
6878
6884
|
});
|
|
6879
6885
|
}
|
|
6880
|
-
g.value = u, _.value = c,
|
|
6881
|
-
}, D = () => {
|
|
6882
|
-
y !== null && cancelAnimationFrame(y), y = requestAnimationFrame(() => {
|
|
6883
|
-
y = requestAnimationFrame(() => {
|
|
6884
|
-
y = null;
|
|
6885
|
-
});
|
|
6886
|
-
});
|
|
6887
|
-
}, O = computed(() => {
|
|
6886
|
+
g.value = u, _.value = c, v.value = c ? S(c, i) : "";
|
|
6887
|
+
}, D = computed(() => {
|
|
6888
6888
|
let { language: e } = b(i.token), n = ["hljs"];
|
|
6889
6889
|
return e && n.push(`language-${e}`), n.join(" ");
|
|
6890
6890
|
});
|
|
@@ -6899,7 +6899,7 @@ var _hoisted_1$29 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
|
|
|
6899
6899
|
immediate: !0,
|
|
6900
6900
|
deep: !0
|
|
6901
6901
|
});
|
|
6902
|
-
let
|
|
6902
|
+
let O = () => {
|
|
6903
6903
|
var e;
|
|
6904
6904
|
let n = (e = s.value) == null ? void 0 : e.innerText;
|
|
6905
6905
|
n && m(n);
|
|
@@ -6908,15 +6908,19 @@ var _hoisted_1$29 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
|
|
|
6908
6908
|
id: "copy",
|
|
6909
6909
|
description: "复制",
|
|
6910
6910
|
name: "复制",
|
|
6911
|
-
onClick:
|
|
6911
|
+
onClick: O
|
|
6912
6912
|
})]), createElementVNode("pre", _hoisted_4$12, [createElementVNode("code", {
|
|
6913
6913
|
ref_key: "codeRef",
|
|
6914
6914
|
ref: s,
|
|
6915
|
-
class: normalizeClass(
|
|
6915
|
+
class: normalizeClass(D.value)
|
|
6916
6916
|
}, [(openBlock(!0), createElementBlock(Fragment, null, renderList(g.value, (n, i) => (openBlock(), createElementBlock(Fragment, { key: `completed-${i}` }, [createElementVNode("span", {
|
|
6917
6917
|
class: "code-line",
|
|
6918
6918
|
innerHTML: n.html
|
|
6919
|
-
}, null, 8, _hoisted_5$9), r[0] || (r[0] = createTextVNode(toDisplayString("\n"), -1))], 64))), 128)), _.value ? (openBlock(), createElementBlock("span",
|
|
6919
|
+
}, null, 8, _hoisted_5$9), r[0] || (r[0] = createTextVNode(toDisplayString("\n"), -1))], 64))), 128)), _.value ? (openBlock(), createElementBlock("span", {
|
|
6920
|
+
key: 0,
|
|
6921
|
+
class: "code-line current-line",
|
|
6922
|
+
innerHTML: v.value
|
|
6923
|
+
}, null, 8, _hoisted_6$4)) : createCommentVNode("", !0)], 2)])]));
|
|
6920
6924
|
}
|
|
6921
6925
|
}), import_debounce = /* @__PURE__ */ __toESM(require_debounce()), _hoisted_1$27 = { class: "md-image-wrapper" }, _hoisted_2$18 = {
|
|
6922
6926
|
key: 0,
|
|
@@ -7528,8 +7532,11 @@ var vnode_renderer_default = defineComponent({
|
|
|
7528
7532
|
trailing: !0
|
|
7529
7533
|
}), { immediate: !0 });
|
|
7530
7534
|
let g = (0, import_throttle.default)(() => {
|
|
7531
|
-
var e
|
|
7532
|
-
a == null || (e = a.value) == null
|
|
7535
|
+
var e;
|
|
7536
|
+
if ((a == null || (e = a.value) == null ? void 0 : e.autoScrollEnabled) !== !1) {
|
|
7537
|
+
var n, r;
|
|
7538
|
+
a == null || (n = a.value) == null || (r = n.toScrollBottom) == null || r.call(n);
|
|
7539
|
+
}
|
|
7533
7540
|
}, 100, {
|
|
7534
7541
|
leading: !0,
|
|
7535
7542
|
trailing: !0
|
|
@@ -10715,7 +10722,10 @@ var _hoisted_1$17 = { class: "ai-slash-input-wrapper" }, _hoisted_2$12 = ["aria-
|
|
|
10715
10722
|
class: "ai-activity-message-title",
|
|
10716
10723
|
onClick: a[0] || (a[0] = (e) => o.value = !o.value)
|
|
10717
10724
|
}, [
|
|
10718
|
-
createElementVNode("span", _hoisted_2$7, [r.value
|
|
10725
|
+
createElementVNode("span", _hoisted_2$7, [r.value && (e.status === unref(MessageStatus).Pending || e.status === unref(MessageStatus).Streaming) ? (openBlock(), createBlock(ai_loading_default, { key: 0 })) : (openBlock(), createBlock(unref(DocumentIcon), {
|
|
10726
|
+
key: 1,
|
|
10727
|
+
style: { "font-size": "12px" }
|
|
10728
|
+
}))]),
|
|
10719
10729
|
createElementVNode("span", _hoisted_3$6, toDisplayString(i.value), 1),
|
|
10720
10730
|
createElementVNode("span", { class: normalizeClass(["ai-activity-message-title-icon collapsed-icon", { "is-collapsed": o.value }]) }, [createVNode(unref(CollapsedIcon))], 2)
|
|
10721
10731
|
]), withDirectives(createElementVNode("div", _hoisted_4$4, [r.value ? (openBlock(), createElementBlock("div", _hoisted_5$3, [createVNode(markdown_content_default, { content: Array.isArray(e.content) ? e.content.join("\n") : ((d = e.content) == null ? void 0 : d.content) || "" }, null, 8, ["content"])])) : createCommentVNode("", !0), createVNode(reference_content_default, { content: Array.isArray(e.content) ? e.content : ((p = e.content) == null ? void 0 : p.referenceDocument) || [] }, null, 8, ["content"])], 512), [[vShow, !o.value]])]);
|
|
@@ -11165,7 +11175,7 @@ var _hoisted_1$17 = { class: "ai-slash-input-wrapper" }, _hoisted_2$12 = ["aria-
|
|
|
11165
11175
|
props: /* @__PURE__ */ mergeModels({
|
|
11166
11176
|
enableSelection: {
|
|
11167
11177
|
type: Boolean,
|
|
11168
|
-
default: !
|
|
11178
|
+
default: !1
|
|
11169
11179
|
},
|
|
11170
11180
|
messages: {},
|
|
11171
11181
|
messageStatus: {},
|