@8wave/ai-elements 0.114.0-beta.15 → 0.114.0-beta.25
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/{Agent-D3ODaN3E.js → Agent-DK76k05_.js} +2 -2
- package/dist/_chunks/{Agent-D3ODaN3E.js.map → Agent-DK76k05_.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-CYOm47PX.js → PkStreamingMarkdown-ZD0SROu1.js} +228 -219
- package/dist/_chunks/{PkStreamingMarkdown-CYOm47PX.js.map → PkStreamingMarkdown-ZD0SROu1.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-BY7nXImb.js → PkToolRequestGeolocation-OF1PWhMw.js} +2 -2
- package/{dist-vue/_chunks/PkToolRequestGeolocation-9vfYNaQo.js.map → dist/_chunks/PkToolRequestGeolocation-OF1PWhMw.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-DFOTALFt.js → PkToolRequestOAuthConnection-ChGMAKV7.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-DFOTALFt.js.map → PkToolRequestOAuthConnection-ChGMAKV7.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-DzHRWoru.js → PkToolShowArtifact-LEfO5zfg.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-DzHRWoru.js.map → PkToolShowArtifact-LEfO5zfg.js.map} +1 -1
- package/dist/_chunks/PkToolShowComparison-8d6fAhRp.js +72 -0
- package/dist/_chunks/PkToolShowComparison-8d6fAhRp.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm-1J6_1AA2.js → PkToolShowContactForm-BO3JQfts.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-1J6_1AA2.js.map → PkToolShowContactForm-BO3JQfts.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DmQYj3v1.js → PkToolShowForm-KW8MOL-j.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-DmQYj3v1.js.map → PkToolShowForm-KW8MOL-j.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BO8V5rlS.js → PkToolShowSources-Sc1W6WHe.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-BO8V5rlS.js.map → PkToolShowSources-Sc1W6WHe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CTWVG1Zk.js → PkToolShowSuggestedReply-Dl4x_nEJ.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CTWVG1Zk.js.map → PkToolShowSuggestedReply-Dl4x_nEJ.js.map} +1 -1
- package/dist/_chunks/{markdown-JpLFzufn.js → markdown-BrvkrEUr.js} +12 -12
- package/dist/_chunks/{markdown-JpLFzufn.js.map → markdown-BrvkrEUr.js.map} +1 -1
- package/dist/ai-elements.es.js +1792 -1983
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-BNlmK-uJ.js → Agent-tbKw8Mdt.js} +2 -2
- package/dist-vue/_chunks/{Agent-BNlmK-uJ.js.map → Agent-tbKw8Mdt.js.map} +1 -1
- package/dist-vue/_chunks/{Document-2X01-F4Z.js → Document-p2Y_4gk8.js} +9 -9
- package/dist-vue/_chunks/{Document-2X01-F4Z.js.map → Document-p2Y_4gk8.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-DZP40EZP.js → PkChatbot-Dn_6yrFw.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-DZP40EZP.js.map → PkChatbot-Dn_6yrFw.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DycCrfwz.js → PkChatbotEmptyState-9mWiPd4B.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DycCrfwz.js.map → PkChatbotEmptyState-9mWiPd4B.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BCuqLdkT.js → PkChatbotInput-BzaCyeFp.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-BCuqLdkT.js.map → PkChatbotInput-BzaCyeFp.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-Yaf_5xJV.js +778 -0
- package/dist-vue/_chunks/PkChatbotMessages-Yaf_5xJV.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-CI98RiNv.js → PkChatbotStepPayload-C36nXLW7.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CI98RiNv.js.map → PkChatbotStepPayload-C36nXLW7.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-B8zXJOdI.js → PkChatbotStepToolDetail-CBX-AQXv.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-B8zXJOdI.js.map → PkChatbotStepToolDetail-CBX-AQXv.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-CL27pMFS.js → PkChatbotSteps-356rnZG5.js} +7 -6
- package/dist-vue/_chunks/PkChatbotSteps-356rnZG5.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-BZVcDXzL.js → PkChatbotViewChat-DFYw4nzP.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-BZVcDXzL.js.map → PkChatbotViewChat-DFYw4nzP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-Cx-mLdUE.js → PkChatbotViewConversations-CHpN4vhm.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-Cx-mLdUE.js.map → PkChatbotViewConversations-CHpN4vhm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-DLIa-xG8.js → PkChatbotViewFiles-BBBO5hyd.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-DLIa-xG8.js.map → PkChatbotViewFiles-BBBO5hyd.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-DEc9apXY.js → PkChatbotViewProfile-CosaHA-g.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-DEc9apXY.js.map → PkChatbotViewProfile-CosaHA-g.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-B2iju0WK.js → PkStreamingMarkdown-BN7waklD.js} +214 -205
- package/dist-vue/_chunks/{PkStreamingMarkdown-B2iju0WK.js.map → PkStreamingMarkdown-BN7waklD.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-9vfYNaQo.js → PkToolRequestGeolocation-BOVbaCzQ.js} +2 -2
- package/{dist/_chunks/PkToolRequestGeolocation-BY7nXImb.js.map → dist-vue/_chunks/PkToolRequestGeolocation-BOVbaCzQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BorR5NmZ.js → PkToolRequestOAuthConnection-DMvCGPuX.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BorR5NmZ.js.map → PkToolRequestOAuthConnection-DMvCGPuX.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C0J71YF6.js → PkToolShowArtifact-DrE_mK1z.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C0J71YF6.js.map → PkToolShowArtifact-DrE_mK1z.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js +72 -0
- package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowContactForm-De3Od9mC.js → PkToolShowContactForm-BBTbrgt4.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-De3Od9mC.js.map → PkToolShowContactForm-BBTbrgt4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-DmY_hhAS.js → PkToolShowDiagram-WyUnnDUn.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-DmY_hhAS.js.map → PkToolShowDiagram-WyUnnDUn.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-D_Z15wCS.js → PkToolShowEmail-C30K5kJA.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-D_Z15wCS.js.map → PkToolShowEmail-C30K5kJA.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DUGysIxj.js → PkToolShowForm-C9N_SSm8.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-DUGysIxj.js.map → PkToolShowForm-C9N_SSm8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowMessage-e5_EI5mV.js → PkToolShowMessage-DvkCRERv.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-e5_EI5mV.js.map → PkToolShowMessage-DvkCRERv.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-B3X7Svyc.js → PkToolShowProductList-cfjg3CmV.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-B3X7Svyc.js.map → PkToolShowProductList-cfjg3CmV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BUjBSGc5.js → PkToolShowSources-BItTltB5.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowSources-BUjBSGc5.js.map → PkToolShowSources-BItTltB5.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DA4NEjHB.js → PkToolShowSuggestedReply-qAWdCUhr.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DA4NEjHB.js.map → PkToolShowSuggestedReply-qAWdCUhr.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-DEih8h5k.js → PkToolShowWebPages-CkQ2NhRj.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-DEih8h5k.js.map → PkToolShowWebPages-CkQ2NhRj.js.map} +1 -1
- package/dist-vue/_chunks/{PkUrl-3NH9t-WA.js → PkUrl-BsD4Vby6.js} +2 -2
- package/dist-vue/_chunks/{PkUrl-3NH9t-WA.js.map → PkUrl-BsD4Vby6.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DohvHshj.js → createChatbotApiClient-BlWs282E.js} +99 -137
- package/dist-vue/_chunks/createChatbotApiClient-BlWs282E.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-_10Jaf4z.js → useChatbotStore-CMo47fnS.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-_10Jaf4z.js.map → useChatbotStore-CMo47fnS.js.map} +1 -1
- package/dist-vue/_chunks/{utils-BL4Ppr2R.js → utils--8iNpBr_.js} +2 -2
- package/dist-vue/_chunks/{utils-BL4Ppr2R.js.map → utils--8iNpBr_.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +11 -9
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +196 -196
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +2 -0
- package/dist-vue/packages/ability/src/index.d.ts +10 -14
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +8 -4
- package/dist-vue/packages/components/src/chat/PkChatbotSteps.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolShowComparison-BJ7QBXtf.js +0 -60
- package/dist/_chunks/PkToolShowComparison-BJ7QBXtf.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-PjKRDNYJ.js +0 -776
- package/dist-vue/_chunks/PkChatbotMessages-PjKRDNYJ.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-CL27pMFS.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js +0 -61
- package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-DohvHshj.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { $ as e, C as t, L as n, O as r, St as i, Tt as a, _ as o, bt as s, d as c, h as l, it as u, m as d, v as f, x as p, xt as m, z as h } from "./vue.runtime.esm-bundler-CIT_Sbqw.js";
|
|
2
|
-
import { i as g } from "./dist-QdjZA6MJ.js";
|
|
3
|
-
import { a as _, r as v, t as y } from "./index.es-C2U5wcOx.js";
|
|
4
|
-
r(), m(), u();
|
|
5
|
-
var b = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "border border-surface-3 rounded-xl w-full overflow-hidden"
|
|
8
|
-
}, x = { 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" }, S = { class: "font-bold" }, C = { class: "overflow-x-auto" }, w = { class: "w-full text-12 border-collapse bg-surface" }, T = /* @__PURE__ */ t({
|
|
9
|
-
__name: "PkToolShowComparison",
|
|
10
|
-
props: { part: { type: null } },
|
|
11
|
-
setup(t) {
|
|
12
|
-
let r = t, { copy: u, copied: m } = g(), T = d(() => r.part), E = d(() => {
|
|
13
|
-
let e = T.value.input?.items;
|
|
14
|
-
return !e || e.length === 0 ? [] : Object.keys(e[0].values);
|
|
15
|
-
}), D = (e) => e === "✓" ? "text-success" : e === "✗" ? "text-danger" : "text-word-2", O = () => {
|
|
16
|
-
let e = T.value.input?.items;
|
|
17
|
-
if (!e) return;
|
|
18
|
-
let t = ["", ...e.map((e) => e.name)].join(" "), n = E.value.map((t) => [t.replace(/_/g, " "), ...e.map((e) => e.values[t] ?? "")].join(" "));
|
|
19
|
-
u([t, ...n].join("\n"));
|
|
20
|
-
};
|
|
21
|
-
return (t, r) => {
|
|
22
|
-
let u = y, d = v, g = _;
|
|
23
|
-
return T.value?.input?.items?.length ? (n(), f("div", b, [l("div", x, [
|
|
24
|
-
p(u, {
|
|
25
|
-
name: "ri:scales-line",
|
|
26
|
-
class: "text-16"
|
|
27
|
-
}),
|
|
28
|
-
l("strong", S, a(T.value.input.title ?? t.$t("label.comparison")), 1),
|
|
29
|
-
p(g, {
|
|
30
|
-
modifiers: "compact",
|
|
31
|
-
class: "ml-auto shrink-0"
|
|
32
|
-
}, {
|
|
33
|
-
default: e(() => [p(d, {
|
|
34
|
-
modifiers: "action-quiet-small",
|
|
35
|
-
icon: s(m) ? "ri:check-line" : "ri:file-copy-line",
|
|
36
|
-
label: s(m) ? t.$t("action.copied") : t.$t("action.copy"),
|
|
37
|
-
onClick: O
|
|
38
|
-
}, null, 8, ["icon", "label"])]),
|
|
39
|
-
_: 1
|
|
40
|
-
})
|
|
41
|
-
]), l("div", C, [l("table", w, [l("thead", null, [l("tr", null, [r[0] ||= l("th", { class: "text-left text-word-3 font-medium p-8 border-b border-surface-3 min-w-32" }, null, -1), (n(!0), f(c, null, h(T.value.input.items, (e) => (n(), f("th", {
|
|
42
|
-
key: e.name,
|
|
43
|
-
class: i(["text-center text-word-1 p-8 border-b border-surface-3 min-w-24", e.highlighted ? "font-semibold bg-surface-1" : "font-medium"])
|
|
44
|
-
}, a(e.name), 3))), 128))])]), l("tbody", null, [(n(!0), f(c, null, h(E.value, (e, t) => (n(), f("tr", {
|
|
45
|
-
key: e,
|
|
46
|
-
class: i({ "bg-surface-1": t % 2 != 0 })
|
|
47
|
-
}, [l("td", { class: i(["text-word-3 font-medium p-8 whitespace-nowrap", { "border-b border-surface-3": t !== E.value.length - 1 }]) }, a(e.replace(/_/g, " ")), 3), (n(!0), f(c, null, h(T.value.input.items, (r) => (n(), f("td", {
|
|
48
|
-
key: r.name,
|
|
49
|
-
class: i(["text-center p-8", [D(r.values[e]), {
|
|
50
|
-
"border-b border-surface-3": t !== E.value.length - 1,
|
|
51
|
-
"bg-surface-1": r.highlighted
|
|
52
|
-
}]])
|
|
53
|
-
}, a(r.values[e] ?? "-"), 3))), 128))], 2))), 128))])])])])) : o("", !0);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
//#endregion
|
|
58
|
-
export { T as default };
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=PkToolShowComparison-BJ7QBXtf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowComparison-BJ7QBXtf.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowComparison.vue","../../../../packages/components/src/chat/PkToolShowComparison.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\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 title?: string\n items: Array<{\n name: string\n values: Record<string, string>\n highlighted?: boolean\n }>\n }\n }\n return part\n })\n\n const features = computed(() => {\n const items = toolPart.value.input?.items\n if (!items || items.length === 0) {\n return []\n }\n return Object.keys(items[0].values)\n })\n\n // The tool contract asks for \"✓\" and \"✗\" on boolean features: the pair is\n // a verdict, so it wears one and the table reads by eye (DESIGN.md).\n const valueColorClass = (value?: string) => {\n if (value === '✓') {\n return 'text-success'\n }\n if (value === '✗') {\n return 'text-danger'\n }\n return 'text-word-2'\n }\n\n const copyTable = () => {\n const items = toolPart.value.input?.items\n if (!items) {\n return\n }\n const header = ['', ...items.map((i) => i.name)].join('\\t')\n const rows = features.value.map((f) =>\n [f.replace(/_/g, ' '), ...items.map((i) => i.values[f] ?? '')].join(\n '\\t',\n ),\n )\n copy([header, ...rows].join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input?.items?.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\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:scales-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{\n toolPart.input.title ?? $t('label.comparison')\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=\"copyTable\" />\n </VvButtonGroup>\n </div>\n <div class=\"overflow-x-auto\">\n <table class=\"w-full text-12 border-collapse bg-surface\">\n <thead>\n <tr>\n <th\n class=\"text-left text-word-3 font-medium p-8 border-b border-surface-3 min-w-32\"></th>\n <th\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center text-word-1 p-8 border-b border-surface-3 min-w-24\"\n :class=\"\n item.highlighted\n ? 'font-semibold bg-surface-1'\n : 'font-medium'\n \">\n {{ item.name }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(feature, fIdx) in features\"\n :key=\"feature\"\n :class=\"{ 'bg-surface-1': fIdx % 2 !== 0 }\">\n <td\n class=\"text-word-3 font-medium p-8 whitespace-nowrap\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n }\">\n {{ feature.replace(/_/g, ' ') }}\n </td>\n <td\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center p-8\"\n :class=\"[\n valueColorClass(item.values[feature]),\n {\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n 'bg-surface-1': item.highlighted,\n },\n ]\">\n {{ item.values[feature] ?? '-' }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\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 title?: string\n items: Array<{\n name: string\n values: Record<string, string>\n highlighted?: boolean\n }>\n }\n }\n return part\n })\n\n const features = computed(() => {\n const items = toolPart.value.input?.items\n if (!items || items.length === 0) {\n return []\n }\n return Object.keys(items[0].values)\n })\n\n // The tool contract asks for \"✓\" and \"✗\" on boolean features: the pair is\n // a verdict, so it wears one and the table reads by eye (DESIGN.md).\n const valueColorClass = (value?: string) => {\n if (value === '✓') {\n return 'text-success'\n }\n if (value === '✗') {\n return 'text-danger'\n }\n return 'text-word-2'\n }\n\n const copyTable = () => {\n const items = toolPart.value.input?.items\n if (!items) {\n return\n }\n const header = ['', ...items.map((i) => i.name)].join('\\t')\n const rows = features.value.map((f) =>\n [f.replace(/_/g, ' '), ...items.map((i) => i.values[f] ?? '')].join(\n '\\t',\n ),\n )\n copy([header, ...rows].join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input?.items?.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\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:scales-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{\n toolPart.input.title ?? $t('label.comparison')\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=\"copyTable\" />\n </VvButtonGroup>\n </div>\n <div class=\"overflow-x-auto\">\n <table class=\"w-full text-12 border-collapse bg-surface\">\n <thead>\n <tr>\n <th\n class=\"text-left text-word-3 font-medium p-8 border-b border-surface-3 min-w-32\"></th>\n <th\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center text-word-1 p-8 border-b border-surface-3 min-w-24\"\n :class=\"\n item.highlighted\n ? 'font-semibold bg-surface-1'\n : 'font-medium'\n \">\n {{ item.name }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(feature, fIdx) in features\"\n :key=\"feature\"\n :class=\"{ 'bg-surface-1': fIdx % 2 !== 0 }\">\n <td\n class=\"text-word-3 font-medium p-8 whitespace-nowrap\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n }\">\n {{ feature.replace(/_/g, ' ') }}\n </td>\n <td\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center p-8\"\n :class=\"[\n valueColorClass(item.values[feature]),\n {\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n 'bg-surface-1': item.highlighted,\n },\n ]\">\n {{ item.values[feature] ?? '-' }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;EAII,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAEhC,IAAW,QACA,EAAM,IAWtB,GAEK,IAAW,QAAe;GAC5B,IAAM,IAAQ,EAAS,MAAM,OAAO;GAIpC,OAHI,CAAC,KAAS,EAAM,WAAW,IACpB,CAAC,IAEL,OAAO,KAAK,EAAM,EAAE,CAAC,MAAM;EACtC,CAAC,GAIK,KAAmB,MACjB,MAAU,MACH,iBAEP,MAAU,MACH,gBAEJ,eAGL,UAAkB;GACpB,IAAM,IAAQ,EAAS,MAAM,OAAO;GACpC,IAAI,CAAC,GACD;GAEJ,IAAM,IAAS,CAAC,IAAI,GAAG,EAAM,KAAK,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,GAAI,GACpD,IAAO,EAAS,MAAM,KAAK,MAC7B,CAAC,EAAE,QAAQ,MAAM,GAAG,GAAG,GAAG,EAAM,KAAK,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC,CAAC,CAAC,KAC3D,GACJ,CACJ;GACA,EAAK,CAAC,GAAQ,GAAG,CAAI,CAAC,CAAC,KAAK,IAAI,CAAC;EACrC;;;GAKU,OAAA,EAAA,OAAU,OAAO,OAAO,UADlC,EAAA,GAAA,EAmEM,OAnEN,GAmEM,CAhEF,EAaM,OAbN,GAaM;IAXF,EAAgD,GAAA;KAAxC,MAAK;KAAiB,OAAM;;IACpC,EAEW,UAFX,GAEW,EADP,EAAA,MAAS,MAAM,SAASA,EAAAA,GAAE,kBAAA,CAAA,GAAA,CAAA;IAE9B,EAMgB,GAAA;KAND,WAAU;KAAU,OAAM;;KACrC,SAAA,QAIyB,CAJzB,EAIyB,GAAA;MAHrB,WAAU;MACT,MAAM,EAAA,CAAA,IAAM,kBAAA;MACZ,OAAO,EAAA,CAAA,IAASA,EAAAA,GAAE,eAAA,IAAoBA,EAAAA,GAAE,aAAA;MACxC,SAAO;;;;GAGpB,CAAA,GAAA,EAiDM,OAjDN,GAiDM,CAhDF,EA+CQ,SA/CR,GA+CQ,CA9CJ,EAgBQ,SAAA,MAAA,CAfJ,EAcK,MAAA,MAAA,CAbD,AAAA,EAAA,OAAA,EAC0F,MAAA,EAAtF,OAAM,2EAA0E,GAAA,MAAA,EAAA,IACpF,EAAA,EAAA,GAAA,EAUK,GAAA,MAAA,EATc,EAAA,MAAS,MAAM,QAAvB,OADX,EAAA,GAAA,EAUK,MAAA;IARA,KAAK,EAAK;IACX,OAAK,EAAA,CAAC,kEACmC,EAAK,cAAA,+BAAA,aAAA,CAAA;GAK3C,GAAA,EAAA,EAAK,IAAI,GAAA,CAAA,EAIxB,GAAA,GAAA,EAAA,CAAA,CAAA,CAAA,GAAA,EA4BQ,SAAA,MAAA,EA3BJ,EAAA,EAAA,GAAA,EA0BK,GAAA,MAAA,EAzByB,EAAA,QAAlB,GAAS,OADrB,EAAA,GAAA,EA0BK,MAAA;IAxBA,KAAK;IACL,OAAK,EAAA,EAAA,gBAAoB,IAAI,KAAA,EAAA,CAAA;GAC9B,GAAA,CAAA,EAOK,MAAA,EAND,OAAK,EAAA,CAAC,iDAA+C,EAAA,6BACsD,MAAS,EAAA,MAAS,SAAM,EAAA,CAAA,CAAA,EAIhI,GAAA,EAAA,EAAQ,QAAO,MAAA,GAAA,CAAA,GAAA,CAAA,IAEtB,EAAA,EAAA,GAAA,EAaK,GAAA,MAAA,EAZc,EAAA,MAAS,MAAM,QAAvB,OADX,EAAA,GAAA,EAaK,MAAA;IAXA,KAAK,EAAK;IACX,OAAK,EAAA,CAAC,mBAAiB,CACmB,EAAgB,EAAK,OAAO,EAAO,GAAA;KAA+I,6BAAA,MAAS,EAAA,MAAS,SAAM;KAA0D,gBAAA,EAAK;;GAQhT,GAAA,EAAA,EAAK,OAAO,MAAO,GAAA,GAAA,CAAA"}
|