:style="{ top: `${elementY}px`, left: `${elementX}px` }">
<span class="play"></span>
<span class="pause"></span>
+ <TextInput :input="input"/>
</div>
</template>
<script lang="ts">
-import { defineComponent, onMounted, onUnmounted, ref } from "vue";
+import { defineComponent, onMounted, onUnmounted, ref, watch } from "vue";
import draggify from '@/modules/draggify';
import useMitt from "@/modules/mitt";
+import TextInput from '@/components/taInput/textDetails/text.vue';
+import useInputController from "@/components/taInput/inputController";
export default defineComponent({
name: "InputItem",
+ components: { TextInput },
setup() {
const isRecording = ref(false);
-
+
const { emitter } = useMitt();
const { elementX, elementY } = draggify({ elementId: 'inputItem'});
+ const {
+ input,
+ visualizeStream,
+ audioBubbleWidth,
+ paths,
+ } = useInputController();
+
onMounted(() => {
emitter.on('input-audio-record', (record) => isRecording.value = record);
})
return {
elementX,
elementY,
- isRecording
+ isRecording,
+ input
}
}
background-color: white;
border: 4px solid #C3C3C3;
+ cursor: pointer;
+
.play, .pause {
z-index: 5;
&::before, &::after {
}
}
}
- &:hover {
- .play::before {
- box-shadow: 0 0 12px rgba(195, 195, 195, 0.8);
- }
- }
}
.animate-audio1 {
// This catches keys from a physical keyboard, a soft keyboard on a tablet, or a
// scanner attached via USB
-export default function useKeyDownHandler(enterCallback: (input: string) => void | null) {
+export default function useKeyDownHandler(enterCallback?: (input: string) => void) {
const input = ref("");
const cmd = keyboardNameMap[e.keyCode];
switch (cmd) {
case "ENTER":
- enterCallback(input.value);
+ if (enterCallback) enterCallback(input.value);
break;
case "BACK_SPACE":
input.value = input.value.slice(0, -1);