mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
1 parent
504cbe1c23
commit
b24021771b
7 files changed
+131
No files matched your search
@@ -7122,3 +7122,15 @@ tools:
|
||||
label-converted-to-hex-array: 'Converted to Hex array:'
|
||||
tag-digit-0-no-grouping: (Digit 0 = No grouping)
|
||||
tag-digit-0-no-row: (Digit 0 = No row)
|
||||
toon-to-json:
|
||||
texts:
|
||||
message-provided-json-is-not-valid: Provided TOON is not valid
|
||||
output-label-json-version: 'JSON version of your TOON content:'
|
||||
input-placeholder-paste-your-raw-toon-here: Paste your raw TOON content here...
|
||||
input-label-your-raw-toon: 'Your raw TOON content:'
|
||||
json-to-toon:
|
||||
texts:
|
||||
message-provided-json-is-not-valid: Provided JSON is not valid.
|
||||
input-placeholder-paste-your-raw-json-here: Paste your raw JSON here...
|
||||
input-label-your-raw-json: 'Your raw JSON:'
|
||||
output-label-toon-version-of-your-json: 'TOON version of your JSON:'
|
||||
@@ -77,6 +77,7 @@
|
||||
"@tiptap/pm": "2.26.1",
|
||||
"@tiptap/starter-kit": "2.26.1",
|
||||
"@tiptap/vue-3": "2.26.1",
|
||||
"@toon-format/toon": "^1.3.0",
|
||||
"@types/haversine": "^1.1.8",
|
||||
"@types/html-to-text": "^9.0.4",
|
||||
"@types/swagger-ui-dist": "^3.30.6",
|
||||
|
||||
Generated
+8
@@ -119,6 +119,9 @@ importers:
|
||||
'@tiptap/vue-3':
|
||||
specifier: 2.26.1
|
||||
version: 2.26.1(@tiptap/core@2.26.1(@tiptap/pm@2.26.1))(@tiptap/pm@2.26.1)(vue@3.3.4)
|
||||
'@toon-format/toon':
|
||||
specifier: ^1.3.0
|
||||
version: 1.3.0
|
||||
'@types/haversine':
|
||||
specifier: ^1.1.8
|
||||
version: 1.1.8
|
||||
@@ -3883,6 +3886,9 @@ packages:
|
||||
'@tokenizer/token@0.3.0':
|
||||
resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==}
|
||||
|
||||
'@toon-format/toon@1.3.0':
|
||||
resolution: {integrity: sha512-/7sizMjP5DA2yXBKqWo8bp3uSXrlEywn1ROXSkoMfsWEmIdazIPilclnSq/5u+srvgd+2lRuN6GpD2H6DXM01w==}
|
||||
|
||||
'@tootallnate/once@2.0.0':
|
||||
resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
|
||||
engines: {node: '>= 10'}
|
||||
@@ -14826,6 +14832,8 @@ snapshots:
|
||||
|
||||
'@tokenizer/token@0.3.0': {}
|
||||
|
||||
'@toon-format/toon@1.3.0': {}
|
||||
|
||||
'@tootallnate/once@2.0.0': {}
|
||||
|
||||
'@trysound/sax@0.2.0': {}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Braces } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'JSON to TOON',
|
||||
path: '/json-to-toon',
|
||||
description: 'Convert JSON object to TOON representation for LLM/GPT usage',
|
||||
keywords: ['json', 'llm', 'gpt', 'toon'],
|
||||
component: () => import('./json-to-toon.vue'),
|
||||
icon: Braces,
|
||||
createdAt: new Date('2025-11-22'),
|
||||
category: 'Text',
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import JSON5 from 'json5';
|
||||
import { encode } from '@toon-format/toon';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import { withDefaultOnError } from '@/utils/defaults';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const defaultValue = `{
|
||||
users: [
|
||||
{ id: 1, name: 'Alice', role: 'admin' },
|
||||
{ id: 2, name: 'Bob', role: 'user' }
|
||||
]
|
||||
}`;
|
||||
|
||||
function transformer(value: string) {
|
||||
return withDefaultOnError(() => {
|
||||
if (value === '') {
|
||||
return '';
|
||||
}
|
||||
return encode(JSON.parseBigInt(value));
|
||||
}, '');
|
||||
}
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: t('tools.json-to-toon.texts.message-provided-json-is-not-valid'),
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<format-transformer
|
||||
:input-label="t('tools.json-to-toon.texts.input-label-your-raw-json')"
|
||||
:input-default="defaultValue"
|
||||
:input-placeholder="t('tools.json-to-toon.texts.input-placeholder-paste-your-raw-json-here')"
|
||||
:output-label="t('tools.json-to-toon.texts.output-label-toon-version-of-your-json')"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
download-file-name="output.toon"
|
||||
/>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Braces } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'TOON to JSON',
|
||||
path: '/toon-to-json',
|
||||
description: 'Convert TOON representation to JSON object for LLM usage',
|
||||
keywords: ['toon', 'llm', 'gpt', 'json'],
|
||||
component: () => import('./toon-to-json.vue'),
|
||||
icon: Braces,
|
||||
createdAt: new Date('2025-11-22'),
|
||||
category: 'Text',
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { decode } from '@toon-format/toon';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import { withDefaultOnError } from '@/utils/defaults';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const defaultValue = `users[2]{id,name,role}:
|
||||
1,Alice,admin
|
||||
2,Bob,user`;
|
||||
|
||||
function transformer(value: string) {
|
||||
return withDefaultOnError(() => {
|
||||
if (value === '') {
|
||||
return '';
|
||||
}
|
||||
return JSON.stringify(decode(value), null, 2);
|
||||
}, '');
|
||||
}
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || decode(v),
|
||||
message: t('tools.toon-to-json.texts.message-provided-json-is-not-valid'),
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<format-transformer
|
||||
:input-label="t('tools.toon-to-json.texts.input-label-your-raw-toon')"
|
||||
:input-default="defaultValue"
|
||||
:input-placeholder="t('tools.toon-to-json.texts.input-placeholder-paste-your-raw-toon-here')"
|
||||
:output-label="t('tools.toon-to-json.texts.output-label-json-version')"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
download-file-name="output.json"
|
||||
/>
|
||||
</template>
|
||||
Reference in new issue
Block a user