@copilotkit/vue 2.0.0-rc.1 → 2.0.0-rc.3
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/PARITY.md +13 -12
- package/README.md +1 -2
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts +3 -1
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts.map +1 -1
- package/dist/index.cjs +43 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10170 -7506
- package/dist/index.mjs.map +1 -1
- package/dist/v2/components/A2UIMessageRenderer.d.ts +7 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts.map +1 -1
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts +11 -2
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts +136 -0
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts.map +1 -0
- package/dist/v2/components/chat/BasicMarkdown.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChat.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts +3 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantToolbarButton.vue.d.ts +16 -0
- package/dist/v2/components/chat/CopilotChatAssistantToolbarButton.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAttachmentRenderer.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAudioRecorder.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.vue.d.ts +22 -0
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +69 -16
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatInspectorButton.vue.d.ts +12 -0
- package/dist/v2/components/chat/CopilotChatInspectorButton.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatLightbox.vue.d.ts +22 -0
- package/dist/v2/components/chat/CopilotChatLightbox.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts +20 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatSuggestionPill.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatSuggestionView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToggleButton.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts +32 -0
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToolCallItem.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts +11 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatWorkSummary.vue.d.ts +5 -0
- package/dist/v2/components/chat/CopilotChatWorkSummary.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeaderTitle.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/StreamingMarkdownDefault.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/index.d.ts +17 -0
- package/dist/v2/components/chat/index.d.ts.map +1 -1
- package/dist/v2/components/chat/inspector-shortcuts.d.ts +12 -0
- package/dist/v2/components/chat/inspector-shortcuts.d.ts.map +1 -0
- package/dist/v2/components/chat/message-feedback.d.ts +89 -0
- package/dist/v2/components/chat/message-feedback.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-capture.d.ts +39 -0
- package/dist/v2/components/chat/tool-call-capture.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-display-context.d.ts +39 -0
- package/dist/v2/components/chat/tool-call-display-context.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-group-parts.d.ts +144 -0
- package/dist/v2/components/chat/tool-call-group-parts.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-layout.d.ts +115 -0
- package/dist/v2/components/chat/tool-call-layout.d.ts.map +1 -0
- package/dist/v2/components/chat/turn-work.d.ts +35 -0
- package/dist/v2/components/chat/turn-work.d.ts.map +1 -0
- package/dist/v2/components/chat/types.d.ts +104 -4
- package/dist/v2/components/chat/types.d.ts.map +1 -1
- package/dist/v2/components/chat/use-lightbox.d.ts +18 -0
- package/dist/v2/components/chat/use-lightbox.d.ts.map +1 -0
- package/dist/v2/components/icons/index.d.ts +1 -1
- package/dist/v2/components/icons/index.d.ts.map +1 -1
- package/dist/v2/components/ui/CopilotDropdownMenuContent.vue.d.ts +55 -0
- package/dist/v2/components/ui/CopilotDropdownMenuContent.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/CopilotPopover.vue.d.ts +40 -0
- package/dist/v2/components/ui/CopilotPopover.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/CopilotTooltip.vue.d.ts +37 -0
- package/dist/v2/components/ui/CopilotTooltip.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/dropdown-menu.d.ts +14 -0
- package/dist/v2/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/v2/components/ui/floating.d.ts +84 -0
- package/dist/v2/components/ui/floating.d.ts.map +1 -0
- package/dist/v2/components/ui/presence.d.ts +9 -0
- package/dist/v2/components/ui/presence.d.ts.map +1 -0
- package/dist/v2/components/ui/use-id.d.ts +9 -0
- package/dist/v2/components/ui/use-id.d.ts.map +1 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts +6 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-tool.d.ts +4 -0
- package/dist/v2/hooks/use-render-tool.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.d.cts +3 -0
- package/dist/v2/index.d.mts +3 -0
- package/dist/v2/index.d.ts +3 -0
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/index.mjs +165 -162
- package/dist/v2/lib/message-feedback.d.ts +33 -0
- package/dist/v2/lib/message-feedback.d.ts.map +1 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.types.d.ts +56 -1
- package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +5 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/index.d.ts +1 -1
- package/dist/v2/providers/index.d.ts.map +1 -1
- package/dist/v2/providers/keys.d.ts +8 -0
- package/dist/v2/providers/keys.d.ts.map +1 -1
- package/dist/v2/providers/types.d.ts +9 -0
- package/dist/v2/providers/types.d.ts.map +1 -1
- package/dist/v2/styles/CopilotKitStyles.d.ts +18 -0
- package/dist/v2/styles/CopilotKitStyles.d.ts.map +1 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts +2 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts.map +1 -1
- package/dist/v2/types/vue-tool-call-renderer.d.ts +7 -0
- package/dist/v2/types/vue-tool-call-renderer.d.ts.map +1 -1
- package/package.json +11 -23
- package/src/components/copilot-provider/CopilotKit.vue +4 -1
- package/src/v2/__tests__/exports.test.ts +4 -2
- package/src/v2/components/A2UIMessageRenderer.ts +55 -67
- package/src/v2/components/A2UISurfaceActivityRenderer.vue +11 -23
- package/src/v2/components/__tests__/A2UIBasicCatalogColors.test.ts +8 -9
- package/src/v2/components/__tests__/A2UIMessageRenderer.test.ts +63 -36
- package/src/v2/components/a2ui/A2UIBuiltInToolCallRenderer.ts +14 -257
- package/src/v2/components/a2ui/A2UIRecoveryStates.ts +444 -0
- package/src/v2/components/a2ui/__tests__/A2UIRecoveryStates.test.ts +175 -0
- package/src/v2/components/chat/BasicMarkdown.vue +8 -6
- package/src/v2/components/chat/CopilotChat.vue +7 -0
- package/src/v2/components/chat/CopilotChatAssistantMessage.vue +267 -67
- package/src/v2/components/chat/CopilotChatAssistantToolbarButton.vue +46 -0
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +141 -168
- package/src/v2/components/chat/CopilotChatAttachmentRenderer.vue +67 -18
- package/src/v2/components/chat/CopilotChatAudioRecorder.vue +2 -2
- package/src/v2/components/chat/CopilotChatFeedbackCommentPopover.vue +240 -0
- package/src/v2/components/chat/CopilotChatInput.vue +210 -161
- package/src/v2/components/chat/CopilotChatInspectorButton.vue +331 -0
- package/src/v2/components/chat/CopilotChatLightbox.vue +105 -0
- package/src/v2/components/chat/CopilotChatMessageView.vue +261 -18
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +21 -22
- package/src/v2/components/chat/CopilotChatSuggestionPill.vue +5 -14
- package/src/v2/components/chat/CopilotChatSuggestionView.vue +1 -4
- package/src/v2/components/chat/CopilotChatToggleButton.vue +3 -9
- package/src/v2/components/chat/CopilotChatToggleButtonCloseIcon.ts +1 -1
- package/src/v2/components/chat/CopilotChatToggleButtonOpenIcon.ts +1 -1
- package/src/v2/components/chat/CopilotChatToolCallGroup.vue +330 -0
- package/src/v2/components/chat/CopilotChatToolCallItem.vue +21 -11
- package/src/v2/components/chat/CopilotChatToolCallsView.vue +192 -21
- package/src/v2/components/chat/CopilotChatUserMessage.vue +105 -42
- package/src/v2/components/chat/CopilotChatView.vue +33 -38
- package/src/v2/components/chat/CopilotChatWorkSummary.vue +85 -0
- package/src/v2/components/chat/CopilotModalHeader.vue +10 -8
- package/src/v2/components/chat/CopilotModalHeaderCloseButton.ts +7 -6
- package/src/v2/components/chat/CopilotModalHeaderTitle.ts +1 -4
- package/src/v2/components/chat/CopilotPopup.vue +3 -0
- package/src/v2/components/chat/CopilotPopupView.vue +1 -0
- package/src/v2/components/chat/CopilotPopupViewInternal.vue +9 -19
- package/src/v2/components/chat/CopilotPopupWelcomeScreen.vue +5 -8
- package/src/v2/components/chat/CopilotSidebar.vue +5 -0
- package/src/v2/components/chat/CopilotSidebarView.vue +2 -0
- package/src/v2/components/chat/CopilotSidebarViewInternal.vue +24 -17
- package/src/v2/components/chat/CopilotSidebarWelcomeScreen.vue +7 -10
- package/src/v2/components/chat/StreamingMarkdownDefault.vue +3 -5
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.inspector.test.ts +269 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.learningFeedback.test.ts +760 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.slots.e2e.test.ts +3 -5
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.test.ts +2 -2
- package/src/v2/components/chat/__tests__/CopilotChatInput.addMenu.test.ts +328 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.slots.e2e.test.ts +6 -3
- package/src/v2/components/chat/__tests__/CopilotChatInput.test.ts +22 -13
- package/src/v2/components/chat/__tests__/CopilotChatLightbox.test.ts +160 -0
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.toolCallDisplay.test.ts +735 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionPill.test.ts +1 -1
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionView.slots.e2e.test.ts +3 -1
- package/src/v2/components/chat/__tests__/CopilotChatToolCallsView.learning.test.ts +75 -0
- package/src/v2/components/chat/__tests__/CopilotChatUserMessage.attachments.test.ts +143 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.inputOverlay.test.ts +5 -4
- package/src/v2/components/chat/__tests__/CopilotChatView.rootWidth.test.ts +7 -33
- package/src/v2/components/chat/__tests__/CopilotModalHeader.slots.e2e.test.ts +1 -1
- package/src/v2/components/chat/__tests__/CopilotPopupView.slots.e2e.test.ts +3 -3
- package/src/v2/components/chat/__tests__/CopilotSidebarView.position.test.ts +126 -0
- package/src/v2/components/chat/__tests__/messageFeedbackDefaults.test.ts +33 -0
- package/src/v2/components/chat/__tests__/modalChatDisplayProps.test.ts +44 -0
- package/src/v2/components/chat/index.ts +2 -0
- package/src/v2/components/chat/inspector-shortcuts.ts +34 -0
- package/src/v2/components/chat/message-feedback.ts +291 -0
- package/src/v2/components/chat/tool-call-capture.ts +55 -0
- package/src/v2/components/chat/tool-call-display-context.ts +49 -0
- package/src/v2/components/chat/tool-call-group-parts.ts +292 -0
- package/src/v2/components/chat/tool-call-layout.ts +304 -0
- package/src/v2/components/chat/turn-work.ts +61 -0
- package/src/v2/components/chat/types.ts +113 -3
- package/src/v2/components/chat/use-lightbox.ts +64 -0
- package/src/v2/components/icons/index.ts +4 -0
- package/src/v2/components/ui/CopilotDropdownMenuContent.vue +465 -0
- package/src/v2/components/ui/CopilotPopover.vue +138 -0
- package/src/v2/components/ui/CopilotTooltip.vue +237 -0
- package/src/v2/components/ui/__tests__/CopilotTooltip.test.ts +168 -0
- package/src/v2/components/ui/dropdown-menu.ts +15 -0
- package/src/v2/components/ui/floating.ts +321 -0
- package/src/v2/components/ui/presence.ts +54 -0
- package/src/v2/components/ui/use-id.ts +16 -0
- package/src/v2/hooks/use-default-render-tool.ts +123 -62
- package/src/v2/hooks/use-render-tool.ts +8 -0
- package/src/v2/index.ts +3 -0
- package/src/v2/lib/__tests__/message-feedback.test.ts +152 -0
- package/src/v2/lib/message-feedback.ts +120 -0
- package/src/v2/providers/CopilotChatConfigurationProvider.vue +29 -2
- package/src/v2/providers/CopilotKitProvider.types.ts +57 -0
- package/src/v2/providers/CopilotKitProvider.vue +125 -3
- package/src/v2/providers/__tests__/CopilotChatConfigurationProvider.openThread.test.ts +69 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.learning.test.ts +534 -0
- package/src/v2/providers/index.ts +4 -1
- package/src/v2/providers/keys.ts +12 -0
- package/src/v2/providers/types.ts +11 -0
- package/src/v2/styles/CopilotKitStyles.ts +95 -0
- package/src/v2/styles/__tests__/CopilotKitStyles.client.test.ts +149 -0
- package/src/v2/styles/__tests__/CopilotKitStyles.ssr.test.ts +71 -0
- package/src/v2/types/defineToolCallRenderer.ts +4 -0
- package/src/v2/types/vue-tool-call-renderer.ts +7 -0
- package/vite.config.ts +2 -1
- package/dist/styles.css +0 -2
- package/scripts/scope-preflight.mjs +0 -100
- package/src/styles/globals.css +0 -233
|
@@ -13,7 +13,6 @@ import { CopilotChatDefaultLabels } from "../../providers/types";
|
|
|
13
13
|
import {
|
|
14
14
|
IconArrowUp,
|
|
15
15
|
IconCheck,
|
|
16
|
-
IconChevronRight,
|
|
17
16
|
IconLoader2,
|
|
18
17
|
IconMic,
|
|
19
18
|
IconPlus,
|
|
@@ -21,6 +20,13 @@ import {
|
|
|
21
20
|
IconX,
|
|
22
21
|
} from "../icons";
|
|
23
22
|
import CopilotChatAudioRecorder from "./CopilotChatAudioRecorder.vue";
|
|
23
|
+
import CopilotTooltip from "../ui/CopilotTooltip.vue";
|
|
24
|
+
import CopilotDropdownMenuContent from "../ui/CopilotDropdownMenuContent.vue";
|
|
25
|
+
import type {
|
|
26
|
+
CopilotDropdownMenuDismissReason,
|
|
27
|
+
CopilotDropdownMenuItem,
|
|
28
|
+
} from "../ui/dropdown-menu";
|
|
29
|
+
import { useCopilotId } from "../ui/use-id";
|
|
24
30
|
import type { CopilotChatAudioRecorderRef } from "./audioRecorder";
|
|
25
31
|
import type { CopilotChatInputMode, ToolsMenuItem } from "./types";
|
|
26
32
|
|
|
@@ -108,7 +114,6 @@ const gridRef = ref<HTMLElement | null>(null);
|
|
|
108
114
|
const addButtonContainerRef = ref<HTMLElement | null>(null);
|
|
109
115
|
const actionsContainerRef = ref<HTMLElement | null>(null);
|
|
110
116
|
const slashMenuRef = ref<HTMLElement | null>(null);
|
|
111
|
-
const addMenuRef = ref<HTMLElement | null>(null);
|
|
112
117
|
const audioRecorderRef = ref<CopilotChatAudioRecorderRef | null>(null);
|
|
113
118
|
const localValue = ref(props.modelValue ?? "");
|
|
114
119
|
const isComposing = ref(false);
|
|
@@ -117,6 +122,12 @@ const commandQuery = ref<string | null>(null);
|
|
|
117
122
|
const slashHighlightIndex = ref(0);
|
|
118
123
|
const previousCommandQuery = ref<string | null>(null);
|
|
119
124
|
const addMenuOpen = ref(false);
|
|
125
|
+
// Where focus goes as the add menu opens: its first or last item for the
|
|
126
|
+
// keyboard, the menu itself for a pointer, as Radix's DropdownMenu does.
|
|
127
|
+
const addMenuInitialFocus = ref<"first" | "last" | "content">("content");
|
|
128
|
+
const addMenuAnchor = ref<HTMLElement | null>(null);
|
|
129
|
+
const addMenuId = useCopilotId("cpk-add-menu");
|
|
130
|
+
const addMenuTriggerId = `${addMenuId}-trigger`;
|
|
120
131
|
const measurements = ref({
|
|
121
132
|
singleLineHeight: 0,
|
|
122
133
|
maxHeight: 0,
|
|
@@ -132,7 +143,6 @@ const containerCacheRef = ref<{
|
|
|
132
143
|
const didWarnMissingFontRef = ref(false);
|
|
133
144
|
const didWarnMissingCanvasContextRef = ref(false);
|
|
134
145
|
let resizeObserver: ResizeObserver | null = null;
|
|
135
|
-
let documentPointerDownHandler: ((event: MouseEvent) => void) | null = null;
|
|
136
146
|
|
|
137
147
|
const isControlled = computed(() => props.modelValue !== undefined);
|
|
138
148
|
const inputValue = computed(() =>
|
|
@@ -179,8 +189,8 @@ const sendDisabled = computed(() =>
|
|
|
179
189
|
);
|
|
180
190
|
|
|
181
191
|
const containerClass = computed(() => [
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
"cpk-chat-input",
|
|
193
|
+
props.positioning === "absolute" && "cpk-chat-input-absolute",
|
|
184
194
|
attrs.class,
|
|
185
195
|
]);
|
|
186
196
|
|
|
@@ -475,23 +485,88 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
475
485
|
}
|
|
476
486
|
}
|
|
477
487
|
|
|
478
|
-
|
|
488
|
+
/** The add button, or the first button of a custom `add-menu-button` slot. */
|
|
489
|
+
function getAddMenuTrigger(): HTMLElement | null {
|
|
490
|
+
const container = addButtonContainerRef.value;
|
|
491
|
+
return container?.querySelector<HTMLElement>("button") ?? container ?? null;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
function toggleAddMenu(focus: "first" | "last" | "content" = "content") {
|
|
479
495
|
if (!hasMenuItems.value || props.mode === "transcribe" || props.disabled) {
|
|
480
496
|
return;
|
|
481
497
|
}
|
|
482
|
-
addMenuOpen.value
|
|
498
|
+
if (addMenuOpen.value) {
|
|
499
|
+
closeAddMenu();
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
addMenuAnchor.value = getAddMenuTrigger();
|
|
503
|
+
addMenuInitialFocus.value = focus;
|
|
504
|
+
addMenuOpen.value = true;
|
|
483
505
|
}
|
|
484
506
|
|
|
485
|
-
function closeAddMenu() {
|
|
507
|
+
function closeAddMenu(options: { returnFocus?: boolean } = {}) {
|
|
508
|
+
if (!addMenuOpen.value) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
486
511
|
addMenuOpen.value = false;
|
|
512
|
+
if (options.returnFocus) {
|
|
513
|
+
getAddMenuTrigger()?.focus();
|
|
514
|
+
}
|
|
487
515
|
}
|
|
488
516
|
|
|
489
517
|
function handleMenuAction(action: () => void) {
|
|
518
|
+
// As Radix does, the menu closes and focus returns to its trigger first, so
|
|
519
|
+
// an action that moves focus (for example into the textarea) keeps it.
|
|
520
|
+
closeAddMenu({ returnFocus: true });
|
|
490
521
|
action();
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function handleAddMenuSelect(item: CopilotDropdownMenuItem) {
|
|
525
|
+
if (item.action) {
|
|
526
|
+
handleMenuAction(item.action);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function handleAddMenuDismiss(reason: CopilotDropdownMenuDismissReason) {
|
|
531
|
+
// A pointer down outside leaves focus where the pointer put it.
|
|
532
|
+
closeAddMenu({ returnFocus: reason !== "outside" });
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// A pointer down opens the menu, as Radix's trigger does; the click that
|
|
536
|
+
// follows it then must not toggle it again. Keyboard and synthetic clicks
|
|
537
|
+
// (detail 0) still toggle it from the click.
|
|
538
|
+
let addMenuPointerToggled = false;
|
|
539
|
+
|
|
540
|
+
function handleAddMenuPointerDown(event: PointerEvent) {
|
|
541
|
+
if (event.button !== 0 || event.ctrlKey) {
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
addMenuPointerToggled = true;
|
|
545
|
+
if (!addMenuOpen.value) {
|
|
546
|
+
// Keep focus off the trigger, so the menu can take it.
|
|
547
|
+
event.preventDefault();
|
|
548
|
+
}
|
|
549
|
+
toggleAddMenu("content");
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function handleAddMenuClick(event: MouseEvent) {
|
|
553
|
+
if (addMenuPointerToggled) {
|
|
554
|
+
addMenuPointerToggled = false;
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
toggleAddMenu(event.detail === 0 ? "first" : "content");
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function handleAddMenuTriggerKeydown(event: KeyboardEvent) {
|
|
561
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
562
|
+
event.preventDefault();
|
|
563
|
+
toggleAddMenu("first");
|
|
564
|
+
} else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
565
|
+
event.preventDefault();
|
|
566
|
+
if (!addMenuOpen.value) {
|
|
567
|
+
toggleAddMenu(event.key === "ArrowDown" ? "first" : "last");
|
|
568
|
+
}
|
|
569
|
+
}
|
|
495
570
|
}
|
|
496
571
|
|
|
497
572
|
async function handleFinishTranscribe() {
|
|
@@ -909,32 +984,9 @@ onMounted(() => {
|
|
|
909
984
|
resizeObserver.observe(actionsContainerRef.value);
|
|
910
985
|
if (textareaRef.value) resizeObserver.observe(textareaRef.value);
|
|
911
986
|
}
|
|
912
|
-
|
|
913
|
-
documentPointerDownHandler = (event: MouseEvent) => {
|
|
914
|
-
if (!addMenuOpen.value) {
|
|
915
|
-
return;
|
|
916
|
-
}
|
|
917
|
-
const target = event.target as Node | null;
|
|
918
|
-
if (!target) {
|
|
919
|
-
return;
|
|
920
|
-
}
|
|
921
|
-
if (
|
|
922
|
-
addMenuRef.value?.contains(target) ||
|
|
923
|
-
addButtonContainerRef.value?.contains(target)
|
|
924
|
-
) {
|
|
925
|
-
return;
|
|
926
|
-
}
|
|
927
|
-
closeAddMenu();
|
|
928
|
-
};
|
|
929
|
-
|
|
930
|
-
document.addEventListener("mousedown", documentPointerDownHandler);
|
|
931
987
|
});
|
|
932
988
|
|
|
933
989
|
onBeforeUnmount(() => {
|
|
934
|
-
if (documentPointerDownHandler) {
|
|
935
|
-
document.removeEventListener("mousedown", documentPointerDownHandler);
|
|
936
|
-
documentPointerDownHandler = null;
|
|
937
|
-
}
|
|
938
990
|
resizeObserver?.disconnect();
|
|
939
991
|
resizeObserver = null;
|
|
940
992
|
if (resizeEvaluationRafRef.value !== null) {
|
|
@@ -959,9 +1011,7 @@ onBeforeUnmount(() => {
|
|
|
959
1011
|
}"
|
|
960
1012
|
v-bind="rootAttrs"
|
|
961
1013
|
>
|
|
962
|
-
<div
|
|
963
|
-
class="cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4 cpk:py-0 cpk:@3xl:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-4"
|
|
964
|
-
>
|
|
1014
|
+
<div class="cpk-chat-input-wrapper">
|
|
965
1015
|
<slot
|
|
966
1016
|
name="layout"
|
|
967
1017
|
:mode="mode"
|
|
@@ -973,7 +1023,7 @@ onBeforeUnmount(() => {
|
|
|
973
1023
|
:send-disabled="sendDisabled"
|
|
974
1024
|
:menu-open="addMenuOpen"
|
|
975
1025
|
:menu-items="menuDisplayItems"
|
|
976
|
-
:on-toggle-menu="toggleAddMenu"
|
|
1026
|
+
:on-toggle-menu="() => toggleAddMenu()"
|
|
977
1027
|
:on-menu-action="handleMenuAction"
|
|
978
1028
|
:on-update-value="updateInputValue"
|
|
979
1029
|
:on-submit="submit"
|
|
@@ -986,99 +1036,81 @@ onBeforeUnmount(() => {
|
|
|
986
1036
|
<div
|
|
987
1037
|
ref="shellRef"
|
|
988
1038
|
data-testid="copilot-chat-input-shell"
|
|
989
|
-
class="
|
|
1039
|
+
class="copilotKitInput cpk-chat-input-pill"
|
|
990
1040
|
:data-layout="isExpanded ? 'expanded' : 'compact'"
|
|
991
1041
|
@click="handleContainerClick"
|
|
992
1042
|
>
|
|
993
1043
|
<div
|
|
994
1044
|
ref="gridRef"
|
|
995
|
-
|
|
996
|
-
'cpk:grid cpk:w-full cpk:gap-x-3 cpk:gap-y-3 cpk:px-3 cpk:py-2',
|
|
997
|
-
isExpanded
|
|
998
|
-
? 'cpk:grid-cols-[auto_minmax(0,1fr)_auto] cpk:grid-rows-[auto_auto]'
|
|
999
|
-
: 'cpk:grid-cols-[auto_minmax(0,1fr)_auto] cpk:items-center',
|
|
1000
|
-
]"
|
|
1045
|
+
class="cpk-chat-input-grid"
|
|
1001
1046
|
:data-layout="isExpanded ? 'expanded' : 'compact'"
|
|
1002
1047
|
>
|
|
1003
|
-
<div
|
|
1004
|
-
ref="addButtonContainerRef"
|
|
1005
|
-
:class="[
|
|
1006
|
-
'cpk:relative cpk:flex cpk:items-center cpk:col-start-1',
|
|
1007
|
-
isExpanded ? 'cpk:row-start-2' : 'cpk:row-start-1',
|
|
1008
|
-
]"
|
|
1009
|
-
>
|
|
1048
|
+
<div ref="addButtonContainerRef" class="cpk-chat-input-start">
|
|
1010
1049
|
<slot
|
|
1011
1050
|
name="add-menu-button"
|
|
1012
1051
|
:disabled="disabled || mode === 'transcribe' || !hasMenuItems"
|
|
1013
1052
|
:menu-open="addMenuOpen"
|
|
1014
|
-
:toggle-menu="toggleAddMenu"
|
|
1053
|
+
:toggle-menu="() => toggleAddMenu()"
|
|
1015
1054
|
:labels="labels"
|
|
1016
1055
|
>
|
|
1017
|
-
<
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1056
|
+
<CopilotTooltip side="bottom" :suppressed="addMenuOpen">
|
|
1057
|
+
<template #default="{ triggerProps }">
|
|
1058
|
+
<button
|
|
1059
|
+
v-bind="triggerProps"
|
|
1060
|
+
:id="addMenuTriggerId"
|
|
1061
|
+
type="button"
|
|
1062
|
+
data-testid="copilot-chat-input-add"
|
|
1063
|
+
:aria-label="labels.chatInputToolbarAddButtonLabel"
|
|
1064
|
+
aria-haspopup="menu"
|
|
1065
|
+
:aria-expanded="addMenuOpen"
|
|
1066
|
+
:aria-controls="addMenuOpen ? addMenuId : undefined"
|
|
1067
|
+
:data-state="addMenuOpen ? 'open' : 'closed'"
|
|
1068
|
+
:disabled="
|
|
1069
|
+
disabled || mode === 'transcribe' || !hasMenuItems
|
|
1070
|
+
"
|
|
1071
|
+
class="cpk-button cpk-button-chat-input-toolbar-secondary cpk-button-size-chat-input-toolbar-icon cpk-chat-input-add-menu-button"
|
|
1072
|
+
@pointerdown="handleAddMenuPointerDown"
|
|
1073
|
+
@click.stop="handleAddMenuClick"
|
|
1074
|
+
@keydown="handleAddMenuTriggerKeydown"
|
|
1075
|
+
>
|
|
1076
|
+
<IconPlus class="cpk-chat-input-add-menu-icon" />
|
|
1077
|
+
</button>
|
|
1078
|
+
</template>
|
|
1079
|
+
<template #content>
|
|
1080
|
+
<p class="cpk-chat-input-add-menu-tooltip">
|
|
1081
|
+
<span>{{ labels.chatInputToolbarAddButtonLabel }}</span>
|
|
1082
|
+
<code class="cpk-chat-input-add-menu-shortcut">/</code>
|
|
1083
|
+
</p>
|
|
1084
|
+
</template>
|
|
1085
|
+
</CopilotTooltip>
|
|
1027
1086
|
</slot>
|
|
1028
1087
|
|
|
1029
|
-
<
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1088
|
+
<CopilotDropdownMenuContent
|
|
1089
|
+
:id="addMenuId"
|
|
1090
|
+
:open="addMenuOpen && hasMenuItems"
|
|
1091
|
+
:anchor="addMenuAnchor"
|
|
1092
|
+
:items="menuItems"
|
|
1093
|
+
:menu-id="addMenuId"
|
|
1094
|
+
:labelled-by="addMenuAnchor?.id || undefined"
|
|
1095
|
+
side="top"
|
|
1096
|
+
align="start"
|
|
1097
|
+
:side-offset="4"
|
|
1098
|
+
:initial-focus="addMenuInitialFocus"
|
|
1033
1099
|
data-testid="copilot-chat-input-add-menu"
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
v-if="entry.type === 'separator'"
|
|
1038
|
-
class="cpk:my-1 cpk:h-px cpk:bg-border cpk:dark:bg-[#333333]"
|
|
1039
|
-
/>
|
|
1040
|
-
<div
|
|
1041
|
-
v-else-if="entry.type === 'label'"
|
|
1042
|
-
class="cpk:flex cpk:items-center cpk:gap-1 cpk:px-3 cpk:py-1.5 cpk:text-xs cpk:font-semibold cpk:text-muted-foreground"
|
|
1043
|
-
:style="{ paddingLeft: `${12 + entry.depth * 12}px` }"
|
|
1044
|
-
>
|
|
1045
|
-
<span>{{ entry.label }}</span>
|
|
1046
|
-
<IconChevronRight class="cpk:size-3" />
|
|
1047
|
-
</div>
|
|
1048
|
-
<button
|
|
1049
|
-
v-else
|
|
1050
|
-
type="button"
|
|
1051
|
-
role="menuitem"
|
|
1052
|
-
class="cpk:w-full cpk:px-3 cpk:py-2 cpk:text-left cpk:text-sm cpk:transition-colors cpk:hover:bg-muted cpk:dark:hover:bg-[#2f2f2f]"
|
|
1053
|
-
:style="{ paddingLeft: `${12 + entry.depth * 12}px` }"
|
|
1054
|
-
@click="handleMenuAction(entry.action)"
|
|
1055
|
-
>
|
|
1056
|
-
{{ entry.label }}
|
|
1057
|
-
</button>
|
|
1058
|
-
</template>
|
|
1059
|
-
</div>
|
|
1100
|
+
@select="handleAddMenuSelect"
|
|
1101
|
+
@dismiss="handleAddMenuDismiss"
|
|
1102
|
+
/>
|
|
1060
1103
|
</div>
|
|
1061
1104
|
|
|
1062
|
-
<div
|
|
1063
|
-
:class="[
|
|
1064
|
-
'cpk:relative cpk:flex cpk:min-h-[50px] cpk:min-w-0 cpk:flex-col cpk:justify-center',
|
|
1065
|
-
isExpanded
|
|
1066
|
-
? 'cpk:col-span-3 cpk:row-start-1'
|
|
1067
|
-
: 'cpk:col-start-2 cpk:row-start-1',
|
|
1068
|
-
]"
|
|
1069
|
-
>
|
|
1105
|
+
<div class="cpk-chat-input-field">
|
|
1070
1106
|
<template v-if="mode === 'transcribe'">
|
|
1071
1107
|
<slot name="audio-recorder">
|
|
1072
1108
|
<CopilotChatAudioRecorder ref="audioRecorderRef" />
|
|
1073
1109
|
</slot>
|
|
1074
1110
|
</template>
|
|
1075
1111
|
<template v-else-if="mode === 'processing'">
|
|
1076
|
-
<div
|
|
1077
|
-
class="cpk
|
|
1078
|
-
>
|
|
1079
|
-
<IconLoader2
|
|
1080
|
-
class="cpk:size-[26px] cpk:animate-spin cpk:text-muted-foreground"
|
|
1081
|
-
/>
|
|
1112
|
+
<div class="cpk-chat-input-processing">
|
|
1113
|
+
<IconLoader2 class="cpk-chat-input-processing-spinner" />
|
|
1082
1114
|
</div>
|
|
1083
1115
|
</template>
|
|
1084
1116
|
<template v-else>
|
|
@@ -1102,8 +1134,10 @@ onBeforeUnmount(() => {
|
|
|
1102
1134
|
:disabled="disabled"
|
|
1103
1135
|
rows="1"
|
|
1104
1136
|
:class="[
|
|
1105
|
-
'cpk
|
|
1106
|
-
isExpanded
|
|
1137
|
+
'cpk-chat-input-textarea',
|
|
1138
|
+
isExpanded
|
|
1139
|
+
? 'cpk-chat-input-textarea-expanded'
|
|
1140
|
+
: 'cpk-chat-input-textarea-compact',
|
|
1107
1141
|
]"
|
|
1108
1142
|
style="overflow: auto; resize: none"
|
|
1109
1143
|
@input="handleInput"
|
|
@@ -1119,12 +1153,12 @@ onBeforeUnmount(() => {
|
|
|
1119
1153
|
data-testid="copilot-slash-menu"
|
|
1120
1154
|
role="listbox"
|
|
1121
1155
|
:aria-label="labels.chatInputSlashMenuLabel"
|
|
1122
|
-
class="cpk
|
|
1156
|
+
class="cpk-chat-input-slash-menu"
|
|
1123
1157
|
:style="{ maxHeight: `${5 * 40}px` }"
|
|
1124
1158
|
>
|
|
1125
1159
|
<div
|
|
1126
1160
|
v-if="filteredCommands.length === 0"
|
|
1127
|
-
class="cpk
|
|
1161
|
+
class="cpk-chat-input-slash-menu-empty"
|
|
1128
1162
|
>
|
|
1129
1163
|
{{ labels.chatInputSlashMenuEmptyText }}
|
|
1130
1164
|
</div>
|
|
@@ -1139,12 +1173,7 @@ onBeforeUnmount(() => {
|
|
|
1139
1173
|
:data-active="
|
|
1140
1174
|
index === slashHighlightIndex ? 'true' : undefined
|
|
1141
1175
|
"
|
|
1142
|
-
|
|
1143
|
-
'cpk:w-full cpk:px-3 cpk:py-2 cpk:text-left cpk:text-sm cpk:transition-colors cpk:hover:bg-muted cpk:dark:hover:bg-[#2f2f2f]',
|
|
1144
|
-
index === slashHighlightIndex
|
|
1145
|
-
? 'cpk:bg-muted cpk:dark:bg-[#2f2f2f]'
|
|
1146
|
-
: 'cpk:bg-transparent',
|
|
1147
|
-
]"
|
|
1176
|
+
class="cpk-chat-input-slash-menu-item"
|
|
1148
1177
|
@mouseenter="slashHighlightIndex = index"
|
|
1149
1178
|
@mousedown.prevent="runCommand(command)"
|
|
1150
1179
|
>
|
|
@@ -1154,15 +1183,7 @@ onBeforeUnmount(() => {
|
|
|
1154
1183
|
</template>
|
|
1155
1184
|
</div>
|
|
1156
1185
|
|
|
1157
|
-
<div
|
|
1158
|
-
ref="actionsContainerRef"
|
|
1159
|
-
:class="[
|
|
1160
|
-
'cpk:flex cpk:items-center cpk:justify-end cpk:gap-2',
|
|
1161
|
-
isExpanded
|
|
1162
|
-
? 'cpk:col-start-3 cpk:row-start-2'
|
|
1163
|
-
: 'cpk:col-start-3 cpk:row-start-1',
|
|
1164
|
-
]"
|
|
1165
|
-
>
|
|
1186
|
+
<div ref="actionsContainerRef" class="cpk-chat-input-actions">
|
|
1166
1187
|
<template v-if="mode === 'transcribe'">
|
|
1167
1188
|
<slot
|
|
1168
1189
|
v-if="
|
|
@@ -1174,18 +1195,28 @@ onBeforeUnmount(() => {
|
|
|
1174
1195
|
:on-click="() => emit('cancel-transcribe')"
|
|
1175
1196
|
:labels="labels"
|
|
1176
1197
|
>
|
|
1177
|
-
<
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
:aria-label="
|
|
1198
|
+
<CopilotTooltip
|
|
1199
|
+
side="bottom"
|
|
1200
|
+
:content="
|
|
1181
1201
|
labels.chatInputToolbarCancelTranscribeButtonLabel
|
|
1182
1202
|
"
|
|
1183
|
-
:disabled="disabled"
|
|
1184
|
-
class="cpk:mr-2 cpk:inline-flex cpk:h-9 cpk:w-9 cpk:shrink-0 cpk:items-center cpk:justify-center cpk:rounded-full cpk:bg-transparent cpk:text-[#444444] cpk:transition-colors cpk:hover:bg-[#f8f8f8] cpk:hover:text-[#333333] cpk:disabled:cursor-not-allowed cpk:disabled:opacity-50 cpk:dark:text-white cpk:dark:hover:bg-[#404040] cpk:dark:hover:text-[#FFFFFF]"
|
|
1185
|
-
@click="emit('cancel-transcribe')"
|
|
1186
1203
|
>
|
|
1187
|
-
<
|
|
1188
|
-
|
|
1204
|
+
<template #default="{ triggerProps }">
|
|
1205
|
+
<button
|
|
1206
|
+
v-bind="triggerProps"
|
|
1207
|
+
type="button"
|
|
1208
|
+
data-testid="copilot-chat-input-cancel-transcribe"
|
|
1209
|
+
:aria-label="
|
|
1210
|
+
labels.chatInputToolbarCancelTranscribeButtonLabel
|
|
1211
|
+
"
|
|
1212
|
+
:disabled="disabled"
|
|
1213
|
+
class="cpk-button cpk-button-chat-input-toolbar-secondary cpk-button-size-chat-input-toolbar-icon cpk-chat-input-cancel-transcribe-button"
|
|
1214
|
+
@click="emit('cancel-transcribe')"
|
|
1215
|
+
>
|
|
1216
|
+
<IconX class="cpk-chat-input-toolbar-icon" />
|
|
1217
|
+
</button>
|
|
1218
|
+
</template>
|
|
1219
|
+
</CopilotTooltip>
|
|
1189
1220
|
</slot>
|
|
1190
1221
|
<slot
|
|
1191
1222
|
v-if="
|
|
@@ -1197,18 +1228,28 @@ onBeforeUnmount(() => {
|
|
|
1197
1228
|
:on-click="handleFinishTranscribe"
|
|
1198
1229
|
:labels="labels"
|
|
1199
1230
|
>
|
|
1200
|
-
<
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
:aria-label="
|
|
1231
|
+
<CopilotTooltip
|
|
1232
|
+
side="bottom"
|
|
1233
|
+
:content="
|
|
1204
1234
|
labels.chatInputToolbarFinishTranscribeButtonLabel
|
|
1205
1235
|
"
|
|
1206
|
-
:disabled="disabled"
|
|
1207
|
-
class="cpk:mr-[10px] cpk:inline-flex cpk:h-9 cpk:w-9 cpk:shrink-0 cpk:items-center cpk:justify-center cpk:rounded-full cpk:bg-transparent cpk:text-[#444444] cpk:transition-colors cpk:hover:bg-[#f8f8f8] cpk:hover:text-[#333333] cpk:disabled:cursor-not-allowed cpk:disabled:opacity-50 cpk:dark:text-white cpk:dark:hover:bg-[#404040] cpk:dark:hover:text-[#FFFFFF]"
|
|
1208
|
-
@click="handleFinishTranscribe"
|
|
1209
1236
|
>
|
|
1210
|
-
<
|
|
1211
|
-
|
|
1237
|
+
<template #default="{ triggerProps }">
|
|
1238
|
+
<button
|
|
1239
|
+
v-bind="triggerProps"
|
|
1240
|
+
type="button"
|
|
1241
|
+
data-testid="copilot-chat-input-finish-transcribe"
|
|
1242
|
+
:aria-label="
|
|
1243
|
+
labels.chatInputToolbarFinishTranscribeButtonLabel
|
|
1244
|
+
"
|
|
1245
|
+
:disabled="disabled"
|
|
1246
|
+
class="cpk-button cpk-button-chat-input-toolbar-secondary cpk-button-size-chat-input-toolbar-icon cpk-chat-input-finish-transcribe-button"
|
|
1247
|
+
@click="handleFinishTranscribe"
|
|
1248
|
+
>
|
|
1249
|
+
<IconCheck class="cpk-chat-input-toolbar-icon" />
|
|
1250
|
+
</button>
|
|
1251
|
+
</template>
|
|
1252
|
+
</CopilotTooltip>
|
|
1212
1253
|
</slot>
|
|
1213
1254
|
</template>
|
|
1214
1255
|
<template v-else>
|
|
@@ -1222,18 +1263,26 @@ onBeforeUnmount(() => {
|
|
|
1222
1263
|
:on-click="() => emit('start-transcribe')"
|
|
1223
1264
|
:labels="labels"
|
|
1224
1265
|
>
|
|
1225
|
-
<
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
:aria-label="
|
|
1229
|
-
labels.chatInputToolbarStartTranscribeButtonLabel
|
|
1230
|
-
"
|
|
1231
|
-
:disabled="disabled"
|
|
1232
|
-
class="cpk:mr-2 cpk:inline-flex cpk:h-9 cpk:w-9 cpk:shrink-0 cpk:items-center cpk:justify-center cpk:rounded-full cpk:bg-transparent cpk:text-[#444444] cpk:transition-colors cpk:hover:bg-[#f8f8f8] cpk:hover:text-[#333333] cpk:disabled:cursor-not-allowed cpk:disabled:opacity-50 cpk:disabled:hover:bg-transparent cpk:disabled:hover:text-[#444444] cpk:dark:text-white cpk:dark:hover:bg-[#404040] cpk:dark:hover:text-[#FFFFFF] cpk:dark:disabled:hover:bg-transparent cpk:dark:disabled:hover:text-[#CCCCCC]"
|
|
1233
|
-
@click="emit('start-transcribe')"
|
|
1266
|
+
<CopilotTooltip
|
|
1267
|
+
side="bottom"
|
|
1268
|
+
:content="labels.chatInputToolbarStartTranscribeButtonLabel"
|
|
1234
1269
|
>
|
|
1235
|
-
<
|
|
1236
|
-
|
|
1270
|
+
<template #default="{ triggerProps }">
|
|
1271
|
+
<button
|
|
1272
|
+
v-bind="triggerProps"
|
|
1273
|
+
type="button"
|
|
1274
|
+
data-testid="copilot-chat-input-start-transcribe"
|
|
1275
|
+
:aria-label="
|
|
1276
|
+
labels.chatInputToolbarStartTranscribeButtonLabel
|
|
1277
|
+
"
|
|
1278
|
+
:disabled="disabled"
|
|
1279
|
+
class="cpk-button cpk-button-chat-input-toolbar-secondary cpk-button-size-chat-input-toolbar-icon cpk-chat-input-start-transcribe-button"
|
|
1280
|
+
@click="emit('start-transcribe')"
|
|
1281
|
+
>
|
|
1282
|
+
<IconMic class="cpk-chat-input-toolbar-icon" />
|
|
1283
|
+
</button>
|
|
1284
|
+
</template>
|
|
1285
|
+
</CopilotTooltip>
|
|
1237
1286
|
</slot>
|
|
1238
1287
|
<slot
|
|
1239
1288
|
name="send-button"
|
|
@@ -1241,7 +1290,7 @@ onBeforeUnmount(() => {
|
|
|
1241
1290
|
:is-processing="isProcessing"
|
|
1242
1291
|
:on-click="handleSendButtonClick"
|
|
1243
1292
|
>
|
|
1244
|
-
<div class="cpk
|
|
1293
|
+
<div class="cpk-chat-input-send">
|
|
1245
1294
|
<button
|
|
1246
1295
|
type="button"
|
|
1247
1296
|
data-testid="copilot-chat-input-send"
|
|
@@ -1251,14 +1300,14 @@ onBeforeUnmount(() => {
|
|
|
1251
1300
|
: labels.chatInputToolbarSendButtonLabel
|
|
1252
1301
|
"
|
|
1253
1302
|
:disabled="sendDisabled"
|
|
1254
|
-
class="cpk
|
|
1303
|
+
class="cpk-button cpk-button-chat-input-toolbar-primary cpk-button-size-chat-input-toolbar-icon cpk-chat-input-send-button"
|
|
1255
1304
|
@click="handleSendButtonClick"
|
|
1256
1305
|
>
|
|
1257
1306
|
<IconSquare
|
|
1258
1307
|
v-if="isProcessing && hasStopAction"
|
|
1259
|
-
class="cpk
|
|
1308
|
+
class="cpk-chat-input-stop-icon"
|
|
1260
1309
|
/>
|
|
1261
|
-
<IconArrowUp v-else class="cpk
|
|
1310
|
+
<IconArrowUp v-else class="cpk-chat-input-send-icon" />
|
|
1262
1311
|
</button>
|
|
1263
1312
|
</div>
|
|
1264
1313
|
</slot>
|
|
@@ -1272,7 +1321,7 @@ onBeforeUnmount(() => {
|
|
|
1272
1321
|
<slot v-if="shouldShowDisclaimer" name="disclaimer" :labels="labels">
|
|
1273
1322
|
<p
|
|
1274
1323
|
data-testid="copilot-chat-input-disclaimer"
|
|
1275
|
-
class="cpk
|
|
1324
|
+
class="cpk-chat-input-disclaimer"
|
|
1276
1325
|
>
|
|
1277
1326
|
{{ labels.chatDisclaimerText }}
|
|
1278
1327
|
</p>
|