mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-25 15:15:23 +03:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
729a10c68e | ||
|
|
9c9b0d5ac0 | ||
|
|
c49ff00c31 |
No files matched your search
@@ -15,7 +15,7 @@ jobs:
|
|||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get Playwright version
|
- name: Get Playwright version
|
||||||
|
|||||||
Vendored
+8
-1
@@ -50,6 +50,7 @@ declare module '@vue/runtime-core' {
|
|||||||
'CModal.demo': typeof import('./src/ui/c-modal/c-modal.demo.vue')['default']
|
'CModal.demo': typeof import('./src/ui/c-modal/c-modal.demo.vue')['default']
|
||||||
CModalValue: typeof import('./src/ui/c-modal-value/c-modal-value.vue')['default']
|
CModalValue: typeof import('./src/ui/c-modal-value/c-modal-value.vue')['default']
|
||||||
'CModalValue.demo': typeof import('./src/ui/c-modal-value/c-modal-value.demo.vue')['default']
|
'CModalValue.demo': typeof import('./src/ui/c-modal-value/c-modal-value.demo.vue')['default']
|
||||||
|
CMonacoEditor: typeof import('./src/ui/c-monaco-editor/c-monaco-editor.vue')['default']
|
||||||
CollapsibleToolMenu: typeof import('./src/components/CollapsibleToolMenu.vue')['default']
|
CollapsibleToolMenu: typeof import('./src/components/CollapsibleToolMenu.vue')['default']
|
||||||
ColorConverter: typeof import('./src/tools/color-converter/color-converter.vue')['default']
|
ColorConverter: typeof import('./src/tools/color-converter/color-converter.vue')['default']
|
||||||
ColoredCard: typeof import('./src/components/ColoredCard.vue')['default']
|
ColoredCard: typeof import('./src/components/ColoredCard.vue')['default']
|
||||||
@@ -81,7 +82,6 @@ declare module '@vue/runtime-core' {
|
|||||||
FormatTransformer: typeof import('./src/components/FormatTransformer.vue')['default']
|
FormatTransformer: typeof import('./src/components/FormatTransformer.vue')['default']
|
||||||
GitMemo: typeof import('./src/tools/git-memo/git-memo.vue')['default']
|
GitMemo: typeof import('./src/tools/git-memo/git-memo.vue')['default']
|
||||||
'GitMemo.content': typeof import('./src/tools/git-memo/git-memo.content.md')['default']
|
'GitMemo.content': typeof import('./src/tools/git-memo/git-memo.content.md')['default']
|
||||||
GzipConverter: typeof import('./src/tools/gzip-converter/gzip-converter.vue')['default']
|
|
||||||
HashText: typeof import('./src/tools/hash-text/hash-text.vue')['default']
|
HashText: typeof import('./src/tools/hash-text/hash-text.vue')['default']
|
||||||
HmacGenerator: typeof import('./src/tools/hmac-generator/hmac-generator.vue')['default']
|
HmacGenerator: typeof import('./src/tools/hmac-generator/hmac-generator.vue')['default']
|
||||||
'Home.page': typeof import('./src/pages/Home.page.vue')['default']
|
'Home.page': typeof import('./src/pages/Home.page.vue')['default']
|
||||||
@@ -131,14 +131,21 @@ declare module '@vue/runtime-core' {
|
|||||||
NCode: typeof import('naive-ui')['NCode']
|
NCode: typeof import('naive-ui')['NCode']
|
||||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||||
|
NDivider: typeof import('naive-ui')['NDivider']
|
||||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||||
|
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||||
|
NGi: typeof import('naive-ui')['NGi']
|
||||||
|
NGrid: typeof import('naive-ui')['NGrid']
|
||||||
NH1: typeof import('naive-ui')['NH1']
|
NH1: typeof import('naive-ui')['NH1']
|
||||||
NH3: typeof import('naive-ui')['NH3']
|
NH3: typeof import('naive-ui')['NH3']
|
||||||
NIcon: typeof import('naive-ui')['NIcon']
|
NIcon: typeof import('naive-ui')['NIcon']
|
||||||
|
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||||
|
NLabel: typeof import('naive-ui')['NLabel']
|
||||||
NLayout: typeof import('naive-ui')['NLayout']
|
NLayout: typeof import('naive-ui')['NLayout']
|
||||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||||
NMenu: typeof import('naive-ui')['NMenu']
|
NMenu: typeof import('naive-ui')['NMenu']
|
||||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||||
|
NSpin: typeof import('naive-ui')['NSpin']
|
||||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
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']
|
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']
|
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
||||||
|
|||||||
+2
-2
@@ -35,6 +35,7 @@
|
|||||||
"release": "node ./scripts/release.mjs"
|
"release": "node ./scripts/release.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@guolao/vue-monaco-editor": "^1.4.1",
|
||||||
"@it-tools/bip39": "^0.0.4",
|
"@it-tools/bip39": "^0.0.4",
|
||||||
"@it-tools/oggen": "^1.3.0",
|
"@it-tools/oggen": "^1.3.0",
|
||||||
"@sindresorhus/slugify": "^2.2.1",
|
"@sindresorhus/slugify": "^2.2.1",
|
||||||
@@ -51,6 +52,7 @@
|
|||||||
"change-case": "^4.1.2",
|
"change-case": "^4.1.2",
|
||||||
"colord": "^2.9.3",
|
"colord": "^2.9.3",
|
||||||
"composerize-ts": "^0.6.2",
|
"composerize-ts": "^0.6.2",
|
||||||
|
"composeverter": "^1.7.2",
|
||||||
"country-code-lookup": "^0.1.0",
|
"country-code-lookup": "^0.1.0",
|
||||||
"cron-validator": "^1.3.1",
|
"cron-validator": "^1.3.1",
|
||||||
"cronstrue": "^2.26.0",
|
"cronstrue": "^2.26.0",
|
||||||
@@ -58,14 +60,12 @@
|
|||||||
"date-fns": "^2.29.3",
|
"date-fns": "^2.29.3",
|
||||||
"dompurify": "^3.0.6",
|
"dompurify": "^3.0.6",
|
||||||
"emojilib": "^3.0.10",
|
"emojilib": "^3.0.10",
|
||||||
"fflate": "^0.8.2",
|
|
||||||
"figlet": "^1.7.0",
|
"figlet": "^1.7.0",
|
||||||
"figue": "^1.2.0",
|
"figue": "^1.2.0",
|
||||||
"fuse.js": "^6.6.2",
|
"fuse.js": "^6.6.2",
|
||||||
"highlight.js": "^11.7.0",
|
"highlight.js": "^11.7.0",
|
||||||
"iarna-toml-esm": "^3.0.5",
|
"iarna-toml-esm": "^3.0.5",
|
||||||
"ibantools": "^4.3.3",
|
"ibantools": "^4.3.3",
|
||||||
"js-base64": "^3.7.7",
|
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"libphonenumber-js": "^1.10.28",
|
"libphonenumber-js": "^1.10.28",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const useWebServer = process.env.NO_WEB_SERVER !== 'true';
|
|||||||
*/
|
*/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: './src',
|
testDir: './src',
|
||||||
testMatch: /.*\.e2e\.(spec\.)?ts/,
|
testMatch: /\.e2e\.(spec\.)?ts$/,
|
||||||
/* Run tests in files in parallel */
|
/* Run tests in files in parallel */
|
||||||
fullyParallel: true,
|
fullyParallel: true,
|
||||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||||
@@ -57,7 +57,7 @@ export default defineConfig({
|
|||||||
&& {
|
&& {
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run preview',
|
command: 'npm run preview',
|
||||||
url: 'http://127.0.0.1:5050',
|
url: 'http://localhost:5050',
|
||||||
reuseExistingServer: !isCI,
|
reuseExistingServer: !isCI,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+63
-19
@@ -5,6 +5,9 @@ settings:
|
|||||||
excludeLinksFromLockfile: false
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@guolao/vue-monaco-editor':
|
||||||
|
specifier: ^1.4.1
|
||||||
|
version: 1.5.1(monaco-editor@0.43.0)(vue@3.3.4)
|
||||||
'@it-tools/bip39':
|
'@it-tools/bip39':
|
||||||
specifier: ^0.0.4
|
specifier: ^0.0.4
|
||||||
version: 0.0.4
|
version: 0.0.4
|
||||||
@@ -53,6 +56,9 @@ dependencies:
|
|||||||
composerize-ts:
|
composerize-ts:
|
||||||
specifier: ^0.6.2
|
specifier: ^0.6.2
|
||||||
version: 0.6.2
|
version: 0.6.2
|
||||||
|
composeverter:
|
||||||
|
specifier: ^1.7.2
|
||||||
|
version: 1.7.2
|
||||||
country-code-lookup:
|
country-code-lookup:
|
||||||
specifier: ^0.1.0
|
specifier: ^0.1.0
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
@@ -74,9 +80,6 @@ dependencies:
|
|||||||
emojilib:
|
emojilib:
|
||||||
specifier: ^3.0.10
|
specifier: ^3.0.10
|
||||||
version: 3.0.10
|
version: 3.0.10
|
||||||
fflate:
|
|
||||||
specifier: ^0.8.2
|
|
||||||
version: 0.8.2
|
|
||||||
figlet:
|
figlet:
|
||||||
specifier: ^1.7.0
|
specifier: ^1.7.0
|
||||||
version: 1.7.0
|
version: 1.7.0
|
||||||
@@ -95,9 +98,6 @@ dependencies:
|
|||||||
ibantools:
|
ibantools:
|
||||||
specifier: ^4.3.3
|
specifier: ^4.3.3
|
||||||
version: 4.3.3
|
version: 4.3.3
|
||||||
js-base64:
|
|
||||||
specifier: ^3.7.7
|
|
||||||
version: 3.7.7
|
|
||||||
json5:
|
json5:
|
||||||
specifier: ^2.2.3
|
specifier: ^2.2.3
|
||||||
version: 2.2.3
|
version: 2.2.3
|
||||||
@@ -2156,6 +2156,22 @@ packages:
|
|||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@guolao/vue-monaco-editor@1.5.1(monaco-editor@0.43.0)(vue@3.3.4):
|
||||||
|
resolution: {integrity: sha512-nhbQHDAwsxrdH/yitcrBgAkN8Cae0IEiYe/M3LWK8bSJRfapkbMyfTHE6Gcxsxa/6efSUZAPDo8dJWBDx5GZyA==}
|
||||||
|
peerDependencies:
|
||||||
|
'@vue/composition-api': ^1.7.1
|
||||||
|
monaco-editor: '>=0.43.0'
|
||||||
|
vue: ^2.6.14 || >=3.0.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
'@vue/composition-api':
|
||||||
|
optional: true
|
||||||
|
dependencies:
|
||||||
|
'@monaco-editor/loader': 1.4.0(monaco-editor@0.43.0)
|
||||||
|
monaco-editor: 0.43.0
|
||||||
|
vue: 3.3.4
|
||||||
|
vue-demi: 0.14.7(vue@3.3.4)
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@humanwhocodes/config-array@0.11.10:
|
/@humanwhocodes/config-array@0.11.10:
|
||||||
resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==}
|
resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==}
|
||||||
engines: {node: '>=10.10.0'}
|
engines: {node: '>=10.10.0'}
|
||||||
@@ -2423,6 +2439,15 @@ packages:
|
|||||||
resolution: {integrity: sha512-mrC4y8n88BYvgcgzq9bvTlDgFyi2zuvzmPilRvRc3Uz1iIvq8mDhxJ0rHKFUNzPEScpDvJdIujqiDrulMqiudA==}
|
resolution: {integrity: sha512-mrC4y8n88BYvgcgzq9bvTlDgFyi2zuvzmPilRvRc3Uz1iIvq8mDhxJ0rHKFUNzPEScpDvJdIujqiDrulMqiudA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@monaco-editor/loader@1.4.0(monaco-editor@0.43.0):
|
||||||
|
resolution: {integrity: sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==}
|
||||||
|
peerDependencies:
|
||||||
|
monaco-editor: '>= 0.21.0 < 1'
|
||||||
|
dependencies:
|
||||||
|
monaco-editor: 0.43.0
|
||||||
|
state-local: 1.0.7
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@nodelib/fs.scandir@2.1.5:
|
/@nodelib/fs.scandir@2.1.5:
|
||||||
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
@@ -4057,6 +4082,14 @@ packages:
|
|||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/ajv-errors@3.0.0(ajv@8.12.0):
|
||||||
|
resolution: {integrity: sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==}
|
||||||
|
peerDependencies:
|
||||||
|
ajv: ^8.0.1
|
||||||
|
dependencies:
|
||||||
|
ajv: 8.12.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
/ajv@6.12.6:
|
/ajv@6.12.6:
|
||||||
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
|
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -4073,7 +4106,6 @@ packages:
|
|||||||
json-schema-traverse: 1.0.0
|
json-schema-traverse: 1.0.0
|
||||||
require-from-string: 2.0.2
|
require-from-string: 2.0.2
|
||||||
uri-js: 4.4.1
|
uri-js: 4.4.1
|
||||||
dev: true
|
|
||||||
|
|
||||||
/ansi-colors@4.1.3:
|
/ansi-colors@4.1.3:
|
||||||
resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
|
resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
|
||||||
@@ -4566,6 +4598,15 @@ packages:
|
|||||||
yamljs: 0.3.0
|
yamljs: 0.3.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/composeverter@1.7.2:
|
||||||
|
resolution: {integrity: sha512-gRSCkSU8wJQvmTHQ23wBd2gCdUsns95k3lL7YszZBu5EyA3eac46mI7nVgvk1pZTM0mOmj/E5yurtdYkuVNZRA==}
|
||||||
|
dependencies:
|
||||||
|
ajv: 8.12.0
|
||||||
|
ajv-errors: 3.0.0(ajv@8.12.0)
|
||||||
|
core-js: 2.6.12
|
||||||
|
yaml: 1.10.2
|
||||||
|
dev: false
|
||||||
|
|
||||||
/concat-map@0.0.1:
|
/concat-map@0.0.1:
|
||||||
resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
|
resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
|
||||||
|
|
||||||
@@ -4619,6 +4660,12 @@ packages:
|
|||||||
browserslist: 4.22.1
|
browserslist: 4.22.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/core-js@2.6.12:
|
||||||
|
resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==}
|
||||||
|
deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
|
||||||
|
requiresBuild: true
|
||||||
|
dev: false
|
||||||
|
|
||||||
/country-code-lookup@0.1.0:
|
/country-code-lookup@0.1.0:
|
||||||
resolution: {integrity: sha512-IOI66HEG+8bXfWPy+sTzuN7161vmDZOHg1wgIPFf3WfD73FeLajnn6C+fnxOIa9RL1WRBDMXQQWW/FOaOYaQ3w==}
|
resolution: {integrity: sha512-IOI66HEG+8bXfWPy+sTzuN7161vmDZOHg1wgIPFf3WfD73FeLajnn6C+fnxOIa9RL1WRBDMXQQWW/FOaOYaQ3w==}
|
||||||
dev: false
|
dev: false
|
||||||
@@ -5601,10 +5648,6 @@ packages:
|
|||||||
web-streams-polyfill: 3.2.1
|
web-streams-polyfill: 3.2.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/fflate@0.8.2:
|
|
||||||
resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/figlet@1.7.0:
|
/figlet@1.7.0:
|
||||||
resolution: {integrity: sha512-gO8l3wvqo0V7wEFLXPbkX83b7MVjRrk1oRLfYlZXol8nEpb/ON9pcKLI4qpBv5YtOTfrINtqb7b40iYY2FTWFg==}
|
resolution: {integrity: sha512-gO8l3wvqo0V7wEFLXPbkX83b7MVjRrk1oRLfYlZXol8nEpb/ON9pcKLI4qpBv5YtOTfrINtqb7b40iYY2FTWFg==}
|
||||||
engines: {node: '>= 0.4.0'}
|
engines: {node: '>= 0.4.0'}
|
||||||
@@ -6482,10 +6525,6 @@ packages:
|
|||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/js-base64@3.7.7:
|
|
||||||
resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/js-beautify@1.14.6:
|
/js-beautify@1.14.6:
|
||||||
resolution: {integrity: sha512-GfofQY5zDp+cuHc+gsEXKPpNw2KbPddreEo35O6jT6i0RVK6LhsoYBhq5TvK4/n74wnA0QbK8gGd+jUZwTMKJw==}
|
resolution: {integrity: sha512-GfofQY5zDp+cuHc+gsEXKPpNw2KbPddreEo35O6jT6i0RVK6LhsoYBhq5TvK4/n74wnA0QbK8gGd+jUZwTMKJw==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
@@ -6585,7 +6624,6 @@ packages:
|
|||||||
|
|
||||||
/json-schema-traverse@1.0.0:
|
/json-schema-traverse@1.0.0:
|
||||||
resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
|
resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
|
||||||
dev: true
|
|
||||||
|
|
||||||
/json-schema@0.4.0:
|
/json-schema@0.4.0:
|
||||||
resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==}
|
resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==}
|
||||||
@@ -7680,7 +7718,6 @@ packages:
|
|||||||
/punycode@2.3.0:
|
/punycode@2.3.0:
|
||||||
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
|
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
dev: true
|
|
||||||
|
|
||||||
/punycode@2.3.1:
|
/punycode@2.3.1:
|
||||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||||
@@ -7828,7 +7865,6 @@ packages:
|
|||||||
/require-from-string@2.0.2:
|
/require-from-string@2.0.2:
|
||||||
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
|
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
dev: true
|
|
||||||
|
|
||||||
/require-main-filename@2.0.0:
|
/require-main-filename@2.0.0:
|
||||||
resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
|
resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
|
||||||
@@ -8210,6 +8246,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
|
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/state-local@1.0.7:
|
||||||
|
resolution: {integrity: sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/std-env@3.3.3:
|
/std-env@3.3.3:
|
||||||
resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==}
|
resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==}
|
||||||
dev: true
|
dev: true
|
||||||
@@ -8927,7 +8967,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
punycode: 2.3.0
|
punycode: 2.3.0
|
||||||
dev: true
|
|
||||||
|
|
||||||
/url-parse@1.5.10:
|
/url-parse@1.5.10:
|
||||||
resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
|
resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
|
||||||
@@ -9593,6 +9632,11 @@ packages:
|
|||||||
yaml: 2.2.1
|
yaml: 2.2.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/yaml@1.10.2:
|
||||||
|
resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
|
||||||
|
engines: {node: '>= 6'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/yaml@2.2.1:
|
/yaml@2.2.1:
|
||||||
resolution: {integrity: sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==}
|
resolution: {integrity: sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==}
|
||||||
engines: {node: '>= 14'}
|
engines: {node: '>= 14'}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ const props = withDefaults(
|
|||||||
language?: string
|
language?: string
|
||||||
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
||||||
copyMessage?: string
|
copyMessage?: string
|
||||||
wordWrap?: boolean
|
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
followHeightOf: null,
|
followHeightOf: null,
|
||||||
@@ -48,7 +47,7 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.
|
|||||||
:style="height ? `min-height: ${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : ''"
|
:style="height ? `min-height: ${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : ''"
|
||||||
>
|
>
|
||||||
<n-config-provider :hljs="hljs">
|
<n-config-provider :hljs="hljs">
|
||||||
<n-code :code="value" :language="language" :word-wrap="wordWrap" :trim="false" data-test-id="area-content" />
|
<n-code :code="value" :language="language" :trim="false" data-test-id="area-content" />
|
||||||
</n-config-provider>
|
</n-config-provider>
|
||||||
</n-scrollbar>
|
</n-scrollbar>
|
||||||
<div absolute right-10px top-10px>
|
<div absolute right-10px top-10px>
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import { createApp } from 'vue';
|
|||||||
import { createPinia } from 'pinia';
|
import { createPinia } from 'pinia';
|
||||||
import { createHead } from '@vueuse/head';
|
import { createHead } from '@vueuse/head';
|
||||||
|
|
||||||
|
import { install as VueMonacoEditorPlugin, loader } from '@guolao/vue-monaco-editor';
|
||||||
|
import * as monaco from 'monaco-editor';
|
||||||
|
|
||||||
import { registerSW } from 'virtual:pwa-register';
|
import { registerSW } from 'virtual:pwa-register';
|
||||||
import { plausible } from './plugins/plausible.plugin';
|
import { plausible } from './plugins/plausible.plugin';
|
||||||
|
|
||||||
@@ -13,10 +16,14 @@ import App from './App.vue';
|
|||||||
import router from './router';
|
import router from './router';
|
||||||
import { i18nPlugin } from './plugins/i18n.plugin';
|
import { i18nPlugin } from './plugins/i18n.plugin';
|
||||||
|
|
||||||
|
// loaded monaco-editor from `node_modules`
|
||||||
|
loader.config({ monaco });
|
||||||
|
|
||||||
registerSW();
|
registerSW();
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
|
app.use(VueMonacoEditorPlugin);
|
||||||
app.use(createPinia());
|
app.use(createPinia());
|
||||||
app.use(createHead());
|
app.use(createHead());
|
||||||
app.use(i18nPlugin);
|
app.use(i18nPlugin);
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
declare module 'composeverter' {
|
||||||
|
interface Configuration {
|
||||||
|
expandVolumes?: boolean;
|
||||||
|
expandPorts?: boolean;
|
||||||
|
indent?: number;
|
||||||
|
}
|
||||||
|
interface DockerComposeValidatioError {
|
||||||
|
line?: number;
|
||||||
|
message: string;
|
||||||
|
helpLink?: string;
|
||||||
|
}
|
||||||
|
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
|
||||||
|
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function migrateFromV3xToV2x(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function migrateFromV1ToV2x(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function migrateToCommonSpec(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
|
||||||
|
export function getDockerComposeSchemaWithoutFormats(): object;
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import {
|
||||||
|
validateDockerComposeToCommonSpec,
|
||||||
|
} from 'composeverter';
|
||||||
|
|
||||||
|
const dockerCompose = ref(
|
||||||
|
`version: '3.3'
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
ports:
|
||||||
|
- '80:80'
|
||||||
|
volumes:
|
||||||
|
- '/var/run/docker.sock:/tmp/docker.sock:ro'
|
||||||
|
restart: always
|
||||||
|
logging:
|
||||||
|
options:
|
||||||
|
max-size: 1g
|
||||||
|
image: nginx`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const conversionResult = computed(() => {
|
||||||
|
try {
|
||||||
|
return validateDockerComposeToCommonSpec(dockerCompose.value);
|
||||||
|
}
|
||||||
|
catch (e: any) {
|
||||||
|
return e.toString().split('\n').map((err: string) => ({ line: -1, message: err, helpLink: '' }));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const errors = computed(() => conversionResult.value);
|
||||||
|
|
||||||
|
const MONACO_EDITOR_OPTIONS = {
|
||||||
|
automaticLayout: true,
|
||||||
|
formatOnType: true,
|
||||||
|
formatOnPaste: true,
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<c-label label="Paste your Docker Compose file content:">
|
||||||
|
<div relative w-full>
|
||||||
|
<c-monaco-editor
|
||||||
|
v-model:value="dockerCompose"
|
||||||
|
theme="vs-dark"
|
||||||
|
language="yaml"
|
||||||
|
height="250px"
|
||||||
|
:options="MONACO_EDITOR_OPTIONS"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</c-label>
|
||||||
|
|
||||||
|
<div v-if="errors.length > 0">
|
||||||
|
<n-alert title="The following errors occured" type="error" mt-5>
|
||||||
|
<ul>
|
||||||
|
<li v-for="(message, index) of errors" :key="index">
|
||||||
|
{{ message.message }} (<n-a v-if="message.helpLink" target="_blank" rel="noreferer noopener">
|
||||||
|
See Docker Compose help
|
||||||
|
</n-a>)
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</n-alert>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<n-alert type="success" mt-5>
|
||||||
|
Validation successful!
|
||||||
|
</n-alert>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { BrandDocker } from '@vicons/tabler';
|
||||||
|
import { defineTool } from '../tool';
|
||||||
|
|
||||||
|
export const tool = defineTool({
|
||||||
|
name: 'Docker Compose Validator',
|
||||||
|
path: '/docker-compose-validator',
|
||||||
|
description: 'Validate Docker Compose files against CommonSpec schema',
|
||||||
|
keywords: ['docker', 'compose', 'validator', 'commonspec'],
|
||||||
|
component: () => import('./docker-compose-validator.vue'),
|
||||||
|
icon: BrandDocker,
|
||||||
|
createdAt: new Date('2024-01-25'),
|
||||||
|
});
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import * as fflate from 'fflate';
|
|
||||||
import { Base64 } from 'js-base64';
|
|
||||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
|
||||||
import { withDefaultOnError } from '@/utils/defaults';
|
|
||||||
|
|
||||||
const compressedInput = ref('');
|
|
||||||
const decompressedOutput = computed(() => withDefaultOnError(() => {
|
|
||||||
const compressedBuf = Base64.toUint8Array(compressedInput.value);
|
|
||||||
return fflate.strFromU8(fflate.decompressSync(compressedBuf));
|
|
||||||
}, '# invalid compressed base64 string'));
|
|
||||||
|
|
||||||
const rawInput = ref('');
|
|
||||||
const compressedGzipOutput = computed(() => withDefaultOnError(() => Base64.fromUint8Array(fflate.gzipSync(fflate.strToU8(rawInput.value))), ''));
|
|
||||||
const compressedDeflateOutput = computed(() => withDefaultOnError(() => Base64.fromUint8Array(fflate.deflateSync(fflate.strToU8(rawInput.value))), ''));
|
|
||||||
const compressedZlibOutput = computed(() => withDefaultOnError(() => Base64.fromUint8Array(fflate.zlibSync(fflate.strToU8(rawInput.value))), ''));
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div style="max-width: 600px;">
|
|
||||||
<c-card title="Compress string" mb-5>
|
|
||||||
<c-input-text
|
|
||||||
v-model:value="rawInput"
|
|
||||||
multiline
|
|
||||||
placeholder="Put your string here..."
|
|
||||||
rows="5"
|
|
||||||
label="String to compress"
|
|
||||||
raw-text
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h3>GZIP compressed string</h3>
|
|
||||||
<TextareaCopyable
|
|
||||||
:value="compressedGzipOutput"
|
|
||||||
:word-wrap="true"
|
|
||||||
multiline
|
|
||||||
placeholder="The GZip compressed version of your string will be here"
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h3>Zlib compressed string</h3>
|
|
||||||
<TextareaCopyable
|
|
||||||
:value="compressedZlibOutput"
|
|
||||||
:word-wrap="true"
|
|
||||||
multiline
|
|
||||||
placeholder="The Zlib compressed version of your string will be here"
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h3>Deflate compressed string</h3>
|
|
||||||
<TextareaCopyable
|
|
||||||
:value="compressedDeflateOutput"
|
|
||||||
:word-wrap="true"
|
|
||||||
multiline
|
|
||||||
placeholder="The Deflate compressed version of your string will be here"
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</c-card>
|
|
||||||
|
|
||||||
<c-card title="Decompress string">
|
|
||||||
<c-input-text
|
|
||||||
v-model:value="compressedInput"
|
|
||||||
multiline
|
|
||||||
placeholder="Your compressed string..."
|
|
||||||
rows="5"
|
|
||||||
label="Compressed string to decompress"
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h3>Decompressed string</h3>
|
|
||||||
<TextareaCopyable
|
|
||||||
v-model:value="decompressedOutput"
|
|
||||||
:word-wrap="true"
|
|
||||||
multiline
|
|
||||||
placeholder="The decompressed string will be here"
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</c-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { FileZip } from '@vicons/tabler';
|
|
||||||
import { defineTool } from '../tool';
|
|
||||||
|
|
||||||
export const tool = defineTool({
|
|
||||||
name: 'GZip/Deflate converter',
|
|
||||||
path: '/gzip-converter',
|
|
||||||
description: 'Convert text from/to gzip/deflate',
|
|
||||||
keywords: ['gzip', 'deflate', 'converter'],
|
|
||||||
component: () => import('./gzip-converter.vue'),
|
|
||||||
icon: FileZip,
|
|
||||||
createdAt: new Date('2024-03-09'),
|
|
||||||
});
|
|
||||||
+2
-2
@@ -5,8 +5,8 @@ import { tool as basicAuthGenerator } from './basic-auth-generator';
|
|||||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||||
|
|
||||||
import { tool as textToUnicode } from './text-to-unicode';
|
import { tool as textToUnicode } from './text-to-unicode';
|
||||||
import { tool as gzipConverter } from './gzip-converter';
|
|
||||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||||
|
import { tool as dockerComposeValidator } from './docker-compose-validator';
|
||||||
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';
|
||||||
@@ -108,7 +108,6 @@ export const toolsByCategory: ToolCategory[] = [
|
|||||||
listConverter,
|
listConverter,
|
||||||
tomlToJson,
|
tomlToJson,
|
||||||
tomlToYaml,
|
tomlToYaml,
|
||||||
gzipConverter,
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -148,6 +147,7 @@ export const toolsByCategory: ToolCategory[] = [
|
|||||||
sqlPrettify,
|
sqlPrettify,
|
||||||
chmodCalculator,
|
chmodCalculator,
|
||||||
dockerRunToDockerComposeConverter,
|
dockerRunToDockerComposeConverter,
|
||||||
|
dockerComposeValidator,
|
||||||
xmlFormatter,
|
xmlFormatter,
|
||||||
yamlViewer,
|
yamlViewer,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import * as monacoEditor from 'monaco-editor';
|
||||||
|
import type { MonacoEditor } from '@guolao/vue-monaco-editor';
|
||||||
|
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
||||||
|
import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
||||||
|
import CssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
|
||||||
|
import HtmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
|
||||||
|
import TsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
||||||
|
import { useStyleStore } from '@/stores/style.store';
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<EditorProps>(), {
|
||||||
|
theme: 'vs',
|
||||||
|
options: () => ({}),
|
||||||
|
overrideServices: () => ({}),
|
||||||
|
saveViewState: true,
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits<{
|
||||||
|
(e: 'update:value', value: string | undefined): void
|
||||||
|
(e: 'beforeMount', monaco: MonacoEditor): void
|
||||||
|
(e: 'mount', editor: monacoEditor.editor.IStandaloneCodeEditor, monaco: MonacoEditor): void
|
||||||
|
(e: 'change', value: string | undefined, event: monacoEditor.editor.IModelContentChangedEvent): void
|
||||||
|
(e: 'validate', markers: monacoEditor.editor.IMarker[]): void
|
||||||
|
}>();
|
||||||
|
|
||||||
|
interface MonacoEnvironment {
|
||||||
|
getWorker(_: any, label: string): Worker
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||||
|
declare module globalThis {
|
||||||
|
let MonacoEnvironment: MonacoEnvironment;
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = useVModel(props, 'value', emits);
|
||||||
|
|
||||||
|
globalThis.MonacoEnvironment = {
|
||||||
|
getWorker(_: any, label: string) {
|
||||||
|
if (label === 'json') {
|
||||||
|
return new JsonWorker();
|
||||||
|
}
|
||||||
|
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||||
|
return new CssWorker();
|
||||||
|
}
|
||||||
|
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||||
|
return new HtmlWorker();
|
||||||
|
}
|
||||||
|
if (label === 'typescript' || label === 'javascript') {
|
||||||
|
return new TsWorker();
|
||||||
|
}
|
||||||
|
return new EditorWorker();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface EditorProps {
|
||||||
|
defaultValue?: string
|
||||||
|
defaultPath?: string
|
||||||
|
defaultLanguage?: string
|
||||||
|
value?: string
|
||||||
|
language?: string
|
||||||
|
path?: string
|
||||||
|
|
||||||
|
/* === */
|
||||||
|
|
||||||
|
theme: 'vs' | string
|
||||||
|
line?: number
|
||||||
|
options?: monacoEditor.editor.IStandaloneEditorConstructionOptions
|
||||||
|
overrideServices?: monacoEditor.editor.IEditorOverrideServices
|
||||||
|
saveViewState?: boolean
|
||||||
|
|
||||||
|
/* === */
|
||||||
|
|
||||||
|
width?: number | string
|
||||||
|
height?: number | string
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
monacoEditor.editor.defineTheme('it-tools-dark', {
|
||||||
|
base: 'vs-dark',
|
||||||
|
inherit: true,
|
||||||
|
rules: [],
|
||||||
|
colors: {
|
||||||
|
'editor.background': '#00000000',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
monacoEditor.editor.defineTheme('it-tools-light', {
|
||||||
|
base: 'vs',
|
||||||
|
inherit: true,
|
||||||
|
rules: [],
|
||||||
|
colors: {
|
||||||
|
'editor.background': '#00000000',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const styleStore = useStyleStore();
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => styleStore.isDarkTheme,
|
||||||
|
isDarkTheme => monacoEditor.editor.setTheme(isDarkTheme ? 'it-tools-dark' : 'it-tools-light'),
|
||||||
|
{ immediate: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
const attrs = useAttrs();
|
||||||
|
const inheritedAttrs = { ...attrs, ...props };
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
inheritAttrs: false,
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<vue-monaco-editor
|
||||||
|
v-bind="inheritedAttrs"
|
||||||
|
v-model:value="value"
|
||||||
|
@before-mount="(monaco: MonacoEditor) => emits('beforeMount', monaco)"
|
||||||
|
@mount="(editor: monacoEditor.editor.IStandaloneCodeEditor, monaco: MonacoEditor) => emits('mount', editor, monaco)"
|
||||||
|
@change="(value: string | undefined, event: monacoEditor.editor.IModelContentChangedEvent) => emits('change', value, event)"
|
||||||
|
@validate="(markers: monacoEditor.editor.IMarker[]) => emits('validate', markers)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
Reference in new issue
Block a user