Merge branch 'feat/web-prettiers' 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:11:50 +01:00
commit 04d2c8aa6e
9 files changed
+164 -8

No files matched your search

+2
View File
@@ -106,6 +106,7 @@
"@types/libmime": "^5.0.3", "@types/libmime": "^5.0.3",
"@types/emscripten": "^1.39.10", "@types/emscripten": "^1.39.10",
"@types/spdx-satisfies": "^0.1.2", "@types/spdx-satisfies": "^0.1.2",
"@types/js-beautify": "^1.14.3",
"@vicons/material": "^0.12.0", "@vicons/material": "^0.12.0",
"@vicons/tabler": "^0.12.0", "@vicons/tabler": "^0.12.0",
"@vueuse/core": "^10.11.1", "@vueuse/core": "^10.11.1",
@@ -225,6 +226,7 @@
"is-ip": "^5.0.1", "is-ip": "^5.0.1",
"isbn3": "^1.1.44", "isbn3": "^1.1.44",
"js-base64": "^3.7.7", "js-base64": "^3.7.7",
"js-beautify": "^1.15.1",
"json5": "^2.2.3", "json5": "^2.2.3",
"jsonpath": "^1.1.1", "jsonpath": "^1.1.1",
"jsonar-mod": "^1.9.0", "jsonar-mod": "^1.9.0",
+6 -8
View File
@@ -1195,8 +1195,8 @@ packages:
resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==} resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
dependencies: dependencies:
'@babel/template': 7.22.15 '@babel/template': 7.22.5
'@babel/types': 7.23.0 '@babel/types': 7.22.5
dev: true dev: true
/@babel/helper-function-name@7.23.0: /@babel/helper-function-name@7.23.0:
@@ -1210,7 +1210,7 @@ packages:
resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
dependencies: dependencies:
'@babel/types': 7.23.0 '@babel/types': 7.22.5
/@babel/helper-member-expression-to-functions@7.22.5: /@babel/helper-member-expression-to-functions@7.22.5:
resolution: {integrity: sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==} resolution: {integrity: sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==}
@@ -5697,7 +5697,7 @@ packages:
/@types/lodash-es@4.17.10: /@types/lodash-es@4.17.10:
resolution: {integrity: sha512-YJP+w/2khSBwbUSFdGsSqmDvmnN3cCKoPOL7Zjle6s30ZtemkkqhjVfFqGwPN7ASil5VyjE2GtyU/yqYY6mC0A==} resolution: {integrity: sha512-YJP+w/2khSBwbUSFdGsSqmDvmnN3cCKoPOL7Zjle6s30ZtemkkqhjVfFqGwPN7ASil5VyjE2GtyU/yqYY6mC0A==}
dependencies: dependencies:
'@types/lodash': 4.14.200 '@types/lodash': 4.14.192
dev: false dev: false
/@types/lodash.defaultsdeep@4.6.9: /@types/lodash.defaultsdeep@4.6.9:
@@ -5720,7 +5720,6 @@ packages:
/@types/lodash@4.14.192: /@types/lodash@4.14.192:
resolution: {integrity: sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==} resolution: {integrity: sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==}
dev: true
/@types/lodash@4.14.200: /@types/lodash@4.14.200:
resolution: {integrity: sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q==} resolution: {integrity: sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q==}
@@ -6839,7 +6838,7 @@ packages:
/@vueuse/shared@10.0.0(vue@3.3.4): /@vueuse/shared@10.0.0(vue@3.3.4):
resolution: {integrity: sha512-Zh3LgJqvUBWVY3SiMvXanTcfAneGbt63QPczBRDNgQ6jd/ehodO9a1lCFzaA6SWJJoI+ugVTjHFYJdoR656DVQ==} resolution: {integrity: sha512-Zh3LgJqvUBWVY3SiMvXanTcfAneGbt63QPczBRDNgQ6jd/ehodO9a1lCFzaA6SWJJoI+ugVTjHFYJdoR656DVQ==}
dependencies: dependencies:
vue-demi: 0.14.10(vue@3.3.4) vue-demi: 0.14.5(vue@3.3.4)
transitivePeerDependencies: transitivePeerDependencies:
- '@vue/composition-api' - '@vue/composition-api'
- vue - vue
@@ -10207,7 +10206,6 @@ packages:
/glob@7.2.3: /glob@7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
deprecated: Glob versions prior to v9 are no longer supported
dependencies: dependencies:
fs.realpath: 1.0.0 fs.realpath: 1.0.0
inflight: 1.0.6 inflight: 1.0.6
@@ -15516,7 +15514,7 @@ packages:
/unimport@3.0.8(rollup@2.79.1): /unimport@3.0.8(rollup@2.79.1):
resolution: {integrity: sha512-AOt6xj3QMwqcTZRPB+NhFkyVEjCKnpTVoPm5x6424zz2NYYtCfym2bpJofzPHIJKPNIh5ko2/t2q46ZIMgdmbw==} resolution: {integrity: sha512-AOt6xj3QMwqcTZRPB+NhFkyVEjCKnpTVoPm5x6424zz2NYYtCfym2bpJofzPHIJKPNIh5ko2/t2q46ZIMgdmbw==}
dependencies: dependencies:
'@rollup/pluginutils': 5.0.5(rollup@2.79.1) '@rollup/pluginutils': 5.0.2(rollup@2.79.1)
escape-string-regexp: 5.0.0 escape-string-regexp: 5.0.0
fast-glob: 3.3.1 fast-glob: 3.3.1
local-pkg: 0.4.3 local-pkg: 0.4.3
@@ -0,0 +1,37 @@
<script setup lang="ts">
import beautify from 'js-beautify';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
const inputCSS = ref('');
const outputCSS = computed(() => {
return beautify.css(inputCSS.value, {
indent_char: ' ',
indent_size: 2,
eol: '\n',
});
});
</script>
<template>
<div>
<c-input-text
v-model:value="inputCSS"
multiline raw-text
placeholder="Your CSS content..."
rows="8"
autofocus
label="Your CSS to format (can paste from clipboard):"
/>
<n-divider />
<n-form-item label="Output prettified CSS:">
<TextareaCopyable
:value="outputCSS"
multiline
language="css"
word-wrap
/>
</n-form-item>
</div>
</template>
+12
View File
@@ -0,0 +1,12 @@
import { BrandCss3 } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Css prettifier',
path: '/css-prettifier',
description: 'CSS Prettify',
keywords: ['css', 'prettifier', 'beautify', 'prettier', 'format'],
component: () => import('./css-prettifier.vue'),
icon: BrandCss3,
createdAt: new Date('2024-03-15'),
});
@@ -0,0 +1,40 @@
<script setup lang="ts">
import beautify from 'js-beautify';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
const inputHtml = ref('');
const outputHtml = computed(() => {
return beautify.html(inputHtml.value, {
unformatted: ['code', 'pre', 'em', 'strong', 'span'],
indent_inner_html: true,
indent_char: ' ',
indent_size: 2,
eol: '\n',
});
});
</script>
<template>
<div>
<c-input-text
v-model:value="inputHtml"
multiline raw-text
placeholder="Your HTML content..."
rows="8"
autofocus
label="Your HTML to format (can paste from clipboard):"
paste-html
/>
<n-divider />
<n-form-item label="Output prettified HTML:">
<TextareaCopyable
:value="outputHtml"
multiline
language="html"
:word-wrap="true"
/>
</n-form-item>
</div>
</template>
+12
View File
@@ -0,0 +1,12 @@
import { BrandHtml5 } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Html Prettifier',
path: '/html-prettifier',
description: 'Prettify HTML code',
keywords: ['html', 'prettifier', 'beautify', 'prettier', 'format'],
component: () => import('./html-prettifier.vue'),
icon: BrandHtml5,
createdAt: new Date('2024-03-15'),
});
+6
View File
@@ -136,6 +136,9 @@ import { tool as urlCleaner } from './url-cleaner';
import { tool as urlFanger } from './url-fanger'; import { tool as urlFanger } from './url-fanger';
import { tool as urlTextFragmentMaker } from './url-text-fragment-maker'; import { tool as urlTextFragmentMaker } from './url-text-fragment-maker';
import { tool as utmUrlGenerator } from './utm-url-generator'; import { tool as utmUrlGenerator } from './utm-url-generator';
import { tool as javascriptPrettifier } from './javascript-prettifier';
import { tool as cssPrettifier } from './css-prettifier';
import { tool as htmlPrettifier } from './html-prettifier';
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';
@@ -446,6 +449,9 @@ export const toolsByCategory: ToolCategory[] = [
components: [ components: [
gitMemo, gitMemo,
nanoMemo, nanoMemo,
cssPrettifier,
htmlPrettifier,
javascriptPrettifier,
], ],
}, },
{ {
+12
View File
@@ -0,0 +1,12 @@
import { BrandJavascript } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Javascript Prettifier',
path: '/javascript-prettifier',
description: 'JS/Javascript Prettifier',
keywords: ['javascript', 'prettifier', 'beautify', 'prettier', 'format'],
component: () => import('./javascript-prettifier.vue'),
icon: BrandJavascript,
createdAt: new Date('2024-03-15'),
});
@@ -0,0 +1,37 @@
<script setup lang="ts">
import beautify from 'js-beautify';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
const inputJS = ref('');
const outputJS = computed(() => {
return beautify(inputJS.value, {
indent_char: ' ',
indent_size: 2,
eol: '\n',
});
});
</script>
<template>
<div>
<c-input-text
v-model:value="inputJS"
multiline raw-text
placeholder="Your JS content..."
rows="8"
autofocus
label="Your JS to format (can paste from clipboard):"
/>
<n-divider />
<n-form-item label="Output prettified JS:">
<TextareaCopyable
:value="outputJS"
multiline
language="javascript"
word-wrap
/>
</n-form-item>
</div>
</template>