From 5ca7aa13d2b0c043dd6b1ebb30f59a0e00e54441 Mon Sep 17 00:00:00 2001 From: Babar Saleh Hayat Date: Tue, 2 Apr 2024 21:32:44 +0500 Subject: [PATCH] feat: Add Text-Case Transformer functionality --- components.d.ts | 8 +++ locales/en.yml | 4 ++ locales/zh.yml | 4 ++ src/tools/index.ts | 2 + src/tools/text-case-transformer/index.ts | 13 +++++ .../text-case-transformer.vue | 54 +++++++++++++++++++ 6 files changed, 85 insertions(+) create mode 100644 src/tools/text-case-transformer/index.ts create mode 100644 src/tools/text-case-transformer/text-case-transformer.vue diff --git a/components.d.ts b/components.d.ts index e31119b3..7e04a0cd 100644 --- a/components.d.ts +++ b/components.d.ts @@ -89,7 +89,9 @@ declare module '@vue/runtime-core' { HttpStatusCodes: typeof import('./src/tools/http-status-codes/http-status-codes.vue')['default'] IbanValidatorAndParser: typeof import('./src/tools/iban-validator-and-parser/iban-validator-and-parser.vue')['default'] 'IconMdi:brushVariant': typeof import('~icons/mdi/brush-variant')['default'] + 'IconMdi:contentCopy': typeof import('~icons/mdi/content-copy')['default'] 'IconMdi:kettleSteamOutline': typeof import('~icons/mdi/kettle-steam-outline')['default'] + IconMdiArrowDown: typeof import('~icons/mdi/arrow-down')['default'] IconMdiChevronDown: typeof import('~icons/mdi/chevron-down')['default'] IconMdiChevronRight: typeof import('~icons/mdi/chevron-right')['default'] IconMdiClose: typeof import('~icons/mdi/close')['default'] @@ -144,7 +146,10 @@ declare module '@vue/runtime-core' { NLayoutSider: typeof import('naive-ui')['NLayoutSider'] NMenu: typeof import('naive-ui')['NMenu'] NScrollbar: typeof import('naive-ui')['NScrollbar'] + NSlider: typeof import('naive-ui')['NSlider'] NSpin: typeof import('naive-ui')['NSpin'] + NStatistic: typeof import('naive-ui')['NStatistic'] + NSwitch: typeof import('naive-ui')['NSwitch'] NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default'] OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default'] PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default'] @@ -159,6 +164,7 @@ declare module '@vue/runtime-core' { RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default'] + SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default'] SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default'] SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default'] SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default'] @@ -166,6 +172,8 @@ declare module '@vue/runtime-core' { SvgPlaceholderGenerator: typeof import('./src/tools/svg-placeholder-generator/svg-placeholder-generator.vue')['default'] TemperatureConverter: typeof import('./src/tools/temperature-converter/temperature-converter.vue')['default'] TextareaCopyable: typeof import('./src/components/TextareaCopyable.vue')['default'] + TextcaseTransformer: typeof import('./src/tools/text-case-transformer/textcase-transformer.vue')['default'] + TextCaseTransformer: typeof import('./src/tools/text-case-transformer/text-case-transformer.vue')['default'] TextDiff: typeof import('./src/tools/text-diff/text-diff.vue')['default'] TextStatistics: typeof import('./src/tools/text-statistics/text-statistics.vue')['default'] TextToBinary: typeof import('./src/tools/text-to-binary/text-to-binary.vue')['default'] diff --git a/locales/en.yml b/locales/en.yml index 50d48af9..4b639563 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -332,6 +332,10 @@ tools: title: JSON minify description: Minify and compress your JSON by removing unnecessary white spaces. + text-case-transformer: + title: Text case transformer + description: Transform text to different cases (upper, lower, capitalize words, capitalize sentences, remove punctuations, remove extra spaces, reverse text) + ulid-generator: title: ULID generator description: Generate random Universally Unique Lexicographically Sortable Identifier (ULID). diff --git a/locales/zh.yml b/locales/zh.yml index 160fe1fa..bcb002d3 100644 --- a/locales/zh.yml +++ b/locales/zh.yml @@ -336,6 +336,10 @@ tools: title: 字符串混淆器 description: 混淆字符串(如秘密、IBAN 或令牌),使其可共享和可识别,而不泄露其内容。 + text-case-transformer: + title: 文本大小写转换器 + description: 将文本转换为不同的大小写(大写、小写、单词首字母大写、句子首字母大写、去除标点符号、去除多余空格、反转文本) + base-converter: title: 整数基转换器 description: 在不同的基数(十进制、十六进制、二进制、八进制、base64…)之间转换数字 diff --git a/src/tools/index.ts b/src/tools/index.ts index aa861c93..f137103b 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -12,6 +12,7 @@ import { tool as macAddressGenerator } from './mac-address-generator'; import { tool as textToBinary } from './text-to-binary'; import { tool as ulidGenerator } from './ulid-generator'; import { tool as ibanValidatorAndParser } from './iban-validator-and-parser'; +import { tool as textCaseTransformer } from './text-case-transformer'; import { tool as stringObfuscator } from './string-obfuscator'; import { tool as textDiff } from './text-diff'; import { tool as emojiPicker } from './emoji-picker'; @@ -168,6 +169,7 @@ export const toolsByCategory: ToolCategory[] = [ loremIpsumGenerator, textStatistics, emojiPicker, + textCaseTransformer, stringObfuscator, textDiff, numeronymGenerator, diff --git a/src/tools/text-case-transformer/index.ts b/src/tools/text-case-transformer/index.ts new file mode 100644 index 00000000..edd72797 --- /dev/null +++ b/src/tools/text-case-transformer/index.ts @@ -0,0 +1,13 @@ +import { EyeOff } from '@vicons/tabler'; +import { defineTool } from '../tool'; +import { translate } from '@/plugins/i18n.plugin'; + +export const tool = defineTool({ + name: translate('tools.text-case-transformer.title'), + path: '/text-case-transformer', + description: translate('tools.text-case-transformer.description'), + keywords: ['string', 'text', 'case', 'transformer', 'secret', 'token', 'hide', 'obscure', 'mask', 'masking'], + component: () => import('./text-case-transformer.vue'), + icon: EyeOff, + createdAt: new Date('2024-04-02'), +}); diff --git a/src/tools/text-case-transformer/text-case-transformer.vue b/src/tools/text-case-transformer/text-case-transformer.vue new file mode 100644 index 00000000..ef39e32d --- /dev/null +++ b/src/tools/text-case-transformer/text-case-transformer.vue @@ -0,0 +1,54 @@ + + +