1
0
Fork 0
mirror of https://github.com/CorentinTh/it-tools.git synced 2025-08-09 23:45:18 +02:00

feat(new tool): Morse converter

Fix #1001
This commit is contained in:
sharevb 2024-04-28 12:26:27 +02:00 committed by ShareVB
parent 80e46c9292
commit 3305c8124d
6 changed files with 94 additions and 6 deletions

1
components.d.ts vendored
View file

@ -137,6 +137,7 @@ declare module '@vue/runtime-core' {
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default'] MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default'] MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default'] MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
MorseConverter: typeof import('./src/tools/morse-converter/morse-converter.vue')['default']
NAlert: typeof import('naive-ui')['NAlert'] NAlert: typeof import('naive-ui')['NAlert']
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default'] NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckbox: typeof import('naive-ui')['NCheckbox']

View file

@ -41,6 +41,7 @@
"@tiptap/pm": "2.1.6", "@tiptap/pm": "2.1.6",
"@tiptap/starter-kit": "2.1.6", "@tiptap/starter-kit": "2.1.6",
"@tiptap/vue-3": "2.0.3", "@tiptap/vue-3": "2.0.3",
"@types/morsee": "^1.0.2",
"@vicons/material": "^0.12.0", "@vicons/material": "^0.12.0",
"@vicons/tabler": "^0.12.0", "@vicons/tabler": "^0.12.0",
"@vueuse/core": "^10.3.0", "@vueuse/core": "^10.3.0",
@ -70,6 +71,7 @@
"mathjs": "^11.9.1", "mathjs": "^11.9.1",
"mime-types": "^2.1.35", "mime-types": "^2.1.35",
"monaco-editor": "^0.43.0", "monaco-editor": "^0.43.0",
"morsee": "^1.0.9",
"naive-ui": "^2.35.0", "naive-ui": "^2.35.0",
"netmask": "^2.0.2", "netmask": "^2.0.2",
"node-forge": "^1.3.1", "node-forge": "^1.3.1",

27
pnpm-lock.yaml generated
View file

@ -23,6 +23,9 @@ dependencies:
'@tiptap/vue-3': '@tiptap/vue-3':
specifier: 2.0.3 specifier: 2.0.3
version: 2.0.3(@tiptap/core@2.1.12)(@tiptap/pm@2.1.6)(vue@3.3.4) version: 2.0.3(@tiptap/core@2.1.12)(@tiptap/pm@2.1.6)(vue@3.3.4)
'@types/morsee':
specifier: ^1.0.2
version: 1.0.2
'@vicons/material': '@vicons/material':
specifier: ^0.12.0 specifier: ^0.12.0
version: 0.12.0 version: 0.12.0
@ -110,6 +113,9 @@ dependencies:
monaco-editor: monaco-editor:
specifier: ^0.43.0 specifier: ^0.43.0
version: 0.43.0 version: 0.43.0
morsee:
specifier: ^1.0.9
version: 1.0.9
naive-ui: naive-ui:
specifier: ^2.35.0 specifier: ^2.35.0
version: 2.35.0(vue@3.3.4) version: 2.35.0(vue@3.3.4)
@ -3006,6 +3012,10 @@ packages:
resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
dev: true dev: true
/@types/morsee@1.0.2:
resolution: {integrity: sha512-WANv1kCyQtmGZTiov9FzFdt1X4wRtXYZA6B4YR3CghKgx4ychU7d1gkOx7oD+ddVGI+SWmWOPccco7pAc6wXeA==}
dev: false
/@types/netmask@2.0.0: /@types/netmask@2.0.0:
resolution: {integrity: sha512-6LjGn0BPF0gOHGuRuJ0hGfdBJLz/9K8Ikz+oRThTNc2w7CGLvwqdjAP7/CydsUeL4cxBBXAHLFfC9bMs74757Q==} resolution: {integrity: sha512-6LjGn0BPF0gOHGuRuJ0hGfdBJLz/9K8Ikz+oRThTNc2w7CGLvwqdjAP7/CydsUeL4cxBBXAHLFfC9bMs74757Q==}
dev: true dev: true
@ -3374,7 +3384,7 @@ packages:
dependencies: dependencies:
'@unhead/dom': 0.5.1 '@unhead/dom': 0.5.1
'@unhead/schema': 0.5.1 '@unhead/schema': 0.5.1
'@vueuse/shared': 10.6.1(vue@3.3.4) '@vueuse/shared': 10.9.0(vue@3.3.4)
unhead: 0.5.1 unhead: 0.5.1
vue: 3.3.4 vue: 3.3.4
transitivePeerDependencies: transitivePeerDependencies:
@ -4016,10 +4026,10 @@ packages:
- vue - vue
dev: false dev: false
/@vueuse/shared@10.6.1(vue@3.3.4): /@vueuse/shared@10.9.0(vue@3.3.4):
resolution: {integrity: sha512-TECVDTIedFlL0NUfHWncf3zF9Gc4VfdxfQc8JFwoVZQmxpONhLxFrlm0eHQeidHj4rdTPL3KXJa0TZCk1wnc5Q==} resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==}
dependencies: dependencies:
vue-demi: 0.14.6(vue@3.3.4) vue-demi: 0.14.7(vue@3.3.4)
transitivePeerDependencies: transitivePeerDependencies:
- '@vue/composition-api' - '@vue/composition-api'
- vue - vue
@ -6977,6 +6987,10 @@ packages:
resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==} resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==}
dev: false dev: false
/morsee@1.0.9:
resolution: {integrity: sha512-8X8jKVUmZBHKpET9Ap6FPiwlAAASvv60M1K25/YwCU7veuj5MfYgaWX3oEPHtMGgC44IIkIKzyD73fduEKB/9g==}
dev: false
/mrmime@1.0.1: /mrmime@1.0.1:
resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==}
engines: {node: '>=10'} engines: {node: '>=10'}
@ -9200,8 +9214,8 @@ packages:
vue: 3.3.4 vue: 3.3.4
dev: false dev: false
/vue-demi@0.14.6(vue@3.3.4): /vue-demi@0.14.7(vue@3.3.4):
resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} resolution: {integrity: sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==}
engines: {node: '>=12'} engines: {node: '>=12'}
hasBin: true hasBin: true
requiresBuild: true requiresBuild: true
@ -9497,6 +9511,7 @@ packages:
/workbox-google-analytics@7.0.0: /workbox-google-analytics@7.0.0:
resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==} resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==}
deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
dependencies: dependencies:
workbox-background-sync: 7.0.0 workbox-background-sync: 7.0.0
workbox-core: 7.0.0 workbox-core: 7.0.0

View file

@ -1,6 +1,7 @@
import { tool as base64FileConverter } from './base64-file-converter'; import { tool as base64FileConverter } from './base64-file-converter';
import { tool as base64StringConverter } from './base64-string-converter'; import { tool as base64StringConverter } from './base64-string-converter';
import { tool as basicAuthGenerator } from './basic-auth-generator'; import { tool as basicAuthGenerator } from './basic-auth-generator';
import { tool as morseConverter } from './morse-converter';
import { tool as pdfSignatureChecker } from './pdf-signature-checker'; import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator'; import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator'; import { tool as macAddressGenerator } from './mac-address-generator';
@ -100,6 +101,7 @@ export const toolsByCategory: ToolCategory[] = [
listConverter, listConverter,
tomlToJson, tomlToJson,
tomlToYaml, tomlToYaml,
morseConverter,
], ],
}, },
{ {

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'),
});

View file

@ -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>