@meistrari/chat-nuxt 4.5.0-rc.4 → 4.5.0-rc.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/module.json +1 -1
- package/dist/module.mjs +9 -2
- package/dist/runtime/conversations/components/chat-conversation-debug-modal.d.vue.ts +17 -0
- package/dist/runtime/conversations/components/chat-conversation-debug-modal.vue +109 -0
- package/dist/runtime/conversations/components/chat-conversation-debug-modal.vue.d.ts +17 -0
- package/dist/runtime/conversations/components/chat-conversation-item.d.vue.ts +2 -0
- package/dist/runtime/conversations/components/chat-conversation-item.vue +10 -6
- package/dist/runtime/conversations/components/chat-conversation-item.vue.d.ts +2 -0
- package/dist/runtime/conversations/components/chat-conversation-list.d.vue.ts +1 -0
- package/dist/runtime/conversations/components/chat-conversation-list.vue +10 -0
- package/dist/runtime/conversations/components/chat-conversation-list.vue.d.ts +1 -0
- package/dist/runtime/conversations/composables/conversation-actions.d.ts +3 -0
- package/dist/runtime/conversations/composables/conversation-actions.js +16 -0
- package/dist/runtime/conversations/composables/conversation-item.d.ts +3 -11
- package/dist/runtime/conversations/composables/conversation-item.js +37 -19
- package/dist/runtime/conversations/composables/conversation-list.d.ts +5 -0
- package/dist/runtime/conversations/composables/conversation-list.js +21 -4
- package/dist/runtime/{usage/components/chat-usage-view.d.vue.ts → embed/components/chat-details-panel.d.vue.ts} +4 -0
- package/dist/runtime/embed/components/chat-details-panel.vue +239 -0
- package/dist/runtime/{usage/components/chat-usage-view.vue.d.ts → embed/components/chat-details-panel.vue.d.ts} +4 -0
- package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +6 -8
- package/dist/runtime/embed/components/chat-embed-inner.vue +75 -177
- package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +6 -8
- package/dist/runtime/embed/components/chat-sidebar-toggle.d.vue.ts +6 -1
- package/dist/runtime/embed/components/chat-sidebar-toggle.vue +55 -40
- package/dist/runtime/embed/components/chat-sidebar-toggle.vue.d.ts +6 -1
- package/dist/runtime/embed/components/meistrari-chat-embed.d.vue.ts +1 -1
- package/dist/runtime/embed/components/meistrari-chat-embed.vue.d.ts +1 -1
- package/dist/runtime/embed/components/mobile/chat-mobile-header.d.vue.ts +2 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-header.vue.d.ts +2 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +2 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +2 -2
- package/dist/runtime/embed/feature-config.d.ts +2 -2
- package/dist/runtime/files/composables/conversation-file-opener.d.ts +4 -0
- package/dist/runtime/files/composables/conversation-file-opener.js +83 -0
- package/dist/runtime/messages/components/chat-message-input.vue +19 -2
- package/dist/runtime/messages/components/reasoning/chat-reasoning-message.vue +4 -3
- package/dist/runtime/messages/tool-registry.d.ts +6 -1
- package/dist/runtime/messages/tool-registry.js +23 -2
- package/dist/runtime/shared/date-formatting.js +3 -6
- package/dist/runtime/usage/composables/conversation-usage.d.ts +1 -0
- package/dist/runtime/usage/composables/conversation-usage.js +15 -5
- package/dist/runtime/usage/formatting.js +3 -3
- package/package.json +1 -1
- package/dist/runtime/embed/components/chat-topbar.d.vue.ts +0 -53
- package/dist/runtime/embed/components/chat-topbar.vue +0 -238
- package/dist/runtime/embed/components/chat-topbar.vue.d.ts +0 -53
- package/dist/runtime/files/components/chat-files-view.d.vue.ts +0 -6
- package/dist/runtime/files/components/chat-files-view.vue +0 -343
- package/dist/runtime/files/components/chat-files-view.vue.d.ts +0 -6
- package/dist/runtime/usage/components/chat-usage-view.vue +0 -313
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -186,7 +186,7 @@ const _chatNuxtRequire = createRequire(import.meta.url);
|
|
|
186
186
|
const _chatNuxtPackageVersion = _chatNuxtRequire("../package.json").version;
|
|
187
187
|
const VUE_COMPONENT_EXTENSIONS = [".vue"];
|
|
188
188
|
const FEATURE_DIRS = ["citations", "conversations", "embed", "files", "messages", "rendering", "shared", "usage", "workspace"];
|
|
189
|
-
const FULL_NAME_COMPONENT_DIRS = ["citations", "conversations", "embed", "files", "messages"
|
|
189
|
+
const FULL_NAME_COMPONENT_DIRS = ["citations", "conversations", "embed", "files", "messages"];
|
|
190
190
|
const PATH_PREFIX_COMPONENT_DIRS = ["rendering", "shared"];
|
|
191
191
|
const DYNAMIC_ICON_SAFELIST = [
|
|
192
192
|
"i-ph-folder-minus",
|
|
@@ -197,7 +197,14 @@ const DYNAMIC_ICON_SAFELIST = [
|
|
|
197
197
|
"i-ph-folder-notch",
|
|
198
198
|
"i-ph-folder-notch-open",
|
|
199
199
|
// Neutral pill icon for host-defined user mentions (user-mentions.ts).
|
|
200
|
-
"i-ph-paperclip"
|
|
200
|
+
"i-ph-paperclip",
|
|
201
|
+
// Sidebar conversation actions menu (conversation-item.ts).
|
|
202
|
+
"i-ph-pencil-simple-bold",
|
|
203
|
+
"i-ph-copy-bold",
|
|
204
|
+
"i-ph-download-simple-bold",
|
|
205
|
+
"i-ph-link-bold",
|
|
206
|
+
"i-ph-bug",
|
|
207
|
+
"i-ph-trash-bold"
|
|
201
208
|
];
|
|
202
209
|
function resolveChatAuthMode(runtimeConfig) {
|
|
203
210
|
const publicConfig = runtimeConfig.public;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type DebugConversation = {
|
|
2
|
+
id: string;
|
|
3
|
+
threadSessionId: string | null;
|
|
4
|
+
telaAgentId: string | null;
|
|
5
|
+
createdAt: string | Date;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
open: boolean;
|
|
9
|
+
conversation: DebugConversation | null;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
close: () => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onClose?: (() => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useStatusToast } from "../../shared/composables/status-toast";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
open: { type: Boolean, required: true },
|
|
5
|
+
conversation: { type: [Object, null], required: true }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits(["close"]);
|
|
8
|
+
const statusToast = useStatusToast();
|
|
9
|
+
const sessionId = computed(() => props.conversation?.threadSessionId ?? "Sess\xE3o ainda n\xE3o criada");
|
|
10
|
+
async function copyDebugInfo() {
|
|
11
|
+
const conversation = props.conversation;
|
|
12
|
+
const conversationId = conversation?.id ?? null;
|
|
13
|
+
const sessionId2 = conversation?.threadSessionId ?? null;
|
|
14
|
+
const telaAgentId = conversation?.telaAgentId ?? null;
|
|
15
|
+
const createdAt = conversation?.createdAt ? new Date(conversation.createdAt) : null;
|
|
16
|
+
const datadogTimeRange = createdAt ? `&from_ts=${createdAt.getTime()}&to_ts=${Date.now()}&live=false` : "";
|
|
17
|
+
const datadogLogsUrl = (facet, value) => `https://us5.datadoghq.com/logs?query=${encodeURIComponent(`@${facet}:${value}`)}${datadogTimeRange}`;
|
|
18
|
+
const environment = useRuntimeConfig().public.environment;
|
|
19
|
+
const telaAppUrl = environment === "production" ? "https://app.tela.com" : "https://app.telastaging.com";
|
|
20
|
+
const debugInfo = {
|
|
21
|
+
conversationId,
|
|
22
|
+
sessionId: sessionId2,
|
|
23
|
+
telaAgentId,
|
|
24
|
+
createdAt: createdAt?.toISOString() ?? null,
|
|
25
|
+
seeConversationInDatadog: conversationId ? datadogLogsUrl("conversationId", conversationId) : null,
|
|
26
|
+
seeSessionInDatadog: sessionId2 ? datadogLogsUrl("sessionId", sessionId2) : null,
|
|
27
|
+
linkToTelaAgent: telaAgentId ? `${telaAppUrl}/agent/${telaAgentId}` : null
|
|
28
|
+
};
|
|
29
|
+
try {
|
|
30
|
+
await navigator.clipboard.writeText(JSON.stringify(debugInfo, null, 2));
|
|
31
|
+
statusToast.update({ text: "Dados de debug copiados", icon: "i-ph-check" });
|
|
32
|
+
} catch {
|
|
33
|
+
statusToast.update({
|
|
34
|
+
text: "Erro ao copiar dados de debug",
|
|
35
|
+
icon: "i-ph-warning"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<TelaModal
|
|
43
|
+
:model-value="open"
|
|
44
|
+
title="Debug"
|
|
45
|
+
hide-dividers
|
|
46
|
+
compact
|
|
47
|
+
class="w-520px!"
|
|
48
|
+
@close="emit('close')"
|
|
49
|
+
>
|
|
50
|
+
<div flex="~ col" w-full my-24px gap-24px>
|
|
51
|
+
<div flex="~ col" gap-4px w-full>
|
|
52
|
+
<p text-14px font-580 text-gray-700 leading-18px>
|
|
53
|
+
Conversation Id
|
|
54
|
+
</p>
|
|
55
|
+
<div
|
|
56
|
+
px-12px
|
|
57
|
+
py-10px
|
|
58
|
+
rounded-8px
|
|
59
|
+
bg-gray-50
|
|
60
|
+
justify-between
|
|
61
|
+
flex
|
|
62
|
+
items-center
|
|
63
|
+
border="0.5px gray-200"
|
|
64
|
+
>
|
|
65
|
+
<p text-13px text-gray-700 break-all leading-18px>
|
|
66
|
+
{{ conversation?.id ?? "Conversa ainda n\xE3o criada" }}
|
|
67
|
+
</p>
|
|
68
|
+
<TelaCopyButton :content="conversation?.id ?? ''" />
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div flex="~ col" gap-4px w-full>
|
|
72
|
+
<p text-14px font-580 text-gray-700 leading-18px>
|
|
73
|
+
Session Id
|
|
74
|
+
</p>
|
|
75
|
+
<div
|
|
76
|
+
px-12px
|
|
77
|
+
py-10px
|
|
78
|
+
rounded-8px
|
|
79
|
+
bg-gray-50
|
|
80
|
+
justify-between
|
|
81
|
+
flex
|
|
82
|
+
items-center
|
|
83
|
+
border="0.5px gray-200"
|
|
84
|
+
>
|
|
85
|
+
<p text-13px text-gray-700 break-all leading-18px>
|
|
86
|
+
{{ sessionId }}
|
|
87
|
+
</p>
|
|
88
|
+
<TelaCopyButton :content="sessionId" />
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<template #footer>
|
|
93
|
+
<div flex justify-between items-center gap-12px w-full>
|
|
94
|
+
<p text-12px font-400 leading-16px text-tertiary>
|
|
95
|
+
Inclui os ids da conversa e os links de debug no Datadog e no Tela
|
|
96
|
+
</p>
|
|
97
|
+
<TelaButton
|
|
98
|
+
variant="primary"
|
|
99
|
+
icon="i-ph-copy"
|
|
100
|
+
leading
|
|
101
|
+
flex-shrink-0
|
|
102
|
+
@click="copyDebugInfo"
|
|
103
|
+
>
|
|
104
|
+
Copiar dados completos
|
|
105
|
+
</TelaButton>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
</TelaModal>
|
|
109
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type DebugConversation = {
|
|
2
|
+
id: string;
|
|
3
|
+
threadSessionId: string | null;
|
|
4
|
+
telaAgentId: string | null;
|
|
5
|
+
createdAt: string | Date;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
open: boolean;
|
|
9
|
+
conversation: DebugConversation | null;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
close: () => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onClose?: (() => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -7,6 +7,8 @@ type __VLS_Props = {
|
|
|
7
7
|
itemClass?: HTMLAttributes['class'];
|
|
8
8
|
userImage?: string;
|
|
9
9
|
selectConversation?: (id: string) => void | Promise<void>;
|
|
10
|
+
copyLink?: (id: string) => void | Promise<void>;
|
|
11
|
+
debug?: (id: string) => void;
|
|
10
12
|
};
|
|
11
13
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
14
|
delete: (id: string) => any;
|
|
@@ -6,7 +6,9 @@ const props = defineProps({
|
|
|
6
6
|
draggable: { type: Boolean, required: false },
|
|
7
7
|
itemClass: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
8
8
|
userImage: { type: String, required: false },
|
|
9
|
-
selectConversation: { type: Function, required: false }
|
|
9
|
+
selectConversation: { type: Function, required: false },
|
|
10
|
+
copyLink: { type: Function, required: false },
|
|
11
|
+
debug: { type: Function, required: false }
|
|
10
12
|
});
|
|
11
13
|
const emit = defineEmits(["delete", "rename", "duplicate", "export", "dragStart", "dragEnd"]);
|
|
12
14
|
const {
|
|
@@ -36,8 +38,8 @@ function setRenameInputRef(element) {
|
|
|
36
38
|
<a
|
|
37
39
|
:href="conversationPath"
|
|
38
40
|
:draggable="draggable && !isRenamingInline"
|
|
39
|
-
block
|
|
40
|
-
pl-12px pr-
|
|
41
|
+
block relative
|
|
42
|
+
pl-12px pr-16px
|
|
41
43
|
h-30px
|
|
42
44
|
rounded-8px
|
|
43
45
|
class="group data-[active=true]:bg-muted data-[active=false]:hover:bg-subtle"
|
|
@@ -82,7 +84,10 @@ function setRenameInputRef(element) {
|
|
|
82
84
|
</div>
|
|
83
85
|
|
|
84
86
|
<template v-else>
|
|
85
|
-
<div
|
|
87
|
+
<div
|
|
88
|
+
flex-1 min-w-0 flex items-center
|
|
89
|
+
class="group-hover:pr-14px group-focus-within:pr-14px group-has-[[data-state=open]]:pr-14px"
|
|
90
|
+
>
|
|
86
91
|
<span
|
|
87
92
|
body-14-medium
|
|
88
93
|
text-taupe-700
|
|
@@ -93,8 +98,7 @@ function setRenameInputRef(element) {
|
|
|
93
98
|
</div>
|
|
94
99
|
|
|
95
100
|
<div
|
|
96
|
-
flex
|
|
97
|
-
items-center
|
|
101
|
+
flex items-center absolute right-3px top-3px
|
|
98
102
|
class="opacity-0 group-hover:opacity-100 focus-within:opacity-100 [&:has([data-state=open])]:opacity-100"
|
|
99
103
|
>
|
|
100
104
|
<TelaDropdownMenu :items="menuItems" content-class="chat-sidebar-floating">
|
|
@@ -7,6 +7,8 @@ type __VLS_Props = {
|
|
|
7
7
|
itemClass?: HTMLAttributes['class'];
|
|
8
8
|
userImage?: string;
|
|
9
9
|
selectConversation?: (id: string) => void | Promise<void>;
|
|
10
|
+
copyLink?: (id: string) => void | Promise<void>;
|
|
11
|
+
debug?: (id: string) => void;
|
|
10
12
|
};
|
|
11
13
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
14
|
delete: (id: string) => any;
|
|
@@ -7,6 +7,7 @@ type __VLS_Props = {
|
|
|
7
7
|
selectConversation?: (id: string) => void | Promise<void>;
|
|
8
8
|
resetConversation?: () => void | Promise<void>;
|
|
9
9
|
startConversation?: (groupId?: string | null) => void | Promise<void>;
|
|
10
|
+
showDebugOption?: boolean;
|
|
10
11
|
loading?: boolean;
|
|
11
12
|
};
|
|
12
13
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -8,6 +8,7 @@ const props = defineProps({
|
|
|
8
8
|
selectConversation: { type: Function, required: false },
|
|
9
9
|
resetConversation: { type: Function, required: false },
|
|
10
10
|
startConversation: { type: Function, required: false },
|
|
11
|
+
showDebugOption: { type: Boolean, required: false },
|
|
11
12
|
loading: { type: Boolean, required: false }
|
|
12
13
|
});
|
|
13
14
|
const {
|
|
@@ -46,6 +47,8 @@ const {
|
|
|
46
47
|
handleDragOver,
|
|
47
48
|
handleDragLeave,
|
|
48
49
|
getConversationItemProps,
|
|
50
|
+
debugConversationId,
|
|
51
|
+
debugConversation,
|
|
49
52
|
handleConversationDrop,
|
|
50
53
|
startConversationInGroup,
|
|
51
54
|
startUngroupedConversation,
|
|
@@ -493,4 +496,11 @@ function dropTargetClass(row) {
|
|
|
493
496
|
>
|
|
494
497
|
{{ deleteGroupConversationsConfirmationMessage }}
|
|
495
498
|
</TelaConfirmationModal>
|
|
499
|
+
|
|
500
|
+
<ChatConversationDebugModal
|
|
501
|
+
:open="!!debugConversation"
|
|
502
|
+
:conversation="debugConversation"
|
|
503
|
+
class="chat-sidebar-floating"
|
|
504
|
+
@close="debugConversationId = null"
|
|
505
|
+
/>
|
|
496
506
|
</template>
|
|
@@ -7,6 +7,7 @@ type __VLS_Props = {
|
|
|
7
7
|
selectConversation?: (id: string) => void | Promise<void>;
|
|
8
8
|
resetConversation?: () => void | Promise<void>;
|
|
9
9
|
startConversation?: (groupId?: string | null) => void | Promise<void>;
|
|
10
|
+
showDebugOption?: boolean;
|
|
10
11
|
loading?: boolean;
|
|
11
12
|
};
|
|
12
13
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { buildConversationShareUrl } from "../../embed/conversation-share-url.js";
|
|
2
|
+
import { useStatusToast } from "../../shared/composables/status-toast.js";
|
|
3
|
+
export function useConversationActions() {
|
|
4
|
+
const statusToast = useStatusToast();
|
|
5
|
+
async function copyConversationLink(conversationId) {
|
|
6
|
+
try {
|
|
7
|
+
await navigator.clipboard.writeText(buildConversationShareUrl(window.location.href, conversationId));
|
|
8
|
+
statusToast.update({ text: "Link copiado", icon: "i-ph-check" });
|
|
9
|
+
} catch {
|
|
10
|
+
statusToast.update({ text: "Erro ao copiar link", icon: "i-ph-warning" });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
copyConversationLink
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -6,6 +6,8 @@ export type ConversationItemOptions = {
|
|
|
6
6
|
draggable?: boolean;
|
|
7
7
|
userImage?: string;
|
|
8
8
|
selectConversation?: (id: string) => void | Promise<void>;
|
|
9
|
+
copyLink?: (id: string) => void | Promise<void>;
|
|
10
|
+
debug?: (id: string) => void;
|
|
9
11
|
};
|
|
10
12
|
export type ConversationItemEmit = {
|
|
11
13
|
(e: 'delete', id: string): void;
|
|
@@ -22,17 +24,7 @@ export declare function useConversationItem(options: ConversationItemOptions, em
|
|
|
22
24
|
showDeleteModal: any;
|
|
23
25
|
conversationPath: any;
|
|
24
26
|
displayTitle: any;
|
|
25
|
-
menuItems:
|
|
26
|
-
label: string;
|
|
27
|
-
icon: string;
|
|
28
|
-
click: () => void;
|
|
29
|
-
color?: undefined;
|
|
30
|
-
} | {
|
|
31
|
-
label: string;
|
|
32
|
-
icon: string;
|
|
33
|
-
color: "negative";
|
|
34
|
-
click: () => boolean;
|
|
35
|
-
})[];
|
|
27
|
+
menuItems: any;
|
|
36
28
|
confirmDelete: () => void;
|
|
37
29
|
cancelDelete: () => void;
|
|
38
30
|
handleConversationClick: (event: MouseEvent) => void;
|
|
@@ -117,29 +117,47 @@ export function useConversationItem(options, emit) {
|
|
|
117
117
|
return;
|
|
118
118
|
submitRename();
|
|
119
119
|
}
|
|
120
|
-
const menuItems =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
120
|
+
const menuItems = computed(() => {
|
|
121
|
+
const items = [
|
|
122
|
+
{
|
|
123
|
+
label: "Renomear",
|
|
124
|
+
icon: "i-ph-pencil-simple-bold",
|
|
125
|
+
click: () => startRename()
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: "Duplicar",
|
|
129
|
+
icon: "i-ph-copy-bold",
|
|
130
|
+
click: () => emit("duplicate", options.conversation.id)
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: "Exportar",
|
|
134
|
+
icon: "i-ph-download-simple-bold",
|
|
135
|
+
click: () => emit("export", options.conversation.id)
|
|
136
|
+
}
|
|
137
|
+
];
|
|
138
|
+
const { copyLink, debug } = options;
|
|
139
|
+
if (copyLink) {
|
|
140
|
+
items.push({
|
|
141
|
+
label: "Copiar link",
|
|
142
|
+
icon: "i-ph-link-bold",
|
|
143
|
+
click: () => void copyLink(options.conversation.id)
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (debug) {
|
|
147
|
+
items.push({
|
|
148
|
+
label: "Debug",
|
|
149
|
+
icon: "i-ph-bug",
|
|
150
|
+
click: () => debug(options.conversation.id)
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
items.push({
|
|
137
154
|
label: "Excluir",
|
|
138
155
|
icon: "i-ph-trash-bold",
|
|
139
156
|
color: "negative",
|
|
140
157
|
click: () => showDeleteModal.value = true
|
|
141
|
-
}
|
|
142
|
-
|
|
158
|
+
});
|
|
159
|
+
return items;
|
|
160
|
+
});
|
|
143
161
|
onBeforeUnmount(() => {
|
|
144
162
|
clearRenameBlurTimer();
|
|
145
163
|
if (typeof window !== "undefined")
|
|
@@ -7,6 +7,7 @@ export type ConversationListOptions = {
|
|
|
7
7
|
selectConversation?: (id: string) => void | Promise<void>;
|
|
8
8
|
resetConversation?: () => void | Promise<void>;
|
|
9
9
|
startConversation?: (groupId?: string | null) => void | Promise<void>;
|
|
10
|
+
showDebugOption?: boolean;
|
|
10
11
|
loading?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export type GroupDeleteTarget = {
|
|
@@ -120,7 +121,11 @@ export declare function useConversationList(options: ConversationListOptions): {
|
|
|
120
121
|
draggable: boolean;
|
|
121
122
|
userImage: string | undefined;
|
|
122
123
|
selectConversation: ((id: string) => void | Promise<void>) | undefined;
|
|
124
|
+
copyLink: (conversationId: string) => Promise<void>;
|
|
125
|
+
debug: (() => void) | undefined;
|
|
123
126
|
};
|
|
127
|
+
debugConversationId: any;
|
|
128
|
+
debugConversation: any;
|
|
124
129
|
handleConversationDrop: (event: DragEvent, groupId: string | null) => Promise<void>;
|
|
125
130
|
startConversationInGroup: (groupId: string) => void;
|
|
126
131
|
startUngroupedConversation: () => void;
|
|
@@ -8,6 +8,7 @@ import { useChat } from "../../messages/composables/chat.js";
|
|
|
8
8
|
import { useChatApi } from "../../shared/composables/chat-api.js";
|
|
9
9
|
import { useConversationGroups } from "./conversation-groups.js";
|
|
10
10
|
import { useConversations } from "./conversations.js";
|
|
11
|
+
import { useConversationActions } from "./conversation-actions.js";
|
|
11
12
|
import { useEmbedConfig } from "../../embed/composables/embed-config.js";
|
|
12
13
|
const DRAG_OPEN_GROUP_DELAY_MS = 400;
|
|
13
14
|
export function useConversationList(options) {
|
|
@@ -15,8 +16,18 @@ export function useConversationList(options) {
|
|
|
15
16
|
const embedConfig = useEmbedConfig();
|
|
16
17
|
const { activeOrganization } = useChatAuth();
|
|
17
18
|
const { deleteConversation, renameConversation, duplicateConversation, moveConversationToGroup } = useConversations();
|
|
19
|
+
const { copyConversationLink } = useConversationActions();
|
|
18
20
|
const { groups, fetchGroups, createGroup, deleteGroup, renameGroup, error: groupError, pendingRenameGroupId } = useConversationGroups();
|
|
19
|
-
const { setConversation } = useChat();
|
|
21
|
+
const { setConversation, currentConversation } = useChat();
|
|
22
|
+
const debugConversationId = ref(null);
|
|
23
|
+
const debugConversation = computed(() => {
|
|
24
|
+
const id = debugConversationId.value;
|
|
25
|
+
if (!id)
|
|
26
|
+
return null;
|
|
27
|
+
if (currentConversation.value?.id === id)
|
|
28
|
+
return currentConversation.value;
|
|
29
|
+
return options.conversations.find((conversation) => conversation.id === id) ?? null;
|
|
30
|
+
});
|
|
20
31
|
const route = useRoute();
|
|
21
32
|
const router = useRouter();
|
|
22
33
|
const conversationSearch = ref("");
|
|
@@ -74,8 +85,8 @@ export function useConversationList(options) {
|
|
|
74
85
|
() => hasConversationSearchQuery.value ? "Nenhuma conversa encontrada" : "Nenhuma conversa ainda"
|
|
75
86
|
);
|
|
76
87
|
const activeGroupId = computed(() => {
|
|
77
|
-
const
|
|
78
|
-
return
|
|
88
|
+
const currentConversation2 = options.conversations.find((conversation) => conversation.id === options.currentId);
|
|
89
|
+
return currentConversation2?.groupId ?? null;
|
|
79
90
|
});
|
|
80
91
|
onMounted(() => {
|
|
81
92
|
void Promise.resolve(fetchGroups()).finally(() => {
|
|
@@ -486,7 +497,11 @@ export function useConversationList(options) {
|
|
|
486
497
|
active: conversation.id === options.currentId,
|
|
487
498
|
draggable: true,
|
|
488
499
|
userImage: options.getMemberImage?.(conversation.userId),
|
|
489
|
-
selectConversation: options.selectConversation
|
|
500
|
+
selectConversation: options.selectConversation,
|
|
501
|
+
copyLink: copyConversationLink,
|
|
502
|
+
debug: options.showDebugOption ? () => {
|
|
503
|
+
debugConversationId.value = conversation.id;
|
|
504
|
+
} : void 0
|
|
490
505
|
};
|
|
491
506
|
}
|
|
492
507
|
async function handleConversationDrop(event, groupId) {
|
|
@@ -588,6 +603,8 @@ export function useConversationList(options) {
|
|
|
588
603
|
handleDragLeave,
|
|
589
604
|
isDropTarget,
|
|
590
605
|
getConversationItemProps,
|
|
606
|
+
debugConversationId,
|
|
607
|
+
debugConversation,
|
|
591
608
|
handleConversationDrop,
|
|
592
609
|
startConversationInGroup,
|
|
593
610
|
startUngroupedConversation,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { ConversationFile } from '../../types/schemas/chat/files.js';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
conversationId: string;
|
|
4
|
+
files: ConversationFile[];
|
|
5
|
+
filesLoading: boolean;
|
|
3
6
|
createdAt?: string | Date;
|
|
4
7
|
updatedAt?: string | Date;
|
|
8
|
+
showUsage?: boolean;
|
|
5
9
|
};
|
|
6
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
11
|
declare const _default: typeof __VLS_export;
|