Merge branch 'feat/morse-converter' into chore/all-my-stuffs

# Conflicts:
#	package.json
#	pnpm-lock.yaml
#	src/tools/index.ts
This commit is contained in:
ShareVB committed 2024-11-03 23:02:13 +01:00
commit 6cb0019533
5 files changed
+86 -2

No files matched your search

+2
View File
@@ -83,6 +83,7 @@
"@tiptap/vue-3": "2.0.3",
"@types/emscripten": "^1.39.10",
"@types/big.js": "^6.2.2",
"@types/morsee": "^1.0.2",
"@types/figlet": "^1.5.8",
"@types/markdown-it": "^13.0.7",
"@types/potrace": "^2.1.5",
@@ -244,6 +245,7 @@
"md-editor-v3": "^4.13.5",
"mime-types": "^2.1.35",
"monaco-editor": "^0.43.0",
"morsee": "^1.0.9",
"naive-ui": "^2.35.0",
"netmask": "^2.0.2",
"nginx-config-formatter": "^1.4.5",
+14 -2
View File
@@ -122,6 +122,9 @@ dependencies:
'@types/memorystream':
specifier: ^0.3.4
version: 0.3.4
'@types/morsee':
specifier: ^1.0.2
version: 1.0.2
'@types/pdfjs-dist':
specifier: ^2.10.378
version: 2.10.378
@@ -476,6 +479,9 @@ dependencies:
monaco-editor:
specifier: ^0.43.0
version: 0.43.0
morsee:
specifier: ^1.0.9
version: 1.0.9
naive-ui:
specifier: ^2.35.0
version: 2.35.0(vue@3.3.4)
@@ -5760,6 +5766,10 @@ packages:
resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
dev: true
/@types/morsee@1.0.2:
resolution: {integrity: sha512-WANv1kCyQtmGZTiov9FzFdt1X4wRtXYZA6B4YR3CghKgx4ychU7d1gkOx7oD+ddVGI+SWmWOPccco7pAc6wXeA==}
dev: false
/@types/netmask@2.0.0:
resolution: {integrity: sha512-6LjGn0BPF0gOHGuRuJ0hGfdBJLz/9K8Ikz+oRThTNc2w7CGLvwqdjAP7/CydsUeL4cxBBXAHLFfC9bMs74757Q==}
dev: true
@@ -11350,7 +11360,6 @@ packages:
/jsesc@2.5.2:
resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
engines: {node: '>=4'}
hasBin: true
/jsesc@3.0.2:
resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==}
@@ -12202,6 +12211,10 @@ packages:
resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==}
dev: false
/morsee@1.0.9:
resolution: {integrity: sha512-8X8jKVUmZBHKpET9Ap6FPiwlAAASvv60M1K25/YwCU7veuj5MfYgaWX3oEPHtMGgC44IIkIKzyD73fduEKB/9g==}
dev: false
/moveable@0.53.0:
resolution: {integrity: sha512-71jS9zIoQzMhnNvduhg4tUEdm23+fO/40FN7muVMbZvVwbTku2MIxxLhnU4qFvxI4oVxn75l79SbtgjuA+s7Pw==}
dependencies:
@@ -16727,7 +16740,6 @@ packages:
/yamljs@0.3.0:
resolution: {integrity: sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==}
hasBin: true
dependencies:
argparse: 1.0.10
glob: 7.2.3
+2
View File
@@ -64,6 +64,7 @@ import { tool as daysCalculator } from './days-calculator';
import { tool as dateDurationCalculator } from './date-duration-calculator';
import { tool as macAddressConverter } from './mac-address-converter';
import { tool as dockerComposeToKubernetesConverter } from './docker-compose-to-kubernetes';
import { tool as morseConverter } from './morse-converter';
import { tool as asciiTextDrawer } from './ascii-text-drawer';
import { tool as textToUnicode } from './text-to-unicode';
import { tool as certificateKeyParser } from './certificate-key-parser';
@@ -310,6 +311,7 @@ export const toolsByCategory: ToolCategory[] = [
gzipConverter,
htmlCleaner,
mimeConverter,
morseConverter,
],
},
{
+12
View File
@@ -0,0 +1,12 @@
import { ArrowsShuffle } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Morse Code Converter',
path: '/morse-converter',
description: 'Encode/Decode to Morse code',
keywords: ['morse', 'converter'],
component: () => import('./morse-converter.vue'),
icon: ArrowsShuffle,
createdAt: new Date('2024-04-20'),
});
@@ -0,0 +1,56 @@
<script setup lang="ts">
import { decode, encode } from 'morsee';
import { computedCatch } from '@/composable/computed/catchedComputed';
const encodeInput = ref('');
const encodeOutput = computed(() => encode(encodeInput.value));
const decodeInput = ref('');
const [decodeOutput, decodeError] = computedCatch(() => decode(decodeInput.value), {
defaultValue: '',
defaultErrorMessage: 'Unable to decode your text',
});
</script>
<template>
<c-card title="Encode">
<div flex gap-3>
<c-input-text
v-model:value="encodeInput"
label="Your text:"
placeholder="The string to encode"
rows="4"
multiline raw-text monospace autosize flex-1
/>
</div>
<c-input-text
label="Your text encoded to Morse code:"
:value="encodeOutput"
rows="3"
placeholder="Your string encoded"
multiline monospace readonly autosize mt-5
/>
</c-card>
<c-card title="Decode">
<div flex gap-3>
<c-input-text
v-model:value="decodeInput"
label="Your Morse encoded text:"
placeholder="The string to decode"
rows="4"
multiline raw-text monospace autosize flex-1
/>
</div>
<c-alert v-if="decodeError" type="error" mt-12 title="Error while decoding">
{{ decodeError }}
</c-alert>
<c-input-text
v-else
label="Your decoded text:"
:value="decodeOutput"
placeholder="Your string decoded"
rows="3"
multiline monospace readonly autosize mt-5
/>
</c-card>
</template>