diff --git a/assets/actionButton.js b/assets/actionButton.js
deleted file mode 100644
index 446393c..0000000
--- a/assets/actionButton.js
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-function processMessageUI(message) {
- addMessageToUI('user', message);
- messageUtil.sendMessage({
- command: 'sendMessage',
- text: message});
-}
-
-function userMessageActions(messageItem, onCancel, onSend, onEdit) {
- const buttonGroup = document.createElement('div');
- buttonGroup.classList.add('button-group');
-
- const cancelButton = document.createElement('button');
- cancelButton.classList.add('cancel-button');
- cancelButton.innerText = 'Cancel';
- buttonGroup.appendChild(cancelButton);
-
- const sendButton = document.createElement('button');
- sendButton.classList.add('send-button');
- sendButton.innerText = 'Send';
- buttonGroup.appendChild(sendButton);
-
- const editButton = document.createElement('button');
- editButton.classList.add('edit-button');
- editButton.innerHTML = '';
- buttonGroup.appendChild(editButton);
-
- messageItem.appendChild(buttonGroup);
-
- // Initially hide the cancel and send buttons
- cancelButton.style.display = 'none';
- sendButton.style.display = 'none';
-
- // Add a click listener to the edit button
- editButton.addEventListener('click', () => {
- // Hide the edit button and show the cancel and send buttons
- editButton.style.display = 'none';
- cancelButton.style.display = 'inline-block';
- sendButton.style.display = 'inline-block';
-
- // Add your existing edit button functionality here
- onEdit();
- });
-
- // Add an event listener for the cancel button
- cancelButton.addEventListener('click', () => {
- // Hide the cancel and send buttons and show the edit button
- cancelButton.style.display = 'none';
- sendButton.style.display = 'none';
- editButton.style.display = 'inline-block';
-
- // Add your existing cancel button functionality here
- onCancel();
- });
-
- // Add an event listener for the send button
- sendButton.addEventListener('click', () => {
- // Hide the cancel and send buttons and show the edit button
- cancelButton.style.display = 'none';
- sendButton.style.display = 'none';
- editButton.style.display = 'inline-block';
-
- // Add your existing save button functionality here
- onSend();
- });
-}
-
-function messageItemActions(messageItem, messageContent, role) {
- if (role === 'user') {
- userMessageActions(messageItem, () => { // onCancel
- const textArea = messageItem.querySelector('.edit-textarea');
- textArea.replaceWith(messageContent)
- // Remove the text area, save button, and cancel button
- textArea.remove();
- }, () => { // onSend
- const textArea = messageItem.querySelector('.edit-textarea');
- const newMessage = textArea.value.trim();
- if (newMessage !== '') {
- textArea.replaceWith(messageContent)
- // Remove the text area, save button, and cancel button
- textArea.remove();
-
- // Process and send the new message to the extension
- processMessageUI(newMessage);
- }
- }, () => { // onEdit
- // Create a new text area element with the same size as the message content
- const textArea = document.createElement('textarea');
- textArea.classList.add('edit-textarea');
- textArea.style.width = `${messageContent.offsetWidth}px`;
- textArea.style.height = `${messageContent.offsetHeight}px`;
- textArea.value = messageContent.textContent.trim();
- messageContent.replaceWith(textArea);
-
- // Focus on the text area
- textArea.focus();
- });
- } else {
- // TODO
- // currently there is no action for the bot message
- //
- // const actionIcon = document.createElement('i');
- // actionIcon.className = 'fas fa-check-circle';
- // messageItem.appendChild(actionIcon);
- }
-}
\ No newline at end of file
diff --git a/assets/bot-icon.png b/assets/bot-icon.png
deleted file mode 100644
index bf44c1e..0000000
Binary files a/assets/bot-icon.png and /dev/null differ
diff --git a/assets/chatPanel.css b/assets/chatPanel.css
deleted file mode 100644
index dbf92fd..0000000
--- a/assets/chatPanel.css
+++ /dev/null
@@ -1,215 +0,0 @@
-:root {
- --vscode-background: var(--vscode-editor-background);
- --vscode-foreground: var(--vscode-editor-foreground);
- --vscode-border: var(--vscode-editorWidget-border);
- --vscode-button-bg: var(--vscode-button-background);
- --vscode-button-fg: var(--vscode-button-foreground);
- --vscode-button-hover-bg: var(--vscode-button-hoverBackground);
-}
-
-body {
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
- background-color: var(--vscode-background);
- color: var(--vscode-foreground);
- margin: 0;
- padding: 0;
-}
-
-p {
- margin-top: 0;
-}
-
-pre {
- background-color: #f1f1f1;
- overflow: auto;
- margin-top: 0;
-}
-
-#chat-container {
- display: flex;
- flex-direction: column;
- height: 100vh;
-}
-
-.code-block {
- background-color: #f1f1f1;
- color: #000000;
- padding: 10px;
- border-radius: 4px;
- overflow-y: auto;
- font-size: 14px;
- margin: 0;
- display: block;
- margin: 10px 0;
- padding: 10px;
- background-color: #f1f1f1;
- border-radius: 5px;
- overflow: auto;
-}
-
-.context-menu {
- position: absolute;
- display: none;
- background-color: white;
- border: 1px solid #ccc;
- padding: 8px;
- z-index: 10;
-}
-.context-menu-item {
- cursor: pointer;
- margin-bottom: 4px;
-}
-.context-menu-item:last-child {
- margin-bottom: 0;
-}
-
-.copy-button {
- background-color: #007acc;
- color: white;
- border: none;
- border-radius: 4px;
- padding: 5px;
- cursor: pointer;
- margin-top: 5px;
-}
-
-.copy-button:hover {
- background-color: #005b8e;
-}
-
-
-#messages-container {
- flex-grow: 1;
- overflow-y: auto;
- padding: 10px;
-}
-
-.message-item {
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- margin: 20px 0;
- padding: 10px;
- border-radius: 4px;
- border-bottom: 1px solid var(--vscode-border);
-}
-
-.message-item.user-message {
- background-color: #007acc;
- color: white;
-}
-
-.message-content {
- margin-left: 30px;
- margin-right: 30px;
-}
-
-.message-item .message-content {
- flex-grow: 1;
-}
-
-.new-message-textarea {
- width: 100%;
- height: 100%;
- border: none;
- background-color: transparent;
- padding: 0;
- font-family: inherit;
- font-size: inherit;
- line-height: inherit;
- color: inherit;
- overflow: hidden;
- resize: none;
-}
-
-.message-item .message-content code {
- background-color: #ddd;
- padding: 2px 4px;
- border-radius: 4px;
-}
-
-.message-item .sender-icon {
- width: 24px;
- height: 24px;
- margin-right: 10px;
-}
-
-.message-item .action-icon {
- width: 24px;
- height: 24px;
- margin-left: 10px;
-}
-
-#input-container {
- display: flex;
- flex-direction: column;
- padding: 10px;
- border-top: 1px solid #ccc;
-}
-
-.input-resize-handle {
- width: 100%;
- height: 5px;
- cursor: ns-resize;
- bottom: 0;
- left: 0;
- z-index: 1;
-}
-
-
-#message-input {
- flex-grow: 1;
- border: 1px solid #ccc;
- border-radius: 4px;
- padding: 5px;
- outline: none;
- resize: none;
-}
-
-#send-button {
- margin-top: 10px;
- background-color: var(--vscode-button-bg);
- color: var(--vscode-button-fg);
- border: 1px solid var(--vscode-border);
- border-radius: 4px;
- padding: 5px 10px;
- cursor: pointer;
-}
-
-#send-button:hover {
- background-color: var(--vscode-button-hover-bg);
-}
-
-.popup-context-menu {
- display: none;
- position: absolute;
- background-color: #f9f9f9;
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
- padding: 12px 16px;
- z-index: 1;
-}
-.popup-context-menu a {
- color: black;
- text-decoration: none;
- display: block;
-}
-.popup-context-menu a:hover {
- background-color: #f1f1f1;
-}
-
-.popup-command-menu {
- display: none;
- position: absolute;
- background-color: #f9f9f9;
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
- padding: 12px 16px;
- z-index: 1;
-}
-.popup-command-menu a {
- color: black;
- text-decoration: none;
- display: block;
-}
-.popup-command-menu a:hover {
- background-color: #f1f1f1;
-}
\ No newline at end of file
diff --git a/assets/chatPanel.html b/assets/chatPanel.html
deleted file mode 100644
index b9deb14..0000000
--- a/assets/chatPanel.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
- Chat Panel
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/assets/chatUI.js b/assets/chatUI.js
deleted file mode 100644
index 4f750f1..0000000
--- a/assets/chatUI.js
+++ /dev/null
@@ -1,95 +0,0 @@
-// chatUI.js
-
-
-function getLastBotMessageItem(messagesContainer) {
- const lastMessage = messagesContainer.lastElementChild;
-
- if (lastMessage && lastMessage.classList.contains('message-item')) {
- const lastMessageIcon = lastMessage.querySelector('i');
- if (lastMessageIcon && lastMessageIcon.classList.contains('fa-robot')) {
- return lastMessage;
- }
- }
-
- return null;
-}
-
-function botMessageUpdate(role, content, partial) {
- // Create a MarkdownIt instance for rendering markdown content
- const messagesContainer = document.getElementById('messages-container');
- let lastBotMessage = getLastBotMessageItem(messagesContainer);
-
- if (lastBotMessage == null) {
- return false
- }
-
- // Render the markdown content inside the message content container
- const renderedContent = markdownRender(content);
- const lastMessageContent = lastBotMessage.querySelector('.message-content');
- lastMessageContent.innerHTML = renderedContent;
-
- if (!partial) {
- // Find any code blocks in the rendered content and add a class to style them
- const codeBlocks = lastMessageContent.querySelectorAll('pre > code');
-
- // Initialize the Apply Patch functionality
- initButtonForCodeBlock(codeBlocks);
- }
-
- return true;
-}
-
-function addSenderIcon(messageItem, role) {
- // Create a sender icon element and add the appropriate class based on the role (user or bot)
- const senderIcon = document.createElement('i');
- const iconClasses = role === 'user' ? ['fas', 'fa-user-circle'] : ['fas', 'fa-robot'];
- senderIcon.classList.add(...iconClasses);
- messageItem.appendChild(senderIcon);
-}
-
-function addMessageContent(messageItem, renderedContent, role) {
- // Create a container for the message content
- const messageContent = document.createElement('div');
- messageContent.classList.add('message-content');
- messageContent.innerHTML = renderedContent;
-
- // Find any code blocks in the rendered content and add a class to style them
- const codeBlocks = messageContent.querySelectorAll('pre > code');
-
- // Initialize the Apply Patch functionality
- if (role != "user") {
- initButtonForCodeBlock(codeBlocks);
- }
- messageItem.appendChild(messageContent);
- messageItemActions(messageItem, messageContent, role);
-}
-
-function addMessageItem(messagesContainer, content, role) {
- // Render the markdown content inside the message content container
- let renderedContent = markdownRender(content);
- if (role == "user") {
- renderedContent = markdownRender("\`\`\`\n" + content);
- }
-
- const messageItem = document.createElement('div');
- messageItem.classList.add('message-item');
-
- addSenderIcon(messageItem, role);
- addMessageContent(messageItem, renderedContent, role);
-
- messagesContainer.appendChild(messageItem);
-}
-
-function addMessageToUI(role, content, partial = false) {
- // Create a MarkdownIt instance for rendering markdown content
- const messagesContainer = document.getElementById('messages-container');
-
- if (role == "bot" && botMessageUpdate(role, content, partial)) {
- return
- }
-
- addMessageItem(messagesContainer, content, role);
- // Scroll the messages container to the bottom to display the latest message
- messagesContainer.scrollTop = messagesContainer.scrollHeight;
-}
-
diff --git a/assets/check-icon.png b/assets/check-icon.png
deleted file mode 100644
index 7b46eae..0000000
Binary files a/assets/check-icon.png and /dev/null differ
diff --git a/assets/clipboard.js b/assets/clipboard.js
deleted file mode 100644
index ba0a746..0000000
--- a/assets/clipboard.js
+++ /dev/null
@@ -1,62 +0,0 @@
-// clipboard.js
-
-
-function initClipboard(codeBlocks, onApplyButtonClick, onApplyCodeButtonClick, onApplyCodeFileButtonClick) {
- codeBlocks.forEach(block => {
- const contentSpan = document.createElement('span');
- contentSpan.innerHTML = block.innerHTML;
- block.innerHTML = '';
- block.appendChild(contentSpan);
-
- const copyButton = document.createElement('button');
- copyButton.classList.add('copy-button');
- copyButton.innerText = 'Copy';
- block.appendChild(copyButton);
-
- copyButton.addEventListener('click', () => {
- // Copy the message text to the clipboard
- navigator.clipboard.writeText(contentSpan.textContent);
-
- // Change the button text temporarily to show that the text has been copied
- copyButton.textContent = 'Copied!';
-
- // Reset the button text after a short delay
- setTimeout(() => {
- copyButton.textContent = '';
- const copyIcon = document.createElement('i');
- copyIcon.classList.add('fas', 'fa-copy');
- copyButton.appendChild(copyIcon);
- }, 1000);
- });
-
- // Add 'Apply' button
- const applyButton = document.createElement('button');
- applyButton.classList.add('apply-button');
- applyButton.innerText = 'Show Diff';
- block.appendChild(applyButton);
-
- applyButton.addEventListener('click', () => {
- onApplyButtonClick(contentSpan.textContent);
- });
-
- // Add 'Apply' button
- const applyCodeButton = document.createElement('button');
- applyCodeButton.classList.add('apply-button');
- applyCodeButton.innerText = 'Insert Code';
- block.appendChild(applyCodeButton);
-
- applyCodeButton.addEventListener('click', () => {
- onApplyCodeButtonClick(contentSpan.textContent);
- });
-
- // Add 'Apply' button
- const applyCodeFileButton = document.createElement('button');
- applyCodeFileButton.classList.add('apply-button');
- applyCodeFileButton.innerText = 'Relace File';
- block.appendChild(applyCodeFileButton);
-
- applyCodeFileButton.addEventListener('click', () => {
- onApplyCodeFileButtonClick(contentSpan.textContent);
- });
- });
- }
\ No newline at end of file
diff --git a/assets/codeBlock.js b/assets/codeBlock.js
deleted file mode 100644
index 21298d4..0000000
--- a/assets/codeBlock.js
+++ /dev/null
@@ -1,23 +0,0 @@
-
-function initButtonForCodeBlock(codeBlocks) {
- codeBlocks.forEach(block => {
- block.classList.add('code-block');
- });
-
- initClipboard(codeBlocks, (patchContent) => {
- messageUtil.sendMessage({
- command: 'block_apply',
- content: patchContent,
- });
- }, (codeContent) => {
- messageUtil.sendMessage({
- command: 'code_apply',
- content: codeContent,
- });
- }, (codeContent) => {
- messageUtil.sendMessage({
- command: 'code_file_apply',
- content: codeContent,
- });
- });
- }
\ No newline at end of file
diff --git a/assets/contextMenu.js b/assets/contextMenu.js
deleted file mode 100644
index f5f1011..0000000
--- a/assets/contextMenu.js
+++ /dev/null
@@ -1,31 +0,0 @@
-
-function initContextMenu() {
- const messagesContainer = document.getElementById('messages-container');
- const contextMenu = document.getElementById('context-menu');
- const menuItem1 = document.getElementById('menu-item-1');
- let selectedText = '';
-
- function hideContextMenu() {
- contextMenu.style.display = 'none';
- }
-
- function getSelectedText() {
- const selection = window.getSelection();
- return selection.toString();
- }
-
- messagesContainer.addEventListener('contextmenu', (event) => {
- event.preventDefault();
- selectedText = getSelectedText();
- contextMenu.style.display = 'block';
- contextMenu.style.left = event.pageX + 'px';
- contextMenu.style.top = event.pageY + 'px';
- });
-
- document.addEventListener('click', hideContextMenu);
-
- menuItem1.addEventListener('click', () => {
- messageUtil.sendMessage('code_apply', { content: selectedText });
- hideContextMenu();
- });
-}
diff --git a/assets/devchat.png b/assets/devchat.png
deleted file mode 100644
index ef6d4f7..0000000
Binary files a/assets/devchat.png and /dev/null differ
diff --git a/assets/devchat_apply.svg b/assets/devchat_apply.svg
deleted file mode 100644
index 2420eb4..0000000
--- a/assets/devchat_apply.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/assets/devchat_icon.svg b/assets/devchat_icon.svg
deleted file mode 100644
index 664a2d3..0000000
--- a/assets/devchat_icon.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/assets/inputContainer.js b/assets/inputContainer.js
deleted file mode 100644
index b8ab78f..0000000
--- a/assets/inputContainer.js
+++ /dev/null
@@ -1,165 +0,0 @@
-
-const messageInput = document.getElementById('message-input');
-const inputContainer = document.getElementById('input-container');
-
-const defaultHeight = 16;
-
-function autoResizeTextarea() {
- const lineCount = (messageInput.value.match(/\n/g) || []).length + 1;
- messageInput.style.height = 'auto';
- messageInput.style.height = (lineCount <= 1 ? defaultHeight : messageInput.scrollHeight) + 'px';
- inputContainer.style.height = 'auto';
- inputContainer.style.height = messageInput.style.height + 25;
-}
-
-messageInput.addEventListener('input', autoResizeTextarea);
-
-autoResizeTextarea();
-
-function initInputContainer() {
- const messageInput = document.getElementById('message-input');
- const sendButton = document.getElementById('send-button');
- const addContextButton = document.getElementById('add-context-button');
- const addCommandButton = document.getElementById('add-command-button');
- const popupContextMenu = document.getElementById('popupContextMenu');
- const popupCommandMenu = document.getElementById('popupCommandMenu');
-
- let contextList = [];
- let commandList = [];
-
- messageInput.addEventListener('keypress', function (e) {
- if (e.key === 'Enter') {
- if (e.ctrlKey) {
- e.preventDefault();
- const message = messageInput.value.trim();
- if (message !== '') {
- sendButton.click();
- }
- } else if (!e.shiftKey) {
- e.preventDefault();
- messageInput.setRangeText('\n', messageInput.selectionStart, messageInput.selectionEnd, 'end');
- autoResizeTextarea();
- }
- }
- });
-
- sendButton.addEventListener('click', () => {
- const message = messageInput.value;
- if (message) {
- // Add the user's message to the chat UI
- addMessageToUI('user', message);
-
- // Clear the input field
- messageInput.value = '';
-
- // Process and send the message to the extension
- messageUtil.sendMessage({
- command: 'sendMessage',
- text: message
- });
- autoResizeTextarea();
- }
- });
-
- addContextButton.addEventListener('click', (event) => {
- popupContextMenu.style.display = popupContextMenu.style.display === 'block' ? 'none' : 'block';
- // 设置弹出菜单的位置
- popupContextMenu.style.left = event.pageX + 'px';
- popupContextMenu.style.top = event.pageY + 'px';
- });
-
- addCommandButton.addEventListener('click', (event) => {
- popupCommandMenu.style.display = popupCommandMenu.style.display === 'block' ? 'none' : 'block';
- // 设置弹出菜单的位置
- popupCommandMenu.style.left = event.pageX + 'px';
- popupCommandMenu.style.top = event.pageY + 'px';
- });
-
- messageUtil.registerHandler('file_select', (message) => {
- addFileToMessageInput(message.filePath);
- });
-
- messageUtil.registerHandler('code_select', (message) => {
- addCodeToMessageInput(message.codeBlock);
- });
-
- messageUtil.registerHandler('appendContext', (message) => {
- addCodeToMessageInput(message.context);
- });
-
- messageUtil.registerHandler('regContextList', (message) => {
- contextList = message.result;
-
- const menuItems = [];
- for (let i = 0; i < contextList.length; i++) {
- menuItems.push({
- text: contextList[i].name,
- href: contextList[i].name
- });
- }
-
- menuItems.forEach(item => {
- const menuItem = document.createElement('a');
- menuItem.textContent = 'add ' + item.text;
- menuItem.href = item.text;
-
- popupContextMenu.appendChild(menuItem);
-
- // 为每个菜单项添加点击事件监听器
- menuItem.addEventListener('click', (event) => {
- // 阻止标签的默认行为(例如导航到链接)
- event.preventDefault();
- // 在此处定义点击处理逻辑
- messageUtil.sendMessage({ command: 'addContext', selected: item.href })
- // 隐藏弹出菜单
- popupContextMenu.style.display = 'none';
- });
- });
- });
-
- messageUtil.registerHandler('regCommandList', (message) => {
- commandList = message.result;
-
- const menuItems = [];
- for (let i = 0; i < commandList.length; i++) {
- menuItems.push({
- text: commandList[i].pattern,
- href: commandList[i].pattern
- });
- }
-
- menuItems.forEach(item => {
- const menuItem = document.createElement('a');
- menuItem.textContent = item.text;
- menuItem.href = item.href;
-
- popupCommandMenu.appendChild(menuItem);
-
- // 为每个菜单项添加点击事件监听器
- menuItem.addEventListener('click', (event) => {
- // 阻止标签的默认行为(例如导航到链接)
- event.preventDefault();
- // 在此处定义点击处理逻辑
- addCodeToMessageInput("/" + item.href);
- // 隐藏弹出菜单
- popupCommandMenu.style.display = 'none';
- });
- });
- });
-
- messageUtil.sendMessage({ command: 'regContextList' });
- messageUtil.sendMessage({ command: 'regCommandList' });
-}
-
-function addFileToMessageInput(filePath) {
- const messageInput = document.getElementById('message-input');
- const formattedPath = `[context|${filePath}] `;
- messageInput.value = formattedPath + messageInput.value;
- messageInput.focus();
-}
-
-function addCodeToMessageInput(codeBlock) {
- const messageInput = document.getElementById('message-input');
- messageInput.value += "\n" + codeBlock + "\n";
- messageInput.focus();
-}
diff --git a/assets/main.js b/assets/main.js
deleted file mode 100644
index f99bf79..0000000
--- a/assets/main.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// main.js
-
-(function () {
- initMessageContainer();
- initInputContainer();
- initContextMenu();
-
- window.addEventListener('message', (event) => {
- const message = event.data;
- messageUtil.handleMessage(message)
- });
-})();
-
diff --git a/assets/markdown.js b/assets/markdown.js
deleted file mode 100644
index 80f9f27..0000000
--- a/assets/markdown.js
+++ /dev/null
@@ -1,5 +0,0 @@
-
-function markdownRender(content) {
- const md = new markdownit();
- return md.render(content);
-}
\ No newline at end of file
diff --git a/assets/messageContainer.js b/assets/messageContainer.js
deleted file mode 100644
index 6f589ee..0000000
--- a/assets/messageContainer.js
+++ /dev/null
@@ -1,34 +0,0 @@
-
-function requestHistoryMessages() {
- // Send a message to the extension with the 'historyMessages' command
- messageUtil.sendMessage({
- command: 'historyMessages',
- });
-}
-
-function loadHistoryMessages(entries) {
- entries.forEach((entry) => {
- addMessageToUI('user', entry.message);
- addMessageToUI('bot', entry.response);
- });
-}
-
-function initMessageContainer() {
- // Register message handlers for receiving messages from the extension
- messageUtil.registerHandler('receiveMessage', (message) => {
- // Add the received message to the chat UI as a bot message
- addMessageToUI('bot', message.text);
- });
-
- messageUtil.registerHandler('receiveMessagePartial', (message) => {
- // Add the received message to the chat UI as a bot message
- addMessageToUI('bot', message.text, true);
- });
-
- messageUtil.registerHandler('loadHistoryMessages', (message) => {
- loadHistoryMessages(message.entries);
- });
-
- // Request history messages when the web view is created and shown
- requestHistoryMessages();
-}
\ No newline at end of file
diff --git a/assets/messageUtil.js b/assets/messageUtil.js
deleted file mode 100644
index 1c0bc93..0000000
--- a/assets/messageUtil.js
+++ /dev/null
@@ -1,43 +0,0 @@
-
-const vscode_api = acquireVsCodeApi();
-
-class MessageUtil {
- constructor() {
- this.handlers = {};
- }
-
- // Register a message handler for a specific message type
- registerHandler(messageType, handler) {
- if (!this.handlers[messageType]) {
- this.handlers[messageType] = [];
- }
- this.handlers[messageType].push(handler);
- }
-
- // Unregister a message handler for a specific message type
- unregisterHandler(messageType, handler) {
- if (this.handlers[messageType]) {
- this.handlers[messageType] = this.handlers[messageType].filter(
- (h) => h !== handler
- );
- }
- }
-
- // Handle a received message
- handleMessage(message) {
- console.log("handleMessage", message)
- const handlers = this.handlers[message.command];
- if (handlers) {
- handlers.forEach((handler) => handler(message));
- }
- }
-
- // Send a message to the VSCode API
- sendMessage(message) {
- console.log("sendMessage", message)
- vscode_api.postMessage(message);
- }
-}
-
-// Export the MessageUtil class as a module
-const messageUtil = new MessageUtil();
diff --git a/assets/resizeInput.js b/assets/resizeInput.js
deleted file mode 100644
index cdd36c9..0000000
--- a/assets/resizeInput.js
+++ /dev/null
@@ -1,26 +0,0 @@
-function initInputResizing() {
- // Create a handle for resizing the input container
- const inputContainer = document.getElementById('input-container')
- const inputResizeHandle = document.getElementById('input-resize-handle')
-
- // Add an event listener for mouse down on the resize handle
- inputResizeHandle.addEventListener('mousedown', (e) => {
- e.preventDefault();
-
- const startY = e.clientY;
- const startHeight = inputContainer.style.height ? parseInt(inputContainer.style.height) : parseInt(getComputedStyle(inputContainer).height);
-
- window.addEventListener('mousemove', resizeInput);
- window.addEventListener('mouseup', stopResizeInput);
-
- function resizeInput(e) {
- const delta = startY - e.clientY;
- inputContainer.style.height = `${startHeight + delta}px`;
- }
-
- function stopResizeInput() {
- window.removeEventListener('mousemove', resizeInput);
- window.removeEventListener('mouseup', stopResizeInput);
- }
- });
- }
\ No newline at end of file
diff --git a/assets/user-icon.png b/assets/user-icon.png
deleted file mode 100644
index 7b46eae..0000000
Binary files a/assets/user-icon.png and /dev/null differ