@8wave/ai-elements 0.122.0-beta.5 → 0.122.0-beta.7

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.
Files changed (118) hide show
  1. package/dist/_chunks/{Agent-8tYRuiJc.js → Agent-BcmcalNN.js} +2 -1
  2. package/dist/_chunks/{Agent-8tYRuiJc.js.map → Agent-BcmcalNN.js.map} +1 -1
  3. package/dist/_chunks/{PkStreamingMarkdown-BAiI6n72.js → PkStreamingMarkdown-Cdaxoaim.js} +3 -3
  4. package/dist/_chunks/{PkStreamingMarkdown-BAiI6n72.js.map → PkStreamingMarkdown-Cdaxoaim.js.map} +1 -1
  5. package/dist/_chunks/PkToolChatFile-BsvJIdgo.js +181 -0
  6. package/dist/_chunks/PkToolChatFile-BsvJIdgo.js.map +1 -0
  7. package/dist/_chunks/{PkToolRequestGeolocation-D1n5Gvks.js → PkToolRequestGeolocation-n1W_drCv.js} +2 -2
  8. package/dist/_chunks/{PkToolRequestGeolocation-D1n5Gvks.js.map → PkToolRequestGeolocation-n1W_drCv.js.map} +1 -1
  9. package/dist/_chunks/{PkToolRequestOAuthConnection-2PzVZ_mh.js → PkToolRequestOAuthConnection-DmMeSF2m.js} +2 -2
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-2PzVZ_mh.js.map → PkToolRequestOAuthConnection-DmMeSF2m.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowArtifact-B2jj0PEo.js → PkToolShowArtifact-BmLs9882.js} +2 -2
  12. package/dist/_chunks/{PkToolShowArtifact-B2jj0PEo.js.map → PkToolShowArtifact-BmLs9882.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowContactForm-DNJaM53a.js → PkToolShowContactForm-DTCEvKUP.js} +2 -2
  14. package/dist/_chunks/{PkToolShowContactForm-DNJaM53a.js.map → PkToolShowContactForm-DTCEvKUP.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowForm-Dbua7aMG.js → PkToolShowForm-CGZ9-mxU.js} +3 -3
  16. package/dist/_chunks/{PkToolShowForm-Dbua7aMG.js.map → PkToolShowForm-CGZ9-mxU.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowImageGallery-nRTnWZUj.js → PkToolShowImageGallery-BnUnjFeU.js} +2 -2
  18. package/dist/_chunks/{PkToolShowImageGallery-nRTnWZUj.js.map → PkToolShowImageGallery-BnUnjFeU.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowProductList-NMRtT3fT.js → PkToolShowProductList-CPqmqS-Q.js} +2 -2
  20. package/dist/_chunks/{PkToolShowProductList-NMRtT3fT.js.map → PkToolShowProductList-CPqmqS-Q.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowSources-CFcTbjcM.js → PkToolShowSources-CPW_xDG2.js} +3 -3
  22. package/dist/_chunks/{PkToolShowSources-CFcTbjcM.js.map → PkToolShowSources-CPW_xDG2.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowSuggestedReply-CeK6mICV.js → PkToolShowSuggestedReply-79UAjTL4.js} +2 -2
  24. package/dist/_chunks/{PkToolShowSuggestedReply-CeK6mICV.js.map → PkToolShowSuggestedReply-79UAjTL4.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowVideo-BN3AaLy1.js → PkToolShowVideo-DYnH3VIc.js} +2 -2
  26. package/dist/_chunks/{PkToolShowVideo-BN3AaLy1.js.map → PkToolShowVideo-DYnH3VIc.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowWebPages-DfBR8eAU.js → PkToolShowWebPages-Ci_Yut6X.js} +2 -2
  28. package/dist/_chunks/{PkToolShowWebPages-DfBR8eAU.js.map → PkToolShowWebPages-Ci_Yut6X.js.map} +1 -1
  29. package/dist/_chunks/{chatImagePolicy-C2-Hy63z.js → chatImagePolicy-B5-NwmIR.js} +2 -2
  30. package/dist/_chunks/{chatImagePolicy-C2-Hy63z.js.map → chatImagePolicy-B5-NwmIR.js.map} +1 -1
  31. package/dist/_chunks/{markdown-B-_gMLvu.js → markdown-_sL6w03k.js} +2 -2
  32. package/dist/_chunks/{markdown-B-_gMLvu.js.map → markdown-_sL6w03k.js.map} +1 -1
  33. package/dist/ai-elements.es.js +48 -16
  34. package/dist/ai-elements.es.js.map +1 -1
  35. package/dist-vue/PkChatbot.js +1 -1
  36. package/dist-vue/PkChatbotEmptyState.js +1 -1
  37. package/dist-vue/PkChatbotInput.js +1 -1
  38. package/dist-vue/PkChatbotMessages.js +1 -1
  39. package/dist-vue/PkChatbotStepPayload.js +1 -1
  40. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  41. package/dist-vue/PkChatbotSteps.js +1 -1
  42. package/dist-vue/PkChatbotViewChat.js +1 -1
  43. package/dist-vue/PkChatbotViewConversations.js +1 -1
  44. package/dist-vue/PkChatbotViewFiles.js +1 -1
  45. package/dist-vue/PkChatbotViewProfile.js +1 -1
  46. package/dist-vue/_chunks/{Agent-CYUPbFnK.js → Agent-BWwjGG2f.js} +2 -1
  47. package/dist-vue/_chunks/{Agent-CYUPbFnK.js.map → Agent-BWwjGG2f.js.map} +1 -1
  48. package/dist-vue/_chunks/{Document-BvZ768dH.js → Document-DvRaziIf.js} +2 -2
  49. package/dist-vue/_chunks/{Document-BvZ768dH.js.map → Document-DvRaziIf.js.map} +1 -1
  50. package/dist-vue/_chunks/{PkChatbot-BVw3-kJg.js → PkChatbot-CI3bGQOA.js} +8 -8
  51. package/dist-vue/_chunks/{PkChatbot-BVw3-kJg.js.map → PkChatbot-CI3bGQOA.js.map} +1 -1
  52. package/dist-vue/_chunks/{PkChatbotEmptyState-DuLoc_ym.js → PkChatbotEmptyState-CMhluT5n.js} +2 -2
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-DuLoc_ym.js.map → PkChatbotEmptyState-CMhluT5n.js.map} +1 -1
  54. package/dist-vue/_chunks/{PkChatbotInput-XbH8I-uH.js → PkChatbotInput-BOypEDWF.js} +2 -2
  55. package/dist-vue/_chunks/{PkChatbotInput-XbH8I-uH.js.map → PkChatbotInput-BOypEDWF.js.map} +1 -1
  56. package/dist-vue/_chunks/{PkChatbotMessages-DcIpivBs.js → PkChatbotMessages-BsUJgHJS.js} +17 -17
  57. package/dist-vue/_chunks/{PkChatbotMessages-DcIpivBs.js.map → PkChatbotMessages-BsUJgHJS.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkChatbotStepPayload-DXhatUfJ.js → PkChatbotStepPayload-BYChvULZ.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-DXhatUfJ.js.map → PkChatbotStepPayload-BYChvULZ.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Sm5cPUAO.js → PkChatbotStepToolDetail-BysPl2ko.js} +3 -3
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Sm5cPUAO.js.map → PkChatbotStepToolDetail-BysPl2ko.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotSteps-CWFBX7Rl.js → PkChatbotSteps-y4dUoA6R.js} +5 -5
  63. package/dist-vue/_chunks/{PkChatbotSteps-CWFBX7Rl.js.map → PkChatbotSteps-y4dUoA6R.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotViewChat-C_dLjNVo.js → PkChatbotViewChat-CfbwaZov.js} +7 -7
  65. package/dist-vue/_chunks/{PkChatbotViewChat-C_dLjNVo.js.map → PkChatbotViewChat-CfbwaZov.js.map} +1 -1
  66. package/dist-vue/_chunks/{PkChatbotViewConversations-DgOFajfO.js → PkChatbotViewConversations-4ZJF-y5q.js} +3 -3
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-DgOFajfO.js.map → PkChatbotViewConversations-4ZJF-y5q.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotViewFiles-DyKSUXeX.js → PkChatbotViewFiles-CfPwNcvf.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-DyKSUXeX.js.map → PkChatbotViewFiles-CfPwNcvf.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotViewProfile-BXrOGpjB.js → PkChatbotViewProfile-Dd8EhOx3.js} +2 -2
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-BXrOGpjB.js.map → PkChatbotViewProfile-Dd8EhOx3.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkStreamingMarkdown-B5vQ1ZZ8.js → PkStreamingMarkdown-DWsZLcmm.js} +3 -3
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-B5vQ1ZZ8.js.map → PkStreamingMarkdown-DWsZLcmm.js.map} +1 -1
  74. package/dist-vue/_chunks/PkToolChatFile-s46esp0O.js +179 -0
  75. package/dist-vue/_chunks/PkToolChatFile-s46esp0O.js.map +1 -0
  76. package/dist-vue/_chunks/{PkToolRequestGeolocation-BHqLXZDd.js → PkToolRequestGeolocation-e8vyxTI_.js} +2 -2
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation-BHqLXZDd.js.map → PkToolRequestGeolocation-e8vyxTI_.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Cg6T3gzF.js → PkToolRequestOAuthConnection-3zLvNF_c.js} +2 -2
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Cg6T3gzF.js.map → PkToolRequestOAuthConnection-3zLvNF_c.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkToolShowArtifact-Clvs-28Q.js → PkToolShowArtifact-CA5FfjHW.js} +2 -2
  81. package/dist-vue/_chunks/{PkToolShowArtifact-Clvs-28Q.js.map → PkToolShowArtifact-CA5FfjHW.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkToolShowContactForm-DA3KYufo.js → PkToolShowContactForm-dV_VEOWZ.js} +2 -2
  83. package/dist-vue/_chunks/{PkToolShowContactForm-DA3KYufo.js.map → PkToolShowContactForm-dV_VEOWZ.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkToolShowDiagram-DxPuGWin.js → PkToolShowDiagram-DrJs92dg.js} +2 -2
  85. package/dist-vue/_chunks/{PkToolShowDiagram-DxPuGWin.js.map → PkToolShowDiagram-DrJs92dg.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolShowForm-DdA2UM-T.js → PkToolShowForm-Dexa0Akc.js} +4 -4
  87. package/dist-vue/_chunks/{PkToolShowForm-DdA2UM-T.js.map → PkToolShowForm-Dexa0Akc.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolShowImageGallery-B_dA0S6H.js → PkToolShowImageGallery-Buq97wbp.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-B_dA0S6H.js.map → PkToolShowImageGallery-Buq97wbp.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowProductList-ubDejlbK.js → PkToolShowProductList-1Zeeyose.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolShowProductList-ubDejlbK.js.map → PkToolShowProductList-1Zeeyose.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowSources-CRGyOz2J.js → PkToolShowSources-BYwmc1vC.js} +3 -3
  93. package/dist-vue/_chunks/{PkToolShowSources-CRGyOz2J.js.map → PkToolShowSources-BYwmc1vC.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowSuggestedReply-zFmhR7Ju.js → PkToolShowSuggestedReply-Bnhgsh4l.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-zFmhR7Ju.js.map → PkToolShowSuggestedReply-Bnhgsh4l.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowVideo-LapBUydt.js → PkToolShowVideo-DrhQz9WN.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowVideo-LapBUydt.js.map → PkToolShowVideo-DrhQz9WN.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowWebPages-CSgdDZF6.js → PkToolShowWebPages-BmYsl6-Z.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowWebPages-CSgdDZF6.js.map → PkToolShowWebPages-BmYsl6-Z.js.map} +1 -1
  100. package/dist-vue/_chunks/{createChatbotApiClient-rGWQSzZY.js → createChatbotApiClient-y6jA42S0.js} +2 -2
  101. package/dist-vue/_chunks/{createChatbotApiClient-rGWQSzZY.js.map → createChatbotApiClient-y6jA42S0.js.map} +1 -1
  102. package/dist-vue/_chunks/{useChatbotStore-BBUPN1Fa.js → useChatbotStore-DCXyql8U.js} +3 -3
  103. package/dist-vue/_chunks/{useChatbotStore-BBUPN1Fa.js.map → useChatbotStore-DCXyql8U.js.map} +1 -1
  104. package/dist-vue/_chunks/{utils-DAJhpoQS.js → utils-DaAIWTtt.js} +2 -2
  105. package/dist-vue/_chunks/{utils-DAJhpoQS.js.map → utils-DaAIWTtt.js.map} +1 -1
  106. package/dist-vue/api.js +1 -1
  107. package/dist-vue/composables.js +36 -4
  108. package/dist-vue/composables.js.map +1 -1
  109. package/dist-vue/index.js +24 -24
  110. package/dist-vue/locales.js +36 -4
  111. package/dist-vue/packages/components/src/chat/PkToolChatFile.d.ts +3 -1
  112. package/dist-vue/packages/models/src/schema/Agent.d.ts +1 -0
  113. package/dist-vue/style.css +1 -1
  114. package/package.json +1 -1
  115. package/dist/_chunks/PkToolChatFile-BuA7AOQ8.js +0 -50
  116. package/dist/_chunks/PkToolChatFile-BuA7AOQ8.js.map +0 -1
  117. package/dist-vue/_chunks/PkToolChatFile-BC_DO--d.js +0 -49
  118. package/dist-vue/_chunks/PkToolChatFile-BC_DO--d.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8wave/ai-elements",
3
3
  "private": false,
4
- "version": "0.122.0-beta.5",
4
+ "version": "0.122.0-beta.7",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite --port 8082 --open --host",
@@ -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"}