diff --git a/.gitignore b/.gitignore index 48ef519..ce49695 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ node_modules /dist /crate/target/* - +/.log # local env files .env.local diff --git a/package.json b/package.json index 9c86aab..899e611 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,13 @@ }, "main": "background.js", "dependencies": { + "@types/animejs": "^3.1.2", "@types/bindings": "^1.3.0", "@types/uuid": "^8.3.0", "@types/ws": "^7.2.7", "animejs": "^3.2.0", "core-js": "^3.6.5", + "mitt": "^2.1.0", "speech-recorder": "^1.2.1", "vue": "^3.0.0-0", "vue-router": "^4.0.0-0", @@ -27,7 +29,6 @@ "ws": "^7.3.1" }, "devDependencies": { - "@types/animejs": "^3.1.2", "@types/jest": "^24.0.19", "@typescript-eslint/eslint-plugin": "^2.33.0", "@typescript-eslint/parser": "^2.33.0", diff --git a/src/background.ts b/src/background.ts index b461c75..9204046 100644 --- a/src/background.ts +++ b/src/background.ts @@ -8,26 +8,26 @@ import * as path from "path"; import { SpeechRecorder } from "speech-recorder"; import WebSocket from "ws"; -const ws = new WebSocket("ws://localhost:8080"); -ws.on("open", function open() { - ws.send("hello fro client"); -}); -ws.on("message", (message: any) => { - console.log("received message", message); -}); - -const recorder = new SpeechRecorder(); - -recorder.start({ - onAudio: (audio: object, speech: boolean) => { - if (speech) { - console.log(audio); - ws.send(audio); - } - console.log("recording"); - // writeStream.write(audio); - } -}); +// const ws = new WebSocket("ws://localhost:8080"); +// ws.on("open", function open() { +// ws.send("hello fro client"); +// }); +// ws.on("message", (message: any) => { +// console.log("received message", message); +// }); +// +// const recorder = new SpeechRecorder(); +// +// recorder.start({ +// onAudio: (audio: object, speech: boolean) => { +// if (speech) { +// console.log(audio); +// ws.send(audio); +// } +// console.log("recording"); +// // writeStream.write(audio); +// } +// }); // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. diff --git a/src/components/UI/UIDetails/inputItem.vue b/src/components/UI/UIDetails/inputItem.vue new file mode 100644 index 0000000..858cc28 --- /dev/null +++ b/src/components/UI/UIDetails/inputItem.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/src/components/UI/UIDetails/messageItem.vue b/src/components/UI/UIDetails/messageItem.vue index 3c19b34..3e9351e 100644 --- a/src/components/UI/UIDetails/messageItem.vue +++ b/src/components/UI/UIDetails/messageItem.vue @@ -5,8 +5,7 @@ :transform = "startingOffset" > {{ item }} - + - - diff --git a/src/components/UI/UIDetails/messages.ts b/src/components/UI/UIDetails/messages.ts index 8e1ad41..46724d3 100644 --- a/src/components/UI/UIDetails/messages.ts +++ b/src/components/UI/UIDetails/messages.ts @@ -1,11 +1,5 @@ -interface Message { - content: string; - signature: string; - outgoing: boolean; - modifier: string; - imgURL: string; - id: string; -} +import { Message } from "@/types/message/index"; + const Messages: Message[] = [ { content: diff --git a/src/components/UI/index.vue b/src/components/UI/index.vue index 371de54..7262812 100644 --- a/src/components/UI/index.vue +++ b/src/components/UI/index.vue @@ -4,6 +4,7 @@ version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + @click="renderMessage" > - + - - - - + + + @@ -83,118 +84,37 @@ diff --git a/yarn.lock b/yarn.lock index 8d2a5a4..82f9910 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8569,6 +8569,11 @@ mississippi@^3.0.0: stream-each "^1.1.0" through2 "^2.0.0" +mitt@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mitt/-/mitt-2.1.0.tgz#f740577c23176c6205b121b2973514eade1b2230" + integrity sha512-ILj2TpLiysu2wkBbWjAmww7TkZb65aiQO+DkVdUTBpBXq+MHYiETENkKFMtsJZX1Lf4pe4QOrTSjIfUwN5lRdg== + mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"