Compare commits
484 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00fd51a8e3 | ||
|
|
161b9e6bca | ||
|
|
f8b5cbfd87 | ||
|
|
1c35ac3704 | ||
|
|
72517002f3 | ||
|
|
f5c4ab19bc | ||
|
|
67094980c9 | ||
|
|
87984e2081 | ||
|
|
318fb6efb9 | ||
|
|
f1a5489e21 | ||
|
|
e1b4f9aafe | ||
|
|
76a19d218d | ||
|
|
b430baef40 | ||
|
|
dd4b7e687b | ||
|
|
30144aa3f5 | ||
|
|
e876d03608 | ||
|
|
81cf6b5483 | ||
|
|
a0bc3468b2 | ||
|
|
5a7b0f9636 | ||
|
|
b59942ad9f | ||
|
|
38d568798c | ||
|
|
9dfd347edf | ||
|
|
33e5294a94 | ||
|
|
2852c30e1f | ||
|
|
124284278f | ||
|
|
a7992340f7 | ||
|
|
2c2fb216e3 | ||
|
|
221ddfa75c | ||
|
|
cb5b462e11 | ||
|
|
9eac9cb2a9 | ||
|
|
23f82d956a | ||
|
|
d3b32cc14e | ||
|
|
fe349ad69b | ||
|
|
a07806cd15 | ||
|
|
10e56b35bb | ||
|
|
dc0461595f | ||
|
|
079aa2164c | ||
|
|
9c6b12225e | ||
|
|
7f5fa00147 | ||
|
|
1334bff30a | ||
|
|
95698cb938 | ||
|
|
85b50bb8f0 | ||
|
|
c65ffb6e75 | ||
|
|
693f362e15 | ||
|
|
fc06f01b34 | ||
|
|
c46207f1bb | ||
|
|
670f735501 | ||
|
|
a29ad66809 | ||
|
|
5ed36935c7 | ||
|
|
80e46c9292 | ||
|
|
7a70dbbe0c | ||
|
|
2e56641398 | ||
|
|
a1037cf8f1 | ||
|
|
0fe9a20329 | ||
|
|
2e396d8776 | ||
|
|
bd3edcb528 | ||
|
|
de1ee69ef9 | ||
|
|
8f99eb6017 | ||
|
|
38586caab7 | ||
|
|
043e4f0a08 | ||
|
|
ca43a25569 | ||
|
|
7fe47b3be4 | ||
|
|
16ffe6b5c9 | ||
|
|
478192065e | ||
|
|
205e360400 | ||
|
|
821cbea2bf | ||
|
|
093ff311fd | ||
|
|
e07e2ae5bc | ||
|
|
fe1de8c5c9 | ||
|
|
b2614990e3 | ||
|
|
79646375f3 | ||
|
|
7d94e11cee | ||
|
|
e87f4b1837 | ||
|
|
e86fd96ae3 | ||
|
|
58de8970f5 | ||
|
|
02b0d0d1a1 | ||
|
|
4d5a67d96d | ||
|
|
8174db9cf3 | ||
|
|
e164afb664 | ||
|
|
d0136962b9 | ||
|
|
015c673e09 | ||
|
|
99b1eb944d | ||
|
|
cc3425dc77 | ||
|
|
681f7bf644 | ||
|
|
f5eb7a8c49 | ||
|
|
abb8335041 | ||
|
|
020e9cbe41 | ||
|
|
02e68d3f56 | ||
|
|
00562ed5e8 | ||
|
|
4365226d01 | ||
|
|
57ecda1623 | ||
|
|
d8d7a3b9ab | ||
|
|
d36b18f193 | ||
|
|
eea9f91276 | ||
|
|
ebb4ec4165 | ||
|
|
84a4a646f6 | ||
|
|
a2b53c2e38 | ||
|
|
35563b8457 | ||
|
|
720201aa7b | ||
|
|
b2ad4f7a27 | ||
|
|
b408df82c1 | ||
|
|
88b881880c | ||
|
|
ee4c853b9f | ||
|
|
cbf58fdd28 | ||
|
|
a757a5155a | ||
|
|
025f556023 | ||
|
|
2d2dffb14a | ||
|
|
5c4d775e2d | ||
|
|
557b30426f | ||
|
|
4972159aa7 | ||
|
|
e371ef702e | ||
|
|
0eedce69a6 | ||
|
|
8a30b6bdb3 | ||
|
|
233d5565f6 | ||
|
|
7ab9204e96 | ||
|
|
c7d4562d3b | ||
|
|
18dd1400bd | ||
|
|
f035f485c0 | ||
|
|
e18bae1fca | ||
|
|
d1dff428d8 | ||
|
|
3a63837d3d | ||
|
|
81bfe57cb8 | ||
|
|
a9cd91ca9c | ||
|
|
06c35472d3 | ||
|
|
f3e14fc18f | ||
|
|
2274766a8f | ||
|
|
a346175d24 | ||
|
|
6f93cba3da | ||
|
|
76b2761d62 | ||
|
|
6ff9a01cc8 | ||
|
|
a2b9b157e5 | ||
|
|
144f86e2dc | ||
|
|
0f1f6590c5 | ||
|
|
2bcb77a9f9 | ||
|
|
c58d6e3423 | ||
|
|
f235dcd6c1 | ||
|
|
ba2c589f0f | ||
|
|
9bd4ad4dfd | ||
|
|
5e12991bcd | ||
|
|
65a9474078 | ||
|
|
85cc7a8447 | ||
|
|
4268e255de | ||
|
|
d1c888019b | ||
|
|
7924456cec | ||
|
|
99bc84c37e | ||
|
|
ea0f27cf4c | ||
|
|
cd5a503fc0 | ||
|
|
86e964a274 | ||
|
|
7b6232a151 | ||
|
|
56d74d07a8 | ||
|
|
e5d0ba7073 | ||
|
|
1a602365be | ||
|
|
a2494219a8 | ||
|
|
93f7cf0e98 | ||
|
|
dfa1ba8554 | ||
|
|
6498c9b0fa | ||
|
|
f40d7ecddf | ||
|
|
2e28c5073e | ||
|
|
d12dd40841 | ||
|
|
cf382b5a10 | ||
|
|
01525838e0 | ||
|
|
38cb61da4d | ||
|
|
354aed6e6f | ||
|
|
6b8682fd23 | ||
|
|
9e8349dbc4 | ||
|
|
f44050742d | ||
|
|
b0d9a3e6c7 | ||
|
|
30f88fc6a8 | ||
|
|
72c98a3c5e | ||
|
|
05ea545475 | ||
|
|
5c3bebfe62 | ||
|
|
8df7cd0f19 | ||
|
|
a9c7b89193 | ||
|
|
6bda2caa04 | ||
|
|
994a1c3401 | ||
|
|
05edaf423c | ||
|
|
8c72e692a7 | ||
|
|
cec9dea9e0 | ||
|
|
49eacea195 | ||
|
|
3f7d469e9f | ||
|
|
5f2190887d | ||
|
|
6cb0845336 | ||
|
|
12d9e5d377 | ||
|
|
e29b258e90 | ||
|
|
ea50a3fc65 | ||
|
|
746e5bdccc | ||
|
|
c7d4f112c0 | ||
|
|
9125dcf9c6 | ||
|
|
38710dce56 | ||
|
|
282cfc4c4b | ||
|
|
ba4876d0d5 | ||
|
|
363c2e47e6 | ||
|
|
9526ed8324 | ||
|
|
7068610438 | ||
|
|
847323ccba | ||
|
|
1b038c7826 | ||
|
|
ec4c533718 | ||
|
|
63045951e1 | ||
|
|
c4cec9e18f | ||
|
|
bcb98b359c | ||
|
|
732da08157 | ||
|
|
b9406a492d | ||
|
|
69f0bd079f | ||
|
|
4cbd7ac145 | ||
|
|
ebfb872fae | ||
|
|
a6bbeaebd8 | ||
|
|
f771e7a99f | ||
|
|
cf7b1f000a | ||
|
|
1e2a35b892 | ||
|
|
45c2474279 | ||
|
|
fe61f0f2f2 | ||
|
|
93799af83c | ||
|
|
962a6d6ec4 | ||
|
|
d2956b66fe | ||
|
|
105b21badc | ||
|
|
33c9b6643f | ||
|
|
4d2b037dbe | ||
|
|
34d8e5ce2c | ||
|
|
8515c24264 | ||
|
|
0b20f1c16a | ||
|
|
8c92d56318 | ||
|
|
7aed9c56fd | ||
|
|
f7fc779e63 | ||
|
|
b3b6b7c46b | ||
|
|
141c12455e | ||
|
|
77f2efc0b9 | ||
|
|
aad8d84e13 | ||
|
|
401f13f7e3 | ||
|
|
edae4c6915 | ||
|
|
a43c546e34 | ||
|
|
83a7b3bae9 | ||
|
|
ce3150c65d | ||
|
|
3f6c8f0edd | ||
|
|
daf2cf0285 | ||
|
|
b7aaea1b58 | ||
|
|
92bd83536f | ||
|
|
e88c1d5f2c | ||
|
|
362f2fa280 | ||
|
|
61ece2387f | ||
|
|
f080933d2a | ||
|
|
bb32513bd3 | ||
|
|
c311e3824d | ||
|
|
74073f5038 | ||
|
|
c45bce36f9 | ||
|
|
df989e24b3 | ||
|
|
6d2202597c | ||
|
|
c68a1fd713 | ||
|
|
46b1a07213 | ||
|
|
dbad7730f9 | ||
|
|
85cb0ffabd | ||
|
|
8355bd2ae4 | ||
|
|
6fb4994603 | ||
|
|
7d7cc99866 | ||
|
|
dce9ff91e2 | ||
|
|
80401b6405 | ||
|
|
fd9ab59172 | ||
|
|
5fa811a583 | ||
|
|
c0a89131dd | ||
|
|
05f06f6a07 | ||
|
|
9fa4c26929 | ||
|
|
9d639edf2d | ||
|
|
a1e983538c | ||
|
|
1d7f8b9a8c | ||
|
|
ec7cb9351c | ||
|
|
ebfdb64fde | ||
|
|
d2a2686705 | ||
|
|
d7a503b4ae | ||
|
|
28145e0ffe | ||
|
|
8930e139b2 | ||
|
|
076df11024 | ||
|
|
1060652590 | ||
|
|
f5c865b278 | ||
|
|
001031b7b5 | ||
|
|
4ccd73c2d1 | ||
|
|
2293f63a79 | ||
|
|
0161395585 | ||
|
|
4d011f15a1 | ||
|
|
4a1afb2b69 | ||
|
|
f350dc19aa | ||
|
|
f3480fe560 | ||
|
|
f68e859c20 | ||
|
|
4872d71165 | ||
|
|
fb8a3a0fee | ||
|
|
20282987e3 | ||
|
|
ff5f38bec6 | ||
|
|
6e84ea4061 | ||
|
|
004cb83719 | ||
|
|
aa4dc0418e | ||
|
|
a599528044 | ||
|
|
b3390f6ff7 | ||
|
|
dee5586bf5 | ||
|
|
5281824b5d | ||
|
|
15cb03347c | ||
|
|
24ba0ff5fa | ||
|
|
849981d1ec | ||
|
|
3b625fd473 | ||
|
|
863c8d0f6a | ||
|
|
9b4f7727f2 | ||
|
|
cf16cb195d | ||
|
|
f6237376e1 | ||
|
|
165dc93f83 | ||
|
|
161a21f285 | ||
|
|
972ffe6f69 | ||
|
|
c339ab3551 | ||
|
|
47948dd343 | ||
|
|
91369cb238 | ||
|
|
ffb99579ba | ||
|
|
f512d09227 | ||
|
|
7c40539ef9 | ||
|
|
f3b1863f09 | ||
|
|
b1d6bfd2dc | ||
|
|
8787ce72ab | ||
|
|
dab8d63390 | ||
|
|
96aaa35ea2 | ||
|
|
519b169336 | ||
|
|
3bc1f0d1fa | ||
|
|
b519cc9574 | ||
|
|
30e9149d61 | ||
|
|
7958e2e075 | ||
|
|
61024279b5 | ||
|
|
ad202bd372 | ||
|
|
400654b6b1 | ||
|
|
3351b70c1a | ||
|
|
53ce079dff | ||
|
|
a771346250 | ||
|
|
a312dedf65 | ||
|
|
0ddf18f4b5 | ||
|
|
9634f5d9a8 | ||
|
|
e6c0445684 | ||
|
|
32f87f3fca | ||
|
|
a3b1cb5737 | ||
|
|
6fe4b5ac60 | ||
|
|
1a3f0a135d | ||
|
|
072083832d | ||
|
|
c934c4e50c | ||
|
|
4a5734d4a3 | ||
|
|
f708f5091e | ||
|
|
db817a2459 | ||
|
|
119041c185 | ||
|
|
4607837f9a | ||
|
|
f52f7a845c | ||
|
|
acc7f0a586 | ||
|
|
ebb7301a98 | ||
|
|
def60e7248 | ||
|
|
bf88836dbe | ||
|
|
bfc2e24bbf | ||
|
|
40872859a5 | ||
|
|
cf723f144e | ||
|
|
7f964941d3 | ||
|
|
af075dcccc | ||
|
|
274ff02b54 | ||
|
|
679dd1c1f6 | ||
|
|
4cd809bd0c | ||
|
|
8d09086e78 | ||
|
|
acf8bc11db | ||
|
|
71e98e93e5 | ||
|
|
1b5d4e72bd | ||
|
|
8476cf319b | ||
|
|
0ff853437b | ||
|
|
39c8f92065 | ||
|
|
35b5187119 | ||
|
|
94698cea50 | ||
|
|
8294cd68da | ||
|
|
7c9b8ac178 | ||
|
|
5d8f46abf8 | ||
|
|
35a3760771 | ||
|
|
4ef25887b9 | ||
|
|
7f229959d6 | ||
|
|
d3a2936979 | ||
|
|
5f16885923 | ||
|
|
ea5e7a7fc7 | ||
|
|
7de6c86f9e | ||
|
|
83da6b7ee9 | ||
|
|
737319edf1 | ||
|
|
a77a82f5a2 | ||
|
|
da17696293 | ||
|
|
164e32b442 | ||
|
|
49755909bd | ||
|
|
44d653b1f2 | ||
|
|
7c449f4f2d | ||
|
|
ab7483b5c2 | ||
|
|
5222bd5d04 | ||
|
|
cf5e4d9056 | ||
|
|
992f96b48a | ||
|
|
fcf4cfe64d | ||
|
|
f54223fb0a | ||
|
|
b38ab82d05 | ||
|
|
f6cd9b76d3 | ||
|
|
208a373fd0 | ||
|
|
8089c60000 | ||
|
|
d30cd8a9ab | ||
|
|
04a8e122be | ||
|
|
447bdf2148 | ||
|
|
ca7cb44389 | ||
|
|
e48d60b1ed | ||
|
|
fda0b0ca25 | ||
|
|
cc717bc87e | ||
|
|
1bc6380c6f | ||
|
|
02c4963531 | ||
|
|
129f74c371 | ||
|
|
0be33fb337 | ||
|
|
422b6eb05a | ||
|
|
fad4833ca2 | ||
|
|
531a25c1c4 | ||
|
|
77b5b0cab5 | ||
|
|
7570ad9656 | ||
|
|
8a9e7888de | ||
|
|
750a76b00f | ||
|
|
5f03619ab4 | ||
|
|
352365f012 | ||
|
|
4f599b6999 | ||
|
|
138149e6f0 | ||
|
|
412de23796 | ||
|
|
1a22d55b3c | ||
|
|
bb4aac6d4a | ||
|
|
e6953d1b67 | ||
|
|
a70a0f83a1 | ||
|
|
bdee93a9e4 | ||
|
|
08ce407a01 | ||
|
|
125a50215a | ||
|
|
d5738e1aef | ||
|
|
560fcf3f78 | ||
|
|
328fda65b3 | ||
|
|
ba87097e3d | ||
|
|
99383d25fc | ||
|
|
d1f95f5b34 | ||
|
|
6cd25a743e | ||
|
|
d2f5d3c3de | ||
|
|
130031c225 | ||
|
|
1c7257eeb0 | ||
|
|
214084262c | ||
|
|
92ce419f45 | ||
|
|
394d085846 | ||
|
|
ab53048d5f | ||
|
|
c3a302bc38 | ||
|
|
a16161cdb4 | ||
|
|
1dc113aaef | ||
|
|
e371e8fedf | ||
|
|
e7997457a8 | ||
|
|
c4f9e90cc7 | ||
|
|
eff7c23ebb | ||
|
|
7a01af1c14 | ||
|
|
c2e1d59cb9 | ||
|
|
f48cd058cf | ||
|
|
5ab4dd3d4a | ||
|
|
f05c8e1dc6 | ||
|
|
ba3b84c668 | ||
|
|
433ba2a3e5 | ||
|
|
8fb0e6af9c | ||
|
|
11720e6cde | ||
|
|
ac89490794 | ||
|
|
2f61c745f5 | ||
|
|
a9a6526e75 | ||
|
|
af0b02d3a8 | ||
|
|
a46d125c19 | ||
|
|
6becdbb423 | ||
|
|
5ce1262fb4 | ||
|
|
d591a73ce7 | ||
|
|
a88e4a9289 | ||
|
|
d4ea393c1d | ||
|
|
048bc4ae94 | ||
|
|
3aefe83a31 | ||
|
|
c3b6132c26 | ||
|
|
69f564e6fe | ||
|
|
e9cc499ed8 | ||
|
|
383d975695 | ||
|
|
347144bfe8 | ||
|
|
4c4da16970 | ||
|
|
9450537bae | ||
|
|
1d7032d026 | ||
|
|
d2c767f092 | ||
|
|
0cc7af6b1d | ||
|
|
34bc6a57a7 | ||
|
|
d356b1488f | ||
|
|
a60f64f744 | ||
|
|
b89db3c8d0 | ||
|
|
3cfc5f8bc2 | ||
|
|
9da56da096 | ||
|
|
9755e51fe2 | ||
|
|
0b0cbd55c3 | ||
|
|
e21230bbd9 | ||
|
|
84cf1bb964 | ||
|
|
b64839cb73 | ||
|
|
608ec3a81d |
@@ -1,30 +0,0 @@
|
||||
/* eslint-env node */
|
||||
require('@rushstack/eslint-patch/modern-module-resolution');
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'plugin:vue/vue3-recommended',
|
||||
'plugin:vue/vue3-recommended',
|
||||
'@vue/eslint-config-typescript/recommended',
|
||||
'@vue/eslint-config-prettier',
|
||||
],
|
||||
env: {
|
||||
'vue/setup-compiler-macros': true,
|
||||
},
|
||||
rules: {
|
||||
'vue/multi-word-component-names': ['off'],
|
||||
'prettier/prettier': [
|
||||
'error',
|
||||
{
|
||||
singleQuote: true,
|
||||
semi: true,
|
||||
tabWidth: 2,
|
||||
trailingComma: 'all',
|
||||
printWidth: 120,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
48
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: 🐞 Bug Report
|
||||
description: File a bug report.
|
||||
labels: ['bug', 'triage']
|
||||
assignees:
|
||||
- CorentinTh
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report!
|
||||
|
||||
- type: textarea
|
||||
id: bug-description
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
|
||||
placeholder: Bug description
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: Also tell us, what did you expect to happen? If you have a screenshot, you can paste it here.
|
||||
placeholder: Tell us what you see!
|
||||
value: 'A bug happened!'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: version
|
||||
attributes:
|
||||
label: System information
|
||||
description: What is you environment? You can use the `npx envinfo --system --browsers` command to get this information.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: app-type
|
||||
attributes:
|
||||
label: Where did you encounter the bug?
|
||||
options:
|
||||
- Public app (it-tools.tech)
|
||||
- A self hosted
|
||||
- Other (installations, docker, etc.)
|
||||
validations:
|
||||
required: true
|
||||
33
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,33 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG] "
|
||||
labels: bug
|
||||
assignees: CorentinTh
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Configuration (please complete the following information):**
|
||||
- Device: [e.g. iPhone6, ]
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
||||
56
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: 🚀 New feature proposal
|
||||
description: Propose a new feature/enhancement or tool idea for IT-Tools
|
||||
labels: ['enhancement', 'triage']
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for your interest in the project and taking the time to fill out this feature report!
|
||||
|
||||
- type: dropdown
|
||||
id: request-type
|
||||
attributes:
|
||||
label: What type of request is this?
|
||||
options:
|
||||
- New tool idea
|
||||
- New feature for an existing tool
|
||||
- Deployment or CI/CD improvement
|
||||
- Self-hosting improvement
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: feature-description
|
||||
attributes:
|
||||
label: Clear and concise description of the feature you are proposing
|
||||
description: A clear and concise description of what the feature is.
|
||||
placeholder: 'Example: a token generator tool'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: alternative
|
||||
attributes:
|
||||
label: Is their example of this tool in the wild?
|
||||
description: Provide link to already existing tool (like websites, apps, cli, ...) or npm packages that could be used or provide inspiration for the feature.
|
||||
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Any other context or screenshots about the feature request here.
|
||||
|
||||
- type: checkboxes
|
||||
id: checkboxes
|
||||
attributes:
|
||||
label: Validations
|
||||
description: Before submitting the issue, please make sure you do the following
|
||||
options:
|
||||
- label: Check the feature is not already implemented in the project.
|
||||
required: true
|
||||
- label: Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
|
||||
required: true
|
||||
- label: Check that the feature can be implemented in a client side only app (IT-Tools is client side only, no server).
|
||||
required: true
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[FEAT]"
|
||||
labels: enhancement
|
||||
assignees: CorentinTh
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
25
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<!-- Thank you for contributing! -->
|
||||
|
||||
### Description
|
||||
|
||||
<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->
|
||||
|
||||
### Additional context
|
||||
|
||||
<!-- e.g. is there anything you'd like reviewers to focus on? -->
|
||||
|
||||
---
|
||||
|
||||
### What is the purpose of this pull request? <!-- (put an "X" next to an item) -->
|
||||
|
||||
- [ ] Bug fix
|
||||
- [ ] New Feature
|
||||
- [ ] Documentation update
|
||||
- [ ] Other
|
||||
|
||||
### Before submitting the PR, please make sure you do the following
|
||||
|
||||
- [ ] Submit the PR against the `dev` branch.
|
||||
- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
|
||||
- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
|
||||
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
|
||||
BIN
.github/logo.png
vendored
|
Before Width: | Height: | Size: 7.8 KiB |
17
.github/stale.yml
vendored
@@ -1,17 +0,0 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
43
.github/workflows/cd-app-prod.yaml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: CD - Production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- next
|
||||
|
||||
jobs:
|
||||
publish-app-prod:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
name: Publish app to production
|
||||
steps:
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
corepack: true
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
|
||||
- name: Build the app
|
||||
run: pnpm -F @it-tools/app build
|
||||
|
||||
- name: Publish to Cloudflare Pages
|
||||
uses: AdrianGonz97/refined-cf-pages-action@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectName: it-tools
|
||||
workingDirectory: packages/app
|
||||
directory: dist
|
||||
deploymentName: Production App
|
||||
branch: next
|
||||
wranglerVersion: '3'
|
||||
|
||||
|
||||
38
.github/workflows/ci.yml
vendored
@@ -1,38 +1,34 @@
|
||||
name: ci
|
||||
|
||||
on: push
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
- uses: actions/checkout@v4
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup node env
|
||||
uses: actions/setup-node@v3.0.0
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
run: pnpm i
|
||||
|
||||
- name: Run linters
|
||||
run: npm run lint
|
||||
run: pnpm lint
|
||||
|
||||
- name: Run unit test
|
||||
run: npm run test
|
||||
run: pnpm test
|
||||
|
||||
- name: Type check
|
||||
run: pnpm typecheck
|
||||
|
||||
- name: Build the app
|
||||
run: npm run build
|
||||
run: pnpm build
|
||||
|
||||
69
.github/workflows/codeql-analysis.yml
vendored
@@ -1,69 +0,0 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ dev ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ dev ]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
48
.gitignore
vendored
@@ -1,28 +1,32 @@
|
||||
# Nuxt dev/build outputs
|
||||
.output
|
||||
.data
|
||||
.nuxt
|
||||
.nitro
|
||||
.cache
|
||||
dist
|
||||
dist-app
|
||||
dist-node
|
||||
dist-cloudflare
|
||||
|
||||
# Node dependencies
|
||||
node_modules
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
# Misc
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.fleet
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# Local env files
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
.wrangler
|
||||
coverage
|
||||
cache
|
||||
.zed
|
||||
|
||||
14
.versionrc
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"types": [
|
||||
{"type": "feat", "section": "Features"},
|
||||
{"type": "fix", "section": "Bug Fixes"},
|
||||
{"type": "docs", "section": "Documentation"},
|
||||
{"type": "style", "section": "Styling"},
|
||||
{"type": "refactor", "section": "Refactors"},
|
||||
{"type": "perf", "section": "Performance"},
|
||||
{"type": "test", "section": "Tests"},
|
||||
{"type": "build", "section": "Build System"},
|
||||
{"type": "ci", "section": "CI"},
|
||||
{"type": "revert", "section": "Reverts"}
|
||||
]
|
||||
}
|
||||
3
.vscode/extensions.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"recommendations": ["johnsoncodehk.volar", "johnsoncodehk.vscode-typescript-vue-plugin"]
|
||||
}
|
||||
187
CHANGELOG.md
@@ -1,187 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [2.3.0](https://github.com/CorentinTh/it-tools/compare/v2.2.0...v2.3.0) (2022-04-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **new-tool:** html entities escape/unescape ([8e29a97](https://github.com/CorentinTh/it-tools/commit/8e29a97404ea0aa9b9b576656358c8c276b6f992))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **head:** added titles for non-tool pages ([0a15892](https://github.com/CorentinTh/it-tools/commit/0a15892dde9852ff158a8fcb72d0ad6bae8bad02))
|
||||
* **sider:** default collapsed value ([b22aa94](https://github.com/CorentinTh/it-tools/commit/b22aa941f52009118d4d3cc98277cc4c402a4c77))
|
||||
* **sider:** missing href for link in footer ([c4dabcc](https://github.com/CorentinTh/it-tools/commit/c4dabccdaeac9d03163ac2588599b000e4e74562))
|
||||
* **style:** hard width for group labels ([ebf6695](https://github.com/CorentinTh/it-tools/commit/ebf6695d2533db6f37b24dc7d338f422c551c8cb))
|
||||
* **url-parser:** cleaned weird margins on dark mode ([005ebfb](https://github.com/CorentinTh/it-tools/commit/005ebfba318ece1a9c04aefb737baed5d7aafb91))
|
||||
|
||||
|
||||
### Refactors
|
||||
|
||||
* **lint:** linter auto fix ([086d31e](https://github.com/CorentinTh/it-tools/commit/086d31eab5b3b1a927803eab5e650585f61abe19))
|
||||
* removed useless ref and value ([b12cbe4](https://github.com/CorentinTh/it-tools/commit/b12cbe412407389186a58e4ceaa94f5b441c11ea))
|
||||
|
||||
### [2.2.1](https://github.com/CorentinTh/it-tools/compare/v2.2.0...v2.2.1) (2022-04-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **head:** added titles for non-tool pages ([0a15892](https://github.com/CorentinTh/it-tools/commit/0a15892dde9852ff158a8fcb72d0ad6bae8bad02))
|
||||
* **sider:** missing href for link in footer ([c4dabcc](https://github.com/CorentinTh/it-tools/commit/c4dabccdaeac9d03163ac2588599b000e4e74562))
|
||||
* **style:** hard width for group labels ([ebf6695](https://github.com/CorentinTh/it-tools/commit/ebf6695d2533db6f37b24dc7d338f422c551c8cb))
|
||||
* **url-parser:** cleaned weird margins on dark mode ([005ebfb](https://github.com/CorentinTh/it-tools/commit/005ebfba318ece1a9c04aefb737baed5d7aafb91))
|
||||
|
||||
## [2.2.0](https://github.com/CorentinTh/it-tools/compare/v2.1.0...v2.2.0) (2022-04-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **new-tool:** url parser ([2b38d6f](https://github.com/CorentinTh/it-tools/commit/2b38d6f81e34845f896b858513e35209cba29f98))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **sider-footer:** fixed commit sha url ([ed9046d](https://github.com/CorentinTh/it-tools/commit/ed9046d3e1f5a7dc01c722ed139a2ae477a2d48f))
|
||||
|
||||
## [2.1.0](https://github.com/CorentinTh/it-tools/compare/v2.0.2...v2.1.0) (2022-04-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **new-tool:** bcrypt ([6d5856f](https://github.com/CorentinTh/it-tools/commit/6d5856fa93d1ffbf71856c75adc24ad87dc4b49b))
|
||||
* **new-tool:** device information ([277bd5f](https://github.com/CorentinTh/it-tools/commit/277bd5f0da359fd54c5164b376007d182a9fabde))
|
||||
|
||||
|
||||
### Refactors
|
||||
|
||||
* **menu:** removed burger menu icon tooltip ([09abffb](https://github.com/CorentinTh/it-tools/commit/09abffbcf9b09cb5adc34f8754b019d0c8b60854))
|
||||
|
||||
### [2.0.2](https://github.com/CorentinTh/it-tools/compare/v2.0.1...v2.0.2) (2022-04-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **git-memo:** pre scroll on overflow ([4fc303e](https://github.com/CorentinTh/it-tools/commit/4fc303e5e3f0bef9201cc002963e244a5d3be7b5))
|
||||
* **menu:** menu auto closed on mobile ([71f79a5](https://github.com/CorentinTh/it-tools/commit/71f79a5bbfe0dd5451a435c0a55e8b77ee7d3848))
|
||||
* **qr-code:** responsive layout ([cbf0b3d](https://github.com/CorentinTh/it-tools/commit/cbf0b3d6995e47d371a8fbcfccd65ba304fb08dc))
|
||||
|
||||
|
||||
### Refactors
|
||||
|
||||
* **crontab:** list instead of table on small screen ([6b11de2](https://github.com/CorentinTh/it-tools/commit/6b11de258a8039fe7729130ede35d47592be7cbe))
|
||||
* removed empty sources ([a14cac6](https://github.com/CorentinTh/it-tools/commit/a14cac6d5c5967a47ca76a1d1a420115114c3bbf))
|
||||
* throw an error object instead of string ([4112fa5](https://github.com/CorentinTh/it-tools/commit/4112fa532e3d4be190d52bf3b11e0d4c3625a402))
|
||||
|
||||
### [2.0.1](https://github.com/CorentinTh/it-tools/compare/v2.0.0...v2.0.1) (2022-04-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** added vercel.json ([2e046ad](https://github.com/CorentinTh/it-tools/commit/2e046ad09fed4a55bbf4449e3683a4150839c461))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove duplicate property ([d066319](https://github.com/CorentinTh/it-tools/commit/d066319b45dee35df0212c7ff407013bd7449ae3))
|
||||
* **style:** url encode/decode layout ([34480b4](https://github.com/CorentinTh/it-tools/commit/34480b4e25ffc33536b03a0ba711c480219ad553))
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
* updated description ([70a3df0](https://github.com/CorentinTh/it-tools/commit/70a3df044ea86ac35c1839ac5ab624f694fdd845))
|
||||
|
||||
|
||||
### Refactors
|
||||
|
||||
* clean imports ([724e142](https://github.com/CorentinTh/it-tools/commit/724e142222202798ea3df7d0fb34da1e7a5216a1))
|
||||
* lint fix ([a58ae24](https://github.com/CorentinTh/it-tools/commit/a58ae24d9409728ac12fb780f2c64643087de5be))
|
||||
* ref name ([5828085](https://github.com/CorentinTh/it-tools/commit/582808597c6aadf0feb48f6aae0a29b839e0dd54))
|
||||
|
||||
## 2.0.0 (2022-04-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **a11y:** aria-label on icon button ([5f50275](https://github.com/CorentinTh/it-tools/commit/5f502755d69ab21a78d9256db8a1c64f1ab82c2a))
|
||||
* added commit short sha ([668625c](https://github.com/CorentinTh/it-tools/commit/668625c6dab6e8b98f363df6c0aa3bf00a3afaa4))
|
||||
* added plausible tracker ([0808920](https://github.com/CorentinTh/it-tools/commit/0808920951b55c938537f33353a37ece96b04084))
|
||||
* added twitter link ([d126abc](https://github.com/CorentinTh/it-tools/commit/d126abc7b12a9fce778fe9883e44dca581509778))
|
||||
* footer in sider ([3f03850](https://github.com/CorentinTh/it-tools/commit/3f038503dd705ba3a5562a1e8f85a3b0e7d0be5b))
|
||||
* **layout:** menu category ([9c9be9e](https://github.com/CorentinTh/it-tools/commit/9c9be9e2e2e2c856d1af1df9d9d37a64460cd82b))
|
||||
* mobile friendly menu ([1e67fa6](https://github.com/CorentinTh/it-tools/commit/1e67fa6e0bede8c055d9e4cb9bf7f97423bc9bdf))
|
||||
* **navbar:** added github link ([d4e226e](https://github.com/CorentinTh/it-tools/commit/d4e226e09face78da794fa7e676eef85d05dde75))
|
||||
* **nav:** navigation tooltips ([b892f50](https://github.com/CorentinTh/it-tools/commit/b892f50cd633d42e6261be208bd077d92d336afb))
|
||||
* **page:** added 404 page ([3db4f91](https://github.com/CorentinTh/it-tools/commit/3db4f91c27a2ab37bb23d8feb77b6dffa9a92977))
|
||||
* **page:** home page layout ([57fd14a](https://github.com/CorentinTh/it-tools/commit/57fd14a199a253f49f3c53810490e5d31512b261))
|
||||
* persistent theme selection fallback to prefered theme ([40e9af0](https://github.com/CorentinTh/it-tools/commit/40e9af06cf28b7348152f8ec3898fa2b27ec0b21))
|
||||
* **router:** added legacy routes redirections ([dbce46b](https://github.com/CorentinTh/it-tools/commit/dbce46b470b0187a395cdd350a023641c6319582))
|
||||
* search-bar ([e8594de](https://github.com/CorentinTh/it-tools/commit/e8594de7b45102b8bc1cfb82d0839e3722d9c4c2))
|
||||
* **search:** round and clearable searchbar ([b112f5f](https://github.com/CorentinTh/it-tools/commit/b112f5f226c6b03151bbeb4fc607e449c444e667))
|
||||
* **seo:** added robots.txt and humans.txt ([cd9a3bc](https://github.com/CorentinTh/it-tools/commit/cd9a3bc9b10cf7363301e9a0d0b17f38ea640e0c))
|
||||
* **seo:** added title + description ([5f74037](https://github.com/CorentinTh/it-tools/commit/5f74037105c5e8efc5bdad2261597458cfcf26d3))
|
||||
* **seo:** pwa and icons ([b7193e8](https://github.com/CorentinTh/it-tools/commit/b7193e838ba83d0548211cff922e107a1f11f90f))
|
||||
* **share:** social image ([39746e0](https://github.com/CorentinTh/it-tools/commit/39746e07c53c22ac132ad2aaf25dd71bb6458cde))
|
||||
* **style:** dark mode ([3e92b7f](https://github.com/CorentinTh/it-tools/commit/3e92b7f1e04a709df231fce22801b55619e8faab))
|
||||
* **style:** theme overrides ([d542688](https://github.com/CorentinTh/it-tools/commit/d542688664cc9c675d1d26f4278a25f1b9e3f28d))
|
||||
* **tool:** add lch in color converter ([b5243c4](https://github.com/CorentinTh/it-tools/commit/b5243c43638f37a2d727b015bba61fab0d1b9fe9))
|
||||
* **tool:** added token generator ([40dec52](https://github.com/CorentinTh/it-tools/commit/40dec52c8467fd27eb8f3857ed72746ebaa4f509))
|
||||
* **tool:** base converter ([034c686](https://github.com/CorentinTh/it-tools/commit/034c686896d0443ea587cd152535b2227234c011))
|
||||
* **tool:** base64 string converter ([203b6a9](https://github.com/CorentinTh/it-tools/commit/203b6a9d73dcb30182b130de59920534e18b76b4))
|
||||
* **tool:** bip39-generator ([d55329f](https://github.com/CorentinTh/it-tools/commit/d55329f3abc3d3f8ad48def7d7f63b44cd768e27))
|
||||
* **tool:** bip39-generator ([765c010](https://github.com/CorentinTh/it-tools/commit/765c010700c07b2809daef0e7c694ac265ce9ddc))
|
||||
* **tool:** case converter ([7a7372d](https://github.com/CorentinTh/it-tools/commit/7a7372df191abc7ecd3fee7234d4de7aaaba03f6))
|
||||
* **tool:** color converter ([4e50b7a](https://github.com/CorentinTh/it-tools/commit/4e50b7a973e950819a52c127db2a754838cbbf8e))
|
||||
* **tool:** crontab generator ([358ff45](https://github.com/CorentinTh/it-tools/commit/358ff45ae1d9822b8a7c342515f668d25b7128b5))
|
||||
* **tool:** date-time converter ([2d9cb20](https://github.com/CorentinTh/it-tools/commit/2d9cb209b377326f4bf62067db7d5ad0c7eb7bde))
|
||||
* **tool:** encryption ([888ab2c](https://github.com/CorentinTh/it-tools/commit/888ab2cf378597e2880b6dd6a013f3bc192f2b1a))
|
||||
* **tool:** git memo ([5cd9997](https://github.com/CorentinTh/it-tools/commit/5cd9997a845f6d5f82d3ae74d3ec12603224517d))
|
||||
* **tool:** lorem ipsum generator ([5dcb2ed](https://github.com/CorentinTh/it-tools/commit/5dcb2ed95c318ea1c4134da207c844672d0fbbd8))
|
||||
* **tool:** qr-code generator ([5582d75](https://github.com/CorentinTh/it-tools/commit/5582d75927b560d9259929c787c0809634d1f8ae))
|
||||
* **tool:** random port generator ([7c540f1](https://github.com/CorentinTh/it-tools/commit/7c540f1208da749c3932aab8f2c392048c4546ae))
|
||||
* **tool:** roman-arabic numbers converter ([655019c](https://github.com/CorentinTh/it-tools/commit/655019cf23babcec2a2f1e03cac87744e3139304))
|
||||
* **tool:** text hash ([0f3b744](https://github.com/CorentinTh/it-tools/commit/0f3b7445ad1f945d9b364476147bf824ac309a6c))
|
||||
* **tool:** text statistics ([0a7c325](https://github.com/CorentinTh/it-tools/commit/0a7c3252e36a4769eedaaec4524b4ee2ae2b19c7))
|
||||
* **tool:** url encode/decode ([afac566](https://github.com/CorentinTh/it-tools/commit/afac5664c802c8480fe2c457bcfb7f5e26829cdf))
|
||||
* **tool:** uuid v4 generator ([3ae6114](https://github.com/CorentinTh/it-tools/commit/3ae61147a94791987e9e326b19063579976d8dc0))
|
||||
* **ux:** copyable input ([1859a9a](https://github.com/CorentinTh/it-tools/commit/1859a9a174010789dcd7ecefb2451e1de7b60b4c))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **hash-text:** added missing toString() ([4ca5fce](https://github.com/CorentinTh/it-tools/commit/4ca5fce911c3312d56bca1ffba863b2f37841c9e))
|
||||
* **hash-text:** correct copy message ([bab92ef](https://github.com/CorentinTh/it-tools/commit/bab92ef84f66372df40ce385c2949518ed158427))
|
||||
* removed global define ([889d594](https://github.com/CorentinTh/it-tools/commit/889d59499212a449ee460c68c480648e337a7ecb))
|
||||
* **style:** working dark mode persistence ([3ae8728](https://github.com/CorentinTh/it-tools/commit/3ae872847b00d65e4e2e629775d479a3333450f1))
|
||||
* **validation:** proper rules ([11d8110](https://github.com/CorentinTh/it-tools/commit/11d8110226e22e30ae16d297628c1d252a93be9e))
|
||||
|
||||
|
||||
### Refactors
|
||||
|
||||
* better icon ([0af7d81](https://github.com/CorentinTh/it-tools/commit/0af7d81abd987aa5d1b0321c25a65131d978e929))
|
||||
* **clean:** removed extra console.log ([82606f6](https://github.com/CorentinTh/it-tools/commit/82606f6a477fce2041ab33adc7e95bcba4343e2b))
|
||||
* embeded sider scrollbar ([f872972](https://github.com/CorentinTh/it-tools/commit/f872972e69aeb4fde4c17f0c122ca3fd4aa1c56c))
|
||||
* icon sizes ([9bb7fc4](https://github.com/CorentinTh/it-tools/commit/9bb7fc47aa70bdc5083d0883f1496fac63f812ea))
|
||||
* menu option key ([390ef93](https://github.com/CorentinTh/it-tools/commit/390ef93232dc1b448022a0c09d36367adad9d221))
|
||||
* **page:** removed unused import ([f70fce6](https://github.com/CorentinTh/it-tools/commit/f70fce65e20989eb19b0f0976e756a43edf02e9d))
|
||||
* removed theme editor ([8559fbd](https://github.com/CorentinTh/it-tools/commit/8559fbd7744fe82b7702a5c0eb77a8d627c5a73d))
|
||||
* removed unused files ([c1e7669](https://github.com/CorentinTh/it-tools/commit/c1e76695e4a16b8312ab6031a1bdfb6368946677))
|
||||
* removed unused files ([8d9f924](https://github.com/CorentinTh/it-tools/commit/8d9f92417744a5fbd9b4108e851005f23de18b53))
|
||||
* **style:** cleaner layout ([1d09a01](https://github.com/CorentinTh/it-tools/commit/1d09a01bb25088493cc9b7f2cb7f8a8aa69ac9e9))
|
||||
* **style:** improve style for tool-card ([65a6896](https://github.com/CorentinTh/it-tools/commit/65a6896563d16f30420424e274bd306e3e9182c8))
|
||||
* **style:** label width ([fd4426d](https://github.com/CorentinTh/it-tools/commit/fd4426d246ada553528759f761c8192df85c0d44))
|
||||
* **style:** menu item height ([8951e87](https://github.com/CorentinTh/it-tools/commit/8951e87c143fda74be32bae5b28e009556d7086e))
|
||||
* **style:** menu scrollbar ([483cf66](https://github.com/CorentinTh/it-tools/commit/483cf66db992169d361487c8461938810793b978))
|
||||
* **style:** port display ([2632f24](https://github.com/CorentinTh/it-tools/commit/2632f24cc89af7dd12f7a0c1a8b58983a1bb78d8))
|
||||
* **style:** removed extra br ([b44539c](https://github.com/CorentinTh/it-tools/commit/b44539c1820defbaaa6dfe83a76c72982a641971))
|
||||
* **style:** replaced scss style block to less ([655d9d2](https://github.com/CorentinTh/it-tools/commit/655d9d22e3136bdf1dee29310ab04cf38596bdc8))
|
||||
* **style:** responsive layout ([2df3f53](https://github.com/CorentinTh/it-tools/commit/2df3f53b78bbe419763fd359788a4b0b5710e4b7))
|
||||
* **style:** updated linter config ([6b58ec5](https://github.com/CorentinTh/it-tools/commit/6b58ec554a0de91139f16d67cec42536d093d5fb))
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
* added new tool creation procedure ([8177883](https://github.com/CorentinTh/it-tools/commit/81778834e6a79725c42eae1772935682ce7580c6))
|
||||
* updated readme ([1134e0b](https://github.com/CorentinTh/it-tools/commit/1134e0b822edbc25ce9ff83007bf5d331a1becbd))
|
||||
74
README.md
@@ -1,73 +1 @@
|
||||

|
||||
|
||||
Useful tools for developer and people working in IT. [Have a look !](https://it-tools.tech).
|
||||
|
||||
## Functionalities and roadmap
|
||||
|
||||
Please check the [issues](https://github.com/CorentinTh/it-tools/issues) to see if some feature listed to be implemented.
|
||||
|
||||
You have an idea of a tool? Submit a [feature request](https://github.com/CorentinTh/it-tools/issues/new?assignees=corentinth&labels=&template=feature_request.md&title=)!
|
||||
|
||||
## Contribute
|
||||
|
||||
### Recommended IDE Setup
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin).
|
||||
|
||||
### Node version
|
||||
|
||||
Ensure you have the correct node/npm version
|
||||
|
||||
```sh
|
||||
nvm use
|
||||
```
|
||||
|
||||
### Project Setup
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
#### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
#### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
#### Run Unit Tests with [Vitest](https://vitest.dev/)
|
||||
|
||||
```sh
|
||||
npm run test
|
||||
```
|
||||
|
||||
#### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Create a new tool
|
||||
|
||||
To create a new tool, there is a script that generate the boilerplate of the new tool, simply run:
|
||||
|
||||
```sh
|
||||
node scripts/create-tool.mjs my-tool-name
|
||||
```
|
||||
|
||||
It will create a directory in `src/tools` with the correct files, and a the import in `src/tools/index.ts`. You will just need to add the inported tool in the proper category and develop the tool.
|
||||
|
||||
## Credits
|
||||
|
||||
Coded with ❤️ by [Corentin Thomasset](//corentin-thomasset.fr).
|
||||
|
||||
This project is continuously deployed using [vercel.com](https://vercel.com).
|
||||
|
||||
## License
|
||||
|
||||
This project is under the [MIT license](LICENSE).
|
||||
# IT-Tools
|
||||
|
||||
14
env.d.ts
vendored
@@ -1,14 +0,0 @@
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference types="vite-svg-loader" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
VITE_PLAUSIBLE_API_HOST: string;
|
||||
VITE_PLAUSIBLE_DOMAIN: string;
|
||||
PACKAGE_VERSION: string;
|
||||
GIT_SHORT_SHA: string;
|
||||
PROD: boolean;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
38
index.html
@@ -1,38 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Aggregated set of useful tools that every developer may need once in a while." />
|
||||
<title>IT Tools</title>
|
||||
<meta itemprop="name" content="IT-Tools" />
|
||||
<meta name="description" content="Aggregated set of useful tools that every developer may need once in a while." />
|
||||
<meta itemprop="description" content="Aggregated set of useful tools that every developer may need once in a while." />
|
||||
<link rel="author" href="/humans.txt" />
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#18a058" />
|
||||
<meta name="msapplication-TileColor" content="#da532c" />
|
||||
<meta name="theme-color" content="#ffffff" />
|
||||
|
||||
<meta property="og:url" content="https://dev.it-tools.tech/" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="IT-Tools" />
|
||||
<meta property="og:description" content="Aggregated set of useful tools that every developer may need once in a while." />
|
||||
<meta property="og:image" content="/banner.png" />
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:domain" content="dev.it-tools.tech" />
|
||||
<meta property="twitter:url" content="https://dev.it-tools.tech/" />
|
||||
<meta name="twitter:title" content="IT-Tools" />
|
||||
<meta name="twitter:description" content="Aggregated set of useful tools that every developer may need once in a while." />
|
||||
<meta name="twitter:image" content="/banner.png" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
19710
package-lock.json
generated
74
package.json
@@ -1,69 +1,15 @@
|
||||
{
|
||||
"name": "it-tools",
|
||||
"version": "2.3.0",
|
||||
"name": "@it-tools/root",
|
||||
"version": "0.0.0",
|
||||
"description": "IT Tools monorepo root",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
"preview": "vite preview --port 5050",
|
||||
"test": "npm run test:unit",
|
||||
"test:unit": "vitest --environment jsdom",
|
||||
"coverage": "vitest run --coverage",
|
||||
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
||||
"lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
|
||||
"release": "standard-version"
|
||||
"dev": "pnpm -F @it-tools/app dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@it-tools/bip39": "^0.0.4",
|
||||
"@vicons/material": "^0.12.0",
|
||||
"@vicons/tabler": "^0.12.0",
|
||||
"@vueuse/core": "^8.2.1",
|
||||
"@vueuse/head": "^0.7.5",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"change-case": "^4.1.2",
|
||||
"colord": "^2.9.2",
|
||||
"cron-validator": "^1.3.1",
|
||||
"cronstrue": "^2.2.0",
|
||||
"crypto-js": "^4.1.1",
|
||||
"date-fns": "^2.28.0",
|
||||
"lodash": "^4.17.21",
|
||||
"naive-ui": "^2.28.0",
|
||||
"pinia": "^2.0.11",
|
||||
"plausible-tracker": "^0.3.5",
|
||||
"qrcode": "^1.5.0",
|
||||
"randombytes": "^2.1.0",
|
||||
"uuid": "^8.3.2",
|
||||
"vue": "^3.2.31",
|
||||
"vue-router": "^4.0.12"
|
||||
"keywords": [],
|
||||
"author": "Corentin Thomasset <corentinth@proton.me> (https://corentin.tech)",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/CorentinTh/it-tools"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.1.0",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/jsdom": "^16.2.14",
|
||||
"@types/node": "^16.11.25",
|
||||
"@types/qrcode": "^1.4.2",
|
||||
"@types/randombytes": "^2.0.0",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@vitejs/plugin-vue": "^2.2.2",
|
||||
"@vitejs/plugin-vue-jsx": "^1.3.7",
|
||||
"@vue/eslint-config-prettier": "^7.0.0",
|
||||
"@vue/eslint-config-typescript": "^10.0.0",
|
||||
"@vue/test-utils": "^2.0.0-rc.18",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"c8": "^7.11.0",
|
||||
"eslint": "^8.5.0",
|
||||
"eslint-plugin-vue": "^8.2.0",
|
||||
"jsdom": "^19.0.0",
|
||||
"less": "^4.1.2",
|
||||
"prettier": "^2.6.2",
|
||||
"standard-version": "^9.3.2",
|
||||
"start-server-and-test": "^1.14.0",
|
||||
"typescript": "~4.5.5",
|
||||
"vite": "^2.9.1",
|
||||
"vite-plugin-md": "^0.12.4",
|
||||
"vite-plugin-pwa": "^0.11.13",
|
||||
"vite-svg-loader": "^3.2.0",
|
||||
"vitest": "^0.5.0",
|
||||
"vue-tsc": "^0.31.4"
|
||||
}
|
||||
"packageManager": "pnpm@9.11.0"
|
||||
}
|
||||
|
||||
17
packages/app/components.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "https://shadcn-solid.com/schema.json",
|
||||
"uno": {
|
||||
"config": "uno.config.ts",
|
||||
"css": {
|
||||
"path": "src/client/app.css",
|
||||
"variable": true
|
||||
},
|
||||
"color": "neutral",
|
||||
"prefix": ""
|
||||
},
|
||||
"alias": {
|
||||
"component": "@/modules/ui/components",
|
||||
"ui": "@/modules/ui/components",
|
||||
"cn": "@/modules/ui/utils/cn"
|
||||
}
|
||||
}
|
||||
21
packages/app/eslint.config.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import antfu from '@antfu/eslint-config';
|
||||
|
||||
export default antfu({
|
||||
stylistic: {
|
||||
semi: true,
|
||||
},
|
||||
|
||||
rules: {
|
||||
// To allow export on top of files
|
||||
'ts/no-use-before-define': ['error', { allowNamedExports: true, functions: false }],
|
||||
'curly': ['error', 'all'],
|
||||
'vitest/consistent-test-it': ['error', { fn: 'test' }],
|
||||
'ts/consistent-type-definitions': ['error', 'type'],
|
||||
'style/brace-style': ['error', '1tbs', { allowSingleLine: false }],
|
||||
'unused-imports/no-unused-vars': ['error', {
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_',
|
||||
}],
|
||||
},
|
||||
});
|
||||
21
packages/app/index.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<title>IT Tools - Handy online tools for developers</title>
|
||||
|
||||
<meta name="title" content="IT Tools - Handy online tools for developers" />
|
||||
<meta name="description" content="Collection of handy online tools for developers, with great UX. IT Tools is a free and open-source collection of handy online tools for developers & people working in IT." />
|
||||
|
||||
<link rel="author" href="humans.txt" />
|
||||
<link rel="canonical" href="https://enclosed.cc/" />
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<script src="/src/client.tsx" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
2381
packages/app/package-lock.json
generated
Normal file
54
packages/app/package.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "@it-tools/app",
|
||||
"type": "module",
|
||||
"version": "0.0.0",
|
||||
"packageManager": "pnpm@9.11.0",
|
||||
"description": "Collection of handy online tools for developers, with great UX.",
|
||||
"author": "Corentin Thomasset <corentinth@proton.me> (https://corentin.tech)",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/CorentinTh/it-tools"
|
||||
},
|
||||
"keywords": [],
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "pnpm run test:unit",
|
||||
"test:unit": "vitest run",
|
||||
"test:unit:watch": "vitest watch",
|
||||
"create:tool": "HYGEN_TMPLS=templates hygen tools new"
|
||||
},
|
||||
"dependencies": {
|
||||
"@corentinth/chisels": "^1.1.0",
|
||||
"@kobalte/core": "^0.13.6",
|
||||
"@solid-primitives/i18n": "^2.1.1",
|
||||
"@solid-primitives/storage": "^4.2.1",
|
||||
"@solidjs/router": "^0.14.7",
|
||||
"@unocss/reset": "^0.62.4",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk-solid": "^1.1.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"solid-js": "^1.9.1",
|
||||
"solid-sonner": "^0.2.8",
|
||||
"tailwind-merge": "^2.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^3.7.3",
|
||||
"@iconify-json/tabler": "^1.2.3",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@vitest/coverage-v8": "2.1.2",
|
||||
"eslint": "^9.11.1",
|
||||
"hygen": "^6.2.11",
|
||||
"typescript": "^5.6.2",
|
||||
"unocss": "^0.62.4",
|
||||
"unocss-preset-animations": "^1.1.0",
|
||||
"vite": "^5.4.8",
|
||||
"vite-plugin-solid": "^2.10.2",
|
||||
"vitest": "^2.1.2"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/* TEAM */
|
||||
Developer: Corentin Thomasset
|
||||
Site: https://github.com/CorentinTh
|
||||
Site: https://corentin.tech
|
||||
Twitter: @cthmsst
|
||||
75
packages/app/src/app.css
Normal file
@@ -0,0 +1,75 @@
|
||||
:root {
|
||||
--background: 0 0% 100%;
|
||||
--foreground: 0 0% 3.9%;
|
||||
|
||||
--card: 0 0% 100%;
|
||||
--card-foreground: 0 0% 3.9%;
|
||||
|
||||
--popover: 0 0% 100%;
|
||||
--popover-foreground: 0 0% 3.9%;
|
||||
|
||||
--primary: 0 0% 9%;
|
||||
--primary-foreground: 0 0% 98%;
|
||||
|
||||
--secondary: 0 0% 96.1%;
|
||||
--secondary-foreground: 0 0% 9%;
|
||||
|
||||
--muted: 0 0% 96.1%;
|
||||
--muted-foreground: 0 0% 45.1%;
|
||||
|
||||
--accent: 0 0% 96.1%;
|
||||
--accent-foreground: 0 0% 9%;
|
||||
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
|
||||
--warning: 31 98% 50%;
|
||||
--warning-foreground: 0 0% 98%;
|
||||
|
||||
--border: 0 0% 89.8%;
|
||||
--input: 0 0% 89.8%;
|
||||
--ring: 0 0% 3.9%;
|
||||
|
||||
--radius: 0.5rem;
|
||||
}
|
||||
|
||||
[data-kb-theme="dark"] {
|
||||
--background: 0 0% 9%;
|
||||
--foreground: 0 0% 98%;
|
||||
|
||||
--card: 0 0% 7%;
|
||||
--card-foreground: 0 0% 98%;
|
||||
|
||||
--popover: 0 0% 3.9%;
|
||||
--popover-foreground: 0 0% 98%;
|
||||
|
||||
--primary: 83 79% 55%;
|
||||
--primary-foreground: 0 0% 9%;
|
||||
|
||||
--secondary: 0 0% 14.9%;
|
||||
--secondary-foreground: 0 0% 98%;
|
||||
|
||||
--muted: 0 0% 14.9%;
|
||||
--muted-foreground: 0 0% 63.9%;
|
||||
|
||||
--accent: 0 0% 14.9%;
|
||||
--accent-foreground: 0 0% 98%;
|
||||
|
||||
--destructive: 0 62.8% 30.6%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
|
||||
--warning: 31 98% 50%;
|
||||
--warning-foreground: 0 0% 98%;
|
||||
|
||||
--border: 0 0% 14.9%;
|
||||
--input: 0 0% 14.9%;
|
||||
--ring: 0 0% 83.1%;
|
||||
}
|
||||
|
||||
|
||||
* {
|
||||
@apply border-border;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
69
packages/app/src/client-routes.tsx
Normal file
@@ -0,0 +1,69 @@
|
||||
import type { LocaleKey } from './modules/i18n/i18n.types';
|
||||
import { A, Navigate, type RouteDefinition, useParams } from '@solidjs/router';
|
||||
import { localeKeys } from './modules/i18n/i18n.constants';
|
||||
import { useI18n } from './modules/i18n/i18n.provider';
|
||||
import { HomePage } from './modules/pages/home.page';
|
||||
import { ToolPage } from './modules/tools/pages/tool.page';
|
||||
import { toolSlugs } from './modules/tools/tools.registry';
|
||||
import { Button } from './modules/ui/components/button';
|
||||
import { AppLayout } from './modules/ui/layouts/app.layout';
|
||||
|
||||
export const routes: RouteDefinition[] = [
|
||||
{
|
||||
path: '/',
|
||||
component: () => {
|
||||
const { getLocale } = useI18n();
|
||||
|
||||
return <Navigate href={`/${getLocale()}`} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: AppLayout,
|
||||
children: [
|
||||
{
|
||||
path: '/:localeKey',
|
||||
matchFilters: {
|
||||
localeKey: localeKeys,
|
||||
},
|
||||
component: (props) => {
|
||||
const params = useParams();
|
||||
const { setLocale } = useI18n();
|
||||
|
||||
setLocale(params.localeKey as LocaleKey);
|
||||
|
||||
return props.children;
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/',
|
||||
component: HomePage,
|
||||
},
|
||||
{
|
||||
path: '/:toolSlug',
|
||||
matchFilters: {
|
||||
toolSlug: toolSlugs,
|
||||
},
|
||||
component: ToolPage,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '*404',
|
||||
component: () => (
|
||||
<div class="flex flex-col items-center justify-center mt-6">
|
||||
<div class="text-3xl font-light text-muted-foreground">404</div>
|
||||
<h1 class="font-semibold text-lg my-2">Page Not Found</h1>
|
||||
<p class="text-muted-foreground">The page you are looking for does not exist.</p>
|
||||
<p class="text-muted-foreground">Please check the URL and try again.</p>
|
||||
<Button as={A} href="/" class="mt-4" variant="secondary">
|
||||
<div class="i-tabler-arrow-left mr-2"></div>
|
||||
Go back home
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
];
|
||||
43
packages/app/src/client.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
/* @refresh reload */
|
||||
|
||||
import { ColorModeProvider, ColorModeScript, createLocalStorageManager } from '@kobalte/core/color-mode';
|
||||
import { Router } from '@solidjs/router';
|
||||
import { render, Suspense } from 'solid-js/web';
|
||||
import { routes } from './client-routes';
|
||||
import { CommandPaletteProvider } from './modules/command-palette/command-palette.provider';
|
||||
import { RootI18nProvider } from './modules/i18n/i18n.provider';
|
||||
import { Toaster } from './modules/ui/components/sonner';
|
||||
import '@unocss/reset/tailwind.css';
|
||||
import 'virtual:uno.css';
|
||||
import './app.css';
|
||||
|
||||
render(
|
||||
() => {
|
||||
const initialColorMode = 'system';
|
||||
const colorModeStorageKey = 'it_tools_color_mode';
|
||||
const localStorageManager = createLocalStorageManager(colorModeStorageKey);
|
||||
|
||||
return (
|
||||
<Router
|
||||
children={routes}
|
||||
root={props => (
|
||||
<Suspense>
|
||||
<RootI18nProvider>
|
||||
<ColorModeScript storageType={localStorageManager.type} storageKey={colorModeStorageKey} initialColorMode={initialColorMode} />
|
||||
<ColorModeProvider
|
||||
initialColorMode={initialColorMode}
|
||||
storageManager={localStorageManager}
|
||||
>
|
||||
<CommandPaletteProvider>
|
||||
<Toaster />
|
||||
<div class="min-h-screen font-sans text-sm font-400">{props.children}</div>
|
||||
</CommandPaletteProvider>
|
||||
</ColorModeProvider>
|
||||
</RootI18nProvider>
|
||||
</Suspense>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
},
|
||||
document.getElementById('root')!,
|
||||
);
|
||||
73
packages/app/src/locales/en.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"app": {
|
||||
"title": "IT-Tools",
|
||||
"description": "The open-source collection of handy online tools to help developers in their daily life."
|
||||
},
|
||||
"navbar": {
|
||||
"theme": {
|
||||
"theme": "Theme",
|
||||
"light-mode": "Light mode",
|
||||
"dark-mode": "Dark mode",
|
||||
"system-mode": "System"
|
||||
},
|
||||
"language": "Language",
|
||||
"contribute-to-i18n": "Contribute to i18n",
|
||||
"github": "GitHub",
|
||||
"support": "Support IT-Tools",
|
||||
"report-bug": "Report a bug"
|
||||
},
|
||||
"footer": {
|
||||
"resources": {
|
||||
"title": "Resources",
|
||||
"all-tools": "All the tools",
|
||||
"github": "GitHub repository",
|
||||
"support": "Support IT-Tools",
|
||||
"license": "License"
|
||||
},
|
||||
"support": {
|
||||
"title": "Support",
|
||||
"report-bug": "Report a bug",
|
||||
"request-feature": "Request a feature",
|
||||
"contribute": "Contribute to the project",
|
||||
"contact": "Contact me"
|
||||
},
|
||||
"friends": {
|
||||
"title": "Friends"
|
||||
}
|
||||
},
|
||||
"commandPalette": {
|
||||
"input-placeholder": "Type to search for a tool or a command...",
|
||||
"go-home": "Go to home",
|
||||
"sections": {
|
||||
"tools": "Tools",
|
||||
"navigation": "Navigation",
|
||||
"language": "Language",
|
||||
"theme": "Theme"
|
||||
},
|
||||
"theme": {
|
||||
"switch-to-light": "Switch to light theme",
|
||||
"switch-to-dark": "Switch to dark theme",
|
||||
"switch-to-system": "Use to system theme"
|
||||
},
|
||||
"trigger": {
|
||||
"search": "Search for a tool"
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"all-tools": "All the tools",
|
||||
"search-tools": "Search for a tool",
|
||||
"open-source": "Open Source",
|
||||
"free": "Free",
|
||||
"self-hostable": "Self-hostable"
|
||||
},
|
||||
"tools": {
|
||||
"token-generator": {
|
||||
"name": "Token Generator",
|
||||
"description": "Generate random string with the characters you want, uppercase, lowercase letters, numbers and/or symbols."
|
||||
},
|
||||
"random-port-generator": {
|
||||
"name": "Random Port Generator",
|
||||
"description": "Generate a random port number outside of the reserved ports range (0-1023)."
|
||||
}
|
||||
}
|
||||
}
|
||||
59
packages/app/src/locales/fr.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"app": {
|
||||
"title": "IT-Tools",
|
||||
"description": "La collection open-source d'outils en ligne pour aider les devs dans leur vie quotidienne."
|
||||
},
|
||||
"navbar": {
|
||||
"theme": {
|
||||
"theme": "Thème",
|
||||
"light-mode": "Mode clair",
|
||||
"dark-mode": "Mode sombre",
|
||||
"system-mode": "Système"
|
||||
},
|
||||
"language": "Langue",
|
||||
"contribute-to-i18n": "Contribuer à l'i18n",
|
||||
"github": "GitHub",
|
||||
"support": "Soutenir IT-Tools",
|
||||
"report-bug": "Signaler un bug"
|
||||
},
|
||||
"footer": {
|
||||
"resources": {
|
||||
"title": "Ressources",
|
||||
"all-tools": "Tous les outils",
|
||||
"github": "Dépôt GitHub",
|
||||
"support": "Soutenir IT-Tools",
|
||||
"license": "Licence"
|
||||
},
|
||||
"support": {
|
||||
"title": "Support",
|
||||
"report-bug": "Signaler un bug",
|
||||
"request-feature": "Demander une fonctionnalité",
|
||||
"contribute": "Contribuer au projet",
|
||||
"contact": "Me contacter"
|
||||
},
|
||||
"friends": {
|
||||
"title": "Ami·e·s"
|
||||
}
|
||||
},
|
||||
"commandPalette": {
|
||||
"input-placeholder": "Tapez pour rechercher un outil...",
|
||||
"go-home": "Aller à l'accueil",
|
||||
"sections": {
|
||||
"tools": "Outils",
|
||||
"navigation": "Navigation",
|
||||
"theme": "Thème"
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"all-tools": "Tous les outils",
|
||||
"open-source": "Open Source",
|
||||
"free": "Gratuit",
|
||||
"self-hostable": "Self-hostable"
|
||||
},
|
||||
"tools": {
|
||||
"token-generator": {
|
||||
"name": "Générateur de token",
|
||||
"description": "Générer des string aléatoires, contrôlez les caractères que vous voulez, lettres majuscules, minuscules, chiffres et/ou symboles."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
import type { Accessor, ParentComponent } from 'solid-js';
|
||||
import { useNavigate } from '@solidjs/router';
|
||||
import { createContext, createMemo, createSignal, For, onCleanup, onMount, useContext } from 'solid-js';
|
||||
import { locales } from '../i18n/i18n.constants';
|
||||
import { useI18n } from '../i18n/i18n.provider';
|
||||
import { useToolsStore } from '../tools/tools.store';
|
||||
import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../ui/components/command';
|
||||
import { useThemeStore } from '../ui/themes/theme.store';
|
||||
import { cn } from '../ui/utils/cn';
|
||||
|
||||
const CommandPaletteContext = createContext<{
|
||||
getIsCommandPaletteOpen: Accessor<boolean>;
|
||||
openCommandPalette: () => void;
|
||||
closeCommandPalette: () => void;
|
||||
}>();
|
||||
|
||||
export function useCommandPalette() {
|
||||
const context = useContext(CommandPaletteContext);
|
||||
|
||||
if (!context) {
|
||||
throw new Error('CommandPalette context not found');
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
export const CommandPaletteProvider: ParentComponent = (props) => {
|
||||
const [getIsCommandPaletteOpen, setIsCommandPaletteOpen] = createSignal(false);
|
||||
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.key === 'k' && (e.metaKey || e.ctrlKey)) {
|
||||
e.preventDefault();
|
||||
setIsCommandPaletteOpen(true);
|
||||
}
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
document.addEventListener('keydown', handleKeyDown);
|
||||
});
|
||||
|
||||
onCleanup(() => {
|
||||
document.removeEventListener('keydown', handleKeyDown);
|
||||
});
|
||||
|
||||
const { getTools } = useToolsStore();
|
||||
const navigate = useNavigate();
|
||||
const { t, createLocalizedUrl, changeLocale } = useI18n();
|
||||
const { setColorMode } = useThemeStore();
|
||||
|
||||
const getCommandData = createMemo(() => [
|
||||
{
|
||||
label: t('commandPalette.sections.tools'),
|
||||
options: [
|
||||
...getTools().map(tool => ({
|
||||
label: tool.name,
|
||||
icon: tool.icon,
|
||||
action: () => navigate(createLocalizedUrl({ path: tool.slug })),
|
||||
})),
|
||||
],
|
||||
},
|
||||
{
|
||||
label: t('commandPalette.sections.navigation'),
|
||||
options: [
|
||||
{
|
||||
label: t('commandPalette.go-home'),
|
||||
icon: 'i-tabler-home',
|
||||
action: () => navigate(createLocalizedUrl({ path: '' })),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: t('commandPalette.sections.language'),
|
||||
options: [
|
||||
...locales.map(locale => ({
|
||||
label: locale.switchToLabel,
|
||||
icon: 'i-custom-language',
|
||||
action: () => changeLocale(locale.key),
|
||||
keywords: [locale.name, locale.key],
|
||||
})),
|
||||
],
|
||||
},
|
||||
{
|
||||
label: t('commandPalette.sections.theme'),
|
||||
options: [
|
||||
{
|
||||
label: t('commandPalette.theme.switch-to-light'),
|
||||
icon: 'i-tabler-sun',
|
||||
action: () => setColorMode({ mode: 'light' }),
|
||||
},
|
||||
{
|
||||
label: t('commandPalette.theme.switch-to-dark'),
|
||||
icon: 'i-tabler-moon',
|
||||
action: () => setColorMode({ mode: 'dark' }),
|
||||
},
|
||||
{
|
||||
label: t('commandPalette.theme.switch-to-system'),
|
||||
icon: 'i-tabler-device-laptop',
|
||||
action: () => setColorMode({ mode: 'system' }),
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const onCommandSelect = ({ action }: { action: () => void }) => {
|
||||
action();
|
||||
setIsCommandPaletteOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<CommandPaletteContext.Provider value={{
|
||||
getIsCommandPaletteOpen,
|
||||
openCommandPalette: () => setIsCommandPaletteOpen(true),
|
||||
closeCommandPalette: () => setIsCommandPaletteOpen(false),
|
||||
}}
|
||||
>
|
||||
<CommandDialog
|
||||
class="rounded-lg border shadow-md"
|
||||
open={getIsCommandPaletteOpen()}
|
||||
onOpenChange={setIsCommandPaletteOpen}
|
||||
>
|
||||
<CommandInput placeholder={t('commandPalette.input-placeholder')} />
|
||||
<CommandList>
|
||||
<CommandEmpty>No results found.</CommandEmpty>
|
||||
<For each={getCommandData()}>
|
||||
{section => (
|
||||
<CommandGroup heading={section.label}>
|
||||
<For each={section.options}>
|
||||
{item => (
|
||||
<CommandItem onSelect={() => onCommandSelect(item)}>
|
||||
<span class={cn('mr-2 ml-1 size-4 text-muted-foreground', item.icon)} />
|
||||
<span>{item.label}</span>
|
||||
</CommandItem>
|
||||
)}
|
||||
</For>
|
||||
</CommandGroup>
|
||||
)}
|
||||
</For>
|
||||
</CommandList>
|
||||
</CommandDialog>
|
||||
|
||||
{props.children}
|
||||
</CommandPaletteContext.Provider>
|
||||
);
|
||||
};
|
||||
18
packages/app/src/modules/i18n/i18n.constants.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { map } from 'lodash-es';
|
||||
|
||||
export const locales = [
|
||||
{
|
||||
key: 'en',
|
||||
file: 'en',
|
||||
name: 'English',
|
||||
switchToLabel: 'Change language to English',
|
||||
},
|
||||
{
|
||||
key: 'fr',
|
||||
file: 'fr',
|
||||
name: 'Français',
|
||||
switchToLabel: 'Changer la langue en Français',
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const localeKeys = map(locales, 'key');
|
||||
96
packages/app/src/modules/i18n/i18n.provider.tsx
Normal file
@@ -0,0 +1,96 @@
|
||||
import type { ParentComponent } from 'solid-js';
|
||||
import type { LocaleKey } from './i18n.types';
|
||||
import { joinUrlPaths } from '@corentinth/chisels';
|
||||
import * as i18n from '@solid-primitives/i18n';
|
||||
import { makePersisted } from '@solid-primitives/storage';
|
||||
import { useNavigate } from '@solidjs/router';
|
||||
import { merge } from 'lodash-es';
|
||||
import { createContext, createResource, createSignal, Show, useContext } from 'solid-js';
|
||||
import defaultDict from '../../locales/en.json';
|
||||
import { locales } from './i18n.constants';
|
||||
|
||||
export {
|
||||
useI18n,
|
||||
};
|
||||
|
||||
type RawDictionary = typeof defaultDict;
|
||||
type Dictionary = i18n.Flatten<RawDictionary>;
|
||||
|
||||
const RootI18nContext = createContext<{
|
||||
t: i18n.Translator<Dictionary>;
|
||||
getLocale: () => LocaleKey;
|
||||
setLocale: (locale: LocaleKey) => void;
|
||||
locales: typeof locales;
|
||||
} | undefined>(undefined);
|
||||
|
||||
function useI18n() {
|
||||
const context = useContext(RootI18nContext);
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (!context) {
|
||||
throw new Error('I18n context not found');
|
||||
}
|
||||
|
||||
const { t, getLocale, setLocale, locales } = context;
|
||||
|
||||
return {
|
||||
t,
|
||||
getLocale,
|
||||
setLocale,
|
||||
locales,
|
||||
createLocalizedUrl: ({ path }: { path: string }) => {
|
||||
const newPath = joinUrlPaths(getLocale(), path);
|
||||
|
||||
return `/${newPath}`;
|
||||
},
|
||||
changeLocale: (locale: LocaleKey) => {
|
||||
setLocale(locale);
|
||||
|
||||
const pathWithoutLocale = location.pathname.split('/').slice(2).join('/');
|
||||
const newPath = joinUrlPaths(locale, pathWithoutLocale);
|
||||
navigate(`/${newPath}`);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async function fetchDictionary(locale: LocaleKey): Promise<Dictionary> {
|
||||
const dict: RawDictionary = (await import(`../../locales/${locale}.json`));
|
||||
const mergedDict = merge({}, defaultDict, dict);
|
||||
const flattened = i18n.flatten(mergedDict);
|
||||
|
||||
return flattened;
|
||||
}
|
||||
|
||||
export function getBrowserLocale(): LocaleKey {
|
||||
const browserLocale = navigator.language?.split('-')[0];
|
||||
|
||||
if (!browserLocale) {
|
||||
return 'en';
|
||||
}
|
||||
|
||||
return locales.find(locale => locale.key === browserLocale)?.key ?? 'en';
|
||||
}
|
||||
|
||||
export const RootI18nProvider: ParentComponent = (props) => {
|
||||
const browserLocale = getBrowserLocale();
|
||||
const [getLocale, setLocale] = makePersisted(createSignal<LocaleKey>(browserLocale), { name: 'it_tools_locale', storage: localStorage });
|
||||
|
||||
const [dict] = createResource(getLocale, fetchDictionary);
|
||||
|
||||
return (
|
||||
<Show when={dict()}>
|
||||
{dict => (
|
||||
<RootI18nContext.Provider
|
||||
value={{
|
||||
t: i18n.translator(dict),
|
||||
getLocale,
|
||||
setLocale,
|
||||
locales,
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
</RootI18nContext.Provider>
|
||||
)}
|
||||
</Show>
|
||||
);
|
||||
};
|
||||
3
packages/app/src/modules/i18n/i18n.types.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { locales } from './i18n.constants';
|
||||
|
||||
export type LocaleKey = typeof locales[number]['key'];
|
||||
87
packages/app/src/modules/pages/home.page.tsx
Normal file
@@ -0,0 +1,87 @@
|
||||
import type { Component } from 'solid-js';
|
||||
import { A } from '@solidjs/router';
|
||||
import { useCommandPalette } from '../command-palette/command-palette.provider';
|
||||
import { useI18n } from '../i18n/i18n.provider';
|
||||
import { useToolsStore } from '../tools/tools.store';
|
||||
import { Badge } from '../ui/components/badge';
|
||||
import { Button } from '../ui/components/button';
|
||||
import { Card, CardDescription, CardHeader, CardTitle } from '../ui/components/card';
|
||||
import { cn } from '../ui/utils/cn';
|
||||
|
||||
export const HomePage: Component = () => {
|
||||
const { t } = useI18n();
|
||||
const { getTools } = useToolsStore();
|
||||
const { openCommandPalette } = useCommandPalette();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div class="w-full bg-[linear-gradient(to_right,#80808010_1px,transparent_1px),linear-gradient(to_bottom,#80808010_1px,transparent_1px)] bg-[size:48px_48px] pt-20">
|
||||
|
||||
<div class="flex justify-center gap-24 items-center p-6">
|
||||
<div class="max-w-xl flex flex-col gap-6 ">
|
||||
<div class="flex items-center gap-2">
|
||||
<Badge class="text-primary bg-primary/10 hover:bg-primary/10">
|
||||
{t('home.open-source')}
|
||||
</Badge>
|
||||
|
||||
<Badge class="text-primary bg-primary/10 hover:bg-primary/10">
|
||||
{t('home.free')}
|
||||
</Badge>
|
||||
|
||||
<Badge class="text-primary bg-primary/10 hover:bg-primary/10">
|
||||
{t('home.self-hostable')}
|
||||
</Badge>
|
||||
</div>
|
||||
<h1 class="text-5xl font-semibold border-b border-transparent hover:no-underline h-auto py-0 px-1 ml--1 rounded-none !transition-border-color-250">
|
||||
<span class="font-bold ">IT</span>
|
||||
<span class="text-90% text-primary font-extrabold border border-5px leading-none border-current rounded-xl px-2 py-0.5 ml-3">TOOLS</span>
|
||||
</h1>
|
||||
|
||||
<p class="text-xl text-muted-foreground">
|
||||
{t('app.description')}
|
||||
</p>
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<Button variant="default" as={A} href="tools">
|
||||
{t('home.all-tools')}
|
||||
<div class="i-tabler-arrow-right ml-2 text-base"></div>
|
||||
</Button>
|
||||
|
||||
<Button variant="outline" onClick={openCommandPalette}>
|
||||
<div class="i-tabler-search mr-2 text-base" />
|
||||
{t('home.search-tools')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="relative hidden md:block">
|
||||
<div class="absolute top-4 left-0 w-full h-full flex items-center justify-center blur-2xl rounded-full opacity-20 bg-gradient-to-br from-primary to-transparent" />
|
||||
<div class="i-tabler-terminal text-9xl text-primary m-8" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-gradient-to-t dark:from-background to-transparent h-24 mt-24"></div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 max-w-1200px mx-auto p-6">
|
||||
{getTools().map(tool => (
|
||||
<A href={tool.slug} class="h-full">
|
||||
<Card class="hover:(shadow-md transform scale-101) transition-transform h-full">
|
||||
<CardHeader>
|
||||
<div class={cn(tool.icon, 'size-12 text-muted-foreground/60')} />
|
||||
|
||||
<CardTitle class="text-base font-semibold">
|
||||
{tool.name}
|
||||
</CardTitle>
|
||||
|
||||
<CardDescription>
|
||||
{tool.description}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</A>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
37
packages/app/src/modules/shared/copy/copy-button.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { Accessor, Component, ComponentProps } from 'solid-js';
|
||||
import { Button } from '@/modules/ui/components/button';
|
||||
import { omit } from 'lodash-es';
|
||||
import { Show, splitProps } from 'solid-js';
|
||||
import { useCopy } from './copy';
|
||||
|
||||
export const CopyButton: Component<{ textToCopy: Accessor<string | number>; toastMessage?: string } & ComponentProps<typeof Button>> = (props) => {
|
||||
const [localProps, buttonProps] = splitProps(props, ['textToCopy', 'toastMessage']);
|
||||
const { copy, getIsJustCopied } = useCopy(localProps.textToCopy, { toastMessage: localProps.toastMessage });
|
||||
|
||||
return (
|
||||
<Button onClick={copy} {...omit(buttonProps, ['textToCopy', 'toastMessage'])}>
|
||||
<Show
|
||||
when={buttonProps.children}
|
||||
fallback={(
|
||||
|
||||
getIsJustCopied()
|
||||
? (
|
||||
<>
|
||||
<div class="i-tabler-check mr-2 text-base" />
|
||||
Copied!
|
||||
</>
|
||||
)
|
||||
: (
|
||||
<>
|
||||
<div class="i-tabler-copy mr-2 text-base" />
|
||||
Copy to clipboard
|
||||
</>
|
||||
)
|
||||
|
||||
)}
|
||||
>
|
||||
{buttonProps.children}
|
||||
</Show>
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
23
packages/app/src/modules/shared/copy/copy.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { Accessor } from 'solid-js';
|
||||
import { createSignal } from 'solid-js';
|
||||
import { toast } from '../../ui/components/sonner';
|
||||
|
||||
export { useCopy, writeTextToClipboard };
|
||||
|
||||
function writeTextToClipboard({ text }: { text: string }) {
|
||||
return navigator.clipboard.writeText(text);
|
||||
}
|
||||
|
||||
function useCopy(getText: Accessor<string | number>, { toastMessage = 'Copied to clipboard' }: { toastMessage?: string } = {}) {
|
||||
const [getIsJustCopied, setIsJustCopied] = createSignal(false);
|
||||
|
||||
return {
|
||||
getIsJustCopied,
|
||||
copy: () => {
|
||||
writeTextToClipboard({ text: String(getText()) });
|
||||
setIsJustCopied(true);
|
||||
setTimeout(() => setIsJustCopied(false), 2000);
|
||||
toast(toastMessage);
|
||||
},
|
||||
};
|
||||
}
|
||||
33
packages/app/src/modules/shared/signals.test.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import { createRefreshableSignal } from './signals';
|
||||
|
||||
describe('signals', () => {
|
||||
describe('createRefreshableSignal', () => {
|
||||
test('the state initially has the value returned by the getter', () => {
|
||||
const [getState] = createRefreshableSignal(() => 42);
|
||||
expect(getState()).to.eql(42);
|
||||
});
|
||||
|
||||
test('calling the refresh function updates the state', () => {
|
||||
let value = 0;
|
||||
const [getState, refresh] = createRefreshableSignal(() => value++);
|
||||
|
||||
expect(getState()).to.eql(0);
|
||||
|
||||
refresh();
|
||||
|
||||
expect(getState()).to.eql(1);
|
||||
expect(getState()).to.eql(1);
|
||||
});
|
||||
|
||||
test('the state can be muted using the setState function', () => {
|
||||
const [getState, , { setState }] = createRefreshableSignal(() => 0);
|
||||
|
||||
expect(getState()).to.eql(0);
|
||||
|
||||
setState(42);
|
||||
|
||||
expect(getState()).to.eql(42);
|
||||
});
|
||||
});
|
||||
});
|
||||
13
packages/app/src/modules/shared/signals.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { createSignal } from 'solid-js';
|
||||
|
||||
export { createRefreshableSignal };
|
||||
|
||||
function createRefreshableSignal<T>(getValue: () => T) {
|
||||
const [getState, setState] = createSignal<T>(getValue());
|
||||
|
||||
return [
|
||||
getState,
|
||||
() => setState(() => getValue()),
|
||||
{ setState },
|
||||
] as const;
|
||||
}
|
||||
30
packages/app/src/modules/tools/components/tool-header.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { Component, ParentComponent } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
|
||||
export const ToolHeader: ParentComponent<{ name: string; description: string; icon: string }> = (props) => {
|
||||
return (
|
||||
<div>
|
||||
<div class="w-full bg-[linear-gradient(to_right,#80808010_1px,transparent_1px),linear-gradient(to_bottom,#80808010_1px,transparent_1px)] bg-[size:48px_48px] pt-12">
|
||||
|
||||
<div class="flex gap-4 mb-8 max-w-1200px mx-auto px-6 items-start flex-col md:flex-row md:items-center">
|
||||
<div class="bg-card p-4 rounded-lg">
|
||||
<div class={cn(props.icon, 'size-8 md:size-12 text-muted-foreground')} />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold">
|
||||
{props.name}
|
||||
</h1>
|
||||
<div class="text-muted-foreground text-base">
|
||||
{props.description}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-gradient-to-t dark:from-background to-transparent h-24 mt-12 mb--24"></div>
|
||||
</div>
|
||||
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "Random Port Generator",
|
||||
"description": "Generate a random port number outside of the reserved ports range (0-1023).",
|
||||
"refresh": "Refresh port",
|
||||
"copy-toast": "Port copied to clipboard"
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import type { Component } from 'solid-js';
|
||||
import { CopyButton } from '@/modules/shared/copy/copy-button';
|
||||
import { createRefreshableSignal } from '@/modules/shared/signals';
|
||||
import { Button } from '@/modules/ui/components/button';
|
||||
import { Card, CardContent, CardHeader } from '@/modules/ui/components/card';
|
||||
import { ToolHeader } from '../../components/tool-header';
|
||||
import { useCurrentTool } from '../../tools.provider';
|
||||
import defaultDictionary from './locales/en.json';
|
||||
import { generateRandomPort } from './random-port-generator.services';
|
||||
|
||||
const RandomPortGenerator: Component = () => {
|
||||
const [getPort, refreshPort] = createRefreshableSignal(generateRandomPort);
|
||||
const { t, getTool } = useCurrentTool({ defaultDictionary });
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ToolHeader {...getTool()} />
|
||||
|
||||
<div class="max-w-600px mx-auto px-6">
|
||||
<Card>
|
||||
<CardHeader class="flex justify-between items-center">
|
||||
<div class="my-6 text-center">
|
||||
|
||||
<div class="text-base text-muted-foreground mb-2">
|
||||
Random port:
|
||||
</div>
|
||||
|
||||
<div class="text-4xl font-mono">
|
||||
|
||||
{getPort()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2 md:gap-4 mt-4 flex-col md:flex-row w-full justify-center">
|
||||
<Button onClick={refreshPort} variant="outline">
|
||||
<div class="i-tabler-refresh mr-2 text-base text-muted-foreground" />
|
||||
{t('refresh')}
|
||||
</Button>
|
||||
|
||||
<CopyButton textToCopy={getPort} toastMessage={t('copy-toast')} />
|
||||
</div>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default RandomPortGenerator;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { random } from 'lodash-es';
|
||||
|
||||
export function generateRandomPort() {
|
||||
return random(1024, 65535);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { defineTool } from '../../tools.models';
|
||||
|
||||
export const randomPortGeneratorTool = defineTool({
|
||||
slug: 'random-port-generator',
|
||||
entryFile: () => import('./random-port-generator.page'),
|
||||
icon: 'i-tabler-server',
|
||||
createdAt: new Date('2024-10-03'),
|
||||
dirName: 'random-port-generator',
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "Token Generator",
|
||||
"description": "Generate random string with the characters you want, uppercase, lowercase letters, numbers and/or symbols.",
|
||||
"uppercase": "Uppercase letters (A-Z)",
|
||||
"lowercase": "Lowercase letters (a-z)",
|
||||
"numbers": "Numbers (0-9)",
|
||||
"symbols": "Special characters (!@#...)",
|
||||
"length": "Length",
|
||||
"result-placeholder": "Your token will appear here"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "Générateur de token",
|
||||
"description": "Génère une chaîne de caractères aléatoire, contrôlez les caractères que vous voulez, lettres majuscules, minuscules, chiffres et/ou symboles.",
|
||||
"uppercase": "Lettres majuscules (A-Z)",
|
||||
"lowercase": "Lettres minuscules (a-z)",
|
||||
"numbers": "Chiffres (0-9)",
|
||||
"symbols": "Caractères spéciaux (!@#...)",
|
||||
"length": "Longueur",
|
||||
"result-placeholder": "Le token apparaîtra ici"
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { sample as sampleImpl, times } from 'lodash-es';
|
||||
|
||||
export function createToken({
|
||||
withUppercase = true,
|
||||
withLowercase = true,
|
||||
withNumbers = true,
|
||||
withSymbols = false,
|
||||
length = 64,
|
||||
alphabet,
|
||||
sample = sampleImpl,
|
||||
}: {
|
||||
withUppercase?: boolean;
|
||||
withLowercase?: boolean;
|
||||
withNumbers?: boolean;
|
||||
withSymbols?: boolean;
|
||||
length?: number;
|
||||
alphabet?: string;
|
||||
sample?: (str: string) => string;
|
||||
}) {
|
||||
const allAlphabet = alphabet ?? [
|
||||
withUppercase ? 'ABCDEFGHIJKLMOPQRSTUVWXYZ' : '',
|
||||
withLowercase ? 'abcdefghijklmopqrstuvwxyz' : '',
|
||||
withNumbers ? '0123456789' : '',
|
||||
withSymbols ? '.,;:!?./-"\'#{([-|\\@)]=}*+' : '',
|
||||
].join('');
|
||||
|
||||
return times(length, () => sample(allAlphabet)).join('');
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import { CopyButton } from '@/modules/shared/copy/copy-button';
|
||||
import { createRefreshableSignal } from '@/modules/shared/signals';
|
||||
import { Button } from '@/modules/ui/components/button';
|
||||
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/modules/ui/components/card';
|
||||
import { Switch, SwitchControl, SwitchLabel, SwitchThumb } from '@/modules/ui/components/switch';
|
||||
import { TextArea } from '@/modules/ui/components/textarea';
|
||||
import { TextFieldRoot } from '@/modules/ui/components/textfield';
|
||||
import { type Component, createSignal } from 'solid-js';
|
||||
import { ToolHeader } from '../../components/tool-header';
|
||||
import { useCurrentTool } from '../../tools.provider';
|
||||
import defaultDictionary from './locales/en.json';
|
||||
import { createToken } from './token-generator.models';
|
||||
|
||||
const TokenGeneratorTool: Component = () => {
|
||||
const [getUseUpperCase, setUseUpperCase] = createSignal(true);
|
||||
const [getUseLowerCase, setUseLowerCase] = createSignal(true);
|
||||
const [getUseNumbers, setUseNumbers] = createSignal(true);
|
||||
const [getUseSpecialCharacters, setUseSpecialCharacters] = createSignal(false);
|
||||
const [getLength] = createSignal(64);
|
||||
|
||||
const { t, getTool } = useCurrentTool({ defaultDictionary });
|
||||
|
||||
const [getToken, refreshToken] = createRefreshableSignal(() => createToken({
|
||||
withUppercase: getUseUpperCase(),
|
||||
withLowercase: getUseLowerCase(),
|
||||
withNumbers: getUseNumbers(),
|
||||
withSymbols: getUseSpecialCharacters(),
|
||||
length: getLength(),
|
||||
}));
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ToolHeader {...getTool()} />
|
||||
|
||||
<div class="mx-auto max-w-1200px p-6 flex flex-col gap-4 md:flex-row items-start">
|
||||
<Card>
|
||||
<CardHeader class="border-b border-border">
|
||||
<CardTitle class="text-muted-foreground">
|
||||
Configuration
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
|
||||
<CardContent class="pt-6 flex flex-col gap-2">
|
||||
<Switch class="flex items-center gap-2" checked={getUseUpperCase()} onChange={setUseUpperCase}>
|
||||
<SwitchControl>
|
||||
<SwitchThumb />
|
||||
</SwitchControl>
|
||||
<SwitchLabel class="text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70">
|
||||
{t('uppercase')}
|
||||
</SwitchLabel>
|
||||
</Switch>
|
||||
|
||||
<Switch class="flex items-center gap-2" checked={getUseLowerCase()} onChange={setUseLowerCase}>
|
||||
<SwitchControl>
|
||||
<SwitchThumb />
|
||||
</SwitchControl>
|
||||
<SwitchLabel class="text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70">
|
||||
{t('lowercase')}
|
||||
</SwitchLabel>
|
||||
</Switch>
|
||||
|
||||
<Switch class="flex items-center gap-2" checked={getUseNumbers()} onChange={setUseNumbers}>
|
||||
<SwitchControl>
|
||||
<SwitchThumb />
|
||||
</SwitchControl>
|
||||
<SwitchLabel class="text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70">
|
||||
{t('numbers')}
|
||||
</SwitchLabel>
|
||||
</Switch>
|
||||
|
||||
<Switch class="flex items-center gap-2" checked={getUseSpecialCharacters()} onChange={setUseSpecialCharacters}>
|
||||
<SwitchControl>
|
||||
<SwitchThumb />
|
||||
</SwitchControl>
|
||||
<SwitchLabel class="text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70">
|
||||
{t('symbols')}
|
||||
</SwitchLabel>
|
||||
</Switch>
|
||||
</CardContent>
|
||||
|
||||
</Card>
|
||||
|
||||
<Card class="flex-1">
|
||||
<CardHeader class="border-b border-border flex justify-between flex-row py-3 items-center">
|
||||
<CardTitle class="text-muted-foreground">
|
||||
Your token
|
||||
</CardTitle>
|
||||
|
||||
<div class="flex justify-center items-center gap-2">
|
||||
<Button onClick={refreshToken} variant="outline">
|
||||
<div class="i-tabler-refresh mr-2 text-base text-muted-foreground" />
|
||||
Refresh token
|
||||
</Button>
|
||||
|
||||
<CopyButton textToCopy={getToken} toastMessage={t('copy-toast')} />
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
<CardContent class="pt-6 text-center">
|
||||
{getToken()}
|
||||
</CardContent>
|
||||
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TokenGeneratorTool;
|
||||
@@ -0,0 +1,9 @@
|
||||
import { defineTool } from '../../tools.models';
|
||||
|
||||
export const tokenGeneratorTool = defineTool({
|
||||
slug: 'token-generator',
|
||||
entryFile: () => import('./token-generator.page'),
|
||||
icon: 'i-tabler-key',
|
||||
createdAt: new Date('2024-02-13'),
|
||||
dirName: 'token-generator',
|
||||
});
|
||||
43
packages/app/src/modules/tools/pages/tool.page.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { useI18n } from '@/modules/i18n/i18n.provider';
|
||||
import { safely } from '@corentinth/chisels';
|
||||
import { useParams } from '@solidjs/router';
|
||||
import { type Component, createResource, lazy, Show } from 'solid-js';
|
||||
import { CurrentToolProvider } from '../tools.provider';
|
||||
import { getToolDefinitionBySlug } from '../tools.registry';
|
||||
|
||||
export const ToolPage: Component = () => {
|
||||
const params = useParams();
|
||||
const { getLocale, t } = useI18n();
|
||||
|
||||
const toolDefinition = getToolDefinitionBySlug({ slug: params.toolSlug });
|
||||
const ToolComponent = lazy(toolDefinition.entryFile);
|
||||
|
||||
const [toolDict] = createResource(getLocale, async (locale) => {
|
||||
const [dict, error] = await safely(import(`../definitions/${toolDefinition.dirName}/locales/${locale}.json`));
|
||||
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
return dict ?? { default: {} };
|
||||
});
|
||||
|
||||
return (
|
||||
<Show when={toolDict()}>
|
||||
{toolLocaleDict => (
|
||||
<CurrentToolProvider
|
||||
toolLocaleDict={toolLocaleDict}
|
||||
tool={() => ({
|
||||
icon: toolDefinition.icon,
|
||||
dirName: toolDefinition.dirName,
|
||||
createdAt: toolDefinition.createdAt,
|
||||
name: t(`tools.${toolDefinition.slug}.name` as any),
|
||||
description: t(`tools.${toolDefinition.slug}.description` as any),
|
||||
})}
|
||||
>
|
||||
<ToolComponent />
|
||||
</CurrentToolProvider>
|
||||
)}
|
||||
</Show>
|
||||
);
|
||||
};
|
||||
16
packages/app/src/modules/tools/tools.models.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { Component } from 'solid-js';
|
||||
|
||||
export { defineTool };
|
||||
|
||||
function defineTool(toolDefinition: {
|
||||
slug: string;
|
||||
entryFile: () => Promise<{ default: Component }>;
|
||||
dirName: string;
|
||||
icon: string;
|
||||
createdAt: Date;
|
||||
}) {
|
||||
return {
|
||||
...toolDefinition,
|
||||
key: toolDefinition.slug,
|
||||
};
|
||||
}
|
||||
35
packages/app/src/modules/tools/tools.provider.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { Accessor, ParentComponent } from 'solid-js';
|
||||
import type { ToolDefinition } from './tools.types';
|
||||
import { flatten, translator } from '@solid-primitives/i18n';
|
||||
import { merge } from 'lodash-es';
|
||||
import { createContext, useContext } from 'solid-js';
|
||||
|
||||
type ToolProviderContext = {
|
||||
toolLocaleDict: Accessor<Record<string, string>>;
|
||||
tool: Accessor<Pick<ToolDefinition, 'icon' | 'dirName' | 'createdAt'> & { name: string; description: string }>;
|
||||
};
|
||||
|
||||
const CurrentToolContext = createContext<ToolProviderContext>();
|
||||
|
||||
export function useCurrentTool<T>({ defaultDictionary }: { defaultDictionary: T }) {
|
||||
const context = useContext(CurrentToolContext);
|
||||
|
||||
if (!context) {
|
||||
throw new Error('useCurrentTool must be used within a CurrentToolProvider');
|
||||
}
|
||||
|
||||
const { toolLocaleDict, tool } = context;
|
||||
|
||||
return {
|
||||
t: translator(() => flatten(merge({}, defaultDictionary, toolLocaleDict()))),
|
||||
getTool: tool,
|
||||
};
|
||||
}
|
||||
|
||||
export const CurrentToolProvider: ParentComponent<ToolProviderContext> = (props) => {
|
||||
return (
|
||||
<CurrentToolContext.Provider value={props}>
|
||||
{props.children}
|
||||
</CurrentToolContext.Provider>
|
||||
);
|
||||
};
|
||||
17
packages/app/src/modules/tools/tools.registry.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { keyBy, map } from 'lodash-es';
|
||||
import { randomPortGeneratorTool } from './definitions/random-port-generator/random-port-generator.tool';
|
||||
import { tokenGeneratorTool } from './definitions/token-generator/token-generator.tool';
|
||||
|
||||
export const toolDefinitions = [
|
||||
tokenGeneratorTool,
|
||||
randomPortGeneratorTool,
|
||||
];
|
||||
|
||||
export const toolSlugs = map(toolDefinitions, 'slug');
|
||||
export const toolDefinitionBySlug = keyBy(toolDefinitions, 'slug');
|
||||
|
||||
export { getToolDefinitionBySlug };
|
||||
|
||||
function getToolDefinitionBySlug({ slug }: { slug: string }) {
|
||||
return toolDefinitionBySlug[slug];
|
||||
}
|
||||
19
packages/app/src/modules/tools/tools.store.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createMemo } from 'solid-js';
|
||||
import { useI18n } from '../i18n/i18n.provider';
|
||||
import { toolDefinitions } from './tools.registry';
|
||||
|
||||
export { useToolsStore };
|
||||
|
||||
function useToolsStore() {
|
||||
const { t } = useI18n();
|
||||
|
||||
const getTools = createMemo(() => toolDefinitions.map((tool) => {
|
||||
return {
|
||||
...tool,
|
||||
name: t(`tools.${tool.slug}.name` as any) ?? tool.slug,
|
||||
description: t(`tools.${tool.slug}.description` as any) ?? tool.slug,
|
||||
};
|
||||
}));
|
||||
|
||||
return { getTools };
|
||||
}
|
||||
6
packages/app/src/modules/tools/tools.types.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { Flatten, Translator } from '@solid-primitives/i18n';
|
||||
import type { defineTool } from './tools.models';
|
||||
|
||||
export type ToolI18nFactory = <T extends Record<string, string>>(args: { defaultDictionary: T }) => { t: Translator<Flatten<T>> };
|
||||
|
||||
export type ToolDefinition = ReturnType<typeof defineTool>;
|
||||
37
packages/app/src/modules/ui/components/badge.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { VariantProps } from 'class-variance-authority';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { cva } from 'class-variance-authority';
|
||||
import { type ComponentProps, splitProps } from 'solid-js';
|
||||
|
||||
export const badgeVariants = cva(
|
||||
'inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold transition-shadow focus-visible:(outline-none ring-1.5 ring-ring)',
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/80',
|
||||
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
||||
destructive: 'bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
|
||||
outline: 'border text-foreground',
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
export function Badge(props: ComponentProps<'div'> & VariantProps<typeof badgeVariants>) {
|
||||
const [local, rest] = splitProps(props, ['class', 'variant']);
|
||||
|
||||
return (
|
||||
<div
|
||||
class={cn(
|
||||
badgeVariants({
|
||||
variant: local.variant,
|
||||
}),
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
60
packages/app/src/modules/ui/components/button.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { ButtonRootProps } from '@kobalte/core/button';
|
||||
import type { PolymorphicProps } from '@kobalte/core/polymorphic';
|
||||
import type { VariantProps } from 'class-variance-authority';
|
||||
import type { ValidComponent } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { Button as ButtonPrimitive } from '@kobalte/core/button';
|
||||
import { cva } from 'class-variance-authority';
|
||||
import { splitProps } from 'solid-js';
|
||||
|
||||
export const buttonVariants = cva(
|
||||
'inline-flex items-center justify-center rounded-md text-sm font-medium transition-shadow focus-visible:(outline-none ring-1.5 ring-ring) disabled:(pointer-events-none opacity-50) bg-inherit',
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
|
||||
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
|
||||
outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
|
||||
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
|
||||
ghost: 'hover:(bg-accent text-accent-foreground)',
|
||||
link: 'text-primary underline-offset-4 hover:underline',
|
||||
},
|
||||
size: {
|
||||
default: 'h-9 px-4 py-2',
|
||||
sm: 'h-8 px-3 text-xs',
|
||||
lg: 'h-10 px-8',
|
||||
icon: 'h-9 w-9',
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
size: 'default',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
type buttonProps<T extends ValidComponent = 'button'> = ButtonRootProps<T> &
|
||||
VariantProps<typeof buttonVariants> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function Button<T extends ValidComponent = 'button'>(props: PolymorphicProps<T, buttonProps<T>>) {
|
||||
const [local, rest] = splitProps(props as buttonProps, [
|
||||
'class',
|
||||
'variant',
|
||||
'size',
|
||||
]);
|
||||
|
||||
return (
|
||||
<ButtonPrimitive
|
||||
class={cn(
|
||||
buttonVariants({
|
||||
size: local.size,
|
||||
variant: local.variant,
|
||||
}),
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
60
packages/app/src/modules/ui/components/card.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { ComponentProps, ParentComponent } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { splitProps } from 'solid-js';
|
||||
|
||||
export function Card(props: ComponentProps<'div'>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<div
|
||||
class={cn(
|
||||
'rounded-xl border bg-card text-card-foreground shadow',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function CardHeader(props: ComponentProps<'div'>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<div class={cn('flex flex-col space-y-1.5 p-6', local.class)} {...rest} />
|
||||
);
|
||||
}
|
||||
|
||||
export const CardTitle: ParentComponent<ComponentProps<'h1'>> = (props) => {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<h1
|
||||
class={cn('font-semibold leading-none tracking-tight', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export const CardDescription: ParentComponent<ComponentProps<'h3'>> = (
|
||||
props,
|
||||
) => {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<h3 class={cn('text-sm text-muted-foreground', local.class)} {...rest} />
|
||||
);
|
||||
};
|
||||
|
||||
export function CardContent(props: ComponentProps<'div'>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return <div class={cn('p-6 pt-0', local.class)} {...rest} />;
|
||||
}
|
||||
|
||||
export function CardFooter(props: ComponentProps<'div'>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<div class={cn('flex items-center p-6 pt-0', local.class)} {...rest} />
|
||||
);
|
||||
}
|
||||
151
packages/app/src/modules/ui/components/command.tsx
Normal file
@@ -0,0 +1,151 @@
|
||||
import type {
|
||||
CommandDialogProps,
|
||||
CommandEmptyProps,
|
||||
CommandGroupProps,
|
||||
CommandInputProps,
|
||||
CommandItemProps,
|
||||
CommandListProps,
|
||||
CommandRootProps,
|
||||
} from 'cmdk-solid';
|
||||
import type { ComponentProps, VoidProps } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { Command as CommandPrimitive } from 'cmdk-solid';
|
||||
import { splitProps } from 'solid-js';
|
||||
import { Dialog, DialogContent } from './dialog';
|
||||
|
||||
export function Command(props: CommandRootProps) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<CommandPrimitive
|
||||
class={cn(
|
||||
'flex size-full flex-col overflow-hidden bg-popover text-popover-foreground',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function CommandList(props: CommandListProps) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<CommandPrimitive.List
|
||||
class={cn(
|
||||
'max-h-[300px] overflow-y-auto overflow-x-hidden p-1',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function CommandInput(props: VoidProps<CommandInputProps>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<div class="flex items-center border-b px-3" cmdk-input-wrapper="">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
class="mr-2 h-4 w-4 shrink-0 opacity-50"
|
||||
>
|
||||
<path
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m18 11l-6-6"
|
||||
/>
|
||||
<title>Search</title>
|
||||
</svg>
|
||||
<CommandPrimitive.Input
|
||||
class={cn(
|
||||
'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:(cursor-not-allowed opacity-50)',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function CommandItem(props: CommandItemProps) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<CommandPrimitive.Item
|
||||
class={cn(
|
||||
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5! text-sm outline-none aria-selected:(bg-accent text-accent-foreground) aria-disabled:(pointer-events-none opacity-50)',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function CommandShortcut(props: ComponentProps<'span'>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<span
|
||||
class={cn(
|
||||
'ml-auto text-xs tracking-widest text-muted-foreground',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function CommandDialog(props: CommandDialogProps) {
|
||||
const [local, rest] = splitProps(props, ['children']);
|
||||
|
||||
return (
|
||||
<Dialog {...rest}>
|
||||
<DialogContent class="overflow-hidden p-0">
|
||||
<Command class="[&_[cmdk-group-heading]]:(px-2 font-medium text-muted-foreground) [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:(px-2 py-3) [&_[cmdk-item]_svg]:size-5">
|
||||
{local.children}
|
||||
</Command>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
export function CommandEmpty(props: CommandEmptyProps) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<CommandPrimitive.Empty
|
||||
class={cn('py-6 text-center text-sm', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function CommandGroup(props: CommandGroupProps) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<CommandPrimitive.Group
|
||||
class={cn(
|
||||
'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:(px-2 py-1.5 text-xs font-medium text-muted-foreground)',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function CommandSeparator(props: CommandEmptyProps) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<CommandPrimitive.Separator
|
||||
class={cn('-mx-1 h-px bg-border', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
122
packages/app/src/modules/ui/components/dialog.tsx
Normal file
@@ -0,0 +1,122 @@
|
||||
import type {
|
||||
DialogContentProps,
|
||||
DialogDescriptionProps,
|
||||
DialogTitleProps,
|
||||
} from '@kobalte/core/dialog';
|
||||
import type { PolymorphicProps } from '@kobalte/core/polymorphic';
|
||||
import type { ComponentProps, ParentProps, ValidComponent } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { Dialog as DialogPrimitive } from '@kobalte/core/dialog';
|
||||
import { splitProps } from 'solid-js';
|
||||
|
||||
export const Dialog = DialogPrimitive;
|
||||
export const DialogTrigger = DialogPrimitive.Trigger;
|
||||
|
||||
type dialogContentProps<T extends ValidComponent = 'div'> = ParentProps<
|
||||
DialogContentProps<T> & {
|
||||
class?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
export function DialogContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dialogContentProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dialogContentProps, [
|
||||
'class',
|
||||
'children',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DialogPrimitive.Portal>
|
||||
<DialogPrimitive.Overlay
|
||||
class={cn(
|
||||
'fixed inset-0 z-50 bg-background/80 data-[expanded]:(animate-in fade-in-0) data-[closed]:(animate-out fade-out-0)',
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
<DialogPrimitive.Content
|
||||
class={cn(
|
||||
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[expanded]:(animate-in fade-in-0 zoom-in-95 slide-in-from-left-1/2 slide-in-from-top-48% duration-200) data-[closed]:(animate-out fade-out-0 zoom-out-95 slide-out-to-left-1/2 slide-out-to-top-48% duration-200) md:w-full sm:rounded-lg',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{local.children}
|
||||
<DialogPrimitive.CloseButton class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:(outline-none ring-1.5 ring-ring ring-offset-2) disabled:pointer-events-none bg-inherit transition-property-[opacity,box-shadow]">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
class="h-4 w-4"
|
||||
>
|
||||
<path
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M18 6L6 18M6 6l12 12"
|
||||
/>
|
||||
<title>Close</title>
|
||||
</svg>
|
||||
</DialogPrimitive.CloseButton>
|
||||
</DialogPrimitive.Content>
|
||||
</DialogPrimitive.Portal>
|
||||
);
|
||||
}
|
||||
|
||||
type dialogTitleProps<T extends ValidComponent = 'h2'> = DialogTitleProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function DialogTitle<T extends ValidComponent = 'h2'>(props: PolymorphicProps<T, dialogTitleProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dialogTitleProps, ['class']);
|
||||
|
||||
return (
|
||||
<DialogPrimitive.Title
|
||||
class={cn('text-lg font-semibold text-foreground', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type dialogDescriptionProps<T extends ValidComponent = 'p'> =
|
||||
DialogDescriptionProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function DialogDescription<T extends ValidComponent = 'p'>(props: PolymorphicProps<T, dialogDescriptionProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dialogDescriptionProps, ['class']);
|
||||
|
||||
return (
|
||||
<DialogPrimitive.Description
|
||||
class={cn('text-sm text-muted-foreground', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function DialogHeader(props: ComponentProps<'div'>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<div
|
||||
class={cn(
|
||||
'flex flex-col space-y-2 text-center sm:text-left',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function DialogFooter(props: ComponentProps<'div'>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<div
|
||||
class={cn(
|
||||
'flex flex-col-reverse sm:(flex-row justify-end space-x-2)',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
286
packages/app/src/modules/ui/components/dropdown-menu.tsx
Normal file
@@ -0,0 +1,286 @@
|
||||
import type {
|
||||
DropdownMenuCheckboxItemProps,
|
||||
DropdownMenuContentProps,
|
||||
DropdownMenuGroupLabelProps,
|
||||
DropdownMenuItemLabelProps,
|
||||
DropdownMenuItemProps,
|
||||
DropdownMenuRadioItemProps,
|
||||
DropdownMenuRootProps,
|
||||
DropdownMenuSeparatorProps,
|
||||
DropdownMenuSubTriggerProps,
|
||||
} from '@kobalte/core/dropdown-menu';
|
||||
import type { PolymorphicProps } from '@kobalte/core/polymorphic';
|
||||
import type { ComponentProps, ParentProps, ValidComponent } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { DropdownMenu as DropdownMenuPrimitive } from '@kobalte/core/dropdown-menu';
|
||||
import { mergeProps, splitProps } from 'solid-js';
|
||||
|
||||
export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
||||
export const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
||||
export const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
||||
export const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
||||
|
||||
export function DropdownMenu(props: DropdownMenuRootProps) {
|
||||
const merge = mergeProps<DropdownMenuRootProps[]>({ gutter: 4 }, props);
|
||||
|
||||
return <DropdownMenuPrimitive {...merge} />;
|
||||
}
|
||||
|
||||
type dropdownMenuContentProps<T extends ValidComponent = 'div'> =
|
||||
DropdownMenuContentProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function DropdownMenuContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuContentProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuContentProps, [
|
||||
'class',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.Portal>
|
||||
<DropdownMenuPrimitive.Content
|
||||
class={cn(
|
||||
'min-w-8rem z-50 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:(animate-in fade-in-0 zoom-in-95) data-[closed]:(animate-out fade-out-0 zoom-out-95) focus-visible:(outline-none ring-1.5 ring-ring) transition-shadow',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
</DropdownMenuPrimitive.Portal>
|
||||
);
|
||||
}
|
||||
|
||||
type dropdownMenuItemProps<T extends ValidComponent = 'div'> =
|
||||
DropdownMenuItemProps<T> & {
|
||||
class?: string;
|
||||
inset?: boolean;
|
||||
};
|
||||
|
||||
export function DropdownMenuItem<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuItemProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuItemProps, [
|
||||
'class',
|
||||
'inset',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.Item
|
||||
class={cn(
|
||||
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:(bg-accent text-accent-foreground) data-[disabled]:(pointer-events-none opacity-50)',
|
||||
local.inset && 'pl-8',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type dropdownMenuGroupLabelProps<T extends ValidComponent = 'span'> =
|
||||
DropdownMenuGroupLabelProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function DropdownMenuGroupLabel<T extends ValidComponent = 'span'>(props: PolymorphicProps<T, dropdownMenuGroupLabelProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuGroupLabelProps, [
|
||||
'class',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.GroupLabel
|
||||
as="div"
|
||||
class={cn('px-2 py-1.5 text-sm font-semibold', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type dropdownMenuItemLabelProps<T extends ValidComponent = 'div'> =
|
||||
DropdownMenuItemLabelProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function DropdownMenuItemLabel<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuItemLabelProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuItemLabelProps, [
|
||||
'class',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.ItemLabel
|
||||
as="div"
|
||||
class={cn('px-2 py-1.5 text-sm font-semibold', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type dropdownMenuSeparatorProps<T extends ValidComponent = 'hr'> =
|
||||
DropdownMenuSeparatorProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function DropdownMenuSeparator<T extends ValidComponent = 'hr'>(props: PolymorphicProps<T, dropdownMenuSeparatorProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuSeparatorProps, [
|
||||
'class',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.Separator
|
||||
class={cn('-mx-1 my-1 h-px bg-muted', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function DropdownMenuShortcut(props: ComponentProps<'span'>) {
|
||||
const [local, rest] = splitProps(props, ['class']);
|
||||
|
||||
return (
|
||||
<span
|
||||
class={cn('ml-auto text-xs tracking-widest opacity-60', local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type dropdownMenuSubTriggerProps<T extends ValidComponent = 'div'> = ParentProps<DropdownMenuSubTriggerProps<T> & { class?: string }>;
|
||||
|
||||
export function DropdownMenuSubTrigger<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuSubTriggerProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuSubTriggerProps, [
|
||||
'class',
|
||||
'children',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.SubTrigger
|
||||
class={cn(
|
||||
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[expanded]:bg-accent',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{local.children}
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="1em"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
class="ml-auto h-4 w-4"
|
||||
>
|
||||
<path
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="m9 6l6 6l-6 6"
|
||||
/>
|
||||
<title>Arrow</title>
|
||||
</svg>
|
||||
</DropdownMenuPrimitive.SubTrigger>
|
||||
);
|
||||
}
|
||||
|
||||
type dropdownMenuSubContentProps<T extends ValidComponent = 'div'> =
|
||||
DropdownMenuSubTriggerProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function DropdownMenuSubContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuSubContentProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuSubContentProps, [
|
||||
'class',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.Portal>
|
||||
<DropdownMenuPrimitive.SubContent
|
||||
class={cn(
|
||||
'min-w-8rem z-50 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:(animate-in fade-in-0 zoom-in-95) data-[closed]:(animate-out fade-out-0 zoom-out-95)',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
</DropdownMenuPrimitive.Portal>
|
||||
);
|
||||
}
|
||||
|
||||
type dropdownMenuCheckboxItemProps<T extends ValidComponent = 'div'> = ParentProps<DropdownMenuCheckboxItemProps<T> & { class?: string }>;
|
||||
|
||||
export function DropdownMenuCheckboxItem<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuCheckboxItemProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuCheckboxItemProps, [
|
||||
'class',
|
||||
'children',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.CheckboxItem
|
||||
class={cn(
|
||||
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:(bg-accent text-accent-foreground) data-[disabled]:(pointer-events-none opacity-50)',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
<DropdownMenuPrimitive.ItemIndicator class="absolute left-2 inline-flex h-4 w-4 items-center justify-center">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
class="h-4 w-4"
|
||||
>
|
||||
<path
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="m5 12l5 5L20 7"
|
||||
/>
|
||||
<title>Checkbox</title>
|
||||
</svg>
|
||||
</DropdownMenuPrimitive.ItemIndicator>
|
||||
{props.children}
|
||||
</DropdownMenuPrimitive.CheckboxItem>
|
||||
);
|
||||
}
|
||||
|
||||
type dropdownMenuRadioItemProps<T extends ValidComponent = 'div'> = ParentProps<
|
||||
DropdownMenuRadioItemProps<T> & {
|
||||
class?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
export function DropdownMenuRadioItem<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuRadioItemProps<T>>) {
|
||||
const [local, rest] = splitProps(props as dropdownMenuRadioItemProps, [
|
||||
'class',
|
||||
'children',
|
||||
]);
|
||||
|
||||
return (
|
||||
<DropdownMenuPrimitive.RadioItem
|
||||
class={cn(
|
||||
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:(bg-accent text-accent-foreground) data-[disabled]:(pointer-events-none opacity-50)',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
<DropdownMenuPrimitive.ItemIndicator class="absolute left-2 inline-flex h-4 w-4 items-center justify-center">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
class="h-2 w-2"
|
||||
>
|
||||
<g
|
||||
fill="none"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
>
|
||||
<path d="M0 0h24v24H0z" />
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M7 3.34a10 10 0 1 1-4.995 8.984L2 12l.005-.324A10 10 0 0 1 7 3.34"
|
||||
/>
|
||||
</g>
|
||||
<title>Radio</title>
|
||||
</svg>
|
||||
</DropdownMenuPrimitive.ItemIndicator>
|
||||
{props.children}
|
||||
</DropdownMenuPrimitive.RadioItem>
|
||||
);
|
||||
}
|
||||
20
packages/app/src/modules/ui/components/sonner.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Toaster as Sonner, toast } from 'solid-sonner';
|
||||
|
||||
export { toast };
|
||||
|
||||
export function Toaster(props: Parameters<typeof Sonner>[0]) {
|
||||
return (
|
||||
<Sonner
|
||||
class="toaster group"
|
||||
toastOptions={{
|
||||
classes: {
|
||||
toast: 'group toast group-[.toaster]:(bg-background text-foreground border-border shadow-lg)',
|
||||
description: 'group-[.toast]:text-muted-foreground',
|
||||
actionButton: 'group-[.toast]:(bg-primary text-primary-foreground)',
|
||||
cancelButton: 'group-[.toast]:(bg-muted text-muted-foreground)',
|
||||
},
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
54
packages/app/src/modules/ui/components/switch.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
import type { PolymorphicProps } from '@kobalte/core/polymorphic';
|
||||
import type {
|
||||
SwitchControlProps,
|
||||
SwitchThumbProps,
|
||||
} from '@kobalte/core/switch';
|
||||
import type { ParentProps, ValidComponent, VoidProps } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { Switch as SwitchPrimitive } from '@kobalte/core/switch';
|
||||
import { splitProps } from 'solid-js';
|
||||
|
||||
export const SwitchLabel = SwitchPrimitive.Label;
|
||||
export const Switch = SwitchPrimitive;
|
||||
export const SwitchErrorMessage = SwitchPrimitive.ErrorMessage;
|
||||
export const SwitchDescription = SwitchPrimitive.Description;
|
||||
|
||||
type switchControlProps<T extends ValidComponent = 'input'> = ParentProps<SwitchControlProps<T> & { class?: string }>;
|
||||
|
||||
export function SwitchControl<T extends ValidComponent = 'input'>(props: PolymorphicProps<T, switchControlProps<T>>) {
|
||||
const [local, rest] = splitProps(props as switchControlProps, [
|
||||
'class',
|
||||
'children',
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SwitchPrimitive.Input class="[&:focus-visible+div]:(outline-none ring-1.5 ring-ring ring-offset-2 ring-offset-background)" />
|
||||
<SwitchPrimitive.Control
|
||||
class={cn(
|
||||
'inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input shadow-sm transition-shadow data-[disabled]:(cursor-not-allowed opacity-50) data-[checked]:bg-primary transition-property-[box-shadow,color,background-color]',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{local.children}
|
||||
</SwitchPrimitive.Control>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
type switchThumbProps<T extends ValidComponent = 'div'> = VoidProps<SwitchThumbProps<T> & { class?: string }>;
|
||||
|
||||
export function SwitchThumb<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, switchThumbProps<T>>) {
|
||||
const [local, rest] = splitProps(props as switchThumbProps, ['class']);
|
||||
|
||||
return (
|
||||
<SwitchPrimitive.Thumb
|
||||
class={cn(
|
||||
'pointer-events-none block h-4 w-4 translate-x-0 rounded-full bg-background shadow-lg transition-transform data-[checked]:translate-x-4',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
26
packages/app/src/modules/ui/components/textarea.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { PolymorphicProps } from '@kobalte/core/polymorphic';
|
||||
import type { TextFieldTextAreaProps } from '@kobalte/core/text-field';
|
||||
import type { ValidComponent, VoidProps } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { TextArea as TextFieldPrimitive } from '@kobalte/core/text-field';
|
||||
import { splitProps } from 'solid-js';
|
||||
|
||||
type textAreaProps<T extends ValidComponent = 'textarea'> = VoidProps<
|
||||
TextFieldTextAreaProps<T> & {
|
||||
class?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
export function TextArea<T extends ValidComponent = 'textarea'>(props: PolymorphicProps<T, textAreaProps<T>>) {
|
||||
const [local, rest] = splitProps(props as textAreaProps, ['class']);
|
||||
|
||||
return (
|
||||
<TextFieldPrimitive
|
||||
class={cn(
|
||||
'flex min-h-[60px] w-full rounded-md border border-input bg-inherit px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:(outline-none ring-1.5 ring-ring) disabled:(cursor-not-allowed opacity-50) transition-shadow',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
116
packages/app/src/modules/ui/components/textfield.tsx
Normal file
@@ -0,0 +1,116 @@
|
||||
import type { PolymorphicProps } from '@kobalte/core/polymorphic';
|
||||
import type {
|
||||
TextFieldDescriptionProps,
|
||||
TextFieldErrorMessageProps,
|
||||
TextFieldInputProps,
|
||||
TextFieldLabelProps,
|
||||
TextFieldRootProps,
|
||||
} from '@kobalte/core/text-field';
|
||||
import type { ValidComponent, VoidProps } from 'solid-js';
|
||||
import { cn } from '@/modules/ui/utils/cn';
|
||||
import { TextField as TextFieldPrimitive } from '@kobalte/core/text-field';
|
||||
import { cva } from 'class-variance-authority';
|
||||
import { splitProps } from 'solid-js';
|
||||
|
||||
type textFieldProps<T extends ValidComponent = 'div'> =
|
||||
TextFieldRootProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function TextFieldRoot<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, textFieldProps<T>>) {
|
||||
const [local, rest] = splitProps(props as textFieldProps, ['class']);
|
||||
|
||||
return <TextFieldPrimitive class={cn('space-y-1', local.class)} {...rest} />;
|
||||
}
|
||||
|
||||
export const textfieldLabel = cva(
|
||||
'text-sm data-[disabled]:(cursor-not-allowed opacity-70) font-medium',
|
||||
{
|
||||
variants: {
|
||||
label: {
|
||||
true: 'data-[invalid]:text-destructive',
|
||||
},
|
||||
error: {
|
||||
true: 'text-destructive text-xs',
|
||||
},
|
||||
description: {
|
||||
true: 'font-normal text-muted-foreground',
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
label: true,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
type textFieldLabelProps<T extends ValidComponent = 'label'> =
|
||||
TextFieldLabelProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function TextFieldLabel<T extends ValidComponent = 'label'>(props: PolymorphicProps<T, textFieldLabelProps<T>>) {
|
||||
const [local, rest] = splitProps(props as textFieldLabelProps, ['class']);
|
||||
|
||||
return (
|
||||
<TextFieldPrimitive.Label
|
||||
class={cn(textfieldLabel(), local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type textFieldErrorMessageProps<T extends ValidComponent = 'div'> =
|
||||
TextFieldErrorMessageProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function TextFieldErrorMessage<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, textFieldErrorMessageProps<T>>) {
|
||||
const [local, rest] = splitProps(props as textFieldErrorMessageProps, [
|
||||
'class',
|
||||
]);
|
||||
|
||||
return (
|
||||
<TextFieldPrimitive.ErrorMessage
|
||||
class={cn(textfieldLabel({ error: true }), local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type textFieldDescriptionProps<T extends ValidComponent = 'div'> =
|
||||
TextFieldDescriptionProps<T> & {
|
||||
class?: string;
|
||||
};
|
||||
|
||||
export function TextFieldDescription<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, textFieldDescriptionProps<T>>) {
|
||||
const [local, rest] = splitProps(props as textFieldDescriptionProps, [
|
||||
'class',
|
||||
]);
|
||||
|
||||
return (
|
||||
<TextFieldPrimitive.Description
|
||||
class={cn(textfieldLabel({ description: true }), local.class)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type textFieldInputProps<T extends ValidComponent = 'input'> = VoidProps<
|
||||
TextFieldInputProps<T> & {
|
||||
class?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
export function TextField<T extends ValidComponent = 'input'>(props: PolymorphicProps<T, textFieldInputProps<T>>) {
|
||||
const [local, rest] = splitProps(props as textFieldInputProps, ['class']);
|
||||
|
||||
return (
|
||||
<TextFieldPrimitive.Input
|
||||
class={cn(
|
||||
'flex h-9 w-full rounded-md border border-input bg-inherit px-3 py-1 text-sm shadow-sm file:(border-0 bg-transparent text-sm font-medium) placeholder:text-muted-foreground focus-visible:(outline-none ring-1.5 ring-ring) disabled:(cursor-not-allowed opacity-50) transition-shadow',
|
||||
local.class,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
279
packages/app/src/modules/ui/layouts/app.layout.tsx
Normal file
@@ -0,0 +1,279 @@
|
||||
import type { Component, ParentComponent } from 'solid-js';
|
||||
import { useCommandPalette } from '@/modules/command-palette/command-palette.provider';
|
||||
import { useI18n } from '@/modules/i18n/i18n.provider';
|
||||
import { Button } from '@/modules/ui/components/button';
|
||||
import { A } from '@solidjs/router';
|
||||
import { Badge } from '../components/badge';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from '../components/dropdown-menu';
|
||||
import { useThemeStore } from '../themes/theme.store';
|
||||
import { cn } from '../utils/cn';
|
||||
import { socialLinks } from './app.layouts.constants';
|
||||
|
||||
const ThemeSwitcher: Component = () => {
|
||||
const themeStore = useThemeStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
return (
|
||||
<>
|
||||
<DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'light' })} class="flex items-center gap-2 cursor-pointer">
|
||||
<div class="i-tabler-sun text-lg"></div>
|
||||
{t('navbar.theme.light-mode')}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'dark' })} class="flex items-center gap-2 cursor-pointer">
|
||||
<div class="i-tabler-moon text-lg"></div>
|
||||
{t('navbar.theme.dark-mode')}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'system' })} class="flex items-center gap-2 cursor-pointer">
|
||||
<div class="i-tabler-device-laptop text-lg"></div>
|
||||
{t('navbar.theme.system-mode')}
|
||||
</DropdownMenuItem>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const LanguageSwitcher: Component = () => {
|
||||
const { t, getLocale, changeLocale, locales } = useI18n();
|
||||
|
||||
return (
|
||||
<>
|
||||
{locales.map(locale => (
|
||||
<DropdownMenuItem onClick={() => changeLocale(locale.key)} class={cn('flex items-center gap-2 cursor-pointer', { 'font-semibold': getLocale() === locale.key })}>
|
||||
{locale.name}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem as="a" class="flex items-center gap-2 cursor-pointer" target="_blank" rel="noopener noreferrer" href="https://github.com/CorentinTh/it-tools">
|
||||
{t('navbar.contribute-to-i18n')}
|
||||
</DropdownMenuItem>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export const Navbar: Component = () => {
|
||||
const themeStore = useThemeStore();
|
||||
const { t } = useI18n();
|
||||
const { openCommandPalette } = useCommandPalette();
|
||||
const getIsMacOs = () => navigator?.userAgent?.match(/Macintosh;/);
|
||||
|
||||
return (
|
||||
<div class="border-b border-border bg-surface">
|
||||
<div class="flex items-center justify-between px-6 py-3 mx-auto max-w-1200px">
|
||||
<div class="flex items-center gap-4">
|
||||
<Button variant="link" class="text-xl font-semibold border-b border-transparent hover:no-underline h-auto py-0 px-1 ml--1 rounded-none !transition-border-color-250" as={A} href="/" aria-label="Home">
|
||||
<span class="font-bold text-foreground">IT</span>
|
||||
<span class="text-80% font-extrabold border border-2px leading-none border-current rounded-md px-1 py-0.5 ml-1 text-primary">TOOLS</span>
|
||||
</Button>
|
||||
|
||||
<Button size="sm" variant="outline" class="bg-card transition flex items-center gap-2 text-muted-foreground" onClick={openCommandPalette}>
|
||||
<div class="i-tabler-search text-base"></div>
|
||||
{t('commandPalette.trigger.search')}
|
||||
<Badge variant="secondary" class="text-muted-foreground text-10px!">
|
||||
{getIsMacOs() ? '⌘ + K' : 'Ctrl + K'}
|
||||
</Badge>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<Button variant="ghost" class="text-lg px-0 size-9 hidden md:inline-flex" as={A} href="https://github.com/CorentinTh/enclosed" target="_blank" rel="noopener noreferrer" aria-label="GitHub repository">
|
||||
<div class="i-tabler-brand-github"></div>
|
||||
</Button>
|
||||
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger as={Button} class="text-lg px-0 size-9 hidden md:inline-flex" variant="ghost" aria-label="Change theme">
|
||||
<div classList={{ 'i-tabler-moon': themeStore.getColorMode() === 'dark', 'i-tabler-sun': themeStore.getColorMode() === 'light' }}></div>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent class="w-42">
|
||||
<ThemeSwitcher />
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger as={Button} class="text-lg px-0 size-9 hidden md:inline-flex" variant="ghost" aria-label="Language">
|
||||
<div class="i-custom-language size-4"></div>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<LanguageSwitcher />
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
<DropdownMenu>
|
||||
|
||||
<DropdownMenuTrigger as={Button} class="text-lg px-0 size-9" variant="ghost" aria-label="Menu icon">
|
||||
<div class="i-tabler-dots-vertical hidden md:block"></div>
|
||||
<div class="i-tabler-menu-2 block md:hidden"></div>
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent class="w-46">
|
||||
|
||||
{/* Mobile only items */}
|
||||
<DropdownMenuItem as="a" class="flex items-center gap-2 cursor-pointer md:hidden" target="_blank" href="https://github.com/CorentinTh/enclosed" rel="noopener noreferrer">
|
||||
<div class="i-tabler-brand-github text-lg"></div>
|
||||
{t('navbar.github')}
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuSub>
|
||||
<DropdownMenuSubTrigger as="a" class="flex items-center gap-2 md:hidden" aria-label="Change theme">
|
||||
<div class="text-lg" classList={{ 'i-tabler-moon': themeStore.getColorMode() === 'dark', 'i-tabler-sun': themeStore.getColorMode() === 'light' }}></div>
|
||||
{t('navbar.theme.theme')}
|
||||
</DropdownMenuSubTrigger>
|
||||
|
||||
<DropdownMenuSubContent>
|
||||
<ThemeSwitcher />
|
||||
</DropdownMenuSubContent>
|
||||
|
||||
</DropdownMenuSub>
|
||||
|
||||
<DropdownMenuSub>
|
||||
<DropdownMenuSubTrigger as="a" class="flex items-center text-medium gap-2 md:hidden" aria-label="Change language">
|
||||
<div class="i-custom-language size-4"></div>
|
||||
{t('navbar.language')}
|
||||
</DropdownMenuSubTrigger>
|
||||
<DropdownMenuSubContent>
|
||||
<LanguageSwitcher />
|
||||
</DropdownMenuSubContent>
|
||||
</DropdownMenuSub>
|
||||
|
||||
{/* Default items */}
|
||||
|
||||
<DropdownMenuItem as="a" class="flex items-center gap-2 cursor-pointer" target="_blank" href="https://github.com/CorentinTh/it-tools/issues/new/choose" rel="noopener noreferrer">
|
||||
<div class="i-tabler-bug text-lg"></div>
|
||||
{t('navbar.report-bug')}
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuItem as="a" class="flex items-center gap-2 cursor-pointer" target="_blank" href="https://buymeacoffee.com/cthmsst" rel="noopener noreferrer">
|
||||
<div class="i-tabler-pig-money text-lg"></div>
|
||||
{t('navbar.support')}
|
||||
</DropdownMenuItem>
|
||||
|
||||
</DropdownMenuContent>
|
||||
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const Footer: Component = () => {
|
||||
const { t, createLocalizedUrl } = useI18n();
|
||||
|
||||
const getFooterSections = () => [
|
||||
{
|
||||
title: t('footer.resources.title'),
|
||||
items: [
|
||||
{ label: t('footer.resources.all-tools'), to: createLocalizedUrl({ path: '/tools' }) },
|
||||
{ label: t('footer.resources.github'), href: 'https://github.com/CorentinTh/it-tools' },
|
||||
{ label: t('footer.resources.support'), href: 'https://buymeacoffee.com/cthmsst' },
|
||||
{ label: 'Humans.txt', href: '/humans.txt' },
|
||||
{ label: t('footer.resources.license'), href: 'https://github.com/CorentinTh/it-tools/blob/main/LICENSE' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: t('footer.support.title'),
|
||||
items: [
|
||||
{ label: t('footer.support.report-bug'), href: 'https://github.com/CorentinTh/it-tools/issues/new/choose' },
|
||||
{ label: t('footer.support.request-feature'), href: 'https://github.com/CorentinTh/it-tools/issues/new/choose' },
|
||||
{ label: t('footer.support.contribute'), href: 'https://github.com/CorentinTh/it-tools/blob/main/CONTRIBUTING.md' },
|
||||
{ label: t('footer.support.contact'), href: 'https://github.com/CorentinTh/it-tools/issues/new/choose' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: t('footer.friends.title'),
|
||||
items: [
|
||||
{ label: 'Jugly.io', href: 'https://jugly.io' },
|
||||
{ label: 'Enclosed.cc', href: 'https://enclosed.cc' },
|
||||
],
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
return (
|
||||
<footer class="bg-card border-t border-border">
|
||||
<div class="py-12 px-6 mx-auto max-w-1200px">
|
||||
|
||||
<div class="flex items-start justify-between flex-col md:flex-row gap-12">
|
||||
<div>
|
||||
<div class="flex items-center gap-2">
|
||||
<A href="/" class="text-2xl font-semibold border-b border-transparent hover:no-underline h-auto py-0 px-1 ml--1 rounded-none !transition-border-color-250 group text-muted-foreground flex items-center gap-1">
|
||||
<span class="font-bold group-hover:text-foreground transition">IT</span>
|
||||
<span class="text-80% font-extrabold border border-2px leading-none border-current rounded-md px-1 py-0.5 ml-1 group-hover:text-primary transition">TOOLS</span>
|
||||
</A>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 mt-4">
|
||||
{socialLinks.map(({ icon, href, label }) => (
|
||||
<a href={href} target="_blank" rel="noopener noreferrer" class="text-2xl text-muted-foreground hover:text-primary transition" aria-label={label}>
|
||||
<div class={icon}></div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div class="text-muted-foreground mt-2">
|
||||
Crafted with
|
||||
{' '}
|
||||
<span class="i-tabler-heart inline-block text-base mb--0.5"></span>
|
||||
{' '}
|
||||
by
|
||||
{' '}
|
||||
<a href="https://corentin.tech" target="_blank" rel="noopener" class="hover:text-primary transition">
|
||||
Corentin Thomasset
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 gap-12">
|
||||
{getFooterSections().map(({ title, items }) => (
|
||||
<div>
|
||||
<h4 class="font-semibold text-foreground">{title}</h4>
|
||||
<ul class="mt-4">
|
||||
{items.map(({ label, to, href }) => (
|
||||
<li class="mt-1">
|
||||
{to
|
||||
? (
|
||||
<A href={to} class="text-muted-foreground hover:text-primary transition">
|
||||
{label}
|
||||
</A>
|
||||
)
|
||||
: (
|
||||
<a href={href} target="_blank" rel="noopener" class="text-muted-foreground hover:text-primary transition">
|
||||
{label}
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-xs text-muted-foreground border-t border-border pt-4 mt-12">
|
||||
<span>
|
||||
©
|
||||
{new Date().getFullYear()}
|
||||
{' '}
|
||||
Corentin Thomasset
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-xs text-foreground opacity-80%">
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
|
||||
export const AppLayout: ParentComponent = (props) => {
|
||||
return (
|
||||
<div class="flex flex-col h-screen min-h-0">
|
||||
|
||||
<Navbar />
|
||||
|
||||
<div class="flex-1 pb-20 ">{props.children}</div>
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
17
packages/app/src/modules/ui/layouts/app.layouts.constants.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export const socialLinks = [
|
||||
{
|
||||
icon: 'i-tabler-brand-github',
|
||||
href: 'https://github.com/CorentinTh/it-tools',
|
||||
label: 'GitHub',
|
||||
},
|
||||
{
|
||||
icon: 'i-tabler-brand-x',
|
||||
href: 'https://x.com/ittoolsdottech',
|
||||
label: 'X',
|
||||
},
|
||||
{
|
||||
icon: 'i-tabler-coffee',
|
||||
href: 'https://buymeacoffee.com/cthmsst',
|
||||
label: 'Support the project',
|
||||
},
|
||||
];
|
||||
11
packages/app/src/modules/ui/themes/theme.store.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { ConfigColorMode } from '@kobalte/core/color-mode';
|
||||
import { useColorMode } from '@kobalte/core/color-mode';
|
||||
|
||||
export function useThemeStore() {
|
||||
const { setColorMode, colorMode: getColorMode } = useColorMode();
|
||||
|
||||
return {
|
||||
setColorMode: ({ mode }: { mode: ConfigColorMode }) => setColorMode(mode),
|
||||
getColorMode,
|
||||
};
|
||||
}
|
||||
5
packages/app/src/modules/ui/utils/cn.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { ClassValue } from 'clsx';
|
||||
import clsx from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
export const cn = (...classLists: ClassValue[]) => twMerge(clsx(classLists));
|
||||
12
packages/app/templates/tools/new/tool.definition.ejs.t
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
to: src/modules/tools/definitions/<%= h.changeCase.param(name) %>/<%= h.changeCase.param(name) %>.tool.ts
|
||||
---
|
||||
import { defineTool } from '../../tools.models'
|
||||
|
||||
export const <%= h.changeCase.camel(name) %>Tool = defineTool({
|
||||
slug: '<%= h.changeCase.param(name) %>',
|
||||
entryFile: () => import('./<%= h.changeCase.param(name) %>.page'),
|
||||
icon: 'i-tabler-question-mark',
|
||||
createdAt: new Date('<%= new Date().toISOString().split('T')[0] %>'),
|
||||
dirName: '<%= h.changeCase.param(name) %>',
|
||||
})
|
||||
4
packages/app/templates/tools/new/tool.en.locale.ejs.t
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
to: src/modules/tools/definitions/<%= h.changeCase.param(name) %>/locales/en.json
|
||||
---
|
||||
{}
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
inject: true
|
||||
to: src/modules/tools/tools.registry.ts
|
||||
at_line: 0
|
||||
---
|
||||
import { <%= h.changeCase.camel(name) %>Tool } from './definitions/<%= h.changeCase.param(name) %>/<%= h.changeCase.param(name) %>.tool';
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
inject: true
|
||||
to: src/modules/tools/tools.registry.ts
|
||||
before: "^]"
|
||||
---
|
||||
<%= h.changeCase.camel(name) %>Tool,
|
||||
14
packages/app/templates/tools/new/tool.page.ejs.t
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
to: src/modules/tools/definitions/<%= h.changeCase.param(name) %>/<%= h.changeCase.param(name) %>.page.tsx
|
||||
---
|
||||
import type { Component } from 'solid-js';
|
||||
|
||||
const <%= h.changeCase.pascal(name) %>: Component = () => {
|
||||
return (
|
||||
<div class="mx-auto max-w-1200px p-6">
|
||||
<h1><%= h.changeCase.title(name) %></h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default <%= h.changeCase.pascal(name) %>;
|
||||
22
packages/app/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "solid-js",
|
||||
"baseUrl": "./",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
},
|
||||
"resolveJsonModule": true,
|
||||
"types": ["vite/client"],
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"isolatedModules": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
120
packages/app/uno.config.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import {
|
||||
defineConfig,
|
||||
presetIcons,
|
||||
presetUno,
|
||||
presetWebFonts,
|
||||
transformerDirectives,
|
||||
transformerVariantGroup,
|
||||
} from 'unocss';
|
||||
import presetAnimations from 'unocss-preset-animations';
|
||||
import { toolDefinitions } from './src/modules/tools/tools.registry';
|
||||
import { socialLinks } from './src/modules/ui/layouts/app.layouts.constants';
|
||||
|
||||
export default defineConfig({
|
||||
presets: [
|
||||
presetUno({
|
||||
dark: {
|
||||
dark: '[data-kb-theme="dark"]',
|
||||
light: '[data-kb-theme="light"]',
|
||||
},
|
||||
prefix: '',
|
||||
}),
|
||||
presetAnimations(),
|
||||
presetWebFonts({
|
||||
fonts: {
|
||||
sans: 'Inter:400,500,600,700,800,900',
|
||||
},
|
||||
}),
|
||||
presetIcons({
|
||||
collections: {
|
||||
custom: {
|
||||
language: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 512 512"><path fill="currentColor" d="m478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4ZM334.83 362L368 281.65L401.17 362Zm-66.99-19.08a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9Z" /></svg>',
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
transformers: [transformerVariantGroup(), transformerDirectives()],
|
||||
theme: {
|
||||
colors: {
|
||||
border: 'hsl(var(--border))',
|
||||
input: 'hsl(var(--input))',
|
||||
ring: 'hsl(var(--ring))',
|
||||
background: 'hsl(var(--background))',
|
||||
foreground: 'hsl(var(--foreground))',
|
||||
primary: {
|
||||
DEFAULT: 'hsl(var(--primary))',
|
||||
foreground: 'hsl(var(--primary-foreground))',
|
||||
},
|
||||
secondary: {
|
||||
DEFAULT: 'hsl(var(--secondary))',
|
||||
foreground: 'hsl(var(--secondary-foreground))',
|
||||
},
|
||||
destructive: {
|
||||
DEFAULT: 'hsl(var(--destructive))',
|
||||
foreground: 'hsl(var(--destructive-foreground))',
|
||||
},
|
||||
warning: {
|
||||
DEFAULT: 'hsl(var(--warning))',
|
||||
foreground: 'hsl(var(--warning-foreground))',
|
||||
},
|
||||
muted: {
|
||||
DEFAULT: 'hsl(var(--muted))',
|
||||
foreground: 'hsl(var(--muted-foreground))',
|
||||
},
|
||||
accent: {
|
||||
DEFAULT: 'hsl(var(--accent))',
|
||||
foreground: 'hsl(var(--accent-foreground))',
|
||||
},
|
||||
popover: {
|
||||
DEFAULT: 'hsl(var(--popover))',
|
||||
foreground: 'hsl(var(--popover-foreground))',
|
||||
},
|
||||
card: {
|
||||
DEFAULT: 'hsl(var(--card))',
|
||||
foreground: 'hsl(var(--card-foreground))',
|
||||
},
|
||||
},
|
||||
borderRadius: {
|
||||
lg: 'var(--radius)',
|
||||
md: 'calc(var(--radius) - 2px)',
|
||||
sm: 'calc(var(--radius) - 4px)',
|
||||
},
|
||||
animation: {
|
||||
keyframes: {
|
||||
'accordion-down':
|
||||
'{ from { height: 0 } to { height: var(--kb-accordion-content-height) } }',
|
||||
'accordion-up':
|
||||
'{ from { height: var(--kb-accordion-content-height) } to { height: 0 } }',
|
||||
'collapsible-down':
|
||||
'{ from { height: 0 } to { height: var(--kb-collapsible-content-height) } }',
|
||||
'collapsible-up':
|
||||
'{ from { height: var(--kb-collapsible-content-height) } to { height: 0 } }',
|
||||
'caret-blink': '{ 0%,70%,100% { opacity: 1 } 20%,50% { opacity: 0 } }',
|
||||
},
|
||||
timingFns: {
|
||||
'accordion-down': 'ease-out',
|
||||
'accordion-up': 'ease-out',
|
||||
'collapsible-down': 'ease-out',
|
||||
'collapsible-up': 'ease-out',
|
||||
'caret-blink': 'ease-out',
|
||||
},
|
||||
durations: {
|
||||
'accordion-down': '0.2s',
|
||||
'accordion-up': '0.2s',
|
||||
'collapsible-down': '0.2s',
|
||||
'collapsible-up': '0.2s',
|
||||
'caret-blink': '1.25s',
|
||||
},
|
||||
counts: {
|
||||
'caret-blink': 'infinite',
|
||||
},
|
||||
},
|
||||
},
|
||||
safelist: [
|
||||
...toolDefinitions.map(tool => tool.icon),
|
||||
...socialLinks.map(({ icon }) => icon),
|
||||
],
|
||||
shortcuts: {
|
||||
'i-logo': 'i-tabler-terminal',
|
||||
},
|
||||
});
|
||||
33
packages/app/vite.config.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import path from 'node:path';
|
||||
import unoCssPlugin from 'unocss/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import solidPlugin from 'vite-plugin-solid';
|
||||
import { configDefaults } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
unoCssPlugin(),
|
||||
solidPlugin(),
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8787',
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
target: 'esnext',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
exclude: [
|
||||
...configDefaults.exclude,
|
||||
'**/*.e2e.test.ts',
|
||||
],
|
||||
},
|
||||
});
|
||||
6811
pnpm-lock.yaml
generated
Normal file
2
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
packages:
|
||||
- 'packages/*'
|
||||
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 71 KiB |
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square150x150logo src="/mstile-150x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
@@ -1,6 +0,0 @@
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="726.000000pt" height="726.000000pt" viewBox="0 0 726.000000 726.000000">
|
||||
<g transform="translate(0.000000,726.000000) scale(0.100000,-0.100000)" stroke="none">
|
||||
<path fill="#18a058" d="M3255 7239 c-112 -39 -191 -120 -230 -238 -14 -43 -17 -88 -17 -237 0 -144 -3 -186 -14 -195 -8 -6 -14 -9 -14 -6 0 3 -23 -1 -52 -9 -28 -9 -60 -17 -71 -19 -10 -3 -28 -7 -40 -11 -12 -5 -26 -8 -32 -9 -5 -1 -17 -4 -25 -7 -8 -3 -53 -19 -100 -34 -47 -15 -89 -31 -94 -36 -6 -4 -16 -8 -24 -8 -15 0 -68 -22 -114 -46 -16 -9 -28 -12 -28 -7 0 4 -4 4 -8 -2 -6 -9 -103 -58 -109 -56 -2 0 -46 -24 -99 -54 -53 -30 -100 -55 -105 -55 -5 0 -9 -3 -9 -7 0 -9 -57 -43 -71 -43 -5 0 -69 60 -142 133 -132 130 -163 152 -264 185 -76 24 -223 -4 -292 -57 -56 -42 -441 -432 -466 -471 -60 -96 -75 -246 -32 -325 6 -11 12 -25 13 -32 4 -23 60 -88 177 -205 64 -64 117 -120 117 -123 0 -4 -13 -25 -29 -48 -15 -23 -31 -52 -35 -64 -4 -13 -11 -23 -15 -23 -5 0 -14 -15 -22 -32 -7 -18 -16 -35 -19 -38 -5 -4 -82 -157 -85 -170 -1 -3 -9 -23 -19 -45 -41 -92 -103 -255 -111 -290 -1 -5 -5 -17 -8 -25 -9 -20 -47 -164 -59 -222 -6 -27 -13 -48 -17 -49 -3 0 -91 -2 -196 -3 -105 -1 -208 -8 -231 -14 -120 -35 -230 -160 -251 -287 -5 -27 -8 -185 -7 -350 1 -282 3 -303 23 -357 41 -106 113 -177 222 -220 48 -18 77 -21 249 -22 l195 -1 13 -50 c7 -27 15 -58 17 -68 2 -10 7 -27 10 -37 3 -10 7 -27 9 -37 15 -75 116 -345 128 -341 5 2 186 180 402 396 l393 393 -8 44 c-24 126 -32 424 -15 550 5 33 9 71 10 85 10 99 86 364 138 480 70 156 158 310 222 392 12 14 32 41 46 59 85 113 253 277 380 372 116 87 304 191 440 244 120 47 141 55 155 58 6 2 35 10 65 19 30 8 73 18 95 22 22 3 44 8 48 11 4 2 22 7 40 9 18 3 43 7 57 9 112 18 365 24 485 11 299 -32 547 -112 810 -260 39 -22 72 -43 75 -46 3 -3 26 -19 52 -35 27 -17 48 -33 48 -37 0 -5 5 -8 11 -8 11 0 84 -59 168 -135 41 -37 58 -54 141 -145 50 -54 142 -178 194 -258 90 -142 216 -429 241 -552 2 -8 8 -33 13 -55 6 -22 13 -53 16 -70 3 -16 7 -41 10 -55 7 -36 17 -109 21 -155 6 -61 6 -315 0 -360 -25 -201 -29 -221 -80 -405 -31 -114 -117 -310 -183 -420 -12 -19 -29 -48 -38 -65 -9 -16 -20 -32 -23 -35 -3 -3 -19 -24 -34 -48 -32 -50 -172 -217 -215 -259 -95 -90 -183 -165 -242 -206 -154 -107 -272 -173 -410 -230 -79 -33 -223 -82 -266 -92 -228 -50 -308 -60 -499 -59 -170 0 -297 10 -355 29 -14 4 -111 -87 -414 -390 -218 -218 -396 -400 -396 -405 0 -4 24 -16 53 -26 28 -9 57 -20 62 -24 6 -4 57 -22 115 -39 58 -18 116 -37 130 -41 14 -5 50 -14 80 -20 106 -23 97 -1 98 -223 0 -122 5 -203 12 -216 6 -12 8 -21 5 -21 -3 0 6 -22 20 -49 27 -53 103 -141 123 -141 7 0 12 -4 12 -9 0 -5 17 -15 38 -22 20 -6 43 -17 51 -23 10 -8 117 -11 350 -11 307 0 341 2 394 20 31 10 57 23 57 27 0 4 6 8 14 8 20 0 112 96 131 137 36 75 42 119 42 307 1 103 2 189 5 191 2 2 15 6 28 9 140 29 398 113 533 174 37 17 67 28 67 24 0 -4 4 -2 8 3 4 6 43 28 87 49 44 22 82 42 85 45 3 4 17 12 32 18 15 7 46 25 70 40 98 64 83 69 228 -76 138 -139 184 -172 270 -193 92 -23 172 -12 265 36 40 21 440 412 487 476 77 107 85 261 19 386 -12 23 -83 103 -157 178 l-136 137 19 26 c22 32 48 75 76 128 12 22 24 42 28 45 6 6 102 202 103 211 1 3 12 30 25 60 13 30 27 63 32 74 17 42 71 203 85 255 19 69 45 170 48 190 2 13 32 15 187 16 201 2 230 5 296 35 46 21 70 38 110 79 24 24 75 104 80 125 1 5 7 31 13 56 12 49 9 646 -3 688 -33 117 -150 231 -262 257 -16 3 -115 7 -219 8 -211 3 -199 -2 -216 83 -5 26 -19 80 -30 118 -12 39 -22 77 -25 85 -2 8 -4 16 -5 18 -2 1 -3 5 -5 10 -1 4 -5 14 -8 22 -4 8 -14 38 -23 65 -9 28 -21 61 -27 75 -5 14 -11 30 -12 36 -7 29 -149 311 -202 400 l-60 102 136 138 c91 92 144 155 159 187 68 144 44 300 -63 415 -114 123 -402 403 -435 424 -95 58 -234 73 -325 34 -22 -9 -42 -17 -45 -18 -13 -1 -86 -67 -191 -172 -64 -64 -124 -116 -132 -116 -9 0 -25 10 -37 22 -11 12 -20 18 -20 12 0 -5 -4 -4 -8 2 -9 13 -185 111 -277 154 -73 34 -263 111 -280 114 -5 1 -14 4 -20 7 -5 4 -37 14 -70 24 -33 10 -87 26 -120 36 -33 10 -85 23 -115 29 l-55 12 0 207 -1 206 -29 60 c-29 60 -125 165 -151 165 -8 0 -14 4 -14 8 0 5 -26 16 -57 25 -48 13 -115 16 -373 16 -293 1 -319 -1 -375 -20z"/>
|
||||
<path fill="#1e1e1e" d="M3577 5134 c-1 -1 -44 -4 -94 -8 -51 -4 -98 -8 -105 -11 -7 -2 -24 -6 -38 -9 -106 -19 -283 -79 -375 -126 -65 -34 -177 -100 -185 -109 -3 -4 -23 -18 -45 -33 -22 -15 -56 -42 -76 -60 -20 -18 -47 -43 -60 -55 -74 -66 -182 -197 -237 -288 -56 -90 -130 -249 -152 -325 -13 -41 -27 -80 -31 -86 -5 -6 -7 -13 -4 -16 3 -2 0 -20 -5 -39 -6 -19 -13 -52 -16 -74 -3 -22 -8 -51 -10 -65 -3 -14 -6 -88 -8 -165 -3 -123 7 -245 28 -345 3 -14 8 -35 10 -48 3 -12 15 -54 28 -92 l22 -71 -1037 -1037 c-570 -570 -1053 -1059 -1072 -1086 -19 -27 -35 -55 -35 -63 0 -7 -3 -13 -8 -13 -8 0 -31 -48 -37 -79 -2 -12 -6 -25 -9 -29 -21 -34 -29 -211 -14 -291 9 -51 55 -180 67 -191 3 -3 12 -17 19 -31 17 -33 116 -137 162 -171 110 -80 245 -120 388 -114 110 5 176 22 277 74 65 33 151 116 1128 1092 l1058 1058 49 -19 c27 -10 59 -20 72 -23 13 -3 32 -7 43 -10 148 -34 189 -39 350 -39 150 -1 226 7 345 34 82 19 233 70 275 92 11 6 22 12 25 12 23 4 240 133 260 155 3 3 25 21 50 41 134 108 265 260 348 404 49 86 121 250 137 315 1 3 4 12 7 20 10 24 37 146 44 195 11 70 14 116 15 215 0 101 -8 237 -16 250 -2 3 -6 26 -10 50 -22 151 -160 233 -287 171 -28 -14 -133 -111 -303 -282 -143 -144 -282 -279 -309 -301 -131 -104 -308 -135 -469 -81 -39 14 -74 28 -77 31 -3 4 -17 13 -32 21 -39 20 -109 89 -144 142 -106 157 -115 340 -26 513 31 59 78 111 328 362 160 161 298 306 307 322 8 16 14 57 15 90 0 63 -24 113 -73 154 -34 29 -172 62 -280 68 -69 4 -175 6 -178 4z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.4 KiB |
@@ -1,80 +0,0 @@
|
||||
import { join, dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { mkdir, readFile, writeFile } from 'fs/promises';
|
||||
|
||||
const currentDirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const toolsDir = join(currentDirname, '..', 'src', 'tools');
|
||||
const toolName = process.argv[2];
|
||||
|
||||
if (!toolName) {
|
||||
throw new Error('Please specify a toolname.');
|
||||
}
|
||||
|
||||
const toolNameCamelCase = toolName.replace(/-./g, (x) => x[1].toUpperCase());
|
||||
const toolNameTitleCase = toolName[0].toUpperCase() + toolName.slice(1).replace(/-/g, ' ');
|
||||
const toolDir = join(toolsDir, toolName);
|
||||
|
||||
await mkdir(toolDir);
|
||||
console.log(`Directory created: ${toolDir}`);
|
||||
|
||||
const createToolFile = async (name, content) => {
|
||||
const filePath = join(toolDir, name);
|
||||
await writeFile(filePath, content.trim());
|
||||
console.log(`File created: ${filePath}`);
|
||||
};
|
||||
|
||||
createToolFile(
|
||||
`${toolName}.vue`,
|
||||
`
|
||||
<template>
|
||||
<n-card>
|
||||
Lorem ipsum
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
`
|
||||
);
|
||||
|
||||
createToolFile(
|
||||
`index.ts`,
|
||||
`
|
||||
import { ArrowsShuffle } from '@vicons/tabler';
|
||||
import type { ITool } from './../Tool';
|
||||
|
||||
export const tool: ITool = {
|
||||
name: '${toolNameTitleCase}',
|
||||
path: '/${toolName}',
|
||||
description: '',
|
||||
keywords: ['${toolName.split('-').join("', '")}'],
|
||||
component: () => import('./${toolName}.vue'),
|
||||
icon: ArrowsShuffle,
|
||||
};
|
||||
`
|
||||
);
|
||||
|
||||
createToolFile(`${toolName}.service.ts`, ``);
|
||||
createToolFile(
|
||||
`${toolName}.service.test.ts`,
|
||||
`
|
||||
import { expect, describe, it } from 'vitest';
|
||||
// import { } from './${toolName}.service';
|
||||
//
|
||||
// describe('${toolName}', () => {
|
||||
//
|
||||
// })
|
||||
`
|
||||
);
|
||||
|
||||
const toolsIndex = join(toolsDir, 'index.ts');
|
||||
const indexContent = await readFile(toolsIndex, { encoding: 'utf-8' }).then((r) => r.split('\n'));
|
||||
|
||||
indexContent.splice(3, 0, `import { tool as ${toolNameCamelCase} } from './${toolName}';`);
|
||||
writeFile(toolsIndex, indexContent.join('\n'));
|
||||
console.log(`Added import in: ${toolsIndex}`);
|
||||
44
src/App.vue
@@ -1,44 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { layouts } from './layouts';
|
||||
import { computed } from 'vue';
|
||||
import { useRoute, RouterView } from 'vue-router';
|
||||
import { darkThemeOverrides, lightThemeOverrides } from './themes';
|
||||
import { darkTheme, NGlobalStyle, NMessageProvider } from 'naive-ui';
|
||||
import { useStyleStore } from './stores/style.store';
|
||||
|
||||
const route = useRoute();
|
||||
const layout = computed(() => route?.meta?.layout ?? layouts.base);
|
||||
const styleStore = useStyleStore();
|
||||
|
||||
const theme = computed(() => (styleStore.isDarkTheme ? darkTheme : null));
|
||||
const themeOverrides = computed(() => (styleStore.isDarkTheme ? darkThemeOverrides : lightThemeOverrides));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-config-provider :theme="theme" :theme-overrides="themeOverrides">
|
||||
<n-global-style />
|
||||
<n-message-provider placement="bottom">
|
||||
<component :is="layout">
|
||||
<router-view />
|
||||
</component>
|
||||
</n-message-provider>
|
||||
</n-config-provider>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
body {
|
||||
min-height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
@@ -1,23 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 275">
|
||||
<defs>
|
||||
<linearGradient id="small-hero-gradient-1" x1="13.74" y1="183.7" x2="303.96" y2="45.59" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#25636c"/>
|
||||
<stop offset="0.6" stop-color="#3b956f"/>
|
||||
<stop offset="1" stop-color="#14a058"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#14a058" opacity="0.49" d="M0,187.5v25s0,37.5,50,50S300,225,300,225V187.5Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#14a058" opacity="0.49" d="M300,237.5S287.5,275,250,275,121.05,237.5,61.4,200s134.21,0,134.21,0Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#14a058" opacity="0.38" d="M0,200v12.5a241.47,241.47,0,0,0,112.5,50c73.6,11.69,130.61-14.86,150-25L300,200Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="url(#small-hero-gradient-1)" d="M0,0V212.5s62.5-12.5,150,25,150,0,150,0V0Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 894 B |