@meistrari/chat-nuxt 4.10.0-rc.0 → 4.10.0-rc.2

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 (136) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +9 -9
  3. package/dist/runtime/embed/components/chat-embed-inner.vue +15 -3
  4. package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +9 -9
  5. package/dist/runtime/files/components/{audio-preview.d.vue.ts → chat-file-audio.d.vue.ts} +8 -7
  6. package/dist/runtime/files/components/chat-file-audio.vue +94 -0
  7. package/dist/runtime/files/components/{image-preview.d.vue.ts → chat-file-audio.vue.d.ts} +8 -7
  8. package/dist/runtime/files/components/chat-file-card.d.vue.ts +31 -0
  9. package/dist/runtime/files/components/chat-file-card.vue +44 -0
  10. package/dist/runtime/files/components/chat-file-card.vue.d.ts +31 -0
  11. package/dist/runtime/files/components/chat-file-preview.vue +90 -196
  12. package/dist/runtime/files/composables/pdf.d.ts +5 -842
  13. package/dist/runtime/files/content-detection.js +7 -3
  14. package/dist/runtime/files/formatting.d.ts +1 -0
  15. package/dist/runtime/files/formatting.js +4 -0
  16. package/dist/runtime/files/presentation.d.ts +3 -0
  17. package/dist/runtime/files/presentation.js +24 -0
  18. package/dist/runtime/messages/answer.d.ts +0 -5
  19. package/dist/runtime/messages/answer.js +0 -18
  20. package/dist/runtime/messages/components/chat-answer.vue +4 -3
  21. package/dist/runtime/messages/components/chat-message-bubble.vue +12 -0
  22. package/dist/runtime/messages/components/widgets/chat-thinking-widget.vue +4 -0
  23. package/dist/runtime/messages/composables/use-stick-to-bottom.d.ts +5 -0
  24. package/dist/runtime/messages/composables/use-stick-to-bottom.js +3 -0
  25. package/dist/runtime/rendering/components/openui/bar-chart.d.vue.ts +10 -0
  26. package/dist/runtime/rendering/components/openui/bar-chart.vue +39 -0
  27. package/dist/runtime/rendering/components/openui/bar-chart.vue.d.ts +10 -0
  28. package/dist/runtime/rendering/components/openui/bar.d.vue.ts +10 -0
  29. package/dist/runtime/rendering/components/openui/bar.vue +12 -0
  30. package/dist/runtime/rendering/components/openui/bar.vue.d.ts +10 -0
  31. package/dist/runtime/rendering/components/openui/button.d.vue.ts +11 -0
  32. package/dist/runtime/rendering/components/openui/button.vue +30 -0
  33. package/dist/runtime/rendering/components/openui/button.vue.d.ts +11 -0
  34. package/dist/runtime/rendering/components/openui/buttons.d.vue.ts +8 -0
  35. package/dist/runtime/rendering/components/openui/buttons.vue +14 -0
  36. package/dist/runtime/rendering/components/openui/buttons.vue.d.ts +8 -0
  37. package/dist/runtime/rendering/components/openui/callout.d.vue.ts +11 -0
  38. package/dist/runtime/rendering/components/openui/callout.vue +27 -0
  39. package/dist/runtime/rendering/components/openui/callout.vue.d.ts +11 -0
  40. package/dist/runtime/rendering/components/openui/card.d.vue.ts +9 -0
  41. package/dist/runtime/rendering/components/openui/card.vue +19 -0
  42. package/dist/runtime/rendering/components/openui/card.vue.d.ts +9 -0
  43. package/dist/runtime/rendering/components/openui/checkbox.d.vue.ts +9 -0
  44. package/dist/runtime/rendering/components/openui/checkbox.vue +26 -0
  45. package/dist/runtime/rendering/components/openui/checkbox.vue.d.ts +9 -0
  46. package/dist/runtime/rendering/components/openui/citation.d.vue.ts +9 -0
  47. package/dist/runtime/rendering/components/openui/citation.vue +13 -0
  48. package/dist/runtime/rendering/components/openui/citation.vue.d.ts +9 -0
  49. package/dist/runtime/rendering/components/openui/col.d.vue.ts +10 -0
  50. package/dist/runtime/rendering/components/openui/col.vue +16 -0
  51. package/dist/runtime/rendering/components/openui/col.vue.d.ts +10 -0
  52. package/dist/runtime/rendering/components/openui/file-card.d.vue.ts +9 -0
  53. package/dist/runtime/rendering/components/openui/file-card.vue +15 -0
  54. package/dist/runtime/rendering/components/openui/file-card.vue.d.ts +9 -0
  55. package/dist/runtime/rendering/components/openui/form.d.vue.ts +10 -0
  56. package/dist/runtime/rendering/components/openui/form.vue +60 -0
  57. package/dist/runtime/rendering/components/openui/form.vue.d.ts +10 -0
  58. package/dist/runtime/rendering/components/openui/image.d.vue.ts +10 -0
  59. package/dist/runtime/rendering/components/openui/image.vue +40 -0
  60. package/dist/runtime/rendering/components/openui/image.vue.d.ts +10 -0
  61. package/dist/runtime/rendering/components/openui/input.d.vue.ts +10 -0
  62. package/dist/runtime/rendering/components/openui/input.vue +23 -0
  63. package/dist/runtime/rendering/components/openui/input.vue.d.ts +10 -0
  64. package/dist/runtime/rendering/components/openui/markdown.d.vue.ts +9 -0
  65. package/dist/runtime/rendering/components/openui/markdown.vue +14 -0
  66. package/dist/runtime/rendering/components/openui/markdown.vue.d.ts +9 -0
  67. package/dist/runtime/rendering/components/openui/metric.d.vue.ts +11 -0
  68. package/dist/runtime/rendering/components/openui/metric.vue +20 -0
  69. package/dist/runtime/rendering/components/openui/metric.vue.d.ts +11 -0
  70. package/dist/runtime/rendering/components/openui/option.d.vue.ts +10 -0
  71. package/dist/runtime/rendering/components/openui/option.vue +12 -0
  72. package/dist/runtime/rendering/components/openui/option.vue.d.ts +10 -0
  73. package/dist/runtime/rendering/components/openui/question.d.vue.ts +11 -0
  74. package/dist/runtime/rendering/components/openui/question.vue +15 -0
  75. package/dist/runtime/rendering/components/openui/question.vue.d.ts +11 -0
  76. package/dist/runtime/rendering/components/openui/questions.d.vue.ts +9 -0
  77. package/dist/runtime/rendering/components/openui/questions.vue +91 -0
  78. package/dist/runtime/rendering/components/openui/questions.vue.d.ts +9 -0
  79. package/dist/runtime/rendering/components/openui/select.d.vue.ts +10 -0
  80. package/dist/runtime/rendering/components/openui/select.vue +27 -0
  81. package/dist/runtime/rendering/components/openui/select.vue.d.ts +10 -0
  82. package/dist/runtime/rendering/components/openui/stack.d.vue.ts +9 -0
  83. package/dist/runtime/rendering/components/openui/stack.vue +18 -0
  84. package/dist/runtime/rendering/components/openui/stack.vue.d.ts +9 -0
  85. package/dist/runtime/rendering/components/openui/table.d.vue.ts +9 -0
  86. package/dist/runtime/rendering/components/openui/table.vue +41 -0
  87. package/dist/runtime/rendering/components/openui/table.vue.d.ts +9 -0
  88. package/dist/runtime/rendering/components/openui-block.d.vue.ts +12 -0
  89. package/dist/runtime/rendering/components/openui-block.vue +73 -0
  90. package/dist/runtime/rendering/components/openui-block.vue.d.ts +12 -0
  91. package/dist/runtime/rendering/components/openui-reasoning-placeholder.d.vue.ts +3 -0
  92. package/dist/runtime/rendering/components/openui-reasoning-placeholder.vue +10 -0
  93. package/dist/runtime/rendering/components/openui-reasoning-placeholder.vue.d.ts +3 -0
  94. package/dist/runtime/rendering/components/renderers/artifact-display.vue +1 -1
  95. package/dist/runtime/rendering/openui/actions.d.ts +15 -0
  96. package/dist/runtime/rendering/openui/actions.js +40 -0
  97. package/dist/runtime/rendering/openui/context.d.ts +22 -0
  98. package/dist/runtime/rendering/openui/context.js +4 -0
  99. package/dist/runtime/rendering/openui/form-fields.d.ts +10 -0
  100. package/dist/runtime/rendering/openui/form-fields.js +30 -0
  101. package/dist/runtime/rendering/openui/markdown-link.d.ts +2 -0
  102. package/dist/runtime/rendering/openui/markdown-link.js +5 -0
  103. package/dist/runtime/rendering/openui/program.d.ts +15 -0
  104. package/dist/runtime/rendering/openui/program.js +74 -0
  105. package/dist/runtime/rendering/openui/registry.d.ts +5 -0
  106. package/dist/runtime/rendering/openui/registry.js +44 -0
  107. package/dist/runtime/rendering/openui/render.d.ts +21 -0
  108. package/dist/runtime/rendering/openui/render.js +45 -0
  109. package/dist/runtime/rendering/openui/use-openui-context.d.ts +2 -0
  110. package/dist/runtime/rendering/openui/use-openui-context.js +8 -0
  111. package/dist/runtime/rendering/openui/use-widget-prose.d.ts +2 -0
  112. package/dist/runtime/rendering/openui/use-widget-prose.js +7 -0
  113. package/dist/runtime/shared/composables/polling.d.ts +1 -1
  114. package/dist/runtime/types/schemas/chat/conversation-runtime.d.ts +12 -0
  115. package/dist/runtime/types/schemas/chat/conversations.d.ts +12 -0
  116. package/dist/runtime/types/schemas/chat/conversations.js +3 -0
  117. package/dist/runtime/types/schemas/chat/messages.d.ts +18 -0
  118. package/dist/runtime/types/schemas/chat/ui-language.d.ts +14 -0
  119. package/dist/runtime/types/schemas/chat/ui-language.js +8 -0
  120. package/package.json +3 -1
  121. package/dist/runtime/files/components/audio-preview.vue +0 -52
  122. package/dist/runtime/files/components/audio-preview.vue.d.ts +0 -14
  123. package/dist/runtime/files/components/csv-preview.d.vue.ts +0 -20
  124. package/dist/runtime/files/components/csv-preview.vue +0 -157
  125. package/dist/runtime/files/components/csv-preview.vue.d.ts +0 -20
  126. package/dist/runtime/files/components/image-preview.vue +0 -54
  127. package/dist/runtime/files/components/image-preview.vue.d.ts +0 -14
  128. package/dist/runtime/files/components/pdf-preview.client.d.vue.ts +0 -20
  129. package/dist/runtime/files/components/pdf-preview.client.vue +0 -90
  130. package/dist/runtime/files/components/pdf-preview.client.vue.d.ts +0 -20
  131. package/dist/runtime/files/components/text-preview.d.vue.ts +0 -19
  132. package/dist/runtime/files/components/text-preview.vue +0 -105
  133. package/dist/runtime/files/components/text-preview.vue.d.ts +0 -19
  134. package/dist/runtime/files/components/video-preview.d.vue.ts +0 -14
  135. package/dist/runtime/files/components/video-preview.vue +0 -55
  136. package/dist/runtime/files/components/video-preview.vue.d.ts +0 -14
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.0",
4
+ "version": "4.10.0-rc.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -19,27 +19,27 @@ type __VLS_Props = {
19
19
  user?: EmbedUser | null;
20
20
  features?: Partial<ChatFeatureConfig>;
21
21
  };
22
- declare var __VLS_14: {}, __VLS_92: {}, __VLS_105: {
22
+ declare var __VLS_14: {}, __VLS_92: {}, __VLS_107: {
23
23
  message: useChatAuth;
24
- }, __VLS_118: {}, __VLS_127: {}, __VLS_191: {}, __VLS_210: {
24
+ }, __VLS_120: {}, __VLS_129: {}, __VLS_193: {}, __VLS_214: {
25
25
  message: useChatAuth;
26
- }, __VLS_223: {};
26
+ }, __VLS_227: {};
27
27
  type __VLS_Slots = {} & {
28
28
  'sidebar-bottom'?: (props: typeof __VLS_14) => any;
29
29
  } & {
30
30
  'composer-bottom'?: (props: typeof __VLS_92) => any;
31
31
  } & {
32
- 'failed-message-actions'?: (props: typeof __VLS_105) => any;
32
+ 'failed-message-actions'?: (props: typeof __VLS_107) => any;
33
33
  } & {
34
- 'composer-bottom'?: (props: typeof __VLS_118) => any;
34
+ 'composer-bottom'?: (props: typeof __VLS_120) => any;
35
35
  } & {
36
- 'topbar-leading'?: (props: typeof __VLS_127) => any;
36
+ 'topbar-leading'?: (props: typeof __VLS_129) => any;
37
37
  } & {
38
- 'composer-bottom'?: (props: typeof __VLS_191) => any;
38
+ 'composer-bottom'?: (props: typeof __VLS_193) => any;
39
39
  } & {
40
- 'failed-message-actions'?: (props: typeof __VLS_210) => any;
40
+ 'failed-message-actions'?: (props: typeof __VLS_214) => any;
41
41
  } & {
42
- 'composer-bottom'?: (props: typeof __VLS_223) => any;
42
+ 'composer-bottom'?: (props: typeof __VLS_227) => any;
43
43
  };
44
44
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
45
45
  "update:conversationId": (value: string | null) => any;
@@ -2,10 +2,11 @@
2
2
  import { inject, provide, useSlots } from "vue";
3
3
  import { useChatHarnessAdapter } from "../composables/harness-adapter";
4
4
  import ChatMessageList from "../../messages/components/chat-message-list.vue";
5
+ import { shouldScrollOnComposerResize } from "../../messages/composables/use-stick-to-bottom";
5
6
  import { CHAT_COMPOSER_EXTENSION_KEY } from "../../types/composer";
6
7
  import { CHAT_MESSAGE_SEND_KEY } from "../../types/messages";
7
8
  import { useChatAuth } from "#chat-auth";
8
- import { useBreakpoints } from "@vueuse/core";
9
+ import { useBreakpoints, useResizeObserver } from "@vueuse/core";
9
10
  import { useCitationPanel } from "../../citations/composables/citation-panel";
10
11
  import { exportConversationToMarkdown } from "../../conversations/export";
11
12
  import { CHAT_MOBILE_BREAKPOINT } from "../../shared/breakpoints";
@@ -175,6 +176,15 @@ provide("chat-answer-target", answerTarget);
175
176
  function setAnswerTarget(el) {
176
177
  answerTarget.value = el instanceof HTMLElement ? el : null;
177
178
  }
179
+ const messageListRef = ref(null);
180
+ const composerRef = ref(null);
181
+ let composerHeights = { composer: 0, dock: 0 };
182
+ useResizeObserver(composerRef, ([entry]) => {
183
+ const next = { composer: entry?.contentRect.height ?? 0, dock: answerTarget.value?.offsetHeight ?? 0 };
184
+ if (shouldScrollOnComposerResize(composerHeights, next, Boolean(messageListRef.value?.isPinned)))
185
+ requestAnimationFrame(() => messageListRef.value?.scrollToBottom());
186
+ composerHeights = next;
187
+ });
178
188
  const messageInputRef = ref(null);
179
189
  const PROMPT_INPUT_HINTS = [
180
190
  { icon: "i-ph-at-bold", label: "Para mencionar arquivos" },
@@ -1053,6 +1063,7 @@ async function handleDelete() {
1053
1063
 
1054
1064
  <ChatMessageList
1055
1065
  :key="currentConversation?.id ?? 'draft'"
1066
+ ref="messageListRef"
1056
1067
  :messages="messages"
1057
1068
  :events="displayConversationEvents"
1058
1069
  :streaming-active-message-id="streamingActiveMessageId"
@@ -1069,7 +1080,7 @@ async function handleDelete() {
1069
1080
  <slot name="failed-message-actions" v-bind="slotProps" />
1070
1081
  </template>
1071
1082
  </ChatMessageList>
1072
- <div data-chat-composer flex="~ col" gap-12px min-h-0>
1083
+ <div ref="composerRef" data-chat-composer flex="~ col" gap-12px min-h-0>
1073
1084
  <div :ref="setAnswerTarget" data-chat-answer-dock class="empty:hidden max-h-[50dvh] overflow-y-auto" />
1074
1085
  <ChatMessageInput
1075
1086
  ref="messageInputRef"
@@ -1266,6 +1277,7 @@ async function handleDelete() {
1266
1277
  >
1267
1278
  <ChatMessageList
1268
1279
  :key="currentConversation?.id ?? 'draft'"
1280
+ ref="messageListRef"
1269
1281
  :messages="messages"
1270
1282
  :events="displayConversationEvents"
1271
1283
  :streaming-active-message-id="streamingActiveMessageId"
@@ -1282,7 +1294,7 @@ async function handleDelete() {
1282
1294
  <slot name="failed-message-actions" v-bind="slotProps" />
1283
1295
  </template>
1284
1296
  </ChatMessageList>
1285
- <div data-chat-composer flex="~ col" gap-12px min-h-0>
1297
+ <div ref="composerRef" data-chat-composer flex="~ col" gap-12px min-h-0>
1286
1298
  <div :ref="setAnswerTarget" data-chat-answer-dock class="empty:hidden max-h-[50dvh] overflow-y-auto" />
1287
1299
  <ChatMessageInput
1288
1300
  ref="messageInputRef"
@@ -19,27 +19,27 @@ type __VLS_Props = {
19
19
  user?: EmbedUser | null;
20
20
  features?: Partial<ChatFeatureConfig>;
21
21
  };
22
- declare var __VLS_14: {}, __VLS_92: {}, __VLS_105: {
22
+ declare var __VLS_14: {}, __VLS_92: {}, __VLS_107: {
23
23
  message: useChatAuth;
24
- }, __VLS_118: {}, __VLS_127: {}, __VLS_191: {}, __VLS_210: {
24
+ }, __VLS_120: {}, __VLS_129: {}, __VLS_193: {}, __VLS_214: {
25
25
  message: useChatAuth;
26
- }, __VLS_223: {};
26
+ }, __VLS_227: {};
27
27
  type __VLS_Slots = {} & {
28
28
  'sidebar-bottom'?: (props: typeof __VLS_14) => any;
29
29
  } & {
30
30
  'composer-bottom'?: (props: typeof __VLS_92) => any;
31
31
  } & {
32
- 'failed-message-actions'?: (props: typeof __VLS_105) => any;
32
+ 'failed-message-actions'?: (props: typeof __VLS_107) => any;
33
33
  } & {
34
- 'composer-bottom'?: (props: typeof __VLS_118) => any;
34
+ 'composer-bottom'?: (props: typeof __VLS_120) => any;
35
35
  } & {
36
- 'topbar-leading'?: (props: typeof __VLS_127) => any;
36
+ 'topbar-leading'?: (props: typeof __VLS_129) => any;
37
37
  } & {
38
- 'composer-bottom'?: (props: typeof __VLS_191) => any;
38
+ 'composer-bottom'?: (props: typeof __VLS_193) => any;
39
39
  } & {
40
- 'failed-message-actions'?: (props: typeof __VLS_210) => any;
40
+ 'failed-message-actions'?: (props: typeof __VLS_214) => any;
41
41
  } & {
42
- 'composer-bottom'?: (props: typeof __VLS_223) => any;
42
+ 'composer-bottom'?: (props: typeof __VLS_227) => any;
43
43
  };
44
44
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
45
45
  "update:conversationId": (value: string | null) => any;
@@ -1,14 +1,15 @@
1
+ import type { ChatFileMenuItem } from './chat-file-card.vue.js';
1
2
  type __VLS_Props = {
2
- url: string;
3
- name?: string;
4
- clickable?: boolean;
3
+ url?: string;
4
+ iconSrc: string;
5
+ name: string;
6
+ meta: string;
7
+ menuItems: ChatFileMenuItem[];
5
8
  };
6
9
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- click: () => any;
8
- loaded: () => any;
10
+ open: () => any;
9
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onClick?: (() => any) | undefined;
11
- onLoaded?: (() => any) | undefined;
12
+ onOpen?: (() => any) | undefined;
12
13
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
14
  declare const _default: typeof __VLS_export;
14
15
  export default _default;
@@ -0,0 +1,94 @@
1
+ <script setup>
2
+ import ChatFileCard from "./chat-file-card.vue";
3
+ import { formatPlaybackTime } from "../formatting";
4
+ const props = defineProps({
5
+ url: { type: String, required: false },
6
+ iconSrc: { type: String, required: true },
7
+ name: { type: String, required: true },
8
+ meta: { type: String, required: true },
9
+ menuItems: { type: Array, required: true }
10
+ });
11
+ const emit = defineEmits(["open"]);
12
+ const player = ref();
13
+ const playing = ref(false);
14
+ const currentTime = ref(0);
15
+ const duration = ref(0);
16
+ const failed = ref(false);
17
+ const progress = computed(() => duration.value > 0 ? currentTime.value / duration.value * 100 : 0);
18
+ function togglePlayback() {
19
+ const audio = player.value;
20
+ if (!audio)
21
+ return;
22
+ if (audio.paused)
23
+ void audio.play();
24
+ else
25
+ audio.pause();
26
+ }
27
+ function seek(event) {
28
+ const audio = player.value;
29
+ if (!audio || duration.value <= 0)
30
+ return;
31
+ audio.currentTime = Number(event.target.value) / 100 * duration.value;
32
+ }
33
+ watch(() => props.url, () => {
34
+ playing.value = false;
35
+ currentTime.value = 0;
36
+ duration.value = 0;
37
+ failed.value = false;
38
+ });
39
+ </script>
40
+
41
+ <template>
42
+ <ChatFileCard
43
+ :icon-src="iconSrc"
44
+ :name="name"
45
+ :meta="failed ? 'Falha ao carregar \xE1udio' : meta"
46
+ :menu-items="menuItems"
47
+ :disabled="!url"
48
+ @open="emit('open')"
49
+ >
50
+ <template #actions>
51
+ <TelaIconButton
52
+ :icon="playing ? 'i-ph-pause-fill' : 'i-ph-play-fill'"
53
+ color="secondary"
54
+ size="xs"
55
+ :aria-label="playing ? 'Pausar \xE1udio' : 'Reproduzir \xE1udio'"
56
+ :disabled="!url || failed"
57
+ @click="togglePlayback"
58
+ />
59
+ </template>
60
+ <div flex items-center gap-12px px-12px py-10px border-t-0.5px border>
61
+ <input
62
+ type="range"
63
+ min="0"
64
+ max="100"
65
+ step="0.1"
66
+ :value="progress"
67
+ :disabled="!url || failed || duration <= 0"
68
+ aria-label="Posição do áudio"
69
+ flex-1 cursor-pointer text-primary
70
+ class="chat-file-audio__track"
71
+ @input="seek"
72
+ >
73
+ <span body-12-regular text-secondary tabular-nums shrink-0>
74
+ {{ formatPlaybackTime(currentTime) }} / {{ formatPlaybackTime(duration) }}
75
+ </span>
76
+ </div>
77
+ <audio
78
+ v-if="url"
79
+ ref="player"
80
+ :src="url"
81
+ preload="metadata"
82
+ @play="playing = true"
83
+ @pause="playing = false"
84
+ @ended="playing = false"
85
+ @timeupdate="currentTime = player?.currentTime ?? 0"
86
+ @loadedmetadata="duration = player?.duration ?? 0"
87
+ @error="failed = true"
88
+ />
89
+ </ChatFileCard>
90
+ </template>
91
+
92
+ <style scoped>
93
+ .chat-file-audio__track{accent-color:currentColor;height:4px}
94
+ </style>
@@ -1,14 +1,15 @@
1
+ import type { ChatFileMenuItem } from './chat-file-card.vue.js';
1
2
  type __VLS_Props = {
2
- url: string;
3
- maxHeight?: number;
4
- clickable?: boolean;
3
+ url?: string;
4
+ iconSrc: string;
5
+ name: string;
6
+ meta: string;
7
+ menuItems: ChatFileMenuItem[];
5
8
  };
6
9
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- click: () => any;
8
- loaded: () => any;
10
+ open: () => any;
9
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onClick?: (() => any) | undefined;
11
- onLoaded?: (() => any) | undefined;
12
+ onOpen?: (() => any) | undefined;
12
13
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
14
  declare const _default: typeof __VLS_export;
14
15
  export default _default;
@@ -0,0 +1,31 @@
1
+ export interface ChatFileMenuItem {
2
+ label: string;
3
+ icon: string;
4
+ click: () => void;
5
+ }
6
+ type __VLS_Props = {
7
+ iconSrc: string;
8
+ name: string;
9
+ meta: string;
10
+ menuItems: ChatFileMenuItem[];
11
+ disabled?: boolean;
12
+ };
13
+ declare var __VLS_1: {}, __VLS_14: {};
14
+ type __VLS_Slots = {} & {
15
+ actions?: (props: typeof __VLS_1) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_14) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ open: () => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onOpen?: (() => any) | undefined;
23
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
27
+ type __VLS_WithSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
@@ -0,0 +1,44 @@
1
+ <script setup>
2
+ defineProps({
3
+ iconSrc: { type: String, required: true },
4
+ name: { type: String, required: true },
5
+ meta: { type: String, required: true },
6
+ menuItems: { type: Array, required: true },
7
+ disabled: { type: Boolean, required: false }
8
+ });
9
+ const emit = defineEmits(["open"]);
10
+ </script>
11
+
12
+ <template>
13
+ <div w-full max-w-480px rounded-12px border-0.5px border bg overflow-hidden data-chat-file="card">
14
+ <div flex items-center gap-12px p-12px>
15
+ <button
16
+ type="button"
17
+ flex items-center gap-12px flex-1 min-w-0 text-left
18
+ :class="disabled ? 'cursor-default' : 'cursor-pointer'"
19
+ :disabled="disabled"
20
+ :aria-label="`Abrir ${name}`"
21
+ @click="emit('open')"
22
+ >
23
+ <span size-40px rounded-8px bg-subtle flex items-center justify-center shrink-0>
24
+ <img :src="iconSrc" alt="" size-20px>
25
+ </span>
26
+ <span flex flex-col min-w-0>
27
+ <span body-14-medium text-primary truncate :title="name">{{ name }}</span>
28
+ <span body-12-regular text-secondary truncate>{{ meta }}</span>
29
+ </span>
30
+ </button>
31
+ <slot name="actions" />
32
+ <TelaDropdownMenu :items="menuItems" align="end">
33
+ <TelaIconButton
34
+ icon="i-ph-dots-three"
35
+ color="secondary"
36
+ size="3xs"
37
+ aria-label="Ações do arquivo"
38
+ :disabled="disabled"
39
+ />
40
+ </TelaDropdownMenu>
41
+ </div>
42
+ <slot />
43
+ </div>
44
+ </template>
@@ -0,0 +1,31 @@
1
+ export interface ChatFileMenuItem {
2
+ label: string;
3
+ icon: string;
4
+ click: () => void;
5
+ }
6
+ type __VLS_Props = {
7
+ iconSrc: string;
8
+ name: string;
9
+ meta: string;
10
+ menuItems: ChatFileMenuItem[];
11
+ disabled?: boolean;
12
+ };
13
+ declare var __VLS_1: {}, __VLS_14: {};
14
+ type __VLS_Slots = {} & {
15
+ actions?: (props: typeof __VLS_1) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_14) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ open: () => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onOpen?: (() => any) | undefined;
23
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
27
+ type __VLS_WithSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };