From 2f2b3db115eb9be7f5eb8f0b3d259d31bf3e3ad2 Mon Sep 17 00:00:00 2001 From: sharevb Date: Wed, 11 Sep 2024 23:10:28 +0200 Subject: [PATCH] feat(new tool): Smart Text Replacer and LineBreaks manager Smart Replacer functionality taken as base from #976 by @utf26 Fixed linebreaking display in Smart Replacer Add linebreaking options Fix #1279 #1194 #616 --- src/tools/index.ts | 11 +- src/tools/smart-text-replacer/index.ts | 13 ++ .../smart-text-replacer.vue | 204 ++++++++++++++++++ 3 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 src/tools/smart-text-replacer/index.ts create mode 100644 src/tools/smart-text-replacer/smart-text-replacer.vue diff --git a/src/tools/index.ts b/src/tools/index.ts index 52bdf8e3..47a0395b 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -1,6 +1,7 @@ import { tool as base64FileConverter } from './base64-file-converter'; import { tool as base64StringConverter } from './base64-string-converter'; import { tool as basicAuthGenerator } from './basic-auth-generator'; +import { tool as smartTextReplacer } from './smart-text-replacer'; import { tool as pdfSignatureChecker } from './pdf-signature-checker'; import { tool as numeronymGenerator } from './numeronym-generator'; import { tool as macAddressGenerator } from './mac-address-generator'; @@ -155,7 +156,15 @@ export const toolsByCategory: ToolCategory[] = [ }, { name: 'Text', - components: [loremIpsumGenerator, textStatistics, emojiPicker, stringObfuscator, textDiff, numeronymGenerator], + components: [ + loremIpsumGenerator, + textStatistics, + emojiPicker, + stringObfuscator, + textDiff, + numeronymGenerator, + smartTextReplacer, + ], }, { name: 'Data', diff --git a/src/tools/smart-text-replacer/index.ts b/src/tools/smart-text-replacer/index.ts new file mode 100644 index 00000000..a0f93fde --- /dev/null +++ b/src/tools/smart-text-replacer/index.ts @@ -0,0 +1,13 @@ +import { Search } from '@vicons/tabler'; +import { defineTool } from '../tool'; +import { translate } from '@/plugins/i18n.plugin'; + +export const tool = defineTool({ + name: translate('tools.smart-text-replacer.title'), + path: '/smart-text-replacer', + description: translate('tools.smart-text-replacer.description'), + keywords: ['smart', 'text-replacer', 'linebreak', 'remove', 'add', 'split', 'search', 'replace'], + component: () => import('./smart-text-replacer.vue'), + icon: Search, + createdAt: new Date('2024-04-03'), +}); diff --git a/src/tools/smart-text-replacer/smart-text-replacer.vue b/src/tools/smart-text-replacer/smart-text-replacer.vue new file mode 100644 index 00000000..74b7695b --- /dev/null +++ b/src/tools/smart-text-replacer/smart-text-replacer.vue @@ -0,0 +1,204 @@ + + + + +