@8wave/ai-elements 0.125.0-beta.32 → 0.125.0-beta.33
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/_chunks/{PkChatbotFilePreview-CqxtVySb.js → PkChatbotFilePreview-DsRAk1js.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-CqxtVySb.js.map → PkChatbotFilePreview-DsRAk1js.js.map} +1 -1
- package/dist/_chunks/PkImageEditorDialog-BQwM06kT.js +939 -0
- package/dist/_chunks/PkImageEditorDialog-BQwM06kT.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-BqDooeUU.js → PkStreamingMarkdown-CjL7l_3E.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-BqDooeUU.js.map → PkStreamingMarkdown-CjL7l_3E.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-DpStX3wS.js → PkToolChatFile-weptM8iA.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-DpStX3wS.js.map → PkToolChatFile-weptM8iA.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-BvHklbzb.js → PkToolShareDocument-D5K3uJ2x.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-BvHklbzb.js.map → PkToolShareDocument-D5K3uJ2x.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-YPwJLLlW.js → PkToolShowArtifact-Bm2zS5YS.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-YPwJLLlW.js.map → PkToolShowArtifact-Bm2zS5YS.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-CTc1mbA8.js → PkToolShowContactForm-BKJCv5To.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-CTc1mbA8.js.map → PkToolShowContactForm-BKJCv5To.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-COt1Z3q9.js → PkToolShowDiagram-jpaEAi2X.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-COt1Z3q9.js.map → PkToolShowDiagram-jpaEAi2X.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DT5EyYVY.js → PkToolShowForm-DvAcJgDP.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-DT5EyYVY.js.map → PkToolShowForm-DvAcJgDP.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-DKrCrrB5.js → PkToolShowImageGallery-D0htuXNL.js} +4 -4
- package/dist/_chunks/{PkToolShowImageGallery-DKrCrrB5.js.map → PkToolShowImageGallery-D0htuXNL.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-CzSknPo6.js → PkToolShowSources-Cfj6iRGj.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-CzSknPo6.js.map → PkToolShowSources-Cfj6iRGj.js.map} +1 -1
- package/dist/_chunks/{useLightbox-D2Zi-Fpe.js → useLightbox-C54BCSbU.js} +130 -89
- package/dist/_chunks/useLightbox-C54BCSbU.js.map +1 -0
- package/dist/ai-elements.es.js +2774 -2721
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-g-mj6Luo.js → PkChatbot-Bc2hlwFO.js} +3 -3
- package/dist-vue/_chunks/{PkChatbot-g-mj6Luo.js.map → PkChatbot-Bc2hlwFO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DMPEj1Qa.js → PkChatbotEmptyState-NHarCaDm.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DMPEj1Qa.js.map → PkChatbotEmptyState-NHarCaDm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-j_8sDZUE.js → PkChatbotFilePreview-BIta8Yg-.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-j_8sDZUE.js.map → PkChatbotFilePreview-BIta8Yg-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-OBoyFkZ-.js → PkChatbotInput-BSzDRoDD.js} +192 -181
- package/dist-vue/_chunks/PkChatbotInput-BSzDRoDD.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-bPBOSAv7.js → PkChatbotMessages-DEMKZDCb.js} +17 -17
- package/dist-vue/_chunks/{PkChatbotMessages-bPBOSAv7.js.map → PkChatbotMessages-DEMKZDCb.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-pibgqxus.js → PkChatbotSteps-DGQoYxJ9.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotSteps-pibgqxus.js.map → PkChatbotSteps-DGQoYxJ9.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-C28g7dz-.js → PkChatbotViewChat-aKi08vCz.js} +440 -431
- package/dist-vue/_chunks/PkChatbotViewChat-aKi08vCz.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreview-BgyJngDt.js → PkFilePreview-D2HInDoA.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreview-BgyJngDt.js.map → PkFilePreview-D2HInDoA.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-B3-oF1_R.js → PkFilePreviewDialog-jxcUSzPx.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-B3-oF1_R.js.map → PkFilePreviewDialog-jxcUSzPx.js.map} +1 -1
- package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js +934 -0
- package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js.map +1 -0
- package/dist-vue/_chunks/{PkStreamingMarkdown-B3VWOaWb.js → PkStreamingMarkdown-DdOv86Eb.js} +11 -11
- package/dist-vue/_chunks/{PkStreamingMarkdown-B3VWOaWb.js.map → PkStreamingMarkdown-DdOv86Eb.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-BsdSOBpH.js → PkSvgViewer-vkd5Dluw.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-BsdSOBpH.js.map → PkSvgViewer-vkd5Dluw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-PXpiJLZ6.js → PkToolChatFile-8nx166iM.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-PXpiJLZ6.js.map → PkToolChatFile-8nx166iM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-cMUqik6v.js → PkToolShareDocument-CspvFwRR.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-cMUqik6v.js.map → PkToolShareDocument-CspvFwRR.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-DouCz_dZ.js → PkToolShowArtifact-BppP_xSN.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-DouCz_dZ.js.map → PkToolShowArtifact-BppP_xSN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BmiNlFfx.js → PkToolShowContactForm-Bm0icz24.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BmiNlFfx.js.map → PkToolShowContactForm-Bm0icz24.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-D6mYTDU-.js → PkToolShowDiagram-CgukB1Ss.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-D6mYTDU-.js.map → PkToolShowDiagram-CgukB1Ss.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CksTiimD.js → PkToolShowForm-CyyN7GQP.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowForm-CksTiimD.js.map → PkToolShowForm-CyyN7GQP.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-B-lVY0xH.js → PkToolShowImageGallery-zQF_lsxI.js} +5 -5
- package/dist-vue/_chunks/{PkToolShowImageGallery-B-lVY0xH.js.map → PkToolShowImageGallery-zQF_lsxI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-B8FE_Sqd.js → PkToolShowLocation-WdRqG8Wi.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowLocation-B8FE_Sqd.js.map → PkToolShowLocation-WdRqG8Wi.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-Dcq3Kdse.js → PkToolShowProductList-DW_P0gC2.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-Dcq3Kdse.js.map → PkToolShowProductList-DW_P0gC2.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DApWmwvk.js → PkToolShowSources-BugMybUx.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-DApWmwvk.js.map → PkToolShowSources-BugMybUx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CjrYh9-q.js → PkToolShowVideo-BW7aRKs_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CjrYh9-q.js.map → PkToolShowVideo-BW7aRKs_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-DSIAizw-.js → PkToolShowWebPages-DxKimT-2.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-DSIAizw-.js.map → PkToolShowWebPages-DxKimT-2.js.map} +1 -1
- package/dist-vue/_chunks/{useLightbox-FDyQrPWe.js → useLightbox-Ctl9zaMX.js} +132 -91
- package/dist-vue/_chunks/useLightbox-Ctl9zaMX.js.map +1 -0
- package/dist-vue/composables.js +36 -2
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +22 -22
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +34 -0
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +5 -0
- package/dist-vue/packages/components/src/chat/PkImageEditor.d.ts +11 -9
- package/dist-vue/packages/components/src/chat/PkImageEditorDialog.d.ts +12 -5
- package/dist-vue/packages/components/src/chat/imageEdits.d.ts +77 -1
- package/dist-vue/packages/components/src/composables/useLightbox.d.ts +26 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkImageEditorDialog-BMCnqiqI.js +0 -555
- package/dist/_chunks/PkImageEditorDialog-BMCnqiqI.js.map +0 -1
- package/dist/_chunks/useLightbox-D2Zi-Fpe.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-OBoyFkZ-.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-C28g7dz-.js.map +0 -1
- package/dist-vue/_chunks/PkImageEditorDialog-3L4URgPw.js +0 -550
- package/dist-vue/_chunks/PkImageEditorDialog-3L4URgPw.js.map +0 -1
- package/dist-vue/_chunks/useLightbox-FDyQrPWe.js.map +0 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { s as e } from "./Media-DylqhvaF.js";
|
|
2
2
|
import { t } from "./VvButtonLocalized-C-vx25u4.js";
|
|
3
|
-
import { t as n } from "./PkStreamingMarkdown-
|
|
3
|
+
import { t as n } from "./PkStreamingMarkdown-DdOv86Eb.js";
|
|
4
4
|
import { O as r } from "./utils-DXOZ6zjh.js";
|
|
5
|
-
import { t as i } from "./PkChatbotFilePreview-
|
|
5
|
+
import { t as i } from "./PkChatbotFilePreview-BIta8Yg-.js";
|
|
6
6
|
import { VvDropdown as a, VvDropdownAction as o, VvIcon as s } from "@volverjs/ui-vue/components";
|
|
7
|
-
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineAsyncComponent as g, defineComponent as _, mergeModels as v, mergeProps as ee, nextTick as y, normalizeClass as b, normalizeProps as te, onBeforeUnmount as ne, onMounted as re, openBlock as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, useId as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { useResizeObserver as
|
|
7
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineAsyncComponent as g, defineComponent as _, mergeModels as v, mergeProps as ee, nextTick as y, normalizeClass as b, normalizeProps as te, onBeforeUnmount as ne, onMounted as re, openBlock as x, ref as S, renderList as C, renderSlot as w, shallowRef as ie, toDisplayString as T, unref as E, useId as ae, useModel as oe, useTemplateRef as D, watch as O, withCtx as k, withKeys as se, withModifiers as ce } from "vue";
|
|
8
|
+
import { useI18n as le } from "vue-i18n";
|
|
9
|
+
import { useResizeObserver as ue } from "@vueuse/core";
|
|
10
10
|
// ../../node_modules/.pnpm/autosize@6.0.1/node_modules/autosize/dist/autosize.esm.js
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
var t =
|
|
11
|
+
var A = /* @__PURE__ */ new Map();
|
|
12
|
+
function de(e) {
|
|
13
|
+
var t = A.get(e);
|
|
14
14
|
t && t.destroy();
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
var t =
|
|
16
|
+
function j(e) {
|
|
17
|
+
var t = A.get(e);
|
|
18
18
|
t && t.update();
|
|
19
19
|
}
|
|
20
|
-
var
|
|
21
|
-
typeof window > "u" ? ((
|
|
20
|
+
var M = null;
|
|
21
|
+
typeof window > "u" ? ((M = function(e) {
|
|
22
22
|
return e;
|
|
23
23
|
}).destroy = function(e) {
|
|
24
24
|
return e;
|
|
25
|
-
},
|
|
25
|
+
}, M.update = function(e) {
|
|
26
26
|
return e;
|
|
27
|
-
}) : ((
|
|
27
|
+
}) : ((M = function(e, t) {
|
|
28
28
|
return e && Array.prototype.forEach.call(e.length ? e : [e], function(e) {
|
|
29
29
|
return function(e) {
|
|
30
|
-
if (e && e.nodeName && e.nodeName === "TEXTAREA" && !
|
|
30
|
+
if (e && e.nodeName && e.nodeName === "TEXTAREA" && !A.has(e)) {
|
|
31
31
|
var t, n = null, r = window.getComputedStyle(e), i = (t = e.value, function() {
|
|
32
32
|
o({
|
|
33
33
|
testForHeightReduction: t === "" || !e.value.startsWith(t),
|
|
@@ -36,7 +36,7 @@ typeof window > "u" ? ((N = function(e) {
|
|
|
36
36
|
}), a = function(t) {
|
|
37
37
|
e.removeEventListener("autosize:destroy", a), e.removeEventListener("autosize:update", s), e.removeEventListener("input", i), window.removeEventListener("resize", s), Object.keys(t).forEach(function(n) {
|
|
38
38
|
return e.style[n] = t[n];
|
|
39
|
-
}),
|
|
39
|
+
}), A.delete(e);
|
|
40
40
|
}.bind(e, {
|
|
41
41
|
height: e.style.height,
|
|
42
42
|
resize: e.style.resize,
|
|
@@ -45,7 +45,7 @@ typeof window > "u" ? ((N = function(e) {
|
|
|
45
45
|
overflowX: e.style.overflowX,
|
|
46
46
|
wordWrap: e.style.wordWrap
|
|
47
47
|
});
|
|
48
|
-
e.addEventListener("autosize:destroy", a), e.addEventListener("autosize:update", s), e.addEventListener("input", i), window.addEventListener("resize", s), e.style.overflowX = "hidden", e.style.wordWrap = "break-word",
|
|
48
|
+
e.addEventListener("autosize:destroy", a), e.addEventListener("autosize:update", s), e.addEventListener("input", i), window.addEventListener("resize", s), e.style.overflowX = "hidden", e.style.wordWrap = "break-word", A.set(e, {
|
|
49
49
|
destroy: a,
|
|
50
50
|
update: s
|
|
51
51
|
}), s();
|
|
@@ -77,14 +77,14 @@ typeof window > "u" ? ((N = function(e) {
|
|
|
77
77
|
}(e);
|
|
78
78
|
}), e;
|
|
79
79
|
}).destroy = function(e) {
|
|
80
|
-
return e && Array.prototype.forEach.call(e.length ? e : [e],
|
|
81
|
-
},
|
|
82
|
-
return e && Array.prototype.forEach.call(e.length ? e : [e],
|
|
80
|
+
return e && Array.prototype.forEach.call(e.length ? e : [e], de), e;
|
|
81
|
+
}, M.update = function(e) {
|
|
82
|
+
return e && Array.prototype.forEach.call(e.length ? e : [e], j), e;
|
|
83
83
|
});
|
|
84
|
-
var
|
|
84
|
+
var N = M, P = ["type"], F = {
|
|
85
85
|
key: 0,
|
|
86
86
|
class: "pk-chat-button__label"
|
|
87
|
-
},
|
|
87
|
+
}, I = /* @__PURE__ */ _({
|
|
88
88
|
__name: "PkChatButton",
|
|
89
89
|
props: {
|
|
90
90
|
icon: {},
|
|
@@ -101,33 +101,33 @@ var P = N, F = ["type"], I = {
|
|
|
101
101
|
}, [h(r, {
|
|
102
102
|
name: e.icon,
|
|
103
103
|
class: "pk-chat-button__icon"
|
|
104
|
-
}, null, 8, ["name"]), e.label ? (x(), f("span",
|
|
104
|
+
}, null, 8, ["name"]), e.label ? (x(), f("span", F, T(e.label), 1)) : d("", !0)], 10, P);
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
}),
|
|
107
|
+
}), fe = { class: "pk-chatbot-input" }, pe = {
|
|
108
108
|
key: 0,
|
|
109
109
|
class: "pk-chatbot-input__notice",
|
|
110
110
|
role: "status"
|
|
111
|
-
},
|
|
111
|
+
}, me = {
|
|
112
112
|
key: 2,
|
|
113
113
|
class: "pk-chatbot-input__notice-text"
|
|
114
|
-
},
|
|
114
|
+
}, he = ["title"], ge = {
|
|
115
115
|
key: 1,
|
|
116
116
|
class: "pk-chatbot-input__pointer"
|
|
117
|
-
},
|
|
117
|
+
}, _e = { class: "pk-chatbot-input__pointer-label" }, ve = {
|
|
118
118
|
key: 2,
|
|
119
119
|
class: "pk-chatbot-input__attachments"
|
|
120
|
-
},
|
|
120
|
+
}, ye = { class: "pk-chatbot-input__fieldset" }, be = [
|
|
121
121
|
"title",
|
|
122
122
|
"disabled",
|
|
123
123
|
"onClick"
|
|
124
|
-
],
|
|
124
|
+
], xe = ["accept"], Se = ["accept"], Ce = { class: "pk-chatbot-input__content" }, we = [
|
|
125
125
|
"value",
|
|
126
126
|
"aria-label",
|
|
127
127
|
"aria-describedby",
|
|
128
128
|
"aria-invalid",
|
|
129
129
|
"placeholder"
|
|
130
|
-
],
|
|
130
|
+
], Te = ["id"], Ee = { class: "opacity-60" }, L = /* @__PURE__ */ _({
|
|
131
131
|
__name: "PkChatbotInput",
|
|
132
132
|
props: /*@__PURE__*/ v({
|
|
133
133
|
placeholder: {},
|
|
@@ -169,100 +169,110 @@ var P = N, F = ["type"], I = {
|
|
|
169
169
|
"remove-pointer",
|
|
170
170
|
"manual-confirmations"
|
|
171
171
|
], ["update:modelValue", "update:pendingAttachments"]),
|
|
172
|
-
setup(_, { expose: v, emit:
|
|
173
|
-
let
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
|
|
172
|
+
setup(_, { expose: v, emit: A }) {
|
|
173
|
+
let de = g(() => import("./PkImageEditorDialog-Dn3HV_ny.js")), j = oe(_, "modelValue"), M = oe(_, "pendingAttachments"), P = A, F = _, { t: L } = le({ useScope: "global" }), R = D("textareaEl"), De = D("fileInputEl"), z = D("cameraInputEl"), B = D("formEl"), V = S(j.value ?? ""), H = null, U = () => {
|
|
174
|
+
H !== null && (clearTimeout(H), H = null);
|
|
175
|
+
}, Oe = () => {
|
|
176
|
+
U(), j.value = V.value;
|
|
177
|
+
}, ke = () => {
|
|
178
|
+
U(), H = setTimeout(() => {
|
|
179
|
+
j.value = V.value, H = null;
|
|
180
180
|
}, 300);
|
|
181
|
-
},
|
|
182
|
-
|
|
181
|
+
}, Ae = () => {
|
|
182
|
+
V.value = R.value?.value ?? "", ke();
|
|
183
183
|
};
|
|
184
|
-
|
|
185
|
-
e !==
|
|
186
|
-
|
|
184
|
+
O(j, (e) => {
|
|
185
|
+
e !== V.value && (V.value = e ?? "", y(() => {
|
|
186
|
+
R.value && N.update(R.value);
|
|
187
187
|
}));
|
|
188
188
|
});
|
|
189
|
-
let
|
|
190
|
-
let t =
|
|
189
|
+
let W = l(() => F.status === "streaming"), G = l(() => F.status === "submitted"), K = l(() => W.value || G.value), q = ae(), je = l(() => V.value.length), J = l(() => F.maxMessageLength !== void 0 && je.value > F.maxMessageLength), Me = l(() => M.value.some((e) => e.state === "uploading")), Ne = l(() => M.value.some((e) => e.state === "error")), Y = l(() => K.value && !F.queueEnabled || Me.value || Ne.value || J.value ? !1 : V.value.trim().length > 0), Pe = l(() => K.value && Y.value), Fe = "capture" in document.createElement("input"), Ie = l(() => {
|
|
190
|
+
let t = F.fileUpload?.allowedMimeTypes ?? [];
|
|
191
191
|
return [...t, ...e(t)].join(",");
|
|
192
|
-
}),
|
|
193
|
-
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
}, Re = (e) => {
|
|
197
|
-
for (let t of e) F("file-select", t);
|
|
198
|
-
}, ze = (e) => {
|
|
199
|
-
let t = e.target;
|
|
200
|
-
Re(Array.from(t.files ?? [])), t.value = "";
|
|
192
|
+
}), Le = l(() => (F.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), X = l(() => Fe && Le.value.length > 0), Re = () => {
|
|
193
|
+
De.value?.click();
|
|
194
|
+
}, ze = () => {
|
|
195
|
+
z.value?.click();
|
|
201
196
|
}, Be = (e) => {
|
|
202
|
-
let t
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
|
|
197
|
+
for (let t of e) P("file-select", t);
|
|
198
|
+
}, Ve = (e) => {
|
|
199
|
+
let t = e.target;
|
|
200
|
+
Be(Array.from(t.files ?? [])), t.value = "";
|
|
201
|
+
}, He = (e) => {
|
|
202
|
+
let t = M.value.find((t) => t.id === e);
|
|
203
|
+
t && (URL.revokeObjectURL(t.localUrl), M.value = M.value.filter((t) => t.id !== e), P("remove-attachment", t));
|
|
204
|
+
}, Z = S(), Q = l(() => M.value.find((e) => e.id === Z.value)), $ = ie(), Ue = l(() => Q.value?.file ?? $.value), We = (e) => !!F.editableImages && e.state !== "uploading" && r(e.file.type), Ge = () => {
|
|
205
|
+
Z.value = void 0, $.value = void 0;
|
|
206
|
+
}, Ke = async (e) => {
|
|
207
|
+
let t = Q.value, n = !t && !!$.value;
|
|
208
|
+
if (Ge(), t) P("replace-attachment", t, e);
|
|
209
|
+
else if (n) P("file-select", e);
|
|
210
|
+
else return;
|
|
211
|
+
await y(), R.value?.focus();
|
|
212
|
+
}, qe = S(!0), Je = () => {
|
|
213
|
+
qe.value = !1;
|
|
214
|
+
}, Ye = l(() => {
|
|
215
|
+
if (F.attachmentNotice) return [{
|
|
211
216
|
id: "limit",
|
|
212
217
|
icon: "ri:information-line",
|
|
213
|
-
text:
|
|
214
|
-
dismiss: () =>
|
|
218
|
+
text: F.attachmentNotice,
|
|
219
|
+
dismiss: () => P("dismiss-attachment-notice")
|
|
215
220
|
}];
|
|
216
221
|
let e = [];
|
|
217
|
-
|
|
222
|
+
Ne.value && e.push({
|
|
218
223
|
id: "upload-failed",
|
|
219
224
|
icon: "ri:error-warning-line",
|
|
220
|
-
text:
|
|
225
|
+
text: L("message.attachmentUploadFailed")
|
|
221
226
|
});
|
|
222
|
-
for (let t of
|
|
227
|
+
for (let t of F.answerNotices ?? []) e.push({
|
|
223
228
|
id: `answer-${t.id}`,
|
|
224
229
|
icon: "ri:chat-check-line",
|
|
225
230
|
text: t.text,
|
|
226
|
-
open: () =>
|
|
227
|
-
dismiss: () =>
|
|
231
|
+
open: () => P("open-answer-notice", t.id),
|
|
232
|
+
dismiss: () => P("dismiss-answer-notice", t.id)
|
|
228
233
|
});
|
|
229
|
-
return
|
|
234
|
+
return F.pageNotice && e.push({
|
|
230
235
|
id: "page",
|
|
231
236
|
icon: "ri:pages-line",
|
|
232
|
-
text:
|
|
233
|
-
dismiss: () =>
|
|
234
|
-
}),
|
|
237
|
+
text: F.pageNotice,
|
|
238
|
+
dismiss: () => P("dismiss-page-notice")
|
|
239
|
+
}), F.dismissableNotice && qe.value && e.push({
|
|
235
240
|
id: "dismissable",
|
|
236
|
-
markdown:
|
|
237
|
-
dismiss:
|
|
241
|
+
markdown: F.dismissableNotice,
|
|
242
|
+
dismiss: Je
|
|
238
243
|
}), e;
|
|
239
|
-
}),
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
}), Xe = () => {
|
|
245
|
+
B.value?.querySelector("button:focus-visible") && R.value?.focus();
|
|
246
|
+
}, Ze = () => {
|
|
247
|
+
Xe(), P("stop-generation");
|
|
248
|
+
}, Qe = () => {
|
|
249
|
+
Y.value && (Xe(), Oe(), P("submit"), V.value = "", j.value = "", y(() => {
|
|
250
|
+
R.value && (R.value.value = "", N.update(R.value));
|
|
246
251
|
}));
|
|
247
|
-
},
|
|
248
|
-
e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(),
|
|
252
|
+
}, $e = (e) => {
|
|
253
|
+
e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(), Qe());
|
|
249
254
|
};
|
|
250
255
|
re(() => {
|
|
251
|
-
|
|
256
|
+
R.value && N(R.value);
|
|
252
257
|
});
|
|
253
|
-
let
|
|
254
|
-
return
|
|
258
|
+
let et = 0;
|
|
259
|
+
return ue(R, ([e]) => {
|
|
255
260
|
let t = e?.contentRect.width ?? 0;
|
|
256
|
-
|
|
257
|
-
}),
|
|
258
|
-
await y(),
|
|
261
|
+
R.value && t !== et && (et = t, N.update(R.value));
|
|
262
|
+
}), O(() => F.placeholder, async () => {
|
|
263
|
+
await y(), R.value && N.update(R.value);
|
|
259
264
|
}), ne(() => {
|
|
260
|
-
|
|
261
|
-
for (let e of
|
|
262
|
-
}), v({
|
|
265
|
+
U(), R.value && N.destroy(R.value);
|
|
266
|
+
for (let e of M.value) URL.revokeObjectURL(e.localUrl);
|
|
267
|
+
}), v({
|
|
268
|
+
focus: () => R.value?.focus(),
|
|
269
|
+
annotateImage: (e) => {
|
|
270
|
+
Z.value = void 0, $.value = e;
|
|
271
|
+
}
|
|
272
|
+
}), (e, r) => {
|
|
263
273
|
let l = s, g = t, v = o, y = a;
|
|
264
|
-
return x(), f("div",
|
|
265
|
-
|
|
274
|
+
return x(), f("div", fe, [
|
|
275
|
+
Ye.value.length ? (x(), f("div", pe, [(x(!0), f(c, null, C(Ye.value, (e) => (x(), f("div", {
|
|
266
276
|
key: e.id,
|
|
267
277
|
class: "pk-chatbot-input__notice-item"
|
|
268
278
|
}, [
|
|
@@ -275,17 +285,17 @@ var P = N, F = ["type"], I = {
|
|
|
275
285
|
key: 1,
|
|
276
286
|
markdown: e.markdown,
|
|
277
287
|
class: "wysiwyg pk-chatbot-input__notice-text"
|
|
278
|
-
}, null, 8, ["markdown"])) : (x(), f("span",
|
|
288
|
+
}, null, 8, ["markdown"])) : (x(), f("span", me, T(e.text), 1)),
|
|
279
289
|
e.open ? (x(), u(g, {
|
|
280
290
|
key: 3,
|
|
281
|
-
label: E(
|
|
291
|
+
label: E(L)("action.open"),
|
|
282
292
|
modifiers: "link",
|
|
283
293
|
class: "pk-chatbot-input__notice-action",
|
|
284
294
|
onClick: (t) => e.open()
|
|
285
295
|
}, null, 8, ["label", "onClick"])) : d("", !0),
|
|
286
296
|
e.dismiss ? (x(), u(g, {
|
|
287
297
|
key: 4,
|
|
288
|
-
title: E(
|
|
298
|
+
title: E(L)("action.close"),
|
|
289
299
|
modifiers: "action-quiet",
|
|
290
300
|
icon: "ri:close-line",
|
|
291
301
|
class: "w-18 h-18",
|
|
@@ -294,42 +304,42 @@ var P = N, F = ["type"], I = {
|
|
|
294
304
|
]))), 128))])) : d("", !0),
|
|
295
305
|
p("form", {
|
|
296
306
|
ref_key: "formEl",
|
|
297
|
-
ref:
|
|
307
|
+
ref: B,
|
|
298
308
|
class: "pk-chatbot-input__form",
|
|
299
|
-
onSubmit:
|
|
309
|
+
onSubmit: ce(Qe, ["prevent"])
|
|
300
310
|
}, [
|
|
301
311
|
_.automaticConfirmations ? (x(), f("button", {
|
|
302
312
|
key: 0,
|
|
303
313
|
type: "button",
|
|
304
314
|
class: "pk-chatbot-input__mode",
|
|
305
|
-
title: E(
|
|
306
|
-
onClick: r[0] ||= (e) =>
|
|
315
|
+
title: E(L)("action.manualConfirmations"),
|
|
316
|
+
onClick: r[0] ||= (e) => P("manual-confirmations")
|
|
307
317
|
}, [
|
|
308
318
|
h(l, {
|
|
309
319
|
name: "ri:flashlight-line",
|
|
310
320
|
class: "pk-chatbot-input__pointer-icon"
|
|
311
321
|
}),
|
|
312
|
-
m(" " + T(E(
|
|
322
|
+
m(" " + T(E(L)("label.automaticConfirmations")) + " ", 1),
|
|
313
323
|
h(l, {
|
|
314
324
|
name: "ri:close-line",
|
|
315
325
|
class: "pk-chatbot-input__pointer-icon"
|
|
316
326
|
})
|
|
317
|
-
], 8,
|
|
318
|
-
_.pointer ? (x(), f("div",
|
|
327
|
+
], 8, he)) : d("", !0),
|
|
328
|
+
_.pointer ? (x(), f("div", ge, [
|
|
319
329
|
h(l, {
|
|
320
330
|
name: _.pointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
|
|
321
331
|
class: "pk-chatbot-input__pointer-icon"
|
|
322
332
|
}, null, 8, ["name"]),
|
|
323
|
-
p("span",
|
|
333
|
+
p("span", _e, T(_.pointer.kind === "text" ? `«${_.pointer.label}»` : _.pointer.label), 1),
|
|
324
334
|
h(g, {
|
|
325
|
-
title: E(
|
|
335
|
+
title: E(L)("pagePointer.remove"),
|
|
326
336
|
modifiers: "action-quiet",
|
|
327
337
|
icon: "ri:close-line",
|
|
328
338
|
class: "w-18 h-18",
|
|
329
|
-
onClick: r[1] ||= (e) =>
|
|
339
|
+
onClick: r[1] ||= (e) => P("remove-pointer")
|
|
330
340
|
}, null, 8, ["title"])
|
|
331
341
|
])) : d("", !0),
|
|
332
|
-
|
|
342
|
+
M.value.length ? (x(), f("div", ve, [(x(!0), f(c, null, C(M.value, (e) => (x(), u(i, {
|
|
333
343
|
key: e.id,
|
|
334
344
|
"media-type": e.mediaSource?.mimeType ?? e.file.type,
|
|
335
345
|
url: e.localUrl,
|
|
@@ -338,12 +348,12 @@ var P = N, F = ["type"], I = {
|
|
|
338
348
|
loading: e.state === "uploading",
|
|
339
349
|
error: e.state === "error" ? e.error : void 0,
|
|
340
350
|
removable: e.state !== "uploading",
|
|
341
|
-
editable:
|
|
351
|
+
editable: We(e),
|
|
342
352
|
retryable: _.retryableAttachments && e.state === "error",
|
|
343
353
|
compact: "",
|
|
344
|
-
onRemove: (t) =>
|
|
345
|
-
onEdit: (t) =>
|
|
346
|
-
onRetry: (t) =>
|
|
354
|
+
onRemove: (t) => He(e.id),
|
|
355
|
+
onEdit: (t) => Z.value = e.id,
|
|
356
|
+
onRetry: (t) => P("retry-attachment", e)
|
|
347
357
|
}, null, 8, [
|
|
348
358
|
"media-type",
|
|
349
359
|
"url",
|
|
@@ -358,135 +368,135 @@ var P = N, F = ["type"], I = {
|
|
|
358
368
|
"onEdit",
|
|
359
369
|
"onRetry"
|
|
360
370
|
]))), 128))])) : d("", !0),
|
|
361
|
-
p("div",
|
|
371
|
+
p("div", ye, [
|
|
362
372
|
w(e.$slots, "prepend"),
|
|
363
|
-
_.fileUpload && _.fileUpload.enabled && (
|
|
373
|
+
_.fileUpload && _.fileUpload.enabled && (X.value || e.$slots["additional-actions"]) ? (x(), u(y, te(ee({ key: 0 }, {
|
|
364
374
|
placement: "top-start",
|
|
365
375
|
modifiers: "menu",
|
|
366
376
|
flip: !0,
|
|
367
377
|
offset: 3
|
|
368
378
|
})), {
|
|
369
|
-
default:
|
|
379
|
+
default: k(({ init: e, toggle: t, aria: n }) => [p("button", ee({ ref: (t) => e(t) }, n, {
|
|
370
380
|
class: "pk-chat-button",
|
|
371
381
|
type: "button",
|
|
372
|
-
title: E(
|
|
373
|
-
disabled:
|
|
382
|
+
title: E(L)("action.attachFile"),
|
|
383
|
+
disabled: K.value,
|
|
374
384
|
onClick: t
|
|
375
385
|
}), [h(l, {
|
|
376
386
|
name: "ri:add-line",
|
|
377
387
|
class: "pk-chat-button__icon"
|
|
378
|
-
})], 16,
|
|
379
|
-
items:
|
|
380
|
-
|
|
388
|
+
})], 16, be)]),
|
|
389
|
+
items: k(() => [
|
|
390
|
+
X.value ? (x(), u(v, {
|
|
381
391
|
key: 0,
|
|
382
|
-
disabled:
|
|
383
|
-
onClick:
|
|
392
|
+
disabled: K.value || _.attachmentLimitReached,
|
|
393
|
+
onClick: ze
|
|
384
394
|
}, {
|
|
385
|
-
default:
|
|
395
|
+
default: k(() => [h(l, {
|
|
386
396
|
name: "ri:camera-line",
|
|
387
397
|
class: "pk-chatbot-input__dropdown-icon"
|
|
388
|
-
}), m(" " + T(E(
|
|
398
|
+
}), m(" " + T(E(L)("action.takePhoto")), 1)]),
|
|
389
399
|
_: 1
|
|
390
400
|
}, 8, ["disabled"])) : d("", !0),
|
|
391
401
|
h(v, {
|
|
392
|
-
disabled:
|
|
393
|
-
onClick:
|
|
402
|
+
disabled: K.value || _.attachmentLimitReached,
|
|
403
|
+
onClick: Re
|
|
394
404
|
}, {
|
|
395
|
-
default:
|
|
405
|
+
default: k(() => [h(l, {
|
|
396
406
|
name: "ri:attachment-line",
|
|
397
407
|
class: "pk-chatbot-input__dropdown-icon"
|
|
398
|
-
}), m(" " + T(E(
|
|
408
|
+
}), m(" " + T(E(L)("action.attachFile")), 1)]),
|
|
399
409
|
_: 1
|
|
400
410
|
}, 8, ["disabled"]),
|
|
401
411
|
w(e.$slots, "additional-actions")
|
|
402
412
|
]),
|
|
403
413
|
_: 3
|
|
404
|
-
}, 16)) : _.fileUpload && _.fileUpload.enabled ? (x(), u(
|
|
414
|
+
}, 16)) : _.fileUpload && _.fileUpload.enabled ? (x(), u(I, {
|
|
405
415
|
key: 1,
|
|
406
416
|
icon: "ri:add-line",
|
|
407
|
-
title: E(
|
|
408
|
-
disabled:
|
|
409
|
-
onClick:
|
|
417
|
+
title: E(L)("action.attachFile"),
|
|
418
|
+
disabled: K.value || _.attachmentLimitReached,
|
|
419
|
+
onClick: Re
|
|
410
420
|
}, null, 8, ["title", "disabled"])) : d("", !0),
|
|
411
421
|
_.fileUpload && _.fileUpload.enabled ? (x(), f("input", {
|
|
412
422
|
key: 2,
|
|
413
423
|
ref_key: "fileInputEl",
|
|
414
|
-
ref:
|
|
424
|
+
ref: De,
|
|
415
425
|
type: "file",
|
|
416
426
|
hidden: "",
|
|
417
427
|
multiple: "",
|
|
418
|
-
accept:
|
|
419
|
-
onChange:
|
|
420
|
-
}, null, 40,
|
|
421
|
-
_.fileUpload && _.fileUpload.enabled &&
|
|
428
|
+
accept: Ie.value,
|
|
429
|
+
onChange: Ve
|
|
430
|
+
}, null, 40, xe)) : d("", !0),
|
|
431
|
+
_.fileUpload && _.fileUpload.enabled && X.value ? (x(), f("input", {
|
|
422
432
|
key: 3,
|
|
423
433
|
ref_key: "cameraInputEl",
|
|
424
|
-
ref:
|
|
434
|
+
ref: z,
|
|
425
435
|
type: "file",
|
|
426
436
|
capture: "environment",
|
|
427
437
|
hidden: "",
|
|
428
|
-
accept:
|
|
429
|
-
onChange:
|
|
430
|
-
}, null, 40,
|
|
431
|
-
_.pointerAvailable ? (x(), u(
|
|
438
|
+
accept: Le.value,
|
|
439
|
+
onChange: Ve
|
|
440
|
+
}, null, 40, Se)) : d("", !0),
|
|
441
|
+
_.pointerAvailable ? (x(), u(I, {
|
|
432
442
|
key: 4,
|
|
433
443
|
icon: "ri:focus-3-line",
|
|
434
|
-
title: E(
|
|
444
|
+
title: E(L)("pagePointer.start"),
|
|
435
445
|
"aria-pressed": _.pointing,
|
|
436
|
-
disabled:
|
|
437
|
-
onClick: r[2] ||= (e) =>
|
|
446
|
+
disabled: K.value,
|
|
447
|
+
onClick: r[2] ||= (e) => P("point")
|
|
438
448
|
}, null, 8, [
|
|
439
449
|
"title",
|
|
440
450
|
"aria-pressed",
|
|
441
451
|
"disabled"
|
|
442
452
|
])) : d("", !0),
|
|
443
|
-
p("div",
|
|
453
|
+
p("div", Ce, [p("textarea", {
|
|
444
454
|
ref_key: "textareaEl",
|
|
445
|
-
ref:
|
|
446
|
-
value:
|
|
455
|
+
ref: R,
|
|
456
|
+
value: V.value,
|
|
447
457
|
class: "pk-chatbot-input__textarea",
|
|
448
458
|
name: "message",
|
|
449
459
|
rows: "1",
|
|
450
460
|
enterkeyhint: "send",
|
|
451
|
-
"aria-label": E(
|
|
452
|
-
"aria-describedby": _.maxMessageLength ? E(
|
|
453
|
-
"aria-invalid":
|
|
461
|
+
"aria-label": E(L)("label.message"),
|
|
462
|
+
"aria-describedby": _.maxMessageLength ? E(q) : void 0,
|
|
463
|
+
"aria-invalid": J.value || void 0,
|
|
454
464
|
placeholder: _.placeholder,
|
|
455
|
-
onInput:
|
|
456
|
-
onKeydown:
|
|
457
|
-
}, null, 40,
|
|
465
|
+
onInput: Ae,
|
|
466
|
+
onKeydown: se($e, ["enter"])
|
|
467
|
+
}, null, 40, we)]),
|
|
458
468
|
_.maxMessageLength ? (x(), f("div", {
|
|
459
469
|
key: 5,
|
|
460
|
-
id: E(
|
|
461
|
-
class: b(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over":
|
|
462
|
-
}, [m(T(e.$n(
|
|
463
|
-
_.voiceEnabled && !
|
|
470
|
+
id: E(q),
|
|
471
|
+
class: b(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": J.value }])
|
|
472
|
+
}, [m(T(e.$n(je.value, "integer")) + "/", 1), p("span", Ee, T(e.$n(_.maxMessageLength, "integer")), 1)], 10, Te)) : d("", !0),
|
|
473
|
+
_.voiceEnabled && !W.value ? (x(), u(I, {
|
|
464
474
|
key: 6,
|
|
465
475
|
icon: "ri:mic-line",
|
|
466
|
-
title: E(
|
|
467
|
-
disabled:
|
|
468
|
-
onClick: r[3] ||= (e) =>
|
|
476
|
+
title: E(L)("action.talk"),
|
|
477
|
+
disabled: K.value,
|
|
478
|
+
onClick: r[3] ||= (e) => P("voice-start")
|
|
469
479
|
}, null, 8, ["title", "disabled"])) : d("", !0),
|
|
470
|
-
|
|
480
|
+
W.value ? (x(), u(I, {
|
|
471
481
|
key: 7,
|
|
472
482
|
icon: "ri:stop-fill",
|
|
473
|
-
modifiers:
|
|
474
|
-
title: E(
|
|
475
|
-
onClick:
|
|
483
|
+
modifiers: Pe.value ? void 0 : "primary",
|
|
484
|
+
title: E(L)("action.stop"),
|
|
485
|
+
onClick: Ze
|
|
476
486
|
}, null, 8, ["modifiers", "title"])) : d("", !0),
|
|
477
|
-
|
|
487
|
+
Pe.value ? (x(), u(I, {
|
|
478
488
|
key: 8,
|
|
479
489
|
type: "submit",
|
|
480
490
|
modifiers: "primary",
|
|
481
491
|
icon: "ri:arrow-up-line",
|
|
482
|
-
title: E(
|
|
483
|
-
}, null, 8, ["title"])) :
|
|
492
|
+
title: E(L)("action.queueMessage")
|
|
493
|
+
}, null, 8, ["title"])) : W.value ? d("", !0) : (x(), u(I, {
|
|
484
494
|
key: 9,
|
|
485
495
|
type: "submit",
|
|
486
496
|
modifiers: "primary",
|
|
487
|
-
icon:
|
|
488
|
-
title: E(
|
|
489
|
-
disabled: !
|
|
497
|
+
icon: G.value ? "loading-loop" : "ri:arrow-up-line",
|
|
498
|
+
title: E(L)("action.submit"),
|
|
499
|
+
disabled: !Y.value
|
|
490
500
|
}, null, 8, [
|
|
491
501
|
"icon",
|
|
492
502
|
"title",
|
|
@@ -494,16 +504,17 @@ var P = N, F = ["type"], I = {
|
|
|
494
504
|
]))
|
|
495
505
|
])
|
|
496
506
|
], 544),
|
|
497
|
-
|
|
498
|
-
key:
|
|
499
|
-
file:
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
507
|
+
Ue.value ? (x(), u(E(de), {
|
|
508
|
+
key: Q.value?.id ?? "annotating",
|
|
509
|
+
file: Ue.value,
|
|
510
|
+
"initial-tool": Q.value ? void 0 : "arrow",
|
|
511
|
+
onApply: Ke,
|
|
512
|
+
onClose: Ge
|
|
513
|
+
}, null, 8, ["file", "initial-tool"])) : d("", !0)
|
|
503
514
|
]);
|
|
504
515
|
};
|
|
505
516
|
}
|
|
506
517
|
});
|
|
507
|
-
export {
|
|
518
|
+
export { I as n, L as t };
|
|
508
519
|
|
|
509
|
-
//# sourceMappingURL=PkChatbotInput-
|
|
520
|
+
//# sourceMappingURL=PkChatbotInput-BSzDRoDD.js.map
|