@8wave/ai-elements 0.126.0-beta.34 → 0.126.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{PkChatbotFilePreview-B4vbUkNp.js → PkChatbotFilePreview-Cw3va5vW.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-B4vbUkNp.js.map → PkChatbotFilePreview-Cw3va5vW.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-C6ZZablL.js → PkFilePreview-D4TgY0T9.js} +3 -3
- package/dist/_chunks/{PkFilePreview-C6ZZablL.js.map → PkFilePreview-D4TgY0T9.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-BzBHAt8l.js → PkFilePreviewDialog-8H1GeV91.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-BzBHAt8l.js.map → PkFilePreviewDialog-8H1GeV91.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-Dm34WFmS.js → PkImageEditorDialog-BqHjVX97.js} +2 -2
- package/dist/_chunks/{PkImageEditorDialog-Dm34WFmS.js.map → PkImageEditorDialog-BqHjVX97.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-CYqbMEjg.js → PkSelectionActions-BxUXWFNK.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-CYqbMEjg.js.map → PkSelectionActions-BxUXWFNK.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-B8rZbprU.js → PkStreamingMarkdown-14rJ_FK2.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-B8rZbprU.js.map → PkStreamingMarkdown-14rJ_FK2.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-C0emIVfS.js → PkToolChatFile-CSBzfuyE.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-C0emIVfS.js.map → PkToolChatFile-CSBzfuyE.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-DYr0Rq4D.js → PkToolShareDocument-Kq7SFbw5.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-DYr0Rq4D.js.map → PkToolShareDocument-Kq7SFbw5.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-B_KIIjEn.js → PkToolShowArtifact-d5tKvM01.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-B_KIIjEn.js.map → PkToolShowArtifact-d5tKvM01.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-DiHb3fRQ.js → PkToolShowContactForm-Bni1QzXV.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-DiHb3fRQ.js.map → PkToolShowContactForm-Bni1QzXV.js.map} +1 -1
- package/dist/_chunks/{PkToolShowEmail-CClEA1rp.js → PkToolShowEmail-D6Mw24jB.js} +2 -2
- package/dist/_chunks/{PkToolShowEmail-CClEA1rp.js.map → PkToolShowEmail-D6Mw24jB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-BmUAhIQy.js → PkToolShowForm-CFXtO0j4.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-BmUAhIQy.js.map → PkToolShowForm-CFXtO0j4.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CZ394fdT.js → PkToolShowImageGallery-Ci_Kg44s.js} +7 -2
- package/dist/_chunks/PkToolShowImageGallery-Ci_Kg44s.js.map +1 -0
- package/dist/_chunks/{PkToolShowLocation-DaFjO8MV.js → PkToolShowLocation-DV0puCbD.js} +136 -135
- package/dist/_chunks/PkToolShowLocation-DV0puCbD.js.map +1 -0
- package/dist/_chunks/{PkToolShowMessage-DIDp9JCf.js → PkToolShowMessage-Bq2dbSy1.js} +2 -2
- package/dist/_chunks/{PkToolShowMessage-DIDp9JCf.js.map → PkToolShowMessage-Bq2dbSy1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-uNvUr2s9.js → PkToolShowProductList-BWWzkWWA.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-uNvUr2s9.js.map → PkToolShowProductList-BWWzkWWA.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Dm0L4prK.js → PkToolShowSources-Dv7hbDyy.js} +8 -8
- package/dist/_chunks/{PkToolShowSources-Dm0L4prK.js.map → PkToolShowSources-Dv7hbDyy.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-Cj2mJrs5.js → PkToolShowWebPages-XxcYBQpr.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-Cj2mJrs5.js.map → PkToolShowWebPages-XxcYBQpr.js.map} +1 -1
- package/dist/_chunks/{utils-DPGBO-HU.js → utils-DE4cAz37.js} +43 -40
- package/dist/_chunks/utils-DE4cAz37.js.map +1 -0
- package/dist/ai-elements.es.js +1270 -1250
- 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/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-CXpftmWm.js → PkChatbot-CFJmT4nN.js} +7 -6
- package/dist-vue/_chunks/PkChatbot-CFJmT4nN.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotAudioTranscript-DgmuXalb.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-vA2v4FES.js → PkChatbotEmptyState-CLfzcH_t.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-vA2v4FES.js.map → PkChatbotEmptyState-CLfzcH_t.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-aKJBtw04.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-CIIJ1bpF.js → PkChatbotInput-C9l_1I3d.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotInput-CIIJ1bpF.js.map → PkChatbotInput-C9l_1I3d.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-_-h-egX7.js +1072 -0
- package/dist-vue/_chunks/{PkChatbotMessages-15R8RxAq.js.map → PkChatbotMessages-_-h-egX7.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-BbNSav-U.js → PkChatbotStepPayload-fyrbP7yS.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-BbNSav-U.js.map → PkChatbotStepPayload-fyrbP7yS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-B_4pmbLe.js → PkChatbotStepToolDetail-Drhc6X-x.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-B_4pmbLe.js.map → PkChatbotStepToolDetail-Drhc6X-x.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-h4E6DH_g.js → PkChatbotSteps-DZwV7UVr.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-h4E6DH_g.js.map → PkChatbotSteps-DZwV7UVr.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CLQ0J9_f.js → PkChatbotViewChat-Bg-Op2Oe.js} +7 -6
- package/dist-vue/_chunks/{PkChatbotViewChat-CLQ0J9_f.js.map → PkChatbotViewChat-Bg-Op2Oe.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-DFBbypGg.js → PkChatbotViewConversations--smzyxqN.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotViewConversations-DFBbypGg.js.map → PkChatbotViewConversations--smzyxqN.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-B0AZvHTr.js → PkChatbotViewProfile-Cn7IQfnQ.js} +2 -1
- package/dist-vue/_chunks/PkChatbotViewProfile-Cn7IQfnQ.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreview-Cb-1YRPN.js → PkFilePreview-DydUI1G2.js} +54 -54
- package/dist-vue/_chunks/{PkFilePreview-Cb-1YRPN.js.map → PkFilePreview-DydUI1G2.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-Bd7kEoCB.js → PkFilePreviewDialog-BuG1whsJ.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-Bd7kEoCB.js.map → PkFilePreviewDialog-BuG1whsJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-Bj4sUHXM.js → PkImageEditorDialog-_-UkV0CO.js} +2 -2
- package/dist-vue/_chunks/{PkImageEditorDialog-Bj4sUHXM.js.map → PkImageEditorDialog-_-UkV0CO.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BcUq4ThC.js → PkStreamingMarkdown-ha0V58V9.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-BcUq4ThC.js.map → PkStreamingMarkdown-ha0V58V9.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-BOexrlLt.js → PkToolChatFile-OusYITiO.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-BOexrlLt.js.map → PkToolChatFile-OusYITiO.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C4gHB6lH.js → PkToolShowArtifact-x57Gri2a.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C4gHB6lH.js.map → PkToolShowArtifact-x57Gri2a.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowChart-CsPXNAb9.js → PkToolShowChart-BSnYmoJJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowChart-CsPXNAb9.js.map → PkToolShowChart-BSnYmoJJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-2_HBPZaa.js → PkToolShowContactForm-D0lDC69x.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-2_HBPZaa.js.map → PkToolShowContactForm-D0lDC69x.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-cCbeL6MK.js → PkToolShowDiagram-BR4fE_be.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-cCbeL6MK.js.map → PkToolShowDiagram-BR4fE_be.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-BehvoNsz.js → PkToolShowEmail-idhNR5-l.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-BehvoNsz.js.map → PkToolShowEmail-idhNR5-l.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DjB3fji5.js → PkToolShowForm-yh0YAXcg.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-DjB3fji5.js.map → PkToolShowForm-yh0YAXcg.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-C22TCUKW.js → PkToolShowImageGallery-mmUY1Yfg.js} +8 -3
- package/dist-vue/_chunks/PkToolShowImageGallery-mmUY1Yfg.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowLocation-CqqtwH_R.js → PkToolShowLocation-CyaKgQUX.js} +3 -3
- package/dist-vue/_chunks/PkToolShowLocation-CyaKgQUX.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowMessage-Cca7K7GQ.js → PkToolShowMessage-B4gztWUk.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-Cca7K7GQ.js.map → PkToolShowMessage-B4gztWUk.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BvtmiHBf.js → PkToolShowProductList-B-ya1TDt.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowProductList-BvtmiHBf.js.map → PkToolShowProductList-B-ya1TDt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-uKO4MQgd.js → PkToolShowSources-DYkHkVdX.js} +8 -8
- package/dist-vue/_chunks/{PkToolShowSources-uKO4MQgd.js.map → PkToolShowSources-DYkHkVdX.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-DKj5N1vo.js → PkToolShowVideo-CRg2lAY8.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-DKj5N1vo.js.map → PkToolShowVideo-CRg2lAY8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BNZmbCSf.js → PkToolShowWebPages-C_pWag94.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowWebPages-BNZmbCSf.js.map → PkToolShowWebPages-C_pWag94.js.map} +1 -1
- package/dist-vue/_chunks/{utils-waie4Gfn.js → utils-Df5n2cDc.js} +66 -59
- package/dist-vue/_chunks/utils-Df5n2cDc.js.map +1 -0
- package/dist-vue/composables.js +5 -5
- package/dist-vue/index.js +3960 -3954
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +4 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +9 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolShowImageGallery-CZ394fdT.js.map +0 -1
- package/dist/_chunks/PkToolShowLocation-DaFjO8MV.js.map +0 -1
- package/dist/_chunks/utils-DPGBO-HU.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-CXpftmWm.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-15R8RxAq.js +0 -1068
- package/dist-vue/_chunks/PkChatbotViewProfile-B0AZvHTr.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowImageGallery-C22TCUKW.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowLocation-CqqtwH_R.js.map +0 -1
- package/dist-vue/_chunks/utils-waie4Gfn.js.map +0 -1
|
@@ -5,7 +5,7 @@ import { i as b } from "./dist-CR8l0inH.js";
|
|
|
5
5
|
import { n as x } from "./useShortUrlResolver-DAVZE_by.js";
|
|
6
6
|
// ../../packages/components/src/chat/PkToolShowMessage.vue?vue&type=script&setup=true&lang.ts
|
|
7
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: "p-sm" }, E = { class: "text-12 text-word-
|
|
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: "p-sm" }, E = { class: "text-12 text-word-3 mb-4" }, D = { class: "text-word-2 whitespace-pre-wrap break-words" }, O = /* @__PURE__ */ h({
|
|
9
9
|
__name: "PkToolShowMessage",
|
|
10
10
|
props: { part: { type: null } },
|
|
11
11
|
setup(c) {
|
|
@@ -75,4 +75,4 @@ var S = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
|
|
|
75
75
|
});
|
|
76
76
|
export { O as default };
|
|
77
77
|
|
|
78
|
-
//# sourceMappingURL=PkToolShowMessage-
|
|
78
|
+
//# sourceMappingURL=PkToolShowMessage-Bq2dbSy1.js.map
|
package/dist/_chunks/{PkToolShowMessage-DIDp9JCf.js.map → PkToolShowMessage-Bq2dbSy1.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowMessage-
|
|
1
|
+
{"version":3,"file":"PkToolShowMessage-Bq2dbSy1.js","names":["$t","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_withCtx","_unref","_normalizeProps","_guardReactiveProps","_createTextVNode","ou","ia","Ee","du","VvButtonLocalized","normalizeProps","guardReactiveProps","createVNode","init_shared_esm_bundler","createBaseVNode","computed","init_runtime_core_esm_bundler","toDisplayString","init_reactivity_esm_bundler","withCtx","defineComponent","unref","createTextVNode","createElementBlock","openBlock","useClipboard","useShortUrlResolver","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","PkToolShowMessage_default","props","__props","toolPart","body","resolveText","openInWhatsApp","url","openInTelegram","openInSms","_component_VvIcon","_component_VvButton","_component_VvDropdownAction","_component_VvDropdown","_component_VvButtonGroup","_ctx","copied","_cache","copy"],"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\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 const { resolveText } = useShortUrlResolver()\n const body = resolveText(() => toolPart.value.input?.body)\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":";;;;;;;;;;;EAKI,IAAMwC,IAAQC,GAIR,EAAE,SAAM,cAAWV,EAAa,GAEhCW,IAAWrB,QACAmB,EAAM,IAMtB,GAIK,EAAE,mBAAgBR,EAAoB,GACtCW,IAAOC,QAAkBF,EAAS,MAAM,OAAO,IAAI,GAEnDG,UAAuB;GACzB,IAAI,CAACH,EAAS,MAAM,OAChB;GAEJ,IAAMI,IAAM,uBAAuB,mBAAmBH,EAAK,KAAK;GAChE,OAAO,KAAKG,GAAK,QAAQ;EAC7B,GAEMC,UAAuB;GACzB,IAAI,CAACL,EAAS,MAAM,OAChB;GAEJ,IAAMI,IAAM,+BAA+B,mBAAmBH,EAAK,KAAK;GACxE,OAAO,KAAKG,GAAK,QAAQ;EAC7B,GAEME,UAAkB;GACpB,IAAI,CAACN,EAAS,MAAM,OAChB;GAEJ,IAAMI,IAAM,aAAa,mBAAmBH,EAAK,KAAK;GACtD,OAAO,KAAKG,CAAG;EACnB;;;GAIA,OAAA7C,EAAA,GAAAC,EAmDM,OAnDN+B,GAmDM,CAjDF9B,EAwCM,OAxCN+B,GAwCM;IAtCF9B,EAAgD6C,GAAA;KAAxC,MAAK;KAAiB,OAAM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,GAEMhC,EADCL,EAAAA,GAAE,YAAA,CAAA,GAAA,CAAA,GAETG,EAEQ,OAFRmC,GAEQjC,EADJE,EAAAoC,CAAA,CAAI,GAAA,CAAA,C"}
|
package/dist/_chunks/{PkToolShowProductList-uNvUr2s9.js → PkToolShowProductList-BWWzkWWA.js}
RENAMED
|
@@ -11,7 +11,7 @@ var C = {
|
|
|
11
11
|
class: "vv-item-group vv-item-group--framed w-full"
|
|
12
12
|
}, w = { class: "flex flex-col gap-4 min-w-0 flex-1" }, T = { class: "font-bold text-12 text-word-1 truncate" }, E = {
|
|
13
13
|
key: 0,
|
|
14
|
-
class: "text-10 text-word-
|
|
14
|
+
class: "text-10 text-word-3 truncate flex items-center gap-4"
|
|
15
15
|
}, D = { class: "flex items-center gap-sm flex-wrap text-12" }, O = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "font-semibold text-word-1"
|
|
@@ -68,4 +68,4 @@ var C = {
|
|
|
68
68
|
});
|
|
69
69
|
export { j as default };
|
|
70
70
|
|
|
71
|
-
//# sourceMappingURL=PkToolShowProductList-
|
|
71
|
+
//# sourceMappingURL=PkToolShowProductList-BWWzkWWA.js.map
|
package/dist/_chunks/{PkToolShowProductList-uNvUr2s9.js.map → PkToolShowProductList-BWWzkWWA.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowProductList-
|
|
1
|
+
{"version":3,"file":"PkToolShowProductList-BWWzkWWA.js","names":["_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createBlock","_resolveDynamicComponent","_withCtx","_unref","PkHeldImage","PkLazyImg","_createElementVNode","_toDisplayString","_createVNode","PkUrl","Ee","normalizeClass","createVNode","init_shared_esm_bundler","renderList","resolveDynamicComponent","createBlock","Fragment","createBaseVNode","computed","init_runtime_core_esm_bundler","toDisplayString","init_reactivity_esm_bundler","withCtx","createCommentVNode","defineComponent","unref","createElementBlock","openBlock","PkLazyImg_default","useChatImageGate","PkHeldImage_default","PkUrl_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowProductList_default","props","__props","toolPart","imageGate","_component_VvIcon","index","product"],"sources":["../../../../packages/components/src/chat/PkToolShowProductList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-3 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOI,IAAM+C,IAAQC,GAIRC,IAAWzB,QACAuB,EAAM,IAatB,GAIKG,IAAYf,EAAiB;;;GAKzB,OAAAc,EAAA,OAAU,OAAO,UAAU,UADrCjD,EAAA,GAAAC,EA6DK,MA7DLqC,GA6DK,EA1DDtC,EAAA,EAAA,GAAAC,EAyDKC,GAAA,MAAAC,EAxD0B8C,EAAA,MAAS,MAAM,WAAlC,GAAS,OADrBjD,EAAA,GAAAC,EAyDK,MAAA;IAvDA,KAAKmD;IACN,OAAKhD,EAAA,CAAC,WAAS,EAAA,kBAAA,CACciD,EAAQ,IAAG,CAAA,CAAA;G,KAExCrD,EAAA,GAAAK,EAkDYC,EAjDH+C,EAAQ,MAAG,MAAA,KAAA,GAAA;IACf,MAAMA,EAAQ;IACd,QAAQA,EAAQ,MAAG,WAAc,KAAA;IACjC,KAAKA,EAAQ,MAAG,wBAA2B,KAAA;IAC5C,OAAM;;IAGN,SAAA9C,QAIkD,CAHxC8C,EAAQ,SAAK,CAAK7C,EAAA0C,CAAA,CAAS,CAAC,QAAQG,EAAQ,KAAK,KAD3DrD,EAAA,GAAAK,EAIkDI,GAAA;;KAF7C,MAAMD,EAAA0C,CAAA,CAAS,CAAC,OAAOG,EAAQ,KAAK;KACrC,OAAM;KACL,YAAO,MAAE7C,EAAA0C,CAAA,CAAS,CAAC,QAAQG,EAAQ,KAAK;I,sCAE9BA,EAAQ,SADvBrD,EAAA,GAAAK,EAK8FK,GAAA;;KAHzF,KAAK2C,EAAQ;KACb,KAAKA,EAAQ;KACd,iBAAc;KACd,OAAM;I,0CACV1C,EA8BM,OA9BN4B,GA8BM;KA7BF5B,EAES,UAFT6B,GAES5B,EADFyC,EAAQ,IAAI,GAAA,CAAA;KAGTA,EAAQ,OADlBrD,EAAA,GAAAC,EAKO,QALPwC,GAKO,CAFH5B,EAAkDsC,GAAA;MAA1C,MAAK;MAAU,OAAM;K,IAC7BtC,EAA4BC,GAAA,EAApB,KAAKuC,EAAQ,I;KAEzB1C,EAcM,OAdN+B,GAcM,CAZQW,EAAQ,SADlBrD,EAAA,GAAAC,EAIO,QAJP0C,GAIO/B,EADAyC,EAAQ,KAAK,GAAA,CAAA,K,WAMVA,EAAQ,gBADlBrD,EAAA,GAAAC,EAIO,QAJP2C,GAIOhC,EADAyC,EAAQ,YAAY,GAAA,CAAA,K;KAIrBA,EAAQ,eADlBrD,EAAA,GAAAC,EAII,KAJJ4C,GAIIjC,EADGyC,EAAQ,WAAW,GAAA,CAAA,K"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./VvButtonLocalized-BgY-V26j.js";
|
|
2
2
|
import { r as t } from "./index.es-BYhSukum.js";
|
|
3
3
|
import { Et as n, S as r, Tt as i, V as a, _ as o, f as s, g as c, gt as l, h as u, k as d, kt as f, mt as p, ot as m, r as h, t as g, tt as _, v, w as y, wt as b, x, y as S, z as C } from "./vue.runtime.esm-bundler-DZgpK-ja.js";
|
|
4
|
-
import { t as w } from "./PkStreamingMarkdown-
|
|
4
|
+
import { t as w } from "./PkStreamingMarkdown-14rJ_FK2.js";
|
|
5
5
|
import "./src-QHwDXo7q.js";
|
|
6
6
|
import { r as T, t as E } from "./markdown-nw5sXwU0.js";
|
|
7
7
|
import { t as D } from "./PkUrl-BmTQ6PVk.js";
|
|
@@ -9,7 +9,7 @@ import { t as D } from "./PkUrl-BmTQ6PVk.js";
|
|
|
9
9
|
d(), m(), i();
|
|
10
10
|
var O = ["title"], k = {
|
|
11
11
|
key: 0,
|
|
12
|
-
class: "text-10 text-word-
|
|
12
|
+
class: "text-10 text-word-3 shrink-0"
|
|
13
13
|
}, ee = /* @__PURE__ */ y({
|
|
14
14
|
__name: "PkChunkPreview",
|
|
15
15
|
props: {
|
|
@@ -48,10 +48,10 @@ var O = ["title"], k = {
|
|
|
48
48
|
d(), m(), i();
|
|
49
49
|
var A = { class: "flex flex-col gap-2 min-w-0 flex-1" }, j = { class: "font-bold text-12 text-word-1 truncate block" }, M = {
|
|
50
50
|
key: 0,
|
|
51
|
-
class: "text-10 text-word-
|
|
51
|
+
class: "text-10 text-word-3 truncate"
|
|
52
52
|
}, N = {
|
|
53
53
|
key: 1,
|
|
54
|
-
class: "text-10 text-word-
|
|
54
|
+
class: "text-10 text-word-3 truncate flex items-center gap-4"
|
|
55
55
|
}, P = /* @__PURE__ */ y({
|
|
56
56
|
__name: "PkDocumentHeader",
|
|
57
57
|
props: {
|
|
@@ -86,10 +86,10 @@ d(), i(), h(), m();
|
|
|
86
86
|
var F = {
|
|
87
87
|
key: 0,
|
|
88
88
|
class: "flex flex-col gap-xs w-full"
|
|
89
|
-
}, I = { class: "flex items-center gap-4 text-12 text-word-3 font-semibold" }, L = { class: "text-word-
|
|
89
|
+
}, I = { class: "flex items-center gap-4 text-12 text-word-3 font-semibold" }, L = { class: "text-word-3 font-normal" }, R = { class: "flex flex-col gap-xs" }, z = { class: "flex items-center hover:bg-surface-1 transition-colors" }, B = ["aria-expanded", "onClick"], V = { class: "flex items-center gap-4 shrink-0" }, H = {
|
|
90
90
|
key: 0,
|
|
91
|
-
class: "text-10 text-word-
|
|
92
|
-
}, U = { class: "text-10 text-word-
|
|
91
|
+
class: "text-10 text-word-3 bg-surface-2 rounded px-4 py-2"
|
|
92
|
+
}, U = { class: "text-10 text-word-3 bg-surface-2 rounded px-4 py-2 uppercase" }, W = {
|
|
93
93
|
key: 0,
|
|
94
94
|
class: "border-t border-surface-3"
|
|
95
95
|
}, G = ["onClick"], K = {
|
|
@@ -265,4 +265,4 @@ var F = {
|
|
|
265
265
|
});
|
|
266
266
|
export { $ as default };
|
|
267
267
|
|
|
268
|
-
//# sourceMappingURL=PkToolShowSources-
|
|
268
|
+
//# sourceMappingURL=PkToolShowSources-Dv7hbDyy.js.map
|
package/dist/_chunks/{PkToolShowSources-Dm0L4prK.js.map → PkToolShowSources-Dv7hbDyy.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowSources-Dm0L4prK.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","VvButtonLocalized","Ee","normalizeClass","createVNode","init_shared_esm_bundler","renderList","createBlock","Fragment","createBaseVNode","ref","computed","init_runtime_core_esm_bundler","toDisplayString","reactive","init_reactivity_esm_bundler","init_runtime_dom_esm_bundler","Transition","withCtx","defineComponent","unref","createElementBlock","openBlock","PkStreamingMarkdown_default","getTypeIcon","stripMarkdown","PkUrl_default","_hoisted_1$2","_hoisted_2$2","PkChunkPreview_default","props","__props","similarityPercent","max","_component_VvIcon","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_default","toolPart","sources","groupedSources","groups","source","existing","maxSimilarity","s","expandedDocuments","expandedChunks","contextData","loadingContext","toggleDocument","documentId","toggleChunk","chunkId","handleExpandContext","content","clearContext","showMore","visibleGroups","hasMore","_component_VvButton","createTextVNode","_ctx","group","chunk","_cache"],"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-4 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-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 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-4 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-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 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,IAAMgE,IAAQC,GAORC,IAAoBrB,QAAe;GACrC,IAAImB,EAAM,cAAc,MACpB,OAAO;GAEX,IAAMG,IACFH,EAAM,iBAAiBA,EAAM,gBAAgB,IACvCA,EAAM,gBACN;GACV,OAAO,KAAK,MAAOA,EAAM,aAAaG,IAAO,GAAG;EACpD,CAAC;;;;IAID/D,EAAsEgE,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrC/D,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAO4D,EAAA;IACnD,GAAA3D,EAAAC,EAAAoD,CAAA,CAAa,CAACM,EAAA,OAAO,CAAA,GAAA,GAAAjE,CAAA;IAEhBkE,EAAA,SAAiB,O,aAA7BhE,EAAA,GAAAC,EAEO,QAFPF,GAEOK,EADA4D,EAAA,KAAiB,IAAG,MAC3B,CAAA;IACA9D,EAE2CgE,GAAA;KADtC,MAAMH,EAAA,WAAQ,uBAAA;KACf,OAAM;;;;;;;;;;;;;;;;;;;;;;;;;;G,wBCdVnD,EAE2CsD,GAAA;IADtC,MAAMrD,EAAA2C,CAAA,CAAW,CAACO,EAAA,IAAI;IACvB,OAAM;G,uBACVjD,EAaM,OAbNR,GAaM;IAZFQ,EAES,UAFTP,GAESQ,EADFgD,EAAA,IAAI,GAAA,CAAA;IAECA,EAAA,YAAZrD,EAAA,GAAAC,EAEO,QAFPH,GAEOO,EADAgD,EAAA,QAAQ,G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EACtB,WAAA,CAAAsF,EAAM,U;MAGnE,UAAK,MAAEvD,EAAA,WAAWuD,EAAM,UAAU;K,IACnCjG,EAEsB6C,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAY5C,EAAA,MACtBC,EAAGN,EAAAA,GAAE,oBAAA,CAAA,GAAA,CAAA,C;;IAWvBgG,GAAA,SADV/F,EAAA,GAAAC,EAcS,UAAA;;KAZL,OAAM;KACL,SAAK,AAAAoG,EAAA,QAAA,MAAE,EAAA,QAAQ,CAAIR,EAAA;I,IACpB1F,EAEsB6C,GAAA;KADjB,MAAM6C,EAAA,QAAQ,uBAAA;KACf,OAAM;I,uBAAYzF,EAAA,MACtBC,EACIwF,EAAA,QAA+B9F,EAAAA,GAAE,iBAAA,IAA0CA,EAAAA,GAAE,mBAAA,EAAuD,OAAA6E,EAAA,MAAe,SAAM,E"}
|
|
1
|
+
{"version":3,"file":"PkToolShowSources-Dv7hbDyy.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","VvButtonLocalized","Ee","normalizeClass","createVNode","init_shared_esm_bundler","renderList","createBlock","Fragment","createBaseVNode","ref","computed","init_runtime_core_esm_bundler","toDisplayString","reactive","init_reactivity_esm_bundler","init_runtime_dom_esm_bundler","Transition","withCtx","defineComponent","unref","createElementBlock","openBlock","PkStreamingMarkdown_default","getTypeIcon","stripMarkdown","PkUrl_default","_hoisted_1$2","_hoisted_2$2","PkChunkPreview_default","props","__props","similarityPercent","max","_component_VvIcon","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_default","toolPart","sources","groupedSources","groups","source","existing","maxSimilarity","s","expandedDocuments","expandedChunks","contextData","loadingContext","toggleDocument","documentId","toggleChunk","chunkId","handleExpandContext","content","clearContext","showMore","visibleGroups","hasMore","_component_VvButton","createTextVNode","_ctx","group","chunk","_cache"],"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,IAAMgE,IAAQC,GAORC,IAAoBrB,QAAe;GACrC,IAAImB,EAAM,cAAc,MACpB,OAAO;GAEX,IAAMG,IACFH,EAAM,iBAAiBA,EAAM,gBAAgB,IACvCA,EAAM,gBACN;GACV,OAAO,KAAK,MAAOA,EAAM,aAAaG,IAAO,GAAG;EACpD,CAAC;;;;IAID/D,EAAsEgE,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrC/D,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAO4D,EAAA;IACnD,GAAA3D,EAAAC,EAAAoD,CAAA,CAAa,CAACM,EAAA,OAAO,CAAA,GAAA,GAAAjE,CAAA;IAEhBkE,EAAA,SAAiB,O,aAA7BhE,EAAA,GAAAC,EAEO,QAFPF,GAEOK,EADA4D,EAAA,KAAiB,IAAG,MAC3B,CAAA;IACA9D,EAE2CgE,GAAA;KADtC,MAAMH,EAAA,WAAQ,uBAAA;KACf,OAAM;;;;;;;;;;;;;;;;;;;;;;;;;;G,wBCdVnD,EAE2CsD,GAAA;IADtC,MAAMrD,EAAA2C,CAAA,CAAW,CAACO,EAAA,IAAI;IACvB,OAAM;G,uBACVjD,EAaM,OAbNR,GAaM;IAZFQ,EAES,UAFTP,GAESQ,EADFgD,EAAA,IAAI,GAAA,CAAA;IAECA,EAAA,YAAZrD,EAAA,GAAAC,EAEO,QAFPH,GAEOO,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,EAAA,CAAC,gFAA8E,EACtB,WAAA,CAAAsF,EAAM,U;MAGnE,UAAK,MAAEvD,EAAA,WAAWuD,EAAM,UAAU;K,IACnCjG,EAEsB6C,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAY5C,EAAA,MACtBC,EAAGN,EAAAA,GAAE,oBAAA,CAAA,GAAA,CAAA,C;;IAWvBgG,GAAA,SADV/F,EAAA,GAAAC,EAcS,UAAA;;KAZL,OAAM;KACL,SAAK,AAAAoG,EAAA,QAAA,MAAE,EAAA,QAAQ,CAAIR,EAAA;I,IACpB1F,EAEsB6C,GAAA;KADjB,MAAM6C,EAAA,QAAQ,uBAAA;KACf,OAAM;I,uBAAYzF,EAAA,MACtBC,EACIwF,EAAA,QAA+B9F,EAAAA,GAAE,iBAAA,IAA0CA,EAAAA,GAAE,mBAAA,EAAuD,OAAA6E,EAAA,MAAe,SAAM,E"}
|
|
@@ -16,7 +16,7 @@ var C = {
|
|
|
16
16
|
"title",
|
|
17
17
|
"target",
|
|
18
18
|
"rel"
|
|
19
|
-
], T = { class: "flex flex-col gap-4 min-w-0 flex-1" }, E = { class: "vv-item__title font-medium text-12 text-word-1" }, D = { class: "text-10 text-word-
|
|
19
|
+
], T = { class: "flex flex-col gap-4 min-w-0 flex-1" }, E = { class: "vv-item__title font-medium text-12 text-word-1" }, D = { class: "text-10 text-word-3 truncate flex items-center gap-4" }, O = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "text-12 text-word-3 line-clamp-2"
|
|
22
22
|
}, k = {
|
|
@@ -82,4 +82,4 @@ var C = {
|
|
|
82
82
|
});
|
|
83
83
|
export { A as default };
|
|
84
84
|
|
|
85
|
-
//# sourceMappingURL=PkToolShowWebPages-
|
|
85
|
+
//# sourceMappingURL=PkToolShowWebPages-XxcYBQpr.js.map
|
package/dist/_chunks/{PkToolShowWebPages-Cj2mJrs5.js.map → PkToolShowWebPages-XxcYBQpr.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowWebPages-
|
|
1
|
+
{"version":3,"file":"PkToolShowWebPages-XxcYBQpr.js","names":["$t","_openBlock","_createElementBlock","_Fragment","_renderList","_createElementVNode","_unref","_createBlock","PkHeldImage","PkLazyImg","_toDisplayString","_createVNode","PkUrl","_createTextVNode","Ee","createVNode","init_shared_esm_bundler","renderList","createBlock","Fragment","createBaseVNode","ref","computed","init_runtime_core_esm_bundler","toDisplayString","init_reactivity_esm_bundler","createCommentVNode","defineComponent","unref","createTextVNode","createElementBlock","openBlock","isSameSite","PkLazyImg_default","useChatImageGate","PkHeldImage_default","PkUrl_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","PkToolShowWebPages_default","props","__props","toolPart","imageGate","normalizeUrl","u","url","uniquePages","seen","result","page","key","showMore","pages","hasMore","_component_VvIcon","index","_ctx","_cache"],"sources":["../../../../packages/components/src/chat/PkToolShowWebPages.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref } from 'vue'\n import { isSameSite } from 'utils'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n pages: Array<{\n title: string\n url: string\n image?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n // The model often passes the same URL several times (e.g. multiple KB\n // chunks from one page), so collapse duplicates, keeping the first (richest)\n // entry. Normalize by dropping the hash and any trailing slash.\n const normalizeUrl = (url: string) => {\n try {\n const u = new URL(url)\n u.hash = ''\n return u.toString().replace(/\\/$/, '')\n } catch {\n return url.trim().replace(/\\/$/, '')\n }\n }\n const uniquePages = computed(() => {\n const seen = new Set<string>()\n const result: NonNullable<typeof toolPart.value.input>['pages'] = []\n for (const page of toolPart.value.input?.pages || []) {\n const key = normalizeUrl(page.url)\n if (seen.has(key)) {\n continue\n }\n seen.add(key)\n result.push(page)\n }\n return result\n })\n\n const showMore = ref(false)\n const pages = computed(() => {\n if (showMore.value) {\n return uniquePages.value\n }\n return uniquePages.value.slice(0, 2)\n })\n const hasMore = computed(() => uniquePages.value.length > 2)\n</script>\n\n<template>\n <ul\n v-if=\"pages?.length\"\n class=\"vv-item-group vv-item-group--framed w-full shrink-0\">\n <li\n v-for=\"(page, index) in pages\"\n :key=\"index\"\n class=\"vv-item vv-item--top vv-item--roomy\">\n <a\n :href=\"page.url\"\n :title=\"$t('action.open')\"\n :target=\"isSameSite(page.url) ? undefined : '_blank'\"\n :rel=\"isSameSite(page.url) ? undefined : 'noopener noreferrer'\"\n class=\"vv-item__entry\">\n <!-- og:images the model scraped are third-party urls: a dead one\n degrades to an icon instead of breaking the card layout -->\n <PkHeldImage\n v-if=\"page.image && !imageGate.canLoad(page.image)\"\n :host=\"imageGate.hostOf(page.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(page.image)\" />\n <PkLazyImg\n v-else-if=\"page.image\"\n :src=\"page.image\"\n :alt=\"page.title\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong\n class=\"vv-item__title font-medium text-12 text-word-1\">\n {{ page.title }}\n </strong>\n <span\n class=\"text-10 text-word-3 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"page.url\" />\n </span>\n <p\n v-if=\"page.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ page.description }}\n </p>\n </div>\n </a>\n </li>\n <li v-if=\"hasMore\" class=\"vv-item\">\n <button\n class=\"vv-item__entry justify-center cursor-pointer\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"\n showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\n \"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: uniquePages.length - 2,\n })\n }}\n </button>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQI,IAAM6C,IAAQC,GAIRC,IAAWzB,QACAuB,EAAM,IAWtB,GAIKG,IAAYd,EAAiB,GAK7Be,KAAgB,MAAgB;GAClC,IAAI;IACA,IAAMC,IAAI,IAAI,IAAIC,CAAG;IAErB,OADA,EAAE,OAAO,IACFD,EAAE,SAAS,CAAC,CAAC,QAAQ,OAAO,EAAE;GACzC,QAAQ;IACJ,OAAOC,EAAI,KAAK,CAAC,CAAC,QAAQ,OAAO,EAAE;GACvC;EACJ,GACMC,IAAc9B,QAAe;GAC/B,IAAM+B,oBAAO,IAAI,IAAY,GACvBC,IAA4D,CAAC;GACnE,KAAK,IAAMC,KAAQR,EAAS,MAAM,OAAO,SAAS,CAAC,GAAG;IAClD,IAAMS,IAAMP,EAAaM,EAAK,GAAG;IACjC,AAAIF,EAAK,IAAIG,CAAG,MAGhBH,EAAK,IAAIG,CAAG,GACZF,EAAO,KAAKC,CAAI;GACpB;GACA,OAAOD;EACX,CAAC,GAEKG,IAAWpC,EAAI,EAAK,GACpBqC,IAAQpC,QACNmC,EAAS,QACFL,EAAY,QAEhBA,EAAY,MAAM,MAAM,GAAG,CAAC,CACtC,GACKO,IAAUrC,QAAe8B,EAAY,MAAM,SAAS,CAAC;;;GAKjD,OAAAM,EAAA,OAAO,UADjBzD,EAAA,GAAAC,EA8DK,MA9DLmC,GA8DK,EA3DDpC,EAAA,EAAA,GAAAC,EAwCKC,GAAA,MAAAC,EAvCuBsD,EAAA,QAAhB,GAAM,OADlBzD,EAAA,GAAAC,EAwCK,MAAA;IAtCA,KAAK2D;IACN,OAAM;G,IACNxD,EAmCI,KAAA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