@ibiz-template-plugin/ai-chat 0.0.78 → 0.0.79
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/index.es.js
CHANGED
|
@@ -19617,24 +19617,23 @@ const mc = new B("chat-editor"), of = ({
|
|
|
19617
19617
|
onKeyDown: s
|
|
19618
19618
|
}) => {
|
|
19619
19619
|
const o = F(null), a = F(null);
|
|
19620
|
-
|
|
19621
|
-
R(() => {
|
|
19620
|
+
return R(() => {
|
|
19622
19621
|
if (!a.current)
|
|
19623
19622
|
return;
|
|
19624
|
-
const
|
|
19625
|
-
const
|
|
19623
|
+
const l = async (u) => {
|
|
19624
|
+
const d = await n.opts.uploader.onUpload(u, () => {
|
|
19626
19625
|
}, {
|
|
19627
19626
|
context: n.context,
|
|
19628
19627
|
params: n.params
|
|
19629
19628
|
});
|
|
19630
|
-
if (!
|
|
19629
|
+
if (!d)
|
|
19631
19630
|
return { name: "", url: "" };
|
|
19632
|
-
const
|
|
19631
|
+
const h = n.opts.uploader.getDownLoadUrl(d, {
|
|
19633
19632
|
context: n.context,
|
|
19634
19633
|
params: n.params
|
|
19635
19634
|
});
|
|
19636
|
-
return { name:
|
|
19637
|
-
},
|
|
19635
|
+
return { name: d.name, url: h };
|
|
19636
|
+
}, c = new p8({
|
|
19638
19637
|
element: a.current,
|
|
19639
19638
|
extensions: [
|
|
19640
19639
|
N8,
|
|
@@ -19642,12 +19641,12 @@ const mc = new B("chat-editor"), of = ({
|
|
|
19642
19641
|
addKeyboardShortcuts() {
|
|
19643
19642
|
return {
|
|
19644
19643
|
"Mod-Enter": () => {
|
|
19645
|
-
var
|
|
19646
|
-
return (
|
|
19644
|
+
var u, d;
|
|
19645
|
+
return (u = o.current) == null || u.commands.enter(), (d = o.current) == null || d.commands.scrollIntoView(), !0;
|
|
19647
19646
|
},
|
|
19648
19647
|
"Shift-Enter": () => {
|
|
19649
|
-
var
|
|
19650
|
-
return (
|
|
19648
|
+
var u, d;
|
|
19649
|
+
return (u = o.current) == null || u.commands.enter(), (d = o.current) == null || d.commands.scrollIntoView(), !0;
|
|
19651
19650
|
}
|
|
19652
19651
|
};
|
|
19653
19652
|
}
|
|
@@ -19664,36 +19663,36 @@ const mc = new B("chat-editor"), of = ({
|
|
|
19664
19663
|
draggable: !1
|
|
19665
19664
|
}),
|
|
19666
19665
|
iy.configure({
|
|
19667
|
-
onDrop: async (
|
|
19668
|
-
if (
|
|
19666
|
+
onDrop: async (u, d) => {
|
|
19667
|
+
if (d = d.filter((f) => f.type.startsWith("image/")), !d.length)
|
|
19669
19668
|
return;
|
|
19670
|
-
const
|
|
19671
|
-
|
|
19669
|
+
const h = await Promise.all(
|
|
19670
|
+
d.map((f) => l(f))
|
|
19672
19671
|
);
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19672
|
+
u.isDestroyed || u.chain().deleteSelection().insertContentAt(
|
|
19673
|
+
u.state.selection.from,
|
|
19674
|
+
h.map((f) => ({
|
|
19676
19675
|
type: "image",
|
|
19677
19676
|
attrs: {
|
|
19678
|
-
src:
|
|
19679
|
-
alt:
|
|
19677
|
+
src: f.url,
|
|
19678
|
+
alt: f.name
|
|
19680
19679
|
}
|
|
19681
19680
|
}))
|
|
19682
19681
|
).focus().scrollIntoView().run();
|
|
19683
19682
|
},
|
|
19684
|
-
onPaste: async (
|
|
19685
|
-
if (
|
|
19683
|
+
onPaste: async (u, d) => {
|
|
19684
|
+
if (d = d.filter((f) => f.type.startsWith("image/")), !d.length)
|
|
19686
19685
|
return;
|
|
19687
|
-
const
|
|
19688
|
-
|
|
19686
|
+
const h = await Promise.all(
|
|
19687
|
+
d.map((f) => l(f))
|
|
19689
19688
|
);
|
|
19690
|
-
|
|
19691
|
-
|
|
19692
|
-
|
|
19689
|
+
u.isDestroyed || u.chain().deleteSelection().insertContentAt(
|
|
19690
|
+
u.state.selection.from,
|
|
19691
|
+
h.map((f) => ({
|
|
19693
19692
|
type: "image",
|
|
19694
19693
|
attrs: {
|
|
19695
|
-
src:
|
|
19696
|
-
alt:
|
|
19694
|
+
src: f.url,
|
|
19695
|
+
alt: f.name
|
|
19697
19696
|
}
|
|
19698
19697
|
}))
|
|
19699
19698
|
).focus().scrollIntoView().run();
|
|
@@ -19702,32 +19701,19 @@ const mc = new B("chat-editor"), of = ({
|
|
|
19702
19701
|
],
|
|
19703
19702
|
content: e || "",
|
|
19704
19703
|
editorProps: {
|
|
19705
|
-
handleKeyDown: (
|
|
19704
|
+
handleKeyDown: (u, d) => s(d)
|
|
19706
19705
|
},
|
|
19707
19706
|
onUpdate: () => {
|
|
19708
|
-
r(
|
|
19707
|
+
r(c.getHTML());
|
|
19709
19708
|
},
|
|
19710
19709
|
onCreate: () => {
|
|
19711
|
-
i(
|
|
19710
|
+
i(c);
|
|
19712
19711
|
}
|
|
19713
19712
|
});
|
|
19714
|
-
return o.current =
|
|
19713
|
+
return o.current = c, () => {
|
|
19715
19714
|
o.current && (o.current.destroy(), o.current = null);
|
|
19716
19715
|
};
|
|
19717
|
-
}, []);
|
|
19718
|
-
const c = () => {
|
|
19719
|
-
l = !0;
|
|
19720
|
-
}, u = () => {
|
|
19721
|
-
l = !1;
|
|
19722
|
-
};
|
|
19723
|
-
return /* @__PURE__ */ p("div", { className: "".concat(mc.b(), " ").concat(t ? mc.m("disabled") : ""), children: /* @__PURE__ */ p(
|
|
19724
|
-
"div",
|
|
19725
|
-
{
|
|
19726
|
-
ref: a,
|
|
19727
|
-
onCompositionStart: c,
|
|
19728
|
-
onCompositionEnd: u
|
|
19729
|
-
}
|
|
19730
|
-
) });
|
|
19716
|
+
}, []), /* @__PURE__ */ p("div", { className: "".concat(mc.b(), " ").concat(t ? mc.m("disabled") : ""), children: /* @__PURE__ */ p("div", { ref: a }) });
|
|
19731
19717
|
}, ie = new B("user-message-question"), ry = (n) => {
|
|
19732
19718
|
const e = Ne(), t = $(null), i = $(135), r = $(!0), s = $(!1), o = F(null), a = Oe(() => an.parseMixedContent(n.message.content), [n.message.content]), l = $({
|
|
19733
19719
|
resources: [],
|
|
@@ -19752,6 +19738,7 @@ const mc = new B("chat-editor"), of = ({
|
|
|
19752
19738
|
syntax: {
|
|
19753
19739
|
table: {
|
|
19754
19740
|
enableChart: !1,
|
|
19741
|
+
// @ts-ignore
|
|
19755
19742
|
externals: ["echarts"]
|
|
19756
19743
|
}
|
|
19757
19744
|
}
|
|
@@ -19780,8 +19767,8 @@ const mc = new B("chat-editor"), of = ({
|
|
|
19780
19767
|
b.stopPropagation(), n.controller.reEditCancel(n.message);
|
|
19781
19768
|
}, y = (b) => {
|
|
19782
19769
|
n.controller.reEditContentChanged.value && (b.stopPropagation(), n.controller.reEditSubmit(n.message));
|
|
19783
|
-
}, g = (b
|
|
19784
|
-
b.code === "Enter" &&
|
|
19770
|
+
}, g = (b) => {
|
|
19771
|
+
b.code === "Enter" && b.key === "Enter" && n.controller.reEditContentChanged.value && b.shiftKey === !1 && setTimeout(() => {
|
|
19785
19772
|
n.controller.reEditSubmit(n.message);
|
|
19786
19773
|
}, 0);
|
|
19787
19774
|
};
|
|
@@ -19815,8 +19802,8 @@ const mc = new B("chat-editor"), of = ({
|
|
|
19815
19802
|
onChange: (b) => {
|
|
19816
19803
|
m(b);
|
|
19817
19804
|
},
|
|
19818
|
-
onKeyDown: (b
|
|
19819
|
-
g(b
|
|
19805
|
+
onKeyDown: (b) => {
|
|
19806
|
+
g(b);
|
|
19820
19807
|
}
|
|
19821
19808
|
}
|
|
19822
19809
|
),
|
|
@@ -23209,8 +23196,8 @@ const G = new B("chat-input"), xc = window.SpeechRecognition || window.webkitSpe
|
|
|
23209
23196
|
} catch (w) {
|
|
23210
23197
|
console.error(w);
|
|
23211
23198
|
}
|
|
23212
|
-
}, [i]), d = (w
|
|
23213
|
-
if (w.code === "Enter" &&
|
|
23199
|
+
}, [i]), d = (w) => {
|
|
23200
|
+
if (w.code === "Enter" && w.key === "Enter" && w.shiftKey === !1)
|
|
23214
23201
|
return c(), !0;
|
|
23215
23202
|
}, h = async (w) => {
|
|
23216
23203
|
await kc.getMaterialHelper(
|