minor enhancements (e.g. idk what else to say)
This commit is contained in:
parent
f89c9944e7
commit
7d97756d60
7 changed files with 37 additions and 105 deletions
|
|
@ -1 +1 @@
|
|||
{"key":"6cde67f6-6188-452d-a54e-9d38cabf2d63","newMessages":[]}
|
||||
{"key":"1099b966-d9e5-4f1a-876e-13535af32f26","newMessages":[]}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import anime from "animejs";
|
||||
import { onMounted, onUnmounted, ref, Ref } from "vue";
|
||||
import useMitt from "@/modules/mitt";
|
||||
import { useIpc } from '@/modules/ipc';
|
||||
import { onMounted, onUnmounted, ref, Ref } from "vue";
|
||||
import keyboardNameMap from "../keyBoardMaps/keyboardNameMap";
|
||||
import { renderMessage, clientMessage } from '@/modules/message';
|
||||
|
||||
|
|
@ -65,8 +65,15 @@ export default function useAudioInputController (typing: Ref) {
|
|||
// Stop recording on space up.
|
||||
if (cmd == "SPACE" && recording.value) {
|
||||
|
||||
// Render audio immediately.
|
||||
const message = renderMessage("", "", "", "sf")
|
||||
// Create a message.
|
||||
const message = renderMessage(
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"sf"
|
||||
)
|
||||
|
||||
// Render it immediately.
|
||||
emitter.emit("self-message", message);
|
||||
|
||||
// Stop recording and get audio from recorder.
|
||||
|
|
|
|||
|
|
@ -85,8 +85,14 @@ export default function useTextInputController(elementX: Ref) {
|
|||
const sendMessage = () => {
|
||||
if (textInput) {
|
||||
|
||||
// Render message
|
||||
const message = renderMessage(textInput.value, false, "", "sf")
|
||||
// Create the message.
|
||||
const message = renderMessage(
|
||||
textInput.value,
|
||||
false,
|
||||
"",
|
||||
"sf"
|
||||
)
|
||||
|
||||
emitter.emit("self-message", message);
|
||||
|
||||
// Send it to the backend for processing.
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<!-- Shows when a new session is created with Crimata. -->
|
||||
<div
|
||||
v-if="message.context === 'launch'"
|
||||
v-if="message.context === 'Crimata'"
|
||||
class="divider"
|
||||
>
|
||||
<div>new session</div>
|
||||
|
|
@ -23,14 +23,6 @@
|
|||
class="messageBox"
|
||||
>
|
||||
|
||||
<!-- Render undo button for messages to friends. -->
|
||||
<button
|
||||
v-if="undoOption === true"
|
||||
class="undoButton"
|
||||
>
|
||||
undo
|
||||
</button>
|
||||
|
||||
<!-- message bubble -->
|
||||
<div
|
||||
class="bubble"
|
||||
|
|
@ -72,7 +64,6 @@
|
|||
<span
|
||||
v-if="message.isChild === 'last' || message.isChild === 'none'"
|
||||
class="context"
|
||||
:class="{ 'context-undo-anim': undoOption }"
|
||||
>
|
||||
|
||||
<!-- Render Crimata icon or friend's initials. -->
|
||||
|
|
@ -98,9 +89,7 @@
|
|||
|
||||
<script lang='ts'>
|
||||
|
||||
import { defineComponent, ref, onMounted, onBeforeUpdate } from 'vue';
|
||||
import { clientRequest } from "@/modules/message";
|
||||
import { useIpc } from "@/modules/ipc";
|
||||
import { defineComponent, ref, onMounted } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: "MessageItem",
|
||||
|
|
@ -111,13 +100,9 @@
|
|||
|
||||
let addListener = false;
|
||||
|
||||
const undoOption = ref(false);
|
||||
|
||||
const notify = ref(false)
|
||||
const isPlaying = ref(false);
|
||||
|
||||
const { post } = useIpc()
|
||||
|
||||
if (!props.message.seen) {
|
||||
console.log("MSG:Checking...")
|
||||
|
||||
|
|
@ -146,7 +131,7 @@
|
|||
}
|
||||
|
||||
// Callback for window visibilityState.
|
||||
const onVisibilityChange = (event: any) => {
|
||||
const onVisibilityChange = (_event: any) => {
|
||||
if (document.visibilityState === "visible") {
|
||||
console.log("MSG:Window visible, notifying.")
|
||||
|
||||
|
|
@ -158,24 +143,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
const onUndo = () => {
|
||||
post("client-message", clientRequest("launch", {name: false}, "undo"))
|
||||
}
|
||||
|
||||
const onStopPlayback = (e: any) => {
|
||||
const onStopPlayback = (_event: any) => {
|
||||
window.ipcRenderer.removeAllListeners("stop-playback-anim");
|
||||
isPlaying.value = false
|
||||
}
|
||||
|
||||
onBeforeUpdate(() => {
|
||||
|
||||
if (props.message.context.substring(0, 3) === 'To ') {
|
||||
console.log("MSG:Applying undo anim")
|
||||
undoOption.value = true;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
// Listen for window focus event.
|
||||
|
|
@ -192,10 +164,8 @@
|
|||
})
|
||||
|
||||
return {
|
||||
onUndo,
|
||||
notify,
|
||||
isPlaying,
|
||||
undoOption
|
||||
isPlaying
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -389,20 +359,6 @@
|
|||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.context-undo-anim {
|
||||
animation-name: context-anim;
|
||||
animation-duration: 3s;
|
||||
}
|
||||
|
||||
@keyframes context-anim {
|
||||
0%, 90% {
|
||||
transform: translateX(-45px);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(0px);
|
||||
}
|
||||
}
|
||||
|
||||
.photo {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
@ -460,48 +416,4 @@
|
|||
color: #357CA2;
|
||||
}
|
||||
|
||||
.undoButton {
|
||||
position: absolute;
|
||||
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
|
||||
opacity: 0;
|
||||
|
||||
border: none;
|
||||
outline: none;
|
||||
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
|
||||
background-color: Transparent;
|
||||
|
||||
font-family: "SF Compact Display";
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #9B9B9B;
|
||||
|
||||
animation-name: undo-anim;
|
||||
animation-duration: 3s;
|
||||
}
|
||||
|
||||
.undoButton:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@keyframes undo-anim {
|
||||
0%, 90% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<!--
|
||||
// If this is a message to a friend, we render undo button.
|
||||
if (props.message.context.substring(0, 3) === 'To ') {
|
||||
console.log("MSG:Applying undo anim")
|
||||
undoOption.value = true;
|
||||
} -->
|
||||
|
|
@ -1,4 +1,11 @@
|
|||
import { RenderMessage, ClientMessage, ClientRequest, AuthRequest, LogoutRequest } from "@/types";
|
||||
import {
|
||||
RenderMessage,
|
||||
ClientMessage,
|
||||
ClientRequest,
|
||||
AuthRequest,
|
||||
LogoutRequest
|
||||
} from "@/types";
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
function getTimeStamp(): number {
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ export interface ClientMessage {
|
|||
}
|
||||
|
||||
export interface ClientRequest {
|
||||
intent: string,
|
||||
params: object,
|
||||
epic: string | boolean,
|
||||
confidence: number
|
||||
intent: string;
|
||||
params: object;
|
||||
epic: string | boolean;
|
||||
confidence: number;
|
||||
}
|
||||
|
||||
export interface SessionState {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":609,"height":721,"x":1376,"y":517}
|
||||
{"width":395,"height":676,"x":1595,"y":542}
|
||||
Loading…
Reference in a new issue