@8wave/ai-elements 0.123.0-beta.10 → 0.123.0-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/README.md +30 -3
- package/dist/_chunks/{Agent-C0JtGK2t.js → Agent-CsSvagZw.js} +13 -2
- package/dist/_chunks/Agent-CsSvagZw.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-DGdyf4_3.js → PkStreamingMarkdown-ReRKQNAO.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-DGdyf4_3.js.map → PkStreamingMarkdown-ReRKQNAO.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-NrOBCzk2.js → PkToolChatFile-QJi6bOuS.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-NrOBCzk2.js.map → PkToolChatFile-QJi6bOuS.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-BIfpxvX5.js → PkToolRequestGeolocation-CUjRsNs9.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-BIfpxvX5.js.map → PkToolRequestGeolocation-CUjRsNs9.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CJgoiSgi.js → PkToolRequestOAuthConnection-CbxVIAPg.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-CJgoiSgi.js.map → PkToolRequestOAuthConnection-CbxVIAPg.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-DmZEQMSm.js → PkToolShowArtifact-D0HZ_qWx.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-DmZEQMSm.js.map → PkToolShowArtifact-D0HZ_qWx.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-BaX3d5Yq.js → PkToolShowContactForm-DkJB0EO1.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-BaX3d5Yq.js.map → PkToolShowContactForm-DkJB0EO1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-BKyZnpPB.js → PkToolShowForm-zAprG0yl.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-BKyZnpPB.js.map → PkToolShowForm-zAprG0yl.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-GBaXxucK.js → PkToolShowImageGallery-o62SZ6tq.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-GBaXxucK.js.map → PkToolShowImageGallery-o62SZ6tq.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-DBVtBJXU.js → PkToolShowProductList-CWLxVreB.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-DBVtBJXU.js.map → PkToolShowProductList-CWLxVreB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Ciuizdl3.js → PkToolShowSources-dJEqZn6T.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Ciuizdl3.js.map → PkToolShowSources-dJEqZn6T.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-Dbti20SV.js → PkToolShowSuggestedReply-BHAltyxH.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-Dbti20SV.js.map → PkToolShowSuggestedReply-BHAltyxH.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DKDR3zmI.js → PkToolShowVideo-DtJ0nEJk.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-DKDR3zmI.js.map → PkToolShowVideo-DtJ0nEJk.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-CuJ12tdE.js → PkToolShowWebPages-D-tG9JH8.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-CuJ12tdE.js.map → PkToolShowWebPages-D-tG9JH8.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-D3zIP7-i.js → chatImagePolicy-Dhxqcirq.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-D3zIP7-i.js.map → chatImagePolicy-Dhxqcirq.js.map} +1 -1
- package/dist/_chunks/{markdown-BxOlM5SY.js → markdown-CUaXq5OY.js} +2 -2
- package/dist/_chunks/{markdown-BxOlM5SY.js.map → markdown-CUaXq5OY.js.map} +1 -1
- package/dist/ai-elements.es.js +2720 -2269
- 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/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-Dsi_xGvV.js → Agent-D3US-D1x.js} +13 -2
- package/dist-vue/_chunks/Agent-D3US-D1x.js.map +1 -0
- package/dist-vue/_chunks/{Document-B5R1PJnc.js → Document-D5FVOcP9.js} +2 -2
- package/dist-vue/_chunks/{Document-B5R1PJnc.js.map → Document-D5FVOcP9.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-CBpViucq.js → PkChatbot-DxPT26Vn.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-CBpViucq.js.map → PkChatbot-DxPT26Vn.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DKrmLdVU.js → PkChatbotEmptyState-3VeE3lFA.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DKrmLdVU.js.map → PkChatbotEmptyState-3VeE3lFA.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-C1i14Ur_.js → PkChatbotInput-SWQVz3m7.js} +212 -175
- package/dist-vue/_chunks/PkChatbotInput-SWQVz3m7.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-Ce8h0QNX.js → PkChatbotMessages-DFimKbCj.js} +122 -114
- package/dist-vue/_chunks/PkChatbotMessages-DFimKbCj.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-Dp_akrQu.js → PkChatbotStepPayload-Di0FNaTC.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-Dp_akrQu.js.map → PkChatbotStepPayload-Di0FNaTC.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CKxl4_lQ.js → PkChatbotStepToolDetail-Bne48uS8.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CKxl4_lQ.js.map → PkChatbotStepToolDetail-Bne48uS8.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-ChaHkHjG.js → PkChatbotSteps-Cr9nwMQj.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-ChaHkHjG.js.map → PkChatbotSteps-Cr9nwMQj.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-Bjw6x7VD.js → PkChatbotViewChat-CQy-k_dp.js} +417 -404
- package/dist-vue/_chunks/PkChatbotViewChat-CQy-k_dp.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-D-UK4paq.js → PkChatbotViewConversations-Bng-dyqd.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-D-UK4paq.js.map → PkChatbotViewConversations-Bng-dyqd.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-57kQRbZm.js → PkChatbotViewFiles-Ccti1JAS.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-57kQRbZm.js.map → PkChatbotViewFiles-Ccti1JAS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BZTify2Q.js → PkChatbotViewProfile-ChEItAHZ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BZTify2Q.js.map → PkChatbotViewProfile-ChEItAHZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-4Ez-DDFq.js → PkStreamingMarkdown-92GXUXrG.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-4Ez-DDFq.js.map → PkStreamingMarkdown-92GXUXrG.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-DaivFIhK.js → PkToolChatFile-Ca45de6q.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-DaivFIhK.js.map → PkToolChatFile-Ca45de6q.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-B__wk6m3.js → PkToolRequestGeolocation-gEDbmudT.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-B__wk6m3.js.map → PkToolRequestGeolocation-gEDbmudT.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BAttadSC.js → PkToolRequestOAuthConnection-Dy0GXNwC.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BAttadSC.js.map → PkToolRequestOAuthConnection-Dy0GXNwC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-CncSr7Z8.js → PkToolShowArtifact-B-BUIMju.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-CncSr7Z8.js.map → PkToolShowArtifact-B-BUIMju.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-Bi5N1fFe.js → PkToolShowContactForm-NRfvmPLV.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-Bi5N1fFe.js.map → PkToolShowContactForm-NRfvmPLV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-D8NF9lZu.js → PkToolShowDiagram-VTi8vwcN.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-D8NF9lZu.js.map → PkToolShowDiagram-VTi8vwcN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-Dmyn6cMU.js → PkToolShowForm-C4JnalBU.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-Dmyn6cMU.js.map → PkToolShowForm-C4JnalBU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-XZiRk6FK.js → PkToolShowImageGallery-ORfqyhhh.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-XZiRk6FK.js.map → PkToolShowImageGallery-ORfqyhhh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-DzvPUdbo.js → PkToolShowProductList-C9kbfutK.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-DzvPUdbo.js.map → PkToolShowProductList-C9kbfutK.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-NOSBkQCi.js → PkToolShowSources-BVfcp1iE.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-NOSBkQCi.js.map → PkToolShowSources-BVfcp1iE.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-C7dUB3dz.js → PkToolShowSuggestedReply-Bb7Inxa4.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-C7dUB3dz.js.map → PkToolShowSuggestedReply-Bb7Inxa4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-sSZyISJH.js → PkToolShowVideo-CUNITpHh.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-sSZyISJH.js.map → PkToolShowVideo-CUNITpHh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-B1c4X_cH.js → PkToolShowWebPages-C-yl2smm.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-B1c4X_cH.js.map → PkToolShowWebPages-C-yl2smm.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-BmBo5IQR.js → createChatbotApiClient-CuqGJGHD.js} +2 -2
- package/dist-vue/_chunks/createChatbotApiClient-CuqGJGHD.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-D7ZMA7Tr.js → useChatbotStore-C1lW6qXE.js} +1143 -1134
- package/dist-vue/_chunks/useChatbotStore-C1lW6qXE.js.map +1 -0
- package/dist-vue/_chunks/{utils-CKsn0vxx.js → utils-CoLdYTZq.js} +2 -2
- package/dist-vue/_chunks/{utils-CKsn0vxx.js.map → utils-CoLdYTZq.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +3 -3
- package/dist-vue/apps/web-component/src/composables/usePagePointer.d.ts +50 -0
- package/dist-vue/apps/web-component/src/composables/usePageTools.d.ts +21 -0
- package/dist-vue/apps/web-component/src/pageTools/index.d.ts +8 -1
- package/dist-vue/apps/web-component/src/pageTools/pointing.d.ts +41 -0
- package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +2 -0
- package/dist-vue/composables.js +24 -8
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +55 -35
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +20 -0
- package/dist-vue/packages/components/src/chat/PkAgentPageAccessSettings.d.ts +2 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +2 -0
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +16 -3
- package/dist-vue/packages/components/src/chat/PkPagePointer.d.ts +41 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +150 -6
- package/dist-vue/packages/composable/src/useSettingsStore.d.ts +3 -2
- package/dist-vue/packages/models/src/schema/Agent.d.ts +7 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +8 -0
- package/dist-vue/packages/models/src/schema/PageAccess.d.ts +29 -1
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-C0JtGK2t.js.map +0 -1
- package/dist-vue/_chunks/Agent-Dsi_xGvV.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-C1i14Ur_.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-Ce8h0QNX.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-Bjw6x7VD.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BmBo5IQR.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-D7ZMA7Tr.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
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-92GXUXrG.js";
|
|
4
4
|
import { t as r } from "./PkChatbotFilePreview-DVl_1zYD.js";
|
|
5
5
|
import { VvDropdown as i, VvDropdownAction as a, VvIcon as o } from "@volverjs/ui-vue/components";
|
|
6
6
|
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeProps as ee, onBeforeUnmount as b, onMounted as x, openBlock as S, ref as C, renderList as te, renderSlot as ne, toDisplayString as w, unref as T, useId as re, useModel as E, useTemplateRef as D, watch as O, withCtx as k, withKeys as ie, withModifiers as ae } from "vue";
|
|
@@ -111,18 +111,21 @@ var P = N, F = ["type"], I = {
|
|
|
111
111
|
class: "pk-chatbot-input__notice-text"
|
|
112
112
|
}, ue = {
|
|
113
113
|
key: 0,
|
|
114
|
+
class: "pk-chatbot-input__pointer"
|
|
115
|
+
}, de = { class: "pk-chatbot-input__pointer-label" }, fe = {
|
|
116
|
+
key: 1,
|
|
114
117
|
class: "pk-chatbot-input__attachments"
|
|
115
|
-
},
|
|
118
|
+
}, pe = { class: "pk-chatbot-input__fieldset" }, me = [
|
|
116
119
|
"title",
|
|
117
120
|
"disabled",
|
|
118
121
|
"onClick"
|
|
119
|
-
],
|
|
122
|
+
], he = ["accept"], ge = ["accept"], _e = { class: "pk-chatbot-input__content" }, ve = [
|
|
120
123
|
"value",
|
|
121
124
|
"aria-label",
|
|
122
125
|
"aria-describedby",
|
|
123
126
|
"aria-invalid",
|
|
124
127
|
"placeholder"
|
|
125
|
-
],
|
|
128
|
+
], ye = ["id"], be = { class: "opacity-60" }, R = /* @__PURE__ */ h({
|
|
126
129
|
__name: "PkChatbotInput",
|
|
127
130
|
props: /*@__PURE__*/ g({
|
|
128
131
|
placeholder: {},
|
|
@@ -135,7 +138,10 @@ var P = N, F = ["type"], I = {
|
|
|
135
138
|
attachmentNotice: {},
|
|
136
139
|
voiceEnabled: { type: Boolean },
|
|
137
140
|
queueEnabled: { type: Boolean },
|
|
138
|
-
answerNotices: {}
|
|
141
|
+
answerNotices: {},
|
|
142
|
+
pointerAvailable: { type: Boolean },
|
|
143
|
+
pointing: { type: Boolean },
|
|
144
|
+
pointer: {}
|
|
139
145
|
}, {
|
|
140
146
|
modelValue: { default: void 0 },
|
|
141
147
|
modelModifiers: {},
|
|
@@ -150,43 +156,45 @@ var P = N, F = ["type"], I = {
|
|
|
150
156
|
"dismiss-page-notice",
|
|
151
157
|
"open-answer-notice",
|
|
152
158
|
"dismiss-answer-notice",
|
|
153
|
-
"voice-start"
|
|
159
|
+
"voice-start",
|
|
160
|
+
"point",
|
|
161
|
+
"remove-pointer"
|
|
154
162
|
], ["update:modelValue", "update:pendingAttachments"]),
|
|
155
163
|
setup(h, { expose: g, emit: A }) {
|
|
156
164
|
let j = E(h, "modelValue"), M = E(h, "pendingAttachments"), N = A, F = h, I = D("textareaEl"), R = D("fileInputEl"), z = D("cameraInputEl"), B = D("formEl"), V = C(j.value ?? ""), H = null, U = () => {
|
|
157
165
|
H !== null && (clearTimeout(H), H = null);
|
|
158
|
-
},
|
|
166
|
+
}, xe = () => {
|
|
159
167
|
U(), j.value = V.value;
|
|
160
|
-
},
|
|
168
|
+
}, Se = () => {
|
|
161
169
|
U(), H = setTimeout(() => {
|
|
162
170
|
j.value = V.value, H = null;
|
|
163
171
|
}, 300);
|
|
164
|
-
},
|
|
165
|
-
V.value = I.value?.value ?? "",
|
|
172
|
+
}, Ce = () => {
|
|
173
|
+
V.value = I.value?.value ?? "", Se();
|
|
166
174
|
};
|
|
167
175
|
O(j, (e) => {
|
|
168
176
|
e !== V.value && (V.value = e ?? "", v(() => {
|
|
169
177
|
I.value && P.update(I.value);
|
|
170
178
|
}));
|
|
171
179
|
});
|
|
172
|
-
let W = c(() => F.status === "streaming"), G = c(() => F.status === "submitted"), K = c(() => W.value || G.value), q = re(), J = c(() => V.value.length), Y = c(() => F.maxMessageLength !== void 0 && J.value > F.maxMessageLength),
|
|
180
|
+
let W = c(() => F.status === "streaming"), G = c(() => F.status === "submitted"), K = c(() => W.value || G.value), q = re(), J = c(() => V.value.length), Y = c(() => F.maxMessageLength !== void 0 && J.value > F.maxMessageLength), we = c(() => M.value.some((e) => e.state === "uploading")), X = c(() => K.value && !F.queueEnabled || we.value || Y.value ? !1 : V.value.trim().length > 0), Z = c(() => K.value && X.value), Te = "capture" in document.createElement("input"), Ee = c(() => {
|
|
173
181
|
let t = F.fileUpload?.allowedMimeTypes ?? [];
|
|
174
182
|
return [...t, ...e(t)].join(",");
|
|
175
|
-
}),
|
|
183
|
+
}), De = c(() => (F.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), Q = c(() => Te && De.value.length > 0), $ = () => {
|
|
176
184
|
R.value?.click();
|
|
177
|
-
},
|
|
185
|
+
}, Oe = () => {
|
|
178
186
|
z.value?.click();
|
|
179
|
-
},
|
|
187
|
+
}, ke = (e) => {
|
|
180
188
|
for (let t of e) N("file-select", t);
|
|
181
|
-
},
|
|
189
|
+
}, Ae = (e) => {
|
|
182
190
|
let t = e.target;
|
|
183
|
-
|
|
184
|
-
},
|
|
191
|
+
ke(Array.from(t.files ?? [])), t.value = "";
|
|
192
|
+
}, je = (e) => {
|
|
185
193
|
let t = M.value.find((t) => t.id === e);
|
|
186
194
|
t && URL.revokeObjectURL(t.localUrl), M.value = M.value.filter((t) => t.id !== e);
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
},
|
|
195
|
+
}, Me = C(!0), Ne = () => {
|
|
196
|
+
Me.value = !1;
|
|
197
|
+
}, Pe = c(() => {
|
|
190
198
|
if (F.attachmentNotice) return [{
|
|
191
199
|
id: "limit",
|
|
192
200
|
icon: "ri:information-line",
|
|
@@ -206,29 +214,29 @@ var P = N, F = ["type"], I = {
|
|
|
206
214
|
icon: "ri:pages-line",
|
|
207
215
|
text: F.pageNotice,
|
|
208
216
|
dismiss: () => N("dismiss-page-notice")
|
|
209
|
-
}), F.dismissableNotice &&
|
|
217
|
+
}), F.dismissableNotice && Me.value && e.push({
|
|
210
218
|
id: "dismissable",
|
|
211
219
|
markdown: F.dismissableNotice,
|
|
212
|
-
dismiss:
|
|
220
|
+
dismiss: Ne
|
|
213
221
|
}), e;
|
|
214
|
-
}),
|
|
222
|
+
}), Fe = () => {
|
|
215
223
|
B.value?.querySelector("button:focus-visible") && I.value?.focus();
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
X.value && (
|
|
224
|
+
}, Ie = () => {
|
|
225
|
+
Fe(), N("stop-generation");
|
|
226
|
+
}, Le = () => {
|
|
227
|
+
X.value && (Fe(), xe(), N("submit"), V.value = "", j.value = "", v(() => {
|
|
220
228
|
I.value && (I.value.value = "", P.update(I.value));
|
|
221
229
|
}));
|
|
222
|
-
},
|
|
223
|
-
e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(),
|
|
230
|
+
}, Re = (e) => {
|
|
231
|
+
e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(), Le());
|
|
224
232
|
};
|
|
225
233
|
x(() => {
|
|
226
234
|
I.value && P(I.value);
|
|
227
235
|
});
|
|
228
|
-
let
|
|
236
|
+
let ze = 0;
|
|
229
237
|
return oe(I, ([e]) => {
|
|
230
238
|
let t = e?.contentRect.width ?? 0;
|
|
231
|
-
I.value && t !==
|
|
239
|
+
I.value && t !== ze && (ze = t, P.update(I.value));
|
|
232
240
|
}), O(() => F.placeholder, async () => {
|
|
233
241
|
await v(), I.value && P.update(I.value);
|
|
234
242
|
}), b(() => {
|
|
@@ -236,7 +244,7 @@ var P = N, F = ["type"], I = {
|
|
|
236
244
|
for (let e of M.value) URL.revokeObjectURL(e.localUrl);
|
|
237
245
|
}), g({ focus: () => I.value?.focus() }), (e, c) => {
|
|
238
246
|
let g = o, v = t, b = a, x = i;
|
|
239
|
-
return S(), d("div", se, [
|
|
247
|
+
return S(), d("div", se, [Pe.value.length ? (S(), d("div", ce, [(S(!0), d(s, null, te(Pe.value, (t) => (S(), d("div", {
|
|
240
248
|
key: t.id,
|
|
241
249
|
class: "pk-chatbot-input__notice-item"
|
|
242
250
|
}, [
|
|
@@ -269,153 +277,182 @@ var P = N, F = ["type"], I = {
|
|
|
269
277
|
ref_key: "formEl",
|
|
270
278
|
ref: B,
|
|
271
279
|
class: "pk-chatbot-input__form",
|
|
272
|
-
onSubmit: ae(
|
|
273
|
-
}, [
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
280
|
+
onSubmit: ae(Le, ["prevent"])
|
|
281
|
+
}, [
|
|
282
|
+
h.pointer ? (S(), d("div", ue, [
|
|
283
|
+
m(g, {
|
|
284
|
+
name: h.pointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
|
|
285
|
+
class: "pk-chatbot-input__pointer-icon"
|
|
286
|
+
}, null, 8, ["name"]),
|
|
287
|
+
f("span", de, w(h.pointer.kind === "text" ? `«${h.pointer.label}»` : h.pointer.label), 1),
|
|
288
|
+
m(v, {
|
|
289
|
+
title: e.$t("pagePointer.remove"),
|
|
290
|
+
modifiers: "action-quiet",
|
|
291
|
+
icon: "ri:close-line",
|
|
292
|
+
class: "w-18 h-18",
|
|
293
|
+
onClick: c[0] ||= (e) => N("remove-pointer")
|
|
294
|
+
}, null, 8, ["title"])
|
|
295
|
+
])) : u("", !0),
|
|
296
|
+
M.value.length ? (S(), d("div", fe, [(S(!0), d(s, null, te(M.value, (e) => (S(), l(r, {
|
|
297
|
+
key: e.id,
|
|
298
|
+
"media-type": e.mediaSource?.mimeType ?? e.file.type,
|
|
299
|
+
url: e.localUrl,
|
|
300
|
+
filename: e.file.name,
|
|
301
|
+
size: e.file.size,
|
|
302
|
+
loading: e.state === "uploading",
|
|
303
|
+
error: e.state === "error" ? e.error : void 0,
|
|
304
|
+
removable: e.state !== "uploading",
|
|
305
|
+
compact: "",
|
|
306
|
+
onRemove: (t) => je(e.id)
|
|
307
|
+
}, null, 8, [
|
|
308
|
+
"media-type",
|
|
309
|
+
"url",
|
|
310
|
+
"filename",
|
|
311
|
+
"size",
|
|
312
|
+
"loading",
|
|
313
|
+
"error",
|
|
314
|
+
"removable",
|
|
315
|
+
"onRemove"
|
|
316
|
+
]))), 128))])) : u("", !0),
|
|
317
|
+
f("div", pe, [
|
|
318
|
+
ne(e.$slots, "prepend"),
|
|
319
|
+
h.fileUpload && h.fileUpload.enabled && (Q.value || e.$slots["additional-actions"]) ? (S(), l(x, ee(_({ key: 0 }, {
|
|
320
|
+
placement: "top-start",
|
|
321
|
+
modifiers: "menu",
|
|
322
|
+
flip: !0,
|
|
323
|
+
offset: 3
|
|
324
|
+
})), {
|
|
325
|
+
default: k(({ init: t, toggle: n, aria: r }) => [f("button", _({ ref: (e) => t(e) }, r, {
|
|
326
|
+
class: "pk-chat-button",
|
|
327
|
+
type: "button",
|
|
328
|
+
title: e.$t("action.attachFile"),
|
|
329
|
+
disabled: K.value,
|
|
330
|
+
onClick: n
|
|
331
|
+
}), [m(g, {
|
|
332
|
+
name: "ri:add-line",
|
|
333
|
+
class: "pk-chat-button__icon"
|
|
334
|
+
})], 16, me)]),
|
|
335
|
+
items: k(() => [
|
|
336
|
+
Q.value ? (S(), l(b, {
|
|
337
|
+
key: 0,
|
|
338
|
+
disabled: K.value || h.attachmentLimitReached,
|
|
339
|
+
onClick: Oe
|
|
340
|
+
}, {
|
|
341
|
+
default: k(() => [m(g, {
|
|
342
|
+
name: "ri:camera-line",
|
|
343
|
+
class: "pk-chatbot-input__dropdown-icon"
|
|
344
|
+
}), p(" " + w(e.$t("action.takePhoto")), 1)]),
|
|
345
|
+
_: 1
|
|
346
|
+
}, 8, ["disabled"])) : u("", !0),
|
|
347
|
+
m(b, {
|
|
348
|
+
disabled: K.value || h.attachmentLimitReached,
|
|
349
|
+
onClick: $
|
|
350
|
+
}, {
|
|
351
|
+
default: k(() => [m(g, {
|
|
352
|
+
name: "ri:attachment-line",
|
|
353
|
+
class: "pk-chatbot-input__dropdown-icon"
|
|
354
|
+
}), p(" " + w(e.$t("action.attachFile")), 1)]),
|
|
355
|
+
_: 1
|
|
356
|
+
}, 8, ["disabled"]),
|
|
357
|
+
ne(e.$slots, "additional-actions")
|
|
358
|
+
]),
|
|
359
|
+
_: 3
|
|
360
|
+
}, 16)) : h.fileUpload && h.fileUpload.enabled ? (S(), l(L, {
|
|
361
|
+
key: 1,
|
|
362
|
+
icon: "ri:add-line",
|
|
304
363
|
title: e.$t("action.attachFile"),
|
|
364
|
+
disabled: K.value || h.attachmentLimitReached,
|
|
365
|
+
onClick: $
|
|
366
|
+
}, null, 8, ["title", "disabled"])) : u("", !0),
|
|
367
|
+
h.fileUpload && h.fileUpload.enabled ? (S(), d("input", {
|
|
368
|
+
key: 2,
|
|
369
|
+
ref_key: "fileInputEl",
|
|
370
|
+
ref: R,
|
|
371
|
+
type: "file",
|
|
372
|
+
hidden: "",
|
|
373
|
+
multiple: "",
|
|
374
|
+
accept: Ee.value,
|
|
375
|
+
onChange: Ae
|
|
376
|
+
}, null, 40, he)) : u("", !0),
|
|
377
|
+
h.fileUpload && h.fileUpload.enabled && Q.value ? (S(), d("input", {
|
|
378
|
+
key: 3,
|
|
379
|
+
ref_key: "cameraInputEl",
|
|
380
|
+
ref: z,
|
|
381
|
+
type: "file",
|
|
382
|
+
capture: "environment",
|
|
383
|
+
hidden: "",
|
|
384
|
+
accept: De.value,
|
|
385
|
+
onChange: Ae
|
|
386
|
+
}, null, 40, ge)) : u("", !0),
|
|
387
|
+
h.pointerAvailable ? (S(), l(L, {
|
|
388
|
+
key: 4,
|
|
389
|
+
icon: "ri:focus-3-line",
|
|
390
|
+
title: e.$t("pagePointer.start"),
|
|
391
|
+
"aria-pressed": h.pointing,
|
|
305
392
|
disabled: K.value,
|
|
306
|
-
onClick:
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
value: V.value,
|
|
367
|
-
class: "pk-chatbot-input__textarea",
|
|
368
|
-
name: "message",
|
|
369
|
-
rows: "1",
|
|
370
|
-
enterkeyhint: "send",
|
|
371
|
-
"aria-label": e.$t("label.message"),
|
|
372
|
-
"aria-describedby": h.maxMessageLength ? T(q) : void 0,
|
|
373
|
-
"aria-invalid": Y.value || void 0,
|
|
374
|
-
placeholder: h.placeholder,
|
|
375
|
-
onInput: xe,
|
|
376
|
-
onKeydown: ie(Ie, ["enter"])
|
|
377
|
-
}, null, 40, ge)]),
|
|
378
|
-
h.maxMessageLength ? (S(), d("div", {
|
|
379
|
-
key: 4,
|
|
380
|
-
id: T(q),
|
|
381
|
-
class: y(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": Y.value }])
|
|
382
|
-
}, [p(w(e.$n(J.value, "integer")) + "/", 1), f("span", ve, w(e.$n(h.maxMessageLength, "integer")), 1)], 10, _e)) : u("", !0),
|
|
383
|
-
h.voiceEnabled && !W.value ? (S(), l(L, {
|
|
384
|
-
key: 5,
|
|
385
|
-
icon: "ri:mic-line",
|
|
386
|
-
title: e.$t("action.talk"),
|
|
387
|
-
disabled: K.value,
|
|
388
|
-
onClick: c[0] ||= (e) => N("voice-start")
|
|
389
|
-
}, null, 8, ["title", "disabled"])) : u("", !0),
|
|
390
|
-
W.value ? (S(), l(L, {
|
|
391
|
-
key: 6,
|
|
392
|
-
icon: "ri:stop-fill",
|
|
393
|
-
modifiers: Z.value ? void 0 : "primary",
|
|
394
|
-
title: e.$t("action.stop"),
|
|
395
|
-
onClick: Pe
|
|
396
|
-
}, null, 8, ["modifiers", "title"])) : u("", !0),
|
|
397
|
-
Z.value ? (S(), l(L, {
|
|
398
|
-
key: 7,
|
|
399
|
-
type: "submit",
|
|
400
|
-
modifiers: "primary",
|
|
401
|
-
icon: "ri:arrow-up-line",
|
|
402
|
-
title: e.$t("action.queueMessage")
|
|
403
|
-
}, null, 8, ["title"])) : W.value ? u("", !0) : (S(), l(L, {
|
|
404
|
-
key: 8,
|
|
405
|
-
type: "submit",
|
|
406
|
-
modifiers: "primary",
|
|
407
|
-
icon: G.value ? "loading-loop" : "ri:arrow-up-line",
|
|
408
|
-
title: e.$t("action.submit"),
|
|
409
|
-
disabled: !X.value
|
|
410
|
-
}, null, 8, [
|
|
411
|
-
"icon",
|
|
412
|
-
"title",
|
|
413
|
-
"disabled"
|
|
414
|
-
]))
|
|
415
|
-
])], 544)]);
|
|
393
|
+
onClick: c[1] ||= (e) => N("point")
|
|
394
|
+
}, null, 8, [
|
|
395
|
+
"title",
|
|
396
|
+
"aria-pressed",
|
|
397
|
+
"disabled"
|
|
398
|
+
])) : u("", !0),
|
|
399
|
+
f("div", _e, [f("textarea", {
|
|
400
|
+
ref_key: "textareaEl",
|
|
401
|
+
ref: I,
|
|
402
|
+
value: V.value,
|
|
403
|
+
class: "pk-chatbot-input__textarea",
|
|
404
|
+
name: "message",
|
|
405
|
+
rows: "1",
|
|
406
|
+
enterkeyhint: "send",
|
|
407
|
+
"aria-label": e.$t("label.message"),
|
|
408
|
+
"aria-describedby": h.maxMessageLength ? T(q) : void 0,
|
|
409
|
+
"aria-invalid": Y.value || void 0,
|
|
410
|
+
placeholder: h.placeholder,
|
|
411
|
+
onInput: Ce,
|
|
412
|
+
onKeydown: ie(Re, ["enter"])
|
|
413
|
+
}, null, 40, ve)]),
|
|
414
|
+
h.maxMessageLength ? (S(), d("div", {
|
|
415
|
+
key: 5,
|
|
416
|
+
id: T(q),
|
|
417
|
+
class: y(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": Y.value }])
|
|
418
|
+
}, [p(w(e.$n(J.value, "integer")) + "/", 1), f("span", be, w(e.$n(h.maxMessageLength, "integer")), 1)], 10, ye)) : u("", !0),
|
|
419
|
+
h.voiceEnabled && !W.value ? (S(), l(L, {
|
|
420
|
+
key: 6,
|
|
421
|
+
icon: "ri:mic-line",
|
|
422
|
+
title: e.$t("action.talk"),
|
|
423
|
+
disabled: K.value,
|
|
424
|
+
onClick: c[2] ||= (e) => N("voice-start")
|
|
425
|
+
}, null, 8, ["title", "disabled"])) : u("", !0),
|
|
426
|
+
W.value ? (S(), l(L, {
|
|
427
|
+
key: 7,
|
|
428
|
+
icon: "ri:stop-fill",
|
|
429
|
+
modifiers: Z.value ? void 0 : "primary",
|
|
430
|
+
title: e.$t("action.stop"),
|
|
431
|
+
onClick: Ie
|
|
432
|
+
}, null, 8, ["modifiers", "title"])) : u("", !0),
|
|
433
|
+
Z.value ? (S(), l(L, {
|
|
434
|
+
key: 8,
|
|
435
|
+
type: "submit",
|
|
436
|
+
modifiers: "primary",
|
|
437
|
+
icon: "ri:arrow-up-line",
|
|
438
|
+
title: e.$t("action.queueMessage")
|
|
439
|
+
}, null, 8, ["title"])) : W.value ? u("", !0) : (S(), l(L, {
|
|
440
|
+
key: 9,
|
|
441
|
+
type: "submit",
|
|
442
|
+
modifiers: "primary",
|
|
443
|
+
icon: G.value ? "loading-loop" : "ri:arrow-up-line",
|
|
444
|
+
title: e.$t("action.submit"),
|
|
445
|
+
disabled: !X.value
|
|
446
|
+
}, null, 8, [
|
|
447
|
+
"icon",
|
|
448
|
+
"title",
|
|
449
|
+
"disabled"
|
|
450
|
+
]))
|
|
451
|
+
])
|
|
452
|
+
], 544)]);
|
|
416
453
|
};
|
|
417
454
|
}
|
|
418
455
|
});
|
|
419
456
|
export { L as n, R as t };
|
|
420
457
|
|
|
421
|
-
//# sourceMappingURL=PkChatbotInput-
|
|
458
|
+
//# sourceMappingURL=PkChatbotInput-SWQVz3m7.js.map
|