@meistrari/chat-nuxt 4.10.0-rc.22 → 4.10.0-rc.24

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "4.10.0-rc.22",
4
+ "version": "4.10.0-rc.24",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { getFileIcon } from "../../files/icons";
2
3
  import { useChatApi } from "../../shared/composables/chat-api";
3
4
  import { captureConversationDocument } from "../export-document";
4
5
  import { conversationExportFilename, downloadConversationFile, exportConversationToMarkdown, renderedConversationToText } from "../export";
@@ -14,9 +15,9 @@ const conversation = shallowRef(null);
14
15
  const documentContainer = ref(null);
15
16
  let controller = null;
16
17
  const formats = [
17
- { value: "pdf", label: "PDF (.pdf)", description: "Conversa formatada, com os widgets renderizados." },
18
- { value: "txt", label: "Texto (.txt)", description: "Texto simples, com o conte\xFAdo dos widgets." },
19
- { value: "md", label: "Markdown (.md)", description: "Formata\xE7\xE3o Markdown e c\xF3digo original dos widgets." }
18
+ { value: "pdf", label: "PDF", extension: ".pdf", mimeType: "application/pdf", description: "Formatado, com os widgets renderizados." },
19
+ { value: "txt", label: "Texto", extension: ".txt", mimeType: "text/plain", description: "Texto simples, com o conte\xFAdo dos widgets." },
20
+ { value: "md", label: "Markdown", extension: ".md", mimeType: "text/markdown", description: "Com o c\xF3digo original dos widgets." }
20
21
  ];
21
22
  onBeforeUnmount(() => controller?.abort());
22
23
  function close() {
@@ -70,7 +71,7 @@ async function exportConversation() {
70
71
  <template>
71
72
  <TelaModal
72
73
  :model-value="true"
73
- modal-width="sm"
74
+ modal-width="md"
74
75
  :compact="true"
75
76
  :hide-dividers="true"
76
77
  :is-close-icon="false"
@@ -79,9 +80,9 @@ async function exportConversation() {
79
80
  if (!value) close();
80
81
  }"
81
82
  >
82
- <div flex="~ col" w-full gap-24px>
83
+ <div flex="~ col" w-full gap-20px>
83
84
  <div flex items-start justify-between gap-16px>
84
- <div flex="~ col" gap-4px>
85
+ <div flex="~ col" gap-2px>
85
86
  <h4 heading-h4-semibold text-primary>
86
87
  Exportar conversa
87
88
  </h4>
@@ -89,28 +90,43 @@ async function exportConversation() {
89
90
  Escolha o formato do arquivo.
90
91
  </p>
91
92
  </div>
92
- <TelaIconButton icon="i-ph-x" size="md" color="secondary" aria-label="Fechar exportação" mt--12px mr--16px @click="close" />
93
+ <TelaIconButton icon="i-ph-x" size="sm" color="secondary" aria-label="Fechar exportação" shrink-0 @click="close" />
93
94
  </div>
94
- <TelaRadioGroupRoot v-model="format" :disabled="preparing" aria-label="Formato do arquivo" flex="~ col" gap-12px w-full>
95
- <label v-for="option in formats" :key="option.value" flex items-start gap-12px border rounded-12px p-12px cursor-pointer>
96
- <TelaRadioGroupItem :value="option.value" mt-2px />
97
- <span flex="~ col" gap-4px>
98
- <span body-14-medium text-primary>{{ option.label }}</span>
95
+ <TelaRadioGroupRoot v-model="format" :disabled="preparing" aria-label="Formato do arquivo" flex="~ col" gap-8px w-full>
96
+ <label
97
+ v-for="option in formats"
98
+ :key="option.value"
99
+ flex items-center gap-12px rounded-12px p-12px transition-colors duration-40
100
+ :class="[
101
+ format === option.value ? 'bg-gray-50 b-1px b-gray-700' : 'b-1px b-gray-200 hover:bg-gray-50',
102
+ preparing ? 'cursor-not-allowed opacity-60' : 'cursor-pointer'
103
+ ]"
104
+ >
105
+ <img :src="getFileIcon(option.mimeType)" alt="" size-32px shrink-0>
106
+ <span flex="~ col" gap-2px flex-1 min-w-0>
107
+ <span flex items-baseline gap-6px>
108
+ <span body-14-semibold text-primary>{{ option.label }}</span>
109
+ <span body-12-regular text-tertiary>{{ option.extension }}</span>
110
+ </span>
99
111
  <span body-12-regular text-secondary>{{ option.description }}</span>
100
112
  </span>
113
+ <TelaRadioGroupItem :value="option.value" shrink-0 />
101
114
  </label>
102
115
  </TelaRadioGroupRoot>
103
- <p v-if="error" role="alert" body-14-regular text-red-600>
104
- {{ error }}
105
- </p>
106
- <p v-if="preparing" role="status" body-14-regular text-secondary>
107
- Preparando arquivo…
108
- </p>
109
- <div flex justify-end gap-8px>
116
+ <div v-if="error" role="alert" flex items-start gap-8px rounded-8px p-12px bg-red-50 b=".5px red-200">
117
+ <span i-ph-warning-circle-fill text-16px text-red-600 shrink-0 mt-2px />
118
+ <p body-14-regular text-red-700>
119
+ {{ error }}
120
+ </p>
121
+ </div>
122
+ <div flex items-center justify-end gap-8px>
123
+ <p v-if="preparing" role="status" body-12-regular text-tertiary mr-auto>
124
+ Preparando arquivo…
125
+ </p>
110
126
  <TelaButton variant="secondary" @click="close">
111
127
  Cancelar
112
128
  </TelaButton>
113
- <TelaButton :loading="preparing" @click="exportConversation">
129
+ <TelaButton icon="i-ph-download-simple" leading :loading="preparing" @click="exportConversation">
114
130
  Exportar
115
131
  </TelaButton>
116
132
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.10.0-rc.22",
3
+ "version": "4.10.0-rc.24",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {