@8wave/ai-elements 0.126.0-beta.43 → 0.126.0-beta.44
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/{markdown-Z_eeOlvv.js → Document-CHcFWo2X.js} +3 -5
- package/dist/_chunks/Document-CHcFWo2X.js.map +1 -0
- package/dist/_chunks/PkToolShowEmail-C8DrPLtf.js +92 -0
- package/dist/_chunks/PkToolShowEmail-C8DrPLtf.js.map +1 -0
- package/dist/_chunks/PkToolShowMessage-4vgFABsU.js +80 -0
- package/dist/_chunks/PkToolShowMessage-4vgFABsU.js.map +1 -0
- package/dist/_chunks/{PkToolShowSources-DMDML2kQ.js → PkToolShowSources-D5gh7FtU.js} +5 -4
- package/dist/_chunks/{PkToolShowSources-DMDML2kQ.js.map → PkToolShowSources-D5gh7FtU.js.map} +1 -1
- package/dist/_chunks/markdown-aNRYL30G.js +7 -0
- package/dist/_chunks/markdown-aNRYL30G.js.map +1 -0
- package/dist/ai-elements.es.js +220 -219
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-QjeNY0h6.js → PkChatbot-DLO9Xc4K.js} +3 -3
- package/dist-vue/_chunks/{PkChatbot-QjeNY0h6.js.map → PkChatbot-DLO9Xc4K.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-CzPsgCAN.js → PkChatbotMessages-BmKGu2Sh.js} +4 -4
- package/dist-vue/_chunks/PkChatbotMessages-BmKGu2Sh.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-BpDCX_72.js → PkChatbotViewChat-DEb_v4fS.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewChat-BpDCX_72.js.map → PkChatbotViewChat-DEb_v4fS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-B0nUFwuu.js → PkChatbotViewConversations-BrgBXjpa.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-B0nUFwuu.js.map → PkChatbotViewConversations-BrgBXjpa.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-0p50S8Km.js → PkFilePreview-Cc8PzIcK.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreview-0p50S8Km.js.map → PkFilePreview-Cc8PzIcK.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-B1N4xDEu.js → PkFilePreviewDialog-D4XuwOvp.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-B1N4xDEu.js.map → PkFilePreviewDialog-D4XuwOvp.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowEmail-C_iJsuec.js +92 -0
- package/dist-vue/_chunks/PkToolShowEmail-C_iJsuec.js.map +1 -0
- package/dist-vue/_chunks/PkToolShowMessage-2pxYXo-_.js +80 -0
- package/dist-vue/_chunks/PkToolShowMessage-2pxYXo-_.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSources-Bci0Ab2u.js → PkToolShowSources-B_2niEa3.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-Bci0Ab2u.js.map → PkToolShowSources-B_2niEa3.js.map} +1 -1
- package/dist-vue/_chunks/markdown-aNRYL30G.js +7 -0
- package/dist-vue/_chunks/markdown-aNRYL30G.js.map +1 -0
- package/dist-vue/index.js +9 -9
- package/dist-vue/packages/components/src/chat/toolApprovalPreviews.d.ts +3 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolShowEmail-CQ4uyty9.js +0 -90
- package/dist/_chunks/PkToolShowEmail-CQ4uyty9.js.map +0 -1
- package/dist/_chunks/PkToolShowMessage-9mlI4IQ6.js +0 -78
- package/dist/_chunks/PkToolShowMessage-9mlI4IQ6.js.map +0 -1
- package/dist/_chunks/markdown-Z_eeOlvv.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CzPsgCAN.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowEmail-idhNR5-l.js +0 -90
- package/dist-vue/_chunks/PkToolShowEmail-idhNR5-l.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowMessage-B4gztWUk.js +0 -78
- package/dist-vue/_chunks/PkToolShowMessage-B4gztWUk.js.map +0 -1
- package/dist-vue/_chunks/markdown-BiG_7-9D.js +0 -7
- package/dist-vue/_chunks/markdown-BiG_7-9D.js.map +0 -1
package/dist-vue/_chunks/{PkFilePreviewDialog-B1N4xDEu.js → PkFilePreviewDialog-D4XuwOvp.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
-
import { t } from "./PkFilePreview-
|
|
2
|
+
import { t } from "./PkFilePreview-Cc8PzIcK.js";
|
|
3
3
|
import { VvDialog as n } from "@volverjs/ui-vue/components";
|
|
4
4
|
import { createBlock as r, createVNode as i, defineComponent as a, mergeModels as o, openBlock as s, useModel as c, withCtx as l } from "vue";
|
|
5
5
|
// ../../packages/components/src/chat/PkFilePreviewDialog.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -113,4 +113,4 @@ var u = /*@__PURE__*/ a({
|
|
|
113
113
|
}), d = /* @__PURE__ */ e({ default: () => f }), f = u;
|
|
114
114
|
export { d as n, f as t };
|
|
115
115
|
|
|
116
|
-
//# sourceMappingURL=PkFilePreviewDialog-
|
|
116
|
+
//# sourceMappingURL=PkFilePreviewDialog-D4XuwOvp.js.map
|
package/dist-vue/_chunks/{PkFilePreviewDialog-B1N4xDEu.js.map → PkFilePreviewDialog-D4XuwOvp.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkFilePreviewDialog-
|
|
1
|
+
{"version":3,"file":"PkFilePreviewDialog-D4XuwOvp.js","names":["_useModel","_openBlock","_createBlock","_withCtx","_createVNode","PkFilePreview","__exportAll","PkFilePreviewDialog_vue_vue_type_script_setup_true_lang_default","\"mode\"","\"modeModifiers\"","\"sheet\"","\"sheetModifiers\"","\"zoom\"","\"zoomModifiers\"","\"fit\"","\"fitModifiers\"","__emit","emit","mode","useModel","__props","sheet","zoom","fit","_component_VvDialog","VvDialog","openBlock","createBlock","_cache","$event","withCtx","createVNode","PkFilePreview_default","text","pointer","action","PkFilePreviewDialog_exports","PkFilePreviewDialog_default"],"sources":["../../../../packages/components/src/chat/PkFilePreviewDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n /** The agent answers in the chat the dialog covers. */\n working?: boolean\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n showChat: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n :working\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @show-chat=\"emit('showChat')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCI,IAAMiB,IAAOD,GAcPE,IAAOlB,EAA4BoB,GAAC,MAAM,GAC1CC,IAAQrB,EAAmBoB,GAAC,OAAO,GACnCE,IAAOtB,EAAmBoB,GAAC,MAAM,GAGjCG,IAAMvB,EAAoBoB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@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
+
import { t } from "./VvButtonLocalized-C-vx25u4.js";
|
|
3
|
+
import { n } from "./useShortUrlResolver-KJDk7QLj.js";
|
|
4
|
+
import { t as r } from "./markdown-aNRYL30G.js";
|
|
5
|
+
import "./src-nb8MU1sh.js";
|
|
6
|
+
import { VvButtonGroup as i, VvDropdown as a, VvDropdownAction as o, VvIcon as s } from "@volverjs/ui-vue/components";
|
|
7
|
+
import { computed as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, normalizeProps as h, openBlock as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
|
|
8
|
+
import { useClipboard as b } from "@vueuse/core";
|
|
9
|
+
// ../../packages/components/src/chat/PkToolShowEmail.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var x = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-surface" }, S = { class: "px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8" }, C = { class: "font-bold" }, w = { class: "border-b border-surface-3 p-sm" }, T = { class: "text-12 text-word-3 mb-4" }, E = { class: "text-word-2 font-semibold" }, D = { class: "p-sm" }, O = { class: "text-12 text-word-3 mb-4" }, k = { class: "text-word-2 whitespace-pre-wrap break-words" }, A = /*@__PURE__*/ p({
|
|
11
|
+
__name: "PkToolShowEmail",
|
|
12
|
+
props: { part: {} },
|
|
13
|
+
setup(e) {
|
|
14
|
+
let p = e, { copy: A, copied: j } = b(), M = c(() => p.part), { resolveText: N } = n(), P = N(() => M.value.input?.subject), F = N(() => M.value.input?.body), I = c(() => r(F.value)), L = () => {
|
|
15
|
+
if (!M.value.input) return;
|
|
16
|
+
let e = `mailto:?subject=${encodeURIComponent(P.value)}&body=${encodeURIComponent(I.value)}`;
|
|
17
|
+
window.open(e);
|
|
18
|
+
}, R = () => {
|
|
19
|
+
if (!M.value.input) return;
|
|
20
|
+
let e = `https://outlook.office.com/mail/deeplink/compose?to=&subject=${encodeURIComponent(P.value)}&body=${encodeURIComponent(I.value)}`;
|
|
21
|
+
window.open(e, "_blank");
|
|
22
|
+
}, z = () => {
|
|
23
|
+
if (!M.value.input) return;
|
|
24
|
+
let e = `https://mail.google.com/mail/u/0/?tf=cm&to=&su=${encodeURIComponent(P.value)}&body=${encodeURIComponent(I.value)}`;
|
|
25
|
+
window.open(e, "_blank");
|
|
26
|
+
}, B = () => {
|
|
27
|
+
if (!M.value.input) return;
|
|
28
|
+
let e = `https://compose.mail.yahoo.com/?to=&subject=${encodeURIComponent(P.value)}&body=${encodeURIComponent(I.value)}`;
|
|
29
|
+
window.open(e, "_blank");
|
|
30
|
+
};
|
|
31
|
+
return (e, n) => {
|
|
32
|
+
let r = s, c = t, p = o, b = a, M = i;
|
|
33
|
+
return g(), l("div", x, [
|
|
34
|
+
u("div", S, [
|
|
35
|
+
f(r, {
|
|
36
|
+
name: "ri:mail-line",
|
|
37
|
+
class: "text-16"
|
|
38
|
+
}),
|
|
39
|
+
u("strong", C, _(e.$t("label.email")), 1),
|
|
40
|
+
f(M, {
|
|
41
|
+
modifiers: "compact",
|
|
42
|
+
class: "ml-auto shrink-0"
|
|
43
|
+
}, {
|
|
44
|
+
default: y(() => [f(c, {
|
|
45
|
+
modifiers: "action-quiet-small",
|
|
46
|
+
icon: v(j) ? "ri:check-line" : "ri:file-copy-line",
|
|
47
|
+
label: v(j) ? e.$t("action.copied") : e.$t("action.copy"),
|
|
48
|
+
onClick: n[0] ||= (e) => v(A)(`${v(P)}\n\n${I.value}`)
|
|
49
|
+
}, null, 8, ["icon", "label"]), f(b, h(m({
|
|
50
|
+
placement: "bottom-end",
|
|
51
|
+
modifiers: "menu",
|
|
52
|
+
flip: !0,
|
|
53
|
+
offset: 3,
|
|
54
|
+
strategy: "fixed"
|
|
55
|
+
})), {
|
|
56
|
+
items: y(() => [
|
|
57
|
+
f(p, { onClick: R }, {
|
|
58
|
+
default: y(() => [f(r, { name: "mdi:outlook" }), d(" " + _(e.$t("action.openInOutlook")), 1)]),
|
|
59
|
+
_: 1
|
|
60
|
+
}),
|
|
61
|
+
f(p, { onClick: z }, {
|
|
62
|
+
default: y(() => [f(r, { name: "mdi:gmail" }), d(" " + _(e.$t("action.openInGmail")), 1)]),
|
|
63
|
+
_: 1
|
|
64
|
+
}),
|
|
65
|
+
f(p, { onClick: B }, {
|
|
66
|
+
default: y(() => [f(r, { name: "mdi:yahoo" }), d(" " + _(e.$t("action.openInYahooMail")), 1)]),
|
|
67
|
+
_: 1
|
|
68
|
+
}),
|
|
69
|
+
f(p, { onClick: L }, {
|
|
70
|
+
default: y(() => [f(r, { name: "ri:mail-open-line" }), d(" " + _(e.$t("action.openInMailApp")), 1)]),
|
|
71
|
+
_: 1
|
|
72
|
+
})
|
|
73
|
+
]),
|
|
74
|
+
default: y(() => [f(c, {
|
|
75
|
+
icon: "ri:mail-send-line",
|
|
76
|
+
modifiers: "action-quiet-small",
|
|
77
|
+
label: e.$t("action.send")
|
|
78
|
+
}, null, 8, ["label"])]),
|
|
79
|
+
_: 1
|
|
80
|
+
}, 16)]),
|
|
81
|
+
_: 1
|
|
82
|
+
})
|
|
83
|
+
]),
|
|
84
|
+
u("div", w, [u("div", T, _(e.$t("label.subject")), 1), u("div", E, _(v(P)), 1)]),
|
|
85
|
+
u("div", D, [u("div", O, _(e.$t("label.body")), 1), u("pre", k, _(I.value), 1)])
|
|
86
|
+
]);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}), j = /* @__PURE__ */ e({ default: () => M }), M = A;
|
|
90
|
+
export { j as n, M as t };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=PkToolShowEmail-C_iJsuec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkToolShowEmail-C_iJsuec.js","names":["$t","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_withCtx","_unref","_normalizeProps","_guardReactiveProps","_createTextVNode","__exportAll","markdownToPlainText","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","PkToolShowEmail_vue_vue_type_script_setup_true_lang_default","props","__props","useClipboard","toolPart","computed","useShortUrlResolver","subject","resolveText","resolvedBody","body","openInMailApp","mailtoLink","openInOutlook","url","openInGmail","openInYahooMail","_component_VvIcon","VvIcon","_component_VvButton","VvButtonLocalized","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","_component_VvButtonGroup","VvButtonGroup","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","withCtx","unref","copied","_cache","copy","normalizeProps","guardReactiveProps","createTextVNode","PkToolShowEmail_exports","PkToolShowEmail_default"],"sources":["../../../../packages/components/src/chat/PkToolShowEmail.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n import { markdownToPlainText } from 'utils'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n subject: string\n body: string\n }\n }\n return part\n })\n\n // Emails leave the app (mailto/webmail/clipboard), so expand short urls to\n // their real target rather than keeping the fragile `/api/r/` redirect.\n // The body is plain text there: drop the Markdown some models still write.\n const { resolveText } = useShortUrlResolver()\n const subject = resolveText(() => toolPart.value.input?.subject)\n const resolvedBody = resolveText(() => toolPart.value.input?.body)\n const body = computed(() => markdownToPlainText(resolvedBody.value))\n\n const openInMailApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const mailtoLink = `mailto:?subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(mailtoLink)\n }\n\n const openInOutlook = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://outlook.office.com/mail/deeplink/compose?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInGmail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://mail.google.com/mail/u/0/?tf=cm&to=&su=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInYahooMail = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://compose.mail.yahoo.com/?to=&subject=${encodeURIComponent(\n subject.value,\n )}&body=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:mail-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.email') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(`${subject}\\n\\n${body}`)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:mail-send-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInOutlook\">\n <VvIcon name=\"mdi:outlook\" />\n {{ $t('action.openInOutlook') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInGmail\">\n <VvIcon name=\"mdi:gmail\" />\n {{ $t('action.openInGmail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInYahooMail\">\n <VvIcon name=\"mdi:yahoo\" />\n {{ $t('action.openInYahooMail') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInMailApp\">\n <VvIcon name=\"ri:mail-open-line\" />\n {{ $t('action.openInMailApp') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"border-b border-surface-3 p-sm\">\n <div class=\"text-12 text-word-3 mb-4\">\n {{ $t('label.subject') }}\n </div>\n <div class=\"text-word-2 font-semibold\">\n {{ subject }}\n </div>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-3 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAMI,IAAMuB,IAAQC,GAIR,EAAE,SAAM,cAAWC,EAAa,GAEhCC,IAAWC,QACAJ,EAAM,IAOtB,GAKK,EAAE,mBAAgBK,EAAoB,GACtCC,IAAUC,QAAkBJ,EAAS,MAAM,OAAO,OAAO,GACzDK,IAAeD,QAAkBJ,EAAS,MAAM,OAAO,IAAI,GAC3DM,IAAOL,QAAef,EAAoBmB,EAAa,KAAK,CAAC,GAE7DE,UAAsB;GACxB,IAAI,CAACP,EAAS,MAAM,OAChB;GAEJ,IAAMQ,IAAa,mBAAmB,mBAClCL,EAAQ,KACZ,EAAE,QAAQ,mBAAmBG,EAAK,KAAK;GACvC,OAAO,KAAKE,CAAU;EAC1B,GAEMC,UAAsB;GACxB,IAAI,CAACT,EAAS,MAAM,OAChB;GAEJ,IAAMU,IAAM,gEAAgE,mBACxEP,EAAQ,KACZ,EAAE,QAAQ,mBAAmBG,EAAK,KAAK;GACvC,OAAO,KAAKI,GAAK,QAAQ;EAC7B,GAEMC,UAAoB;GACtB,IAAI,CAACX,EAAS,MAAM,OAChB;GAEJ,IAAMU,IAAM,kDAAkD,mBAC1DP,EAAQ,KACZ,EAAE,QAAQ,mBAAmBG,EAAK,KAAK;GACvC,OAAO,KAAKI,GAAK,QAAQ;EAC7B,GAEME,UAAwB;GAC1B,IAAI,CAACZ,EAAS,MAAM,OAChB;GAE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C,GAAA,EAAnB,MAAK,YAAW,CAAA,GAAG7B,EAAA,MAC3BL,EAAGL,EAAAA,GAAE,wBAAA,CAAA,GAAA,CAAA,C;;;QAETI,EAGmBuC,GAAA,EAHA,SAAOV,EAAa,GAAA;SACnC,SAAA3B,QAAmC,CAAnCF,EAAmCmC,GAAA,EAA3B,MAAK,oBAAmB,CAAA,GAAG7B,EAAA,MACnCL,EAAGL,EAAAA,GAAE,sBAAA,CAAA,GAAA,CAAA,C;;;;OAnBb,SAAAM,QAGiC,CAHjCF,EAGiCqC,GAAA;QAF7B,MAAK;QACL,WAAU;QACT,OAAOzC,EAAAA,GAAE,aAAA;;;;;;;IAsB1BG,EAOM,OAPNa,GAOM,CANFb,EAEM,OAFNc,GAEMZ,EADCL,EAAAA,GAAE,eAAA,CAAA,GAAA,CAAA,GAETG,EAEM,OAFNe,GAEMb,EADCE,EAAAsB,CAAA,CAAO,GAAA,CAAA,C;IAGlB1B,EAOM,OAPNgB,GAOM,CANFhB,EAEM,OAFNiB,GAEMf,EADCL,EAAAA,GAAE,YAAA,CAAA,GAAA,CAAA,GAETG,EAEQ,OAFRkB,GAEQhB,EADJ2B,EAAA,KAAI,GAAA,CAAA,C"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
+
import { t } from "./VvButtonLocalized-C-vx25u4.js";
|
|
3
|
+
import { n } from "./useShortUrlResolver-KJDk7QLj.js";
|
|
4
|
+
import { t as r } from "./markdown-aNRYL30G.js";
|
|
5
|
+
import "./src-nb8MU1sh.js";
|
|
6
|
+
import { VvButtonGroup as i, VvDropdown as a, VvDropdownAction as o, VvIcon as s } from "@volverjs/ui-vue/components";
|
|
7
|
+
import { computed as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, normalizeProps as h, openBlock as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
|
|
8
|
+
import { useClipboard as b } from "@vueuse/core";
|
|
9
|
+
// ../../packages/components/src/chat/PkToolShowMessage.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var x = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-surface" }, S = { class: "px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8" }, C = { class: "font-bold" }, w = { class: "p-sm" }, T = { class: "text-12 text-word-3 mb-4" }, E = { class: "text-word-2 whitespace-pre-wrap break-words" }, D = /*@__PURE__*/ p({
|
|
11
|
+
__name: "PkToolShowMessage",
|
|
12
|
+
props: { part: {} },
|
|
13
|
+
setup(e) {
|
|
14
|
+
let p = e, { copy: D, copied: O } = b(), k = c(() => p.part), { resolveText: A } = n(), j = A(() => k.value.input?.body), M = c(() => r(j.value)), N = () => {
|
|
15
|
+
if (!k.value.input) return;
|
|
16
|
+
let e = `https://wa.me/?text=${encodeURIComponent(M.value)}`;
|
|
17
|
+
window.open(e, "_blank");
|
|
18
|
+
}, P = () => {
|
|
19
|
+
if (!k.value.input) return;
|
|
20
|
+
let e = `https://t.me/share/url?text=${encodeURIComponent(M.value)}`;
|
|
21
|
+
window.open(e, "_blank");
|
|
22
|
+
}, F = () => {
|
|
23
|
+
if (!k.value.input) return;
|
|
24
|
+
let e = `sms:?body=${encodeURIComponent(M.value)}`;
|
|
25
|
+
window.open(e);
|
|
26
|
+
};
|
|
27
|
+
return (e, n) => {
|
|
28
|
+
let r = s, c = t, p = o, b = a, k = i;
|
|
29
|
+
return g(), l("div", x, [u("div", S, [
|
|
30
|
+
f(r, {
|
|
31
|
+
name: "ri:chat-1-line",
|
|
32
|
+
class: "text-16"
|
|
33
|
+
}),
|
|
34
|
+
u("strong", C, _(e.$t("label.message")), 1),
|
|
35
|
+
f(k, {
|
|
36
|
+
modifiers: "compact",
|
|
37
|
+
class: "ml-auto shrink-0"
|
|
38
|
+
}, {
|
|
39
|
+
default: y(() => [f(c, {
|
|
40
|
+
modifiers: "action-quiet-small",
|
|
41
|
+
icon: v(O) ? "ri:check-line" : "ri:file-copy-line",
|
|
42
|
+
label: v(O) ? e.$t("action.copied") : e.$t("action.copy"),
|
|
43
|
+
onClick: n[0] ||= (e) => v(D)(M.value)
|
|
44
|
+
}, null, 8, ["icon", "label"]), f(b, h(m({
|
|
45
|
+
placement: "bottom-end",
|
|
46
|
+
modifiers: "menu",
|
|
47
|
+
flip: !0,
|
|
48
|
+
offset: 3,
|
|
49
|
+
strategy: "fixed"
|
|
50
|
+
})), {
|
|
51
|
+
items: y(() => [
|
|
52
|
+
f(p, { onClick: N }, {
|
|
53
|
+
default: y(() => [f(r, { name: "ri:whatsapp-line" }), d(" " + _(e.$t("action.openInWhatsApp")), 1)]),
|
|
54
|
+
_: 1
|
|
55
|
+
}),
|
|
56
|
+
f(p, { onClick: P }, {
|
|
57
|
+
default: y(() => [f(r, { name: "ri:telegram-line" }), d(" " + _(e.$t("action.openInTelegram")), 1)]),
|
|
58
|
+
_: 1
|
|
59
|
+
}),
|
|
60
|
+
f(p, { onClick: F }, {
|
|
61
|
+
default: y(() => [f(r, { name: "ri:message-2-line" }), d(" " + _(e.$t("action.openInSms")), 1)]),
|
|
62
|
+
_: 1
|
|
63
|
+
})
|
|
64
|
+
]),
|
|
65
|
+
default: y(() => [f(c, {
|
|
66
|
+
icon: "ri:send-plane-line",
|
|
67
|
+
modifiers: "action-quiet-small",
|
|
68
|
+
label: e.$t("action.send")
|
|
69
|
+
}, null, 8, ["label"])]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 16)]),
|
|
72
|
+
_: 1
|
|
73
|
+
})
|
|
74
|
+
]), u("div", w, [u("div", T, _(e.$t("label.body")), 1), u("pre", E, _(M.value), 1)])]);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}), O = /* @__PURE__ */ e({ default: () => k }), k = D;
|
|
78
|
+
export { O as n, k as t };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=PkToolShowMessage-2pxYXo-_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkToolShowMessage-2pxYXo-_.js","names":["$t","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_withCtx","_unref","_normalizeProps","_guardReactiveProps","_createTextVNode","__exportAll","markdownToPlainText","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","PkToolShowMessage_vue_vue_type_script_setup_true_lang_default","props","__props","useClipboard","toolPart","computed","useShortUrlResolver","resolvedBody","resolveText","body","openInWhatsApp","url","openInTelegram","openInSms","_component_VvIcon","VvIcon","_component_VvButton","VvButtonLocalized","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","_component_VvButtonGroup","VvButtonGroup","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","withCtx","unref","copied","_cache","copy","normalizeProps","guardReactiveProps","createTextVNode","PkToolShowMessage_exports","PkToolShowMessage_default"],"sources":["../../../../packages/components/src/chat/PkToolShowMessage.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n import { markdownToPlainText } from 'utils'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n body: string\n }\n }\n return part\n })\n\n // Messages leave the app (WhatsApp/Telegram/SMS/clipboard), so expand short\n // urls to their real target rather than keeping the fragile `/api/r/` link.\n // The body is plain text there: drop the Markdown some models still write.\n const { resolveText } = useShortUrlResolver()\n const resolvedBody = resolveText(() => toolPart.value.input?.body)\n const body = computed(() => markdownToPlainText(resolvedBody.value))\n\n const openInWhatsApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://wa.me/?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInTelegram = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://t.me/share/url?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInSms = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `sms:?body=${encodeURIComponent(body.value)}`\n window.open(url)\n }\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:chat-1-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.message') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(body)\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:send-plane-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInWhatsApp\">\n <VvIcon name=\"ri:whatsapp-line\" />\n {{ $t('action.openInWhatsApp') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInTelegram\">\n <VvIcon name=\"ri:telegram-line\" />\n {{ $t('action.openInTelegram') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInSms\">\n <VvIcon name=\"ri:message-2-line\" />\n {{ $t('action.openInSms') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-3 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAMI,IAAMoB,IAAQC,GAIR,EAAE,SAAM,cAAWC,EAAa,GAEhCC,IAAW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AAAvB,QAAkC,CAAlCF,EAAkC6B,GAAA,EAA1B,MAAK,mBAAkB,CAAA,GAAGvB,EAAA,MAClCL,EAAGL,EAAAA,GAAE,uBAAA,CAAA,GAAA,CAAA,C;;;OAETI,EAGmBiC,GAAA,EAHA,SAAON,EAAc,GAAA;QACpC,SAAAzB,QAAkC,CAAlCF,EAAkC6B,GAAA,EAA1B,MAAK,mBAAkB,CAAA,GAAGvB,EAAA,MAClCL,EAAGL,EAAAA,GAAE,uBAAA,CAAA,GAAA,CAAA,C;;;OAETI,EAGmBiC,GAAA,EAHA,SAAOL,EAAS,GAAA;QAC/B,SAAA1B,QAAmC,CAAnCF,EAAmC6B,GAAA,EAA3B,MAAK,oBAAmB,CAAA,GAAGvB,EAAA,MACnCL,EAAGL,EAAAA,GAAE,kBAAA,CAAA,GAAA,CAAA,C;;;;MAfb,SAAAM,QAGiC,CAHjCF,EAGiC+B,GAAA;OAF7B,MAAK;OACL,WAAU;OACT,OAAOnC,EAAAA,GAAE,aAAA;;;;;;G,IAkB1BG,EAOM,OAPNa,GAOM,CANFb,EAEM,OAFNc,GAEMZ,EADCL,EAAAA,GAAE,YAAA,CAAA,GAAA,CAAA,GAETG,EAEQ,OAFRe,GAEQb,EADJuB,EAAA,KAAI,GAAA,CAAA,C"}
|
|
@@ -3,7 +3,7 @@ import { t } from "./VvButtonLocalized-C-vx25u4.js";
|
|
|
3
3
|
import { t as n } from "./PkStreamingMarkdown-WIueQOg3.js";
|
|
4
4
|
import "./src-nb8MU1sh.js";
|
|
5
5
|
import { i as r } from "./Document-CA7c3oZE.js";
|
|
6
|
-
import {
|
|
6
|
+
import { n as i } from "./markdown-aNRYL30G.js";
|
|
7
7
|
import { t as a } from "./PkUrl-IFszepUi.js";
|
|
8
8
|
import { VvIcon as o } from "@volverjs/ui-vue/components";
|
|
9
9
|
import { Fragment as s, Transition as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, normalizeClass as _, openBlock as v, reactive as y, ref as b, renderList as x, toDisplayString as S, unref as C, withCtx as w } from "vue";
|
|
@@ -260,4 +260,4 @@ var T = ["title"], E = {
|
|
|
260
260
|
}), Q = /* @__PURE__ */ e({ default: () => $ }), $ = Z;
|
|
261
261
|
export { D as i, Q as n, M as r, $ as t };
|
|
262
262
|
|
|
263
|
-
//# sourceMappingURL=PkToolShowSources-
|
|
263
|
+
//# sourceMappingURL=PkToolShowSources-B_2niEa3.js.map
|
package/dist-vue/_chunks/{PkToolShowSources-Bci0Ab2u.js.map → PkToolShowSources-B_2niEa3.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowSources-Bci0Ab2u.js","names":["_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createVNode","_createElementVNode","_toDisplayString","_unref","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_toDisplayString","PkUrl","$t","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_createTextVNode","_toDisplayString","_Fragment","_renderList","PkDocumentHeader","_createBlock","PkStreamingMarkdown","PkChunkPreview","_Transition","_withCtx","_normalizeClass","__exportAll","PkStreamingMarkdown_default","getTypeIcon","stripMarkdown","PkUrl_default","_hoisted_1$2","_hoisted_2$2","PkChunkPreview_default","defineComponent","props","__props","similarityPercent","computed","max","_component_VvIcon","VvIcon","openBlock","createElementBlock","Fragment","createVNode","createElementVNode","toDisplayString","unref","createCommentVNode","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","PkDocumentHeader_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","PkToolShowSources_vue_vue_type_script_setup_true_lang_default","toolPart","sources","groupedSources","groups","source","existing","maxSimilarity","s","expandedDocuments","reactive","expandedChunks","contextData","loadingContext","toggleDocument","documentId","toggleChunk","chunkId","handleExpandContext","content","clearContext","showMore","ref","visibleGroups","hasMore","_component_VvButton","VvButtonLocalized","createTextVNode","_ctx","renderList","group","createBlock","chunk","Transition","withCtx","normalizeClass","_cache","PkToolShowSources_exports","PkToolShowSources_default"],"sources":["../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkToolShowSources.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-3 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n /**\n * The address as text, not a link: for a header drawn inside a button,\n * where a link is invalid HTML and its click also toggles the row\n */\n mutedUrl?: boolean\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-3 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-3 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" :muted=\"mutedUrl\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-3 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header: the toggle, and beside it the link to\n the source, because a link inside a button is invalid\n HTML and its click also toggled the row -->\n <div\n class=\"flex items-center hover:bg-surface-1 transition-colors\">\n <button\n type=\"button\"\n class=\"flex items-center gap-8 p-8 flex-1 min-w-0 text-left cursor-pointer\"\n :aria-expanded=\"\n expandedDocuments.has(group.document.documentId)\n \"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\"\n muted-url />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-3 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-3 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(\n group.document.documentId,\n )\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n <VvButton\n v-if=\"group.document.sourceUrl\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:external-link-line\"\n class=\"text-10 shrink-0 mr-8\"\n :href=\"group.document.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n :title=\"$t('action.open')\"\n :aria-label=\"$t('action.open')\" />\n </div>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAII,IAAM4C,IAAQC,GAORC,IAAoBC,QAAe;GACrC,IAAIH,EAAM,cAAc,MACpB,OAAO;GAEX,IAAMI,IACFJ,EAAM,iBAAiBA,EAAM,gBAAgB,IACvCA,EAAM,gBACN;GACV,OAAO,KAAK,MAAOA,EAAM,aAAaI,IAAO,GAAG;EACpD,CAAC;;;;IAID5C,EAAsE6C,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrC5C,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAOwC,EAAA;IACnD,GAAAvC,EAAAC,EAAA+B,CAAA,CAAa,CAACO,EAAA,OAAO,CAAA,GAAA,GAAA7C,CAAA;IAEhB8C,EAAA,SAAiB,O,aAA7B5C,EAAA,GAAAC,EAEO,QAFPF,GAEOK,EADAwC,EAAA,KAAiB,IAAG,MAC3B,CAAA;IACA1C,EAE2C6C,GAAA;KADtC,MAAMJ,EAAA,WAAQ,uBAAA;KACf,OAAM;;;;;;;;;;;;;;;;;;;;;;;G,wBCdV/B,EAE2CmC,GAAA;IADtC,MAAMlC,EAAAsB,CAAA,CAAW,CAACQ,EAAA,IAAI;IACvB,OAAM;G,uBACV7B,EAaM,OAbNR,GAaM;IAZFQ,EAES,UAFTP,GAESQ,EADF4B,EAAA,IAAI,GAAA,CAAA;IAECA,EAAA,YAAZjC,EAAA,GAAAC,EAEO,QAFPH,GAEOO,EADA4B,EAAA,QAAQ,GAAA,CAAA,K;IAGLA,EAAA,OADVjC,EAAA,GAAAC,EAKO,QALPF,GAKO,CAFHG,EAAkDmC,GAAA;KAA1C,MAAK;KAAU,OAAM;I,IAC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YzB,EAAA,MACtBC,EAAGN,EAAAA,GAAE,oBAAA,CAAA,GAAA,CAAA,C;;IAWvBuF,GAAA,SADVtF,EAAA,GAAAC,EAcS,UAAA;;KAZL,OAAM;KACL,SAAK,AAAAiG,EAAA,QAAA,MAAE,EAAA,QAAQ,CAAIf,EAAA;I,IACpBhF,EAEsB0B,GAAA;KADjB,MAAMsD,EAAA,QAAQ,uBAAA;KACf,OAAM;I,uBAAY/E,EAAA,MACtBC,EACI8E,EAAA,QAA+BpF,EAAAA,GAAE,iBAAA,IAA0CA,EAAAA,GAAE,mBAAA,EAAuD,OAAAkE,EAAA,MAAe,SAAM,E"}
|
|
1
|
+
{"version":3,"file":"PkToolShowSources-B_2niEa3.js","names":["_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createVNode","_createElementVNode","_toDisplayString","_unref","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_toDisplayString","PkUrl","$t","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_createTextVNode","_toDisplayString","_Fragment","_renderList","PkDocumentHeader","_createBlock","PkStreamingMarkdown","PkChunkPreview","_Transition","_withCtx","_normalizeClass","__exportAll","PkStreamingMarkdown_default","getTypeIcon","stripMarkdown","PkUrl_default","_hoisted_1$2","_hoisted_2$2","PkChunkPreview_default","defineComponent","props","__props","similarityPercent","computed","max","_component_VvIcon","VvIcon","openBlock","createElementBlock","Fragment","createVNode","createElementVNode","toDisplayString","unref","createCommentVNode","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","PkDocumentHeader_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","PkToolShowSources_vue_vue_type_script_setup_true_lang_default","toolPart","sources","groupedSources","groups","source","existing","maxSimilarity","s","expandedDocuments","reactive","expandedChunks","contextData","loadingContext","toggleDocument","documentId","toggleChunk","chunkId","handleExpandContext","content","clearContext","showMore","ref","visibleGroups","hasMore","_component_VvButton","VvButtonLocalized","createTextVNode","_ctx","renderList","group","createBlock","chunk","Transition","withCtx","normalizeClass","_cache","PkToolShowSources_exports","PkToolShowSources_default"],"sources":["../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkToolShowSources.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-3 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n /**\n * The address as text, not a link: for a header drawn inside a button,\n * where a link is invalid HTML and its click also toggles the row\n */\n mutedUrl?: boolean\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-3 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-3 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" :muted=\"mutedUrl\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-3 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header: the toggle, and beside it the link to\n the source, because a link inside a button is invalid\n HTML and its click also toggled the row -->\n <div\n class=\"flex items-center hover:bg-surface-1 transition-colors\">\n <button\n type=\"button\"\n class=\"flex items-center gap-8 p-8 flex-1 min-w-0 text-left cursor-pointer\"\n :aria-expanded=\"\n expandedDocuments.has(group.document.documentId)\n \"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\"\n muted-url />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-3 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-3 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(\n group.document.documentId,\n )\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n <VvButton\n v-if=\"group.document.sourceUrl\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:external-link-line\"\n class=\"text-10 shrink-0 mr-8\"\n :href=\"group.document.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n :title=\"$t('action.open')\"\n :aria-label=\"$t('action.open')\" />\n </div>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAII,IAAM4C,IAAQC,GAORC,IAAoBC,QAAe;GACrC,IAAIH,EAAM,cAAc,MACpB,OAAO;GAEX,IAAMI,IACFJ,EAAM,iBAAiBA,EAAM,gBAAgB,IACvCA,EAAM,gBACN;GACV,OAAO,KAAK,MAAOA,EAAM,aAAaI,IAAO,GAAG;EACpD,CAAC;;;;IAID5C,EAAsE6C,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrC5C,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAOwC,EAAA;IACnD,GAAAvC,EAAAC,EAAA+B,CAAA,CAAa,CAACO,EAAA,OAAO,CAAA,GAAA,GAAA7C,CAAA;IAEhB8C,EAAA,SAAiB,O,aAA7B5C,EAAA,GAAAC,EAEO,QAFPF,GAEOK,EADAwC,EAAA,KAAiB,IAAG,MAC3B,CAAA;IACA1C,EAE2C6C,GAAA;KADtC,MAAMJ,EAAA,WAAQ,uBAAA;KACf,OAAM;;;;;;;;;;;;;;;;;;;;;;;G,wBCdV/B,EAE2CmC,GAAA;IADtC,MAAMlC,EAAAsB,CAAA,CAAW,CAACQ,EAAA,IAAI;IACvB,OAAM;G,uBACV7B,EAaM,OAbNR,GAaM;IAZFQ,EAES,UAFTP,GAESQ,EADF4B,EAAA,IAAI,GAAA,CAAA;IAECA,EAAA,YAAZjC,EAAA,GAAAC,EAEO,QAFPH,GAEOO,EADA4B,EAAA,QAAQ,GAAA,CAAA,K;IAGLA,EAAA,OADVjC,EAAA,GAAAC,EAKO,QALPF,GAKO,CAFHG,EAAkDmC,GAAA;KAA1C,MAAK;KAAU,OAAM;I,IAC7BnC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EAAA,MACtBC,EAAGN,EAAAA,GAAE,oBAAA,CAAA,GAAA,CAAA,C;;IAWvBuF,GAAA,SADVtF,EAAA,GAAAC,EAcS,UAAA;;KAZL,OAAM;KACL,SAAK,AAAAiG,EAAA,QAAA,MAAE,EAAA,QAAQ,CAAIf,EAAA;I,IACpBhF,EAEsB0B,GAAA;KADjB,MAAMsD,EAAA,QAAQ,uBAAA;KACf,OAAM;I,uBAAY/E,EAAA,MACtBC,EACI8E,EAAA,QAA+BpF,EAAAA,GAAE,iBAAA,IAA0CA,EAAAA,GAAE,mBAAA,EAAuD,OAAAkE,EAAA,MAAe,SAAM,E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// ../../packages/utils/src/markdown.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
if (e) return e.replace(/!\[.*?\]\(.*?\)/g, "").replace(/\[([^\]]+)\]\(.*?\)/g, "$1").replace(/`{1,3}[^`]*`{1,3}/g, "").replace(/#{1,6}\s/g, "").replace(/(\*{1,3}|_{1,3})(.*?)\1/g, "$2").replace(/~~(.*?)~~/g, "$1").replace(/^\s*[-*+>]\s+/gm, "").replace(/\n+/g, " ").trim();
|
|
4
|
+
}, t = (e) => e.replace(/^(?:https?:\/\/|mailto:|tel:)/i, ""), n = (e) => e.replace(/^([ \t]*)\* /gm, "$1- ").replace(/^ {0,3}#{1,6}[ \t]+/gm, "").replace(/\[([^[\]\n]+)\]\(([^)\s[\]]+)\)/g, (e, n, r) => n === r || n === t(r) ? n : `${n} (${r})`).replace(/(?<=^|[\s([{"'«“‘’])\*\*(?=[^\s*])([^*\n]*?[^\s*])\*\*(?=$|[\s.,;:!?…)\]}"'»”’])/gm, "$1").replace(/(?<=^|[\s([{"'«“‘’])__(?=[^\s_])([^_\n]*?[^\s_])__(?=$|[\s.,;:!?…)\]}"'»”’])/gm, "$1").replace(/^[ \t]*```[^\n]*\n?/gm, "").replace(/`/g, "");
|
|
5
|
+
export { e as n, n as t };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=markdown-aNRYL30G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-aNRYL30G.js","names":["stripMarkdown","text","withoutScheme","url","markdownToPlainText","label"],"sources":["../../../../packages/utils/src/markdown.ts"],"sourcesContent":["export const stripMarkdown = (text?: string | null) => {\n if (!text) {\n return undefined\n }\n return text\n .replace(/!\\[.*?\\]\\(.*?\\)/g, '') // images\n .replace(/\\[([^\\]]+)\\]\\(.*?\\)/g, '$1') // links\n .replace(/`{1,3}[^`]*`{1,3}/g, '') // inline code / code blocks\n .replace(/#{1,6}\\s/g, '') // headings\n .replace(/(\\*{1,3}|_{1,3})(.*?)\\1/g, '$2') // bold / italic\n .replace(/~~(.*?)~~/g, '$1') // strikethrough\n .replace(/^\\s*[-*+>]\\s+/gm, '') // lists and blockquotes\n .replace(/\\n+/g, ' ') // newlines\n .trim()\n}\n\n/** A link's URL without the scheme a reader does not type (`https://`, `mailto:`). */\nconst withoutScheme = (url: string) =>\n url.replace(/^(?:https?:\\/\\/|mailto:|tel:)/i, '')\n\n/**\n * Turns the Markdown a model may still write into text that reads right where\n * an email or message draft ends up: a mail client, WhatsApp, an SMS. Unlike\n * {@link stripMarkdown} it keeps line breaks, paragraphs and `- ` lists, keeps\n * a link's URL and leaves a lone `*` or `_` alone (`5 * 3`,\n * `mario_rossi@example.com`). A bold pair counts only between blanks or\n * punctuation, so a URL, an address or `2**3` keeps its markers. Every\n * pattern runs in linear time, so a long tool input cannot stall the event\n * loop.\n */\nexport const markdownToPlainText = (text: string) =>\n text\n .replace(/^([ \\t]*)\\* /gm, '$1- ') // `* ` list items\n .replace(/^ {0,3}#{1,6}[ \\t]+/gm, '') // headings\n .replace(\n /\\[([^[\\]\\n]+)\\]\\(([^)\\s[\\]]+)\\)/g,\n (_, label: string, url: string) =>\n label === url || label === withoutScheme(url)\n ? label\n : `${label} (${url})`,\n ) // links\n .replace(\n /(?<=^|[\\s([{\"'«“‘’])\\*\\*(?=[^\\s*])([^*\\n]*?[^\\s*])\\*\\*(?=$|[\\s.,;:!?…)\\]}\"'»”’])/gm,\n '$1',\n ) // bold\n .replace(\n /(?<=^|[\\s([{\"'«“‘’])__(?=[^\\s_])([^_\\n]*?[^\\s_])__(?=$|[\\s.,;:!?…)\\]}\"'»”’])/gm,\n '$1',\n ) // bold with underscores\n .replace(/^[ \\t]*```[^\\n]*\\n?/gm, '') // code fence lines\n .replace(/`/g, '') // inline code\n"],"mappings":";AAAA,IAAaA,KAAiB,MAAyB;CACnD,IAAKC,GAGL,OAAOA,EACF,QAAQ,oBAAoB,EAAE,CAAC,CAC/B,QAAQ,wBAAwB,IAAI,CAAC,CACrC,QAAQ,sBAAsB,EAAE,CAAC,CACjC,QAAQ,aAAa,EAAE,CAAC,CACxB,QAAQ,4BAA4B,IAAI,CAAC,CACzC,QAAQ,cAAc,IAAI,CAAC,CAC3B,QAAQ,mBAAmB,EAAE,CAAC,CAC9B,QAAQ,QAAQ,GAAG,CAAC,CACpB,KAAK;AACd,GAGMC,KAAiB,MACnBC,EAAI,QAAQ,kCAAkC,EAAE,GAYvCC,KAAuB,MAChCH,EACK,QAAQ,kBAAkB,MAAM,CAAC,CACjC,QAAQ,yBAAyB,EAAE,CAAC,CACpC,QACG,qCACC,GAAG,GAAe,MACfI,MAAUF,KAAOE,MAAUH,EAAcC,CAAG,IACtCE,IACA,GAAGA,EAAM,IAAIF,EAAI,EAC/B,CAAC,CACA,QACG,sFACA,IACJ,CAAC,CACA,QACG,kFACA,IACJ,CAAC,CACA,QAAQ,yBAAyB,EAAE,CAAC,CACpC,QAAQ,MAAM,EAAE"}
|
package/dist-vue/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { t as He } from "./_chunks/PkEditorRadioButtons-Bw576DPQ.js";
|
|
|
6
6
|
import { r as Ue, t as We } from "./_chunks/Document-CA7c3oZE.js";
|
|
7
7
|
import { a as Ge, i as Ke, n as qe, r as Je } from "./_chunks/useChatbotStore-CjFPM9Q5.js";
|
|
8
8
|
import { a as Ye, n as Xe, o as Ze } from "./_chunks/createChatbotApiClient-_gh3Y1rl.js";
|
|
9
|
-
import { t as Qe } from "./_chunks/PkChatbotMessages-
|
|
9
|
+
import { t as Qe } from "./_chunks/PkChatbotMessages-BmKGu2Sh.js";
|
|
10
10
|
import { t as $e } from "./_chunks/PkChatbotAuth-C8ZjLNFY.js";
|
|
11
11
|
import { t as et } from "./_chunks/VvButtonLocalized-C-vx25u4.js";
|
|
12
12
|
import { r as tt, t as nt } from "./_chunks/PkToolShowArtifact-CPBFsUrY.js";
|
|
@@ -14,7 +14,7 @@ import { $ as rt, A as it, B as at, C as ot, Ct as st, D as ct, E as lt, F as ut
|
|
|
14
14
|
import { n as ln, t as un } from "./_chunks/dist-CKKe4gMX.js";
|
|
15
15
|
import { n as dn, r as fn } from "./_chunks/dist-CrTGiCae.js";
|
|
16
16
|
import { a as pn, l as mn, u as hn } from "./_chunks/message-DuibQyHy.js";
|
|
17
|
-
import { a as gn, i as _n, n as vn, o as yn, s as bn, t as xn } from "./_chunks/PkChatbotViewChat-
|
|
17
|
+
import { a as gn, i as _n, n as vn, o as yn, s as bn, t as xn } from "./_chunks/PkChatbotViewChat-DEb_v4fS.js";
|
|
18
18
|
import { i as Sn, t as Cn } from "./_chunks/PkStreamingMarkdown-WIueQOg3.js";
|
|
19
19
|
import { t as wn } from "./_chunks/useDialogConfirm-fn7iV-iE.js";
|
|
20
20
|
import { i as Tn, r as En } from "./_chunks/useLightbox-DrEFS3gx.js";
|
|
@@ -23,10 +23,10 @@ import { t as On } from "./_chunks/useImageFallback-HUe4GHah.js";
|
|
|
23
23
|
import { t as kn } from "./_chunks/PkLazyImg-D_Tmtfz3.js";
|
|
24
24
|
import { n as An, t as jn } from "./_chunks/PkChatbotInput-CunAf5Rq.js";
|
|
25
25
|
import { t as Mn } from "./_chunks/useSafeLocalStorage-Bn4SsL8C.js";
|
|
26
|
-
import { i as Nn, r as Pn } from "./_chunks/PkFilePreview-
|
|
26
|
+
import { i as Nn, r as Pn } from "./_chunks/PkFilePreview-Cc8PzIcK.js";
|
|
27
27
|
import { $ as Fn, B as In, D as Ln, F as Rn, M as zn, R as Bn, U as Vn, W as Hn, _ as Un, et as Wn, l as Gn, tt as Kn, x as qn, y as Jn } from "./_chunks/utils-BYvQMZLG.js";
|
|
28
28
|
import { t as Yn } from "./_chunks/PkAvatar-DwtZWSW4.js";
|
|
29
|
-
import { i as Xn, n as Zn, r as Qn, t as $n } from "./_chunks/PkChatbotViewConversations-
|
|
29
|
+
import { i as Xn, n as Zn, r as Qn, t as $n } from "./_chunks/PkChatbotViewConversations-BrgBXjpa.js";
|
|
30
30
|
import { r as er, t as tr } from "./_chunks/PkToolShowForm-CAadu_Pq.js";
|
|
31
31
|
import "./_chunks/src-nb8MU1sh.js";
|
|
32
32
|
import { t as nr } from "./_chunks/PkSvgViewer-PAr87kCa.js";
|
|
@@ -35,16 +35,16 @@ import { n as ir, t as ar } from "./_chunks/PkRelativeTime-CZF5CYHv.js";
|
|
|
35
35
|
import { n as or, t as sr } from "./_chunks/PkChatbotSteps-HACZ1RrB.js";
|
|
36
36
|
import { t as cr } from "./_chunks/PkChatbotFeedbackForm-DjsLxYjT.js";
|
|
37
37
|
import { t as lr } from "./_chunks/PkChatbotFilePreview-aKJBtw04.js";
|
|
38
|
-
import { i as ur, r as dr, t as fr } from "./_chunks/PkToolShowSources-
|
|
38
|
+
import { i as ur, r as dr, t as fr } from "./_chunks/PkToolShowSources-B_2niEa3.js";
|
|
39
39
|
import { t as pr } from "./_chunks/PkChatbotStepPayload-BQDpTDgn.js";
|
|
40
40
|
import { t as mr } from "./_chunks/PkChatbotStepToolDetail-Dsf9t1B6.js";
|
|
41
41
|
import { t as hr } from "./_chunks/PkChatbotEmptyState-D6S0iYe3.js";
|
|
42
42
|
import { t as gr } from "./_chunks/PkChatbotViewProfile-BuJtqq8F.js";
|
|
43
|
-
import { t as _r } from "./_chunks/PkChatbot-
|
|
43
|
+
import { t as _r } from "./_chunks/PkChatbot-DLO9Xc4K.js";
|
|
44
44
|
import { t as vr } from "./_chunks/useLocalizedString-Dmn92nix.js";
|
|
45
45
|
import { t as yr } from "./_chunks/mcpOAuthReport-D-MtFYwN.js";
|
|
46
|
-
import { t as br } from "./_chunks/PkToolShowEmail-
|
|
47
|
-
import { t as xr } from "./_chunks/PkToolShowMessage-
|
|
46
|
+
import { t as br } from "./_chunks/PkToolShowEmail-C_iJsuec.js";
|
|
47
|
+
import { t as xr } from "./_chunks/PkToolShowMessage-2pxYXo-_.js";
|
|
48
48
|
import { t as Sr } from "./_chunks/PkToolShowWebPages-CHrHuFZI.js";
|
|
49
49
|
import { t as Cr } from "./_chunks/PkToolShowProductList-CZFkf9UD.js";
|
|
50
50
|
import { t as wr } from "./_chunks/PkToolShowContactForm-6OQ-hjCt.js";
|
|
@@ -56,7 +56,7 @@ import { t as kr } from "./_chunks/PkToolShowImageGallery-BlTyCF8h.js";
|
|
|
56
56
|
import { t as Ar } from "./_chunks/PkToolShowSuggestedReply-DCZbwFhR.js";
|
|
57
57
|
import { t as jr } from "./_chunks/PkToolShareDocument-Bkt9JVqk.js";
|
|
58
58
|
import { t as Mr } from "./_chunks/PkToolChatFile-W6OJP7HH.js";
|
|
59
|
-
import { t as Nr } from "./_chunks/PkFilePreviewDialog-
|
|
59
|
+
import { t as Nr } from "./_chunks/PkFilePreviewDialog-D4XuwOvp.js";
|
|
60
60
|
import { t as Pr } from "./_chunks/PkToolRequestGeolocation-BPZfJfR1.js";
|
|
61
61
|
import { VvAccordion as Fr, VvAccordionGroup as Ir, VvAlert as Lr, VvAlertGroup as Rr, VvBadge as zr, VvButtonGroup as Br, VvCheckbox as Vr, VvCombobox as Hr, VvDialog as Ur, VvDropdown as Wr, VvDropdownAction as Gr, VvIcon as Kr, VvInputFile as qr, VvInputRange as Jr, VvInputText as Yr, VvTab as Xr, VvTextarea as Zr } from "@volverjs/ui-vue/components";
|
|
62
62
|
import { Fragment as j, Teleport as Qr, Transition as $r, TransitionGroup as ei, cloneVNode as ti, computed as M, createApp as ni, createBlock as N, createCommentVNode as P, createElementBlock as F, createElementVNode as I, createSlots as ri, createStaticVNode as ii, createTextVNode as L, createVNode as R, defineComponent as z, guardReactiveProps as ai, h as oi, inject as B, isRef as si, isVNode as ci, mergeModels as li, mergeProps as ui, nextTick as di, normalizeClass as fi, normalizeProps as pi, normalizeStyle as mi, onBeforeUnmount as hi, onMounted as gi, onUnmounted as _i, openBlock as V, provide as vi, reactive as yi, readonly as bi, ref as H, renderList as xi, renderSlot as Si, resolveComponent as Ci, resolveDynamicComponent as wi, shallowRef as Ti, toDisplayString as U, toRef as Ei, toRefs as Di, unref as W, useId as Oi, useModel as G, useSlots as ki, useTemplateRef as Ai, vModelSelect as ji, vModelText as Mi, watch as K, withCtx as q, withDirectives as Ni, withKeys as Pi, withModifiers as Fi } from "vue";
|
|
@@ -7,6 +7,8 @@ import { Component } from 'vue';
|
|
|
7
7
|
* Registering a preview needs no change to the card: tools with no entry here
|
|
8
8
|
* show only the localized confirmation prompt (no raw echo of the call input).
|
|
9
9
|
* Reuse the component that already renders that kind of payload when there is
|
|
10
|
-
* one (e.g. `sendEmail` will reuse `PkToolShowEmail`).
|
|
10
|
+
* one (e.g. `sendEmail` will reuse `PkToolShowEmail`). Mind that the draft
|
|
11
|
+
* cards drop the Markdown from the body: a preview must show the text the
|
|
12
|
+
* tool will send, so it cleans the sent body the same way or none at all.
|
|
11
13
|
*/
|
|
12
14
|
export declare const toolApprovalPreviews: Record<string, Component>;
|
package/package.json
CHANGED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { f as e, o as t, r as n, s as r } from "./index.es-CEYwDeKz.js";
|
|
2
|
-
import { t as i } from "./VvButtonLocalized-D_gumqSJ.js";
|
|
3
|
-
import { Dt as a, E as o, S as s, Tt as c, g as l, h as u, k as d, kt as f, ot as p, tt as m, w as h, wt as g, x as _, y as v, z as y } from "./vue.runtime.esm-bundler-DZgpK-ja.js";
|
|
4
|
-
import { i as b } from "./dist-CR8l0inH.js";
|
|
5
|
-
import { n as x } from "./useShortUrlResolver-DAVZE_by.js";
|
|
6
|
-
// ../../packages/components/src/chat/PkToolShowEmail.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
d(), c(), p();
|
|
8
|
-
var S = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-surface" }, C = { class: "px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8" }, w = { class: "font-bold" }, T = { class: "border-b border-surface-3 p-sm" }, E = { class: "text-12 text-word-3 mb-4" }, D = { class: "text-word-2 font-semibold" }, O = { class: "p-sm" }, k = { class: "text-12 text-word-3 mb-4" }, A = { class: "text-word-2 whitespace-pre-wrap break-words" }, j = /* @__PURE__ */ h({
|
|
9
|
-
__name: "PkToolShowEmail",
|
|
10
|
-
props: { part: { type: null } },
|
|
11
|
-
setup(c) {
|
|
12
|
-
let d = c, { copy: p, copied: h } = b(), j = u(() => d.part), { resolveText: M } = x(), N = M(() => j.value.input?.subject), P = M(() => j.value.input?.body), F = () => {
|
|
13
|
-
if (!j.value.input) return;
|
|
14
|
-
let e = `mailto:?subject=${encodeURIComponent(N.value)}&body=${encodeURIComponent(P.value)}`;
|
|
15
|
-
window.open(e);
|
|
16
|
-
}, I = () => {
|
|
17
|
-
if (!j.value.input) return;
|
|
18
|
-
let e = `https://outlook.office.com/mail/deeplink/compose?to=&subject=${encodeURIComponent(N.value)}&body=${encodeURIComponent(P.value)}`;
|
|
19
|
-
window.open(e, "_blank");
|
|
20
|
-
}, L = () => {
|
|
21
|
-
if (!j.value.input) return;
|
|
22
|
-
let e = `https://mail.google.com/mail/u/0/?tf=cm&to=&su=${encodeURIComponent(N.value)}&body=${encodeURIComponent(P.value)}`;
|
|
23
|
-
window.open(e, "_blank");
|
|
24
|
-
}, R = () => {
|
|
25
|
-
if (!j.value.input) return;
|
|
26
|
-
let e = `https://compose.mail.yahoo.com/?to=&subject=${encodeURIComponent(N.value)}&body=${encodeURIComponent(P.value)}`;
|
|
27
|
-
window.open(e, "_blank");
|
|
28
|
-
};
|
|
29
|
-
return (c, u) => {
|
|
30
|
-
let d = n, b = i, x = r, j = t, M = e;
|
|
31
|
-
return y(), v("div", S, [
|
|
32
|
-
l("div", C, [
|
|
33
|
-
s(d, {
|
|
34
|
-
name: "ri:mail-line",
|
|
35
|
-
class: "text-16"
|
|
36
|
-
}),
|
|
37
|
-
l("strong", w, f(c.$t("label.email")), 1),
|
|
38
|
-
s(M, {
|
|
39
|
-
modifiers: "compact",
|
|
40
|
-
class: "ml-auto shrink-0"
|
|
41
|
-
}, {
|
|
42
|
-
default: m(() => [s(b, {
|
|
43
|
-
modifiers: "action-quiet-small",
|
|
44
|
-
icon: g(h) ? "ri:check-line" : "ri:file-copy-line",
|
|
45
|
-
label: g(h) ? c.$t("action.copied") : c.$t("action.copy"),
|
|
46
|
-
onClick: u[0] ||= (e) => g(p)(`${g(N)}\n\n${g(P)}`)
|
|
47
|
-
}, null, 8, ["icon", "label"]), s(j, a(o({
|
|
48
|
-
placement: "bottom-end",
|
|
49
|
-
modifiers: "menu",
|
|
50
|
-
flip: !0,
|
|
51
|
-
offset: 3,
|
|
52
|
-
strategy: "fixed"
|
|
53
|
-
})), {
|
|
54
|
-
items: m(() => [
|
|
55
|
-
s(x, { onClick: I }, {
|
|
56
|
-
default: m(() => [s(d, { name: "mdi:outlook" }), _(" " + f(c.$t("action.openInOutlook")), 1)]),
|
|
57
|
-
_: 1
|
|
58
|
-
}),
|
|
59
|
-
s(x, { onClick: L }, {
|
|
60
|
-
default: m(() => [s(d, { name: "mdi:gmail" }), _(" " + f(c.$t("action.openInGmail")), 1)]),
|
|
61
|
-
_: 1
|
|
62
|
-
}),
|
|
63
|
-
s(x, { onClick: R }, {
|
|
64
|
-
default: m(() => [s(d, { name: "mdi:yahoo" }), _(" " + f(c.$t("action.openInYahooMail")), 1)]),
|
|
65
|
-
_: 1
|
|
66
|
-
}),
|
|
67
|
-
s(x, { onClick: F }, {
|
|
68
|
-
default: m(() => [s(d, { name: "ri:mail-open-line" }), _(" " + f(c.$t("action.openInMailApp")), 1)]),
|
|
69
|
-
_: 1
|
|
70
|
-
})
|
|
71
|
-
]),
|
|
72
|
-
default: m(() => [s(b, {
|
|
73
|
-
icon: "ri:mail-send-line",
|
|
74
|
-
modifiers: "action-quiet-small",
|
|
75
|
-
label: c.$t("action.send")
|
|
76
|
-
}, null, 8, ["label"])]),
|
|
77
|
-
_: 1
|
|
78
|
-
}, 16)]),
|
|
79
|
-
_: 1
|
|
80
|
-
})
|
|
81
|
-
]),
|
|
82
|
-
l("div", T, [l("div", E, f(c.$t("label.subject")), 1), l("div", D, f(g(N)), 1)]),
|
|
83
|
-
l("div", O, [l("div", k, f(c.$t("label.body")), 1), l("pre", A, f(g(P)), 1)])
|
|
84
|
-
]);
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
export { j as default };
|
|
89
|
-
|
|
90
|
-
//# sourceMappingURL=PkToolShowEmail-CQ4uyty9.js.map
|