mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 14:50:17 +03:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1cb1cca4d | ||
|
|
87984e2081 | ||
|
|
f9f9288bbc |
No files matched your search
Vendored
+2
-3
@@ -121,6 +121,7 @@ declare module '@vue/runtime-core' {
|
||||
LoremIpsumGenerator: typeof import('./src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue')['default']
|
||||
MacAddressGenerator: typeof import('./src/tools/mac-address-generator/mac-address-generator.vue')['default']
|
||||
MacAddressLookup: typeof import('./src/tools/mac-address-lookup/mac-address-lookup.vue')['default']
|
||||
MarkdownToHtml: typeof import('./src/tools/markdown-to-html/markdown-to-html.vue')['default']
|
||||
MathEvaluator: typeof import('./src/tools/math-evaluator/math-evaluator.vue')['default']
|
||||
MenuBar: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar.vue')['default']
|
||||
MenuBarItem: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar-item.vue')['default']
|
||||
@@ -128,13 +129,11 @@ declare module '@vue/runtime-core' {
|
||||
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
|
||||
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
|
||||
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
|
||||
MongoObjectidConverter: typeof import('./src/tools/mongo-objectid-converter/mongo-objectid-converter.vue')['default']
|
||||
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
||||
NButton: typeof import('naive-ui')['NButton']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDatePicker: typeof import('naive-ui')['NDatePicker']
|
||||
NDivider: typeof import('naive-ui')['NDivider']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NForm: typeof import('naive-ui')['NForm']
|
||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
"@tiptap/pm": "2.1.6",
|
||||
"@tiptap/starter-kit": "2.1.6",
|
||||
"@tiptap/vue-3": "2.0.3",
|
||||
"@types/markdown-it": "^13.0.7",
|
||||
"@types/figlet": "^1.5.8",
|
||||
"@vicons/material": "^0.12.0",
|
||||
"@vicons/tabler": "^0.12.0",
|
||||
@@ -70,6 +71,7 @@
|
||||
"jwt-decode": "^3.1.2",
|
||||
"libphonenumber-js": "^1.10.28",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-it": "^14.0.0",
|
||||
"marked": "^10.0.0",
|
||||
"mathjs": "^11.9.1",
|
||||
"mime-types": "^2.1.35",
|
||||
@@ -89,6 +91,7 @@
|
||||
"unplugin-auto-import": "^0.16.4",
|
||||
"uuid": "^9.0.0",
|
||||
"vue": "^3.3.4",
|
||||
"vue-color-wheel": "^0.1.1",
|
||||
"vue-i18n": "^9.9.1",
|
||||
"vue-router": "^4.1.6",
|
||||
"vue-tsc": "^1.8.1",
|
||||
|
||||
Generated
+254
-10
@@ -26,6 +26,9 @@ dependencies:
|
||||
'@types/figlet':
|
||||
specifier: ^1.5.8
|
||||
version: 1.5.8
|
||||
'@types/markdown-it':
|
||||
specifier: ^13.0.7
|
||||
version: 13.0.9
|
||||
'@vicons/material':
|
||||
specifier: ^0.12.0
|
||||
version: 0.12.0
|
||||
@@ -110,6 +113,9 @@ dependencies:
|
||||
lodash:
|
||||
specifier: ^4.17.21
|
||||
version: 4.17.21
|
||||
markdown-it:
|
||||
specifier: ^14.0.0
|
||||
version: 14.1.0
|
||||
marked:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
@@ -167,6 +173,9 @@ dependencies:
|
||||
vue:
|
||||
specifier: ^3.3.4
|
||||
version: 3.3.4
|
||||
vue-color-wheel:
|
||||
specifier: ^0.1.1
|
||||
version: 0.1.1
|
||||
vue-i18n:
|
||||
specifier: ^9.9.1
|
||||
version: 9.9.1(vue@3.3.4)
|
||||
@@ -1904,6 +1913,12 @@ packages:
|
||||
'@babel/helper-validator-identifier': 7.22.20
|
||||
to-fast-properties: 2.0.0
|
||||
|
||||
/@cfcs/core@0.0.6:
|
||||
resolution: {integrity: sha512-FxfJMwoLB8MEMConeXUCqtMGqxdtePQxRBOiGip9ULcYYam3WfCgoY6xdnMaSkYvRvmosp5iuG+TiPofm65+Pw==}
|
||||
dependencies:
|
||||
'@egjs/component': 3.0.5
|
||||
dev: false
|
||||
|
||||
/@css-render/plugin-bem@0.15.12(css-render@0.15.12):
|
||||
resolution: {integrity: sha512-Lq2jSOZn+wYQtsyaFj6QRz2EzAnd3iW5fZeHO1WSXQdVYwvwGX0ZiH3X2JQgtgYLT1yeGtrwrqJdNdMEUD2xTw==}
|
||||
peerDependencies:
|
||||
@@ -1920,6 +1935,28 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/@daybrush/utils@1.13.0:
|
||||
resolution: {integrity: sha512-ALK12C6SQNNHw1enXK+UO8bdyQ+jaWNQ1Af7Z3FNxeAwjYhQT7do+TRE4RASAJ3ObaS2+TJ7TXR3oz2Gzbw0PQ==}
|
||||
dev: false
|
||||
|
||||
/@egjs/agent@2.4.4:
|
||||
resolution: {integrity: sha512-cvAPSlUILhBBOakn2krdPnOGv5hAZq92f1YHxYcfu0p7uarix2C6Ia3AVizpS1SGRZGiEkIS5E+IVTLg1I2Iog==}
|
||||
dev: false
|
||||
|
||||
/@egjs/children-differ@1.0.1:
|
||||
resolution: {integrity: sha512-DRvyqMf+CPCOzAopQKHtW+X8iN6Hy6SFol+/7zCUiE5y4P/OB8JP8FtU4NxtZwtafvSL4faD5KoQYPj3JHzPFQ==}
|
||||
dependencies:
|
||||
'@egjs/list-differ': 1.0.1
|
||||
dev: false
|
||||
|
||||
/@egjs/component@3.0.5:
|
||||
resolution: {integrity: sha512-cLcGizTrrUNA2EYE3MBmEDt2tQv1joVP1Q3oDisZ5nw0MZDx2kcgEXM+/kZpfa/PAkFvYVhRUZwytIQWoN3V/w==}
|
||||
dev: false
|
||||
|
||||
/@egjs/list-differ@1.0.1:
|
||||
resolution: {integrity: sha512-OTFTDQcWS+1ZREOdCWuk5hCBgYO4OsD30lXcOCyVOAjXMhgL5rBRDnt/otb6Nz8CzU0L/igdcaQBDLWc4t9gvg==}
|
||||
dev: false
|
||||
|
||||
/@emotion/hash@0.8.0:
|
||||
resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==}
|
||||
dev: false
|
||||
@@ -2595,6 +2632,25 @@ packages:
|
||||
resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==}
|
||||
dev: true
|
||||
|
||||
/@scena/dragscroll@1.4.0:
|
||||
resolution: {integrity: sha512-3O8daaZD9VXA9CP3dra6xcgt/qrm0mg0xJCwiX6druCteQ9FFsXffkF8PrqxY4Z4VJ58fFKEa0RlKqbsi/XnRA==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
dev: false
|
||||
|
||||
/@scena/event-emitter@1.0.5:
|
||||
resolution: {integrity: sha512-AzY4OTb0+7ynefmWFQ6hxDdk0CySAq/D4efljfhtRHCOP7MBF9zUfhKG3TJiroVjASqVgkRJFdenS8ArZo6Olg==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
dev: false
|
||||
|
||||
/@scena/matrix@1.1.1:
|
||||
resolution: {integrity: sha512-JVKBhN0tm2Srl+Yt+Ywqu0oLgLcdemDQlD1OxmN9jaCTwaFPZ7tY8n6dhVgMEaR9qcR7r+kAlMXnSfNyYdE+Vg==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
dev: false
|
||||
|
||||
/@sinclair/typebox@0.27.8:
|
||||
resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
|
||||
dev: true
|
||||
@@ -2952,7 +3008,6 @@ packages:
|
||||
|
||||
/@types/linkify-it@3.0.2:
|
||||
resolution: {integrity: sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==}
|
||||
dev: true
|
||||
|
||||
/@types/lodash-es@4.17.10:
|
||||
resolution: {integrity: sha512-YJP+w/2khSBwbUSFdGsSqmDvmnN3cCKoPOL7Zjle6s30ZtemkkqhjVfFqGwPN7ASil5VyjE2GtyU/yqYY6mC0A==}
|
||||
@@ -2974,6 +3029,13 @@ packages:
|
||||
'@types/mdurl': 1.0.2
|
||||
dev: true
|
||||
|
||||
/@types/markdown-it@13.0.9:
|
||||
resolution: {integrity: sha512-1XPwR0+MgXLWfTn9gCsZ55AHOKW1WN+P9vr0PaQh5aerR9LLQXUbjfEAFhjmEmyoYFWAyuN2Mqkn40MZ4ukjBw==}
|
||||
dependencies:
|
||||
'@types/linkify-it': 3.0.2
|
||||
'@types/mdurl': 1.0.2
|
||||
dev: false
|
||||
|
||||
/@types/mdast@3.0.11:
|
||||
resolution: {integrity: sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==}
|
||||
dependencies:
|
||||
@@ -2982,7 +3044,6 @@ packages:
|
||||
|
||||
/@types/mdurl@1.0.2:
|
||||
resolution: {integrity: sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==}
|
||||
dev: true
|
||||
|
||||
/@types/mime-types@2.1.1:
|
||||
resolution: {integrity: sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw==}
|
||||
@@ -3360,7 +3421,7 @@ packages:
|
||||
dependencies:
|
||||
'@unhead/dom': 0.5.1
|
||||
'@unhead/schema': 0.5.1
|
||||
'@vueuse/shared': 10.11.1(vue@3.3.4)
|
||||
'@vueuse/shared': 11.0.3(vue@3.3.4)
|
||||
unhead: 0.5.1
|
||||
vue: 3.3.4
|
||||
transitivePeerDependencies:
|
||||
@@ -3993,19 +4054,19 @@ packages:
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
/@vueuse/shared@10.11.1(vue@3.3.4):
|
||||
resolution: {integrity: sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==}
|
||||
/@vueuse/shared@10.3.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==}
|
||||
dependencies:
|
||||
vue-demi: 0.14.10(vue@3.3.4)
|
||||
vue-demi: 0.14.5(vue@3.3.4)
|
||||
transitivePeerDependencies:
|
||||
- '@vue/composition-api'
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
/@vueuse/shared@10.3.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==}
|
||||
/@vueuse/shared@11.0.3(vue@3.3.4):
|
||||
resolution: {integrity: sha512-0rY2m6HS5t27n/Vp5cTDsKTlNnimCqsbh/fmT2LgE+aaU42EMfXo8+bNX91W9I7DDmxfuACXMmrd7d79JxkqWA==}
|
||||
dependencies:
|
||||
vue-demi: 0.14.5(vue@3.3.4)
|
||||
vue-demi: 0.14.10(vue@3.3.4)
|
||||
transitivePeerDependencies:
|
||||
- '@vue/composition-api'
|
||||
- vue
|
||||
@@ -4630,6 +4691,43 @@ packages:
|
||||
resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==}
|
||||
dev: false
|
||||
|
||||
/croact-css-styled@1.1.9:
|
||||
resolution: {integrity: sha512-G7yvRiVJ3Eoj0ov2h2xR4312hpOzATay2dGS9clK8yJQothjH1sBXIyvOeRP5wBKD9mPcKcoUXPCPsl0tQog4w==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
css-styled: 1.0.8
|
||||
framework-utils: 1.1.0
|
||||
dev: false
|
||||
|
||||
/croact-moveable@0.9.0(croact@1.0.4):
|
||||
resolution: {integrity: sha512-fc3bieV6CdqqZFtzsSLi9KmvUMFW3oakUfhPCls1BxKjOfUfn8rktteGED2341A/Qghy8tI3Hm6SdocIc68IKg==}
|
||||
peerDependencies:
|
||||
croact: ^1.0.4
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@egjs/agent': 2.4.4
|
||||
'@egjs/children-differ': 1.0.1
|
||||
'@egjs/list-differ': 1.0.1
|
||||
'@scena/dragscroll': 1.4.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
'@scena/matrix': 1.1.1
|
||||
croact: 1.0.4
|
||||
croact-css-styled: 1.1.9
|
||||
css-to-mat: 1.1.1
|
||||
framework-utils: 1.1.0
|
||||
gesto: 1.19.4
|
||||
overlap-area: 1.1.0
|
||||
react-css-styled: 1.1.9
|
||||
react-moveable: 0.56.0
|
||||
dev: false
|
||||
|
||||
/croact@1.0.4:
|
||||
resolution: {integrity: sha512-9GhvyzTY/IVUrMQ2iz/mzgZ8+NcjczmIo/t4FkC1CU0CEcau6v6VsEih4jkTa4ZmRgYTF0qXEZLObCzdDFplpw==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@egjs/list-differ': 1.0.1
|
||||
dev: false
|
||||
|
||||
/cron-validator@1.3.1:
|
||||
resolution: {integrity: sha512-C1HsxuPCY/5opR55G5/WNzyEGDWFVG+6GLrA+fW/sCTcP6A6NTjUP2AK7B8n2PyFs90kDG2qzwm8LMheADku6A==}
|
||||
dev: false
|
||||
@@ -4673,6 +4771,19 @@ packages:
|
||||
nth-check: 2.1.1
|
||||
dev: true
|
||||
|
||||
/css-styled@1.0.8:
|
||||
resolution: {integrity: sha512-tCpP7kLRI8dI95rCh3Syl7I+v7PP+2JYOzWkl0bUEoSbJM+u8ITbutjlQVf0NC2/g4ULROJPi16sfwDIO8/84g==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
dev: false
|
||||
|
||||
/css-to-mat@1.1.1:
|
||||
resolution: {integrity: sha512-kvpxFYZb27jRd2vium35G7q5XZ2WJ9rWjDUMNT36M3Hc41qCrLXFM5iEKMGXcrPsKfXEN+8l/riB4QzwwwiEyQ==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/matrix': 1.1.1
|
||||
dev: false
|
||||
|
||||
/css-tree@2.2.1:
|
||||
resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==}
|
||||
engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'}
|
||||
@@ -5016,7 +5127,6 @@ packages:
|
||||
/entities@4.5.0:
|
||||
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
|
||||
engines: {node: '>=0.12'}
|
||||
dev: true
|
||||
|
||||
/errno@0.1.8:
|
||||
resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==}
|
||||
@@ -5698,6 +5808,10 @@ packages:
|
||||
resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}
|
||||
dev: false
|
||||
|
||||
/framework-utils@1.1.0:
|
||||
resolution: {integrity: sha512-KAfqli5PwpFJ8o3psRNs8svpMGyCSAe8nmGcjQ0zZBWN2H6dZDnq+ABp3N3hdUmFeMrLtjOCTXD4yplUJIWceg==}
|
||||
dev: false
|
||||
|
||||
/from@0.1.7:
|
||||
resolution: {integrity: sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==}
|
||||
dev: true
|
||||
@@ -5781,6 +5895,13 @@ packages:
|
||||
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
|
||||
/gesto@1.19.4:
|
||||
resolution: {integrity: sha512-hfr/0dWwh0Bnbb88s3QVJd1ZRJeOWcgHPPwmiH6NnafDYvhTsxg+SLYu+q/oPNh9JS3V+nlr6fNs8kvPAtcRDQ==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
dev: false
|
||||
|
||||
/get-caller-file@2.0.5:
|
||||
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
||||
engines: {node: 6.* || 8.* || >= 10.*}
|
||||
@@ -5934,6 +6055,10 @@ packages:
|
||||
strip-bom-string: 1.0.0
|
||||
dev: true
|
||||
|
||||
/gsap@3.12.5:
|
||||
resolution: {integrity: sha512-srBfnk4n+Oe/ZnMIOXt3gT605BX9x5+rh/prT2F1SsNJsU1XuMiP0E2aptW481OnonOGACZWBqseH5Z7csHxhQ==}
|
||||
dev: false
|
||||
|
||||
/gzip-size@6.0.0:
|
||||
resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -6634,6 +6759,19 @@ packages:
|
||||
resolution: {integrity: sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==}
|
||||
dev: false
|
||||
|
||||
/keycode@2.2.1:
|
||||
resolution: {integrity: sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==}
|
||||
dev: false
|
||||
|
||||
/keycon@1.4.0:
|
||||
resolution: {integrity: sha512-p1NAIxiRMH3jYfTeXRs2uWbVJ1WpEjpi8ktzUyBJsX7/wn2qu2VRXktneBLNtKNxJmlUYxRi9gOJt1DuthXR7A==}
|
||||
dependencies:
|
||||
'@cfcs/core': 0.0.6
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
keycode: 2.2.1
|
||||
dev: false
|
||||
|
||||
/kind-of@6.0.3:
|
||||
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -6688,6 +6826,12 @@ packages:
|
||||
dependencies:
|
||||
uc.micro: 1.0.6
|
||||
|
||||
/linkify-it@5.0.0:
|
||||
resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==}
|
||||
dependencies:
|
||||
uc.micro: 2.1.0
|
||||
dev: false
|
||||
|
||||
/local-pkg@0.4.3:
|
||||
resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -6825,6 +6969,18 @@ packages:
|
||||
mdurl: 1.0.1
|
||||
uc.micro: 1.0.6
|
||||
|
||||
/markdown-it@14.1.0:
|
||||
resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
argparse: 2.0.1
|
||||
entities: 4.5.0
|
||||
linkify-it: 5.0.0
|
||||
mdurl: 2.0.0
|
||||
punycode.js: 2.3.1
|
||||
uc.micro: 2.1.0
|
||||
dev: false
|
||||
|
||||
/marked@10.0.0:
|
||||
resolution: {integrity: sha512-YiGcYcWj50YrwBgNzFoYhQ1hT6GmQbFG8SksnYJX1z4BXTHSOrz1GB5/Jm2yQvMg4nN1FHP4M6r03R10KrVUiA==}
|
||||
engines: {node: '>= 18'}
|
||||
@@ -6873,6 +7029,10 @@ packages:
|
||||
/mdurl@1.0.1:
|
||||
resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==}
|
||||
|
||||
/mdurl@2.0.0:
|
||||
resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==}
|
||||
dev: false
|
||||
|
||||
/merge-stream@2.0.0:
|
||||
resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
|
||||
dev: true
|
||||
@@ -6970,6 +7130,16 @@ packages:
|
||||
resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==}
|
||||
dev: false
|
||||
|
||||
/moveable@0.53.0:
|
||||
resolution: {integrity: sha512-71jS9zIoQzMhnNvduhg4tUEdm23+fO/40FN7muVMbZvVwbTku2MIxxLhnU4qFvxI4oVxn75l79SbtgjuA+s7Pw==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
croact: 1.0.4
|
||||
croact-moveable: 0.9.0(croact@1.0.4)
|
||||
react-moveable: 0.56.0
|
||||
dev: false
|
||||
|
||||
/mrmime@1.0.1:
|
||||
resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -7226,6 +7396,12 @@ packages:
|
||||
resolution: {integrity: sha512-PPrr40z5/MPStTTGJ0QtSD9KtaGHmnexBQWANWLWQOZZwbNMf/VyG/Uh29LwxExd51p3S323oM3kHbjRqmBiLg==}
|
||||
dev: false
|
||||
|
||||
/overlap-area@1.1.0:
|
||||
resolution: {integrity: sha512-3dlJgJCaVeXH0/eZjYVJvQiLVVrPO4U1ZGqlATtx6QGO3b5eNM6+JgUKa7oStBTdYuGTk7gVoABCW6Tp+dhRdw==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
dev: false
|
||||
|
||||
/p-limit@2.3.0:
|
||||
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -7682,6 +7858,11 @@ packages:
|
||||
resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
|
||||
dev: true
|
||||
|
||||
/punycode.js@2.3.1:
|
||||
resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==}
|
||||
engines: {node: '>=6'}
|
||||
dev: false
|
||||
|
||||
/punycode@2.3.0:
|
||||
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -7727,10 +7908,41 @@ packages:
|
||||
safe-buffer: 5.2.1
|
||||
dev: true
|
||||
|
||||
/react-css-styled@1.1.9:
|
||||
resolution: {integrity: sha512-M7fJZ3IWFaIHcZEkoFOnkjdiUFmwd8d+gTh2bpqMOcnxy/0Gsykw4dsL4QBiKsxcGow6tETUa4NAUcmJF+/nfw==}
|
||||
dependencies:
|
||||
css-styled: 1.0.8
|
||||
framework-utils: 1.1.0
|
||||
dev: false
|
||||
|
||||
/react-is@18.2.0:
|
||||
resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
|
||||
dev: true
|
||||
|
||||
/react-moveable@0.56.0:
|
||||
resolution: {integrity: sha512-FmJNmIOsOA36mdxbrc/huiE4wuXSRlmon/o+/OrfNhSiYYYL0AV5oObtPluEhb2Yr/7EfYWBHTxF5aWAvjg1SA==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@egjs/agent': 2.4.4
|
||||
'@egjs/children-differ': 1.0.1
|
||||
'@egjs/list-differ': 1.0.1
|
||||
'@scena/dragscroll': 1.4.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
'@scena/matrix': 1.1.1
|
||||
css-to-mat: 1.1.1
|
||||
framework-utils: 1.1.0
|
||||
gesto: 1.19.4
|
||||
overlap-area: 1.1.0
|
||||
react-css-styled: 1.1.9
|
||||
react-selecto: 1.26.3
|
||||
dev: false
|
||||
|
||||
/react-selecto@1.26.3:
|
||||
resolution: {integrity: sha512-Ubik7kWSnZyQEBNro+1k38hZaI1tJarE+5aD/qsqCOA1uUBSjgKVBy3EWRzGIbdmVex7DcxznFZLec/6KZNvwQ==}
|
||||
dependencies:
|
||||
selecto: 1.26.3
|
||||
dev: false
|
||||
|
||||
/read-pkg-up@7.0.1:
|
||||
resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -7999,6 +8211,21 @@ packages:
|
||||
resolution: {integrity: sha512-lEV5VB8BUKTo/AfktXJcy+JeXns26ylbMkIUco8CYREsQijuz4mrXres2Q+vMLdwkuLxJdIPQ8IlCIxLYm71Yw==}
|
||||
dev: false
|
||||
|
||||
/selecto@1.26.3:
|
||||
resolution: {integrity: sha512-gZHgqMy5uyB6/2YDjv3Qqaf7bd2hTDOpPdxXlrez4R3/L0GiEWDCFaUfrflomgqdb3SxHF2IXY0Jw0EamZi7cw==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@egjs/children-differ': 1.0.1
|
||||
'@scena/dragscroll': 1.4.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
css-styled: 1.0.8
|
||||
css-to-mat: 1.1.1
|
||||
framework-utils: 1.1.0
|
||||
gesto: 1.19.4
|
||||
keycon: 1.4.0
|
||||
overlap-area: 1.1.0
|
||||
dev: false
|
||||
|
||||
/semver@5.7.2:
|
||||
resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}
|
||||
hasBin: true
|
||||
@@ -8626,6 +8853,10 @@ packages:
|
||||
/uc.micro@1.0.6:
|
||||
resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==}
|
||||
|
||||
/uc.micro@2.1.0:
|
||||
resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==}
|
||||
dev: false
|
||||
|
||||
/ufo@1.1.2:
|
||||
resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==}
|
||||
|
||||
@@ -9144,6 +9375,15 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-color-wheel@0.1.1:
|
||||
resolution: {integrity: sha512-FOZztY9puZM+cVWMd9JdOMDHQKCeOoD8qUeJOeSxw4FheOXuuaKpr9Kep2qSX2gTiLEpTgwiFaUkRQnSCVInAQ==}
|
||||
dependencies:
|
||||
colord: 2.9.3
|
||||
gsap: 3.12.5
|
||||
moveable: 0.53.0
|
||||
vue-sonner: 1.1.4
|
||||
dev: false
|
||||
|
||||
/vue-demi@0.13.11(vue@3.3.4):
|
||||
resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -9227,6 +9467,10 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-sonner@1.1.4:
|
||||
resolution: {integrity: sha512-ATt+o38ALfPBfmaT3rfr10K+mkZ/7EdqZewEZVI3krSc1RaIDK8fI9gQro0Jlh8HZcOHv2oUDJufSIUl/qpdOA==}
|
||||
dev: false
|
||||
|
||||
/vue-template-compiler@2.7.14:
|
||||
resolution: {integrity: sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==}
|
||||
dependencies:
|
||||
|
||||
@@ -7,6 +7,7 @@ import sqlHljs from 'highlight.js/lib/languages/sql';
|
||||
import xmlHljs from 'highlight.js/lib/languages/xml';
|
||||
import yamlHljs from 'highlight.js/lib/languages/yaml';
|
||||
import iniHljs from 'highlight.js/lib/languages/ini';
|
||||
import markdownHljs from 'highlight.js/lib/languages/markdown';
|
||||
import { useCopy } from '@/composable/copy';
|
||||
|
||||
const props = withDefaults(
|
||||
@@ -30,6 +31,7 @@ hljs.registerLanguage('html', xmlHljs);
|
||||
hljs.registerLanguage('xml', xmlHljs);
|
||||
hljs.registerLanguage('yaml', yamlHljs);
|
||||
hljs.registerLanguage('toml', iniHljs);
|
||||
hljs.registerLanguage('markdown', markdownHljs);
|
||||
|
||||
const { value, language, followHeightOf, copyPlacement, copyMessage } = toRefs(props);
|
||||
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
<script setup lang="ts">
|
||||
import { colord, extend } from 'colord';
|
||||
import a11yPlugin from 'colord/plugins/a11y';
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useDebounce } from '@vueuse/core';
|
||||
import type { Harmony, HarmonyType } from 'vue-color-wheel';
|
||||
import { VueColorWheel } from 'vue-color-wheel';
|
||||
|
||||
extend([a11yPlugin]);
|
||||
|
||||
const wheelColor = useDebounce(ref('#40ffff')); // { hue: 0, saturation: 0.68, value: 1 }
|
||||
const colors = ref<Array<Harmony>>([]);
|
||||
const currentType = ref<HarmonyType>('analogous');
|
||||
const isColorReadable = ref(false);
|
||||
const isDarkTheme = useDark();
|
||||
|
||||
const harmonyTypes: { type: HarmonyType; label: string }[] = [
|
||||
{ type: 'monochromatic', label: 'Monochromatic' },
|
||||
{ type: 'complementary', label: 'Complementary' },
|
||||
{ type: 'analogous', label: 'Analogous' },
|
||||
{ type: 'triad', label: 'Triad' },
|
||||
{ type: 'split', label: 'Split' },
|
||||
{ type: 'compound', label: 'Compound' },
|
||||
{ type: 'tetradic', label: 'Tetradic' },
|
||||
{ type: 'square', label: 'Square' },
|
||||
{ type: 'doubleSplit', label: 'Double Split' },
|
||||
];
|
||||
|
||||
const colorList = computed(() => {
|
||||
return colors.value.map(item => colord(item.rgb).toHex());
|
||||
});
|
||||
|
||||
function handleChangeGradient(harmonyColors: Harmony[]) {
|
||||
const newColors = harmonyColors.map(color => colord(color.rgb).toHex());
|
||||
|
||||
const [base, secondary] = newColors;
|
||||
|
||||
const rootEl = document.documentElement;
|
||||
|
||||
// change the colors variables
|
||||
harmonyColors.map((color, index) => {
|
||||
const { r, g, b } = colord(color.rgb).toRgb();
|
||||
rootEl.style.setProperty(`--color${index + 1}`, `${r}, ${g}, ${b}`);
|
||||
return null;
|
||||
});
|
||||
const secondaryRgb = colord(secondary).toRgb();
|
||||
rootEl.style.setProperty(
|
||||
'--color-interactive',
|
||||
`${secondaryRgb.r}, ${secondaryRgb.g}, ${secondaryRgb.b}`,
|
||||
);
|
||||
if (newColors.length === 3) {
|
||||
const lightColor = colord(base).saturate(0.25).toRgb();
|
||||
const darkColor = colord(base).desaturate(0.25).toRgb();
|
||||
rootEl.style.setProperty(
|
||||
'--color4',
|
||||
`${lightColor.r}, ${lightColor.g}, ${lightColor.b}`,
|
||||
);
|
||||
rootEl.style.setProperty(
|
||||
'--color5',
|
||||
`${darkColor.r}, ${darkColor.g}, ${darkColor.b}`,
|
||||
);
|
||||
}
|
||||
|
||||
isColorReadable.value = colord(base).isReadable(
|
||||
isDarkTheme.value ? '#fff' : '#000',
|
||||
{ level: 'AAA' },
|
||||
);
|
||||
}
|
||||
|
||||
function handleChangeColors(harmonyColors: Harmony[]) {
|
||||
colors.value = harmonyColors;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => colors.value,
|
||||
(newColors) => {
|
||||
handleChangeGradient(newColors);
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="max-width: 600px">
|
||||
<c-card title="Pick a color" mb-2>
|
||||
<n-color-picker :value="wheelColor" :show-alpha="false" />
|
||||
<div
|
||||
:style="{ backgroundColor: wheelColor }"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Pick a palette type" mb-2>
|
||||
<n-radio-group v-model:value="currentType" name="radiogroup">
|
||||
<n-space>
|
||||
<n-radio
|
||||
v-for="v in harmonyTypes"
|
||||
:key="v.type"
|
||||
:value="v.type"
|
||||
:label="v.label"
|
||||
/>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</c-card>
|
||||
<c-card title="Wheel" mb-2 style="text-align: center">
|
||||
<div style="display: inline-block">
|
||||
<VueColorWheel
|
||||
v-model:color="wheelColor"
|
||||
wheel="aurora"
|
||||
:harmony="currentType"
|
||||
:radius="160"
|
||||
:default-color="wheelColor"
|
||||
:show-brightness="false"
|
||||
@change="handleChangeColors"
|
||||
/>
|
||||
</div>
|
||||
</c-card>
|
||||
<div
|
||||
v-for="(color, i) in colorList"
|
||||
:key="i"
|
||||
mt-1 flex items-center justify-center gap-1
|
||||
>
|
||||
<div
|
||||
p-1
|
||||
:style="{
|
||||
backgroundColor: `${color}`,
|
||||
color: isColorReadable ? '#000' : '#fff',
|
||||
}"
|
||||
>
|
||||
{{ color }}
|
||||
</div>
|
||||
<input-copyable :value="color" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ColorPicker } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Color Wheel',
|
||||
path: '/color-wheel',
|
||||
description: 'Choose a color palette/theme using a wheel and mode',
|
||||
keywords: ['color', 'wheel', 'palette', 'theme'],
|
||||
component: () => import('./color-wheel.vue'),
|
||||
icon: ColorPicker,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
});
|
||||
+4
-2
@@ -2,14 +2,15 @@ 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 emailNormalizer } from './email-normalizer';
|
||||
import { tool as colorWheel } from './color-wheel';
|
||||
|
||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||
|
||||
import { tool as textToUnicode } from './text-to-unicode';
|
||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||
import { tool as mongoObjectidConverter } from './mongo-objectid-converter';
|
||||
import { tool as xmlToJson } from './xml-to-json';
|
||||
import { tool as jsonToXml } from './json-to-xml';
|
||||
import { tool as markdownToHtml } from './markdown-to-html';
|
||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||
import { tool as macAddressGenerator } from './mac-address-generator';
|
||||
@@ -113,6 +114,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
tomlToYaml,
|
||||
xmlToJson,
|
||||
jsonToXml,
|
||||
markdownToHtml,
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -134,6 +136,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
httpStatusCodes,
|
||||
jsonDiff,
|
||||
safelinkDecoder,
|
||||
colorWheel,
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -155,7 +158,6 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
xmlFormatter,
|
||||
yamlViewer,
|
||||
emailNormalizer,
|
||||
mongoObjectidConverter,
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Markdown } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Markdown to HTML',
|
||||
path: '/markdown-to-html',
|
||||
description: 'Convert Markdown to Html and allow to print (as PDF)',
|
||||
keywords: ['markdown', 'html', 'converter', 'pdf'],
|
||||
component: () => import('./markdown-to-html.vue'),
|
||||
icon: Markdown,
|
||||
createdAt: new Date('2024-08-25'),
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
<script setup lang="ts">
|
||||
import markdownit from 'markdown-it';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const inputMarkdown = ref('');
|
||||
const outputHtml = computed(() => {
|
||||
const md = markdownit();
|
||||
return md.render(inputMarkdown.value);
|
||||
});
|
||||
|
||||
function printHtml() {
|
||||
const w = window.open();
|
||||
if (w === null) {
|
||||
return;
|
||||
}
|
||||
w.document.body.innerHTML = outputHtml.value;
|
||||
w.print();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="inputMarkdown"
|
||||
multiline raw-text
|
||||
placeholder="Your Markdown content..."
|
||||
rows="8"
|
||||
autofocus
|
||||
label="Your Markdown to convert:"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Output HTML:">
|
||||
<TextareaCopyable :value="outputHtml" :word-wrap="true" language="html" />
|
||||
</n-form-item>
|
||||
|
||||
<div flex justify-center>
|
||||
<n-button @click="printHtml">
|
||||
Print as PDF
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Database } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'MongoDB ObjectId Converter',
|
||||
path: '/mongo-objectid-converter',
|
||||
description: 'Convert between MongoDB ObjectId and internal timestamp',
|
||||
keywords: ['mongo', 'objectid', 'converter', 'timestamp'],
|
||||
component: () => import('./mongo-objectid-converter.vue'),
|
||||
icon: Database,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
});
|
||||
@@ -1,30 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { dateFromObjectId, generateMongoFilter, objectIdFromDate, objectIdSyntaxFromDate } from './mongo-objectid-converter.service';
|
||||
|
||||
describe('mongo-objectid-converter', () => {
|
||||
describe('objectIdFromDate', () => {
|
||||
it('convert a Date to ObjectId', () => {
|
||||
expect(objectIdFromDate(new Date(Date.UTC(2024, 0, 1)))).to.eql('659200800000000000000000');
|
||||
expect(objectIdFromDate(new Date(Date.UTC(2024, 0, 1, 12, 12, 12)))).to.eql('6592ac1c0000000000000000');
|
||||
});
|
||||
});
|
||||
describe('objectIdSyntaxFromDate', () => {
|
||||
it('convert a Date to ObjectId', () => {
|
||||
expect(objectIdSyntaxFromDate(new Date(Date.UTC(2024, 0, 1)))).to.eql('ObjectId("659200800000000000000000")');
|
||||
});
|
||||
});
|
||||
describe('dateFromObjectId', () => {
|
||||
it('convert an ObjectId to Date', () => {
|
||||
expect(dateFromObjectId('659200800000000000000000')).to.eql(new Date(Date.UTC(2024, 0, 1)));
|
||||
expect(dateFromObjectId('6592ac1c0000000000000000')).to.eql(new Date(Date.UTC(2024, 0, 1, 12, 12, 12)));
|
||||
});
|
||||
});
|
||||
describe('generateMongoFilter', () => {
|
||||
it('convert a date to mongo query', () => {
|
||||
expect(generateMongoFilter({
|
||||
date: new Date(Date.UTC(2024, 0, 1, 12, 12, 12)),
|
||||
tableName: 'comments',
|
||||
})).to.eql('db.comments.find({_id: {$gt: ObjectId("6592ac1c0000000000000000")}})');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,23 +0,0 @@
|
||||
export function objectIdFromDate(date: Date) {
|
||||
return `${Math.floor(date.getTime() / 1000).toString(16)}0000000000000000`;
|
||||
};
|
||||
|
||||
export function objectIdSyntaxFromDate(date: Date) {
|
||||
return `ObjectId("${objectIdFromDate(date)}")`;
|
||||
};
|
||||
|
||||
export function generateMongoFilter(
|
||||
{
|
||||
tableName, date, operator = 'gt',
|
||||
}:
|
||||
{
|
||||
tableName: string
|
||||
date: Date
|
||||
operator?: 'gt' | 'lt'
|
||||
}) {
|
||||
return `db.${tableName}.find({_id: {$${operator}: ObjectId("${objectIdFromDate(date)}")}})`;
|
||||
}
|
||||
|
||||
export function dateFromObjectId(objectId: string) {
|
||||
return new Date(Number.parseInt(objectId.substring(0, 8), 16) * 1000);
|
||||
};
|
||||
@@ -1,68 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { dateFromObjectId, generateMongoFilter, objectIdFromDate, objectIdSyntaxFromDate } from './mongo-objectid-converter.service';
|
||||
import { withDefaultOnError } from '@/utils/defaults';
|
||||
|
||||
const currentTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
|
||||
const objectIdInput = ref(objectIdFromDate(new Date()));
|
||||
const dateOutput = computed(() =>
|
||||
withDefaultOnError(() => dateFromObjectId(objectIdInput.value), 'Invalid ObjectId'),
|
||||
);
|
||||
|
||||
const dateInput = ref(Date.now());
|
||||
const dateValue = computed(() => new Date(dateInput.value));
|
||||
const tableName = ref('tbl');
|
||||
const objectIdOutput = computed(() =>
|
||||
withDefaultOnError(() => objectIdFromDate(dateValue.value), 'Invalid Date'),
|
||||
);
|
||||
const objectIdSyntaxOutput = computed(() =>
|
||||
withDefaultOnError(() => objectIdSyntaxFromDate(dateValue.value), 'Invalid Date'),
|
||||
);
|
||||
const objectIdQueryOutput = computed(() =>
|
||||
withDefaultOnError(() => generateMongoFilter({ date: dateValue.value, tableName: tableName.value }), 'Invalid Date'),
|
||||
);
|
||||
const objectIdUTCDate = computed(() =>
|
||||
dateValue.value.toISOString(),
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card :title="`ObjectId to Date (${currentTimeZone})`">
|
||||
<c-input-text
|
||||
v-model:value="objectIdInput"
|
||||
placeholder="Put your ObjectId here..."
|
||||
label="ObjectId to encode"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<textarea-copyable
|
||||
:value="dateOutput instanceof Date ? dateOutput.toLocaleString(undefined, { timeZoneName: 'short' }) : dateOutput"
|
||||
/>
|
||||
<textarea-copyable
|
||||
:value="dateOutput instanceof Date ? dateOutput.toISOString() : dateOutput"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-card :title="`Date to ObjectId (${currentTimeZone})`">
|
||||
<n-form-item label="Date and time" label-placement="left" mb-2 flex-1>
|
||||
<n-date-picker v-model:value="dateInput" type="datetime" />
|
||||
</n-form-item>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="tableName"
|
||||
placeholder="Put your Table Name here..."
|
||||
label="Table Name"
|
||||
label-position="left"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<textarea-copyable :value="objectIdUTCDate" />
|
||||
<textarea-copyable :value="objectIdOutput" />
|
||||
<textarea-copyable :value="objectIdSyntaxOutput" />
|
||||
<textarea-copyable :value="objectIdQueryOutput" />
|
||||
</c-card>
|
||||
</template>
|
||||
Reference in new issue
Block a user