@8wave/ai-elements 0.122.0-beta.4 → 0.122.0-beta.6
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/PkToolChatFile-CLaqBsM-.js +181 -0
- package/dist/_chunks/PkToolChatFile-CLaqBsM-.js.map +1 -0
- package/dist/ai-elements.es.js +33 -1
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-BVw3-kJg.js → PkChatbot-B1Lox5YD.js} +2 -2
- package/dist-vue/_chunks/{PkChatbot-BVw3-kJg.js.map → PkChatbot-B1Lox5YD.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-C_dLjNVo.js → PkChatbotViewChat-B3HtPjcu.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewChat-C_dLjNVo.js.map → PkChatbotViewChat-B3HtPjcu.js.map} +1 -1
- package/dist-vue/_chunks/PkToolChatFile-B7aCK9Az.js +179 -0
- package/dist-vue/_chunks/PkToolChatFile-B7aCK9Az.js.map +1 -0
- package/dist-vue/composables.js +32 -0
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +2 -2
- package/dist-vue/locales.js +36 -4
- package/dist-vue/packages/components/src/chat/PkToolChatFile.d.ts +3 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolChatFile-BuA7AOQ8.js +0 -50
- package/dist/_chunks/PkToolChatFile-BuA7AOQ8.js.map +0 -1
- package/dist-vue/_chunks/PkToolChatFile-BC_DO--d.js +0 -49
- package/dist-vue/_chunks/PkToolChatFile-BC_DO--d.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Ot as e, R as t, S as n, h as r, k as i, v as a, w as o, wt as s, y as c } from "./vue.runtime.esm-bundler-DQaOHfo6.js";
|
|
2
|
-
import { r as l } from "./vue-i18n-DjRtpHH3.js";
|
|
3
|
-
import { f as u, v as d } from "./Agent-8tYRuiJc.js";
|
|
4
|
-
import { t as f } from "./PkChatbotFilePreview-D5jwgPp8.js";
|
|
5
|
-
// ../../packages/components/src/chat/PkToolChatFile.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
i(), s();
|
|
7
|
-
var p = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "pk-tool-chat-file"
|
|
10
|
-
}, m = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "text-12 text-word-3 mt-xs mb-0"
|
|
13
|
-
}, h = /* @__PURE__ */ o({
|
|
14
|
-
__name: "PkToolChatFile",
|
|
15
|
-
props: {
|
|
16
|
-
part: { type: null },
|
|
17
|
-
fileUrl: { type: Function }
|
|
18
|
-
},
|
|
19
|
-
setup(i) {
|
|
20
|
-
let o = /* @__PURE__ */ new Set(["tool-editWordDocument", "tool-createWordDocument"]), s = i, { t: h } = l({ useScope: "global" }), g = r(() => {
|
|
21
|
-
let e = s.part;
|
|
22
|
-
if (e.state !== "output-available" || !e.output?.storedFileName) return;
|
|
23
|
-
let t = e.output;
|
|
24
|
-
return o.has(e.type ?? "") ? {
|
|
25
|
-
output: t,
|
|
26
|
-
mediaType: d,
|
|
27
|
-
changed: t.changedParagraphs === void 0 ? void 0 : h("messagePart.editWordDocumentParagraphs", t.changedParagraphs)
|
|
28
|
-
} : {
|
|
29
|
-
output: t,
|
|
30
|
-
mediaType: u,
|
|
31
|
-
changed: t.changedCells === void 0 ? void 0 : h("messagePart.editSpreadsheetCells", t.changedCells)
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
return (r, o) => g.value ? (t(), c("div", p, [n(f, {
|
|
35
|
-
"media-type": g.value.mediaType,
|
|
36
|
-
url: i.fileUrl(g.value.output.storedFileName),
|
|
37
|
-
filename: g.value.output.filename,
|
|
38
|
-
size: g.value.output.sizeBytes,
|
|
39
|
-
"show-download": ""
|
|
40
|
-
}, null, 8, [
|
|
41
|
-
"media-type",
|
|
42
|
-
"url",
|
|
43
|
-
"filename",
|
|
44
|
-
"size"
|
|
45
|
-
]), g.value.changed ? (t(), c("p", m, e(g.value.changed), 1)) : a("", !0)])) : a("", !0);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
export { h as default };
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=PkToolChatFile-BuA7AOQ8.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolChatFile-BuA7AOQ8.js","names":["_openBlock","_createElementBlock","_createVNode","PkChatbotFilePreview","_toDisplayString","_createCommentVNode","_sfc_main","toDisplayString","openBlock","createVNode","computed","init_runtime_core_esm_bundler","createCommentVNode","defineComponent","init_shared_esm_bundler","createElementBlock","useI18n","SPREADSHEET_MIME_TYPE","WORD_MIME_TYPE","PkChatbotFilePreview_default","_hoisted_1","_hoisted_2","PkToolChatFile_default","WORD_TOOL_PARTS","props","__props","$t","file","part","output"],"sources":["../../../../packages/components/src/chat/PkToolChatFile.vue","../../../../packages/components/src/chat/PkToolChatFile.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { SPREADSHEET_MIME_TYPE, WORD_MIME_TYPE } from 'models'\n import PkChatbotFilePreview from './PkChatbotFilePreview.vue'\n\n /** What the four file tools return that the card shows. */\n type ChatFileOutput = {\n storedFileName: string\n filename?: string\n sizeBytes?: number\n changedCells?: number\n changedParagraphs?: number\n }\n\n /** The tools whose output is a Word document; the others write a spreadsheet. */\n const WORD_TOOL_PARTS = new Set([\n 'tool-editWordDocument',\n 'tool-createWordDocument',\n ])\n\n /**\n * The file a call of `editSpreadsheet`, `editWordDocument`,\n * `createSpreadsheet` or `createWordDocument` wrote, a new version or a\n * new file, to download. Drawn once the call has an output: while it runs,\n * the feed's activity indicator names it, and a refused call is explained\n * by the answer.\n */\n const props = defineProps<{\n part: unknown\n /** The authenticated download URL of a file stored in this chat. */\n fileUrl: (storedFileName: string) => string\n }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const file = computed(() => {\n const part = props.part as {\n type?: string\n state?: string\n output?: Partial<ChatFileOutput>\n }\n if (part.state !== 'output-available' || !part.output?.storedFileName) {\n return undefined\n }\n const output = part.output as ChatFileOutput\n // A new file has no count of changes.\n if (WORD_TOOL_PARTS.has(part.type ?? '')) {\n return {\n output,\n mediaType: WORD_MIME_TYPE,\n changed:\n output.changedParagraphs !== undefined\n ? $t(\n 'messagePart.editWordDocumentParagraphs',\n output.changedParagraphs,\n )\n : undefined,\n }\n }\n return {\n output,\n mediaType: SPREADSHEET_MIME_TYPE,\n changed:\n output.changedCells !== undefined\n ? $t(\n 'messagePart.editSpreadsheetCells',\n output.changedCells,\n )\n : undefined,\n }\n })\n</script>\n\n<template>\n <div v-if=\"file\" class=\"pk-tool-chat-file\">\n <PkChatbotFilePreview\n :media-type=\"file.mediaType\"\n :url=\"fileUrl(file.output.storedFileName)\"\n :filename=\"file.output.filename\"\n :size=\"file.output.sizeBytes\"\n show-download />\n <p v-if=\"file.changed\" class=\"text-12 text-word-3 mt-xs mb-0\">\n {{ file.changed }}\n </p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { SPREADSHEET_MIME_TYPE, WORD_MIME_TYPE } from 'models'\n import PkChatbotFilePreview from './PkChatbotFilePreview.vue'\n\n /** What the four file tools return that the card shows. */\n type ChatFileOutput = {\n storedFileName: string\n filename?: string\n sizeBytes?: number\n changedCells?: number\n changedParagraphs?: number\n }\n\n /** The tools whose output is a Word document; the others write a spreadsheet. */\n const WORD_TOOL_PARTS = new Set([\n 'tool-editWordDocument',\n 'tool-createWordDocument',\n ])\n\n /**\n * The file a call of `editSpreadsheet`, `editWordDocument`,\n * `createSpreadsheet` or `createWordDocument` wrote, a new version or a\n * new file, to download. Drawn once the call has an output: while it runs,\n * the feed's activity indicator names it, and a refused call is explained\n * by the answer.\n */\n const props = defineProps<{\n part: unknown\n /** The authenticated download URL of a file stored in this chat. */\n fileUrl: (storedFileName: string) => string\n }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const file = computed(() => {\n const part = props.part as {\n type?: string\n state?: string\n output?: Partial<ChatFileOutput>\n }\n if (part.state !== 'output-available' || !part.output?.storedFileName) {\n return undefined\n }\n const output = part.output as ChatFileOutput\n // A new file has no count of changes.\n if (WORD_TOOL_PARTS.has(part.type ?? '')) {\n return {\n output,\n mediaType: WORD_MIME_TYPE,\n changed:\n output.changedParagraphs !== undefined\n ? $t(\n 'messagePart.editWordDocumentParagraphs',\n output.changedParagraphs,\n )\n : undefined,\n }\n }\n return {\n output,\n mediaType: SPREADSHEET_MIME_TYPE,\n changed:\n output.changedCells !== undefined\n ? $t(\n 'messagePart.editSpreadsheetCells',\n output.changedCells,\n )\n : undefined,\n }\n })\n</script>\n\n<template>\n <div v-if=\"file\" class=\"pk-tool-chat-file\">\n <PkChatbotFilePreview\n :media-type=\"file.mediaType\"\n :url=\"fileUrl(file.output.storedFileName)\"\n :filename=\"file.output.filename\"\n :size=\"file.output.sizeBytes\"\n show-download />\n <p v-if=\"file.changed\" class=\"text-12 text-word-3 mt-xs mb-0\">\n {{ file.changed }}\n </p>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAgBI,IAAMuB,oBAAkB,IAAI,IAAI,CAC5B,yBACA,yBACJ,CAAC,GASKC,IAAQC,GAMR,EAAE,GAAGC,MAAOV,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1CW,IAAOjB,QAAe;GACxB,IAAMkB,IAAOJ,EAAM;GAKnB,IAAII,EAAK,UAAU,sBAAsB,CAACA,EAAK,QAAQ,gBACnD;GAEJ,IAAMC,IAASD,EAAK;GAepB,OAbIL,EAAgB,IAAIK,EAAK,QAAQ,EAAE,IAC5B;IACH;IACA,WAAWV;IACX,SACIW,EAAO,sBAAsB,KAAA,IAKvB,KAAA,IAJAH,EACI,0CACAG,EAAO,iBACX;GAEd,IAEG;IACH;IACA,WAAWZ;IACX,SACIY,EAAO,iBAAiB,KAAA,IAKlB,KAAA,IAJAH,EACI,oCACAG,EAAO,YACX;GAEd;EACJ,CAAC;E,iBAIUF,EAAA,SAAX3B,EAAA,GAAAC,EAUM,OAVNmB,GAUM,CATFlB,EAKoBC,GAAA;GAJf,cAAYwB,EAAA,MAAK;GACjB,KAAKF,EAAA,QAAQE,EAAA,MAAK,OAAO,cAAc;GACvC,UAAUA,EAAA,MAAK,OAAO;GACtB,MAAMA,EAAA,MAAK,OAAO;GACnB,iBAAA;;;;;;E,IACKA,EAAA,MAAK,WAAd3B,EAAA,GAAAC,EAEI,KAFJoB,GAEIjB,EADGuB,EAAA,MAAK,OAAO,GAAA,CAAA,K"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { E as e, M as t } from "./Agent-CYUPbFnK.js";
|
|
2
|
-
import { t as n } from "./PkChatbotFilePreview-CzmGvKjI.js";
|
|
3
|
-
import { computed as r, createCommentVNode as i, createElementBlock as a, createVNode as o, defineComponent as s, openBlock as c, toDisplayString as l } from "vue";
|
|
4
|
-
import { useI18n as u } from "vue-i18n";
|
|
5
|
-
// ../../packages/components/src/chat/PkToolChatFile.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var d = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "pk-tool-chat-file"
|
|
9
|
-
}, f = {
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "text-12 text-word-3 mt-xs mb-0"
|
|
12
|
-
}, p = /* @__PURE__ */ s({
|
|
13
|
-
__name: "PkToolChatFile",
|
|
14
|
-
props: {
|
|
15
|
-
part: {},
|
|
16
|
-
fileUrl: { type: Function }
|
|
17
|
-
},
|
|
18
|
-
setup(s) {
|
|
19
|
-
let p = /* @__PURE__ */ new Set(["tool-editWordDocument", "tool-createWordDocument"]), m = s, { t: h } = u({ useScope: "global" }), g = r(() => {
|
|
20
|
-
let n = m.part;
|
|
21
|
-
if (n.state !== "output-available" || !n.output?.storedFileName) return;
|
|
22
|
-
let r = n.output;
|
|
23
|
-
return p.has(n.type ?? "") ? {
|
|
24
|
-
output: r,
|
|
25
|
-
mediaType: t,
|
|
26
|
-
changed: r.changedParagraphs === void 0 ? void 0 : h("messagePart.editWordDocumentParagraphs", r.changedParagraphs)
|
|
27
|
-
} : {
|
|
28
|
-
output: r,
|
|
29
|
-
mediaType: e,
|
|
30
|
-
changed: r.changedCells === void 0 ? void 0 : h("messagePart.editSpreadsheetCells", r.changedCells)
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
return (e, t) => g.value ? (c(), a("div", d, [o(n, {
|
|
34
|
-
"media-type": g.value.mediaType,
|
|
35
|
-
url: s.fileUrl(g.value.output.storedFileName),
|
|
36
|
-
filename: g.value.output.filename,
|
|
37
|
-
size: g.value.output.sizeBytes,
|
|
38
|
-
"show-download": ""
|
|
39
|
-
}, null, 8, [
|
|
40
|
-
"media-type",
|
|
41
|
-
"url",
|
|
42
|
-
"filename",
|
|
43
|
-
"size"
|
|
44
|
-
]), g.value.changed ? (c(), a("p", f, l(g.value.changed), 1)) : i("", !0)])) : i("", !0);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
export { p as default };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=PkToolChatFile-BC_DO--d.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolChatFile-BC_DO--d.js","names":["_openBlock","_createElementBlock","_createVNode","PkChatbotFilePreview","_toDisplayString","_createCommentVNode","_sfc_main","SPREADSHEET_MIME_TYPE","WORD_MIME_TYPE","PkChatbotFilePreview_default","_hoisted_1","_hoisted_2","PkToolChatFile_default","defineComponent","WORD_TOOL_PARTS","props","__props","$t","useI18n","file","computed","part","output","openBlock","createElementBlock","createVNode","toDisplayString","createCommentVNode"],"sources":["../../../../packages/components/src/chat/PkToolChatFile.vue","../../../../packages/components/src/chat/PkToolChatFile.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { SPREADSHEET_MIME_TYPE, WORD_MIME_TYPE } from 'models'\n import PkChatbotFilePreview from './PkChatbotFilePreview.vue'\n\n /** What the four file tools return that the card shows. */\n type ChatFileOutput = {\n storedFileName: string\n filename?: string\n sizeBytes?: number\n changedCells?: number\n changedParagraphs?: number\n }\n\n /** The tools whose output is a Word document; the others write a spreadsheet. */\n const WORD_TOOL_PARTS = new Set([\n 'tool-editWordDocument',\n 'tool-createWordDocument',\n ])\n\n /**\n * The file a call of `editSpreadsheet`, `editWordDocument`,\n * `createSpreadsheet` or `createWordDocument` wrote, a new version or a\n * new file, to download. Drawn once the call has an output: while it runs,\n * the feed's activity indicator names it, and a refused call is explained\n * by the answer.\n */\n const props = defineProps<{\n part: unknown\n /** The authenticated download URL of a file stored in this chat. */\n fileUrl: (storedFileName: string) => string\n }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const file = computed(() => {\n const part = props.part as {\n type?: string\n state?: string\n output?: Partial<ChatFileOutput>\n }\n if (part.state !== 'output-available' || !part.output?.storedFileName) {\n return undefined\n }\n const output = part.output as ChatFileOutput\n // A new file has no count of changes.\n if (WORD_TOOL_PARTS.has(part.type ?? '')) {\n return {\n output,\n mediaType: WORD_MIME_TYPE,\n changed:\n output.changedParagraphs !== undefined\n ? $t(\n 'messagePart.editWordDocumentParagraphs',\n output.changedParagraphs,\n )\n : undefined,\n }\n }\n return {\n output,\n mediaType: SPREADSHEET_MIME_TYPE,\n changed:\n output.changedCells !== undefined\n ? $t(\n 'messagePart.editSpreadsheetCells',\n output.changedCells,\n )\n : undefined,\n }\n })\n</script>\n\n<template>\n <div v-if=\"file\" class=\"pk-tool-chat-file\">\n <PkChatbotFilePreview\n :media-type=\"file.mediaType\"\n :url=\"fileUrl(file.output.storedFileName)\"\n :filename=\"file.output.filename\"\n :size=\"file.output.sizeBytes\"\n show-download />\n <p v-if=\"file.changed\" class=\"text-12 text-word-3 mt-xs mb-0\">\n {{ file.changed }}\n </p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { SPREADSHEET_MIME_TYPE, WORD_MIME_TYPE } from 'models'\n import PkChatbotFilePreview from './PkChatbotFilePreview.vue'\n\n /** What the four file tools return that the card shows. */\n type ChatFileOutput = {\n storedFileName: string\n filename?: string\n sizeBytes?: number\n changedCells?: number\n changedParagraphs?: number\n }\n\n /** The tools whose output is a Word document; the others write a spreadsheet. */\n const WORD_TOOL_PARTS = new Set([\n 'tool-editWordDocument',\n 'tool-createWordDocument',\n ])\n\n /**\n * The file a call of `editSpreadsheet`, `editWordDocument`,\n * `createSpreadsheet` or `createWordDocument` wrote, a new version or a\n * new file, to download. Drawn once the call has an output: while it runs,\n * the feed's activity indicator names it, and a refused call is explained\n * by the answer.\n */\n const props = defineProps<{\n part: unknown\n /** The authenticated download URL of a file stored in this chat. */\n fileUrl: (storedFileName: string) => string\n }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const file = computed(() => {\n const part = props.part as {\n type?: string\n state?: string\n output?: Partial<ChatFileOutput>\n }\n if (part.state !== 'output-available' || !part.output?.storedFileName) {\n return undefined\n }\n const output = part.output as ChatFileOutput\n // A new file has no count of changes.\n if (WORD_TOOL_PARTS.has(part.type ?? '')) {\n return {\n output,\n mediaType: WORD_MIME_TYPE,\n changed:\n output.changedParagraphs !== undefined\n ? $t(\n 'messagePart.editWordDocumentParagraphs',\n output.changedParagraphs,\n )\n : undefined,\n }\n }\n return {\n output,\n mediaType: SPREADSHEET_MIME_TYPE,\n changed:\n output.changedCells !== undefined\n ? $t(\n 'messagePart.editSpreadsheetCells',\n output.changedCells,\n )\n : undefined,\n }\n })\n</script>\n\n<template>\n <div v-if=\"file\" class=\"pk-tool-chat-file\">\n <PkChatbotFilePreview\n :media-type=\"file.mediaType\"\n :url=\"fileUrl(file.output.storedFileName)\"\n :filename=\"file.output.filename\"\n :size=\"file.output.sizeBytes\"\n show-download />\n <p v-if=\"file.changed\" class=\"text-12 text-word-3 mt-xs mb-0\">\n {{ file.changed }}\n </p>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAgBI,IAAMc,oBAAkB,IAAI,IAAI,CAC5B,yBACA,yBACJ,CAAC,GASKC,IAAQC,GAMR,EAAE,GAAGC,MAAOC,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1CC,IAAOC,QAAe;GACxB,IAAMC,IAAON,EAAM;GAKnB,IAAIM,EAAK,UAAU,sBAAsB,CAACA,EAAK,QAAQ,gBACnD;GAEJ,IAAMC,IAASD,EAAK;GAepB,OAbIP,EAAgB,IAAIO,EAAK,QAAQ,EAAE,IAC5B;IACH;IACA,WAAWb;IACX,SACIc,EAAO,sBAAsB,KAAA,IAKvB,KAAA,IAJAL,EACI,0CACAK,EAAO,iBACX;GAEd,IAEG;IACH;IACA,WAAWf;IACX,SACIe,EAAO,iBAAiB,KAAA,IAKlB,KAAA,IAJAL,EACI,oCACAK,EAAO,YACX;GAEd;EACJ,CAAC;E,iBAIUH,EAAA,SAAXnB,EAAA,GAAAC,EAUM,OAVNS,GAUM,CATFR,EAKoBC,GAAA;GAJf,cAAYgB,EAAA,MAAK;GACjB,KAAKH,EAAA,QAAQG,EAAA,MAAK,OAAO,cAAc;GACvC,UAAUA,EAAA,MAAK,OAAO;GACtB,MAAMA,EAAA,MAAK,OAAO;GACnB,iBAAA;;;;;;E,IACKA,EAAA,MAAK,WAAdnB,EAAA,GAAAC,EAEI,KAFJU,GAEIP,EADGe,EAAA,MAAK,OAAO,GAAA,CAAA,K"}
|