mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-23 14:21:04 +03:00
Compare commits
352
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6485e8afb2 | ||
|
|
f6ee1e2c0f | ||
|
|
9a1c825055 | ||
|
|
f2e13aa9bf | ||
|
|
b8deacf682 | ||
|
|
c4c6d3883f | ||
|
|
95590f1d7b | ||
|
|
ea37ca60cf | ||
|
|
3c7e690fbd | ||
|
|
12c821fafa | ||
|
|
6c862d6a33 | ||
|
|
252b5e7696 | ||
|
|
7ba56bf81b | ||
|
|
ebad961241 | ||
|
|
d6d51799b7 | ||
|
|
5ee3c18db3 | ||
|
|
bfbfee874f | ||
|
|
529c7da1e2 | ||
|
|
08ac203def | ||
|
|
53c447ad6b | ||
|
|
8e379e4611 | ||
|
|
be14d3a62b | ||
|
|
aebb3f2052 | ||
|
|
ed2519e937 | ||
|
|
1cafdfa9ad | ||
|
|
4351e57075 | ||
|
|
2cf9c75d96 | ||
|
|
0715b2862a | ||
|
|
4fd5d89c3a | ||
|
|
19da4e31c8 | ||
|
|
0c334e9560 | ||
|
|
93b688a1b9 | ||
|
|
1eb6ec6e8a | ||
|
|
be41dd6175 | ||
|
|
28eedcf114 | ||
|
|
c24f94ce4c | ||
|
|
32a680faf1 | ||
|
|
f36451f47a | ||
|
|
15ca81d8f0 | ||
|
|
abd685b4c1 | ||
|
|
bf5833524c | ||
|
|
23fbd21432 | ||
|
|
acb95afe1b | ||
|
|
19d494fbb3 | ||
|
|
bae6175c4b | ||
|
|
b700c2cfdd | ||
|
|
fbe9c58cc4 | ||
|
|
20c0791fc6 | ||
|
|
209988a3f2 | ||
|
|
a87559696c | ||
|
|
2b9f4f84da | ||
|
|
5943dc4ec5 | ||
|
|
617bd37ee3 | ||
|
|
342399ce45 | ||
|
|
6fd3c6b695 | ||
|
|
e6cbe0884d | ||
|
|
ac08813407 | ||
|
|
8fad71868a | ||
|
|
cb0725dc7c | ||
|
|
801e3d52d1 | ||
|
|
6e525b92c7 | ||
|
|
9e2eca25c4 | ||
|
|
acaa5d7ccd | ||
|
|
057999596d | ||
|
|
f0d2347ee2 | ||
|
|
99f4be60ec | ||
|
|
7955f5013d | ||
|
|
f811b996dd | ||
|
|
811e52f5bd | ||
|
|
27818151e7 | ||
|
|
2461cba237 | ||
|
|
6e901196fe | ||
|
|
484729cdbe | ||
|
|
835ff8d428 | ||
|
|
86683d81d6 | ||
|
|
ecb81ec535 | ||
|
|
fb9ddb02c4 | ||
|
|
a4af330721 | ||
|
|
6737df4be1 | ||
|
|
4db9743221 | ||
|
|
c25ec86546 | ||
|
|
6af606be55 | ||
|
|
3763f9e076 | ||
|
|
23581a34b0 | ||
|
|
b24021771b | ||
|
|
504cbe1c23 | ||
|
|
475a86ab52 | ||
|
|
461dabf362 | ||
|
|
a3161e9afe | ||
|
|
c7d77e1b6b | ||
|
|
8c97e191f4 | ||
|
|
102cfce37b | ||
|
|
58db3b3397 | ||
|
|
6aa69eb39d | ||
|
|
4df614eeec | ||
|
|
5d8b28d36b | ||
|
|
3fc1614ce0 | ||
|
|
b7a28dbfaa | ||
|
|
29c14837b6 | ||
|
|
5dd16d4b49 | ||
|
|
bc7166324a | ||
|
|
4a148b5cf2 | ||
|
|
73483fa736 | ||
|
|
b3fb940d20 | ||
|
|
c156222e52 | ||
|
|
20f484c561 | ||
|
|
814bae2897 | ||
|
|
ba5c95024c | ||
|
|
a18259595e | ||
|
|
935600c969 | ||
|
|
8873b9d0a1 | ||
|
|
c8f0d53821 | ||
|
|
c1b0694097 | ||
|
|
9f52df1197 | ||
|
|
75637340a2 | ||
|
|
01928b3ad9 | ||
|
|
fb99fb24c7 | ||
|
|
8a89a78830 | ||
|
|
3ba3b222ad | ||
|
|
7516aae2c1 | ||
|
|
aab0e2eb18 | ||
|
|
c1d962c9b9 | ||
|
|
c30d598d77 | ||
|
|
3f8d2db9b9 | ||
|
|
20251116c3 | ||
|
|
a7776baa1a | ||
|
|
f6411f862c | ||
|
|
2c2643b14c | ||
|
|
087860c472 | ||
|
|
de2de50769 | ||
|
|
37164f3ced | ||
|
|
6c4f64b662 | ||
|
|
9425d3419b | ||
|
|
fdb39a80cb | ||
|
|
50ffafc9dc | ||
|
|
83a9fe564d | ||
|
|
4119b049cf | ||
|
|
330b18d945 | ||
|
|
b853dfa0d4 | ||
|
|
6914e3e325 | ||
|
|
545d7f01c4 | ||
|
|
92a0dda3e7 | ||
|
|
ca64d2a018 | ||
|
|
825d90c22b | ||
|
|
fc9c0abe70 | ||
|
|
cb3d366080 | ||
|
|
a47e25a360 | ||
|
|
282acba77e | ||
|
|
c02b358dcc | ||
|
|
23b853415f | ||
|
|
116ee92eab | ||
|
|
4fabdf9cf5 | ||
|
|
3275c7041e | ||
|
|
1236082735 | ||
|
|
bfb4a45d9c | ||
|
|
3ad698544c | ||
|
|
76551387d7 | ||
|
|
46a1b9b163 | ||
|
|
8f160bb241 | ||
|
|
4b1ca280e4 | ||
|
|
71700b92c6 | ||
|
|
608ee95753 | ||
|
|
abc0d11b09 | ||
|
|
5a6c3fb9e2 | ||
|
|
c0e57eafc7 | ||
|
|
13b8f041be | ||
|
|
b4255a3e32 | ||
|
|
61d2beae2f | ||
|
|
44a21380ab | ||
|
|
b5b3aa02c0 | ||
|
|
91f554845a | ||
|
|
b94a25c963 | ||
|
|
1234dca5ff | ||
|
|
fc36499963 | ||
|
|
39c47a0a5a | ||
|
|
72169aaf8d | ||
|
|
e4b2869aa7 | ||
|
|
34373f1a3f | ||
|
|
c2f5b6477c | ||
|
|
14dd110bfe | ||
|
|
6682517544 | ||
|
|
e1d05b11a4 | ||
|
|
2ee02742e7 | ||
|
|
5f8aea2d09 | ||
|
|
454b347fac | ||
|
|
3240a257bc | ||
|
|
3d3850f76c | ||
|
|
201e17b00d | ||
|
|
bd7e018e23 | ||
|
|
900c4c9266 | ||
|
|
dd87f353aa | ||
|
|
e942fe4f04 | ||
|
|
81bc96515b | ||
|
|
dbb56a4db6 | ||
|
|
6b1825f568 | ||
|
|
6a8d1d30f3 | ||
|
|
50bd3ed699 | ||
|
|
0716afba0a | ||
|
|
9f08fe6886 | ||
|
|
9f70133188 | ||
|
|
dfe13de18b | ||
|
|
c031d57f41 | ||
|
|
2b06b5b64c | ||
|
|
d450f3b38c | ||
|
|
d2e32ace21 | ||
|
|
01beb24ce7 | ||
|
|
cf3defed07 | ||
|
|
083b5e1834 | ||
|
|
6cb4958013 | ||
|
|
1b15214a1d | ||
|
|
241dd6f9fb | ||
|
|
e2f6a8299c | ||
|
|
8ee06eeedb | ||
|
|
71b60fc961 | ||
|
|
9f5792d2b4 | ||
|
|
1127fbd260 | ||
|
|
40901c976d | ||
|
|
dacb5ec378 | ||
|
|
f5f2938817 | ||
|
|
4dc9dcfe91 | ||
|
|
03e6e208ec | ||
|
|
1f314da094 | ||
|
|
ca3c3a6b91 | ||
|
|
ab7f046386 | ||
|
|
a0beb74601 | ||
|
|
58b3bd4404 | ||
|
|
d554f2961a | ||
|
|
d175e60ce9 | ||
|
|
100563cc70 | ||
|
|
63065a59e5 | ||
|
|
686c9fb08b | ||
|
|
c63e10a135 | ||
|
|
1d737a0bc3 | ||
|
|
603140a25d | ||
|
|
e20b284fba | ||
|
|
acc5ab5f13 | ||
|
|
de9f44e09e | ||
|
|
87c7609bc8 | ||
|
|
6706c682d5 | ||
|
|
438bb09dda | ||
|
|
a3b75a60e7 | ||
|
|
ae0ef63a03 | ||
|
|
8ad6157f7e | ||
|
|
72f541c7a3 | ||
|
|
75670a71ab | ||
|
|
11e2ac8130 | ||
|
|
e36bc459a9 | ||
|
|
0325b11746 | ||
|
|
0462c17fc1 | ||
|
|
6cbfa60e89 | ||
|
|
99393d2683 | ||
|
|
b612eed948 | ||
|
|
3ccbd85342 | ||
|
|
a26f2a2cf9 | ||
|
|
0bb259c734 | ||
|
|
b434ad7246 | ||
|
|
1202011926 | ||
|
|
babff364d6 | ||
|
|
cfe5b4fece | ||
|
|
504aff98d0 | ||
|
|
a4576e040c | ||
|
|
9cb58fccf3 | ||
|
|
521d0bf638 | ||
|
|
1d02e32486 | ||
|
|
d28f275168 | ||
|
|
eafc6f87fc | ||
|
|
5bdbaa920e | ||
|
|
aabbfca763 | ||
|
|
be9d659763 | ||
|
|
96ad3ebba0 | ||
|
|
c46e65fe3c | ||
|
|
79e0db7ef6 | ||
|
|
b0c43e2bdb | ||
|
|
ad312d788f | ||
|
|
a8c6ebc81b | ||
|
|
0d4267e356 | ||
|
|
e5d842571b | ||
|
|
2be6d4d412 | ||
|
|
05d25dac5a | ||
|
|
e811a5b654 | ||
|
|
7824f48383 | ||
|
|
e9dbf1fb0e | ||
|
|
3ffb8052d6 | ||
|
|
1a2e152e16 | ||
|
|
4ea4420b35 | ||
|
|
7527853897 | ||
|
|
a9d6b86198 | ||
|
|
cca32baf0f | ||
|
|
207b2ab54d | ||
|
|
7fd60b0356 | ||
|
|
3b921e64ed | ||
|
|
d625f622ca | ||
|
|
700cc2a196 | ||
|
|
c53a8cb773 | ||
|
|
ea0a99ef20 | ||
|
|
241dd13c17 | ||
|
|
9f5f7d80de | ||
|
|
5e3648e141 | ||
|
|
a78201bffd | ||
|
|
a12c43bfae | ||
|
|
e00b78b5b4 | ||
|
|
f868b97cd7 | ||
|
|
9186038c6f | ||
|
|
de76ee5b4d | ||
|
|
91564e0a0a | ||
|
|
5904fa7f84 | ||
|
|
399e9d008c | ||
|
|
161b0e8c03 | ||
|
|
20a26514d8 | ||
|
|
0048f48b47 | ||
|
|
be25e17687 | ||
|
|
1e405c3446 | ||
|
|
203f207be7 | ||
|
|
8e9d921b88 | ||
|
|
a93a99b138 | ||
|
|
56da33f2cd | ||
|
|
a768d22700 | ||
|
|
bf395a1862 | ||
|
|
4537cc6f63 | ||
|
|
db0aff39c3 | ||
|
|
ac3648c749 | ||
|
|
bc8524d9d3 | ||
|
|
64ef495a3f | ||
|
|
39479739e5 | ||
|
|
78fdcebefd | ||
|
|
cfcc21d21b | ||
|
|
0c29c19de0 | ||
|
|
da8c5df0a0 | ||
|
|
d4447dfb2e | ||
|
|
6f1b17fc66 | ||
|
|
e14fd2f9e2 | ||
|
|
fd7691495b | ||
|
|
b77c57e08d | ||
|
|
3ed3f90ee7 | ||
|
|
eb401042a6 | ||
|
|
ca47590376 | ||
|
|
09d56f5cbf | ||
|
|
02df1bc9f2 | ||
|
|
226081db3a | ||
|
|
8decf33ec8 | ||
|
|
4313ce9215 | ||
|
|
7d6753f344 | ||
|
|
bed46c6045 | ||
|
|
f1d6a167a0 | ||
|
|
19d3179339 | ||
|
|
884a4474d6 | ||
|
|
c9b448ce64 | ||
|
|
f90a69c86c | ||
|
|
80a2fb78c3 | ||
|
|
a99744646a | ||
|
|
b489f3aa02 | ||
|
|
2355232aed |
No files matched your search
@@ -39,6 +39,7 @@
|
||||
"h": true,
|
||||
"ignorableWatch": true,
|
||||
"inject": true,
|
||||
"injectLocal": true,
|
||||
"isDefined": true,
|
||||
"isProxy": true,
|
||||
"isReactive": true,
|
||||
@@ -68,6 +69,7 @@
|
||||
"onUpdated": true,
|
||||
"pausableWatch": true,
|
||||
"provide": true,
|
||||
"provideLocal": true,
|
||||
"reactify": true,
|
||||
"reactifyObject": true,
|
||||
"reactive": true,
|
||||
@@ -96,6 +98,7 @@
|
||||
"toReactive": true,
|
||||
"toRef": true,
|
||||
"toRefs": true,
|
||||
"toValue": true,
|
||||
"triggerRef": true,
|
||||
"tryOnBeforeMount": true,
|
||||
"tryOnBeforeUnmount": true,
|
||||
@@ -130,6 +133,7 @@
|
||||
"useBrowserLocation": true,
|
||||
"useCached": true,
|
||||
"useClipboard": true,
|
||||
"useClipboardItems": true,
|
||||
"useCloned": true,
|
||||
"useColorMode": true,
|
||||
"useConfirmDialog": true,
|
||||
@@ -285,10 +289,6 @@
|
||||
"watchThrottled": true,
|
||||
"watchTriggerable": true,
|
||||
"watchWithFilter": true,
|
||||
"whenever": true,
|
||||
"toValue": true,
|
||||
"injectLocal": true,
|
||||
"provideLocal": true,
|
||||
"useClipboardItems": true
|
||||
"whenever": true
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ body:
|
||||
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!
|
||||
description: A clear and concise description, in PLAIN ENGLISH ONLY, 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
|
||||
|
||||
@@ -25,7 +25,7 @@ body:
|
||||
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.
|
||||
description: A clear and concise description of what the feature is, in PLAIN ENGLISH ONLY.
|
||||
placeholder: 'Example: a token generator tool'
|
||||
validations:
|
||||
required: true
|
||||
@@ -33,7 +33,7 @@ body:
|
||||
- type: textarea
|
||||
id: alternative
|
||||
attributes:
|
||||
label: Is their example of this tool in the wild?
|
||||
label: Is there 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
|
||||
@@ -54,3 +54,5 @@ body:
|
||||
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
|
||||
- label: Everything is written in PLAIN ENGLISH
|
||||
required: true
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
### Before submitting the PR, please make sure you do the following
|
||||
|
||||
- [ ] Submit the PR against the `dev` branch.
|
||||
- [ ] Submit the PR against the `chore/all-my-stuffs` 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`).
|
||||
- [ ] Provide a description, in PLAIN ENGLISH ONLY, in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
|
||||
- [ ] Run `pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck` to ensure pnpm lock, eslint and typecheck are ok
|
||||
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
|
||||
@@ -20,11 +20,11 @@ jobs:
|
||||
pnpm --version
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
name: Docker nightly release
|
||||
|
||||
env:
|
||||
VITE_VERCEL_ENV: production
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
@@ -37,11 +40,11 @@ jobs:
|
||||
pnpm --version
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
name: Build and Push Docker Image (baseurl-it-tools)
|
||||
|
||||
env:
|
||||
VITE_VERCEL_ENV: production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -19,11 +22,11 @@ jobs:
|
||||
pnpm --version
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
name: Build and Push Docker Image (latest)
|
||||
|
||||
env:
|
||||
VITE_VERCEL_ENV: production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -19,11 +22,11 @@ jobs:
|
||||
pnpm --version
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
@@ -67,6 +70,8 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
build-args: |
|
||||
"BASE_URL=/"
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get Playwright version
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
run: echo "PLAYWRIGHT_VERSION=$(jq -r .dependencies.playwright package.json)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
run: pnpm install --ignore-scripts
|
||||
|
||||
- name: Build app
|
||||
run: pnpm build
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
name: Deploy static content to Pages
|
||||
|
||||
env:
|
||||
VITE_VERCEL_ENV: production
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches: ["chore/all-my-stuffs"]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
# Single deploy job since we're just deploying
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
name: Install pnpm
|
||||
id: pnpm-install
|
||||
with:
|
||||
version: 9
|
||||
run_install: true
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
BASE_URL="/it-tools/" pnpm build
|
||||
cp dist/index.html dist/404.html
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: './dist'
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -1,5 +1,8 @@
|
||||
name: Release new versions
|
||||
|
||||
env:
|
||||
VITE_VERCEL_ENV: production
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
@@ -45,8 +48,10 @@ jobs:
|
||||
push: true
|
||||
tags: |
|
||||
sharevb/it-tools:baseurl-it-tools
|
||||
sharevb/it-tools:stable-baseurl-it-tools
|
||||
sharevb/it-tools:${{ env.RELEASE_VERSION}}-baseurl-it-tools
|
||||
ghcr.io/sharevb/it-tools:baseurl-it-tools
|
||||
ghcr.io/sharevb/it-tools:stable-baseurl-it-tools
|
||||
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}-baseurl-it-tools
|
||||
|
||||
- name: Build and push
|
||||
@@ -58,8 +63,10 @@ jobs:
|
||||
push: true
|
||||
tags: |
|
||||
sharevb/it-tools:latest
|
||||
sharevb/it-tools:stable
|
||||
sharevb/it-tools:${{ env.RELEASE_VERSION}}
|
||||
ghcr.io/sharevb/it-tools:latest
|
||||
ghcr.io/sharevb/it-tools:stable
|
||||
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}
|
||||
|
||||
github-release:
|
||||
@@ -81,11 +88,11 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Build the app
|
||||
run: pnpm build
|
||||
@@ -114,10 +121,12 @@ jobs:
|
||||
|
||||
- Docker Hub Registry
|
||||
- `sharevb/it-tools:latest`
|
||||
- `sharevb/it-tools:stable`
|
||||
- `sharevb/it-tools:${{ env.RELEASE_VERSION}}`
|
||||
|
||||
- GitHub Container Registry
|
||||
- `ghcr.io/sharevb/it-tools:latest`
|
||||
- `ghcr.io/sharevb/it-tools:stable`
|
||||
- `ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}`
|
||||
|
||||
## Changelog
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
name: Vercel Preview Deployment
|
||||
env:
|
||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
VITE_VERCEL_ENV: preview
|
||||
VITE_VERCEL_DEPLOY: true
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- chore/all-my-stuffs
|
||||
pull_request:
|
||||
jobs:
|
||||
Deploy-Preview:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Vercel CLI
|
||||
run: npm install --global vercel@latest
|
||||
- name: Pull Vercel Environment Information
|
||||
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
|
||||
- name: Build Project Artifacts
|
||||
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
|
||||
- name: Deploy Project Artifacts to Vercel
|
||||
run: vercel deploy --prebuilt --archive=tgz --token=${{ secrets.VERCEL_TOKEN }}
|
||||
@@ -0,0 +1,23 @@
|
||||
name: Vercel Production Deployment
|
||||
env:
|
||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
VITE_VERCEL_ENV: production
|
||||
VITE_VERCEL_DEPLOY: true
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- chore/all-my-stuffs
|
||||
jobs:
|
||||
Deploy-Production:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Vercel CLI
|
||||
run: npm install --global vercel@latest
|
||||
- name: Pull Vercel Environment Information
|
||||
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
|
||||
- name: Build Project Artifacts
|
||||
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
||||
- name: Deploy Project Artifacts to Vercel
|
||||
run: vercel deploy --prebuilt --archive=tgz --prod --token=${{ secrets.VERCEL_TOKEN }}
|
||||
+4
-1
@@ -34,4 +34,7 @@ coverage
|
||||
# Webkit with playwright creates a salt file
|
||||
salt
|
||||
# WSL can create Zone.Identifier
|
||||
*:Zone.Identifier
|
||||
*:Zone.Identifier
|
||||
.vercel
|
||||
|
||||
components.d.ts
|
||||
+530
@@ -2,6 +2,536 @@
|
||||
|
||||
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.
|
||||
|
||||
## Version 2026.01.04
|
||||
|
||||
### Features
|
||||
- **JSON Viewer**: add unescape JSON string (c4c6d38)
|
||||
- **new tool**: Wiktionary Search (ea37ca6)
|
||||
- add download buttons for many tools (3c7e690)
|
||||
- **string extraction**: add attribute download-button-text (12c821f)
|
||||
- **HTML WYSIWYG Editor**: add XHTML output option (252b5e7)
|
||||
- **new tool**: HTML to XHTML (7ba56bf)
|
||||
- **HTML WYSIWYG Editor**: upgrade tiptap + add aligments + enhance cell selection (ebad961)
|
||||
- **new tool**: JavaScript Obfuscator (529c7da)
|
||||
- **new tool**: Database Table Generator (08ac203)
|
||||
- **new tool**: Database Creation Generator (53c447a)
|
||||
- **Git Attributes Generator**: get all .gitattributes on subfolders + fallback in case of API Rate (8e379e4)
|
||||
- **new-tool**: Add Dead Pixel detection tool (#256) (aebb3f2)
|
||||
- **new tool**: PTR/ARPA generator/decoder (ed2519e)
|
||||
- **new tool**: Gitattributes Generator (1cafdfa)
|
||||
- **new tool**: Zellij Cheatsheet (4fd5d89)
|
||||
- **JSON tools**: handle big float (0c334e9)
|
||||
- **datetime converter**: add custom timezone (#248) (abd685b)
|
||||
- **new tool**: implement amortization-calculator tool (#242) (bf58335)
|
||||
- **new tool**: Trigo/equation visualizer (23fbd21)
|
||||
- **Case Converter**: add title, sponge and swap case (acb95af)
|
||||
- **Git Semantic Commit Memo**: enhanced version (19d494f)
|
||||
- **new tool**: SVG Preview (bae6175)
|
||||
- **JSON Editor**: add Repair and schema validation (fbe9c58)
|
||||
- **new tools**: Screen and Tmux Cheatsheets (20c0791)
|
||||
|
||||
### Bug fixes
|
||||
- **README**: add better new features + typo (d6d5179)
|
||||
- **README**: enhance create new tool description (5ee3c18)
|
||||
- **README**: add explaination for PORT env var (bfbfee8)
|
||||
- **Docker**: allow PORT environment variable (be14d3a)
|
||||
- **Code Highlighter**: copy HTML for Word (text/html) and for code editors (text/plain) (0715b28)
|
||||
- **JSON Schema Validation**: handle JSON parse error (19da4e3)
|
||||
- implement JSON.parseBigNum with decimal.js (93b688a)
|
||||
- handle quoted big numbers + fix unit tests (1eb6ec6)
|
||||
- **JQ Tester**: fix import and typo (be41dd6)
|
||||
- json schema validation 'no validation' reset errors (b700c2c)
|
||||
- enable json repair by default (a875596)
|
||||
- correct docker compose with subfolder sample and links (2b9f4f8)
|
||||
- **Barcode Generator**: linear UI (5943dc4)
|
||||
|
||||
### Performance
|
||||
- **ssh-key-generators**: Added debounce to key pair generators (#249) (c24f94c)
|
||||
|
||||
### Chores
|
||||
- **README**: link to VSCode installation (f2e13aa)
|
||||
- **deps**: update some packages (b8deacf)
|
||||
- update some deps (95590f1)
|
||||
- enhance github issue/pr models (28eedcf)
|
||||
- update renovate.json with better grouping (f36451f)
|
||||
|
||||
### Other
|
||||
- Add components.d.ts to .gitignore (32a680f)
|
||||
|
||||
### I18n
|
||||
- translate remaining tools (9a1c825)
|
||||
- string extractions (6c862d6)
|
||||
- useCopy messages (4351e57)
|
||||
- **zh**: add new translation keys for tools (#247) (15ca81d)
|
||||
|
||||
### Fixup! feat
|
||||
- **JSON tools**: handle big float (2cf9c75)
|
||||
|
||||
### Documentation
|
||||
- add lxc container instructions (209988a)
|
||||
|
||||
## Version 2025.12.07
|
||||
|
||||
### Features
|
||||
- Custom External Tools (801e3d5)
|
||||
- **new tool**: Argon2 Hasher (6e525b9)
|
||||
- **new tool**: GitIgnore Generator (9e2eca2)
|
||||
- **Url Parser**: add Open URL button for url params that contains xxx:// (acaa5d7)
|
||||
- **JSON Viewer**: add repair search keyword (0579995)
|
||||
- **JSON Linter**: add auto repair option (f0d2347)
|
||||
- **new tool**: IP Subnets Lister (99f4be6)
|
||||
- **Lorem Ipsum Generators**: add a Print to PDF button (7955f50)
|
||||
- **unicode-search**: Added ability to search using unicode characters (#213) (2781815)
|
||||
- **new tool**: Shamir's Secret Sharing (2461cba)
|
||||
- **new tool**: Short Urls expander (6e90119)
|
||||
- **new tool**: Markdown Lorem Ipsum generator (484729c)
|
||||
- **new tool**: CSS Units Converter (835ff8d)
|
||||
- **new tool**: CSS Gradient Generator (86683d8)
|
||||
- **HTML to Markdown**: heading and emphasis variants (fb9ddb0)
|
||||
- **new tool**: Pdf Compressor (4db9743)
|
||||
- **Docker Compose to Docker Run**: add multiline options (6af606b)
|
||||
- **JWT Generator**: allow to paste an existing token to edit (23581a3)
|
||||
- **new tools**: JSON to TOON, TOON to JSON (b240217)
|
||||
- **JWT Parser**: secret encoding (text, hex array or base64) (504cbe1)
|
||||
- **JWT Generator**: handle secret encodings (base64, hex array or text) (475a86a)
|
||||
- **Many Units Converter**: references other units conversion (6aa69eb)
|
||||
- **new tool**: Binary Calculator (4df614e)
|
||||
- **new tool**: EMV TLV Parser (5d8b28d)
|
||||
- **new tool**: ETH Transaction Decoder (3fc1614)
|
||||
- **new tool**: JSON <> Message Pack (b7a28db)
|
||||
- **new tool**: File Splitter (json, txt, xml) (29c1483)
|
||||
- **new tool**: Serial Terminal (5dd16d4)
|
||||
- **new tool**: Docker Compose to .env file (bc71663)
|
||||
- **JSON Linter**: add copyable formatted json (4a148b5)
|
||||
- **Keycode Info**: add scancodes (73483fa)
|
||||
- **Chmod Calculator**: add a cheatsheet (b3fb940)
|
||||
- **new tool**: I or L checker (c156222)
|
||||
- **Base64 File Converter**: add paste-image (935600c)
|
||||
|
||||
### Bug fixes
|
||||
- **Text Statistics**: word counts for only spaces (e6cbe08)
|
||||
- **token-generator**: add the missing character 'N' & 'n' (#221) (ac08813)
|
||||
- **JSON DIff**: wrap and indent diffs (8fad718)
|
||||
- remove sponsor banner (cb0725d)
|
||||
- **dBm mW Converter**: change category (ecb81ec)
|
||||
- **Text Diff**: sticky overlap fix (a4af330)
|
||||
- **Port Numbers**: unknown port throws (3763f9e)
|
||||
- invalid watch callback (461dabf)
|
||||
- **CRC Calculator**: input text watcher was wrong (a3161e9)
|
||||
- router-link color contrast (c7d77e1)
|
||||
- **Translate Missings Script**: ensure format of en.yml (8c97e19)
|
||||
- remove Credit Card Generator as usage could be malicious (814bae2)
|
||||
- **Image Formats Converter**: add SVG in keywords (ba5c950)
|
||||
- **Vite/PWA**: on vite preload error, reload (a182595)
|
||||
- **Data Storage Converter**: make precision even for 1.00 (c8f0d53)
|
||||
|
||||
### Chores
|
||||
- overrides @vueuse/shared (811e52f)
|
||||
- **Vercel**: ensure no cache for index.html (6737df4)
|
||||
- clean qpdf (c25ec86)
|
||||
- **Vercel**: limit PWA precaching to avoid Fast Data Transfer exceed (20f484c)
|
||||
- **Build**: ignore scripts (8873b9d)
|
||||
|
||||
### Other
|
||||
- Use async versions of bcrypt methods to avoid freezing browser tab (#204) (102cfce)
|
||||
|
||||
### I18n
|
||||
- translate all (6fd3c6b)
|
||||
|
||||
### Merge branch 'chore/all-my-stuffs' of https
|
||||
- //github.com/sharevb/it-tools into chore/all-my-stuffs (f811b99)
|
||||
|
||||
### Documentation
|
||||
- spelling updates and quadlet instructions (#203) (58db3b3)
|
||||
|
||||
### Fixup! chore
|
||||
- optimize unit test memory use (c1b0694)
|
||||
|
||||
## Version 2025.10.19
|
||||
|
||||
### Features
|
||||
- **Script**: add a translation script for missing translations (a7776ba)
|
||||
|
||||
### Bug fixes
|
||||
- **Scripts**: remove target languages unused + keep line break (8a89a78)
|
||||
- **Scripts**: translate only if missing + handle ' (7516aae)
|
||||
- **Scripts**: extract string, avoid if has already t() + /* NO EXTRACT SCRIPT */ (c30d598)
|
||||
- **i18n**: wrong input-label,... text extractions (2025111)
|
||||
- **Tools Filtering**: filter tools everywhere (2c2643b)
|
||||
- **JSON Diff**: display removed original text (de2de50)
|
||||
|
||||
### Chores
|
||||
- update some deps (01928b3)
|
||||
- optimize unit test memory use (fb99fb2)
|
||||
- add script:translate-missing (3f8d2db)
|
||||
- add a stable tag on release (f6411f8)
|
||||
- add buymeacoffee (087860c)
|
||||
|
||||
### Other
|
||||
- Update fr.yml fix few punctuations (#201) (c1d962c)
|
||||
|
||||
### I18n
|
||||
- auto translatte missing + add da, it, nl, tr, kr (3ba3b22)
|
||||
|
||||
### Merge branch 'chore/all-my-stuffs' of https
|
||||
- //github.com/sharevb/it-tools into chore/all-my-stuffs (aab0e2e)
|
||||
|
||||
## Version 2025.10.12
|
||||
|
||||
### Features
|
||||
- extract strings of new tools (9425d34)
|
||||
- **Citation Generator**: Add Vancouver Style (fdb39a8)
|
||||
- **new tool**: Database Connection String Generator (83a9fe5)
|
||||
- **new tool**: Niceware Bytes Passphrase Converter (4119b04)
|
||||
- **List Converter**: filter item regexps (330b18d)
|
||||
- **new tool**: Credit Card Checker and Info (6914e3e)
|
||||
- **new tool**: Random Credit Card Number Generator (545d7f0)
|
||||
- **IBAN Validator**: allow multiple IBANs (92a0dda)
|
||||
- **new tool**: Diceware Password Generator (ca64d2a)
|
||||
- **new tool**: IANA Whois Checker (825d90c)
|
||||
- unit test for JSON.parseBigInt (fc9c0ab)
|
||||
- **new tool**: dBm mW Converter (cb3d366)
|
||||
- **new tool**: GTIN Validator (282acba)
|
||||
- **new tool**: Keyboard Layouts Converter (c02b358)
|
||||
- **About page**: import/export favorites (3ad6985)
|
||||
|
||||
### Bug fixes
|
||||
- **Github Page**: pnpm 9 (50ffafc)
|
||||
- **IBAN Validator**: update placeholder regarding multiline input (b853dfa)
|
||||
- **Text To Unicode**: fix python \U padded to 8 for high ucods (a47e25a)
|
||||
- **JSON Bigint parser**: better handle large numbers in strings (116ee92)
|
||||
- **iso-3166-searcher**: timezones separator (3275c70)
|
||||
- **issues**: fix textarea always grows (#194) (bfb4a45)
|
||||
- **Energy Computer**: label and fixed precision (7655138)
|
||||
- **Text Translator**: filter available languages (46a1b9b)
|
||||
- **QR Code Generator**: Fixed an issue where the text input provided to the terminal QR code wasn't trimming leading/trailing spaces and newlines from the string (#189) (4b1ca28)
|
||||
- **QR Code Generator**: bring back multiline (71700b9)
|
||||
- **Docker**: remove CSP header (608ee95)
|
||||
|
||||
### Continuous integration
|
||||
- **Docker**: fix VITE_VERCEL_ENV to production (8f160bb)
|
||||
|
||||
### Chores
|
||||
- **Release**: remove commit hash from version (23b8534)
|
||||
- contribute section (1236082)
|
||||
|
||||
### Other
|
||||
- Spelling error (#183) (abc0d11)
|
||||
|
||||
### Merge branch 'chore/all-my-stuffs' of https
|
||||
- //github.com/sharevb/it-tools into chore/all-my-stuffs (4fabdf9)
|
||||
|
||||
## Version 2025.08.31-13b8f041
|
||||
|
||||
### Features
|
||||
- **new tool**: add image color inversion tool (#179) (b94a25c)
|
||||
|
||||
### Bug fixes
|
||||
- **Extract Text from HTML**: display conversion errors (13b8f04)
|
||||
- **Docker Compose Cheatsheet**: new syntax (61d2bea)
|
||||
- **Extract Text From HTML**: use html-to-text for better result (91f5548)
|
||||
|
||||
### Chores
|
||||
- **deps**: update node.js to v22 (#182) (b5b3aa0)
|
||||
- **preview workflow**: fix for running on pull requests (1234dca)
|
||||
- fix env.VITE_VERCEL_ENV for prod (39c47a0)
|
||||
|
||||
### Other
|
||||
- - Fixed an issue where the center of the wheel was misaligned compared to the fortune wheel (#177) (fc36499)
|
||||
|
||||
### I18n
|
||||
- add fr translation (b4255a3)
|
||||
|
||||
### Merge branch 'chore/all-my-stuffs' of https
|
||||
- //github.com/sharevb/it-tools into chore/all-my-stuffs (44a2138)
|
||||
|
||||
## Version 2025.08.24-34373f1a
|
||||
|
||||
### Features
|
||||
- fix typescript issue and translate all remaining tools (14dd110)
|
||||
- **About**: rewrite and list all tools (6682517)
|
||||
- **new tool**: DNSBL Checker (e1d05b1)
|
||||
- **Yaml Prettifier**: add a JSON Schema Validator (2ee0274)
|
||||
- **JSON Prettifier/Linter**: add a JSON Schema Validator (5f8aea2)
|
||||
- **new tool**: Which Day Calculator (454b347)
|
||||
- **new tool**: Random Numbers Generator (3240a25)
|
||||
- **new tool**: Favicon Generator (3d3850f)
|
||||
- **new tool**: Image Comparer (201e17b)
|
||||
- **new tool**: Pack files for AI (Repomix) (bd7e018)
|
||||
- **new tool**: Resistor Data Calculator (900c4c9)
|
||||
- **new tool**: Docker Inspect to Docker Run (e942fe4)
|
||||
- **new tool**: Apache Logrotate Generator (81bc965)
|
||||
- **new tool**: RAID Reliability Calculator/MTTDL (dbb56a4)
|
||||
- **new tool**: Font Comparer (6a8d1d3)
|
||||
- **new tool**: Unicode to GSM7 (and SMS info) (50bd3ed)
|
||||
- **new tool**: GPT Token Encoder/Decoder (dfe13de)
|
||||
- **GPT Token Estimator**: expose all models of tiktoken (and remove price thus) (c031d57)
|
||||
- **new tool**: Charset Detector/Decoder (2b06b5b)
|
||||
- **new tool**: Markdown to DOCX (d2e32ac)
|
||||
- **new tool**: Text Translator (01beb24)
|
||||
- **SSL Certificate Converter**: allow converting crt... with multiple certificate (cf3defe)
|
||||
- **new tool**: Env Variables Converter (083b5e1)
|
||||
- **new tool**: Wireguard Config Generator (241dd6f)
|
||||
- **JSON Escaper**: option Wrap in quotes (e2f6a82)
|
||||
- **new tools**: Zpool/OpenZFS calculator and cheatsheet (8ee06ee)
|
||||
- **new tool**: SQL Parameters Generator (71b60fc)
|
||||
- **new tool**: Social Link Sharer (9f5792d)
|
||||
- **new tool**: Middle Endian Converter (1127fbd)
|
||||
- **new tool**: zxcvbn Password Strength (40901c9)
|
||||
- **new tool**: JSON to Data (dacb5ec)
|
||||
- **CSV to Data**: add xlsx format (f5f2938)
|
||||
- **new tool**: TOML Linter (4dc9dcf)
|
||||
- **new tool**: XML Linter (03e6e20)
|
||||
- **YAML Viewer**: add lint keyword (1f314da)
|
||||
- **new tool**: Markdown Table Prettifier (ab7f046)
|
||||
- tools default params and default language at runtime and more url parameters (63065a5)
|
||||
- **new tool**: Mailto Generator (686c9fb)
|
||||
- **new tool**: Django Secret Key generator (603140a)
|
||||
- **new tools**: Docker Compose/file/Swarm Cheatsheet (e20b284)
|
||||
- **new tool**: Sed Command Generator + Cheatsheet (a3b75a6)
|
||||
|
||||
### Bug fixes
|
||||
- optimize Docker build (slow on arm64) (34373f1)
|
||||
- **Text Tranlator**: enhance UI and fix for arm64 (dd87f35)
|
||||
- **Vercel**: Vercel deployment 404 (9f08fe6)
|
||||
- **JSON to TOML**: e2e tests (6cb4958)
|
||||
- add BASE_URL to useScriptTag (1b15214)
|
||||
- **TOML tools**: replace iarna_toml-esm by smol-toml (ca3c3a6)
|
||||
- **deps**: update tiptap monorepo to v2.26.1 (#144) (d554f29)
|
||||
- **Unit Tests**: disable getITToolsSetting (d175e60)
|
||||
- **SEO**: ensure title and description in all <meta> (100563c)
|
||||
- **My IP**: resolve country by IPv4 first (c63e10a)
|
||||
- **Sed Cheatsheet**: naming and table formatting (1d737a0)
|
||||
- **Percentage Calculator**: e2e test failing (de9f44e)
|
||||
- **Docker/Pomodoro Timer**: allow Google Fonts for CSP + fix translation call (87c7609)
|
||||
- **Cron Generator**: fix disappearing UI (6706c68)
|
||||
- **Docker**: allow image upload (connect-src CSP) in nginx config (438bb09)
|
||||
- tool loading indicator after 350ms only (ae0ef63)
|
||||
- **Data Faker**: insert method names + handle options (8ad6157)
|
||||
- **Input Number**: handle dot and comma (and other format) (72f541c)
|
||||
- **QRCode Decoder**: limit to image/* and leave empty if no qr code to decode (75670a7)
|
||||
|
||||
### Chores
|
||||
- cleaning sponsors and buymeacoffee (c2f5b64)
|
||||
- **Translator**: fix typescript stange error (6b1825f)
|
||||
- **Build**: fix maximumFileSizeToCacheInBytes to 25MB (0716afb)
|
||||
- add --archive=tgz to vercel deploy (for rate limiting) (a0beb74)
|
||||
- **config**: migrate config renovate.json (#150) (58b3bd4)
|
||||
- replace Vercel deploiement in Vercel by GitHub Action (acc5ab5)
|
||||
|
||||
### Fixup! feat
|
||||
- **new tool**: Env Variables Converter (9f70133)
|
||||
- **new tool**: Env Variables Converter (d450f3b)
|
||||
|
||||
## Version 2025.08.06-0325b117
|
||||
|
||||
### Features
|
||||
- **i18n**: add Chinese translation (#163) (6cbfa60)
|
||||
|
||||
### Other
|
||||
- - Added a loading background color for light and dark theme (#166) (0325b11)
|
||||
- QR code generator UI improvements (#165) (0462c17)
|
||||
|
||||
## Version 2025.07.20-3ccbd853
|
||||
|
||||
### Features
|
||||
- prepare new tools for translation (cfe5b4f)
|
||||
- translation scripts enhancements (a4576e0)
|
||||
- **new tool**: Levenshtein Distance Calculator (9cb58fc)
|
||||
- **new tools**: YAML/JSON Flattener/Unflattener (521d0bf)
|
||||
- **new tools**: YAML/JSON Merger (1d02e32)
|
||||
- **new tools**: Docker Run/Compose to Quadlets (d28f275)
|
||||
- **Git Memo**: add git pull (c46e65f)
|
||||
- **XPath Tester**: handle namespaces (b0c43e2)
|
||||
- **new tool**: Swagger UI Tester (e5d8425)
|
||||
- **yaml-to-json**: add nestify options (e9dbf1f)
|
||||
- **i18n**: extract some more (1a2e152)
|
||||
- **i18n**: extract some more (7527853)
|
||||
- **i18n**: extract all tools name and description (a9d6b86)
|
||||
- add script to extract tools name and description (cca32ba)
|
||||
- **HTML Editor**: add raw html editor (d625f62)
|
||||
- **new tool**: Citation Generator (APA/MLA) (700cc2a)
|
||||
- **new tool**: JSON Query (lang) (c53a8cb)
|
||||
- **JQ Tester**: add some keywords and move to JSON category (ea0a99e)
|
||||
- **new tool**: ANSI Escape Tester (241dd13)
|
||||
- **new tool**: HTML Minifier (9f5f7d8)
|
||||
- **HTML Editor**: option to minify output (5e3648e)
|
||||
- **Watermarker**: add options for repeated tile spacing and single watermark positioning (a78201b)
|
||||
- **new tool**: Image Watermarker (e00b78b)
|
||||
- **Unicode Search**: improve unicode search loading speed (#97) (f868b97)
|
||||
- **Folder Structure**: Add backwards converter for Folder Structure Page (#105) (9186038)
|
||||
|
||||
### Bug fixes
|
||||
- use t for translate in tools name/description (3ccbd85)
|
||||
- **Regex Tester**: remove shadow root on unmount (a26f2a2)
|
||||
- **iCal Merger**: fix name and desc + regenerate UIDs (0bb259c)
|
||||
- remove stub @types + update podletjs + use @xterm/xterm (504aff9)
|
||||
- **nginx.conf**: allow image-src to blob and http(s) (eafc6f8)
|
||||
- **deps**: update dependency @iplookup/country-extra to v1.0.20250717 (#115) (5bdbaa9)
|
||||
- allow connect-src any https: and http: (79e0db7)
|
||||
- JSON stringify/parse BigInt (ad312d7)
|
||||
- read yaml with intAsBigInt (0d4267e)
|
||||
- **HTML Editor**: remove <p> from <li> (2be6d4d)
|
||||
- **IPv4 Address Converter**: error handling (05d25da)
|
||||
|
||||
### Chores
|
||||
- update deps (b434ad7)
|
||||
- update playwright (1202011)
|
||||
- update deps (babff36)
|
||||
- force base url / for latest and default build (91564e0)
|
||||
- fix github issue template typo (5904fa7)
|
||||
|
||||
### Other
|
||||
- Additions for responsive sidebar pull request (#131) (aabbfca)
|
||||
- add yunohost install option (#133) (96ad3eb)
|
||||
- Feat/translate all content (#121) (a8c6ebc)
|
||||
- Made sidebar responsive (#130) (e811a5b)
|
||||
- Updated Irish translation (#127) (7824f48)
|
||||
- feat(i18n) Added Irish/Gaeilge translation (#124) (4ea4420)
|
||||
- Squashed commit of the following: (207b2ab)
|
||||
|
||||
### Fix
|
||||
- Massive website slowdown after visiting the Unicode Search page (#132) (be9d659)
|
||||
|
||||
### Merge branch 'chore/all-my-stuffs' of https
|
||||
- //github.com/sharevb/it-tools into chore/all-my-stuffs (3ffb805)
|
||||
|
||||
### Feature
|
||||
- Improve menu bar animation smoothness (#109) (7fd60b0)
|
||||
|
||||
### New tool
|
||||
- CLI Command Editor (#108) (3b921e6)
|
||||
|
||||
### Doc
|
||||
- add info for authentication (a12c43b)
|
||||
- add info about ipv6, cyberpanel, https, PWA, dev under WSL2 (de76ee5)
|
||||
|
||||
## Version 2025.06.15-20a26514
|
||||
|
||||
### Features
|
||||
- **Date-Time Converter**: add .Net Ticks (20a2651)
|
||||
- **NGINX**: Add some commonly used security headers (#94) (0048f48)
|
||||
- **new tool**: PDF Text Extractor (3947973)
|
||||
- **new tool**: Age Crypto (8decf33)
|
||||
- **Htpasswd Generator**: add md5, apr1, sha256 and sha512 (4313ce9)
|
||||
- **new tool**: Nginx Memo (7d6753f)
|
||||
- **new tool**: Vim Memo (bed46c6)
|
||||
- **new tool**: Kubernetes Memo (f1d6a16)
|
||||
- **new tool**: Linux Bash Memo (19d3179)
|
||||
- **new tool**: Cron/Weekdays Time Alarm (c9b448c)
|
||||
- **Time Alarm**: fullscreen mode (f90a69c)
|
||||
- **Countdown**: fullscreen mode (80a2fb7)
|
||||
- **Certificate Key Parser**: display public and private keys (pem) (b489f3a)
|
||||
- **new tool**: Traefik Compose Maker (7a48c2f)
|
||||
- **new tool**: Data Faker (dd5ca6f)
|
||||
- **new tool**: Firewalld Generator (eaa8b5b)
|
||||
- **new tool**: HTAccess Generator (00053c3)
|
||||
- add KiB/kB explanations (6762677)
|
||||
- **new tool**: String Escaper (58e2fb3)
|
||||
- **new tool**: Quote Converter (91f565f)
|
||||
- **new tool**: JSON to Protobuf (937ddc6)
|
||||
- **new tool**: Distinct Words Counter (2593df0)
|
||||
- **new tool**: JSON to Typescript (9c925ac)
|
||||
- **new tool**: SQL Minifier (2da9832)
|
||||
- **JS to Object**: handle backquotes (4751417)
|
||||
- **new tool**: JSON to SQL INSERT (e073f3b)
|
||||
- **new tool**: CSV to JSON, YAML, SQL INSERT, Markdown, CSV, XML (93532ce)
|
||||
- **Excel to Data**: handle nestify, XML and Sheet Selection (b982fa5)
|
||||
- **new tool**: Cookies Parser (41d24a5)
|
||||
- **new tool**: Git Semantic Commits Cheatsheet (ca12661)
|
||||
- **PDF Tools**: display command args (1829733)
|
||||
- **JSON to Go**: use quicktype (7931c9b)
|
||||
- **new tool**: JSON to PHP Code (40d90b9)
|
||||
- **new tool**: JSON to Python (bcf93f3)
|
||||
- **new tool**: Curl Command Generator (f4d4de8)
|
||||
- **new tool**: Pdf Extractor (2160e7a)
|
||||
- **new tool**: Pdf Concatener (2c12e1e)
|
||||
- **Rune Converter**: add StavelessFuthark (8efe340)
|
||||
- **new tool**: Paseto/PASERK Encrypt/Decrypt/Sign/Verify and Generator (2037d14)
|
||||
- **new tool**: Excel to Data (e99d7b4)
|
||||
- **new tool**: Iptables Command Generator (35e91b3)
|
||||
- **new tool**: TCP Dump Generator (af6ccec)
|
||||
- **new tool**: JSON to SQL CREATE TABLE/DDL (06e4f84)
|
||||
- **new tool**: Rsync Command Line Generator (f01d56c)
|
||||
- **new tool**: /etc/fstab Generator (faaeeb2)
|
||||
- **new tool**: BMI Calculator (2464f1f)
|
||||
- **new tool**: Properties from/to YAML (ec865b7)
|
||||
- **new tools**: DNS generator (SPF Record, DKIM Record, DMARC Record, BIMI Record ) (53aa948)
|
||||
|
||||
### Bug fixes
|
||||
- favorites contextmenu disable (a93a99b)
|
||||
- linting (56da33f)
|
||||
- **Favorites**: add a delay for dragging to allow touch to access tools (4537cc6)
|
||||
- add loading progress on tool load (db0aff3)
|
||||
- add a splash screen (ac3648c)
|
||||
- **Favorites**: add a delay for dragging to allow touch to access tools (bc8524d)
|
||||
- **Fortune wheel**: added description (64ef495)
|
||||
- add GitHub Page deployment and update README (0c29c19)
|
||||
- optimize monaco-editor loading (locally) (eb40104)
|
||||
- **Textarea Copyable**: better copy button placement (ca47590)
|
||||
- file upload, preview for images only (09d56f5)
|
||||
- Certificate Key Parser and PGP (884a447)
|
||||
- **README**: use latest version for GitHub Pages publish actions (a997446)
|
||||
- **Certificate/Key Parser**: handle multiple PEM certificate in one file (4885459)
|
||||
- **deps**: update dependency jq-wasm to v1 (#24) (386b4fd)
|
||||
- **Docker building**: image overwrite bug (4c600f0)
|
||||
- **Folder Structure Diagram**: use monaco editor (665db9b)
|
||||
- **Cookies Parser**: handle multuple = (368d088)
|
||||
- **Docker Cheatsheet**: typo <> in code blocks (3b21a6b)
|
||||
- checkbox bindings (77e7667)
|
||||
- **Paste as Mardown**: ref errors (6cb20b7)
|
||||
- **Text Diff**: height responsive (6eccfc1)
|
||||
- **README**: typoe in "custom default language" (68c56e4)
|
||||
- **Paseto Tools**: renaming (02e40dc)
|
||||
- **Docker**: baseurl-it-tools, fix rewrite for Traefik (0e9c33d)
|
||||
|
||||
### Refactoring
|
||||
- **Excel to Data**: service + unit tests (ece2770)
|
||||
|
||||
### Chores
|
||||
- try fix vercel build (8e9d921)
|
||||
- fix pgp for vercel (a768d22)
|
||||
- github page deploy and contributors to README (cfcc21d)
|
||||
- fix lint (da8c5df)
|
||||
- fix and optimize build (d4447df)
|
||||
- **deps**: update actions/checkout digest to 11bd719 (#8) (e2a6580)
|
||||
- **deps**: update actions/cache action to v4 (#20) (9eb888f)
|
||||
- **deps**: update actions/checkout action to v4 (#21) (648ef7b)
|
||||
- update codeql version (3a11b59)
|
||||
- github release split and matrix optimization (dae5fe6)
|
||||
- optimize onnxruntime-node (99f4f83)
|
||||
- optimize build and disable preload (8de0535)
|
||||
- update composerize (134a5e8)
|
||||
|
||||
### Other
|
||||
- Added loading delay (#92) (be25e17)
|
||||
- Improve fortune wheel performance (#91) (1e405c3)
|
||||
- Fix broken text fonts (#95) (203f207)
|
||||
- Merge branch 'feat/loading-indicators' into chore/all-my-stuffs (bf395a1)
|
||||
- Convert last items to flex search (#87) (6f1b17f)
|
||||
- Improve image resizer features (#90) (e14fd2f)
|
||||
- Improve hompage performance (#85) (fd76914)
|
||||
- Improve http status codes performance (#86) (b77c57e)
|
||||
- Improve emoji picker performance (#84) (3ed3f90)
|
||||
- Improve IES Lighting guidelines performance (#83) (02df1bc)
|
||||
- Improved iso 3166 searcher page performance (#79) (226081d)
|
||||
- Improved performance on the Unicode Search page (#75) (2355232)
|
||||
- Add all mainpage card translate templates (en.yml) + add ru & ua translations on mainpage card (#62) (3e1b05f)
|
||||
- Add arabic translation (#61) (5a990ae)
|
||||
- Update pt.yml (#59) (4cc875f)
|
||||
- Adding full Ukrainian & Russian translation (#60) (7ed2e41)
|
||||
|
||||
### Documentation
|
||||
- add info about HTTPS using DNS Challenge (78fdceb)
|
||||
|
||||
### Typo
|
||||
- **Fortune Wheel**: maje restart button cleared (spin!) (0098645)
|
||||
|
||||
### Fixup! feat
|
||||
- **new tool**: JSON to Python (3564ccf)
|
||||
- **new tool**: JSON to PHP Code (4089c62)
|
||||
- **new tool**: Properties from/to YAML (520d2cd)
|
||||
|
||||
## Version 2025.04.21-70194069
|
||||
|
||||
### Features
|
||||
|
||||
+9
-4
@@ -1,5 +1,5 @@
|
||||
# build stage
|
||||
FROM node:lts-alpine AS build-stage
|
||||
FROM --platform=$BUILDPLATFORM node:lts-alpine AS build-stage
|
||||
# Set environment variables for non-interactive npm installs
|
||||
ENV NPM_CONFIG_LOGLEVEL warn
|
||||
ENV CI true
|
||||
@@ -9,17 +9,22 @@ RUN apk add --update python3 make g++\
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN npm install -g pnpm && pnpm i --frozen-lockfile
|
||||
RUN npm install -g pnpm && pnpm i --ignore-scripts --frozen-lockfile
|
||||
COPY . .
|
||||
ARG BASE_URL
|
||||
ENV BASE_URL=${BASE_URL}
|
||||
ENV VITE_VERCEL_ENV production
|
||||
RUN pnpm build
|
||||
|
||||
# production stage
|
||||
FROM nginxinc/nginx-unprivileged:stable-alpine AS production-stage
|
||||
ENV VITE_VERCEL_ENV production
|
||||
ARG BASE_URL
|
||||
ENV BASE_URL=${BASE_URL}
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 8080
|
||||
|
||||
COPY nginx.conf /etc/nginx/templates/default.conf.template
|
||||
ENV PORT=8080
|
||||
EXPOSE $PORT
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -1,20 +1,58 @@
|
||||
## BREAKING CHANGE for Docker Image
|
||||
## BREAKING CHANGE for Container Image
|
||||
|
||||
Since *Docker base image* is now `nginx-unpriviledged`, docker image now listen to **8080** and no more 80. So you need to update your port mapping, ie from `8080:80` to `8080:8080`.
|
||||
Since the *base image* is now `nginx-unpriviledged` the container will now listen to port **8080** and not 80. So you need to update your port mapping, i.e. from `8080:80` to `8080:8080`.
|
||||
|
||||
### Check out these change here: <https://sharevb-it-tools.vercel.app/>
|
||||
You can override listening port using environment variable `PORT` (docker option `-e PORT=8888`).
|
||||
|
||||
You can use my image in your docker-compose file if you want an update to date version of it-tools (with my PR and some of others) until the main branch has been updated.
|
||||
If the container needs to listen to IPv6, it needs to be enabled: https://serverfault.com/questions/1147296/how-to-enable-ipv6-on-ubuntu-20-04. Alternatively, you can mount your own `nginx.conf` own using docker option `-v "./nginx.conf:/etc/nginx/templates/default.conf.template"` (with `listen [::]:8080;` removed)
|
||||
|
||||
## PR Welcome
|
||||
|
||||
Especially for UI improvements and translation. And for anything else.
|
||||
|
||||
Want to support this fork of IT Tools: [Buy me a coffee](https://www.buymeacoffee.com/sharevb)
|
||||
|
||||
## HTTPS is recommended
|
||||
|
||||
Some tools like PGP encryption rely on WebCrypto API that is only available in HTTPS/SSL. Also, if you want to use PWA, HTTPS is required.
|
||||
|
||||
So even on internal installations, you should enable HTTPS using Let's Encrypt using DNS Challenge
|
||||
|
||||
Some docs about DNS Challenge:
|
||||
- https://medium.com/@life-is-short-so-enjoy-it/homelab-nginx-proxy-manager-setup-ssl-certificate-with-domain-name-in-cloudflare-dns-732af64ddc0b
|
||||
- https://doc.traefik.io/traefik/user-guides/docker-compose/acme-dns/
|
||||
- https://medium.com/@svenvanginkel/traefik-letsencrypt-dns01-challenge-with-ovhcloud-52f2a2c6d08a
|
||||
|
||||
Related doc for CyberPanel: https://community.cyberpanel.net/t/reverse-proxy-traffic-to-docker-container-on-cyberpanel/30644
|
||||
|
||||
### Check out these change here: <https://sharevb-it-tools.vercel.app/> or <https://sharevb.github.io/it-tools/>
|
||||
|
||||
You can use my image in your docker-compose/quadlet file if you want an up-to-date version of it-tools (with my PR and some of others) until the main branch has been updated.
|
||||
|
||||
- github action triggers on every push to this branch - [view package here](https://github.com/sharevb/it-tools/pkgs/container/it-tools)
|
||||
|
||||
(Thanks to [gitmotion](https://github.com/gitmotion/it-tools) for this model of README fork)
|
||||
|
||||
## Contributors
|
||||
|
||||
Big thanks to all the people who have already contributed!
|
||||
|
||||
[](https://github.com/sharevb/it-tools/graphs/contributors)
|
||||
|
||||
## Development under Windows
|
||||
|
||||
Use of WSL2 is recommended to develop using VSCode on Windows. Direct development is tricky (because of some dependencies)
|
||||
|
||||
## Added features
|
||||
|
||||
Almost [all tools PR of it-tools](https://github.com/sharevb/it-tools/pulls).
|
||||
- Almost [all tools PR, 192 of mine, of original it-tools](https://github.com/CorentinTh/it-tools/pulls)
|
||||
- 95% of [issues if original it-tools](https://github.com/CorentinTh/it-tools/issues)
|
||||
- Full UI translation in many language (Google Translated)
|
||||
- Many [new tools](https://sharevb-it-tools.vercel.app/about)
|
||||
- Many bug fixes and enhancements
|
||||
- Many customizations (Docker version), see below
|
||||
|
||||
## Docker images
|
||||
## Container images
|
||||
|
||||
[GitHub Container Registry](https://github.com/sharevb/it-tools/pkgs/container/it-tools): `ghcr.io/sharevb/it-tools:latest`
|
||||
|
||||
@@ -33,6 +71,27 @@ services:
|
||||
- 8080:8080
|
||||
```
|
||||
|
||||
## Use in Podman Quadlet file
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=IT Tools container
|
||||
After=network-online.target
|
||||
|
||||
[Container]
|
||||
AutoUpdate=registry
|
||||
Image=ghcr.io/sharevb/it-tools:latest
|
||||
PublishPort=8080:8080
|
||||
Label=io.containers.autoupdate=registry
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
```
|
||||
|
||||
|
||||
## Filter tools and add home custom content
|
||||
|
||||
You can add custom content in Home page by mounting a `home.custom.md` in `/usr/share/nginx/html`.
|
||||
@@ -48,7 +107,82 @@ You can filter available tools by mounting `tools-filter.json` in `/usr/share/ng
|
||||
```
|
||||
Category matches on category (English) names ; Tools matches on tools path/url.
|
||||
|
||||
See (docker-tools-filter-and-home-content)[https://github.com/sharevb/it-tools]
|
||||
See [docker-tools-filter-and-home-content](https://github.com/sharevb/it-tools)
|
||||
|
||||
## Add custom external tools
|
||||
|
||||
You can add custom external tools (href or markdownContent) by mounting a `external-tools.json` in `/usr/share/nginx/html` with the following structure:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "GitHub",
|
||||
"path": "/github",
|
||||
"description": "Link to Github",
|
||||
"keywords": ["github"],
|
||||
"category": "Links",
|
||||
"href": "https://github.com"
|
||||
},
|
||||
{
|
||||
"name": "Some text",
|
||||
"path": "/some-text",
|
||||
"description": "Some description",
|
||||
"keywords": ["some"],
|
||||
"category": "Links",
|
||||
"markdownContent": "Some useful **text**\n\nin *markdown*"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
See [docker-tools-filter-and-home-content](https://github.com/sharevb/it-tools)
|
||||
|
||||
## Setting default tools parameters / default UI language at runtime
|
||||
|
||||
You can set default tool parameters by mounting a `tools-setting.json` in `/usr/share/nginx/html`.
|
||||
|
||||
It is a two level json, with the first level being for `tool name` and the second level for `parameter name`:
|
||||
```json
|
||||
{
|
||||
"regex-tester": {
|
||||
"multi": true,
|
||||
"regex": "some regex",
|
||||
"global": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can find `tool name` and `parameter name` in the tools source code `src/tools` subfolder :
|
||||
- example pattern for `const global = useQueryParamOrStorage({ storageName: 'regex-tester:g', name: 'global', defaultValue: true });`:
|
||||
```json
|
||||
{
|
||||
"regex-tester": {
|
||||
"global": false
|
||||
}
|
||||
}
|
||||
```
|
||||
- example pattern for `const value = useQueryParam({ tool: 'barcode-gen', name: 'text', defaultValue: '123456789' });`:
|
||||
```json
|
||||
{
|
||||
"barcode-gen": {
|
||||
"text": "4356"
|
||||
}
|
||||
}
|
||||
```
|
||||
- example pattern for `const width = useITStorage('ascii-text-drawer:width', 80);`:
|
||||
```json
|
||||
{
|
||||
"ascii-text-drawer": {
|
||||
"width": 80
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To define the default UI language, add a `default_locale` key to json:
|
||||
```json
|
||||
{
|
||||
"default_locale": "fr"
|
||||
}
|
||||
```
|
||||
|
||||
## To build using a custom default language:
|
||||
|
||||
@@ -57,7 +191,7 @@ docker build -t it-tools-fr --build-arg VITE_LANGUAGE=fr .
|
||||
docker run -d --name it-tools-fr --restart unless-stopped -p 8080:8080 it-tools-fr
|
||||
```
|
||||
|
||||
## Build docker image for a custom subfolder
|
||||
## Build container image for a custom subfolder
|
||||
|
||||
According to https://github.com/sharevb/it-tools/pull/461#issuecomment-1602506049 and https://github.com/CorentinTh/it-tools/pull/461:
|
||||
```
|
||||
@@ -73,10 +207,12 @@ So you would need to put another server in front of it, like [Nginx Proxy Manage
|
||||
|
||||
For `/it-tools/` subfolder, you can use `baseurl-it-tools` tag.
|
||||
|
||||
See [sample of docker-compose.yml and nginx.conf](https://github.com/sharevb/it-tools/docker-subfolder-sample), this docker image needs to have another reverse proxy in front of it, like [Nginx Proxy Manager](https://nginxproxymanager.com/), [Traefik](https://traefik.io/traefik/), [caddy](https://caddyserver.com/) etc.
|
||||
See [sample of docker-compose.yml and nginx.conf](https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-subfolder-sample), this docker image needs to have another reverse proxy in front of it, like [Nginx Proxy Manager](https://nginxproxymanager.com/), [Traefik](https://traefik.io/traefik/), [caddy](https://caddyserver.com/) etc.
|
||||
|
||||
Setup a reverse proxy pass using `/it-tools/`. And you should be able to access it-tools in `/it-tools/` of your server.
|
||||
|
||||
An example of nginx reverse proxy configuration is available at: https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-subfolder-sample
|
||||
|
||||
To run the sample:
|
||||
|
||||
```bash
|
||||
@@ -95,80 +231,116 @@ Then navigate to http://localhost:8080/it-tools/
|
||||
## To build for GitHub Pages:
|
||||
|
||||
1. Enable GitHub Pages build and deployment option in your fork, under **Settings** > **Pages** and select **GitHub Actions** as the source
|
||||
2. Add the following GitHub action to your repo:
|
||||
2. Add the following GitHub action to your repo: https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/.github/workflows/sharevb-github-pages-publish.yml
|
||||
|
||||
.github/workflows/deploy-pages.yaml
|
||||
```yaml
|
||||
name: Deploy static content to Pages
|
||||
## To add authentication
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches: ["main"]
|
||||
Assuming you're already hosting it-tools behind a reverse proxy, you can configure forward-auth and enforce authentication from the reverse proxy
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
* [Official guides](https://docs.goauthentik.io/docs/add-secure-apps/providers/proxy/server_nginx) with nginx. Guides with other reverse proxy setups are available
|
||||
* [Step-by-step setup guide with nginx-proxy-manager](https://geekscircuit.com/set-up-authentik-sso-with-nginx-proxy-manager/)
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
(thanks @jogerj)
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
## Deploy as LXC container
|
||||
|
||||
jobs:
|
||||
# Single deploy job since we're just deploying
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
name: Install pnpm
|
||||
id: pnpm-install
|
||||
with:
|
||||
version: 8
|
||||
run_install: true
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
BASE_URL="/it-tools/" pnpm build
|
||||
cp dist/index.html dist/404.html
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v3
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
with:
|
||||
path: './dist'
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
||||
In Proxmox VE, you can use docker image directly:
|
||||
```bash
|
||||
sudo lxc-create -n sharevb-it-tools -t oci -- --url docker://ghcr.io/sharevb/it-tools:latest
|
||||
```
|
||||
|
||||
## Contribute
|
||||
|
||||
### Recommended IDE Setup
|
||||
|
||||
To install VSCode in WSL2 (Windows), see: https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-vscode
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) with the following extensions:
|
||||
|
||||
- [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur)
|
||||
- [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
||||
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
||||
- [i18n Ally](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally)
|
||||
|
||||
with the following settings:
|
||||
|
||||
```json
|
||||
{
|
||||
"editor.formatOnSave": false,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
},
|
||||
"i18n-ally.localesPaths": ["locales", "src/tools/*/locales"],
|
||||
"i18n-ally.keystyle": "nested"
|
||||
}
|
||||
```
|
||||
|
||||
### Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
||||
|
||||
1. Disable the built-in TypeScript Extension
|
||||
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
||||
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
||||
|
||||
### Project Setup
|
||||
|
||||
```sh
|
||||
pnpm install --ignore-scripts
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
||||
|
||||
```sh
|
||||
pnpm test
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
pnpm lint
|
||||
```
|
||||
|
||||
### Ensure CI (lock, eslint, typecheck) will succeed
|
||||
|
||||
Before submitting a PR, run:
|
||||
|
||||
```sh
|
||||
pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck
|
||||
```
|
||||
|
||||
### Create a new tool
|
||||
|
||||
To create a new tool, there is a script that generate the boilerplate of the new tool, simply run:
|
||||
|
||||
```sh
|
||||
pnpm run script:create:tool my-tool-name
|
||||
```
|
||||
|
||||
It will create a directory in `src/tools` with the correct files. You will need to fill `src/tools/_my-tool-name_/index.ts` with tool name, category, description... and then develop the tool.
|
||||
|
||||
## Installation methods
|
||||
|
||||
Local installation required installing first: `python3 make g++`
|
||||
|
||||
| Docker Image | Local Installation |
|
||||
| Container Image | Local Installation |
|
||||
|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
|
||||
| GitHub Container Registry: <span title="triple click me!">`ghcr.io/sharevb/it-tools:latest`</span><br/>Docker Hub: <span title="triple click me!">`sharevb/it-tools:latest`</span> | <span title="triple click me!">`sudo apt-get install python3 make g++ && git clone -b chore/all-my-stuffs https://github.com/sharevb/it-tools.git && cd it-tools/ && pnpm i && pnpm dev`</span> |
|
||||
| GitHub Container Registry: <span title="triple click me!">`ghcr.io/sharevb/it-tools:latest`</span><br/>Docker Hub: <span title="triple click me!">`sharevb/it-tools:latest`</span> | <span title="triple click me!">`sudo apt-get install python3 make g++ && git clone -b chore/all-my-stuffs https://github.com/sharevb/it-tools.git && cd it-tools/ && pnpm i --ignore-scripts && pnpm dev`</span> |
|
||||
| replace your current image with this image | copy & paste oneliner (from github repo) |
|
||||
| You may need to clear cache and hard reload to get new features loading | Installing packages for the first time may take some time; please wait until it finishes |
|
||||
|
||||
@@ -209,81 +381,8 @@ docker run -d --name it-tools --restart unless-stopped -p 8080:8080 ghcr.io/core
|
||||
- [Cloudron](https://www.cloudron.io/store/tech.ittools.cloudron.html)
|
||||
- [Tipi](https://www.runtipi.io/docs/apps-available)
|
||||
- [Unraid](https://unraid.net/community/apps?q=it-tools)
|
||||
- [YunoHost](https://apps.yunohost.org/app/it-tools)
|
||||
|
||||
## Contribute
|
||||
|
||||
### Recommended IDE Setup
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) with the following extensions:
|
||||
|
||||
- [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur)
|
||||
- [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
||||
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
||||
- [i18n Ally](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally)
|
||||
|
||||
with the following settings:
|
||||
|
||||
```json
|
||||
{
|
||||
"editor.formatOnSave": false,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
},
|
||||
"i18n-ally.localesPaths": ["locales", "src/tools/*/locales"],
|
||||
"i18n-ally.keystyle": "nested"
|
||||
}
|
||||
```
|
||||
|
||||
### Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
||||
|
||||
1. Disable the built-in TypeScript Extension
|
||||
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
||||
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
||||
|
||||
### Project Setup
|
||||
|
||||
```sh
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
||||
|
||||
```sh
|
||||
pnpm test
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
pnpm 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
|
||||
pnpm run script:create:tool 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 imported tool in the proper category and develop the tool.
|
||||
|
||||
## Contributors
|
||||
|
||||
@@ -306,4 +405,4 @@ Contributor graph is generated using [contrib.rocks](https://contrib.rocks/previ
|
||||
|
||||
This project is under the [GNU GPLv3](LICENSE).
|
||||
|
||||
</details>
|
||||
</details>
|
||||
Vendored
+114
-24
@@ -12,14 +12,19 @@ declare module '@vue/runtime-core' {
|
||||
'404.page': typeof import('./src/pages/404.page.vue')['default']
|
||||
About: typeof import('./src/pages/About.vue')['default']
|
||||
AdLdapSearcher: typeof import('./src/tools/ad-ldap-searcher/ad-ldap-searcher.vue')['default']
|
||||
AgeCrypto: typeof import('./src/tools/age-crypto/age-crypto.vue')['default']
|
||||
AiPromptSplitter: typeof import('./src/tools/ai-prompt-splitter/ai-prompt-splitter.vue')['default']
|
||||
AlarmSoundToggle: typeof import('./src/tools/pomodoro-timer/app/components/AlarmSoundToggle.vue')['default']
|
||||
AmortizationCalculator: typeof import('./src/tools/amortization-calculator/amortization-calculator.vue')['default']
|
||||
AngleConverter: typeof import('./src/tools/angle-converter/angle-converter.vue')['default']
|
||||
AnsibleVaultCryptDecrypt: typeof import('./src/tools/ansible-vault-crypt-decrypt/ansible-vault-crypt-decrypt.vue')['default']
|
||||
AnsiEscapeTester: typeof import('./src/tools/ansi-escape-tester/ansi-escape-tester.vue')['default']
|
||||
ApiTester: typeof import('./src/tools/api-tester/api-tester.vue')['default']
|
||||
App: typeof import('./src/App.vue')['default']
|
||||
AppColorPicker: typeof import('./src/tools/pomodoro-timer/app/components/AppColorPicker.vue')['default']
|
||||
AreaConverter: typeof import('./src/tools/area-converter/area-converter.vue')['default']
|
||||
Argon2Hash: typeof import('./src/tools/argon2-hash/argon2-hash.vue')['default']
|
||||
ArpaDecoder: typeof import('./src/tools/arpa-decoder/arpa-decoder.vue')['default']
|
||||
AsciiTextDrawer: typeof import('./src/tools/ascii-text-drawer/ascii-text-drawer.vue')['default']
|
||||
AspectRatioCalculator: typeof import('./src/tools/aspect-ratio-calculator/aspect-ratio-calculator.vue')['default']
|
||||
BarcodeGenerator: typeof import('./src/tools/barcode-generator/barcode-generator.vue')['default']
|
||||
@@ -28,10 +33,13 @@ declare module '@vue/runtime-core' {
|
||||
Base64FileConverter: typeof import('./src/tools/base64-file-converter/base64-file-converter.vue')['default']
|
||||
Base64HexConverter: typeof import('./src/tools/base64-hex-converter/base64-hex-converter.vue')['default']
|
||||
Base64StringConverter: typeof import('./src/tools/base64-string-converter/base64-string-converter.vue')['default']
|
||||
BashMemo: typeof import('./src/tools/bash-memo/bash-memo.vue')['default']
|
||||
'BashMemo.content': typeof import('./src/tools/bash-memo/bash-memo.content.md')['default']
|
||||
BasicAuthGenerator: typeof import('./src/tools/basic-auth-generator/basic-auth-generator.vue')['default']
|
||||
Bcrypt: typeof import('./src/tools/bcrypt/bcrypt.vue')['default']
|
||||
BenchmarkBuilder: typeof import('./src/tools/benchmark-builder/benchmark-builder.vue')['default']
|
||||
BimiDnsGenerator: typeof import('./src/tools/bimi-dns-generator/bimi-dns-generator.vue')['default']
|
||||
BinaryCalculator: typeof import('./src/tools/binary-calculator/binary-calculator.vue')['default']
|
||||
Bip39Generator: typeof import('./src/tools/bip39-generator/bip39-generator.vue')['default']
|
||||
BmiCalculator: typeof import('./src/tools/bmi-calculator/bmi-calculator.vue')['default']
|
||||
BounceParser: typeof import('./src/tools/bounce-parser/bounce-parser.vue')['default']
|
||||
@@ -52,14 +60,19 @@ declare module '@vue/runtime-core' {
|
||||
CertificateKeyParser: typeof import('./src/tools/certificate-key-parser/certificate-key-parser.vue')['default']
|
||||
CFileUpload: typeof import('./src/ui/c-file-upload/c-file-upload.vue')['default']
|
||||
'CFileUpload.demo': typeof import('./src/ui/c-file-upload/c-file-upload.demo.vue')['default']
|
||||
CharsetDetector: typeof import('./src/tools/charset-detector/charset-detector.vue')['default']
|
||||
Chmod: typeof import('./src/tools/chmod-memo/chmod.md')['default']
|
||||
ChmodCalculator: typeof import('./src/tools/chmod-calculator/chmod-calculator.vue')['default']
|
||||
ChmodMemo: typeof import('./src/tools/chmod-memo/chmod-memo.vue')['default']
|
||||
Chronometer: typeof import('./src/tools/chronometer/chronometer.vue')['default']
|
||||
CidrInCidr: typeof import('./src/tools/cidr-in-cidr/cidr-in-cidr.vue')['default']
|
||||
CInputText: typeof import('./src/ui/c-input-text/c-input-text.vue')['default']
|
||||
'CInputText.demo': typeof import('./src/ui/c-input-text/c-input-text.demo.vue')['default']
|
||||
CitationGenerator: typeof import('./src/tools/citation-generator/citation-generator.vue')['default']
|
||||
CKeyValueList: typeof import('./src/ui/c-key-value-list/c-key-value-list.vue')['default']
|
||||
CKeyValueListItem: typeof import('./src/ui/c-key-value-list/c-key-value-list-item.vue')['default']
|
||||
CLabel: typeof import('./src/ui/c-label/c-label.vue')['default']
|
||||
CliCommandEditor: typeof import('./src/tools/cli-command-editor/cli-command-editor.vue')['default']
|
||||
CLink: typeof import('./src/ui/c-link/c-link.vue')['default']
|
||||
'CLink.demo': typeof import('./src/ui/c-link/c-link.demo.vue')['default']
|
||||
CMarkdown: typeof import('./src/ui/c-markdown/c-markdown.vue')['default']
|
||||
@@ -84,13 +97,17 @@ declare module '@vue/runtime-core' {
|
||||
Countdown: typeof import('./src/tools/countdown/countdown.vue')['default']
|
||||
Counter: typeof import('./src/tools/pomodoro-timer/app/components/Counter.vue')['default']
|
||||
CrcCalculator: typeof import('./src/tools/crc-calculator/crc-calculator.vue')['default']
|
||||
CreditCardChecker: typeof import('./src/tools/credit-card-checker/credit-card-checker.vue')['default']
|
||||
CronAlarm: typeof import('./src/tools/cron-alarm/cron-alarm.vue')['default']
|
||||
CrontabGenerator: typeof import('./src/tools/crontab-generator/crontab-generator.vue')['default']
|
||||
CSelect: typeof import('./src/ui/c-select/c-select.vue')['default']
|
||||
'CSelect.demo': typeof import('./src/ui/c-select/c-select.demo.vue')['default']
|
||||
CsrGenerator: typeof import('./src/tools/csr-generator/csr-generator.vue')['default']
|
||||
CssGradientGenerator: typeof import('./src/tools/css-gradient-generator/css-gradient-generator.vue')['default']
|
||||
CssPrettifier: typeof import('./src/tools/css-prettifier/css-prettifier.vue')['default']
|
||||
CssSelectors: typeof import('./src/tools/css-selectors-memo/css-selectors.md')['default']
|
||||
CssSelectorsMemo: typeof import('./src/tools/css-selectors-memo/css-selectors-memo.vue')['default']
|
||||
CssUnitsConverter: typeof import('./src/tools/css-units-converter/css-units-converter.vue')['default']
|
||||
CssXpathConverter: typeof import('./src/tools/css-xpath-converter/css-xpath-converter.vue')['default']
|
||||
CsvToData: typeof import('./src/tools/csv-to-data/csv-to-data.vue')['default']
|
||||
CsvToJson: typeof import('./src/tools/csv-to-json/csv-to-json.vue')['default']
|
||||
@@ -103,32 +120,46 @@ declare module '@vue/runtime-core' {
|
||||
CurlConverter: typeof import('./src/tools/curl-converter/curl-converter.vue')['default']
|
||||
CurlGenerator: typeof import('./src/tools/curl-generator/curl-generator.vue')['default']
|
||||
CurrencyConverter: typeof import('./src/tools/currency-converter/currency-converter.vue')['default']
|
||||
DatabaseConnectionStringBuilder: typeof import('./src/tools/database-connection-string-builder/database-connection-string-builder.vue')['default']
|
||||
DataFaker: typeof import('./src/tools/data-faker/data-faker.vue')['default']
|
||||
DataStorageUnitConverter: typeof import('./src/tools/data-storage-unit-converter/data-storage-unit-converter.vue')['default']
|
||||
DataTransferRateConverter: typeof import('./src/tools/data-transfer-rate-converter/data-transfer-rate-converter.vue')['default']
|
||||
DateDurationCalculator: typeof import('./src/tools/date-duration-calculator/date-duration-calculator.vue')['default']
|
||||
DateTimeConverter: typeof import('./src/tools/date-time-converter/date-time-converter.vue')['default']
|
||||
DaysCalculator: typeof import('./src/tools/days-calculator/days-calculator.vue')['default']
|
||||
DbmMwConverter: typeof import('./src/tools/dbm-mw-converter/dbm-mw-converter.vue')['default']
|
||||
DeadPixel: typeof import('./src/tools/dead-pixel/dead-pixel.vue')['default']
|
||||
'DemoHome.page': typeof import('./src/ui/demo/demo-home.page.vue')['default']
|
||||
DemoWrapper: typeof import('./src/ui/demo/demo-wrapper.vue')['default']
|
||||
DeviceInformation: typeof import('./src/tools/device-information/device-information.vue')['default']
|
||||
DiceRoller: typeof import('./src/tools/dice-roller/dice-roller.vue')['default']
|
||||
DicewareGenerator: typeof import('./src/tools/diceware-generator/diceware-generator.vue')['default']
|
||||
DiffViewer: typeof import('./src/tools/json-diff/diff-viewer/diff-viewer.vue')['default']
|
||||
DistinctWords: typeof import('./src/tools/distinct-words/distinct-words.vue')['default']
|
||||
DjangoSecretGenerator: typeof import('./src/tools/django-secret-generator/django-secret-generator.vue')['default']
|
||||
DkimDnsGenerator: typeof import('./src/tools/dkim-dns-generator/dkim-dns-generator.vue')['default']
|
||||
'Dmarc-Generator': typeof import('./src/tools/dmarc-dns-generator/dmarc--generator.vue')['default']
|
||||
DmarcDnsGenerator: typeof import('./src/tools/dmarc-dns-generator/dmarc-dns-generator.vue')['default']
|
||||
DmarcGenerator: typeof import('./src/tools/dmarc-dns-generator/dmarc-generator.vue')['default']
|
||||
DmarcReportAnalyzer: typeof import('./src/tools/dmarc-report-analyzer/dmarc-report-analyzer.vue')['default']
|
||||
DnsblChecker: typeof import('./src/tools/dnsbl-checker/dnsbl-checker.vue')['default']
|
||||
DnsQueries: typeof import('./src/tools/dns-queries/dns-queries.vue')['default']
|
||||
Docker: typeof import('./src/tools/docker-memo/docker.md')['default']
|
||||
DockerCompose: typeof import('./src/tools/docker-compose-memo/docker-compose.md')['default']
|
||||
DockerComposeConverter: typeof import('./src/tools/docker-compose-converter/docker-compose-converter.vue')['default']
|
||||
DockerComposeMemo: typeof import('./src/tools/docker-compose-memo/docker-compose-memo.vue')['default']
|
||||
DockerComposeToDockerRunConverter: typeof import('./src/tools/docker-compose-to-docker-run-converter/docker-compose-to-docker-run-converter.vue')['default']
|
||||
DockerComposeToEnvFile: typeof import('./src/tools/docker-compose-to-env-file/docker-compose-to-env-file.vue')['default']
|
||||
DockerComposeToKubernetes: typeof import('./src/tools/docker-compose-to-kubernetes/docker-compose-to-kubernetes.vue')['default']
|
||||
DockerComposeToQuadlets: typeof import('./src/tools/docker-compose-to-quadlets/docker-compose-to-quadlets.vue')['default']
|
||||
DockerComposeValidator: typeof import('./src/tools/docker-compose-validator/docker-compose-validator.vue')['default']
|
||||
Dockerfile: typeof import('./src/tools/dockerfile-memo/dockerfile.md')['default']
|
||||
DockerfileMemo: typeof import('./src/tools/dockerfile-memo/dockerfile-memo.vue')['default']
|
||||
DockerInspectToDockerRun: typeof import('./src/tools/docker-inspect-to-docker-run/docker-inspect-to-docker-run.vue')['default']
|
||||
DockerMemo: typeof import('./src/tools/docker-memo/docker-memo.vue')['default']
|
||||
DockerRunToDockerComposeConverter: typeof import('./src/tools/docker-run-to-docker-compose-converter/docker-run-to-docker-compose-converter.vue')['default']
|
||||
DockerRunToKubernetes: typeof import('./src/tools/docker-run-to-kubernetes/docker-run-to-kubernetes.vue')['default']
|
||||
DockerRunToQuadlets: typeof import('./src/tools/docker-run-to-quadlets/docker-run-to-quadlets.vue')['default']
|
||||
DockerSwarm: typeof import('./src/tools/docker-swarm-memo/docker-swarm.md')['default']
|
||||
DockerSwarmMemo: typeof import('./src/tools/docker-swarm-memo/docker-swarm-memo.vue')['default']
|
||||
DuplicateLineFinder: typeof import('./src/tools/duplicate-line-finder/duplicate-line-finder.vue')['default']
|
||||
DurationCalculator: typeof import('./src/tools/duration-calculator/duration-calculator.vue')['default']
|
||||
DynamicValues: typeof import('./src/tools/benchmark-builder/dynamic-values.vue')['default']
|
||||
@@ -140,30 +171,41 @@ declare module '@vue/runtime-core' {
|
||||
EmojiCard: typeof import('./src/tools/emoji-picker/emoji-card.vue')['default']
|
||||
EmojiGrid: typeof import('./src/tools/emoji-picker/emoji-grid.vue')['default']
|
||||
EmojiPicker: typeof import('./src/tools/emoji-picker/emoji-picker.vue')['default']
|
||||
EmvTlvDecoder: typeof import('./src/tools/emv-tlv-decoder/emv-tlv-decoder.vue')['default']
|
||||
Encryption: typeof import('./src/tools/encryption/encryption.vue')['default']
|
||||
EnergyComputer: typeof import('./src/tools/energy-computer/energy-computer.vue')['default']
|
||||
EnergyConverter: typeof import('./src/tools/energy-converter/energy-converter.vue')['default']
|
||||
EnvVariablesConverter: typeof import('./src/tools/env-variables-converter/env-variables-converter.vue')['default']
|
||||
EtaCalculator: typeof import('./src/tools/eta-calculator/eta-calculator.vue')['default']
|
||||
EthTransactionDecoder: typeof import('./src/tools/eth-transaction-decoder/eth-transaction-decoder.vue')['default']
|
||||
ExcelToData: typeof import('./src/tools/excel-to-data/excel-to-data.vue')['default']
|
||||
ExtractTextFromHtml: typeof import('./src/tools/extract-text-from-html/extract-text-from-html.vue')['default']
|
||||
FaviconGenerator: typeof import('./src/tools/favicon-generator/favicon-generator.vue')['default']
|
||||
FavoriteButton: typeof import('./src/components/FavoriteButton.vue')['default']
|
||||
FileHasher: typeof import('./src/tools/file-hasher/file-hasher.vue')['default']
|
||||
FileSplitter: typeof import('./src/tools/file-splitter/file-splitter.vue')['default']
|
||||
FileType: typeof import('./src/tools/file-type/file-type.vue')['default']
|
||||
FinishedPopup: typeof import('./src/tools/pomodoro-timer/app/components/FinishedPopup.vue')['default']
|
||||
FirewalldGenerator: typeof import('./src/tools/firewalld-generator/firewalld-generator.vue')['default']
|
||||
FloatingPointNumberConverter: typeof import('./src/tools/floating-point-number-converter/floating-point-number-converter.vue')['default']
|
||||
FolderStructureDiagram: typeof import('./src/tools/folder-structure-diagram/folder-structure-diagram.vue')['default']
|
||||
FontCompare: typeof import('./src/tools/font-compare/font-compare.vue')['default']
|
||||
FontControls: typeof import('./src/tools/font-compare/font-controls.vue')['default']
|
||||
Footer: typeof import('./src/tools/pomodoro-timer/app/components/Footer.vue')['default']
|
||||
ForceConverter: typeof import('./src/tools/force-converter/force-converter.vue')['default']
|
||||
FormatTransformer: typeof import('./src/components/FormatTransformer.vue')['default']
|
||||
FortuneWheel: typeof import('./src/tools/fortune-wheel/fortune-wheel.vue')['default']
|
||||
FstabGenerator: typeof import('./src/tools/fstab-generator/fstab-generator.vue')['default']
|
||||
GeoDistanceCalculator: typeof import('./src/tools/geo-distance-calculator/geo-distance-calculator.vue')['default']
|
||||
GitattributesGenerator: typeof import('./src/tools/gitattributes-generator/gitattributes-generator.vue')['default']
|
||||
GitignoreGenerator: typeof import('./src/tools/gitignore-generator/gitignore-generator.vue')['default']
|
||||
GitMemo: typeof import('./src/tools/git-memo/git-memo.vue')['default']
|
||||
'GitMemo.content': typeof import('./src/tools/git-memo/git-memo.content.md')['default']
|
||||
'GitSem.memo': typeof import('./src/tools/git-semantic-commit-memo/git-sem.memo.md')['default']
|
||||
GitSemanticCommitMemo: typeof import('./src/tools/git-semantic-commit-memo/git-semantic-commit-memo.vue')['default']
|
||||
GptTokenEncoder: typeof import('./src/tools/gpt-token-encoder/gpt-token-encoder.vue')['default']
|
||||
GptTokenEstimator: typeof import('./src/tools/gpt-token-estimator/gpt-token-estimator.vue')['default']
|
||||
GtinValidator: typeof import('./src/tools/gtin-validator/gtin-validator.vue')['default']
|
||||
GzipConverter: typeof import('./src/tools/gzip-converter/gzip-converter.vue')['default']
|
||||
HarSanitizer: typeof import('./src/tools/har-sanitizer/har-sanitizer.vue')['default']
|
||||
HashText: typeof import('./src/tools/hash-text/hash-text.vue')['default']
|
||||
@@ -178,11 +220,14 @@ declare module '@vue/runtime-core' {
|
||||
HtaccessGenerator: typeof import('./src/tools/htaccess-generator/htaccess-generator.vue')['default']
|
||||
HtmlCleaner: typeof import('./src/tools/html-cleaner/html-cleaner.vue')['default']
|
||||
HtmlEntities: typeof import('./src/tools/html-entities/html-entities.vue')['default']
|
||||
HtmlMinifier: typeof import('./src/tools/html-minifier/html-minifier.vue')['default']
|
||||
HtmlPrettifier: typeof import('./src/tools/html-prettifier/html-prettifier.vue')['default']
|
||||
HtmlToMarkdown: typeof import('./src/tools/html-to-markdown/html-to-markdown.vue')['default']
|
||||
HtmlWysiwygEditor: typeof import('./src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue')['default']
|
||||
HtpasswdGenerator: typeof import('./src/tools/htpasswd-generator/htpasswd-generator.vue')['default']
|
||||
HttpStatusCodes: typeof import('./src/tools/http-status-codes/http-status-codes.vue')['default']
|
||||
IanaWhoisChecker: typeof import('./src/tools/iana-whois-checker/iana-whois-checker.vue')['default']
|
||||
IAndLChecker: typeof import('./src/tools/i-and-l-checker/i-and-l-checker.vue')['default']
|
||||
IbanValidatorAndParser: typeof import('./src/tools/iban-validator-and-parser/iban-validator-and-parser.vue')['default']
|
||||
IcalGenerator: typeof import('./src/tools/ical-generator/ical-generator.vue')['default']
|
||||
IcalMerger: typeof import('./src/tools/ical-merger/ical-merger.vue')['default']
|
||||
@@ -202,6 +247,8 @@ declare module '@vue/runtime-core' {
|
||||
IconMdiTriangleDown: typeof import('~icons/mdi/triangle-down')['default']
|
||||
IesLightingGuidelines: typeof import('./src/tools/ies-lighting-guidelines/ies-lighting-guidelines.vue')['default']
|
||||
IlluminanceConverter: typeof import('./src/tools/illuminance-converter/illuminance-converter.vue')['default']
|
||||
ImageColorInverter: typeof import('./src/tools/image-color-inverter/image-color-inverter.vue')['default']
|
||||
ImageComparer: typeof import('./src/tools/image-comparer/image-comparer.vue')['default']
|
||||
ImageConverter: typeof import('./src/tools/image-converter/image-converter.vue')['default']
|
||||
ImageExifReader: typeof import('./src/tools/image-exif-reader/image-exif-reader.vue')['default']
|
||||
ImageResizer: typeof import('./src/tools/image-resizer/image-resizer.vue')['default']
|
||||
@@ -218,6 +265,7 @@ declare module '@vue/runtime-core' {
|
||||
Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default']
|
||||
Ipv4RangeExpander: typeof import('./src/tools/ipv4-range-expander/ipv4-range-expander.vue')['default']
|
||||
Ipv4SubnetCalculator: typeof import('./src/tools/ipv4-subnet-calculator/ipv4-subnet-calculator.vue')['default']
|
||||
Ipv4SubnetsList: typeof import('./src/tools/ipv4-subnets-list/ipv4-subnets-list.vue')['default']
|
||||
Ipv6AddressConverter: typeof import('./src/tools/ipv6-address-converter/ipv6-address-converter.vue')['default']
|
||||
Ipv6SubnetCalculator: typeof import('./src/tools/ipv6-subnet-calculator/ipv6-subnet-calculator.vue')['default']
|
||||
Ipv6UlaGenerator: typeof import('./src/tools/ipv6-ula-generator/ipv6-ula-generator.vue')['default']
|
||||
@@ -231,18 +279,23 @@ declare module '@vue/runtime-core' {
|
||||
JsonDiff: typeof import('./src/tools/json-diff/json-diff.vue')['default']
|
||||
JsonEditor: typeof import('./src/tools/json-editor/json-editor.vue')['default']
|
||||
JsonEscaper: typeof import('./src/tools/json-escaper/json-escaper.vue')['default']
|
||||
JsonFlattenNestify: typeof import('./src/tools/json-flatten-nestify/json-flatten-nestify.vue')['default']
|
||||
JsonLinter: typeof import('./src/tools/json-linter/json-linter.vue')['default']
|
||||
JsonMerger: typeof import('./src/tools/json-merger/json-merger.vue')['default']
|
||||
JsonMinify: typeof import('./src/tools/json-minify/json-minify.vue')['default']
|
||||
Jsonpath: typeof import('./src/tools/jsonpath-memo/jsonpath.md')['default']
|
||||
JsonpathMemo: typeof import('./src/tools/jsonpath-memo/jsonpath-memo.vue')['default']
|
||||
JsonQuery: typeof import('./src/tools/json-query/json-query.vue')['default']
|
||||
JsonSizeAnalyzer: typeof import('./src/tools/json-size-analyzer/json-size-analyzer.vue')['default']
|
||||
JsonSortMaster: typeof import('./src/tools/json-sort-master/json-sort-master.vue')['default']
|
||||
JsonStringConverter: typeof import('./src/tools/json-string-converter/json-string-converter.vue')['default']
|
||||
JsonToCsharp: typeof import('./src/tools/json-to-csharp/json-to-csharp.vue')['default']
|
||||
JsonToCsv: typeof import('./src/tools/json-to-csv/json-to-csv.vue')['default']
|
||||
JsonToData: typeof import('./src/tools/json-to-data/json-to-data.vue')['default']
|
||||
JsonToGo: typeof import('./src/tools/json-to-go/json-to-go.vue')['default']
|
||||
JsonToJava: typeof import('./src/tools/json-to-java/json-to-java.vue')['default']
|
||||
JsonToJavascript: typeof import('./src/tools/json-to-javascript/json-to-javascript.vue')['default']
|
||||
JsonToMsgpack: typeof import('./src/tools/json-to-msgpack/json-to-msgpack.vue')['default']
|
||||
JsonToObject: typeof import('./src/tools/json-to-object/json-to-object.vue')['default']
|
||||
JsonToPhp: typeof import('./src/tools/json-to-php/json-to-php.vue')['default']
|
||||
JsonToPhpArray: typeof import('./src/tools/json-to-php-array/json-to-php-array.vue')['default']
|
||||
@@ -252,6 +305,7 @@ declare module '@vue/runtime-core' {
|
||||
JsonToSqlDdl: typeof import('./src/tools/json-to-sql-ddl/json-to-sql-ddl.vue')['default']
|
||||
JsonToSqlInsert: typeof import('./src/tools/json-to-sql-insert/json-to-sql-insert.vue')['default']
|
||||
JsonToToml: typeof import('./src/tools/json-to-toml/json-to-toml.vue')['default']
|
||||
JsonToToon: typeof import('./src/tools/json-to-toon/json-to-toon.vue')['default']
|
||||
JsonToTs: typeof import('./src/tools/json-to-ts/json-to-ts.vue')['default']
|
||||
JsonToTypescript: typeof import('./src/tools/json-to-typescript/json-to-typescript.vue')['default']
|
||||
JsonToXml: typeof import('./src/tools/json-to-xml/json-to-xml.vue')['default']
|
||||
@@ -260,20 +314,29 @@ declare module '@vue/runtime-core' {
|
||||
JsUnobfuscator: typeof import('./src/tools/js-unobfuscator/js-unobfuscator.vue')['default']
|
||||
JwtGenerator: typeof import('./src/tools/jwt-generator/jwt-generator.vue')['default']
|
||||
JwtParser: typeof import('./src/tools/jwt-parser/jwt-parser.vue')['default']
|
||||
K8sMemo: typeof import('./src/tools/k8s-memo/k8s-memo.vue')['default']
|
||||
'K8sMemo.content': typeof import('./src/tools/k8s-memo/k8s-memo.content.md')['default']
|
||||
KeyboardLayoutConverter: typeof import('./src/tools/keyboard-layout-converter/keyboard-layout-converter.vue')['default']
|
||||
KeycodeInfo: typeof import('./src/tools/keycode-info/keycode-info.vue')['default']
|
||||
LengthConverter: typeof import('./src/tools/length-converter/length-converter.vue')['default']
|
||||
LevenshteinCalculator: typeof import('./src/tools/levenshtein-calculator/levenshtein-calculator.vue')['default']
|
||||
ListComparer: typeof import('./src/tools/list-comparer/list-comparer.vue')['default']
|
||||
ListConverter: typeof import('./src/tools/list-converter/list-converter.vue')['default']
|
||||
LocaleSelector: typeof import('./src/modules/i18n/components/locale-selector.vue')['default']
|
||||
LogrotateGenerator: typeof import('./src/tools/logrotate-generator/logrotate-generator.vue')['default']
|
||||
LoremIpsumGenerator: typeof import('./src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue')['default']
|
||||
LuhnValidator: typeof import('./src/tools/luhn-validator/luhn-validator.vue')['default']
|
||||
MacAddressConverter: typeof import('./src/tools/mac-address-converter/mac-address-converter.vue')['default']
|
||||
MacAddressGenerator: typeof import('./src/tools/mac-address-generator/mac-address-generator.vue')['default']
|
||||
MacAddressLookup: typeof import('./src/tools/mac-address-lookup/mac-address-lookup.vue')['default']
|
||||
MailtoGenerator: typeof import('./src/tools/mailto-generator/mailto-generator.vue')['default']
|
||||
ManyUnitsConverter: typeof import('./src/tools/many-units-converter/many-units-converter.vue')['default']
|
||||
MarkdownCheatsheet: typeof import('./src/tools/markdown-cheatsheet/markdown-cheatsheet.vue')['default']
|
||||
MarkdownEditor: typeof import('./src/tools/markdown-editor/markdown-editor.vue')['default']
|
||||
MarkdownLoremIpsum: typeof import('./src/tools/markdown-lorem-ipsum/markdown-lorem-ipsum.vue')['default']
|
||||
MarkdownTablePrettifier: typeof import('./src/tools/markdown-table-prettifier/markdown-table-prettifier.vue')['default']
|
||||
MarkdownTocGenerator: typeof import('./src/tools/markdown-toc-generator/markdown-toc-generator.vue')['default']
|
||||
MarkdownToDocx: typeof import('./src/tools/markdown-to-docx/markdown-to-docx.vue')['default']
|
||||
MarkdownToHtml: typeof import('./src/tools/markdown-to-html/markdown-to-html.vue')['default']
|
||||
MassConverter: typeof import('./src/tools/mass-converter/mass-converter.vue')['default']
|
||||
MathEvaluator: typeof import('./src/tools/math-evaluator/math-evaluator.vue')['default']
|
||||
@@ -283,50 +346,39 @@ declare module '@vue/runtime-core' {
|
||||
MenuBar: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar.vue')['default']
|
||||
MenuBarItem: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar-item.vue')['default']
|
||||
MenuIconItem: typeof import('./src/components/MenuIconItem.vue')['default']
|
||||
MenuItemTooltip: typeof import('./src/components/MenuItemTooltip.vue')['default']
|
||||
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
|
||||
MermaidExporter: typeof import('./src/tools/mermaid-exporter/mermaid-exporter.vue')['default']
|
||||
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
|
||||
MicTester: typeof import('./src/tools/mic-tester/mic-tester.vue')['default']
|
||||
MiddleEndianConverter: typeof import('./src/tools/middle-endian-converter/middle-endian-converter.vue')['default']
|
||||
MimeConverter: typeof import('./src/tools/mime-converter/mime-converter.vue')['default']
|
||||
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
|
||||
ModeIconBar: typeof import('./src/tools/pomodoro-timer/app/components/ModeIconBar.vue')['default']
|
||||
MongoObjectidConverter: typeof import('./src/tools/mongo-objectid-converter/mongo-objectid-converter.vue')['default']
|
||||
MorseConverter: typeof import('./src/tools/morse-converter/morse-converter.vue')['default']
|
||||
MsgpackToJson: typeof import('./src/tools/msgpack-to-json/msgpack-to-json.vue')['default']
|
||||
MttdlCalculator: typeof import('./src/tools/mttdl-calculator/mttdl-calculator.vue')['default']
|
||||
MultiLinkDownloader: typeof import('./src/tools/multi-link-downloader/multi-link-downloader.vue')['default']
|
||||
MyIp: typeof import('./src/tools/my-ip/my-ip.vue')['default']
|
||||
NanoidGenerator: typeof import('./src/tools/nanoid-generator/nanoid-generator.vue')['default']
|
||||
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
|
||||
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']
|
||||
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
||||
NButton: typeof import('naive-ui')['NButton']
|
||||
NCard: typeof import('naive-ui')['NCard']
|
||||
NCheckbox: typeof import('naive-ui')['NCheckbox']
|
||||
NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDivider: typeof import('naive-ui')['NDivider']
|
||||
NDynamicTags: typeof import('naive-ui')['NDynamicTags']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NForm: typeof import('naive-ui')['NForm']
|
||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
NginxFormatter: typeof import('./src/tools/nginx-formatter/nginx-formatter.vue')['default']
|
||||
NginxMemo: typeof import('./src/tools/nginx-memo/nginx-memo.vue')['default']
|
||||
'NginxMemo.content': typeof import('./src/tools/nginx-memo/nginx-memo.content.md')['default']
|
||||
NH1: typeof import('naive-ui')['NH1']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NicewareBytesToPassphrase: typeof import('./src/tools/niceware-bytes-to-passphrase/niceware-bytes-to-passphrase.vue')['default']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
NInput: typeof import('naive-ui')['NInput']
|
||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
NInputNumberI18n: typeof import('./src/ui/n-input-number-i18n/n-input-number-i18n.vue')['default']
|
||||
'NInputNumberI18n.demo': typeof import('./src/ui/n-input-number-i18n/n-input-number-i18n.demo.vue')['default']
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NP: typeof import('naive-ui')['NP']
|
||||
NRadio: typeof import('naive-ui')['NRadio']
|
||||
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSelect: typeof import('naive-ui')['NSelect']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NSwitch: typeof import('naive-ui')['NSwitch']
|
||||
NText: typeof import('naive-ui')['NText']
|
||||
NTooltip: typeof import('naive-ui')['NTooltip']
|
||||
NumberInput: typeof import('./src/tools/pomodoro-timer/app/components/NumberInput.vue')['default']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
@@ -334,18 +386,21 @@ declare module '@vue/runtime-core' {
|
||||
Option43Generator: typeof import('./src/tools/option43-generator/option43-generator.vue')['default']
|
||||
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
||||
OutlookParser: typeof import('./src/tools/outlook-parser/outlook-parser.vue')['default']
|
||||
PackFilesForAi: typeof import('./src/tools/pack-files-for-ai/pack-files-for-ai.vue')['default']
|
||||
ParquetsReader: typeof import('./src/tools/parquets-reader/parquets-reader.vue')['default']
|
||||
PasetoEncryption: typeof import('./src/tools/paseto-encryption/paseto-encryption.vue')['default']
|
||||
PasetoSigning: typeof import('./src/tools/paseto-signing/paseto-signing.vue')['default']
|
||||
PassphraseGenerator: typeof import('./src/tools/passphrase-generator/passphrase-generator.vue')['default']
|
||||
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
||||
PasteAsMarkdown: typeof import('./src/tools/paste-as-markdown/paste-as-markdown.vue')['default']
|
||||
PdfCompressor: typeof import('./src/tools/pdf-compressor/pdf-compressor.vue')['default']
|
||||
PdfConcat: typeof import('./src/tools/pdf-concat/pdf-concat.vue')['default']
|
||||
PdfEncrypt: typeof import('./src/tools/pdf-encrypt/pdf-encrypt.vue')['default']
|
||||
PdfExtract: typeof import('./src/tools/pdf-extract/pdf-extract.vue')['default']
|
||||
PdfLinearize: typeof import('./src/tools/pdf-linearize/pdf-linearize.vue')['default']
|
||||
PdfSignatureChecker: typeof import('./src/tools/pdf-signature-checker/pdf-signature-checker.vue')['default']
|
||||
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
|
||||
PdfTextExtractor: typeof import('./src/tools/pdf-text-extractor/pdf-text-extractor.vue')['default']
|
||||
PdfUnlock: typeof import('./src/tools/pdf-unlock/pdf-unlock.vue')['default']
|
||||
PercentageCalculator: typeof import('./src/tools/percentage-calculator/percentage-calculator.vue')['default']
|
||||
PgpEncryption: typeof import('./src/tools/pgp-encryption/pgp-encryption.vue')['default']
|
||||
@@ -363,13 +418,14 @@ declare module '@vue/runtime-core' {
|
||||
PressureConverter: typeof import('./src/tools/pressure-converter/pressure-converter.vue')['default']
|
||||
ProgressBar: typeof import('./src/tools/pomodoro-timer/app/components/ProgressBar.vue')['default']
|
||||
PropertiesConverter: typeof import('./src/tools/properties-converter/properties-converter.vue')['default']
|
||||
PropertiesToYaml: typeof import('./src/tools/properties-to-yaml/properties-to-yaml.vue')['default']
|
||||
PtrDnsGenerator: typeof import('./src/tools/ptr-dns-generator/ptr-dns-generator.vue')['default']
|
||||
PunycodeConverter: typeof import('./src/tools/punycode-converter/punycode-converter.vue')['default']
|
||||
QrCodeDecoder: typeof import('./src/tools/qr-code-decoder/qr-code-decoder.vue')['default']
|
||||
QrCodeGenerator: typeof import('./src/tools/qr-code-generator/qr-code-generator.vue')['default']
|
||||
QrContactInfoGenerator: typeof import('./src/tools/qr-contact-info-generator/qr-contact-info-generator.vue')['default']
|
||||
QuoteConverter: typeof import('./src/tools/quote-converter/quote-converter.vue')['default']
|
||||
RaidCalculator: typeof import('./src/tools/raid-calculator/raid-calculator.vue')['default']
|
||||
RandomNumbersGenerator: typeof import('./src/tools/random-numbers-generator/random-numbers-generator.vue')['default']
|
||||
RandomPortGenerator: typeof import('./src/tools/random-port-generator/random-port-generator.vue')['default']
|
||||
RegexMemo: typeof import('./src/tools/regex-memo/regex-memo.vue')['default']
|
||||
'RegexMemo.content': typeof import('./src/tools/regex-memo/regex-memo.content.md')['default']
|
||||
@@ -377,6 +433,7 @@ declare module '@vue/runtime-core' {
|
||||
RemoveExif: typeof import('./src/tools/remove-exif/remove-exif.vue')['default']
|
||||
RemPxConverter: typeof import('./src/tools/rem-px-converter/rem-px-converter.vue')['default']
|
||||
ResetDropup: typeof import('./src/tools/pomodoro-timer/app/components/ResetDropup.vue')['default']
|
||||
ResistorCalculator: typeof import('./src/tools/resistor-calculator/resistor-calculator.vue')['default']
|
||||
ResultRow: typeof import('./src/tools/ipv4-range-expander/result-row.vue')['default']
|
||||
RmbNumbers: typeof import('./src/tools/rmb-numbers/rmb-numbers.vue')['default']
|
||||
RomanNumeralConverter: typeof import('./src/tools/roman-numeral-converter/roman-numeral-converter.vue')['default']
|
||||
@@ -388,27 +445,38 @@ declare module '@vue/runtime-core' {
|
||||
RsyncGenerator: typeof import('./src/tools/rsync-generator/rsync-generator.vue')['default']
|
||||
RuneConverter: typeof import('./src/tools/rune-converter/rune-converter.vue')['default']
|
||||
SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default']
|
||||
ScreenMemo: typeof import('./src/tools/screen-memo/screen-memo.vue')['default']
|
||||
'ScreenMemo.content': typeof import('./src/tools/screen-memo/screen-memo.content.md')['default']
|
||||
Sed: typeof import('./src/tools/sed-memo/sed.md')['default']
|
||||
SedCommandGenerator: typeof import('./src/tools/sed-command-generator/sed-command-generator.vue')['default']
|
||||
SedMemo: typeof import('./src/tools/sed-memo/sed-memo.vue')['default']
|
||||
SensitiveDataMasker: typeof import('./src/tools/sensitive-data-masker/sensitive-data-masker.vue')['default']
|
||||
SerialConsole: typeof import('./src/tools/serial-console/serial-console.vue')['default']
|
||||
Settings: typeof import('./src/tools/pomodoro-timer/app/views/Settings.vue')['default']
|
||||
ShamirsSecretSharing: typeof import('./src/tools/shamirs-secret-sharing/shamirs-secret-sharing.vue')['default']
|
||||
SharepointDecoder: typeof import('./src/tools/sharepoint-decoder/sharepoint-decoder.vue')['default']
|
||||
ShortUrlsExpander: typeof import('./src/tools/short-urls-expander/short-urls-expander.vue')['default']
|
||||
SipAuth: typeof import('./src/tools/sip-auth/sip-auth.vue')['default']
|
||||
SlaCalculator: typeof import('./src/tools/sla-calculator/sla-calculator.vue')['default']
|
||||
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
|
||||
SmartRawConverter: typeof import('./src/tools/smart-raw-converter/smart-raw-converter.vue')['default']
|
||||
SmartTextReplacer: typeof import('./src/tools/smart-text-replacer/smart-text-replacer.vue')['default']
|
||||
SnowflakeIdExtractor: typeof import('./src/tools/snowflake-id-extractor/snowflake-id-extractor.vue')['default']
|
||||
SocialLinkSharer: typeof import('./src/tools/social-link-sharer/social-link-sharer.vue')['default']
|
||||
SoftwareLicenceCompatibility: typeof import('./src/tools/software-licence-compatibility/software-licence-compatibility.vue')['default']
|
||||
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
|
||||
SpfDnsGenerator: typeof import('./src/tools/spf-dns-generator/spf-dns-generator.vue')['default']
|
||||
SpfGenerator: typeof import('./src/tools/spf-dns-generator/spf-generator.vue')['default']
|
||||
SplashScreen: typeof import('./src/tools/pomodoro-timer/app/views/SplashScreen.vue')['default']
|
||||
SqlMinifier: typeof import('./src/tools/sql-minifier/sql-minifier.vue')['default']
|
||||
SqlParameters: typeof import('./src/tools/sql-parameters/sql-parameters.vue')['default']
|
||||
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
|
||||
SslCertConverter: typeof import('./src/tools/ssl-cert-converter/ssl-cert-converter.vue')['default']
|
||||
StacktracePrettier: typeof import('./src/tools/stacktrace-prettier/stacktrace-prettier.vue')['default']
|
||||
StringEscaper: typeof import('./src/tools/string-escaper/string-escaper.vue')['default']
|
||||
StringObfuscator: typeof import('./src/tools/string-obfuscator/string-obfuscator.vue')['default']
|
||||
SvgPlaceholderGenerator: typeof import('./src/tools/svg-placeholder-generator/svg-placeholder-generator.vue')['default']
|
||||
SvgPreviewer: typeof import('./src/tools/svg-previewer/svg-previewer.vue')['default']
|
||||
SwaggerUiTester: typeof import('./src/tools/swagger-ui-tester/swagger-ui-tester.vue')['default']
|
||||
TcpdumpGenerator: typeof import('./src/tools/tcpdump-generator/tcpdump-generator.vue')['default']
|
||||
TemperatureConverter: typeof import('./src/tools/temperature-converter/temperature-converter.vue')['default']
|
||||
TextareaCopyable: typeof import('./src/components/TextareaCopyable.vue')['default']
|
||||
@@ -420,19 +488,27 @@ declare module '@vue/runtime-core' {
|
||||
TextToUnicodeNames: typeof import('./src/tools/text-to-unicode-names/text-to-unicode-names.vue')['default']
|
||||
TimeAlarm: typeof import('./src/tools/time-alarm/time-alarm.vue')['default']
|
||||
TimezoneConverter: typeof import('./src/tools/timezone-converter/timezone-converter.vue')['default']
|
||||
TLVTagTree: typeof import('./src/tools/emv-tlv-decoder/TLVTagTree.vue')['default']
|
||||
TmuxMemo: typeof import('./src/tools/tmux-memo/tmux-memo.vue')['default']
|
||||
'TmuxMemo.content': typeof import('./src/tools/tmux-memo/tmux-memo.content.md')['default']
|
||||
TokenDisplay: typeof import('./src/tools/otp-code-generator-and-validator/token-display.vue')['default']
|
||||
'TokenGenerator.tool': typeof import('./src/tools/token-generator/token-generator.tool.vue')['default']
|
||||
TomlLinter: typeof import('./src/tools/toml-linter/toml-linter.vue')['default']
|
||||
TomlToJson: typeof import('./src/tools/toml-to-json/toml-to-json.vue')['default']
|
||||
TomlToYaml: typeof import('./src/tools/toml-to-yaml/toml-to-yaml.vue')['default']
|
||||
'Tool.layout': typeof import('./src/layouts/tool.layout.vue')['default']
|
||||
ToolCard: typeof import('./src/components/ToolCard.vue')['default']
|
||||
ToonToJson: typeof import('./src/tools/toon-to-json/toon-to-json.vue')['default']
|
||||
TorrentToMagnet: typeof import('./src/tools/torrent-to-magnet/torrent-to-magnet.vue')['default']
|
||||
TraefikComposeMaker: typeof import('./src/tools/traefik-compose-maker/traefik-compose-maker.vue')['default']
|
||||
Translator: typeof import('./src/tools/translator/translator.vue')['default']
|
||||
TrigoViewer: typeof import('./src/tools/trigo-viewer/trigo-viewer.vue')['default']
|
||||
TtlCalculator: typeof import('./src/tools/ttl-calculator/ttl-calculator.vue')['default']
|
||||
UlidGenerator: typeof import('./src/tools/ulid-generator/ulid-generator.vue')['default']
|
||||
UnicodeCharactersToJavaEntities: typeof import('./src/tools/unicode-characters-to-java-entities-converter/unicode-characters-to-java-entities.vue')['default']
|
||||
UnicodeFormatter: typeof import('./src/tools/unicode-formatter/unicode-formatter.vue')['default']
|
||||
UnicodeSearch: typeof import('./src/tools/unicode-search/unicode-search.vue')['default']
|
||||
UnicodeToGsm7: typeof import('./src/tools/unicode-to-gsm7/unicode-to-gsm7.vue')['default']
|
||||
UnitsConverter: typeof import('./src/components/UnitsConverter.vue')['default']
|
||||
UrlCleaner: typeof import('./src/tools/url-cleaner/url-cleaner.vue')['default']
|
||||
UrlEncoder: typeof import('./src/tools/url-encoder/url-encoder.vue')['default']
|
||||
@@ -445,21 +521,35 @@ declare module '@vue/runtime-core' {
|
||||
UuidConverter: typeof import('./src/tools/uuid-converter/uuid-converter.vue')['default']
|
||||
UuidGenerator: typeof import('./src/tools/uuid-generator/uuid-generator.vue')['default']
|
||||
VatValidator: typeof import('./src/tools/vat-validator/vat-validator.vue')['default']
|
||||
VimMemo: typeof import('./src/tools/vim-memo/vim-memo.vue')['default']
|
||||
'VimMemo.content': typeof import('./src/tools/vim-memo/vim-memo.content.md')['default']
|
||||
VolumeConverter: typeof import('./src/tools/volume-converter/volume-converter.vue')['default']
|
||||
Watermarker: typeof import('./src/tools/watermarker/watermarker.vue')['default']
|
||||
WebsocketTester: typeof import('./src/tools/websocket-tester/websocket-tester.vue')['default']
|
||||
WeekNumberConverter: typeof import('./src/tools/week-number-converter/week-number-converter.vue')['default']
|
||||
WhichDay: typeof import('./src/tools/which-day/which-day.vue')['default']
|
||||
WifiQrCodeGenerator: typeof import('./src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue')['default']
|
||||
WireguardConfigGenerator: typeof import('./src/tools/wireguard-config-generator/wireguard-config-generator.vue')['default']
|
||||
WpaPskGenerator: typeof import('./src/tools/wpa-psk-generator/wpa-psk-generator.vue')['default']
|
||||
X509CertificateGenerator: typeof import('./src/tools/x509-certificate-generator/x509-certificate-generator.vue')['default']
|
||||
XmlFormatter: typeof import('./src/tools/xml-formatter/xml-formatter.vue')['default']
|
||||
XmlLinter: typeof import('./src/tools/xml-linter/xml-linter.vue')['default']
|
||||
XmlToJson: typeof import('./src/tools/xml-to-json/xml-to-json.vue')['default']
|
||||
Xpath: typeof import('./src/tools/xpath-memo/xpath.md')['default']
|
||||
XpathMemo: typeof import('./src/tools/xpath-memo/xpath-memo.vue')['default']
|
||||
XpathTester: typeof import('./src/tools/xpath-tester/xpath-tester.vue')['default']
|
||||
XsltTester: typeof import('./src/tools/xslt-tester/xslt-tester.vue')['default']
|
||||
XVrSpamcauseDecoder: typeof import('./src/tools/x-vr-spamcause-decoder/x-vr-spamcause-decoder.vue')['default']
|
||||
YamlFlattenNestify: typeof import('./src/tools/yaml-flatten-nestify/yaml-flatten-nestify.vue')['default']
|
||||
YamlMerger: typeof import('./src/tools/yaml-merger/yaml-merger.vue')['default']
|
||||
YamlToJson: typeof import('./src/tools/yaml-to-json-converter/yaml-to-json.vue')['default']
|
||||
YamlToToml: typeof import('./src/tools/yaml-to-toml/yaml-to-toml.vue')['default']
|
||||
YamlViewer: typeof import('./src/tools/yaml-viewer/yaml-viewer.vue')['default']
|
||||
ZellijMemo: typeof import('./src/tools/zellij-memo/zellij-memo.vue')['default']
|
||||
'ZellijMemo.content': typeof import('./src/tools/zellij-memo/zellij-memo.content.md')['default']
|
||||
'Zpool.content': typeof import('./src/tools/zpool-memo/zpool.content.md')['default']
|
||||
ZpoolCalculator: typeof import('./src/tools/zpool-calculator/zpool-calculator.vue')['default']
|
||||
ZpoolMemo: typeof import('./src/tools/zpool-memo/zpool-memo.vue')['default']
|
||||
ZxcvbnPasswordStrength: typeof import('./src/tools/zxcvbn-password-strength/zxcvbn-password-strength.vue')['default']
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,6 @@ services:
|
||||
depends_on:
|
||||
- it-tools
|
||||
volumes:
|
||||
- "./nginx.conf:/etc/nginx/conf.d/nginx.conf"
|
||||
- "./nginx.conf:/etc/nginx/conf.d/default.conf"
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 80:80
|
||||
@@ -1,8 +1,11 @@
|
||||
server {
|
||||
listen 8080;
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
location /it-tools/ {
|
||||
proxy_pass http://it-tools-subfolder:8080/;
|
||||
}
|
||||
location /it-tools {
|
||||
return 301 /it-tools/;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ services:
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./tools-filter.json:/usr/share/nginx/html/tools-filter.json
|
||||
- ./external-tools.json:/usr/share/nginx/html/external-tools.json
|
||||
- ./home.custom.md:/usr/share/nginx/html/home.custom.md
|
||||
ports:
|
||||
- 8080:8080
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"name": "GitHub",
|
||||
"path": "/github",
|
||||
"description": "Link to Github",
|
||||
"keywords": ["github"],
|
||||
"category": "Links",
|
||||
"href": "https://github.com"
|
||||
},
|
||||
{
|
||||
"name": "Some text",
|
||||
"path": "/some-text",
|
||||
"description": "Some description",
|
||||
"keywords": ["some"],
|
||||
"category": "Links",
|
||||
"markdownContent": "Some useful **text**\n\nin *markdown*"
|
||||
}
|
||||
]
|
||||
-19
@@ -5,15 +5,6 @@
|
||||
<link rel="icon" href="favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>IT Tools - Handy online tools for developers</title>
|
||||
<meta itemprop="name" 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."
|
||||
/>
|
||||
<meta
|
||||
itemprop="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://sharevb-it-tools.vercel.app" />
|
||||
|
||||
@@ -26,22 +17,12 @@
|
||||
|
||||
<meta property="og:url" content="https://sharevb-it-tools.vercel.app/" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="IT Tools - Handy online tools for developers" />
|
||||
<meta
|
||||
property="og: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."
|
||||
/>
|
||||
<meta property="og:image" content="https://sharevb-it-tools.vercel.app/banner.png?v=2" />
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:site" content="@ittoolsdottech" />
|
||||
<meta name="twitter:creator" content="@cthmsst" />
|
||||
|
||||
<meta name="twitter:title" content="IT Tools - Handy online tools for developers" />
|
||||
<meta
|
||||
name="twitter: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."
|
||||
/>
|
||||
<meta name="twitter:image" content="https://sharevb-it-tools.vercel.app/banner.png?v=2" />
|
||||
<meta name="twitter:image:alt" content="IT Tools - Handy online tools for developers" />
|
||||
</head>
|
||||
|
||||
+7224
-188
File diff suppressed because it is too large.
Load diff
+7639
File diff suppressed because it is too large.
Load diff
+7572
-191
File diff suppressed because it is too large.
Load diff
+6900
-517
File diff suppressed because it is too large.
Load diff
+7775
-50
File diff suppressed because it is too large.
Load diff
+7941
-45
File diff suppressed because it is too large.
Load diff
+7739
File diff suppressed because it is too large.
Load diff
+7788
File diff suppressed because it is too large.
Load diff
+7290
File diff suppressed because it is too large.
Load diff
+7718
File diff suppressed because it is too large.
Load diff
+7417
-177
File diff suppressed because it is too large.
Load diff
+7639
-42
File diff suppressed because it is too large.
Load diff
+7692
-57
File diff suppressed because it is too large.
Load diff
+6914
-406
File diff suppressed because it is too large.
Load diff
+7704
File diff suppressed because it is too large.
Load diff
+6869
-396
File diff suppressed because it is too large.
Load diff
+7392
-158
File diff suppressed because it is too large.
Load diff
+7206
-309
File diff suppressed because it is too large.
Load diff
+9
-2
@@ -1,10 +1,17 @@
|
||||
server {
|
||||
listen 8080;
|
||||
listen [::]:8080;
|
||||
listen ${PORT};
|
||||
listen [::]:${PORT};
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
add_header X-Frame-Options SAMEORIGIN;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header Referrer-Policy strict-origin-when-cross-origin;
|
||||
add_header X-Permitted-Cross-Domain-Policies none;
|
||||
add_header Cross-Origin-Resource-Policy same-site;
|
||||
add_header Cross-Origin-Opener-Policy same-origin;
|
||||
#add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' http: https: blob:; style-src 'self' 'unsafe-inline' https: http:; img-src 'self' data: blob: https: http:; connect-src data: blob: https: http:; font-src 'self' https: http:; object-src 'none'; base-uri 'self'; form-action 'self';";
|
||||
location / {
|
||||
rewrite ^/it-tools/(.*) /$1 break;
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
+193
-120
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "it-tools",
|
||||
"type": "module",
|
||||
"version": "2025.4.21-70194069",
|
||||
"version": "2026.1.4",
|
||||
"packageManager": "pnpm@9.11.0",
|
||||
"description": "Collection of handy online tools for developers, with great UX. ",
|
||||
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
|
||||
@@ -26,213 +26,263 @@
|
||||
"build": "vue-tsc --noEmit && . ./set_node_mem.sh && vite build",
|
||||
"preview": "vite preview --port 5050",
|
||||
"test": "TZ=UTC npm run test:unit",
|
||||
"test:unit": "TZ=UTC vitest --environment jsdom",
|
||||
"test:e2e": "TZ=UTC playwright test",
|
||||
"test:unit": "TZ=UTC . ./set_node_mem.sh && vitest --environment jsdom",
|
||||
"test:e2e": "TZ=UTC . ./set_node_mem.sh && playwright test",
|
||||
"test:e2e:dev": "TZ=UTC BASE_URL=http://localhost:5173 NO_WEB_SERVER=true playwright test",
|
||||
"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",
|
||||
"script:create:tool": "node scripts/create-tool.mjs",
|
||||
"script:create:ui": "hygen generator ui-component",
|
||||
"release": "node ./scripts/release.mjs"
|
||||
"release": "node ./scripts/release.mjs",
|
||||
"script:extract:desc": "node ./scripts/extract-tools-desc.mjs",
|
||||
"script:extract:strings": "node ./scripts/extract-tools-strings.mjs",
|
||||
"script:translate-missing": "node ./scripts/translate-missings.mjs -e ./locales/en.yml -t ./locales/*.yml",
|
||||
"vue-i18n-extract": "vue-i18n-extract report --vueFiles 'src/**/*.?(ts|vue)' --languageFiles 'locales/*.yml'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@chenfengyuan/vue-barcode": "^2.0.2",
|
||||
"@date-fns/utc": "^1.2.0",
|
||||
"@date-fns/utc": "^2.1.1",
|
||||
"@dice-roller/rpg-dice-roller": "^5.5.1",
|
||||
"@faker-js/faker": "^9.7.0",
|
||||
"@faker-js/faker": "^9.9.0",
|
||||
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
||||
"@fortawesome/vue-fontawesome": "^3.0.8",
|
||||
"@github/paste-markdown": "^1.5.3",
|
||||
"@guolao/vue-monaco-editor": "^1.5.4",
|
||||
"@guolao/vue-monaco-editor": "^1.5.5",
|
||||
"@guyplusplus/turndown-plugin-gfm": "^1.0.7",
|
||||
"@huggingface/transformers": "3.0.0-alpha.14",
|
||||
"@iplookup/country-extra": "^1.0.20250317",
|
||||
"@huggingface/transformers": "3.7.2",
|
||||
"@iplookup/country-extra": "^1.0.20251209",
|
||||
"@it-tools/bip39": "^0.0.4",
|
||||
"@it-tools/oggen": "^1.3.0",
|
||||
"@jsonquerylang/jsonquery": "^5.1.1",
|
||||
"@kenjiuno/decompressrtf": "^0.1.4",
|
||||
"@kenjiuno/msgreader": "^1.22.0",
|
||||
"@kenjiuno/msgreader": "^1.27.0",
|
||||
"@langfreak/convert-layout": "^0.11.2",
|
||||
"@mdit/plugin-align": "^0.16.0",
|
||||
"@noble/ciphers": "^1.2.1",
|
||||
"@regexper/render": "^1.0.0",
|
||||
"@sindresorhus/slugify": "^2.2.1",
|
||||
"@sindresorhus/slugify": "^3.0.0",
|
||||
"@skeepit/unicode-to-gsm7": "^1.0.0",
|
||||
"@tabler/icons-vue": "^3.20.0",
|
||||
"@tiptap/core": "2.9.1",
|
||||
"@tiptap/extension-color": "^2.11.5",
|
||||
"@tiptap/extension-gapcursor": "^2.11.5",
|
||||
"@tiptap/extension-highlight": "^2.11.5",
|
||||
"@tiptap/extension-table": "^2.11.5",
|
||||
"@tiptap/extension-table-cell": "^2.11.5",
|
||||
"@tiptap/extension-table-header": "^2.11.5",
|
||||
"@tiptap/extension-table-row": "^2.11.5",
|
||||
"@tiptap/extension-text-style": "^2.11.5",
|
||||
"@tiptap/pm": "2.9.1",
|
||||
"@tiptap/starter-kit": "2.9.1",
|
||||
"@tiptap/vue-3": "2.9.1",
|
||||
"@tiptap/core": "3.14.0",
|
||||
"@tiptap/extension-color": "^3.14.0",
|
||||
"@tiptap/extension-gapcursor": "^3.14.0",
|
||||
"@tiptap/extension-highlight": "^3.14.0",
|
||||
"@tiptap/extension-table": "^3.14.0",
|
||||
"@tiptap/extension-text-align": "^3.14.0",
|
||||
"@tiptap/extension-text-style": "^3.14.0",
|
||||
"@tiptap/extensions": "^3.14.0",
|
||||
"@tiptap/pm": "3.14.0",
|
||||
"@tiptap/starter-kit": "3.14.0",
|
||||
"@tiptap/vue-3": "3.14.0",
|
||||
"@toon-format/toon": "^1.4.0",
|
||||
"@types/haversine": "^1.1.8",
|
||||
"@types/moment": "^2.13.0",
|
||||
"@unicode/unicode-15.1.0": "^1.6.5",
|
||||
"@types/html-to-text": "^9.0.4",
|
||||
"@types/swagger-ui-dist": "^3.30.6",
|
||||
"@unicode/unicode-15.1.0": "^1.6.6",
|
||||
"@vicons/material": "^0.12.0",
|
||||
"@vicons/tabler": "^0.12.0",
|
||||
"@vueuse/core": "^10.11.1",
|
||||
"@vueuse/head": "^1.0.0",
|
||||
"@vueuse/router": "^10.0.0",
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"@xmldom/xmldom": "^0.8.11",
|
||||
"@xterm/xterm": "^5.5.0",
|
||||
"@younestouati/playing-cards-standard-deck": "^6.0.1",
|
||||
"@zxcvbn-ts/core": "^3.0.4",
|
||||
"@zxcvbn-ts/language-common": "^3.0.4",
|
||||
"@zxcvbn-ts/language-en": "^3.0.2",
|
||||
"@zxing/library": "^0.21.3",
|
||||
"a11y-color-contrast": "^0.2.0",
|
||||
"abort-signal-polyfill": "^1.0.0",
|
||||
"aircodes": "^1.3.16",
|
||||
"ajv": "^8.17.1",
|
||||
"ajv-errors": "^3.0.0",
|
||||
"ansi-styles": "^6.2.3",
|
||||
"ansible-vault": "^1.3.0",
|
||||
"apache-md5": "^1.1.8",
|
||||
"arr-diff": "^4.0.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"big.js": "^6.2.2",
|
||||
"bcryptjs": "^3.0.3",
|
||||
"big.js": "^7.0.1",
|
||||
"braces": "^3.0.3",
|
||||
"bwip-js": "^4.5.1",
|
||||
"bwip-js": "^4.8.0",
|
||||
"byte-data": "^19.0.1",
|
||||
"change-case": "^5.4.4",
|
||||
"chardet": "^2.1.1",
|
||||
"chart.js": "^4.5.1",
|
||||
"chartjs-plugin-zoom": "^2.2.0",
|
||||
"chatgpt-prompt-splitter": "^1.0.5",
|
||||
"chinesegen": "^0.3.3",
|
||||
"cidr-tools": "^11.0.2",
|
||||
"cidr-tools": "^11.0.3",
|
||||
"citation-formatter": "^1.0.1",
|
||||
"colord": "^2.9.3",
|
||||
"composerize": "^1.7.2",
|
||||
"composeverter": "^1.7.4",
|
||||
"convert": "^5.7.0",
|
||||
"countries-and-timezones": "^3.7.2",
|
||||
"composerize": "^1.7.5",
|
||||
"composeverter": "^1.7.5",
|
||||
"convert": "^5.14.1",
|
||||
"countries-and-timezones": "^3.8.0",
|
||||
"countries-db": "^1.2.0",
|
||||
"country-code-lookup": "^0.1.3",
|
||||
"crc": "^4.3.2",
|
||||
"cron-parser": "^4.9.0",
|
||||
"cron-validator": "^1.3.1",
|
||||
"cronstrue": "^2.54.0",
|
||||
"creditcard": "^0.1.3",
|
||||
"creditcard-generator": "^0.0.7",
|
||||
"cron-parser": "4.9.0",
|
||||
"cron-validator": "^1.4.0",
|
||||
"cronstrue": "^3.0.0",
|
||||
"cross-spawn": "^7.0.6",
|
||||
"crypto-js": "^4.2.0",
|
||||
"csstoxpath": "^2.0.0",
|
||||
"curlconverter": "^4.12.0",
|
||||
"currency-codes-ts": "^3.0.0",
|
||||
"currency-exchanger-js": "^1.0.4",
|
||||
"damerau-levenshtein": "^1.0.8",
|
||||
"data-guardian": "^1.1.3",
|
||||
"date-fns": "^2.30.0",
|
||||
"date-holidays": "^3.23.21",
|
||||
"date-fns": "^4.1.0",
|
||||
"date-fns-tz": "^3.2.0",
|
||||
"date-holidays": "^3.26.6",
|
||||
"decimal.js": "^10.6.0",
|
||||
"decomposerize": "^1.4.4",
|
||||
"detect-csv": "^1.1.0",
|
||||
"diceware-generator": "^3.0.1",
|
||||
"diceware-wordlist-en": "^1.0.0",
|
||||
"diceware-wordlist-en-eff": "^1.0.1",
|
||||
"diceware-wordlist-jp": "^1.0.1",
|
||||
"diceware-wordlist-sp": "^1.0.0",
|
||||
"diceware-wordlist-swe": "^1.0.1",
|
||||
"dmarc-report-parser": "^0.1.5",
|
||||
"dns-query": "^0.11.2",
|
||||
"docker2kube": "^0.0.14",
|
||||
"dom-to-image-more": "^3.5.0",
|
||||
"dompurify": "^3.2.4",
|
||||
"dom-to-image-more": "^3.7.2",
|
||||
"dompurify": "^3.2.6",
|
||||
"duration-fns": "^3.0.2",
|
||||
"email-bounce-parser-browser": "^1.1.0",
|
||||
"email-normalizer": "^1.0.0",
|
||||
"emojilib": "^4.0.1",
|
||||
"event-cron-parser": "^1.0.35",
|
||||
"emojilib": "^4.0.2",
|
||||
"ethers": "^6.16.0",
|
||||
"event-cron-parser": "^1.0.37",
|
||||
"exif-be-gone": "^1.5.1",
|
||||
"exifreader": "^4.26.1",
|
||||
"exifreader": "^4.33.1",
|
||||
"fanger": "^0.3.1",
|
||||
"fast-xml-parser": "^5.3.3",
|
||||
"fast_array_intersect": "^1.1.0",
|
||||
"fflate": "^0.8.2",
|
||||
"figlet": "^1.8.0",
|
||||
"figlet": "^1.9.4",
|
||||
"figue": "^1.2.0",
|
||||
"file-type": "^20.1.0",
|
||||
"flatten-anything": "^4.0.1",
|
||||
"file-type": "^21.2.0",
|
||||
"flatten-anything": "^4.0.2",
|
||||
"flexsearch": "^0.8.212",
|
||||
"fuse.js": "^7.1.0",
|
||||
"generate-schema": "^2.6.0",
|
||||
"get-timezone-offset": "^1.0.5",
|
||||
"gpt-tokens": "^1.3.14",
|
||||
"ghostscript-wasm-esm": "^1.0.1",
|
||||
"gtin-validator": "^1.0.0",
|
||||
"hash-wasm": "^4.12.0",
|
||||
"haversine": "^1.1.1",
|
||||
"heic-convert": "^2.1.0",
|
||||
"hex-array": "^1.0.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
"hyparquet": "^1.9.0",
|
||||
"hyparquet-compressors": "^1.0.0",
|
||||
"iarna-toml-esm": "^3.0.5",
|
||||
"html-to-text": "^9.0.5",
|
||||
"htmlfy": "^1.0.1",
|
||||
"htmlparser2": "^10.0.0",
|
||||
"hyparquet": "^1.23.3",
|
||||
"hyparquet-compressors": "^1.1.1",
|
||||
"ibantools": "^4.5.1",
|
||||
"ical-generator": "^8.1.1",
|
||||
"ical.js": "^2.1.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"image-in-browser": "^3.2.1",
|
||||
"ical-generator": "^10.0.0",
|
||||
"ical.js": "^2.2.1",
|
||||
"iconv-lite": "^0.7.1",
|
||||
"image-compare-viewer": "^1.6.2",
|
||||
"image-in-browser": "^3.3.0",
|
||||
"image-to-ascii-art": "^0.0.4",
|
||||
"ip-address": "^9.0.5",
|
||||
"ip-bigint": "^8.2.0",
|
||||
"ip-address": "^10.1.0",
|
||||
"ip-bigint": "^8.2.2",
|
||||
"ip-cidr": "^4.0.2",
|
||||
"ip-matching": "^2.1.2",
|
||||
"ip-regex": "^5.0.0",
|
||||
"is-cidr": "^5.1.0",
|
||||
"is-cidr": "^6.0.1",
|
||||
"is-ip": "^5.0.1",
|
||||
"isbn3": "^1.2.7",
|
||||
"isbn3": "^2.0.2",
|
||||
"iso-639-1": "^3.1.5",
|
||||
"javascript-obfuscator": "^5.1.0",
|
||||
"javastack.js": "^1.0.3",
|
||||
"jks-js": "^1.1.4",
|
||||
"jose": "^5.9.6",
|
||||
"jose": "5.10.0",
|
||||
"jpeg-quality-estimator": "^1.0.1",
|
||||
"jq-wasm": "^1.0.0",
|
||||
"js-base64": "^3.7.7",
|
||||
"js-beautify": "^1.15.2",
|
||||
"jsbarcode": "^3.11.6",
|
||||
"jq-wasm": "^1.0.1",
|
||||
"js-base64": "^3.7.8",
|
||||
"js-beautify": "^1.15.4",
|
||||
"js-tiktoken": "^1.0.21",
|
||||
"jsbarcode": "^3.12.1",
|
||||
"json-analyzer": "^1.2.2",
|
||||
"json-editor-vue": "^0.16.0",
|
||||
"json-to-ts": "^1.7.0",
|
||||
"json-editor-vue": "^0.18.1",
|
||||
"json-to-ts": "^2.1.0",
|
||||
"json5": "^2.2.3",
|
||||
"jsonar-mod": "^1.9.0",
|
||||
"jsonlint-mod": "^1.7.6",
|
||||
"jsonpath": "^1.1.1",
|
||||
"jsonrepair": "^3.12.0",
|
||||
"jsonrepair": "^3.13.1",
|
||||
"jsonschema": "^1.5.0",
|
||||
"jsonschema-protobuf": "^1.0.2",
|
||||
"jsstack.js": "^2.0.0",
|
||||
"jsvat-next": "^3.0.4",
|
||||
"jszip": "^3.10.1",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"korean-unpacker": "^1.0.3",
|
||||
"libmime": "^5.3.6",
|
||||
"libphonenumber-js": "^1.11.19",
|
||||
"libmime": "^5.3.7",
|
||||
"libphonenumber-js": "^1.12.33",
|
||||
"lodash": "^4.17.21",
|
||||
"lodash.defaultsdeep": "^4.6.1",
|
||||
"lodash.flattendeep": "^4.4.0",
|
||||
"lodash.last": "^3.0.0",
|
||||
"lodash.mergewith": "^4.6.2",
|
||||
"long": "^5.3.1",
|
||||
"lorem-ipsum-japanese": "^1.0.1",
|
||||
"luhn-js": "^1.1.2",
|
||||
"luxon": "^3.5.0",
|
||||
"markdown-docx": "^1.5.1",
|
||||
"markdown-it": "^14.1.0",
|
||||
"markdown-it-mark": "^4.0.0",
|
||||
"markdown-it-sanitizer": "^0.4.3",
|
||||
"markdown-it-sub": "^2.0.0",
|
||||
"markdown-it-sup": "^2.0.0",
|
||||
"markdown-table-prettify": "^3.7.0",
|
||||
"marked": "^10.0.0",
|
||||
"mathjs": "^14.2.1",
|
||||
"mathjs": "^15.1.0",
|
||||
"md-editor-v3": "^4.21.3",
|
||||
"memorystream": "^0.3.1",
|
||||
"mermaid": "^11.6.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"merge-anything": "^6.0.6",
|
||||
"mermaid": "^11.12.2",
|
||||
"mime-types": "^3.0.2",
|
||||
"mitex-wasm": "^0.2.5",
|
||||
"moment": "^2.30.1",
|
||||
"monaco-editor": "^0.43.0",
|
||||
"monaco-editor": "^0.55.1",
|
||||
"morsee": "^1.0.10",
|
||||
"msgpackr": "^1.11.8",
|
||||
"naive-ui": "^2.35.0",
|
||||
"nanoid": "^5.0.9",
|
||||
"nanoid-dictionary": "^4.3.0",
|
||||
"nestify-anything": "^3.0.3",
|
||||
"nanoid": "^5.1.6",
|
||||
"nanoid-dictionary": "^5.0.0",
|
||||
"nestify-anything": "^4.0.1",
|
||||
"netmask": "^2.0.2",
|
||||
"netstack.js": "^2.1.1",
|
||||
"netstack.js": "^2.1.2",
|
||||
"nginx-config-formatter": "^1.4.5",
|
||||
"node-forge": "^1.3.1",
|
||||
"openpgp": "^6.1.0",
|
||||
"oui-data": "^1.1.281",
|
||||
"parse-duration": "^2.1.2",
|
||||
"parse-torrent": "^11.0.18",
|
||||
"niceware": "^4.0.0",
|
||||
"node-emv": "^1.0.23",
|
||||
"node-forge": "^1.3.3",
|
||||
"openai-chat-tokens": "^0.2.8",
|
||||
"openpgp": "^6.3.0",
|
||||
"oui-data": "^1.1.476",
|
||||
"parse-duration": "^2.1.5",
|
||||
"parse-torrent": "^11.0.19",
|
||||
"paseto-ts": "^2.0.5",
|
||||
"path2d-polyfill": "^3.1.3",
|
||||
"pdf-signature-reader": "^1.4.3",
|
||||
"pdfjs-dist": "^4.8.69",
|
||||
"pinia": "^2.0.34",
|
||||
"plausible-tracker": "^0.3.9",
|
||||
"port-numbers": "^8.0.22",
|
||||
"postal-mime": "^2.4.3",
|
||||
"podletjs": "^1.0.2",
|
||||
"port-numbers": "^8.0.28",
|
||||
"postal-mime": "^2.7.1",
|
||||
"potrace": "^2.1.8",
|
||||
"pp-qr-code": "^0.6.4",
|
||||
"pretty-ms": "^9.2.0",
|
||||
"pretty-ms": "^9.3.0",
|
||||
"properties": "^1.2.1",
|
||||
"punycode": "^2.3.1",
|
||||
"pythonstack.js": "^1.0.2",
|
||||
@@ -240,115 +290,132 @@
|
||||
"qrcode": "^1.5.4",
|
||||
"qrcode-parser": "^2.1.3",
|
||||
"qrcode-terminal-nooctal": "^0.12.1",
|
||||
"quicktype-core": "^23.1.3",
|
||||
"qrcode-vue3": "^1.7.1",
|
||||
"quicktype-core": "^23.2.6",
|
||||
"randexp": "^0.5.3",
|
||||
"regex": "^4.4.0",
|
||||
"regex": "^6.1.0",
|
||||
"rekcod": "^3.0.0",
|
||||
"resistor-data": "^1.1.1",
|
||||
"riimut": "^0.9.1",
|
||||
"roboto-base64": "^0.1.2",
|
||||
"rtf-stream-parser": "^3.8.0",
|
||||
"rtf-stream-parser": "^3.8.1",
|
||||
"safe-license-list": "^0.1.2",
|
||||
"sandybox": "^1.1.2",
|
||||
"sanitize-html": "^2.14.0",
|
||||
"shiki": "1.22.2",
|
||||
"silly-password-generator": "^1.0.28",
|
||||
"shamirs-secret-sharing": "^2.0.1",
|
||||
"shiki": "1.29.2",
|
||||
"silly-password-generator": "^1.0.29",
|
||||
"slashes": "^3.0.12",
|
||||
"spdx-satisfies": "^5.0.1",
|
||||
"sql-formatter": "^15.5.1",
|
||||
"smol-toml": "^1.6.0",
|
||||
"sms-segments-calculator": "^1.2.0",
|
||||
"spdx-satisfies": "^6.0.0",
|
||||
"sponge-case": "^2.0.3",
|
||||
"sql-formatter": "^15.6.6",
|
||||
"sshpk": "^1.18.0",
|
||||
"staveless-futhark": "^0.6.1",
|
||||
"stringify-object": "^5.0.0",
|
||||
"stringify-object": "^6.0.0",
|
||||
"svg2png-wasm": "^1.4.1",
|
||||
"svgo": "^3.3.2",
|
||||
"swagger-ui-dist": "^5.27.0",
|
||||
"swap-case": "^3.0.3",
|
||||
"tesseract.js": "^5.1.1",
|
||||
"text-encoding-utf-8": "^1.0.2",
|
||||
"tick-time": "^1.0.1",
|
||||
"tidy-url": "^1.18.3",
|
||||
"title-case": "^4.3.2",
|
||||
"to-double-quotes": "^4.0.0",
|
||||
"to-single-quotes": "^4.0.0",
|
||||
"turndown": "^7.2.0",
|
||||
"ua-parser-js": "^2.0.1",
|
||||
"ulid": "^2.3.0",
|
||||
"unicode-emoji-json": "^0.4.0",
|
||||
"turndown": "^7.2.2",
|
||||
"ua-parser-js": "^2.0.4",
|
||||
"ulid": "^3.0.2",
|
||||
"unicode-emoji-json": "^0.8.0",
|
||||
"unique-random": "^4.0.0",
|
||||
"unixcrypt-browser": "^2.0.4",
|
||||
"unpdf": "^1.4.0",
|
||||
"unplugin-auto-import": "^0.16.4",
|
||||
"utf8": "^3.0.0",
|
||||
"uuid": "^11.0.5",
|
||||
"vanilla-jsoneditor": "^0.23.8",
|
||||
"uuid": "^13.0.0",
|
||||
"vanilla-jsoneditor": "^3.11.0",
|
||||
"vue": "^3.3.4",
|
||||
"vue-color-wheel": "^0.1.1",
|
||||
"vue-i18n": "^9.14.3",
|
||||
"vue-i18n": "^11.1.9",
|
||||
"vue-loading-overlay": "^6.0",
|
||||
"vue-markdown-render": "^2.2.1",
|
||||
"vue-mathjax-next": "^0.0.6",
|
||||
"vue-router": "^4.1.6",
|
||||
"vue-shadow-dom": "^4.2.0",
|
||||
"vue-tsc": "^1.8.1",
|
||||
"vue3-flip-countdown": "^0.1.6",
|
||||
"vue3-fortune-wheel": "^2.0.5",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"vuex": "^4.1.0",
|
||||
"w-websocket-client": "^1.0.29",
|
||||
"webcrack": "^2.15.0",
|
||||
"webcrypto-liner-shim": "^1.4.8",
|
||||
"webp-converter-browser": "^1.0.4",
|
||||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
|
||||
"xml-formatter": "^3.6.4",
|
||||
"xml-formatter": "^3.6.6",
|
||||
"xml-js": "^1.6.11",
|
||||
"xpath": "^0.0.34",
|
||||
"xpath-to-css": "^1.2.0",
|
||||
"xslt-processor": "^3.3.1",
|
||||
"yaml": "^2.7.0"
|
||||
"xslt-processor": "^3.4.0",
|
||||
"yaml": "^2.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^0.41.0",
|
||||
"@iconify-json/mdi": "^1.1.50",
|
||||
"@intlify/unplugin-vue-i18n": "^0.13.0",
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@intlify/unplugin-vue-i18n": "^6.0.8",
|
||||
"@playwright/test": "^1.54.1",
|
||||
"@rushstack/eslint-patch": "^1.2.0",
|
||||
"@tsconfig/node18": "^18.2.0",
|
||||
"@types/arr-diff": "^4.0.3",
|
||||
"@types/bcryptjs": "^2.4.6",
|
||||
"@types/big.js": "^6.2.2",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/dompurify": "^3.2.0",
|
||||
"@types/emscripten": "^1.40.0",
|
||||
"@types/figlet": "^1.7.0",
|
||||
"@types/damerau-levenshtein": "^1.0.2",
|
||||
"@types/emscripten": "^1.40.1",
|
||||
"@types/har-format": "^1.2.16",
|
||||
"@types/hex-array": "^1.0.2",
|
||||
"@types/js-beautify": "^1.14.3",
|
||||
"@types/jsdom": "^21.1.7",
|
||||
"@types/jsonpath": "^0.2.4",
|
||||
"@types/libmime": "^5.0.3",
|
||||
"@types/lodash": "^4.14.192",
|
||||
"@types/lodash": "^4.17.20",
|
||||
"@types/lodash.defaultsdeep": "^4.6.9",
|
||||
"@types/lodash.flattendeep": "^4.4.9",
|
||||
"@types/lodash.last": "^3.0.9",
|
||||
"@types/lodash.mergewith": "^4.6.9",
|
||||
"@types/luxon": "^3.4.2",
|
||||
"@types/markdown-it": "^13.0.9",
|
||||
"@types/memorystream": "^0.3.4",
|
||||
"@types/mime-types": "^2.1.4",
|
||||
"@types/mime-types": "^3.0.1",
|
||||
"@types/morsee": "^1.0.2",
|
||||
"@types/nanoid-dictionary": "^4.2.3",
|
||||
"@types/netmask": "^2.0.5",
|
||||
"@types/node": "^18.19.75",
|
||||
"@types/node-forge": "^1.3.11",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/node-forge": "^1.3.14",
|
||||
"@types/potrace": "^2.1.5",
|
||||
"@types/punycode": "^2.1.4",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@types/sanitize-html": "^2.13.0",
|
||||
"@types/spdx-satisfies": "^0.1.2",
|
||||
"@types/spdx-satisfies": "^6.0.0",
|
||||
"@types/sshpk": "^1.17.4",
|
||||
"@types/stringify-object": "^4.0.5",
|
||||
"@types/text-encoding-utf-8": "^1.0.5",
|
||||
"@types/turndown": "^5.0.5",
|
||||
"@types/ua-parser-js": "^0.7.39",
|
||||
"@types/utf8": "^3.0.3",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@unocss/eslint-config": "^0.57.1",
|
||||
"@vitejs/plugin-vue": "^4.3.2",
|
||||
"@vitejs/plugin-vue": "^4.3.4",
|
||||
"@vitejs/plugin-vue-jsx": "^3.0.2",
|
||||
"@vue/compiler-sfc": "^3.2.47",
|
||||
"@vue/runtime-dom": "^3.3.4",
|
||||
"@vue/test-utils": "^2.3.2",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
"axios": "^1.12.2",
|
||||
"commander": "^14.0.1",
|
||||
"consola": "^3.0.2",
|
||||
"dotenv": "^17.2.3",
|
||||
"eslint": "^8.47.0",
|
||||
"hygen": "^6.2.11",
|
||||
"jsdom": "^22.0.0",
|
||||
@@ -360,19 +427,25 @@
|
||||
"unocss-preset-scrollbar": "^0.2.1",
|
||||
"unplugin-icons": "^0.17.0",
|
||||
"unplugin-vue-components": "^0.25.0",
|
||||
"unplugin-vue-markdown": "^29.1.0",
|
||||
"vite": "^4.4.9",
|
||||
"vite-plugin-node-polyfills": "^0.22.0",
|
||||
"vite-plugin-pwa": "^1.0.0",
|
||||
"vite-plugin-vue-markdown": "^0.23.5",
|
||||
"vite-plugin-node-polyfills": "^0.23.0",
|
||||
"vite-plugin-pwa": "^1.1.0",
|
||||
"vite-plugin-splash-screen": "^0.2.0",
|
||||
"vite-plugin-wasm": "^3.4.1",
|
||||
"vite-svg-loader": "^4.0.0",
|
||||
"vitest": "^0.34.6",
|
||||
"vue-i18n-extract": "^2.0.7",
|
||||
"workbox-window": "^7.3.0",
|
||||
"zx": "^7.2.3"
|
||||
"zx": "^7.2.4"
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"@vueuse/shared": "13.9.0",
|
||||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
|
||||
}
|
||||
},
|
||||
"scarfSettings": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
Generated
+15784
-11194
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,575 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
"use strict";
|
||||
|
||||
(() => {
|
||||
const enosys = () => {
|
||||
const err = new Error("not implemented");
|
||||
err.code = "ENOSYS";
|
||||
return err;
|
||||
};
|
||||
|
||||
if (!globalThis.fs) {
|
||||
let outputBuf = "";
|
||||
globalThis.fs = {
|
||||
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_DIRECTORY: -1 }, // unused
|
||||
writeSync(fd, buf) {
|
||||
outputBuf += decoder.decode(buf);
|
||||
const nl = outputBuf.lastIndexOf("\n");
|
||||
if (nl != -1) {
|
||||
console.log(outputBuf.substring(0, nl));
|
||||
outputBuf = outputBuf.substring(nl + 1);
|
||||
}
|
||||
return buf.length;
|
||||
},
|
||||
write(fd, buf, offset, length, position, callback) {
|
||||
if (offset !== 0 || length !== buf.length || position !== null) {
|
||||
callback(enosys());
|
||||
return;
|
||||
}
|
||||
const n = this.writeSync(fd, buf);
|
||||
callback(null, n);
|
||||
},
|
||||
chmod(path, mode, callback) { callback(enosys()); },
|
||||
chown(path, uid, gid, callback) { callback(enosys()); },
|
||||
close(fd, callback) { callback(enosys()); },
|
||||
fchmod(fd, mode, callback) { callback(enosys()); },
|
||||
fchown(fd, uid, gid, callback) { callback(enosys()); },
|
||||
fstat(fd, callback) { callback(enosys()); },
|
||||
fsync(fd, callback) { callback(null); },
|
||||
ftruncate(fd, length, callback) { callback(enosys()); },
|
||||
lchown(path, uid, gid, callback) { callback(enosys()); },
|
||||
link(path, link, callback) { callback(enosys()); },
|
||||
lstat(path, callback) { callback(enosys()); },
|
||||
mkdir(path, perm, callback) { callback(enosys()); },
|
||||
open(path, flags, mode, callback) { callback(enosys()); },
|
||||
read(fd, buffer, offset, length, position, callback) { callback(enosys()); },
|
||||
readdir(path, callback) { callback(enosys()); },
|
||||
readlink(path, callback) { callback(enosys()); },
|
||||
rename(from, to, callback) { callback(enosys()); },
|
||||
rmdir(path, callback) { callback(enosys()); },
|
||||
stat(path, callback) { callback(enosys()); },
|
||||
symlink(path, link, callback) { callback(enosys()); },
|
||||
truncate(path, length, callback) { callback(enosys()); },
|
||||
unlink(path, callback) { callback(enosys()); },
|
||||
utimes(path, atime, mtime, callback) { callback(enosys()); },
|
||||
};
|
||||
}
|
||||
|
||||
if (!globalThis.process) {
|
||||
globalThis.process = {
|
||||
getuid() { return -1; },
|
||||
getgid() { return -1; },
|
||||
geteuid() { return -1; },
|
||||
getegid() { return -1; },
|
||||
getgroups() { throw enosys(); },
|
||||
pid: -1,
|
||||
ppid: -1,
|
||||
umask() { throw enosys(); },
|
||||
cwd() { throw enosys(); },
|
||||
chdir() { throw enosys(); },
|
||||
}
|
||||
}
|
||||
|
||||
if (!globalThis.path) {
|
||||
globalThis.path = {
|
||||
resolve(...pathSegments) {
|
||||
return pathSegments.join("/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!globalThis.crypto) {
|
||||
throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");
|
||||
}
|
||||
|
||||
if (!globalThis.performance) {
|
||||
throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");
|
||||
}
|
||||
|
||||
if (!globalThis.TextEncoder) {
|
||||
throw new Error("globalThis.TextEncoder is not available, polyfill required");
|
||||
}
|
||||
|
||||
if (!globalThis.TextDecoder) {
|
||||
throw new Error("globalThis.TextDecoder is not available, polyfill required");
|
||||
}
|
||||
|
||||
const encoder = new TextEncoder("utf-8");
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
|
||||
globalThis.Go = class {
|
||||
constructor() {
|
||||
this.argv = ["js"];
|
||||
this.env = {};
|
||||
this.exit = (code) => {
|
||||
if (code !== 0) {
|
||||
console.warn("exit code:", code);
|
||||
}
|
||||
};
|
||||
this._exitPromise = new Promise((resolve) => {
|
||||
this._resolveExitPromise = resolve;
|
||||
});
|
||||
this._pendingEvent = null;
|
||||
this._scheduledTimeouts = new Map();
|
||||
this._nextCallbackTimeoutID = 1;
|
||||
|
||||
const setInt64 = (addr, v) => {
|
||||
this.mem.setUint32(addr + 0, v, true);
|
||||
this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);
|
||||
}
|
||||
|
||||
const setInt32 = (addr, v) => {
|
||||
this.mem.setUint32(addr + 0, v, true);
|
||||
}
|
||||
|
||||
const getInt64 = (addr) => {
|
||||
const low = this.mem.getUint32(addr + 0, true);
|
||||
const high = this.mem.getInt32(addr + 4, true);
|
||||
return low + high * 4294967296;
|
||||
}
|
||||
|
||||
const loadValue = (addr) => {
|
||||
const f = this.mem.getFloat64(addr, true);
|
||||
if (f === 0) {
|
||||
return undefined;
|
||||
}
|
||||
if (!isNaN(f)) {
|
||||
return f;
|
||||
}
|
||||
|
||||
const id = this.mem.getUint32(addr, true);
|
||||
return this._values[id];
|
||||
}
|
||||
|
||||
const storeValue = (addr, v) => {
|
||||
const nanHead = 0x7FF80000;
|
||||
|
||||
if (typeof v === "number" && v !== 0) {
|
||||
if (isNaN(v)) {
|
||||
this.mem.setUint32(addr + 4, nanHead, true);
|
||||
this.mem.setUint32(addr, 0, true);
|
||||
return;
|
||||
}
|
||||
this.mem.setFloat64(addr, v, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (v === undefined) {
|
||||
this.mem.setFloat64(addr, 0, true);
|
||||
return;
|
||||
}
|
||||
|
||||
let id = this._ids.get(v);
|
||||
if (id === undefined) {
|
||||
id = this._idPool.pop();
|
||||
if (id === undefined) {
|
||||
id = this._values.length;
|
||||
}
|
||||
this._values[id] = v;
|
||||
this._goRefCounts[id] = 0;
|
||||
this._ids.set(v, id);
|
||||
}
|
||||
this._goRefCounts[id]++;
|
||||
let typeFlag = 0;
|
||||
switch (typeof v) {
|
||||
case "object":
|
||||
if (v !== null) {
|
||||
typeFlag = 1;
|
||||
}
|
||||
break;
|
||||
case "string":
|
||||
typeFlag = 2;
|
||||
break;
|
||||
case "symbol":
|
||||
typeFlag = 3;
|
||||
break;
|
||||
case "function":
|
||||
typeFlag = 4;
|
||||
break;
|
||||
}
|
||||
this.mem.setUint32(addr + 4, nanHead | typeFlag, true);
|
||||
this.mem.setUint32(addr, id, true);
|
||||
}
|
||||
|
||||
const loadSlice = (addr) => {
|
||||
const array = getInt64(addr + 0);
|
||||
const len = getInt64(addr + 8);
|
||||
return new Uint8Array(this._inst.exports.mem.buffer, array, len);
|
||||
}
|
||||
|
||||
const loadSliceOfValues = (addr) => {
|
||||
const array = getInt64(addr + 0);
|
||||
const len = getInt64(addr + 8);
|
||||
const a = new Array(len);
|
||||
for (let i = 0; i < len; i++) {
|
||||
a[i] = loadValue(array + i * 8);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
const loadString = (addr) => {
|
||||
const saddr = getInt64(addr + 0);
|
||||
const len = getInt64(addr + 8);
|
||||
return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
|
||||
}
|
||||
|
||||
const testCallExport = (a, b) => {
|
||||
this._inst.exports.testExport0();
|
||||
return this._inst.exports.testExport(a, b);
|
||||
}
|
||||
|
||||
const timeOrigin = Date.now() - performance.now();
|
||||
this.importObject = {
|
||||
_gotest: {
|
||||
add: (a, b) => a + b,
|
||||
callExport: testCallExport,
|
||||
},
|
||||
gojs: {
|
||||
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
|
||||
// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
|
||||
// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
|
||||
// This changes the SP, thus we have to update the SP used by the imported function.
|
||||
|
||||
// func wasmExit(code int32)
|
||||
"runtime.wasmExit": (sp) => {
|
||||
sp >>>= 0;
|
||||
const code = this.mem.getInt32(sp + 8, true);
|
||||
this.exited = true;
|
||||
delete this._inst;
|
||||
delete this._values;
|
||||
delete this._goRefCounts;
|
||||
delete this._ids;
|
||||
delete this._idPool;
|
||||
this.exit(code);
|
||||
},
|
||||
|
||||
// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)
|
||||
"runtime.wasmWrite": (sp) => {
|
||||
sp >>>= 0;
|
||||
const fd = getInt64(sp + 8);
|
||||
const p = getInt64(sp + 16);
|
||||
const n = this.mem.getInt32(sp + 24, true);
|
||||
fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));
|
||||
},
|
||||
|
||||
// func resetMemoryDataView()
|
||||
"runtime.resetMemoryDataView": (sp) => {
|
||||
sp >>>= 0;
|
||||
this.mem = new DataView(this._inst.exports.mem.buffer);
|
||||
},
|
||||
|
||||
// func nanotime1() int64
|
||||
"runtime.nanotime1": (sp) => {
|
||||
sp >>>= 0;
|
||||
setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);
|
||||
},
|
||||
|
||||
// func walltime() (sec int64, nsec int32)
|
||||
"runtime.walltime": (sp) => {
|
||||
sp >>>= 0;
|
||||
const msec = (new Date).getTime();
|
||||
setInt64(sp + 8, msec / 1000);
|
||||
this.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);
|
||||
},
|
||||
|
||||
// func scheduleTimeoutEvent(delay int64) int32
|
||||
"runtime.scheduleTimeoutEvent": (sp) => {
|
||||
sp >>>= 0;
|
||||
const id = this._nextCallbackTimeoutID;
|
||||
this._nextCallbackTimeoutID++;
|
||||
this._scheduledTimeouts.set(id, setTimeout(
|
||||
() => {
|
||||
this._resume();
|
||||
while (this._scheduledTimeouts.has(id)) {
|
||||
// for some reason Go failed to register the timeout event, log and try again
|
||||
// (temporary workaround for https://github.com/golang/go/issues/28975)
|
||||
console.warn("scheduleTimeoutEvent: missed timeout event");
|
||||
this._resume();
|
||||
}
|
||||
},
|
||||
getInt64(sp + 8),
|
||||
));
|
||||
this.mem.setInt32(sp + 16, id, true);
|
||||
},
|
||||
|
||||
// func clearTimeoutEvent(id int32)
|
||||
"runtime.clearTimeoutEvent": (sp) => {
|
||||
sp >>>= 0;
|
||||
const id = this.mem.getInt32(sp + 8, true);
|
||||
clearTimeout(this._scheduledTimeouts.get(id));
|
||||
this._scheduledTimeouts.delete(id);
|
||||
},
|
||||
|
||||
// func getRandomData(r []byte)
|
||||
"runtime.getRandomData": (sp) => {
|
||||
sp >>>= 0;
|
||||
crypto.getRandomValues(loadSlice(sp + 8));
|
||||
},
|
||||
|
||||
// func finalizeRef(v ref)
|
||||
"syscall/js.finalizeRef": (sp) => {
|
||||
sp >>>= 0;
|
||||
const id = this.mem.getUint32(sp + 8, true);
|
||||
this._goRefCounts[id]--;
|
||||
if (this._goRefCounts[id] === 0) {
|
||||
const v = this._values[id];
|
||||
this._values[id] = null;
|
||||
this._ids.delete(v);
|
||||
this._idPool.push(id);
|
||||
}
|
||||
},
|
||||
|
||||
// func stringVal(value string) ref
|
||||
"syscall/js.stringVal": (sp) => {
|
||||
sp >>>= 0;
|
||||
storeValue(sp + 24, loadString(sp + 8));
|
||||
},
|
||||
|
||||
// func valueGet(v ref, p string) ref
|
||||
"syscall/js.valueGet": (sp) => {
|
||||
sp >>>= 0;
|
||||
const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 32, result);
|
||||
},
|
||||
|
||||
// func valueSet(v ref, p string, x ref)
|
||||
"syscall/js.valueSet": (sp) => {
|
||||
sp >>>= 0;
|
||||
Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));
|
||||
},
|
||||
|
||||
// func valueDelete(v ref, p string)
|
||||
"syscall/js.valueDelete": (sp) => {
|
||||
sp >>>= 0;
|
||||
Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));
|
||||
},
|
||||
|
||||
// func valueIndex(v ref, i int) ref
|
||||
"syscall/js.valueIndex": (sp) => {
|
||||
sp >>>= 0;
|
||||
storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));
|
||||
},
|
||||
|
||||
// valueSetIndex(v ref, i int, x ref)
|
||||
"syscall/js.valueSetIndex": (sp) => {
|
||||
sp >>>= 0;
|
||||
Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));
|
||||
},
|
||||
|
||||
// func valueCall(v ref, m string, args []ref) (ref, bool)
|
||||
"syscall/js.valueCall": (sp) => {
|
||||
sp >>>= 0;
|
||||
try {
|
||||
const v = loadValue(sp + 8);
|
||||
const m = Reflect.get(v, loadString(sp + 16));
|
||||
const args = loadSliceOfValues(sp + 32);
|
||||
const result = Reflect.apply(m, v, args);
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 56, result);
|
||||
this.mem.setUint8(sp + 64, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 56, err);
|
||||
this.mem.setUint8(sp + 64, 0);
|
||||
}
|
||||
},
|
||||
|
||||
// func valueInvoke(v ref, args []ref) (ref, bool)
|
||||
"syscall/js.valueInvoke": (sp) => {
|
||||
sp >>>= 0;
|
||||
try {
|
||||
const v = loadValue(sp + 8);
|
||||
const args = loadSliceOfValues(sp + 16);
|
||||
const result = Reflect.apply(v, undefined, args);
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, result);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, err);
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
}
|
||||
},
|
||||
|
||||
// func valueNew(v ref, args []ref) (ref, bool)
|
||||
"syscall/js.valueNew": (sp) => {
|
||||
sp >>>= 0;
|
||||
try {
|
||||
const v = loadValue(sp + 8);
|
||||
const args = loadSliceOfValues(sp + 16);
|
||||
const result = Reflect.construct(v, args);
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, result);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, err);
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
}
|
||||
},
|
||||
|
||||
// func valueLength(v ref) int
|
||||
"syscall/js.valueLength": (sp) => {
|
||||
sp >>>= 0;
|
||||
setInt64(sp + 16, parseInt(loadValue(sp + 8).length));
|
||||
},
|
||||
|
||||
// valuePrepareString(v ref) (ref, int)
|
||||
"syscall/js.valuePrepareString": (sp) => {
|
||||
sp >>>= 0;
|
||||
const str = encoder.encode(String(loadValue(sp + 8)));
|
||||
storeValue(sp + 16, str);
|
||||
setInt64(sp + 24, str.length);
|
||||
},
|
||||
|
||||
// valueLoadString(v ref, b []byte)
|
||||
"syscall/js.valueLoadString": (sp) => {
|
||||
sp >>>= 0;
|
||||
const str = loadValue(sp + 8);
|
||||
loadSlice(sp + 16).set(str);
|
||||
},
|
||||
|
||||
// func valueInstanceOf(v ref, t ref) bool
|
||||
"syscall/js.valueInstanceOf": (sp) => {
|
||||
sp >>>= 0;
|
||||
this.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);
|
||||
},
|
||||
|
||||
// func copyBytesToGo(dst []byte, src ref) (int, bool)
|
||||
"syscall/js.copyBytesToGo": (sp) => {
|
||||
sp >>>= 0;
|
||||
const dst = loadSlice(sp + 8);
|
||||
const src = loadValue(sp + 32);
|
||||
if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
return;
|
||||
}
|
||||
const toCopy = src.subarray(0, dst.length);
|
||||
dst.set(toCopy);
|
||||
setInt64(sp + 40, toCopy.length);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
},
|
||||
|
||||
// func copyBytesToJS(dst ref, src []byte) (int, bool)
|
||||
"syscall/js.copyBytesToJS": (sp) => {
|
||||
sp >>>= 0;
|
||||
const dst = loadValue(sp + 8);
|
||||
const src = loadSlice(sp + 16);
|
||||
if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
return;
|
||||
}
|
||||
const toCopy = src.subarray(0, dst.length);
|
||||
dst.set(toCopy);
|
||||
setInt64(sp + 40, toCopy.length);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
},
|
||||
|
||||
"debug": (value) => {
|
||||
console.log(value);
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async run(instance) {
|
||||
if (!(instance instanceof WebAssembly.Instance)) {
|
||||
throw new Error("Go.run: WebAssembly.Instance expected");
|
||||
}
|
||||
this._inst = instance;
|
||||
this.mem = new DataView(this._inst.exports.mem.buffer);
|
||||
this._values = [ // JS values that Go currently has references to, indexed by reference id
|
||||
NaN,
|
||||
0,
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
globalThis,
|
||||
this,
|
||||
];
|
||||
this._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id
|
||||
this._ids = new Map([ // mapping from JS values to reference ids
|
||||
[0, 1],
|
||||
[null, 2],
|
||||
[true, 3],
|
||||
[false, 4],
|
||||
[globalThis, 5],
|
||||
[this, 6],
|
||||
]);
|
||||
this._idPool = []; // unused ids that have been garbage collected
|
||||
this.exited = false; // whether the Go program has exited
|
||||
|
||||
// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.
|
||||
let offset = 4096;
|
||||
|
||||
const strPtr = (str) => {
|
||||
const ptr = offset;
|
||||
const bytes = encoder.encode(str + "\0");
|
||||
new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
|
||||
offset += bytes.length;
|
||||
if (offset % 8 !== 0) {
|
||||
offset += 8 - (offset % 8);
|
||||
}
|
||||
return ptr;
|
||||
};
|
||||
|
||||
const argc = this.argv.length;
|
||||
|
||||
const argvPtrs = [];
|
||||
this.argv.forEach((arg) => {
|
||||
argvPtrs.push(strPtr(arg));
|
||||
});
|
||||
argvPtrs.push(0);
|
||||
|
||||
const keys = Object.keys(this.env).sort();
|
||||
keys.forEach((key) => {
|
||||
argvPtrs.push(strPtr(`${key}=${this.env[key]}`));
|
||||
});
|
||||
argvPtrs.push(0);
|
||||
|
||||
const argv = offset;
|
||||
argvPtrs.forEach((ptr) => {
|
||||
this.mem.setUint32(offset, ptr, true);
|
||||
this.mem.setUint32(offset + 4, 0, true);
|
||||
offset += 8;
|
||||
});
|
||||
|
||||
// The linker guarantees global data starts from at least wasmMinDataAddr.
|
||||
// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
|
||||
const wasmMinDataAddr = 4096 + 8192;
|
||||
if (offset >= wasmMinDataAddr) {
|
||||
throw new Error("total length of command line and environment variables exceeds limit");
|
||||
}
|
||||
|
||||
this._inst.exports.run(argc, argv);
|
||||
if (this.exited) {
|
||||
this._resolveExitPromise();
|
||||
}
|
||||
await this._exitPromise;
|
||||
}
|
||||
|
||||
_resume() {
|
||||
if (this.exited) {
|
||||
throw new Error("Go program has already exited");
|
||||
}
|
||||
this._inst.exports.resume();
|
||||
if (this.exited) {
|
||||
this._resolveExitPromise();
|
||||
}
|
||||
}
|
||||
|
||||
_makeFuncWrapper(id) {
|
||||
const go = this;
|
||||
return function () {
|
||||
const event = { id: id, this: this, args: arguments };
|
||||
go._pendingEvent = event;
|
||||
go._resume();
|
||||
return event.result;
|
||||
};
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
Binary file not shown.
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* TEAM */
|
||||
Developer: Corentin Thomasset
|
||||
Site: https://github.com/sharevb
|
||||
Twitter: @cthmsst
|
||||
Twitter: @sharevb
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="100%" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
|
||||
<path fill="#18A058" opacity="1.000000" stroke="none" d="
|
||||
M285.000000,513.000000
|
||||
C266.979095,513.000000 248.958206,513.000000 230.615494,512.644287
|
||||
C229.968979,511.921387 229.716232,511.382812 229.309113,511.211853
|
||||
C218.396698,506.628937 213.003540,498.729675 212.999954,487.251953
|
||||
C212.998291,481.919189 213.069885,476.585052 212.971207,471.254089
|
||||
C212.900787,467.449951 212.103973,464.263245 207.588333,462.976166
|
||||
C197.812027,460.189667 188.161697,456.964111 178.432053,454.009644
|
||||
C174.416306,452.790222 174.210861,451.195892 177.154800,448.277527
|
||||
C193.368622,432.204376 209.452194,415.999878 225.643829,399.904205
|
||||
C228.649826,396.916077 231.776611,394.111877 236.750610,395.911224
|
||||
C239.017761,396.731354 241.623001,397.033478 244.047836,396.930908
|
||||
C256.271179,396.413727 268.584656,396.448700 280.683228,394.878082
|
||||
C308.709534,391.239777 332.460785,378.020538 353.019287,359.258087
|
||||
C368.025909,345.562500 379.164703,328.894348 387.080200,310.008087
|
||||
C397.514709,285.111481 400.190918,259.095978 395.580444,233.039902
|
||||
C388.452637,192.756897 367.372803,160.549133 332.674225,138.356888
|
||||
C306.592529,121.675720 277.948334,114.135246 246.629364,116.773010
|
||||
C233.331314,117.893005 220.561539,120.401459 208.240204,125.109039
|
||||
C174.324066,138.067276 148.734146,160.636047 132.096924,192.952316
|
||||
C124.606049,207.502655 119.021263,222.883041 118.082573,239.389465
|
||||
C117.436966,250.742188 118.060280,262.162384 117.890938,273.549103
|
||||
C117.818344,278.430389 120.050224,283.121490 114.951683,287.920319
|
||||
C98.213287,303.674896 82.262794,320.266083 65.978798,336.504974
|
||||
C64.893883,337.586884 63.552643,338.411804 61.379997,340.090973
|
||||
C57.091328,326.843109 53.126518,314.595673 48.724842,300.998749
|
||||
C40.811443,300.998749 32.375408,301.257568 23.963419,300.918945
|
||||
C16.905138,300.634827 11.062209,297.534576 6.861771,291.627380
|
||||
C5.004858,289.015961 2.959697,286.538361 1.000002,284.000000
|
||||
C1.000000,266.312439 1.000000,248.624878 1.351752,230.620483
|
||||
C2.110438,229.819885 2.644665,229.396179 2.905443,228.843460
|
||||
C7.729964,218.617569 14.869195,212.362228 27.081358,212.855576
|
||||
C34.470955,213.154099 41.917923,212.032501 49.503120,211.538284
|
||||
C49.930244,210.460617 50.472652,209.275940 50.876099,208.045715
|
||||
C54.957413,195.600723 58.443336,182.920807 63.269257,170.772751
|
||||
C66.875496,161.694946 72.310219,153.353683 76.643616,144.543213
|
||||
C77.268799,143.272110 76.875984,140.710388 75.940704,139.598450
|
||||
C71.893585,134.786926 67.613625,130.147751 63.154736,125.710793
|
||||
C52.409088,115.017990 53.175587,99.068611 63.065083,88.529762
|
||||
C71.609055,79.424789 80.590767,70.722450 89.546265,62.014179
|
||||
C97.946587,53.845749 111.478111,52.299988 120.879387,59.132851
|
||||
C127.269226,63.776997 132.789154,69.641991 138.549271,75.117599
|
||||
C141.096039,77.538582 143.340576,78.395378 146.041687,75.498436
|
||||
C146.691711,74.801285 147.627441,74.343666 148.483658,73.869568
|
||||
C167.675156,63.242867 187.640701,54.595615 209.176758,49.855827
|
||||
C210.299286,49.608776 211.774704,47.775528 211.871597,46.582169
|
||||
C212.446533,39.500645 212.726669,32.392342 212.984604,25.288631
|
||||
C213.331390,15.737711 217.675217,8.711089 225.940353,3.966579
|
||||
C227.134415,3.281146 227.988556,2.003553 229.000000,0.999998
|
||||
C247.687561,1.000000 266.375122,1.000000 285.359344,1.336950
|
||||
C286.272583,2.180966 286.854462,2.738805 287.510956,3.187436
|
||||
C296.266235,9.170486 302.408325,16.622066 302.020691,28.003832
|
||||
C301.833649,33.495098 302.148804,39.003735 301.951874,44.494297
|
||||
C301.831512,47.849655 302.857178,49.239353 306.377594,50.148369
|
||||
C327.956940,55.720463 348.893555,62.973309 367.444214,75.796150
|
||||
C370.798370,78.114670 373.444916,77.062447 375.978302,74.521271
|
||||
C379.859924,70.627731 383.743927,66.736534 387.640076,62.857548
|
||||
C398.375732,52.169086 414.620026,52.131424 425.267944,62.769962
|
||||
C434.172485,71.666710 443.086761,80.553810 451.964233,89.477501
|
||||
C459.245544,96.796661 461.926941,109.059235 456.393982,117.669823
|
||||
C451.364594,125.496826 444.546387,132.213898 438.206146,139.135773
|
||||
C436.225037,141.298630 436.083069,142.749924 437.540405,145.062164
|
||||
C439.908752,148.819778 442.059357,152.717621 444.228027,156.597549
|
||||
C453.361237,172.937195 459.384766,190.456528 464.092468,208.502213
|
||||
C464.453613,209.886566 466.388580,211.706345 467.741180,211.842621
|
||||
C474.318298,212.505280 480.963654,213.134338 487.552246,212.891495
|
||||
C497.872620,212.511093 504.715637,217.453522 509.969666,225.663666
|
||||
C510.616699,226.674789 511.972595,227.232300 513.000000,228.000000
|
||||
C513.000000,246.687561 513.000000,265.375122 512.662354,284.359100
|
||||
C511.733185,285.415466 511.016571,286.108582 510.569366,286.945587
|
||||
C505.407562,296.606781 497.500641,301.249237 486.426849,301.091187
|
||||
C479.178955,300.987701 471.918579,301.757996 464.467834,302.147156
|
||||
C459.001740,326.397308 450.286987,349.124634 436.827209,369.930664
|
||||
C436.250122,370.822754 437.111023,373.336243 438.068176,374.414185
|
||||
C443.129181,380.114044 448.515259,385.523651 453.638641,391.169983
|
||||
C461.341797,399.659515 460.459839,415.641815 452.969604,423.440735
|
||||
C444.318268,432.448608 435.314056,441.116486 426.531677,449.999786
|
||||
C413.941711,462.734406 397.257568,460.938751 386.910645,449.494751
|
||||
C383.240326,445.435242 379.091583,441.804901 375.117126,438.025024
|
||||
C372.746674,435.770630 370.486420,435.932892 367.662201,437.755432
|
||||
C355.187897,445.805359 341.869110,452.212799 327.777374,456.885681
|
||||
C319.284332,459.701996 310.640045,462.062256 301.998688,464.646912
|
||||
C301.998688,471.018707 302.134674,477.013062 301.970062,482.999146
|
||||
C301.639496,495.017059 298.419830,505.484009 286.312378,510.981781
|
||||
C285.696442,511.261444 285.429443,512.309631 285.000000,513.000000
|
||||
z"/>
|
||||
<path fill="#1E1E1E" opacity="1.000000" stroke="none" d="
|
||||
M1.000004,456.468628
|
||||
C1.822166,454.797089 2.628374,453.582886 3.469247,452.393158
|
||||
C6.999179,447.398895 9.930220,441.810699 14.169559,437.514587
|
||||
C60.265923,390.800812 106.535835,344.257965 152.881363,297.791077
|
||||
C156.198288,294.465485 156.603577,291.568451 155.325211,287.178467
|
||||
C141.467667,239.591599 161.330902,188.747421 204.424301,164.305359
|
||||
C220.242783,155.333313 237.368484,150.577866 255.422409,150.416046
|
||||
C264.268372,150.336792 273.314178,151.927124 281.942780,154.074677
|
||||
C290.435120,156.188293 293.762177,166.385971 289.236664,173.953033
|
||||
C287.802948,176.350311 285.872772,178.503738 283.921600,180.529770
|
||||
C272.487274,192.402817 260.909668,204.138321 249.516190,216.050156
|
||||
C238.393982,227.678391 238.816269,247.758820 249.284225,259.941101
|
||||
C264.351624,277.476074 288.225739,275.449402 301.992401,260.722168
|
||||
C312.778595,249.183380 324.529144,238.540146 335.951752,227.604050
|
||||
C345.195679,218.753845 358.541260,222.312363 361.014587,234.815887
|
||||
C365.302612,256.493622 363.763580,277.758209 354.910248,298.393768
|
||||
C345.507751,320.309265 330.715363,337.234406 310.032440,348.956696
|
||||
C283.600494,363.937286 255.641647,366.796692 226.573334,358.503540
|
||||
C222.005630,357.200348 219.181458,358.174500 216.019226,361.360992
|
||||
C184.680542,392.939728 153.300262,424.477997 121.775734,455.871094
|
||||
C106.087929,471.493469 90.260460,486.987579 74.092552,502.108154
|
||||
C69.576103,506.332062 63.622486,509.019257 58.164070,512.705688
|
||||
C49.645767,513.000000 41.291534,513.000000 32.304932,512.705200
|
||||
C30.146564,511.452087 28.703566,510.314148 27.081211,509.564240
|
||||
C15.867707,504.380951 8.051239,496.012604 3.304708,484.657959
|
||||
C2.756540,483.346649 1.778662,482.214966 1.000009,481.000000
|
||||
C1.000000,472.979095 1.000000,464.958191 1.000004,456.468628
|
||||
z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{}
|
||||
File diff suppressed because it is too large.
Load diff
Vendored
+4233
File diff suppressed because it is too large.
Load diff
+79
-2
@@ -1,6 +1,83 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"configMigration": true,
|
||||
"branchConcurrentLimit": 5,
|
||||
"prHourlyLimit": 25,
|
||||
"recreateWhen": "never",
|
||||
"prCreation": "immediate",
|
||||
"extends": [
|
||||
"config:base"
|
||||
"config:recommended",
|
||||
"docker:pinDigests",
|
||||
"helpers:pinGitHubActionDigests",
|
||||
":pinDevDependencies"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"groupName": "TypeScript toolchain",
|
||||
"matchPackageNames": ["typescript", "vue-tsc"],
|
||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"groupName": "Vue ecosystem",
|
||||
"matchPackageNames": [
|
||||
"vue",
|
||||
"@vue/compiler-sfc",
|
||||
"@vue/runtime-dom",
|
||||
"@vue/test-utils",
|
||||
"@vue/tsconfig"
|
||||
],
|
||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"groupName": "Vite ecosystem",
|
||||
"matchPackageNames": [
|
||||
"vite",
|
||||
"@vitejs/plugin-vue",
|
||||
"@vitejs/plugin-vue-jsx",
|
||||
"vite-plugin-pwa",
|
||||
"vite-plugin-vue-markdown",
|
||||
"vite-svg-loader"
|
||||
],
|
||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"groupName": "UnoCSS ecosystem",
|
||||
"matchPackageNames": [
|
||||
"unocss",
|
||||
"@unocss/eslint-config",
|
||||
"unocss-preset-scrollbar"
|
||||
],
|
||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"groupName": "Unplugin ecosystem",
|
||||
"matchPackageNames": [
|
||||
"unplugin-auto-import",
|
||||
"unplugin-icons",
|
||||
"unplugin-vue-components"
|
||||
],
|
||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"groupName": "Vicons",
|
||||
"matchPackageNames": ["@vicons/material", "@vicons/tabler"],
|
||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"groupName": "VueUse",
|
||||
"matchPackageNames": ["@vueuse/core", "@vueuse/head", "@vueuse/router"],
|
||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"groupName": "uuid with types",
|
||||
"matchPackageNames": ["uuid", "@types/uuid"],
|
||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"groupName": "Type packages with their dependencies",
|
||||
"matchDepTypes": ["devDependencies"],
|
||||
"groupSlug": "types",
|
||||
"automerge": true,
|
||||
"matchPackageNames": ["/^@types//", "!@types/uuid"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import yaml from 'yaml';
|
||||
|
||||
const toolsDir = 'src/tools';
|
||||
const localesFile = 'locales/en.yml';
|
||||
|
||||
// Load existing locales file or initialize an empty object
|
||||
let localesData = {};
|
||||
if (fs.existsSync(localesFile)) {
|
||||
localesData = yaml.parse(fs.readFileSync(localesFile, 'utf-8')) || {};
|
||||
}
|
||||
|
||||
function processFile(filePath) {
|
||||
const parentDir = path.basename(path.dirname(filePath)); // Get parent directory name
|
||||
const originalContent = fs.readFileSync(filePath, 'utf-8');
|
||||
|
||||
// Extract existing name and description values
|
||||
const nameMatch = originalContent.match(/name: '(.*?)'/);
|
||||
const descriptionMatch = originalContent.match(/description: '(.*?)'/);
|
||||
|
||||
if (!nameMatch || !descriptionMatch) {
|
||||
console.warn(`Skipping ${filePath}: Unable to extract name or description.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const nameValue = nameMatch[1];
|
||||
const descriptionValue = descriptionMatch[1];
|
||||
|
||||
// Modify name and description to use the translate function
|
||||
const transformedContent = originalContent
|
||||
.replace(/name: '((?:[^']+|(?<=\\)')+)'/, `name: t('tools.${parentDir}.title')`)
|
||||
.replace(/description: '((?:[^']+|(?<=\\)')+)'/, `description: t('tools.${parentDir}.description')`);
|
||||
|
||||
fs.writeFileSync(filePath, `import { translate as t } from '@/plugins/i18n.plugin';\n${transformedContent}`, 'utf-8');
|
||||
console.log(`Transformed: ${filePath}`);
|
||||
|
||||
// Update locales file with extracted name and description
|
||||
if (!localesData.tools) {
|
||||
localesData.tools = {};
|
||||
}
|
||||
localesData.tools[parentDir] = {
|
||||
...localesData.tools[parentDir],
|
||||
title: nameValue,
|
||||
description: descriptionValue,
|
||||
};
|
||||
}
|
||||
|
||||
function iterateFolder(folderPath) {
|
||||
const items = fs.readdirSync(folderPath);
|
||||
|
||||
items.forEach((item) => {
|
||||
const itemPath = path.join(folderPath, item);
|
||||
const stat = fs.statSync(itemPath);
|
||||
|
||||
if (stat.isDirectory()) {
|
||||
iterateFolder(itemPath);
|
||||
}
|
||||
else if (item === 'index.ts') {
|
||||
processFile(itemPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Run transformations
|
||||
iterateFolder(toolsDir);
|
||||
|
||||
// Write back the updated locales file
|
||||
fs.writeFileSync(localesFile, yaml.stringify(localesData), 'utf-8');
|
||||
console.log('Locales file updated!');
|
||||
console.log('Transformation completed!');
|
||||
@@ -0,0 +1,149 @@
|
||||
import fs from 'node:fs';
|
||||
import path, { basename } from 'node:path';
|
||||
import process from 'node:process';
|
||||
import yaml from 'yaml';
|
||||
|
||||
const toolsDir = 'src/tools';
|
||||
const localesFile = 'locales/en.yml';
|
||||
|
||||
// Load existing locales file or initialize an empty object
|
||||
let localesData = {};
|
||||
if (fs.existsSync(localesFile)) {
|
||||
localesData = yaml.parse(fs.readFileSync(localesFile, 'utf-8')) || {};
|
||||
}
|
||||
|
||||
// Function to process Vue components in a directory
|
||||
function processVueComponents(toolDir, toolName) {
|
||||
fs.readdirSync(toolDir)
|
||||
.filter(file => file.endsWith('.vue'))
|
||||
.forEach(file => processVueComponent(path.join(toolDir, file), toolName));
|
||||
}
|
||||
|
||||
// Function to process a Vue component file
|
||||
function processVueComponent(filePath, toolName) {
|
||||
console.log(`Processing ${filePath} in ${toolName}`);
|
||||
|
||||
let content = fs.readFileSync(filePath, 'utf8');
|
||||
const origContent = content;
|
||||
|
||||
// Update locales file with extracted name and description
|
||||
if (!localesData.tools) {
|
||||
localesData.tools = {};
|
||||
}
|
||||
if (!localesData.tools[toolName]) {
|
||||
localesData.tools[toolName] = {};
|
||||
}
|
||||
|
||||
// Regex to find label or placeholder attributes
|
||||
let regex = /\b(label|text|message):\s*'((?:[^']|\\')+)'/g;
|
||||
content = content.replace(regex, (match, attr, text) => {
|
||||
if (!text?.trim()) {
|
||||
return match;
|
||||
}
|
||||
const key = (attr + '-' + text.replace(/[\p{P}\p{S}\s]+/gu, '-').replace(/^-+|-+$/g, '').replace(/-+/g, '-')).toLowerCase();
|
||||
if (!localesData.tools[toolName].texts) {
|
||||
localesData.tools[toolName].texts = {};
|
||||
}
|
||||
localesData.tools[toolName].texts[key] = text;
|
||||
return `${attr}: t('tools.${toolName}.texts.${key}')`;
|
||||
});
|
||||
|
||||
if (content.includes("/* NO EXTRACT SCRIPT */")) {
|
||||
console.log(`Marked to not extract: ${filePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const hasAlreayI18n = filePath.endsWith('.vue')
|
||||
? /const\s+\{.*?\bt\b.*?\}\s+=\s+useI18n\(.*?\)/s.test(content)
|
||||
: /import\s+\{.*?\btranslate\b.*?\}\s+from\s+(['"])@\/plugins\/i18n\.plugin\1/s.test(content);
|
||||
if (hasAlreayI18n) {
|
||||
console.log(`Already extracted: ${filePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (filePath.endsWith('.vue')) {
|
||||
// Regex to find label or placeholder attributes
|
||||
regex = /(?<!:)((?:[a-z]+-)?(?:label|placeholder|title|download-button-text))="([^"]+)"/g;
|
||||
content = content.replace(regex, (match, attr, text) => {
|
||||
if (!text?.trim()) {
|
||||
return match;
|
||||
}
|
||||
const key = (attr + '-' + text.replace(/[\p{P}\p{S}\s]+/gu, '-').replace(/^-+|-+$/g, '').replace(/-+/g, '-')).toLowerCase();
|
||||
if (!localesData.tools[toolName].texts) {
|
||||
localesData.tools[toolName].texts = {};
|
||||
}
|
||||
localesData.tools[toolName].texts[key] = text;
|
||||
return `:${attr}="t('tools.${toolName}.texts.${key}')"`;
|
||||
});
|
||||
|
||||
// Regex to find text inside HTML tags
|
||||
const textInsideTagsRegex = /(?<!=)\>(?:\n\s*)?([^\<\>\n]+)(?:\n\s*)?\</g;
|
||||
content = content.replace(textInsideTagsRegex, (match, text) => {
|
||||
if (!text?.trim()) {
|
||||
return match;
|
||||
}
|
||||
if (text.match(/[\}\{\|\[\<\>\]]/)) {
|
||||
return match;
|
||||
}
|
||||
const key = ('tag-' + text.trim().replace(/[\p{P}\p{S}\s]+/gu, '-').replace(/^-+|-+$/g, '').replace(/-+/g, '-')).toLowerCase();
|
||||
if (!localesData.tools[toolName].texts) {
|
||||
localesData.tools[toolName].texts = {};
|
||||
}
|
||||
localesData.tools[toolName].texts[key] = text.trim();
|
||||
return `>{{ t('tools.${toolName}.texts.${key}') }}<`;
|
||||
});
|
||||
}
|
||||
|
||||
if (origContent === content) {
|
||||
console.log(`Nothing to extract in ${filePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (filePath.endsWith('.vue')) {
|
||||
// Ensure the useI18n import exists
|
||||
if (!hasAlreayI18n) {
|
||||
content = content.replace(/\<script setup( lang="ts")?\>/, "<script setup lang=\"ts\">\nimport { useI18n } from 'vue-i18n';\nconst { t } = useI18n();");
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Ensure the useI18n import exists
|
||||
if (!hasAlreayI18n) {
|
||||
content = 'import { translate as t } from "@/plugins/i18n.plugin";\n' + content;
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(filePath, content, 'utf8');
|
||||
console.log(`Processed: ${filePath}`);
|
||||
}
|
||||
|
||||
const localFileOrDir = process.argv[2];
|
||||
if (localFileOrDir) {
|
||||
if (fs.statSync(localFileOrDir).isDirectory()) {
|
||||
fs.readdirSync(localFileOrDir)
|
||||
.filter((fileName) => {
|
||||
const filePath = path.join(localFileOrDir, fileName);
|
||||
return fs.statSync(filePath).isFile();
|
||||
})
|
||||
.forEach((fileName) => {
|
||||
const filePath = path.join(localFileOrDir, fileName);
|
||||
processVueComponent(filePath, process.argv[3] || basename(localFileOrDir));
|
||||
});
|
||||
} else {
|
||||
processVueComponent(localFileOrDir, process.argv[3] || basename(localFileOrDir));
|
||||
}
|
||||
} else {
|
||||
fs.readdirSync(toolsDir)
|
||||
.filter((toolName) => {
|
||||
const toolPath = path.join(toolsDir, toolName);
|
||||
return fs.statSync(toolPath).isDirectory();
|
||||
})
|
||||
.forEach((toolName) => {
|
||||
const toolPath = path.join(toolsDir, toolName);
|
||||
console.log(`Processing tool: ${toolName}`);
|
||||
processVueComponents(toolPath, toolName);
|
||||
});
|
||||
}
|
||||
|
||||
// Write back the updated locales file
|
||||
fs.writeFileSync(localesFile, yaml.stringify(localesData), 'utf-8');
|
||||
console.log('Locales file updated!');
|
||||
console.log('Transformation completed!');
|
||||
+1
-2
@@ -8,10 +8,9 @@ $.verbose = false;
|
||||
const isDryRun = argv['dry-run'] ?? false;
|
||||
|
||||
const now = new Date();
|
||||
const currentShortSha = (await $`git rev-parse --short HEAD`).stdout.trim();
|
||||
|
||||
const calver = now.toISOString().slice(0, 10).replace(/-/g, '.');
|
||||
const version = `${calver}-${currentShortSha}`;
|
||||
const version = `${calver}`;
|
||||
|
||||
const { stdout: rawCommits } = await $`git log --pretty=oneline $(git describe --tags --abbrev=0)..HEAD`;
|
||||
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
import { promises as fs } from "fs";
|
||||
import path from 'node:path';
|
||||
import yaml from 'yaml';
|
||||
import dotenv from 'dotenv';
|
||||
import axios from 'axios';
|
||||
import { Command } from 'commander';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const program = new Command();
|
||||
const GOOGLE_TRANSLATE_API_KEY = process.env.GOOGLE_TRANSLATE_API_KEY;
|
||||
const TRANSLATE_ENDPOINT = 'https://translation.googleapis.com/language/translate/v2';
|
||||
|
||||
if (!GOOGLE_TRANSLATE_API_KEY) {
|
||||
console.error('❌ Missing GOOGLE_TRANSLATE_API_KEY environment variable');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
program
|
||||
.name('translate-yaml')
|
||||
.description('Sync and translate YAML files using Google Translate')
|
||||
.requiredOption('-e, --english <file>', 'English YAML file')
|
||||
.requiredOption('-t, --targets <files...>', 'Target language YAML files')
|
||||
.option('--dry-run', 'Count characters to translate without sending API requests')
|
||||
.parse(process.argv);
|
||||
|
||||
const options = program.opts();
|
||||
|
||||
function removeUnusedKeys(targetFlat, englishFlat) {
|
||||
const cleaned = {};
|
||||
for (const key of Object.keys(targetFlat)) {
|
||||
if (englishFlat[key] !== undefined) {
|
||||
cleaned[key] = targetFlat[key];
|
||||
} else {
|
||||
console.log(`Removed unused key: ${key}`);
|
||||
}
|
||||
}
|
||||
return cleaned;
|
||||
}
|
||||
|
||||
async function translateText(text, targetLang) {
|
||||
const response = await axios.post(TRANSLATE_ENDPOINT, null, {
|
||||
params: {
|
||||
q: text,
|
||||
target: targetLang,
|
||||
key: GOOGLE_TRANSLATE_API_KEY,
|
||||
format: 'text',
|
||||
},
|
||||
});
|
||||
return response.data.data.translations[0].translatedText
|
||||
.replace(/\{'/, '{\'').replace(/'\}/, '}\'');
|
||||
}
|
||||
|
||||
function flattenYaml(obj, prefix = '') {
|
||||
const result = {};
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
const fullKey = prefix ? `${prefix}.${key}` : key;
|
||||
if (typeof value === 'object' && value !== null) {
|
||||
Object.assign(result, flattenYaml(value, fullKey));
|
||||
} else {
|
||||
result[fullKey] = String(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function unflattenYaml(flat) {
|
||||
const result = {};
|
||||
for (const [key, value] of Object.entries(flat)) {
|
||||
const keys = key.split('.');
|
||||
let current = result;
|
||||
keys.forEach((k, i) => {
|
||||
if (i === keys.length - 1) {
|
||||
current[k] = value;
|
||||
} else {
|
||||
current[k] = current[k] || {};
|
||||
current = current[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async function syncTranslations(englishFile, targetFiles, dryRun = false) {
|
||||
const englishYaml = yaml.parse(await fs.readFile(englishFile, 'utf8'));
|
||||
const englishFlat = flattenYaml(englishYaml);
|
||||
await fs.writeFile(englishFile, yaml.stringify(unflattenYaml(englishFlat)), 'utf8');
|
||||
|
||||
let totalChars = 0;
|
||||
|
||||
for (const file of targetFiles) {
|
||||
const langCode = path.basename(file, '.yml');
|
||||
if (langCode === 'en') {
|
||||
continue;
|
||||
}
|
||||
const targetYaml = yaml.parse(await fs.readFile(file, 'utf8')) || {};
|
||||
const targetFlat = removeUnusedKeys(flattenYaml(targetYaml), englishFlat);
|
||||
|
||||
const updatedFlat = { ...targetFlat };
|
||||
let langCharCount = 0;
|
||||
|
||||
for (const [key, englishText] of Object.entries(englishFlat)) {
|
||||
const needsTranslation = !targetFlat[key];
|
||||
if (needsTranslation) {
|
||||
if (dryRun) {
|
||||
langCharCount += englishText.length;
|
||||
} else {
|
||||
const translated = await translateText(englishText, langCode);
|
||||
updatedFlat[key] = translated;
|
||||
console.log(`Translated [${key}] to ${langCode}: ${translated}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dryRun) {
|
||||
console.log(`Dry run for ${langCode}: ${langCharCount} characters to translate.`);
|
||||
totalChars += langCharCount;
|
||||
} else {
|
||||
const updatedYaml = unflattenYaml(updatedFlat);
|
||||
await fs.writeFile(file, yaml.stringify(updatedYaml), 'utf8');
|
||||
}
|
||||
}
|
||||
|
||||
if (dryRun) {
|
||||
console.log(`Total characters across all languages: ${totalChars}`);
|
||||
}
|
||||
}
|
||||
|
||||
syncTranslations(options.english, options.targets, options.dryRun)
|
||||
.then(() => console.log(options.dryRun ? 'Dry run complete.' : 'Translation sync complete.'))
|
||||
.catch(console.error);
|
||||
+40
-3
@@ -1,9 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterView, useRoute } from 'vue-router';
|
||||
import { NGlobalStyle, NMessageProvider, NNotificationProvider, darkTheme } from 'naive-ui';
|
||||
import { get } from '@vueuse/core';
|
||||
import { darkThemeOverrides, lightThemeOverrides } from './themes';
|
||||
import { layouts } from './layouts';
|
||||
import { useStyleStore } from './stores/style.store';
|
||||
import { useAppTheme } from './ui/theme/themes';
|
||||
import { getITToolsSetting } from './composable/queryParams';
|
||||
|
||||
const route = useRoute();
|
||||
const layout = computed(() => route?.meta?.layout ?? layouts.base);
|
||||
@@ -14,6 +17,23 @@ const themeOverrides = computed(() => (styleStore.isDarkTheme ? darkThemeOverrid
|
||||
|
||||
const { locale } = useI18n();
|
||||
|
||||
const colorPalette = useAppTheme();
|
||||
|
||||
// Create CSS custom properties for the color palette
|
||||
const cssVars = computed(() => ({
|
||||
'--loading-background-color': colorPalette.value.loading_background,
|
||||
}));
|
||||
|
||||
// Apply CSS variables to the document root
|
||||
watchEffect(() => {
|
||||
const root = document.documentElement;
|
||||
Object.entries(cssVars.value).forEach(([key, value]) => {
|
||||
root.style.setProperty(key, value);
|
||||
});
|
||||
});
|
||||
|
||||
locale.value = get(getITToolsSetting('default_locale', locale.value));
|
||||
|
||||
syncRef(
|
||||
locale,
|
||||
useStorage('locale', locale),
|
||||
@@ -25,9 +45,11 @@ syncRef(
|
||||
<NGlobalStyle />
|
||||
<NMessageProvider placement="bottom">
|
||||
<NNotificationProvider placement="bottom-right">
|
||||
<component :is="layout">
|
||||
<RouterView />
|
||||
</component>
|
||||
<div>
|
||||
<component :is="layout">
|
||||
<RouterView />
|
||||
</component>
|
||||
</div>
|
||||
</NNotificationProvider>
|
||||
</NMessageProvider>
|
||||
</n-config-provider>
|
||||
@@ -49,4 +71,19 @@ html {
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body .vld-container {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: var(--loading-background-color);
|
||||
z-index: 9999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body .vld-container .vl-overlay.vl-active {
|
||||
margin-top: 15%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 275">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 275" preserveAspectRatio="none">
|
||||
<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"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 894 B After Width: | Height: | Size: 921 B |
@@ -1,15 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { useStorage } from '@vueuse/core';
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import { RouterLink, useRoute } from 'vue-router';
|
||||
import { useRoute } from 'vue-router';
|
||||
import MenuIconItem from './MenuIconItem.vue';
|
||||
import MenuItemWithTooltip from './MenuItemTooltip.vue';
|
||||
import type { Tool, ToolCategory } from '@/tools/tools.types';
|
||||
|
||||
const props = withDefaults(defineProps<{ toolsByCategory?: ToolCategory[] }>(), { toolsByCategory: () => [] });
|
||||
const { toolsByCategory } = toRefs(props);
|
||||
const route = useRoute();
|
||||
|
||||
const makeLabel = (tool: Tool) => () => h(RouterLink, { to: tool.path }, { default: () => tool.name });
|
||||
const makeLabel = (tool: Tool) => () => h(MenuItemWithTooltip, { tool });
|
||||
const makeIcon = (tool: Tool) => () => h(MenuIconItem, { tool });
|
||||
|
||||
const collapsedCategories = useStorage<Record<string, boolean>>(
|
||||
@@ -25,37 +26,64 @@ const collapsedCategories = useStorage<Record<string, boolean>>(
|
||||
},
|
||||
);
|
||||
|
||||
function toggleCategoryCollapse({ name }: { name: string }) {
|
||||
collapsedCategories.value[name] = !collapsedCategories.value[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* areAllCollapsed (new)
|
||||
* --------------------------------------------------------------------------
|
||||
* A computed property that checks if all categories are collapsed.
|
||||
* - If even one category is expanded (false), this becomes false.
|
||||
* - If no categories are found or all are collapsed (true), it becomes true.
|
||||
*/
|
||||
const areAllCollapsed = computed(() => {
|
||||
return toolsByCategory.value.every(({ name }) => collapsedCategories.value[name] !== false);
|
||||
// Initialize default values for all categories
|
||||
watchEffect(() => {
|
||||
toolsByCategory.value.forEach(({ name }) => {
|
||||
if (!(name in collapsedCategories.value)) {
|
||||
collapsedCategories.value[name] = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* toggleAllCategories (new)
|
||||
* --------------------------------------------------------------------------
|
||||
* If all categories are collapsed, expand them all; otherwise, collapse them all.
|
||||
*/
|
||||
function toggleAllCategories() {
|
||||
const nextState = !areAllCollapsed.value;
|
||||
const isToggling = ref(false);
|
||||
|
||||
function toggleCategoryCollapse({ name }: { name: string }) {
|
||||
const currentState = collapsedCategories.value[name];
|
||||
collapsedCategories.value[name] = !currentState;
|
||||
}
|
||||
|
||||
const areAllCollapsed = computed(() => {
|
||||
return toolsByCategory.value.every(({ name }) =>
|
||||
collapsedCategories.value[name] !== false,
|
||||
);
|
||||
});
|
||||
|
||||
async function toggleAllCategories() {
|
||||
if (isToggling.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
isToggling.value = true;
|
||||
|
||||
const shouldCollapse = !areAllCollapsed.value;
|
||||
const updates: Record<string, boolean> = {};
|
||||
|
||||
toolsByCategory.value.forEach(({ name }) => {
|
||||
collapsedCategories.value[name] = nextState;
|
||||
updates[name] = shouldCollapse;
|
||||
});
|
||||
};
|
||||
|
||||
Object.assign(collapsedCategories.value, updates);
|
||||
|
||||
await nextTick();
|
||||
isToggling.value = false;
|
||||
}
|
||||
|
||||
// Function to calculate animation duration based on number of items
|
||||
function getAnimationDuration(itemCount: number): number {
|
||||
const baseDuration = 325;
|
||||
const baseItemCount = 10;
|
||||
const durationIncrement = 5;
|
||||
|
||||
const additionalDuration = (itemCount - baseItemCount) * durationIncrement;
|
||||
|
||||
return Math.max(baseDuration + additionalDuration, baseDuration);
|
||||
}
|
||||
|
||||
const menuOptions = computed(() =>
|
||||
toolsByCategory.value.map(({ name, components }) => ({
|
||||
name,
|
||||
isCollapsed: collapsedCategories.value[name] === undefined ? true : collapsedCategories.value[name], // default to collapsed if not set
|
||||
isCollapsed: collapsedCategories.value[name],
|
||||
animationDuration: getAnimationDuration(components.length),
|
||||
tools: components.map(tool => ({
|
||||
label: makeLabel(tool),
|
||||
icon: makeIcon(tool),
|
||||
@@ -68,19 +96,23 @@ const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!--
|
||||
A button at the top to expand or collapse all categories at once.
|
||||
- Uses areAllCollapsed to determine the label ("Expand All" vs. "Collapse All").
|
||||
- Calls toggleAllCategories() on click.
|
||||
-->
|
||||
<div class="top-controls" ml-6px>
|
||||
<c-button @click="toggleAllCategories">
|
||||
{{ areAllCollapsed ? 'Expand All Tools' : 'Collapse All Tools' }}
|
||||
<div class="top-controls" mb-12px ml-12px>
|
||||
<c-button :disabled="isToggling" @click="toggleAllCategories">
|
||||
<span v-if="isToggling">
|
||||
{{ areAllCollapsed ? 'Expanding...' : 'Collapsing...' }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ areAllCollapsed ? 'Expand All Tools' : 'Collapse All Tools' }}
|
||||
</span>
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<div v-for="{ name, tools, isCollapsed } of menuOptions" :key="name">
|
||||
<div ml-6px mt-12px flex cursor-pointer items-center op-60 @click="toggleCategoryCollapse({ name })">
|
||||
<div v-for="{ name, tools, isCollapsed, animationDuration } of menuOptions" :key="name" class="category-container">
|
||||
<button
|
||||
class="category-button"
|
||||
flex cursor-pointer items-center op-60
|
||||
@click="toggleCategoryCollapse({ name })"
|
||||
>
|
||||
<span :class="{ 'rotate-0': isCollapsed, 'rotate-90': !isCollapsed }" text-16px lh-1 op-50 transition-transform>
|
||||
<icon-mdi-chevron-right />
|
||||
</span>
|
||||
@@ -88,9 +120,13 @@ const themeVars = useThemeVars();
|
||||
<span ml-8px text-13px>
|
||||
{{ name }}
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<n-collapse-transition :show="!isCollapsed">
|
||||
<div
|
||||
class="menu-container"
|
||||
:class="{ collapsed: isCollapsed }"
|
||||
:style="{ '--animation-duration': `${animationDuration}ms` }"
|
||||
>
|
||||
<div class="menu-wrapper">
|
||||
<div class="toggle-bar" @click="toggleCategoryCollapse({ name })" />
|
||||
|
||||
@@ -104,44 +140,73 @@ const themeVars = useThemeVars();
|
||||
:default-expand-all="true"
|
||||
/>
|
||||
</div>
|
||||
</n-collapse-transition>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
.menu-wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.menu {
|
||||
flex: 1;
|
||||
margin-bottom: 5px;
|
||||
.category-button {
|
||||
border: none;
|
||||
background: transparent;
|
||||
padding: 6px;
|
||||
width: 100%;
|
||||
color: v-bind('themeVars.textColor1');
|
||||
text-align: left;
|
||||
user-select: none;
|
||||
|
||||
::v-deep(.n-menu-item-content::before) {
|
||||
left: 0;
|
||||
right: 13px;
|
||||
}
|
||||
&:hover {
|
||||
background-color: v-bind('themeVars.buttonColor2Hover');
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
.category-container {
|
||||
.menu-container {
|
||||
display: grid;
|
||||
grid-template-rows: 1fr;
|
||||
transition: grid-template-rows var(--animation-duration, 350ms) ease-in-out;
|
||||
|
||||
.toggle-bar {
|
||||
width: 24px;
|
||||
opacity: 0.1;
|
||||
transition: opacity ease 0.2s;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
&::before {
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
content: ' ';
|
||||
background-color: v-bind('themeVars.textColor3');
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 14px;
|
||||
&.collapsed {
|
||||
grid-template-rows: 0fr;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
opacity: 0.5;
|
||||
.menu-wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
overflow: hidden;
|
||||
|
||||
.menu {
|
||||
flex: 1;
|
||||
margin-bottom: 5px;
|
||||
|
||||
::v-deep(.n-menu-item-content::before) {
|
||||
left: 0;
|
||||
right: 13px;
|
||||
transition: none !important; // Disables hover transition effect to instantly show hover state
|
||||
}
|
||||
}
|
||||
|
||||
.toggle-bar {
|
||||
width: 24px;
|
||||
opacity: 0.1;
|
||||
transition: opacity ease 0.2s;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
&::before {
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
content: ' ';
|
||||
background-color: v-bind('themeVars.textColor3');
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 14px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Base64 } from 'js-base64';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import CInputText from '@/ui/c-input-text/c-input-text.vue';
|
||||
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -21,13 +22,13 @@ const props = withDefaults(
|
||||
{
|
||||
transformer: _.identity,
|
||||
inputValidationRules: () => [],
|
||||
inputLabel: 'Input',
|
||||
inputLabel: t('formatTransformer.input'),
|
||||
inputDefault: '',
|
||||
inputPlaceholder: 'Input...',
|
||||
outputLabel: 'Output',
|
||||
inputPlaceholder: t('formatTransformer.input-placeholder'),
|
||||
outputLabel: t('formatTransformer.output'),
|
||||
outputLanguage: '',
|
||||
downloadFileName: '',
|
||||
downloadButtonText: 'Download',
|
||||
downloadButtonText: t('formatTransformer.download'),
|
||||
rows: 15,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { useVModel } from '@vueuse/core';
|
||||
import { useCopy } from '@/composable/copy';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
const props = defineProps<{
|
||||
value: string
|
||||
multiline?: boolean
|
||||
rows?: number | string
|
||||
autosize?: boolean
|
||||
readonly?: boolean
|
||||
}>();
|
||||
const emit = defineEmits(['update:value']);
|
||||
|
||||
const value = useVModel(props, 'value', emit);
|
||||
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
|
||||
const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : 'Copy to clipboard');
|
||||
const tooltipText = computed(() => isJustCopied.value ? t('inputCopyable.copied') : t('inputCopyable.copy'));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -21,6 +23,7 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : 'Copy to cli
|
||||
:multiline="multiline"
|
||||
:rows="rows"
|
||||
:autosize="autosize"
|
||||
:readonly="readonly"
|
||||
>
|
||||
<template #suffix>
|
||||
<c-tooltip :tooltip="tooltipText">
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterLink } from 'vue-router';
|
||||
import { nextTick, onMounted, onUnmounted, ref } from 'vue';
|
||||
import type { Tool } from '@/tools/tools.types';
|
||||
|
||||
defineProps<{
|
||||
tool: Tool
|
||||
}>();
|
||||
|
||||
const textRef = ref<HTMLElement>();
|
||||
const showTooltip = ref(false);
|
||||
let resizeTimeout: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
async function checkTruncation() {
|
||||
await nextTick();
|
||||
if (textRef.value) {
|
||||
const text = textRef.value.textContent || '';
|
||||
const computedStyle = window.getComputedStyle(textRef.value);
|
||||
|
||||
// Create canvas context for precise text measurement
|
||||
const canvas = document.createElement('canvas');
|
||||
const context = canvas.getContext('2d')!;
|
||||
context.font = `${computedStyle.fontWeight} ${computedStyle.fontSize} ${computedStyle.fontFamily}`;
|
||||
|
||||
const textWidth = context.measureText(text).width;
|
||||
|
||||
// Calculate precise container width by accounting for padding
|
||||
const containerWidth = textRef.value.clientWidth
|
||||
- Number.parseFloat(computedStyle.paddingLeft)
|
||||
- Number.parseFloat(computedStyle.paddingRight);
|
||||
|
||||
showTooltip.value = textWidth > containerWidth;
|
||||
}
|
||||
}
|
||||
|
||||
function debouncedCheckTruncation() {
|
||||
if (resizeTimeout) {
|
||||
clearTimeout(resizeTimeout);
|
||||
}
|
||||
// Prevent the truncation check from running too frequently when the window is resized
|
||||
resizeTimeout = setTimeout(checkTruncation, 500);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
checkTruncation();
|
||||
window.addEventListener('resize', debouncedCheckTruncation);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (resizeTimeout) {
|
||||
clearTimeout(resizeTimeout);
|
||||
}
|
||||
window.removeEventListener('resize', debouncedCheckTruncation);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-tooltip
|
||||
placement="right"
|
||||
:delay="500"
|
||||
:show-arrow="true"
|
||||
:disabled="!showTooltip"
|
||||
>
|
||||
<template #trigger>
|
||||
<RouterLink :to="tool.path" class="menu-link">
|
||||
<span
|
||||
ref="textRef"
|
||||
class="menu-text"
|
||||
@mouseenter="checkTruncation"
|
||||
>
|
||||
{{ tool.name }}
|
||||
</span>
|
||||
</RouterLink>
|
||||
</template>
|
||||
{{ tool.name }}
|
||||
</n-tooltip>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.menu-link {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.menu-text {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
@@ -4,6 +4,35 @@ import { useStyleStore } from '@/stores/style.store';
|
||||
const styleStore = useStyleStore();
|
||||
const { isMenuCollapsed, isSmallScreen } = toRefs(styleStore);
|
||||
const siderPosition = computed(() => (isSmallScreen.value ? 'absolute' : 'static'));
|
||||
|
||||
// Reactive window width
|
||||
const windowWidth = ref(window.innerWidth);
|
||||
|
||||
// Update window width on resize
|
||||
function updateWindowWidth() {
|
||||
windowWidth.value = window.innerWidth;
|
||||
}
|
||||
|
||||
// Add resize listener
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', updateWindowWidth);
|
||||
});
|
||||
|
||||
// Clean up listener
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', updateWindowWidth);
|
||||
});
|
||||
|
||||
// Calculate the actual width to ensure minimum width is respected
|
||||
const siderWidth = computed(() => {
|
||||
if (isMenuCollapsed.value) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Use 12.5% of window width, but ensure it's at least 240px
|
||||
const tenPercent = windowWidth.value * 0.125;
|
||||
return Math.max(240, tenPercent);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -12,7 +41,7 @@ const siderPosition = computed(() => (isSmallScreen.value ? 'absolute' : 'static
|
||||
bordered
|
||||
collapse-mode="width"
|
||||
:collapsed-width="0"
|
||||
:width="240"
|
||||
:width="siderWidth"
|
||||
:collapsed="isMenuCollapsed"
|
||||
:show-trigger="false"
|
||||
:native-scrollbar="false"
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { useCopy } from '@/composable/copy';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
const props = withDefaults(defineProps<{ value?: string }>(), { value: '' });
|
||||
const { value } = toRefs(props);
|
||||
|
||||
const initialText = 'Copy to clipboard';
|
||||
const initialText = t('spanCopyable.copy');
|
||||
|
||||
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
|
||||
const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : initialText);
|
||||
const tooltipText = computed(() => isJustCopied.value ? t('spanCopyable.copied') : initialText);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -20,6 +20,7 @@ import protobufHljs from 'highlight.js/lib/languages/protobuf';
|
||||
import { Base64 } from 'js-base64';
|
||||
import { useCopy } from '@/composable/copy';
|
||||
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -31,14 +32,18 @@ const props = withDefaults(
|
||||
wordWrap?: boolean
|
||||
downloadFileName?: string
|
||||
downloadButtonText?: string
|
||||
scrollable?: boolean
|
||||
maxHeight?: string
|
||||
}>(),
|
||||
{
|
||||
followHeightOf: null,
|
||||
language: 'txt',
|
||||
copyPlacement: 'top-right',
|
||||
copyMessage: 'Copy to clipboard',
|
||||
copyMessage: t('textareaCopyable.copy'),
|
||||
downloadFileName: '',
|
||||
downloadButtonText: 'Download',
|
||||
downloadButtonText: t('textareaCopyable.download'),
|
||||
scrollable: false,
|
||||
maxHeight: '400px',
|
||||
},
|
||||
);
|
||||
hljs.registerLanguage('sql', sqlHljs);
|
||||
@@ -47,6 +52,7 @@ hljs.registerLanguage('html', xmlHljs);
|
||||
hljs.registerLanguage('xml', xmlHljs);
|
||||
hljs.registerLanguage('yaml', yamlHljs);
|
||||
hljs.registerLanguage('toml', iniHljs);
|
||||
hljs.registerLanguage('ini', iniHljs);
|
||||
hljs.registerLanguage('ts', tsHljs);
|
||||
hljs.registerLanguage('typescript', tsHljs);
|
||||
hljs.registerLanguage('bash', bashHljs);
|
||||
@@ -62,8 +68,19 @@ hljs.registerLanguage('protobuf', protobufHljs);
|
||||
const { value, language, followHeightOf, copyPlacement, copyMessage, downloadFileName, downloadButtonText } = toRefs(props);
|
||||
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
|
||||
|
||||
const scrollbarRef = ref();
|
||||
|
||||
// Watch for content changes and scroll to bottom
|
||||
watch(value, () => {
|
||||
nextTick(() => {
|
||||
if (scrollbarRef.value) {
|
||||
scrollbarRef.value.scrollTo({ top: scrollbarRef.value.scrollbarInstRef.containerRef.scrollHeight });
|
||||
}
|
||||
});
|
||||
}, { flush: 'post' });
|
||||
|
||||
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
|
||||
const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.value);
|
||||
const tooltipText = computed(() => isJustCopied.value ? t('textareaCopyable.copied') : copyMessage.value);
|
||||
|
||||
const valueBase64 = computed(() => Base64.encode(value.value));
|
||||
const { download } = useDownloadFileFromBase64(
|
||||
@@ -75,11 +92,19 @@ const { download } = useDownloadFileFromBase64(
|
||||
|
||||
<template>
|
||||
<div style="overflow-x: hidden; width: 100%">
|
||||
<c-card relative>
|
||||
<c-card
|
||||
relative
|
||||
:style="(copyPlacement === 'top-right' || copyPlacement === 'bottom-right') ? `padding-bottom: 50px` : ''"
|
||||
>
|
||||
<n-scrollbar
|
||||
x-scrollable
|
||||
ref="scrollbarRef"
|
||||
:x-scrollable="true"
|
||||
:y-scrollable="scrollable"
|
||||
trigger="none"
|
||||
:style="height ? `min-height: ${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : ''"
|
||||
:style="{
|
||||
minHeight: height ? `${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : '',
|
||||
maxHeight: scrollable ? maxHeight : '',
|
||||
}"
|
||||
>
|
||||
<n-config-provider :hljs="hljs">
|
||||
<n-code :code="value" :language="language" :word-wrap="wordWrap" :trim="false" data-test-id="area-content" />
|
||||
@@ -87,9 +112,10 @@ const { download } = useDownloadFileFromBase64(
|
||||
</n-scrollbar>
|
||||
<div
|
||||
v-if="value && copyPlacement !== 'none'"
|
||||
absolute right-10px
|
||||
:top-10px="copyPlacement === 'top-right' ? '' : 'no'"
|
||||
:bottom-10px="copyPlacement === 'bottom-right' ? '' : 'no'"
|
||||
absolute right-10px
|
||||
:style="scrollable ? 'z-index: 10; background: var(--bg-color); border-radius: 50%; padding: 2px;' : ''"
|
||||
>
|
||||
<c-tooltip v-if="value && copyPlacement !== 'outside'" :tooltip="tooltipText" position="left">
|
||||
<c-button circle important:h-10 important:w-10 @click="copy()">
|
||||
|
||||
+82
-2
@@ -2,8 +2,9 @@
|
||||
import { useClipboard, useClipboardItems } from '@vueuse/core';
|
||||
import { useMessage } from 'naive-ui';
|
||||
import type { MaybeRefOrGetter } from 'vue';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export function useCopy({ source, text = 'Copied to the clipboard', createToast = true }: { source?: MaybeRefOrGetter<string>; text?: string; createToast?: boolean } = {}) {
|
||||
export function useCopy({ source, text = t('tools.copy.text.copied-to-the-clipboard'), createToast = true }: { source?: MaybeRefOrGetter<string>; text?: string; createToast?: boolean } = {}) {
|
||||
const { copy, copied, ...rest } = useClipboard({
|
||||
source,
|
||||
legacy: true,
|
||||
@@ -29,7 +30,7 @@ export function useCopy({ source, text = 'Copied to the clipboard', createToast
|
||||
};
|
||||
}
|
||||
|
||||
export function useCopyClipboardItems({ source, text = 'Copied to the clipboard', createToast = true }: { source?: MaybeRefOrGetter<Array<{ mime: string; content: string }>>; text?: string; createToast?: boolean } = {}) {
|
||||
export function useCopyClipboardItems({ source, text = t('tools.copy.text.copied-to-the-clipboard'), createToast = true }: { source?: MaybeRefOrGetter<Array<{ mime: string; content: string }>>; text?: string; createToast?: boolean } = {}) {
|
||||
function toClipboardItem(item: { mime: string; content: string }) {
|
||||
return new ClipboardItem({
|
||||
[item.mime]: new Blob([item.content], { type: item.mime }),
|
||||
@@ -59,3 +60,82 @@ export function useCopyClipboardItems({ source, text = 'Copied to the clipboard'
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function useCopyHtml({ sourceHtml, fallbackText, toastText = t('tools.copy.text.copied-to-the-clipboard'), createToast = true }: { sourceHtml?: MaybeRefOrGetter<string>; fallbackText?: MaybeRefOrGetter<string>; toastText?: string; createToast?: boolean } = {}) {
|
||||
const message = useMessage();
|
||||
|
||||
const copied = ref(false);
|
||||
const error = ref('');
|
||||
|
||||
function legacyCopy(text: string) {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = text;
|
||||
|
||||
textarea.style.position = 'fixed';
|
||||
textarea.style.opacity = '0';
|
||||
textarea.style.pointerEvents = 'none';
|
||||
|
||||
document.body.appendChild(textarea);
|
||||
textarea.focus();
|
||||
textarea.select();
|
||||
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
}
|
||||
finally {
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
}
|
||||
|
||||
async function copyHtml(html: string, fallbackText?: string) {
|
||||
copied.value = false;
|
||||
error.value = '';
|
||||
|
||||
try {
|
||||
const ClipboardItemCtor = (window as any).ClipboardItem;
|
||||
|
||||
if (navigator.clipboard && ClipboardItemCtor) {
|
||||
// Modern HTML clipboard support
|
||||
const blobHtml = new Blob([html], { type: 'text/html' });
|
||||
const blobText = new Blob([fallbackText || html], { type: 'text/plain' });
|
||||
const item = new ClipboardItemCtor({ 'text/plain': blobText, 'text/html': blobHtml });
|
||||
await navigator.clipboard.write([item]);
|
||||
}
|
||||
else if (navigator.clipboard?.writeText) {
|
||||
// Async text fallback
|
||||
await navigator.clipboard.writeText(fallbackText || html);
|
||||
}
|
||||
else {
|
||||
// Legacy execCommand fallback
|
||||
legacyCopy(fallbackText || html);
|
||||
}
|
||||
|
||||
copied.value = true;
|
||||
}
|
||||
catch (e: any) {
|
||||
error.value = e.toString();
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
isJustCopied: copied,
|
||||
async copy(html?: string, text?: string, { notificationMessage }: { notificationMessage?: string } = {}) {
|
||||
if (sourceHtml) {
|
||||
await copyHtml(toValue(sourceHtml), toValue(fallbackText));
|
||||
}
|
||||
else if (html) {
|
||||
await copyHtml(html, text);
|
||||
}
|
||||
|
||||
if (createToast) {
|
||||
if (error.value) {
|
||||
message.error(error.value);
|
||||
}
|
||||
else {
|
||||
message.success(notificationMessage ?? toastText);
|
||||
}
|
||||
}
|
||||
},
|
||||
error,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
import { type MaybeRef, get } from '@vueuse/core';
|
||||
import { computed, ref } from 'vue';
|
||||
import FlexSearch from 'flexsearch';
|
||||
|
||||
// Define key types to match Fuse.js format
|
||||
type SearchKey = string | { name: string; weight?: number };
|
||||
|
||||
export function useFlexSearch<Data extends Record<string, any>>({
|
||||
search,
|
||||
data,
|
||||
options = {
|
||||
keys: [],
|
||||
},
|
||||
limit = -1,
|
||||
}: {
|
||||
search: MaybeRef<string>
|
||||
data: Data[]
|
||||
options?: {
|
||||
keys: SearchKey[]
|
||||
/**
|
||||
* Whether to show or not show items with an empty search query. `true` won't show any items, `false` will show all items.
|
||||
* @default true
|
||||
*/
|
||||
filterEmpty?: boolean
|
||||
/**
|
||||
* Whether the results should be sorted by similarity score using the Levenshtein distance.
|
||||
* @default true
|
||||
*/
|
||||
shouldSort?: boolean
|
||||
/**
|
||||
* Type of tokenization logic to use (Determines how the search logic will behave).
|
||||
* @default 'forward'
|
||||
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#tokenizer-partial-match | FlexSearch Tokenizer Documentation}
|
||||
*
|
||||
* Note: The `'tolerant'` tokenizer option mentioned in the documentation doesn't exist anymore in the current version of FlexSearch.
|
||||
*/
|
||||
tokenize?: 'strict' | 'forward' | 'reverse' | 'full'
|
||||
/**
|
||||
* Resolution value for giving meaningful results when searching for partial matches.
|
||||
* @default 9
|
||||
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#resolution | FlexSearch Resolution Documentation}
|
||||
*/
|
||||
resolution?: number
|
||||
optimize?: boolean
|
||||
/**
|
||||
* Value to determine if the cache should be used.
|
||||
* If set to a number, the cache will use the number to assign that number of cache slots (No information in the documentation is provided about what a cache slot is exactly).
|
||||
* @default false
|
||||
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#auto-balanced-cache-by-popularity | FlexSearch Cache Documentation}
|
||||
*/
|
||||
cache?: boolean | number
|
||||
}
|
||||
limit?: MaybeRef<number>
|
||||
}) {
|
||||
// Extract options
|
||||
const { keys, filterEmpty = true, shouldSort = true, tokenize = 'forward', ...indexOptions } = options;
|
||||
|
||||
// Normalize keys to include weights
|
||||
const normalizedKeys = keys.map((key) => {
|
||||
if (typeof key === 'string') {
|
||||
return { name: key, weight: 1 };
|
||||
}
|
||||
return { name: key.name, weight: key.weight ?? 1 };
|
||||
});
|
||||
|
||||
// Helper to get unique key for each item (prefer 'id', fallback to index)
|
||||
const getItemKey = (item: Data, idx: number) => (item.id !== undefined ? item.id : idx);
|
||||
|
||||
// Map to store original data items by unique key
|
||||
const dataMap = ref(new Map<any, Data>());
|
||||
|
||||
// Create separate indices for each key with weight info
|
||||
const indices = normalizedKeys.map(({ name, weight }) => ({
|
||||
key: name,
|
||||
weight,
|
||||
index: new FlexSearch.Index({
|
||||
tokenize,
|
||||
preset: 'performance',
|
||||
resolution: 9,
|
||||
optimize: true,
|
||||
cache: false,
|
||||
fastupdate: true,
|
||||
...indexOptions,
|
||||
}),
|
||||
}));
|
||||
|
||||
// Initialize indices with data
|
||||
const initializeIndices = async () => {
|
||||
dataMap.value.clear();
|
||||
indices.forEach(({ index }) => index.clear());
|
||||
|
||||
// Pre-calculate all the values to avoid repeated nested property access
|
||||
const itemData = data.map((item, idx) => {
|
||||
const itemKey = getItemKey(item, idx);
|
||||
const values = new Map<string, string>();
|
||||
|
||||
indices.forEach(({ key }) => {
|
||||
const value = key.split('.').reduce((obj, path) => obj?.[path], item);
|
||||
if (value) {
|
||||
values.set(key, String(value));
|
||||
}
|
||||
});
|
||||
|
||||
return { itemKey, item, values };
|
||||
});
|
||||
|
||||
// Batch add to dataMap
|
||||
itemData.forEach(({ itemKey, item }) => {
|
||||
dataMap.value.set(itemKey, item);
|
||||
});
|
||||
|
||||
// Process indices sequentially to avoid event loop flooding
|
||||
for (const { key, index } of indices) {
|
||||
// Filter items that have values for this key upfront
|
||||
const itemsForThisKey = itemData
|
||||
.map(({ itemKey, values }) => ({ itemKey, value: values.get(key) }))
|
||||
.filter(({ value }) => value);
|
||||
|
||||
const chunkSize = 5000;
|
||||
|
||||
for (let i = 0; i < itemsForThisKey.length; i += chunkSize) {
|
||||
const chunk = itemsForThisKey.slice(i, i + chunkSize);
|
||||
|
||||
// Use requestAnimationFrame for better performance
|
||||
await new Promise<void>((resolve) => {
|
||||
requestAnimationFrame(() => {
|
||||
chunk.forEach(({ itemKey, value }) => {
|
||||
index.add(itemKey, value!);
|
||||
});
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Initialize on creation
|
||||
initializeIndices();
|
||||
|
||||
// Function to search across all indices with weight consideration
|
||||
const searchAllIndices = (query: string, searchLimit: number) => {
|
||||
if (!query) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Use a higher individual limit for each index to ensure we don't miss potential matches
|
||||
const individualLimit = searchLimit > 0 ? searchLimit * 2 : undefined;
|
||||
|
||||
// Search each index and collect results with weights
|
||||
const weightedResults = new Map<any, { score: number; maxWeight: number }>();
|
||||
|
||||
indices.forEach(({ index, weight }) => {
|
||||
const results = index.search(query, individualLimit ? { limit: individualLimit } : undefined);
|
||||
|
||||
results.forEach((id) => {
|
||||
const current = weightedResults.get(id) || { score: 0, maxWeight: 0 };
|
||||
// Use the maximum weight among matching fields as the primary score
|
||||
// Add a small bonus for additional field matches
|
||||
const newScore = Math.max(current.score, weight * 100) + (weight * 10);
|
||||
const newMaxWeight = Math.max(current.maxWeight, weight);
|
||||
|
||||
weightedResults.set(id, {
|
||||
score: newScore,
|
||||
maxWeight: newMaxWeight,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Sort by score (higher score = better match) and convert to array
|
||||
const sortedIds = Array.from(weightedResults.entries())
|
||||
.sort((a, b) => {
|
||||
// First sort by max weight, then by total score
|
||||
if (b[1].maxWeight !== a[1].maxWeight) {
|
||||
return b[1].maxWeight - a[1].maxWeight;
|
||||
}
|
||||
return b[1].score - a[1].score;
|
||||
})
|
||||
.map(([id]) => id);
|
||||
|
||||
// If shouldn't be sorted by similarity, apply limit here and return early
|
||||
if (!shouldSort) {
|
||||
const limitedIds = searchLimit > 0 ? sortedIds.slice(0, searchLimit) : sortedIds;
|
||||
return limitedIds
|
||||
.map(id => dataMap.value.get(id))
|
||||
.filter(Boolean) as Data[];
|
||||
}
|
||||
|
||||
// Calculate Levenshtein distance
|
||||
const levenshteinDistance = (str1: string, str2: string): number => {
|
||||
const matrix = Array(str2.length + 1).fill(null).map(() => Array(str1.length + 1).fill(null));
|
||||
|
||||
for (let i = 0; i <= str1.length; i++) {
|
||||
matrix[0][i] = i;
|
||||
}
|
||||
for (let j = 0; j <= str2.length; j++) {
|
||||
matrix[j][0] = j;
|
||||
}
|
||||
|
||||
for (let j = 1; j <= str2.length; j++) {
|
||||
for (let i = 1; i <= str1.length; i++) {
|
||||
const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1;
|
||||
matrix[j][i] = Math.min(
|
||||
matrix[j][i - 1] + 1, // deletion
|
||||
matrix[j - 1][i] + 1, // insertion
|
||||
matrix[j - 1][i - 1] + indicator, // substitution
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return matrix[str2.length][str1.length];
|
||||
};
|
||||
|
||||
// Calculate similarity score (0-1, where 1 is perfect match)
|
||||
const calculateSimilarity = (str1: string, str2: string): number => {
|
||||
const maxLength = Math.max(str1.length, str2.length);
|
||||
if (maxLength === 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const distance = levenshteinDistance(str1.toLowerCase(), str2.toLowerCase());
|
||||
return 1 - (distance / maxLength);
|
||||
};
|
||||
|
||||
// Sort ALL results by similarity score, then apply limit at the end
|
||||
const sortedResults = sortedIds
|
||||
.map((id) => {
|
||||
const item = dataMap.value.get(id);
|
||||
if (!item) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Calculate weighted similarity score across all searchable fields
|
||||
let bestWeightedSimilarity = 0;
|
||||
let maxFieldWeight = 0;
|
||||
|
||||
normalizedKeys.forEach(({ name, weight }) => {
|
||||
const value = name.split('.').reduce((obj, path) => obj?.[path], item);
|
||||
if (value) {
|
||||
const similarity = calculateSimilarity(query, String(value));
|
||||
const weightedSimilarity = similarity * weight;
|
||||
|
||||
if (weightedSimilarity > bestWeightedSimilarity) {
|
||||
bestWeightedSimilarity = weightedSimilarity;
|
||||
maxFieldWeight = weight;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
item,
|
||||
similarity: bestWeightedSimilarity,
|
||||
maxWeight: maxFieldWeight,
|
||||
};
|
||||
})
|
||||
.filter(Boolean)
|
||||
.sort((a, b) => {
|
||||
// First sort by max field weight, then by weighted similarity
|
||||
if (b!.maxWeight !== a!.maxWeight) {
|
||||
return b!.maxWeight - a!.maxWeight;
|
||||
}
|
||||
return b!.similarity - a!.similarity;
|
||||
})
|
||||
.map(result => result!.item);
|
||||
|
||||
// Apply limit after final sorting
|
||||
return searchLimit > 0 ? sortedResults.slice(0, searchLimit) : sortedResults;
|
||||
};
|
||||
|
||||
// Computed results
|
||||
const searchResult = computed<Data[]>(() => {
|
||||
const query = get(search);
|
||||
const searchLimit: number = get(limit);
|
||||
|
||||
// Handle empty query case
|
||||
if (!query && !filterEmpty) {
|
||||
return searchLimit > 0 ? data.slice(0, searchLimit) : data;
|
||||
}
|
||||
|
||||
if (!query) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return searchAllIndices(query, searchLimit);
|
||||
});
|
||||
|
||||
return { searchResult };
|
||||
}
|
||||
@@ -4,6 +4,10 @@ import { computed } from 'vue';
|
||||
|
||||
export { useFuzzySearch };
|
||||
|
||||
/**
|
||||
* @deprecated This composable is deprecated and will be removed in a future version.
|
||||
* Use {@link useFlexSearch} instead.
|
||||
*/
|
||||
function useFuzzySearch<Data>({
|
||||
search,
|
||||
data,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useRouteQuery } from '@vueuse/router';
|
||||
import { computed } from 'vue';
|
||||
import { useStorage } from '@vueuse/core';
|
||||
import { type MaybeRef, computed } from 'vue';
|
||||
import { type RemovableRef, type StorageLike, type UseStorageOptions, get, useStorage } from '@vueuse/core';
|
||||
import { getCurrentInstance } from 'vue';
|
||||
|
||||
export { useQueryParam, useQueryParamOrStorage };
|
||||
export { useQueryParam, useQueryParamOrStorage, useITStorage, getITToolsSetting };
|
||||
|
||||
const transformers = {
|
||||
number: {
|
||||
@@ -25,11 +26,12 @@ const transformers = {
|
||||
},
|
||||
};
|
||||
|
||||
function useQueryParam<T>({ name, defaultValue }: { name: string; defaultValue: T }) {
|
||||
function useQueryParam<T>({ tool, name, defaultValue }: { tool: string; name: string; defaultValue: T }): RemovableRef<T> {
|
||||
const type = typeof defaultValue;
|
||||
const transformer = transformers[type as keyof typeof transformers] ?? transformers.string;
|
||||
const defaultValueOrSetting = getITToolsSetting(`${tool}:${name}`, defaultValue);
|
||||
|
||||
const proxy = useRouteQuery(name, transformer.toQuery(defaultValue as never));
|
||||
const proxy = useRouteQuery(name, transformer.toQuery(defaultValueOrSetting as never));
|
||||
|
||||
return computed<T>({
|
||||
get() {
|
||||
@@ -45,11 +47,13 @@ function useQueryParamOrStorage<T>({ name, storageName, defaultValue }: { name:
|
||||
const type = typeof defaultValue;
|
||||
const transformer = transformers[type as keyof typeof transformers] ?? transformers.string;
|
||||
|
||||
const storageRef = useStorage(storageName, defaultValue);
|
||||
const proxyDefaultValue = transformer.toQuery(defaultValue as never);
|
||||
const defaultValueOrSetting = getITToolsSetting(`${storageName.split(':')[0]}:${name}`, defaultValue);
|
||||
|
||||
const storageRef = useStorage(storageName, defaultValueOrSetting);
|
||||
const proxyDefaultValue = transformer.toQuery(defaultValueOrSetting as never);
|
||||
const proxy = useRouteQuery(name, proxyDefaultValue);
|
||||
|
||||
const r = ref(defaultValue);
|
||||
const r = isRef(defaultValueOrSetting) ? defaultValueOrSetting as Ref<T> : ref(get(defaultValueOrSetting));
|
||||
|
||||
watch(r,
|
||||
(value) => {
|
||||
@@ -64,3 +68,31 @@ function useQueryParamOrStorage<T>({ name, storageName, defaultValue }: { name:
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
function useITStorage<T>(key: string, defaults: MaybeRef<T>, storage?: StorageLike, options?: UseStorageOptions<T>): RemovableRef<T> {
|
||||
const defaultValueOrSetting = getITToolsSetting(key, defaults);
|
||||
return useStorage<T>(key, defaultValueOrSetting, storage, options);
|
||||
}
|
||||
|
||||
function getITToolsSetting<T>(key: string, defaultValue: MaybeRef<T>) {
|
||||
const itToolsSettings = useITToolsSettings();
|
||||
if (!itToolsSettings) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (key.includes(':')) {
|
||||
const [tool, subkey] = key.split(':');
|
||||
return (itToolsSettings[tool] || {})[subkey] as T ?? defaultValue;
|
||||
}
|
||||
else {
|
||||
return (itToolsSettings)[key] as T ?? defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
let itToolsSettings: Record<string, Record<string, any> | any>;
|
||||
function useITToolsSettings(): Record<string, Record<string, any>> {
|
||||
if (!itToolsSettings) {
|
||||
const vm = getCurrentInstance();
|
||||
itToolsSettings = vm?.appContext.config.globalProperties.$itToolsSettings as Record<string, Record<string, any>>;
|
||||
}
|
||||
return itToolsSettings;
|
||||
}
|
||||
+31
-13
@@ -1,18 +1,16 @@
|
||||
<script lang="ts" setup>
|
||||
import { Coffee, Home2, Menu2 } from '@vicons/tabler';
|
||||
import { NIcon, useThemeVars } from 'naive-ui';
|
||||
|
||||
import { RouterLink } from 'vue-router';
|
||||
import { Home2, Menu2 } from '@vicons/tabler';
|
||||
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { RouterLink } from 'vue-router';
|
||||
import HeroGradient from '../assets/hero-gradient.svg?component';
|
||||
import MenuLayout from '../components/MenuLayout.vue';
|
||||
import NavbarButtons from '../components/NavbarButtons.vue';
|
||||
import { useStyleStore } from '@/stores/style.store';
|
||||
import { config } from '@/config';
|
||||
import type { ToolCategory } from '@/tools/tools.types';
|
||||
import { useToolStore } from '@/tools/tools.store';
|
||||
import CollapsibleToolMenu from '@/components/CollapsibleToolMenu.vue';
|
||||
import { config } from '@/config';
|
||||
import { useStyleStore } from '@/stores/style.store';
|
||||
import { useToolStore } from '@/tools/tools.store';
|
||||
import type { ToolCategory } from '@/tools/tools.types';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
const styleStore = useStyleStore();
|
||||
@@ -117,6 +115,20 @@ const tools = computed<ToolCategory[]>(() => [
|
||||
<div>
|
||||
<NavbarButtons v-if="!styleStore.isSmallScreen" />
|
||||
</div>
|
||||
|
||||
<c-tooltip position="bottom" :tooltip="$t('home.support')">
|
||||
<c-button
|
||||
round
|
||||
href="https://www.buymeacoffee.com/sharevb"
|
||||
rel="noopener"
|
||||
target="_blank"
|
||||
class="support-button"
|
||||
:bordered="false"
|
||||
>
|
||||
<span v-if="!styleStore.isSmallScreen" mr-2>{{ $t('home.buyMeACoffee') }}</span>
|
||||
<NIcon :component="Coffee" />
|
||||
</c-button>
|
||||
</c-tooltip>
|
||||
</div>
|
||||
<slot />
|
||||
</template>
|
||||
@@ -156,20 +168,26 @@ const tools = computed<ToolCategory[]>(() => [
|
||||
}
|
||||
|
||||
.sider-content {
|
||||
padding-top: 160px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 200px;
|
||||
}
|
||||
|
||||
.hero-wrapper {
|
||||
position: absolute;
|
||||
display: block;
|
||||
position: sticky;
|
||||
display: flex;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
height: 150px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.gradient {
|
||||
margin-top: -65px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.text-wrapper {
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { HeadObject } from '@vueuse/head';
|
||||
import VueMarkdown from 'vue-markdown-render';
|
||||
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import { useTheme } from '../ui/c-link/c-link.theme';
|
||||
import BaseLayout from './base.layout.vue';
|
||||
import FavoriteButton from '@/components/FavoriteButton.vue';
|
||||
import type { Tool } from '@/tools/tools.types';
|
||||
@@ -14,10 +15,34 @@ const route = useRoute();
|
||||
const head = computed<HeadObject>(() => ({
|
||||
title: `${route.meta.name} - IT Tools`,
|
||||
meta: [
|
||||
{
|
||||
itemprop: 'name',
|
||||
content: `${route.meta.name} - IT Tools`,
|
||||
},
|
||||
{
|
||||
property: 'og:title',
|
||||
content: `${route.meta.name} - IT Tools`,
|
||||
},
|
||||
{
|
||||
property: 'twitter:title',
|
||||
content: `${route.meta.name} - IT Tools`,
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
content: route.meta?.description as string,
|
||||
},
|
||||
{
|
||||
itemprop: 'description',
|
||||
content: route.meta?.description as string,
|
||||
},
|
||||
{
|
||||
property: 'og:description',
|
||||
content: route.meta?.description as string,
|
||||
},
|
||||
{
|
||||
property: 'twitter:description',
|
||||
content: route.meta?.description as string,
|
||||
},
|
||||
{
|
||||
name: 'keywords',
|
||||
content: ((route.meta.keywords ?? []) as string[]).join(','),
|
||||
@@ -44,9 +69,11 @@ const toolFooter = computed<string>(() => {
|
||||
packageName,
|
||||
packageName.includes('://') ? packageName : `https://www.npmjs.com/package/${packageName}`),
|
||||
);
|
||||
return ((npmPackages.length > 0 ? `Made with ${npmPackages.join(', ')}\n` : '') + footer).trim();
|
||||
return ((npmPackages.length > 0 ? t('tools.tool.layout.text.made-with-npmpackages-join-n', [npmPackages.join(', ')]) : '') + footer).trim();
|
||||
});
|
||||
const themeVars = useThemeVars();
|
||||
|
||||
const linkTheme = useTheme();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -72,7 +99,9 @@ const themeVars = useThemeVars();
|
||||
</div>
|
||||
|
||||
<div class="tool-content">
|
||||
<slot />
|
||||
<Suspense>
|
||||
<slot />
|
||||
</Suspense>
|
||||
</div>
|
||||
|
||||
<div class="tool-footer">
|
||||
@@ -140,4 +169,30 @@ const themeVars = useThemeVars();
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
::v-deep(.external-tool) a {
|
||||
line-height: inherit;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
font-weight: 400;
|
||||
color: v-bind('linkTheme.default.textColor');
|
||||
border-radius: 4px;
|
||||
transition: color cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
|
||||
|
||||
outline-offset: 1px;
|
||||
|
||||
&:hover {
|
||||
color: v-bind('linkTheme.default.hover.textColor');
|
||||
}
|
||||
|
||||
&:active {
|
||||
color: v-bind('linkTheme.default.textColor');
|
||||
}
|
||||
|
||||
&:focus {
|
||||
color: v-bind('linkTheme.default.outline.color');
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
const createModule: EmscriptenModuleFactory;
|
||||
export default createModule;
|
||||
@@ -1,127 +0,0 @@
|
||||
|
||||
var Module = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(Module) {
|
||||
Module = Module || {};
|
||||
|
||||
|
||||
var d;d||(d=typeof Module !== 'undefined' ? Module : {});var aa,ba;d.ready=new Promise(function(a,b){aa=a;ba=b});d.noInitialRun=!0;var ca=Object.assign({},d),da=[],ea="./this.program",fa=(a,b)=>{throw b;},ha="object"==typeof window,m="function"==typeof importScripts,ia="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,q="",ja,ka,la,fs,t,ma;
|
||||
if(ia)q=m?require("path").dirname(q)+"/":__dirname+"/",ma=()=>{t||(fs=require("fs"),t=require("path"))},ja=function(a,b){ma();a=t.normalize(a);return fs.readFileSync(a,b?void 0:"utf8")},la=a=>{a=ja(a,!0);a.buffer||(a=new Uint8Array(a));return a},ka=(a,b,c)=>{ma();a=t.normalize(a);fs.readFile(a,function(e,f){e?c(e):b(f.buffer)})},1<process.argv.length&&(ea=process.argv[1].replace(/\\/g,"/")),da=process.argv.slice(2),process.on("uncaughtException",function(a){if(!(a instanceof na))throw a;}),process.on("unhandledRejection",
|
||||
function(a){throw a;}),fa=(a,b)=>{if(noExitRuntime)throw process.exitCode=a,b;b instanceof na||v("exiting due to exception: "+b);process.exit(a)},d.inspect=function(){return"[Emscripten Module object]"};else if(ha||m)m?q=self.location.href:"undefined"!=typeof document&&document.currentScript&&(q=document.currentScript.src),_scriptDir&&(q=_scriptDir),0!==q.indexOf("blob:")?q=q.substr(0,q.replace(/[?#].*/,"").lastIndexOf("/")+1):q="",ja=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},
|
||||
m&&(la=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),ka=(a,b,c)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?b(e.response):c()};e.onerror=c;e.send(null)};var oa=console.log.bind(console),v=console.warn.bind(console);Object.assign(d,ca);ca=null;var z=0,noExitRuntime=!0;"object"!=typeof WebAssembly&&A("no native wasm support detected");
|
||||
var pa,qa=!1,ra,sa="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;
|
||||
function B(a,b){for(var c=b+NaN,e=b;a[e]&&!(e>=c);)++e;if(16<e-b&&a.buffer&&sa)return sa.decode(a.subarray(b,e));for(c="";b<e;){var f=a[b++];if(f&128){var g=a[b++]&63;if(192==(f&224))c+=String.fromCharCode((f&31)<<6|g);else{var k=a[b++]&63;f=224==(f&240)?(f&15)<<12|g<<6|k:(f&7)<<18|g<<12|k<<6|a[b++]&63;65536>f?c+=String.fromCharCode(f):(f-=65536,c+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else c+=String.fromCharCode(f)}return c}function C(a){return a?B(ta,a):""}
|
||||
function ua(a,b,c,e){if(!(0<e))return 0;var f=c;e=c+e-1;for(var g=0;g<a.length;++g){var k=a.charCodeAt(g);if(55296<=k&&57343>=k){var l=a.charCodeAt(++g);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(c>=e)break;b[c++]=k}else{if(2047>=k){if(c+1>=e)break;b[c++]=192|k>>6}else{if(65535>=k){if(c+2>=e)break;b[c++]=224|k>>12}else{if(c+3>=e)break;b[c++]=240|k>>18;b[c++]=128|k>>12&63}b[c++]=128|k>>6&63}b[c++]=128|k&63}}b[c]=0;return c-f}
|
||||
function va(a){for(var b=0,c=0;c<a.length;++c){var e=a.charCodeAt(c);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++c)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b}function wa(a){var b=va(a)+1,c=xa(b);c&&ua(a,D,c,b);return c}function ya(a){var b=va(a)+1,c=za(b);ua(a,D,c,b);return c}var Aa,D,ta,Ba,E,G,Ca;
|
||||
function Da(){var a=pa.buffer;Aa=a;d.HEAP8=D=new Int8Array(a);d.HEAP16=Ba=new Int16Array(a);d.HEAP32=E=new Int32Array(a);d.HEAPU8=ta=new Uint8Array(a);d.HEAPU16=new Uint16Array(a);d.HEAPU32=G=new Uint32Array(a);d.HEAPF32=new Float32Array(a);d.HEAPF64=new Float64Array(a);d.HEAP64=Ca=new BigInt64Array(a);d.HEAPU64=new BigUint64Array(a)}var Ea,Fa=[],Ga=[],Ha=[],Ia=[],H=0,Ja=null,Ka=null;function La(){H--;if(0==H&&(null!==Ja&&(clearInterval(Ja),Ja=null),Ka)){var a=Ka;Ka=null;a()}}
|
||||
function A(a){a="Aborted("+a+")";v(a);qa=!0;ra=1;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ba(a);throw a;}function Ma(){return K.startsWith("data:application/octet-stream;base64,")}var K;K="qpdf.wasm";if(!Ma()){var Na=K;K=d.locateFile?d.locateFile(Na,q):q+Na}function Oa(){var a=K;try{if(la)return la(a);throw"both async and sync fetching of the wasm failed";}catch(b){A(b)}}
|
||||
function Pa(){if(ha||m){if("function"==typeof fetch&&!K.startsWith("file://"))return fetch(K,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+K+"'";return a.arrayBuffer()}).catch(function(){return Oa()});if(ka)return new Promise(function(a,b){ka(K,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Oa()})}
|
||||
function Qa(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b(d);else{var c=b.ld;"number"==typeof c?void 0===b.vb?L(c)():L(c)(b.vb):c(void 0===b.vb?null:b.vb)}}}function L(a){return Ea.get(a)}var Ra=[],Sa=0,M=0;
|
||||
function N(a){this.eb=a;this.ta=a-24;this.ed=function(b){G[this.ta+4>>2]=b};this.Ia=function(){return G[this.ta+4>>2]};this.Yc=function(b){G[this.ta+8>>2]=b};this.Gc=function(){return G[this.ta+8>>2]};this.cd=function(){E[this.ta>>2]=0};this.Nb=function(b){D[this.ta+12>>0]=b?1:0};this.Tc=function(){return 0!=D[this.ta+12>>0]};this.Ob=function(b){D[this.ta+13>>0]=b?1:0};this.fc=function(){return 0!=D[this.ta+13>>0]};this.Ma=function(b,c){this.Ya(0);this.ed(b);this.Yc(c);this.cd();this.Nb(!1);this.Ob(!1)};
|
||||
this.Oc=function(){E[this.ta>>2]+=1};this.Uc=function(){var b=E[this.ta>>2];E[this.ta>>2]=b-1;return 1===b};this.Ya=function(b){G[this.ta+16>>2]=b};this.Sc=function(){return G[this.ta+16>>2]};this.Wc=function(){if(Ta(this.Ia()))return G[this.eb>>2];var b=this.Sc();return 0!==b?b:this.eb}}function Ua(a){return Va((new N(a)).ta)}
|
||||
var Wa=(a,b)=>{for(var c=0,e=a.length-1;0<=e;e--){var f=a[e];"."===f?a.splice(e,1):".."===f?(a.splice(e,1),c++):c&&(a.splice(e,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},O=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=Wa(a.split("/").filter(e=>!!e),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},Xa=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},P=a=>{if("/"===
|
||||
a)return"/";a=O(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)};function Ya(){var a=Array.prototype.slice.call(arguments,0);return O(a.join("/"))}var Q=(a,b)=>O(a+"/"+b);function Za(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(ia)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(c){}return function(){A("randomDevice")}}
|
||||
function R(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:S.cwd();if("string"!=typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=Wa(a.split("/").filter(e=>!!e),!b).join("/");return(b?"/":"")+a||"."}
|
||||
var $a=(a,b)=>{function c(k){for(var l=0;l<k.length&&""===k[l];l++);for(var p=k.length-1;0<=p&&""===k[p];p--);return l>p?[]:k.slice(l,p-l+1)}a=R(a).substr(1);b=R(b).substr(1);a=c(a.split("/"));b=c(b.split("/"));for(var e=Math.min(a.length,b.length),f=e,g=0;g<e;g++)if(a[g]!==b[g]){f=g;break}e=[];for(g=f;g<a.length;g++)e.push("..");e=e.concat(b.slice(f));return e.join("/")},ab=[];function bb(a,b){ab[a]={input:[],output:[],Za:b};S.Mb(a,cb)}
|
||||
var cb={open:function(a){var b=ab[a.node.rdev];if(!b)throw new S.na(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.Za.flush(a.tty)},flush:function(a){a.tty.Za.flush(a.tty)},read:function(a,b,c,e){if(!a.tty||!a.tty.Za.ec)throw new S.na(60);for(var f=0,g=0;g<e;g++){try{var k=a.tty.Za.ec(a.tty)}catch(l){throw new S.na(29);}if(void 0===k&&0===f)throw new S.na(6);if(null===k||void 0===k)break;f++;b[c+g]=k}f&&(a.node.timestamp=Date.now());return f},write:function(a,b,c,e){if(!a.tty||!a.tty.Za.Ib)throw new S.na(60);
|
||||
try{for(var f=0;f<e;f++)a.tty.Za.Ib(a.tty,b[c+f])}catch(g){throw new S.na(29);}e&&(a.node.timestamp=Date.now());return f}},eb={ec:function(a){if(!a.input.length){var b=null;if(ia){var c=Buffer.alloc(256),e=0;try{e=fs.readSync(process.stdin.fd,c,0,256,-1)}catch(f){if(f.toString().includes("EOF"))e=0;else throw f;}0<e?b=c.slice(0,e).toString("utf-8"):b=null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),null!==b&&(b+="\n")):"function"==typeof readline&&
|
||||
(b=readline(),null!==b&&(b+="\n"));if(!b)return null;a.input=db(b,!0)}return a.input.shift()},Ib:function(a,b){null===b||10===b?(oa(B(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(oa(B(a.output,0)),a.output=[])}},fb={Ib:function(a,b){null===b||10===b?(v(B(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(v(B(a.output,0)),a.output=[])}},T={Fa:null,ra:function(){return T.createNode(null,"/",16895,0)},
|
||||
createNode:function(a,b,c,e){if(S.Hc(c)||S.isFIFO(c))throw new S.na(63);T.Fa||(T.Fa={dir:{node:{za:T.oa.za,wa:T.oa.wa,lookup:T.oa.lookup,Ca:T.oa.Ca,rename:T.oa.rename,unlink:T.oa.unlink,rmdir:T.oa.rmdir,readdir:T.oa.readdir,symlink:T.oa.symlink},stream:{Aa:T.qa.Aa}},file:{node:{za:T.oa.za,wa:T.oa.wa},stream:{Aa:T.qa.Aa,read:T.qa.read,write:T.qa.write,cb:T.qa.cb,Wa:T.qa.Wa,Xa:T.qa.Xa}},link:{node:{za:T.oa.za,wa:T.oa.wa,readlink:T.oa.readlink},stream:{}},Ub:{node:{za:T.oa.za,wa:T.oa.wa},stream:S.tc}});
|
||||
c=S.createNode(a,b,c,e);S.va(c.mode)?(c.oa=T.Fa.dir.node,c.qa=T.Fa.dir.stream,c.pa={}):S.isFile(c.mode)?(c.oa=T.Fa.file.node,c.qa=T.Fa.file.stream,c.ua=0,c.pa=null):S.Va(c.mode)?(c.oa=T.Fa.link.node,c.qa=T.Fa.link.stream):S.jb(c.mode)&&(c.oa=T.Fa.Ub.node,c.qa=T.Fa.Ub.stream);c.timestamp=Date.now();a&&(a.pa[b]=c,a.timestamp=c.timestamp);return c},nd:function(a){return a.pa?a.pa.subarray?a.pa.subarray(0,a.ua):new Uint8Array(a.pa):new Uint8Array(0)},$b:function(a,b){var c=a.pa?a.pa.length:0;c>=b||(b=
|
||||
Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.pa,a.pa=new Uint8Array(b),0<a.ua&&a.pa.set(c.subarray(0,a.ua),0))},Vc:function(a,b){if(a.ua!=b)if(0==b)a.pa=null,a.ua=0;else{var c=a.pa;a.pa=new Uint8Array(b);c&&a.pa.set(c.subarray(0,Math.min(b,a.ua)));a.ua=b}},oa:{za:function(a){var b={};b.dev=S.jb(a.mode)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;S.va(a.mode)?b.size=4096:S.isFile(a.mode)?b.size=a.ua:S.Va(a.mode)?b.size=a.link.length:b.size=0;b.atime=
|
||||
new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.Ja=4096;b.blocks=Math.ceil(b.size/b.Ja);return b},wa:function(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);void 0!==b.size&&T.Vc(a,b.size)},lookup:function(){throw S.yb[44];},Ca:function(a,b,c,e){return T.createNode(a,b,c,e)},rename:function(a,b,c){if(S.va(a.mode)){try{var e=S.Ha(b,c)}catch(g){}if(e)for(var f in e.pa)throw new S.na(55);}delete a.parent.pa[a.name];a.parent.timestamp=
|
||||
Date.now();a.name=c;b.pa[c]=a;b.timestamp=a.parent.timestamp;a.parent=b},unlink:function(a,b){delete a.pa[b];a.timestamp=Date.now()},rmdir:function(a,b){var c=S.Ha(a,b),e;for(e in c.pa)throw new S.na(55);delete a.pa[b];a.timestamp=Date.now()},readdir:function(a){var b=[".",".."],c;for(c in a.pa)a.pa.hasOwnProperty(c)&&b.push(c);return b},symlink:function(a,b,c){a=T.createNode(a,b,41471,0);a.link=c;return a},readlink:function(a){if(!S.Va(a.mode))throw new S.na(28);return a.link}},qa:{read:function(a,
|
||||
b,c,e,f){var g=a.node.pa;if(f>=a.node.ua)return 0;a=Math.min(a.node.ua-f,e);if(8<a&&g.subarray)b.set(g.subarray(f,f+a),c);else for(e=0;e<a;e++)b[c+e]=g[f+e];return a},write:function(a,b,c,e,f,g){b.buffer===D.buffer&&(g=!1);if(!e)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.pa||a.pa.subarray)){if(g)return a.pa=b.subarray(c,c+e),a.ua=e;if(0===a.ua&&0===f)return a.pa=b.slice(c,c+e),a.ua=e;if(f+e<=a.ua)return a.pa.set(b.subarray(c,c+e),f),e}T.$b(a,f+e);if(a.pa.subarray&&b.subarray)a.pa.set(b.subarray(c,
|
||||
c+e),f);else for(g=0;g<e;g++)a.pa[f+g]=b[c+g];a.ua=Math.max(a.ua,f+e);return e},Aa:function(a,b,c){1===c?b+=a.position:2===c&&S.isFile(a.node.mode)&&(b+=a.node.ua);if(0>b)throw new S.na(28);return b},cb:function(a,b,c){T.$b(a.node,b+c);a.node.ua=Math.max(a.node.ua,b+c)},Wa:function(a,b,c,e,f,g){if(0!==b)throw new S.na(28);if(!S.isFile(a.node.mode))throw new S.na(43);a=a.node.pa;if(g&2||a.buffer!==Aa){if(0<e||e+c<a.length)a.subarray?a=a.subarray(e,e+c):a=Array.prototype.slice.call(a,e,e+c);e=!0;A();
|
||||
c=void 0;if(!c)throw new S.na(48);D.set(a,c)}else e=!1,c=a.byteOffset;return{ta:c,qc:e}},Xa:function(a,b,c,e,f){if(!S.isFile(a.node.mode))throw new S.na(43);if(f&2)return 0;T.qa.write(a,b,0,e,c,!1);return 0}}};function gb(a,b,c){var e="al "+a;ka(a,function(f){f||A('Loading data file "'+a+'" failed (no arrayBuffer).');b(new Uint8Array(f));e&&La()},function(){if(c)c();else throw'Loading data file "'+a+'" failed.';});e&&H++}
|
||||
var hb={},U={lb:!1,Pb:()=>{U.lb=!!process.platform.match(/^win/);var a=process.binding("constants");a.fs&&(a=a.fs);U.ac={1024:a.O_APPEND,64:a.O_CREAT,128:a.O_EXCL,256:a.O_NOCTTY,0:a.O_RDONLY,2:a.O_RDWR,4096:a.O_SYNC,512:a.O_TRUNC,1:a.O_WRONLY,131072:a.O_NOFOLLOW}},xa:a=>hb[a.code],ra:a=>U.createNode(null,"/",U.Ta(a.$a.root),0),createNode:(a,b,c)=>{if(!S.va(c)&&!S.isFile(c)&&!S.Va(c))throw new S.na(28);a=S.createNode(a,b,c);a.oa=U.oa;a.qa=U.qa;return a},Ta:a=>{try{var b=fs.lstatSync(a);U.lb&&(b.mode=
|
||||
b.mode|(b.mode&292)>>2)}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}return b.mode},Ba:a=>{for(var b=[];a.parent!==a;)b.push(a.name),a=a.parent;b.push(a.ra.$a.root);b.reverse();return Ya.apply(null,b)},Ec:a=>{a&=-2721793;var b=0,c;for(c in U.ac)a&c&&(b|=U.ac[c],a^=c);if(a)throw new S.na(28);return b},oa:{za:a=>{a=U.Ba(a);try{var b=fs.lstatSync(a)}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}U.lb&&!b.Ja&&(b.Ja=4096);U.lb&&!b.blocks&&(b.blocks=(b.size+b.Ja-1)/b.Ja|0);return{dev:b.dev,
|
||||
ino:b.ino,mode:b.mode,nlink:b.nlink,uid:b.uid,gid:b.gid,rdev:b.rdev,size:b.size,atime:b.atime,mtime:b.mtime,ctime:b.ctime,Ja:b.Ja,blocks:b.blocks}},wa:(a,b)=>{var c=U.Ba(a);try{void 0!==b.mode&&(fs.chmodSync(c,b.mode),a.mode=b.mode),void 0!==b.size&&fs.truncateSync(c,b.size)}catch(e){if(!e.code)throw e;throw new S.na(U.xa(e));}},lookup:(a,b)=>{var c=Q(U.Ba(a),b);c=U.Ta(c);return U.createNode(a,b,c)},Ca:(a,b,c,e)=>{a=U.createNode(a,b,c,e);b=U.Ba(a);try{S.va(a.mode)?fs.mkdirSync(b,a.mode):fs.writeFileSync(b,
|
||||
"",{mode:a.mode})}catch(f){if(!f.code)throw f;throw new S.na(U.xa(f));}return a},rename:(a,b,c)=>{var e=U.Ba(a);b=Q(U.Ba(b),c);try{fs.renameSync(e,b)}catch(f){if(!f.code)throw f;throw new S.na(U.xa(f));}a.name=c},unlink:(a,b)=>{a=Q(U.Ba(a),b);try{fs.unlinkSync(a)}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}},rmdir:(a,b)=>{a=Q(U.Ba(a),b);try{fs.rmdirSync(a)}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}},readdir:a=>{a=U.Ba(a);try{return fs.readdirSync(a)}catch(b){if(!b.code)throw b;
|
||||
throw new S.na(U.xa(b));}},symlink:(a,b,c)=>{a=Q(U.Ba(a),b);try{fs.symlinkSync(c,a)}catch(e){if(!e.code)throw e;throw new S.na(U.xa(e));}},readlink:a=>{var b=U.Ba(a);try{return b=fs.readlinkSync(b),b=t.relative(t.resolve(a.ra.$a.root),b)}catch(c){if(!c.code)throw c;if("UNKNOWN"===c.code)throw new S.na(28);throw new S.na(U.xa(c));}}},qa:{open:a=>{var b=U.Ba(a.node);try{S.isFile(a.node.mode)&&(a.ib=fs.openSync(b,U.Ec(a.flags)))}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}},close:a=>{try{S.isFile(a.node.mode)&&
|
||||
a.ib&&fs.closeSync(a.ib)}catch(b){if(!b.code)throw b;throw new S.na(U.xa(b));}},read:(a,b,c,e,f)=>{if(0===e)return 0;try{return fs.readSync(a.ib,Buffer.from(b.buffer),c,e,f)}catch(g){throw new S.na(U.xa(g));}},write:(a,b,c,e,f)=>{try{return fs.writeSync(a.ib,Buffer.from(b.buffer),c,e,f)}catch(g){throw new S.na(U.xa(g));}},Aa:(a,b,c)=>{if(1===c)b+=a.position;else if(2===c&&S.isFile(a.node.mode))try{b+=fs.fstatSync(a.ib).size}catch(e){throw new S.na(U.xa(e));}if(0>b)throw new S.na(28);return b},Wa:(a,
|
||||
b,c,e)=>{if(0!==b)throw new S.na(28);if(!S.isFile(a.node.mode))throw new S.na(43);A();U.qa.read(a,D,void 0,c,e);return{ta:void 0,qc:!0}},Xa:(a,b,c,e,f)=>{if(!S.isFile(a.node.mode))throw new S.na(43);if(f&2)return 0;U.qa.write(a,b,0,e,c,!1);return 0}}},V={sb:16895,bb:33279,Kb:null,ra:function(a){function b(g){g=g.split("/");for(var k=e,l=0;l<g.length-1;l++){var p=g.slice(0,l+1).join("/");f[p]||(f[p]=V.createNode(k,g[l],V.sb,0));k=f[p]}return k}function c(g){g=g.split("/");return g[g.length-1]}m||A();
|
||||
V.Kb||(V.Kb=new FileReaderSync);var e=V.createNode(null,"/",V.sb,0),f={};Array.prototype.forEach.call(a.$a.files||[],function(g){V.createNode(b(g.name),c(g.name),V.bb,0,g,g.lastModifiedDate)});(a.$a.blobs||[]).forEach(function(g){V.createNode(b(g.name),c(g.name),V.bb,0,g.data)});(a.$a.packages||[]).forEach(function(g){g.metadata.files.forEach(function(k){var l=k.filename.substr(1);V.createNode(b(l),c(l),V.bb,0,g.blob.slice(k.start,k.end))})});return e},createNode:function(a,b,c,e,f,g){e=S.createNode(a,
|
||||
b,c);e.mode=c;e.oa=V.oa;e.qa=V.qa;e.timestamp=(g||new Date).getTime();V.bb!==V.sb||A();c===V.bb?(e.size=f.size,e.pa=f):(e.size=4096,e.pa={});a&&(a.pa[b]=e);return e},oa:{za:function(a){return{dev:1,ino:a.id,mode:a.mode,nlink:1,uid:0,gid:0,rdev:void 0,size:a.size,atime:new Date(a.timestamp),mtime:new Date(a.timestamp),ctime:new Date(a.timestamp),Ja:4096,blocks:Math.ceil(a.size/4096)}},wa:function(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp)},lookup:function(){throw new S.na(44);
|
||||
},Ca:function(){throw new S.na(63);},rename:function(){throw new S.na(63);},unlink:function(){throw new S.na(63);},rmdir:function(){throw new S.na(63);},readdir:function(a){var b=[".",".."],c;for(c in a.pa)a.pa.hasOwnProperty(c)&&b.push(c);return b},symlink:function(){throw new S.na(63);},readlink:function(){throw new S.na(63);}},qa:{read:function(a,b,c,e,f){if(f>=a.node.size)return 0;a=a.node.pa.slice(f,f+e);e=V.Kb.readAsArrayBuffer(a);b.set(new Uint8Array(e),c);return a.size},write:function(){throw new S.na(29);
|
||||
},Aa:function(a,b,c){1===c?b+=a.position:2===c&&S.isFile(a.node.mode)&&(b+=a.node.size);if(0>b)throw new S.na(28);return b}}},S={root:null,hb:[],Yb:{},streams:[],Mc:1,Ea:null,Xb:"/",Cb:!1,Bb:!0,na:null,yb:{},Cc:null,pb:0,sa:(a,b={})=>{a=R(S.cwd(),a);if(!a)return{path:"",node:null};b=Object.assign({xb:!0,Lb:0},b);if(8<b.Lb)throw new S.na(32);a=Wa(a.split("/").filter(k=>!!k),!1);for(var c=S.root,e="/",f=0;f<a.length;f++){var g=f===a.length-1;if(g&&b.parent)break;c=S.Ha(c,a[f]);e=O(e+"/"+a[f]);S.Na(c)&&
|
||||
(!g||g&&b.xb)&&(c=c.gb.root);if(!g||b.Da)for(g=0;S.Va(c.mode);)if(c=S.readlink(e),e=R(Xa(e),c),c=S.sa(e,{Lb:b.Lb+1}).node,40<g++)throw new S.na(32);}return{path:e,node:c}},La:a=>{for(var b;;){if(S.kb(a))return a=a.ra.kc,b?"/"!==a[a.length-1]?a+"/"+b:a+b:a;b=b?a.name+"/"+b:a.name;a=a.parent}},Ab:(a,b)=>{for(var c=0,e=0;e<b.length;e++)c=(c<<5)-c+b.charCodeAt(e)|0;return(a+c>>>0)%S.Ea.length},ic:a=>{var b=S.Ab(a.parent.id,a.name);a.Pa=S.Ea[b];S.Ea[b]=a},jc:a=>{var b=S.Ab(a.parent.id,a.name);if(S.Ea[b]===
|
||||
a)S.Ea[b]=a.Pa;else for(b=S.Ea[b];b;){if(b.Pa===a){b.Pa=a.Pa;break}b=b.Pa}},Ha:(a,b)=>{var c=S.Jc(a);if(c)throw new S.na(c,a);for(c=S.Ea[S.Ab(a.id,b)];c;c=c.Pa){var e=c.name;if(c.parent.id===a.id&&e===b)return c}return S.lookup(a,b)},createNode:(a,b,c,e)=>{a=new S.mc(a,b,c,e);S.ic(a);return a},wb:a=>{S.jc(a)},kb:a=>a===a.parent,Na:a=>!!a.gb,isFile:a=>32768===(a&61440),va:a=>16384===(a&61440),Va:a=>40960===(a&61440),jb:a=>8192===(a&61440),Hc:a=>24576===(a&61440),isFIFO:a=>4096===(a&61440),isSocket:a=>
|
||||
49152===(a&49152),Dc:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Lc:a=>{var b=S.Dc[a];if("undefined"==typeof b)throw Error("Unknown file open mode: "+a);return b},bc:a=>{var b=["r","w","rw"][a&3];a&512&&(b+="w");return b},Qa:(a,b)=>{if(S.Bb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0},Jc:a=>{var b=S.Qa(a,"x");return b?b:a.oa.lookup?0:2},Hb:(a,b)=>{try{return S.Ha(a,b),20}catch(c){}return S.Qa(a,"wx")},
|
||||
mb:(a,b,c)=>{try{var e=S.Ha(a,b)}catch(f){return f.ya}if(a=S.Qa(a,"wx"))return a;if(c){if(!S.va(e.mode))return 54;if(S.kb(e)||S.La(e)===S.cwd())return 10}else if(S.va(e.mode))return 31;return 0},Kc:(a,b)=>a?S.Va(a.mode)?32:S.va(a.mode)&&("r"!==S.bc(b)||b&512)?31:S.Qa(a,S.bc(b)):44,nc:4096,Nc:(a=0,b=S.nc)=>{for(;a<=b;a++)if(!S.streams[a])return a;throw new S.na(33);},Ua:a=>S.streams[a],Wb:(a,b,c)=>{S.tb||(S.tb=function(){this.ob={}},S.tb.prototype={object:{get:function(){return this.node},set:function(e){this.node=
|
||||
e}},flags:{get:function(){return this.ob.flags},set:function(e){this.ob.flags=e}},position:{get md(){return this.ob.position},set:function(e){this.ob.position=e}}});a=Object.assign(new S.tb,a);b=S.Nc(b,c);a.fd=b;return S.streams[b]=a},uc:a=>{S.streams[a]=null},tc:{open:a=>{a.qa=S.Fc(a.node.rdev).qa;a.qa.open&&a.qa.open(a)},Aa:()=>{throw new S.na(70);}},Gb:a=>a>>8,qd:a=>a&255,Oa:(a,b)=>a<<8|b,Mb:(a,b)=>{S.Yb[a]={qa:b}},Fc:a=>S.Yb[a],dc:a=>{var b=[];for(a=[a];a.length;){var c=a.pop();b.push(c);a.push.apply(a,
|
||||
c.hb)}return b},lc:(a,b)=>{function c(k){S.pb--;return b(k)}function e(k){if(k){if(!e.Bc)return e.Bc=!0,c(k)}else++g>=f.length&&c(null)}"function"==typeof a&&(b=a,a=!1);S.pb++;1<S.pb&&v("warning: "+S.pb+" FS.syncfs operations in flight at once, probably just doing extra work");var f=S.dc(S.root.ra),g=0;f.forEach(k=>{if(!k.type.lc)return e(null);k.type.lc(k,a,e)})},ra:(a,b,c)=>{var e="/"===c,f=!c;if(e&&S.root)throw new S.na(10);if(!e&&!f){var g=S.sa(c,{xb:!1});c=g.path;g=g.node;if(S.Na(g))throw new S.na(10);
|
||||
if(!S.va(g.mode))throw new S.na(54);}b={type:a,$a:b,kc:c,hb:[]};a=a.ra(b);a.ra=b;b.root=a;e?S.root=a:g&&(g.gb=b,g.ra&&g.ra.hb.push(b));return a},wd:a=>{a=S.sa(a,{xb:!1});if(!S.Na(a.node))throw new S.na(28);a=a.node;var b=a.gb,c=S.dc(b);Object.keys(S.Ea).forEach(e=>{for(e=S.Ea[e];e;){var f=e.Pa;c.includes(e.ra)&&S.wb(e);e=f}});a.gb=null;a.ra.hb.splice(a.ra.hb.indexOf(b),1)},lookup:(a,b)=>a.oa.lookup(a,b),Ca:(a,b,c)=>{var e=S.sa(a,{parent:!0}).node;a=P(a);if(!a||"."===a||".."===a)throw new S.na(28);
|
||||
var f=S.Hb(e,a);if(f)throw new S.na(f);if(!e.oa.Ca)throw new S.na(63);return e.oa.Ca(e,a,b,c)},create:(a,b)=>S.Ca(a,(void 0!==b?b:438)&4095|32768,0),mkdir:(a,b)=>S.Ca(a,(void 0!==b?b:511)&1023|16384,0),rd:(a,b)=>{a=a.split("/");for(var c="",e=0;e<a.length;++e)if(a[e]){c+="/"+a[e];try{S.mkdir(c,b)}catch(f){if(20!=f.ya)throw f;}}},nb:(a,b,c)=>{"undefined"==typeof c&&(c=b,b=438);return S.Ca(a,b|8192,c)},symlink:(a,b)=>{if(!R(a))throw new S.na(44);var c=S.sa(b,{parent:!0}).node;if(!c)throw new S.na(44);
|
||||
b=P(b);var e=S.Hb(c,b);if(e)throw new S.na(e);if(!c.oa.symlink)throw new S.na(63);return c.oa.symlink(c,b,a)},rename:(a,b)=>{var c=Xa(a),e=Xa(b),f=P(a),g=P(b);var k=S.sa(a,{parent:!0});var l=k.node;k=S.sa(b,{parent:!0});k=k.node;if(!l||!k)throw new S.na(44);if(l.ra!==k.ra)throw new S.na(75);var p=S.Ha(l,f);a=$a(a,e);if("."!==a.charAt(0))throw new S.na(28);a=$a(b,c);if("."!==a.charAt(0))throw new S.na(55);try{var n=S.Ha(k,g)}catch(r){}if(p!==n){b=S.va(p.mode);if(f=S.mb(l,f,b))throw new S.na(f);if(f=
|
||||
n?S.mb(k,g,b):S.Hb(k,g))throw new S.na(f);if(!l.oa.rename)throw new S.na(63);if(S.Na(p)||n&&S.Na(n))throw new S.na(10);if(k!==l&&(f=S.Qa(l,"w")))throw new S.na(f);S.jc(p);try{l.oa.rename(p,k,g)}catch(r){throw r;}finally{S.ic(p)}}},rmdir:a=>{var b=S.sa(a,{parent:!0}).node;a=P(a);var c=S.Ha(b,a),e=S.mb(b,a,!0);if(e)throw new S.na(e);if(!b.oa.rmdir)throw new S.na(63);if(S.Na(c))throw new S.na(10);b.oa.rmdir(b,a);S.wb(c)},readdir:a=>{a=S.sa(a,{Da:!0}).node;if(!a.oa.readdir)throw new S.na(54);return a.oa.readdir(a)},
|
||||
unlink:a=>{var b=S.sa(a,{parent:!0}).node;if(!b)throw new S.na(44);a=P(a);var c=S.Ha(b,a),e=S.mb(b,a,!1);if(e)throw new S.na(e);if(!b.oa.unlink)throw new S.na(63);if(S.Na(c))throw new S.na(10);b.oa.unlink(b,a);S.wb(c)},readlink:a=>{a=S.sa(a).node;if(!a)throw new S.na(44);if(!a.oa.readlink)throw new S.na(28);return R(S.La(a.parent),a.oa.readlink(a))},stat:(a,b)=>{a=S.sa(a,{Da:!b}).node;if(!a)throw new S.na(44);if(!a.oa.za)throw new S.na(63);return a.oa.za(a)},lstat:a=>S.stat(a,!0),chmod:(a,b,c)=>{a=
|
||||
"string"==typeof a?S.sa(a,{Da:!c}).node:a;if(!a.oa.wa)throw new S.na(63);a.oa.wa(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})},lchmod:(a,b)=>{S.chmod(a,b,!0)},fchmod:(a,b)=>{a=S.Ua(a);if(!a)throw new S.na(8);S.chmod(a.node,b)},chown:(a,b,c,e)=>{a="string"==typeof a?S.sa(a,{Da:!e}).node:a;if(!a.oa.wa)throw new S.na(63);a.oa.wa(a,{timestamp:Date.now()})},lchown:(a,b,c)=>{S.chown(a,b,c,!0)},fchown:(a,b,c)=>{a=S.Ua(a);if(!a)throw new S.na(8);S.chown(a.node,b,c)},truncate:(a,b)=>{if(0>b)throw new S.na(28);
|
||||
a="string"==typeof a?S.sa(a,{Da:!0}).node:a;if(!a.oa.wa)throw new S.na(63);if(S.va(a.mode))throw new S.na(31);if(!S.isFile(a.mode))throw new S.na(28);var c=S.Qa(a,"w");if(c)throw new S.na(c);a.oa.wa(a,{size:b,timestamp:Date.now()})},kd:(a,b)=>{a=S.Ua(a);if(!a)throw new S.na(8);if(0===(a.flags&2097155))throw new S.na(28);S.truncate(a.node,b)},xd:(a,b,c)=>{a=S.sa(a,{Da:!0}).node;a.oa.wa(a,{timestamp:Math.max(b,c)})},open:(a,b,c)=>{if(""===a)throw new S.na(44);b="string"==typeof b?S.Lc(b):b;c=b&64?("undefined"==
|
||||
typeof c?438:c)&4095|32768:0;if("object"==typeof a)var e=a;else{a=O(a);try{e=S.sa(a,{Da:!(b&131072)}).node}catch(g){}}var f=!1;if(b&64)if(e){if(b&128)throw new S.na(20);}else e=S.Ca(a,c,0),f=!0;if(!e)throw new S.na(44);S.jb(e.mode)&&(b&=-513);if(b&65536&&!S.va(e.mode))throw new S.na(54);if(!f&&(c=S.Kc(e,b)))throw new S.na(c);b&512&&!f&&S.truncate(e,0);b&=-131713;e=S.Wb({node:e,path:S.La(e),flags:b,seekable:!0,position:0,qa:e.qa,dd:[],error:!1});e.qa.open&&e.qa.open(e);!d.logReadFiles||b&1||(S.Jb||
|
||||
(S.Jb={}),a in S.Jb||(S.Jb[a]=1));return e},close:a=>{if(S.fb(a))throw new S.na(8);a.zb&&(a.zb=null);try{a.qa.close&&a.qa.close(a)}catch(b){throw b;}finally{S.uc(a.fd)}a.fd=null},fb:a=>null===a.fd,Aa:(a,b,c)=>{if(S.fb(a))throw new S.na(8);if(!a.seekable||!a.qa.Aa)throw new S.na(70);if(0!=c&&1!=c&&2!=c)throw new S.na(28);a.position=a.qa.Aa(a,b,c);a.dd=[];return a.position},read:(a,b,c,e,f)=>{if(0>e||0>f)throw new S.na(28);if(S.fb(a))throw new S.na(8);if(1===(a.flags&2097155))throw new S.na(8);if(S.va(a.node.mode))throw new S.na(31);
|
||||
if(!a.qa.read)throw new S.na(28);var g="undefined"!=typeof f;if(!g)f=a.position;else if(!a.seekable)throw new S.na(70);b=a.qa.read(a,b,c,e,f);g||(a.position+=b);return b},write:(a,b,c,e,f,g)=>{if(0>e||0>f)throw new S.na(28);if(S.fb(a))throw new S.na(8);if(0===(a.flags&2097155))throw new S.na(8);if(S.va(a.node.mode))throw new S.na(31);if(!a.qa.write)throw new S.na(28);a.seekable&&a.flags&1024&&S.Aa(a,0,2);var k="undefined"!=typeof f;if(!k)f=a.position;else if(!a.seekable)throw new S.na(70);b=a.qa.write(a,
|
||||
b,c,e,f,g);k||(a.position+=b);return b},cb:(a,b,c)=>{if(S.fb(a))throw new S.na(8);if(0>b||0>=c)throw new S.na(28);if(0===(a.flags&2097155))throw new S.na(8);if(!S.isFile(a.node.mode)&&!S.va(a.node.mode))throw new S.na(43);if(!a.qa.cb)throw new S.na(138);a.qa.cb(a,b,c)},Wa:(a,b,c,e,f,g)=>{if(0!==(f&2)&&0===(g&2)&&2!==(a.flags&2097155))throw new S.na(2);if(1===(a.flags&2097155))throw new S.na(2);if(!a.qa.Wa)throw new S.na(43);return a.qa.Wa(a,b,c,e,f,g)},Xa:(a,b,c,e,f)=>a&&a.qa.Xa?a.qa.Xa(a,b,c,e,f):
|
||||
0,sd:()=>0,Db:(a,b,c)=>{if(!a.qa.Db)throw new S.na(59);return a.qa.Db(a,b,c)},readFile:(a,b={})=>{b.flags=b.flags||0;b.encoding=b.encoding||"binary";if("utf8"!==b.encoding&&"binary"!==b.encoding)throw Error('Invalid encoding type "'+b.encoding+'"');var c,e=S.open(a,b.flags);a=S.stat(a).size;var f=new Uint8Array(a);S.read(e,f,0,a,0);"utf8"===b.encoding?c=B(f,0):"binary"===b.encoding&&(c=f);S.close(e);return c},writeFile:(a,b,c={})=>{c.flags=c.flags||577;a=S.open(a,c.flags,c.mode);if("string"==typeof b){var e=
|
||||
new Uint8Array(va(b)+1);b=ua(b,e,0,e.length);S.write(a,e,0,b,void 0,c.sc)}else if(ArrayBuffer.isView(b))S.write(a,b,0,b.byteLength,void 0,c.sc);else throw Error("Unsupported data type");S.close(a)},cwd:()=>S.Xb,chdir:a=>{a=S.sa(a,{Da:!0});if(null===a.node)throw new S.na(44);if(!S.va(a.node.mode))throw new S.na(54);var b=S.Qa(a.node,"x");if(b)throw new S.na(b);S.Xb=a.path},wc:()=>{S.mkdir("/tmp");S.mkdir("/home");S.mkdir("/home/web_user")},vc:()=>{S.mkdir("/dev");S.Mb(S.Oa(1,3),{read:()=>0,write:(b,
|
||||
c,e,f)=>f});S.nb("/dev/null",S.Oa(1,3));bb(S.Oa(5,0),eb);bb(S.Oa(6,0),fb);S.nb("/dev/tty",S.Oa(5,0));S.nb("/dev/tty1",S.Oa(6,0));var a=Za();S.Ka("/dev","random",a);S.Ka("/dev","urandom",a);S.mkdir("/dev/shm");S.mkdir("/dev/shm/tmp")},zc:()=>{S.mkdir("/proc");var a=S.mkdir("/proc/self");S.mkdir("/proc/self/fd");S.ra({ra:()=>{var b=S.createNode(a,"fd",16895,73);b.oa={lookup:(c,e)=>{var f=S.Ua(+e);if(!f)throw new S.na(8);c={parent:null,ra:{kc:"fake"},oa:{readlink:()=>f.path}};return c.parent=c}};return b}},
|
||||
{},"/proc/self/fd")},Ac:()=>{d.stdin?S.Ka("/dev","stdin",d.stdin):S.symlink("/dev/tty","/dev/stdin");d.stdout?S.Ka("/dev","stdout",null,d.stdout):S.symlink("/dev/tty","/dev/stdout");d.stderr?S.Ka("/dev","stderr",null,d.stderr):S.symlink("/dev/tty1","/dev/stderr");S.open("/dev/stdin",0);S.open("/dev/stdout",1);S.open("/dev/stderr",1)},Zb:()=>{S.na||(S.na=function(a,b){this.node=b;this.Xc=function(c){this.ya=c};this.Xc(a);this.message="FS error"},S.na.prototype=Error(),S.na.prototype.constructor=S.na,
|
||||
[44].forEach(a=>{S.yb[a]=new S.na(a);S.yb[a].stack="<generic error, no stack>"}))},Pb:()=>{S.Zb();S.Ea=Array(4096);S.ra(T,{},"/");S.wc();S.vc();S.zc();S.Cc={MEMFS:T,NODEFS:U,WORKERFS:V}},Ma:(a,b,c)=>{S.Ma.Cb=!0;S.Zb();d.stdin=a||d.stdin;d.stdout=b||d.stdout;d.stderr=c||d.stderr;S.Ac()},td:()=>{S.Ma.Cb=!1;for(var a=0;a<S.streams.length;a++){var b=S.streams[a];b&&S.close(b)}},Ta:(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},jd:(a,b)=>{a=S.ub(a,b);return a.exists?a.object:null},ub:(a,b)=>{try{var c=
|
||||
S.sa(a,{Da:!b});a=c.path}catch(f){}var e={kb:!1,exists:!1,error:0,name:null,path:null,object:null,Pc:!1,Rc:null,Qc:null};try{c=S.sa(a,{parent:!0}),e.Pc=!0,e.Rc=c.path,e.Qc=c.node,e.name=P(a),c=S.sa(a,{Da:!b}),e.exists=!0,e.path=c.path,e.object=c.node,e.name=c.node.name,e.kb="/"===c.path}catch(f){e.error=f.ya}return e},gd:(a,b)=>{a="string"==typeof a?a:S.La(a);for(b=b.split("/").reverse();b.length;){var c=b.pop();if(c){var e=O(a+"/"+c);try{S.mkdir(e)}catch(f){}a=e}}return e},xc:(a,b,c,e,f)=>{a=Q("string"==
|
||||
typeof a?a:S.La(a),b);e=S.Ta(e,f);return S.create(a,e)},Vb:(a,b,c,e,f,g)=>{var k=b;a&&(a="string"==typeof a?a:S.La(a),k=b?O(a+"/"+b):a);a=S.Ta(e,f);k=S.create(k,a);if(c){if("string"==typeof c){b=Array(c.length);e=0;for(f=c.length;e<f;++e)b[e]=c.charCodeAt(e);c=b}S.chmod(k,a|146);b=S.open(k,577);S.write(b,c,0,c.length,0,g);S.close(b);S.chmod(k,a)}return k},Ka:(a,b,c,e)=>{a=Q("string"==typeof a?a:S.La(a),b);b=S.Ta(!!c,!!e);S.Ka.Gb||(S.Ka.Gb=64);var f=S.Oa(S.Ka.Gb++,0);S.Mb(f,{open:g=>{g.seekable=!1},
|
||||
close:()=>{e&&e.buffer&&e.buffer.length&&e(10)},read:(g,k,l,p)=>{for(var n=0,r=0;r<p;r++){try{var w=c()}catch(y){throw new S.na(29);}if(void 0===w&&0===n)throw new S.na(6);if(null===w||void 0===w)break;n++;k[l+r]=w}n&&(g.node.timestamp=Date.now());return n},write:(g,k,l,p)=>{for(var n=0;n<p;n++)try{e(k[l+n])}catch(r){throw new S.na(29);}p&&(g.node.timestamp=Date.now());return n}});return S.nb(a,b,f)},cc:a=>{if(a.Eb||a.Ic||a.link||a.pa)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
|
||||
if(ja)try{a.pa=db(ja(a.url),!0),a.ua=a.pa.length}catch(b){throw new S.na(29);}else throw Error("Cannot load without read() or XMLHttpRequest.");},yc:(a,b,c,e,f)=>{function g(){this.Fb=!1;this.Ia=[]}g.prototype.get=function(n){if(!(n>this.length-1||0>n)){var r=n%this.chunkSize;return this.hc(n/this.chunkSize|0)[r]}};g.prototype.Ya=function(n){this.hc=n};g.prototype.Tb=function(){var n=new XMLHttpRequest;n.open("HEAD",c,!1);n.send(null);if(!(200<=n.status&&300>n.status||304===n.status))throw Error("Couldn't load "+
|
||||
c+". Status: "+n.status);var r=Number(n.getResponseHeader("Content-length")),w,y=(w=n.getResponseHeader("Accept-Ranges"))&&"bytes"===w;n=(w=n.getResponseHeader("Content-Encoding"))&&"gzip"===w;var h=1048576;y||(h=r);var u=this;u.Ya(x=>{var F=x*h,I=(x+1)*h-1;I=Math.min(I,r-1);if("undefined"==typeof u.Ia[x]){var Ab=u.Ia;if(F>I)throw Error("invalid range ("+F+", "+I+") or no bytes requested!");if(I>r-1)throw Error("only "+r+" bytes available! programmer error!");var J=new XMLHttpRequest;J.open("GET",
|
||||
c,!1);r!==h&&J.setRequestHeader("Range","bytes="+F+"-"+I);J.responseType="arraybuffer";J.overrideMimeType&&J.overrideMimeType("text/plain; charset=x-user-defined");J.send(null);if(!(200<=J.status&&300>J.status||304===J.status))throw Error("Couldn't load "+c+". Status: "+J.status);F=void 0!==J.response?new Uint8Array(J.response||[]):db(J.responseText||"",!0);Ab[x]=F}if("undefined"==typeof u.Ia[x])throw Error("doXHR failed!");return u.Ia[x]});if(n||!r)h=r=1,h=r=this.hc(0).length,oa("LazyFiles on gzip forces download of the whole file when length is accessed");
|
||||
this.pc=r;this.oc=h;this.Fb=!0};if("undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var k=new g;Object.defineProperties(k,{length:{get:function(){this.Fb||this.Tb();return this.pc}},chunkSize:{get:function(){this.Fb||this.Tb();return this.oc}}});k={Eb:!1,pa:k}}else k={Eb:!1,url:c};var l=S.xc(a,b,k,e,f);k.pa?l.pa=k.pa:k.url&&(l.pa=null,l.url=k.url);Object.defineProperties(l,{ua:{get:function(){return this.pa.length}}});
|
||||
var p={};Object.keys(l.qa).forEach(n=>{var r=l.qa[n];p[n]=function(){S.cc(l);return r.apply(null,arguments)}});p.read=(n,r,w,y,h)=>{S.cc(l);n=n.node.pa;if(h>=n.length)return 0;y=Math.min(n.length-h,y);if(n.slice)for(var u=0;u<y;u++)r[w+u]=n[h+u];else for(u=0;u<y;u++)r[w+u]=n.get(h+u);return y};l.qa=p;return l},hd:(a,b,c,e,f,g,k,l,p,n)=>{function r(y){function h(u){n&&n();l||S.Vb(a,b,u,e,f,p);g&&g();La()}ib.od(y,w,h,()=>{k&&k();La()})||h(y)}var w=b?R(O(a+"/"+b)):a;H++;"string"==typeof c?gb(c,y=>r(y),
|
||||
k):r(c)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,Rb:()=>"EM_FS_"+window.location.pathname,Sb:20,ab:"FILE_DATA",ud:(a,b,c)=>{b=b||(()=>{});c=c||(()=>{});var e=S.indexedDB();try{var f=e.open(S.Rb(),S.Sb)}catch(g){return c(g)}f.onupgradeneeded=()=>{oa("creating db");f.result.createObjectStore(S.ab)};f.onsuccess=()=>{var g=f.result.transaction([S.ab],"readwrite"),k=g.objectStore(S.ab),l=0,p=0,n=a.length;a.forEach(r=>{r=k.put(S.ub(r).object.pa,r);
|
||||
r.onsuccess=()=>{l++;l+p==n&&(0==p?b():c())};r.onerror=()=>{p++;l+p==n&&(0==p?b():c())}});g.onerror=c};f.onerror=c},pd:(a,b,c)=>{b=b||(()=>{});c=c||(()=>{});var e=S.indexedDB();try{var f=e.open(S.Rb(),S.Sb)}catch(g){return c(g)}f.onupgradeneeded=c;f.onsuccess=()=>{var g=f.result;try{var k=g.transaction([S.ab],"readonly")}catch(w){c(w);return}var l=k.objectStore(S.ab),p=0,n=0,r=a.length;a.forEach(w=>{var y=l.get(w);y.onsuccess=()=>{S.ub(w).exists&&S.unlink(w);S.Vb(Xa(w),P(w),y.result,!0,!0,!0);p++;
|
||||
p+n==r&&(0==n?b():c())};y.onerror=()=>{n++;p+n==r&&(0==n?b():c())}});k.onerror=c};f.onerror=c}};function jb(a,b){if("/"===b.charAt(0))return b;if(-100===a)a=S.cwd();else{a=S.Ua(a);if(!a)throw new S.na(8);a=a.path}if(0==b.length)throw new S.na(44);return O(a+"/"+b)}var kb=void 0;function W(){kb+=4;return E[kb-4>>2]}function lb(a){a=S.Ua(a);if(!a)throw new S.na(8);return a}
|
||||
function mb(a,b,c){function e(p){return(p=p.toTimeString().match(/\(([A-Za-z ]+)\)$/))?p[1]:"GMT"}var f=(new Date).getFullYear(),g=new Date(f,0,1),k=new Date(f,6,1);f=g.getTimezoneOffset();var l=k.getTimezoneOffset();E[a>>2]=60*Math.max(f,l);E[b>>2]=Number(f!=l);a=e(g);b=e(k);a=wa(a);b=wa(b);l<f?(E[c>>2]=a,E[c+4>>2]=b):(E[c>>2]=b,E[c+4>>2]=a)}function nb(a,b,c){nb.rc||(nb.rc=!0,mb(a,b,c))}var ob={};
|
||||
function pb(){if(!qb){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ea||"./this.program"},b;for(b in ob)void 0===ob[b]?delete a[b]:a[b]=ob[b];var c=[];for(b in a)c.push(b+"="+a[b]);qb=c}return qb}var qb;function rb(a){return 0===a%4&&(0!==a%100||0===a%400)}var sb=[31,29,31,30,31,30,31,31,30,31,30,31],tb=[31,28,31,30,31,30,31,31,30,31,30,31];
|
||||
function ub(a,b,c,e){function f(h,u,x){for(h="number"==typeof h?h.toString():h||"";h.length<u;)h=x[0]+h;return h}function g(h,u){return f(h,u,"0")}function k(h,u){function x(I){return 0>I?-1:0<I?1:0}var F;0===(F=x(h.getFullYear()-u.getFullYear()))&&0===(F=x(h.getMonth()-u.getMonth()))&&(F=x(h.getDate()-u.getDate()));return F}function l(h){switch(h.getDay()){case 0:return new Date(h.getFullYear()-1,11,29);case 1:return h;case 2:return new Date(h.getFullYear(),0,3);case 3:return new Date(h.getFullYear(),
|
||||
0,2);case 4:return new Date(h.getFullYear(),0,1);case 5:return new Date(h.getFullYear()-1,11,31);case 6:return new Date(h.getFullYear()-1,11,30)}}function p(h){var u=h.Ra;for(h=new Date((new Date(h.Sa+1900,0,1)).getTime());0<u;){var x=h.getMonth(),F=(rb(h.getFullYear())?sb:tb)[x];if(u>F-h.getDate())u-=F-h.getDate()+1,h.setDate(1),11>x?h.setMonth(x+1):(h.setMonth(0),h.setFullYear(h.getFullYear()+1));else{h.setDate(h.getDate()+u);break}}x=new Date(h.getFullYear()+1,0,4);u=l(new Date(h.getFullYear(),
|
||||
0,4));x=l(x);return 0>=k(u,h)?0>=k(x,h)?h.getFullYear()+1:h.getFullYear():h.getFullYear()-1}var n=E[e+40>>2];e={ad:E[e>>2],$c:E[e+4>>2],qb:E[e+8>>2],Qb:E[e+12>>2],rb:E[e+16>>2],Sa:E[e+20>>2],Ga:E[e+24>>2],Ra:E[e+28>>2],vd:E[e+32>>2],Zc:E[e+36>>2],bd:n?C(n):""};c=C(c);n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d",
|
||||
"%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var r in n)c=c.replace(new RegExp(r,"g"),n[r]);var w="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),y="January February March April May June July August September October November December".split(" ");n={"%a":function(h){return w[h.Ga].substring(0,3)},"%A":function(h){return w[h.Ga]},"%b":function(h){return y[h.rb].substring(0,3)},"%B":function(h){return y[h.rb]},
|
||||
"%C":function(h){return g((h.Sa+1900)/100|0,2)},"%d":function(h){return g(h.Qb,2)},"%e":function(h){return f(h.Qb,2," ")},"%g":function(h){return p(h).toString().substring(2)},"%G":function(h){return p(h)},"%H":function(h){return g(h.qb,2)},"%I":function(h){h=h.qb;0==h?h=12:12<h&&(h-=12);return g(h,2)},"%j":function(h){for(var u=0,x=0;x<=h.rb-1;u+=(rb(h.Sa+1900)?sb:tb)[x++]);return g(h.Qb+u,3)},"%m":function(h){return g(h.rb+1,2)},"%M":function(h){return g(h.$c,2)},"%n":function(){return"\n"},"%p":function(h){return 0<=
|
||||
h.qb&&12>h.qb?"AM":"PM"},"%S":function(h){return g(h.ad,2)},"%t":function(){return"\t"},"%u":function(h){return h.Ga||7},"%U":function(h){return g(Math.floor((h.Ra+7-h.Ga)/7),2)},"%V":function(h){var u=Math.floor((h.Ra+7-(h.Ga+6)%7)/7);2>=(h.Ga+371-h.Ra-2)%7&&u++;if(u)53==u&&(x=(h.Ga+371-h.Ra)%7,4==x||3==x&&rb(h.Sa)||(u=1));else{u=52;var x=(h.Ga+7-h.Ra-1)%7;(4==x||5==x&&rb(h.Sa%400-1))&&u++}return g(u,2)},"%w":function(h){return h.Ga},"%W":function(h){return g(Math.floor((h.Ra+7-(h.Ga+6)%7)/7),2)},
|
||||
"%y":function(h){return(h.Sa+1900).toString().substring(2)},"%Y":function(h){return h.Sa+1900},"%z":function(h){h=h.Zc;var u=0<=h;h=Math.abs(h)/60;return(u?"+":"-")+String("0000"+(h/60*100+h%60)).slice(-4)},"%Z":function(h){return h.bd},"%%":function(){return"%"}};c=c.replace(/%%/g,"\x00\x00");for(r in n)c.includes(r)&&(c=c.replace(new RegExp(r,"g"),n[r](e)));c=c.replace(/\0\0/g,"%");r=db(c,!1);if(r.length>b)return 0;D.set(r,a);return r.length-1}
|
||||
function vb(a,b,c,e){a||(a=this);this.parent=a;this.ra=a.ra;this.gb=null;this.id=S.Mc++;this.name=b;this.mode=c;this.oa={};this.qa={};this.rdev=e}Object.defineProperties(vb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},Ic:{get:function(){return S.va(this.mode)}},Eb:{get:function(){return S.jb(this.mode)}}});S.mc=vb;S.Pb();var ib;
|
||||
ia&&(ma(),U.Pb());
|
||||
hb={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,
|
||||
ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,
|
||||
EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function db(a,b){var c=Array(va(a)+1);a=ua(a,c,0,c.length);b&&(c.length=a);return c}
|
||||
var Tb={n:function(a,b,c,e){A("Assertion failed: "+C(a)+", at: "+[b?C(b):"unknown filename",c,e?C(e):"unknown function"])},a:function(a){return xa(a+24)+24},o:function(a){a=new N(a);a.Tc()||(a.Nb(!0),Sa--);a.Ob(!1);Ra.push(a);a.Oc();return a.Wc()},q:function(){X(0);var a=Ra.pop();if(a.Uc()&&!a.fc()){var b=a.Gc();b&&L(b)(a.eb);Ua(a.eb)}M=0},d:function(){var a=M;if(!a)return z=0;var b=new N(a);b.Ya(a);var c=b.Ia();if(!c)return z=0,a;for(var e=Array.prototype.slice.call(arguments),f=0;f<e.length;f++){var g=
|
||||
e[f];if(0===g||g===c)break;if(wb(g,c,b.ta+16))return z=g,a}z=c;return a},j:function(){var a=M;if(!a)return z=0;var b=new N(a);b.Ya(a);var c=b.Ia();if(!c)return z=0,a;for(var e=Array.prototype.slice.call(arguments),f=0;f<e.length;f++){var g=e[f];if(0===g||g===c)break;if(wb(g,c,b.ta+16))return z=g,a}z=c;return a},O:function(){var a=M;if(!a)return z=0;var b=new N(a);b.Ya(a);var c=b.Ia();if(!c)return z=0,a;for(var e=Array.prototype.slice.call(arguments),f=0;f<e.length;f++){var g=e[f];if(0===g||g===c)break;
|
||||
if(wb(g,c,b.ta+16))return z=g,a}z=c;return a},y:Ua,D:function(){var a=Ra.pop();a||A("no exception to throw");var b=a.eb;a.fc()||(Ra.push(a),a.Ob(!0),a.Nb(!1),Sa++);M=b;throw b;},b:function(a,b,c){(new N(a)).Ma(b,c);M=a;Sa++;throw a;},R:function(){return Sa},g:function(a){M||(M=a);throw a;},F:function(a,b,c){kb=c;try{var e=lb(a);switch(b){case 0:var f=W();return 0>f?-28:S.Wb(e,f).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return f=W(),e.flags|=f,0;case 5:return f=W(),Ba[f+0>>1]=2,0;case 6:case 7:return 0;
|
||||
case 16:case 8:return-28;case 9:return E[xb()>>2]=28,-1;default:return-28}}catch(g){if("undefined"==typeof S||!(g instanceof S.na))throw g;return-g.ya}},_:function(a,b,c){kb=c;try{var e=lb(a);switch(b){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var f=W();return E[f>>2]=0;case 21520:return e.tty?-28:-59;case 21531:return f=W(),S.Db(e,b,f);case 21523:return e.tty?0:-59;case 21524:return e.tty?
|
||||
0:-59;default:A("bad ioctl syscall "+b)}}catch(g){if("undefined"==typeof S||!(g instanceof S.na))throw g;return-g.ya}},$:function(a,b,c,e){kb=e;try{b=C(b);b=jb(a,b);var f=e?W():0;return S.open(b,c,f).fd}catch(g){if("undefined"==typeof S||!(g instanceof S.na))throw g;return-g.ya}},U:function(a,b,c,e){try{return b=C(b),e=C(e),b=jb(a,b),e=jb(c,e),S.rename(b,e),0}catch(f){if("undefined"==typeof S||!(f instanceof S.na))throw f;return-f.ya}},T:function(a,b){try{a=C(a);a:{var c=S.stat;try{var e=c(a)}catch(g){if(g&&
|
||||
g.node&&O(a)!==O(S.La(g.node))){var f=-54;break a}throw g;}E[b>>2]=e.dev;E[b+4>>2]=0;E[b+8>>2]=e.ino;E[b+12>>2]=e.mode;E[b+16>>2]=e.nlink;E[b+20>>2]=e.uid;E[b+24>>2]=e.gid;E[b+28>>2]=e.rdev;E[b+32>>2]=0;Ca[b+40>>3]=BigInt(e.size);E[b+48>>2]=4096;E[b+52>>2]=e.blocks;E[b+56>>2]=e.atime.getTime()/1E3|0;E[b+60>>2]=0;E[b+64>>2]=e.mtime.getTime()/1E3|0;E[b+68>>2]=0;E[b+72>>2]=e.ctime.getTime()/1E3|0;E[b+76>>2]=0;Ca[b+80>>3]=BigInt(e.ino);f=0}return f}catch(g){if("undefined"==typeof S||!(g instanceof S.na))throw g;
|
||||
return-g.ya}},S:function(a,b,c){try{return b=C(b),b=jb(a,b),0===c?S.unlink(b):512===c?S.rmdir(b):A("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof S||!(e instanceof S.na))throw e;return-e.ya}},G:function(){return Date.now()},P:function(){throw Infinity;},H:function(a,b){a=new Date(1E3*E[a>>2]);E[b>>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()-1900;E[b+24>>2]=a.getDay();var c=new Date(a.getFullYear(),
|
||||
0,1);E[b+28>>2]=(a.getTime()-c.getTime())/864E5|0;E[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();c=c.getTimezoneOffset();E[b+32>>2]=(e!=c&&a.getTimezoneOffset()==Math.min(c,e))|0},I:nb,z:function(){A("")},A:function(a){var b=ta.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);var f=Math;e=Math.max(a,e);f=f.min.call(f,2147483648,e+(65536-e%65536)%65536);a:{try{pa.grow(f-Aa.byteLength+65535>>>16);
|
||||
Da();var g=1;break a}catch(k){}g=void 0}if(g)return!0}return!1},W:function(a,b){var c=0;pb().forEach(function(e,f){var g=b+c;f=E[a+4*f>>2]=g;for(g=0;g<e.length;++g)D[f++>>0]=e.charCodeAt(g);D[f>>0]=0;c+=e.length+1});return 0},X:function(a,b){var c=pb();E[a>>2]=c.length;var e=0;c.forEach(function(f){e+=f.length+1});E[b>>2]=e;return 0},v:function(a){ra=a;yb(a)},E:function(a){try{var b=lb(a);S.close(b);return 0}catch(c){if("undefined"==typeof S||!(c instanceof S.na))throw c;return c.ya}},Z:function(a,
|
||||
b,c,e){try{a:{var f=lb(a);a=b;for(var g=b=0;g<c;g++){var k=G[a>>2],l=G[a+4>>2];a+=8;var p=S.read(f,D,k,l,void 0);if(0>p){var n=-1;break a}b+=p;if(p<l)break}n=b}E[e>>2]=n;return 0}catch(r){if("undefined"==typeof S||!(r instanceof S.na))throw r;return r.ya}},V:function(a,b,c,e){try{var f=Number(b&BigInt(4294967295))|0,g=Number(b>>BigInt(32))|0,k=lb(a);a=4294967296*g+(f>>>0);if(-9007199254740992>=a||9007199254740992<=a)return 61;S.Aa(k,a,c);Ca[e>>3]=BigInt(k.position);k.zb&&0===a&&0===c&&(k.zb=null);
|
||||
return 0}catch(l){if("undefined"==typeof S||!(l instanceof S.na))throw l;return l.ya}},Y:function(a,b,c,e){try{a:{var f=lb(a);a=b;for(var g=b=0;g<c;g++){var k=G[a>>2],l=G[a+4>>2];a+=8;var p=S.write(f,D,k,l,void 0);if(0>p){var n=-1;break a}b+=p}n=b}E[e>>2]=n;return 0}catch(r){if("undefined"==typeof S||!(r instanceof S.na))throw r;return r.ya}},c:function(){return z},J:zb,e:Bb,f:Cb,p:Db,L:Eb,N:Fb,s:Gb,B:Hb,x:Ib,M:Jb,K:Kb,k:Lb,i:Mb,h:Nb,r:Ob,m:Pb,t:Qb,u:Rb,w:Sb,C:function(a){return a},l:function(a){z=
|
||||
a},Q:function(a,b,c,e){return ub(a,b,c,e)}};
|
||||
(function(){function a(f){d.asm=f.exports;pa=d.asm.aa;Da();Ea=d.asm.ga;Ga.unshift(d.asm.ba);La()}function b(f){a(f.instance)}function c(f){return Pa().then(function(g){return WebAssembly.instantiate(g,e)}).then(function(g){return g}).then(f,function(g){v("failed to asynchronously prepare wasm: "+g);A(g)})}var e={a:Tb};H++;if(d.instantiateWasm)try{return d.instantiateWasm(e,a)}catch(f){return v("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return"function"!=typeof WebAssembly.instantiateStreaming||
|
||||
Ma()||K.startsWith("file://")||"function"!=typeof fetch?c(b):fetch(K,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(b,function(g){v("wasm streaming compile failed: "+g);v("falling back to ArrayBuffer instantiation");return c(b)})})})().catch(ba);return{}})();d.___wasm_call_ctors=function(){return(d.___wasm_call_ctors=d.asm.ba).apply(null,arguments)};
|
||||
var xb=d.___errno_location=function(){return(xb=d.___errno_location=d.asm.ca).apply(null,arguments)},xa=d._malloc=function(){return(xa=d._malloc=d.asm.da).apply(null,arguments)};d._main=function(){return(d._main=d.asm.ea).apply(null,arguments)};
|
||||
var Va=d._free=function(){return(Va=d._free=d.asm.fa).apply(null,arguments)},X=d._setThrew=function(){return(X=d._setThrew=d.asm.ha).apply(null,arguments)},Y=d.stackSave=function(){return(Y=d.stackSave=d.asm.ia).apply(null,arguments)},Z=d.stackRestore=function(){return(Z=d.stackRestore=d.asm.ja).apply(null,arguments)},za=d.stackAlloc=function(){return(za=d.stackAlloc=d.asm.ka).apply(null,arguments)},wb=d.___cxa_can_catch=function(){return(wb=d.___cxa_can_catch=d.asm.la).apply(null,arguments)},Ta=
|
||||
d.___cxa_is_pointer_type=function(){return(Ta=d.___cxa_is_pointer_type=d.asm.ma).apply(null,arguments)};function Mb(a,b){var c=Y();try{L(a)(b)}catch(e){Z(c);if(e!==e+0)throw e;X(1,0)}}function Bb(a,b){var c=Y();try{return L(a)(b)}catch(e){Z(c);if(e!==e+0)throw e;X(1,0)}}function Cb(a,b,c){var e=Y();try{return L(a)(b,c)}catch(f){Z(e);if(f!==f+0)throw f;X(1,0)}}function Ob(a,b,c,e){var f=Y();try{L(a)(b,c,e)}catch(g){Z(f);if(g!==g+0)throw g;X(1,0)}}
|
||||
function Nb(a,b,c){var e=Y();try{L(a)(b,c)}catch(f){Z(e);if(f!==f+0)throw f;X(1,0)}}function Lb(a){var b=Y();try{L(a)()}catch(c){Z(b);if(c!==c+0)throw c;X(1,0)}}function Gb(a,b,c,e,f,g,k){var l=Y();try{return L(a)(b,c,e,f,g,k)}catch(p){Z(l);if(p!==p+0)throw p;X(1,0)}}function Db(a,b,c,e){var f=Y();try{return L(a)(b,c,e)}catch(g){Z(f);if(g!==g+0)throw g;X(1,0)}}function Fb(a,b,c,e,f,g){var k=Y();try{return L(a)(b,c,e,f,g)}catch(l){Z(k);if(l!==l+0)throw l;X(1,0)}}
|
||||
function Jb(a,b,c,e,f,g){var k=Y();try{return L(a)(b,c,e,f,g)}catch(l){Z(k);if(l!==l+0)throw l;X(1,0)}}function Eb(a,b,c,e,f,g){var k=Y();try{return L(a)(b,c,e,f,g)}catch(l){Z(k);if(l!==l+0)throw l;X(1,0)}}function Kb(a,b,c,e){var f=Y();try{return L(a)(b,c,e)}catch(g){Z(f);if(g!==g+0)throw g;X(1,0)}}function Hb(a,b,c,e,f,g,k,l){var p=Y();try{return L(a)(b,c,e,f,g,k,l)}catch(n){Z(p);if(n!==n+0)throw n;X(1,0)}}
|
||||
function Pb(a,b,c,e,f){var g=Y();try{L(a)(b,c,e,f)}catch(k){Z(g);if(k!==k+0)throw k;X(1,0)}}function Qb(a,b,c,e,f,g,k,l){var p=Y();try{L(a)(b,c,e,f,g,k,l)}catch(n){Z(p);if(n!==n+0)throw n;X(1,0)}}function Ib(a,b,c,e,f,g,k,l,p,n,r,w){var y=Y();try{return L(a)(b,c,e,f,g,k,l,p,n,r,w)}catch(h){Z(y);if(h!==h+0)throw h;X(1,0)}}function Rb(a,b,c,e,f,g,k,l,p,n,r){var w=Y();try{L(a)(b,c,e,f,g,k,l,p,n,r)}catch(y){Z(w);if(y!==y+0)throw y;X(1,0)}}
|
||||
function Sb(a,b,c,e,f,g,k,l,p,n,r,w,y,h,u,x){var F=Y();try{L(a)(b,c,e,f,g,k,l,p,n,r,w,y,h,u,x)}catch(I){Z(F);if(I!==I+0)throw I;X(1,0)}}function zb(a){var b=Y();try{return L(a)()}catch(c){Z(b);if(c!==c+0)throw c;X(1,0)}}d.callMain=Ub;d.ENV=ob;d.FS=S;d.NODEFS=U;d.WORKERFS=V;var Vb;function na(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}Ka=function Wb(){Vb||Xb();Vb||(Ka=Wb)};
|
||||
function Ub(a){var b=d._main;a=a||[];var c=a.length+1,e=za(4*(c+1));E[e>>2]=ya(ea);for(var f=1;f<c;f++)E[(e>>2)+f]=ya(a[f-1]);E[(e>>2)+c]=0;try{var g=b(c,e);ra=g;yb(g);return g}catch(l){if(l instanceof na||"unwind"==l)var k=ra;else fa(1,l),k=void 0;return k}finally{}}
|
||||
function Xb(a){a=a||da;if(!(0<H)){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;){var b=d.preRun.shift();Fa.unshift(b)}Qa(Fa);0<H||Vb||(Vb=!0,d.calledRun=!0,qa||(d.noFSInit||S.Ma.Cb||S.Ma(),S.Bb=!1,Qa(Ga),Qa(Ha),aa(d),Yb&&Ub(a),Qa(Ia)))}}d.run=Xb;function yb(a){ra=a;noExitRuntime||(qa=!0);fa(a,new na(a))}var Yb=!0;d.noInitialRun&&(Yb=!1);Xb();
|
||||
Object.assign(S,{init:S.Ma,mkdir:S.mkdir,mount:S.ra,chdir:S.chdir,writeFile:S.writeFile,readFile:S.readFile,createLazyFile:S.yc,setIgnorePermissions:function(a){S.Bb=a}});
|
||||
|
||||
|
||||
return Module.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
export default Module;
|
||||
+27
-6
@@ -3,13 +3,16 @@ import { createPinia } from 'pinia';
|
||||
import { createHead } from '@vueuse/head';
|
||||
import { library } from '@fortawesome/fontawesome-svg-core';
|
||||
import { fas } from '@fortawesome/free-solid-svg-icons';
|
||||
import { LoadingPlugin } from 'vue-loading-overlay';
|
||||
|
||||
import { install as VueMonacoEditorPlugin, loader } from '@guolao/vue-monaco-editor';
|
||||
import * as monaco from 'monaco-editor';
|
||||
import { installAbortSignalPolyfill } from 'abort-signal-polyfill';
|
||||
|
||||
import { registerSW } from 'virtual:pwa-register';
|
||||
import shadow from 'vue-shadow-dom';
|
||||
import { hideSplashScreen } from 'vite-plugin-splash-screen/runtime';
|
||||
import { plausible } from './plugins/plausible.plugin';
|
||||
import '@/utils/json5-bigint';
|
||||
import '@/utils/json5-bignum';
|
||||
|
||||
import 'virtual:uno.css';
|
||||
|
||||
@@ -21,16 +24,32 @@ import { i18nPlugin } from './plugins/i18n.plugin';
|
||||
|
||||
import store from './tools/pomodoro-timer/app/store';
|
||||
|
||||
library.add(fas);
|
||||
window.addEventListener('vite:preloadError', (event: Event) => {
|
||||
console.error('Vite preload error, forcing page reload:', event);
|
||||
event.preventDefault(); // Prevent the original error from being thrown again
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
// loaded monaco-editor from `node_modules`
|
||||
loader.config({ monaco });
|
||||
installAbortSignalPolyfill();
|
||||
|
||||
library.add(fas);
|
||||
|
||||
registerSW();
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
app.use(VueMonacoEditorPlugin);
|
||||
const base = import.meta.env.BASE_URL ?? '/';
|
||||
let toolsSettings: Record<string, Record<string, any> | any> = {};
|
||||
try {
|
||||
const remoteSettingsResponse = await fetch(`${base}tools-settings.json`);
|
||||
if (remoteSettingsResponse.ok) {
|
||||
toolsSettings = (await remoteSettingsResponse.json()) as Record<string, Record<string, any> | any>;
|
||||
}
|
||||
}
|
||||
catch {}
|
||||
app.config.globalProperties.$itToolsSettings = toolsSettings;
|
||||
|
||||
app.use(LoadingPlugin);
|
||||
app.use(createPinia());
|
||||
app.use(createHead());
|
||||
app.use(i18nPlugin);
|
||||
@@ -41,3 +60,5 @@ app.use(shadow);
|
||||
app.use(store, 'pomodoro-store');
|
||||
|
||||
app.mount('#app');
|
||||
|
||||
hideSplashScreen();
|
||||
@@ -2,7 +2,6 @@ import { defineStore } from 'pinia';
|
||||
import _ from 'lodash';
|
||||
import type { PaletteOption } from './command-palette.types';
|
||||
import { useToolStore } from '@/tools/tools.store';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import { useStyleStore } from '@/stores/style.store';
|
||||
|
||||
import SunIcon from '~icons/mdi/white-balance-sunny';
|
||||
@@ -10,6 +9,7 @@ import GithubIcon from '~icons/mdi/github';
|
||||
import BugIcon from '~icons/mdi/bug-outline';
|
||||
import DiceIcon from '~icons/mdi/dice-5';
|
||||
import InfoIcon from '~icons/mdi/information-outline';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const maxSearchResultsPerCategory = import.meta.env.VITE_MAX_SEARCH_RESULT || 25;
|
||||
|
||||
@@ -74,12 +74,11 @@ export const useCommandPaletteStore = defineStore('command-palette', () => {
|
||||
},
|
||||
];
|
||||
|
||||
const { searchResult } = useFuzzySearch({
|
||||
const { searchResult } = useFlexSearch({
|
||||
search: searchPrompt,
|
||||
data: searchOptions,
|
||||
options: {
|
||||
keys: [{ name: 'name', weight: 2 }, 'description', 'keywords', 'category'],
|
||||
threshold: 0.3,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ function activateOption(option: PaletteOption) {
|
||||
</c-button>
|
||||
|
||||
<c-modal v-model:open="isModalOpen" class="palette-modal" overflow-y-auto shadow-xl important:max-w-650px pretty-scrollbar important:pa-12px @keydown="handleKeydown">
|
||||
<c-input-text ref="inputRef" v-model:value="searchPrompt" raw-text placeholder="Type to search a tool or a command..." autofocus clearable />
|
||||
<c-input-text ref="inputRef" v-model:value="searchPrompt" raw-text :placeholder="$t('search.placeholder')" autofocus clearable />
|
||||
|
||||
<div v-for="(options, category) in filteredSearchResult" :key="category">
|
||||
<div ml-3 mt-3 text-sm font-bold text-primary op-60>
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
const { availableLocales, locale } = useI18n();
|
||||
const { availableLocales, locale, t } = useI18n();
|
||||
|
||||
const localesLong: Record<string, string> = {
|
||||
en: 'English',
|
||||
de: 'Deutsch',
|
||||
da: 'Dansk',
|
||||
es: 'Español',
|
||||
fr: 'Français',
|
||||
ga: 'Gaeilge',
|
||||
it: 'Italiano',
|
||||
nl: 'Nederlands',
|
||||
no: 'Norwegian',
|
||||
pl: 'Polski',
|
||||
pt: 'Português',
|
||||
ru: 'Русский',
|
||||
tr: 'Türkçe',
|
||||
uk: 'Українська',
|
||||
ko: '한국인',
|
||||
zh: '中文',
|
||||
vi: 'Tiếng Việt',
|
||||
ar: 'عربي',
|
||||
@@ -28,7 +34,7 @@ const localeOptions = computed(() =>
|
||||
<c-select
|
||||
v-model:value="locale"
|
||||
:options="localeOptions"
|
||||
placeholder="Select a language"
|
||||
:placeholder="t('locale-selector.select-a-language')"
|
||||
w-100px
|
||||
/>
|
||||
</template>
|
||||
+112
-2
@@ -1,9 +1,119 @@
|
||||
<script setup lang="ts">
|
||||
import _ from 'lodash';
|
||||
import { useHead } from '@vueuse/head';
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useToolStore } from '@/tools/tools.store';
|
||||
|
||||
useHead({ title: 'About - IT Tools' });
|
||||
const { t } = useI18n();
|
||||
|
||||
const toolStore = useToolStore();
|
||||
|
||||
const desc = '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.';
|
||||
const title = 'About - IT Tools';
|
||||
useHead({
|
||||
title,
|
||||
meta: [
|
||||
{
|
||||
itemprop: 'name',
|
||||
content: title,
|
||||
},
|
||||
{
|
||||
property: 'og:title',
|
||||
content: title,
|
||||
},
|
||||
{
|
||||
property: 'twitter:title',
|
||||
content: title,
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
content: desc,
|
||||
},
|
||||
{
|
||||
itemprop: 'description',
|
||||
content: desc,
|
||||
},
|
||||
{
|
||||
property: 'og:description',
|
||||
content: desc,
|
||||
},
|
||||
{
|
||||
property: 'twitter:description',
|
||||
content: desc,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const orderedTools = computed(() => _.orderBy(toolStore.tools, ['category', 'name'], ['asc', 'asc']));
|
||||
const { favoriteToolsName } = storeToRefs(toolStore);
|
||||
|
||||
const message = useMessage();
|
||||
const importFavoritesJson = ref('');
|
||||
function importFavorites() {
|
||||
try {
|
||||
favoriteToolsName.value = JSON.parse(importFavoritesJson.value);
|
||||
message.success(t('about.favorites-imported-successfully'));
|
||||
}
|
||||
catch (e: any) {
|
||||
message.error(t('about.error-importing-favorites-e', [e]));
|
||||
}
|
||||
}
|
||||
const favoritesJson = computed(() => JSON.stringify(favoriteToolsName.value));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-markdown :markdown="$t('about.content')" mx-auto mt-50px max-w-600px />
|
||||
<c-markdown :markdown="$t('about.content-fork')" mx-auto mt-50px />
|
||||
|
||||
<n-card :title="$t('about.import-favorites')" mx-auto mt-50px>
|
||||
<c-input-text
|
||||
v-model:value="importFavoritesJson"
|
||||
:placeholder="$t('about.put-your-favorites-json-array-here')"
|
||||
multiline
|
||||
monospace
|
||||
mb-2
|
||||
/>
|
||||
<c-button @click="importFavorites">
|
||||
{{ $t('about.import-button') }}
|
||||
</c-button>
|
||||
</n-card>
|
||||
|
||||
<n-card :title="$t('about.export-favorites')" mx-auto mt-50px>
|
||||
<textarea-copyable
|
||||
v-model:value="favoritesJson"
|
||||
/>
|
||||
</n-card>
|
||||
|
||||
<n-card :title="$t('about.alltools-title', { toolsCount: toolStore.tools.length })" mx-auto mt-50px>
|
||||
<n-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
{{ $t('about.tools.category') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ $t('about.tools.name') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ $t('about.tools.desc') }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(tool, ix) in orderedTools" :key="ix">
|
||||
<td>
|
||||
{{ tool.category }}
|
||||
</td>
|
||||
<td>
|
||||
<router-link :to="tool.path" class="decoration-none" target="_blank">
|
||||
{{ tool.name }}
|
||||
</router-link>
|
||||
</td>
|
||||
<td>
|
||||
{{ tool.description }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
</n-card>
|
||||
</template>
|
||||
+120
-24
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { IconDragDrop, IconFileDescription, IconHeart } from '@tabler/icons-vue';
|
||||
import { IconDragDrop, IconHeart } from '@tabler/icons-vue';
|
||||
import { useHead } from '@vueuse/head';
|
||||
import { computed } from 'vue';
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue';
|
||||
import Draggable from 'vuedraggable';
|
||||
import VueMarkdown from 'vue-markdown-render';
|
||||
import ColoredCard from '../components/ColoredCard.vue';
|
||||
@@ -22,16 +22,121 @@ const homeCustomMarkdown = computedAsync(async () => {
|
||||
});
|
||||
|
||||
const toolStore = useToolStore();
|
||||
const desc = '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.';
|
||||
const title = 'IT Tools - Handy online tools for developers';
|
||||
|
||||
useHead({ title: 'IT Tools - Handy online tools for developers' });
|
||||
useHead({
|
||||
title,
|
||||
meta: [
|
||||
{
|
||||
itemprop: 'name',
|
||||
content: title,
|
||||
},
|
||||
{
|
||||
property: 'og:title',
|
||||
content: title,
|
||||
},
|
||||
{
|
||||
property: 'twitter:title',
|
||||
content: title,
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
content: desc,
|
||||
},
|
||||
{
|
||||
itemprop: 'description',
|
||||
content: desc,
|
||||
},
|
||||
{
|
||||
property: 'og:description',
|
||||
content: desc,
|
||||
},
|
||||
{
|
||||
property: 'twitter:description',
|
||||
content: desc,
|
||||
},
|
||||
],
|
||||
});
|
||||
const { t } = useI18n();
|
||||
|
||||
const favoriteTools = computed(() => toolStore.favoriteTools);
|
||||
|
||||
const isOrderingFavorites = ref(false);
|
||||
|
||||
window.addEventListener('contextmenu', (e) => {
|
||||
if (isOrderingFavorites.value) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
function startOrderingFavorites() {
|
||||
isOrderingFavorites.value = true;
|
||||
}
|
||||
|
||||
// Update favorite tools order when drag is finished
|
||||
function onUpdateFavoriteTools() {
|
||||
function stopOrderingFavorites() {
|
||||
isOrderingFavorites.value = false;
|
||||
toolStore.updateFavoriteTools(favoriteTools.value); // Update the store with the new order
|
||||
}
|
||||
|
||||
// Batch loading logic for tool cards
|
||||
const TOOLS_PER_ROW = 4; // Based on xl:grid-cols-4
|
||||
const ROWS_PER_BATCH = 8;
|
||||
const TOOLS_PER_BATCH = TOOLS_PER_ROW * ROWS_PER_BATCH; // 32 tools per batch
|
||||
|
||||
const visibleToolsCount = ref(TOOLS_PER_BATCH); // Start with first batch
|
||||
let loadingInterval: NodeJS.Timeout | null = null;
|
||||
|
||||
// Computed property for visible tools
|
||||
const visibleTools = computed(() => {
|
||||
return toolStore.tools.slice(0, visibleToolsCount.value);
|
||||
});
|
||||
|
||||
// Function to stop automated loading
|
||||
function stopAutomatedLoading() {
|
||||
if (loadingInterval) {
|
||||
clearInterval(loadingInterval);
|
||||
loadingInterval = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Function to start automated loading
|
||||
function startAutomatedLoading() {
|
||||
// Clear any existing interval
|
||||
if (loadingInterval) {
|
||||
clearInterval(loadingInterval);
|
||||
}
|
||||
|
||||
// Start loading batches every 150ms
|
||||
loadingInterval = setInterval(() => {
|
||||
if (visibleToolsCount.value < toolStore.tools.length) {
|
||||
visibleToolsCount.value = Math.min(
|
||||
visibleToolsCount.value + TOOLS_PER_BATCH,
|
||||
toolStore.tools.length,
|
||||
);
|
||||
}
|
||||
else {
|
||||
// Stop loading when all tools are visible
|
||||
stopAutomatedLoading();
|
||||
}
|
||||
}, 150);
|
||||
}
|
||||
|
||||
// Start automated loading on component mount
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
startAutomatedLoading();
|
||||
});
|
||||
});
|
||||
|
||||
// Clean up on component unmount
|
||||
onUnmounted(() => {
|
||||
stopAutomatedLoading();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -49,24 +154,6 @@ function onUpdateFavoriteTools() {
|
||||
{{ $t('home.follow.thankYou') }}
|
||||
<n-icon :component="IconHeart" />
|
||||
</ColoredCard>
|
||||
|
||||
<a href="https://renderize.tech?utm_source=it-tools&utm_medium=banner" target="_blank" rel="noopener" class="text-current decoration-none">
|
||||
<c-card v-if="config.showSponsorBanner" class="cursor-pointer !border-2px !hover:border-primary">
|
||||
<div class="flex items-center justify-between">
|
||||
<n-icon :component="IconFileDescription" class="text-neutral-400 dark:text-neutral-600" size="40" />
|
||||
<div class="rounded-full bg-#eeeeee px-10px py-2px text-xs text-black dark:bg-#333333 dark:text-white">
|
||||
Sponsor
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="my-5px flex items-baseline gap-4 text-balance text-lg text-black dark:text-white">
|
||||
Generate PDFs from HTML with Renderize API
|
||||
</div>
|
||||
<div class="text-neutral-500 dark:text-neutral-400">
|
||||
Automate your document generation with our fast, developer-friendly API. Start with a free forever plan.
|
||||
</div>
|
||||
</c-card>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<transition name="height">
|
||||
@@ -82,7 +169,9 @@ function onUpdateFavoriteTools() {
|
||||
class="grid grid-cols-1 gap-12px lg:grid-cols-3 md:grid-cols-3 sm:grid-cols-2 xl:grid-cols-4"
|
||||
ghost-class="ghost-favorites-draggable"
|
||||
item-key="name"
|
||||
@end="onUpdateFavoriteTools"
|
||||
:delay="100"
|
||||
@start="startOrderingFavorites"
|
||||
@end="stopOrderingFavorites"
|
||||
>
|
||||
<template #item="{ element: tool }">
|
||||
<ToolCard :tool="tool" />
|
||||
@@ -108,7 +197,14 @@ function onUpdateFavoriteTools() {
|
||||
{{ $t('home.categories.allTools') }}
|
||||
</h3>
|
||||
<div class="grid grid-cols-1 gap-12px lg:grid-cols-3 md:grid-cols-3 sm:grid-cols-2 xl:grid-cols-4">
|
||||
<ToolCard v-for="tool in toolStore.tools" :key="tool.name" :tool="tool" />
|
||||
<ToolCard v-for="tool in visibleTools" :key="tool.name" :tool="tool" />
|
||||
</div>
|
||||
|
||||
<!-- Loading indicator when more tools are coming -->
|
||||
<div v-if="visibleToolsCount < toolStore.tools.length" mt-6 text-center>
|
||||
<div text-14px op-70>
|
||||
{{ t('home.loading-more-tools') }} <span>({{ visibleTools.length }}/{{ toolStore.tools.length }})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,9 +3,11 @@ import { get } from '@vueuse/core';
|
||||
import type { Plugin } from 'vue';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
|
||||
const DEFAULT_LOCALE = String(import.meta.env.VITE_LANGUAGE || 'en');
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: import.meta.env.VITE_LANGUAGE || 'en',
|
||||
locale: DEFAULT_LOCALE,
|
||||
messages,
|
||||
});
|
||||
|
||||
@@ -15,7 +17,8 @@ export const i18nPlugin: Plugin = {
|
||||
},
|
||||
};
|
||||
|
||||
export const translate = function (localeKey: string) {
|
||||
const hasKey = i18n.global.te(localeKey, get(i18n.global.locale));
|
||||
return hasKey ? i18n.global.t(localeKey) : localeKey;
|
||||
};
|
||||
export function getCurrentLocale(): string {
|
||||
return get(i18n.global.locale);
|
||||
}
|
||||
|
||||
export const translate = i18n.global.t as typeof i18n.global.t;
|
||||
@@ -1,11 +1,14 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { type ActiveLoader, useLoading } from 'vue-loading-overlay';
|
||||
import { layouts } from './layouts/index';
|
||||
import HomePage from './pages/Home.page.vue';
|
||||
import NotFound from './pages/404.page.vue';
|
||||
import { tools } from './tools';
|
||||
import { config } from './config';
|
||||
import { routes as demoRoutes } from './ui/demo/demo.routes';
|
||||
import { useAppTheme } from './ui/theme/themes';
|
||||
|
||||
const $loading = useLoading();
|
||||
const toolsRoutes = tools.map(({ path, name, component, ...config }) => ({
|
||||
path,
|
||||
name,
|
||||
@@ -38,4 +41,30 @@ const router = createRouter({
|
||||
],
|
||||
});
|
||||
|
||||
let loader: ActiveLoader | null = null;
|
||||
let loaderTimeoutId: NodeJS.Timeout | null = null;
|
||||
|
||||
router.beforeEach((to, from) => {
|
||||
// Only show loading for actual route changes, not just query param changes
|
||||
if (to.path !== from.path) {
|
||||
const theme = useAppTheme();
|
||||
loaderTimeoutId = setTimeout(() => {
|
||||
loader = $loading?.show({
|
||||
color: theme.value.primary.color,
|
||||
});
|
||||
}, 350);
|
||||
}
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
if (loaderTimeoutId) {
|
||||
clearTimeout(loaderTimeoutId);
|
||||
loaderTimeoutId = null;
|
||||
}
|
||||
if (loader) {
|
||||
loader.hide();
|
||||
loader = null;
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
Vendored
+32
-6
@@ -10,11 +10,6 @@ declare module '*.md' {
|
||||
export default Component;
|
||||
}
|
||||
|
||||
declare module 'iarna-toml-esm' {
|
||||
export const parse: (toml: string) => any;
|
||||
export const stringify: (obj: any) => string;
|
||||
}
|
||||
|
||||
declare module 'emojilib' {
|
||||
const lib: Record<string, string[]>;
|
||||
export default lib;
|
||||
@@ -38,4 +33,35 @@ declare module 'pdf-signature-reader' {
|
||||
const verifySignature: (pdf: ArrayBuffer) => ({signatures: SignatureInfo[]});
|
||||
|
||||
export default verifySignature;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vite-plugin-splash-screen/runtime' {
|
||||
export function hideSplashScreen();
|
||||
}
|
||||
|
||||
interface BigInt {
|
||||
toJSON: () => string;
|
||||
}
|
||||
|
||||
interface JSON {
|
||||
parseBigInt: (jsonStr: string, options?: { minDigits?: number; }) => any;
|
||||
parseBigNum: (jsonStr: string) => any;
|
||||
rawJSON(value: string): any;
|
||||
}
|
||||
|
||||
interface Navigator {
|
||||
gpu?: any;
|
||||
}
|
||||
|
||||
interface FontFaceSet {
|
||||
add(fontFace: FontFace)
|
||||
}
|
||||
|
||||
// TODO remove once https://github.com/microsoft/TypeScript/issues/60608 is resolved
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace Intl {
|
||||
class DurationFormat {
|
||||
constructor(locale?: Intl.LocalesArgument, options?: { style?: 'long' });
|
||||
format(duration: { seconds?: number; milliseconds?: number }): string;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
import { useDark, useMediaQuery, useStorage, useToggle } from '@vueuse/core';
|
||||
import { useDark, useMediaQuery, useToggle } from '@vueuse/core';
|
||||
import { defineStore } from 'pinia';
|
||||
import { type Ref, watch } from 'vue';
|
||||
import { useITStorage } from '@/composable/queryParams';
|
||||
|
||||
export const useStyleStore = defineStore('style', {
|
||||
state: () => {
|
||||
const isDarkTheme = useDark();
|
||||
const toggleDark = useToggle(isDarkTheme);
|
||||
const isSmallScreen = useMediaQuery('(max-width: 700px)');
|
||||
const isMenuCollapsed = useStorage('isMenuCollapsed', isSmallScreen.value) as Ref<boolean>;
|
||||
const isMenuCollapsed = useITStorage('isMenuCollapsed', isSmallScreen.value) as Ref<boolean>;
|
||||
|
||||
watch(isSmallScreen, v => (isMenuCollapsed.value = v));
|
||||
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import mappingData from './ad-mapping.json';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const data = mappingData.map(i => ({ ...i, all: `${i.TAB} - ${i.ActiveDirectoryField}` }));
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const { t } = useI18n();
|
||||
|
||||
const { searchResult } = useFuzzySearch({
|
||||
search: searchQuery,
|
||||
const data = mappingData;
|
||||
const search = ref('');
|
||||
|
||||
const { searchResult } = useFlexSearch({
|
||||
search,
|
||||
data,
|
||||
options: {
|
||||
keys: ['all'],
|
||||
threshold: 0.2,
|
||||
isCaseSensitive: false,
|
||||
minMatchCharLength: 3,
|
||||
useExtendedSearch: true,
|
||||
keys: ['TAB', 'ActiveDirectoryField', 'LDAPAttribute'],
|
||||
filterEmpty: false,
|
||||
},
|
||||
});
|
||||
@@ -24,8 +22,8 @@ const { searchResult } = useFuzzySearch({
|
||||
<div mx-auto max-w-2400px important:flex-1>
|
||||
<div flex items-center gap-3>
|
||||
<c-input-text
|
||||
v-model:value="searchQuery"
|
||||
placeholder="Search Active Directory LDAP mapping"
|
||||
v-model:value="search"
|
||||
:placeholder="t('tools.ad-ldap-searcher.texts.placeholder-search-active-directory-ldap-mapping')"
|
||||
mx-auto max-w-600px
|
||||
>
|
||||
<template #prefix>
|
||||
@@ -40,19 +38,19 @@ const { searchResult } = useFuzzySearch({
|
||||
|
||||
mt-4 text-center text-20px font-bold
|
||||
>
|
||||
No results
|
||||
{{ t('tools.ad-ldap-searcher.texts.tag-no-results') }}
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<div mt-4 text-20px font-bold>
|
||||
Search result
|
||||
{{ t('tools.ad-ldap-searcher.texts.tag-search-result') }}
|
||||
</div>
|
||||
|
||||
<n-table>
|
||||
<thead>
|
||||
<th>TAB</th>
|
||||
<th>Active Directory Field</th>
|
||||
<th>LDAP Attribute</th>
|
||||
<th>{{ t('tools.ad-ldap-searcher.texts.tag-tab') }}</th>
|
||||
<th>{{ t('tools.ad-ldap-searcher.texts.tag-active-directory-field') }}</th>
|
||||
<th>{{ t('tools.ad-ldap-searcher.texts.tag-ldap-attribute') }}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(result, ix) in searchResult" :key="ix">
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Folder } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: translate('tools.ad-ldap-searcher.title'),
|
||||
name: t('tools.ad-ldap-searcher.title'),
|
||||
path: '/ad-ldap-searcher',
|
||||
description: translate('tools.ad-ldap-searcher.description'),
|
||||
description: t('tools.ad-ldap-searcher.description'),
|
||||
keywords: ['active', 'directory', 'ad', 'ldap', 'prop', 'searcher'],
|
||||
component: () => import('./ad-ldap-searcher.vue'),
|
||||
icon: Folder,
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useScriptTag } from '@vueuse/core';
|
||||
import ageWasmUrl from '/age-wasm/age.wasm?url';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
generateX25519Identity: () => {
|
||||
privateKey: string
|
||||
publicKey: string
|
||||
}
|
||||
encrypt: (publicKeys: string, message: string) => {
|
||||
error?: string
|
||||
output: string
|
||||
}
|
||||
decrypt: (privateKeys: string, message: string) => {
|
||||
error?: string
|
||||
output: string
|
||||
}
|
||||
encryptBinary: (publicKeys: string, buffer: Uint8Array) => string | Uint8Array
|
||||
decryptBinary: (privateKeys: string, buffer: Uint8Array) => string | Uint8Array
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Go is the class as defined in the Golang `wasm_exec.js` distributable file required for WebAssembly.
|
||||
* Golang WebAssembly wiki: https://github.com/golang/go/wiki/WebAssembly
|
||||
*/
|
||||
declare class Go {
|
||||
argv: string[];
|
||||
env: { [envKey: string]: string };
|
||||
exit: (code: number) => void;
|
||||
importObject: WebAssembly.Imports;
|
||||
exited: boolean;
|
||||
mem: DataView;
|
||||
run(instance: WebAssembly.Instance): Promise<void>;
|
||||
}
|
||||
|
||||
const base = import.meta.env.BASE_URL ?? '/';
|
||||
|
||||
const { load: loadGo } = useScriptTag(`${base}age-wasm/wasm_exec.js`, undefined, { type: 'module', manual: true });
|
||||
|
||||
await loadGo();
|
||||
|
||||
const go = new Go();
|
||||
const result = await WebAssembly.instantiateStreaming(fetch(ageWasmUrl), go.importObject);
|
||||
go.run(result.instance);
|
||||
|
||||
const privKey = ref('');
|
||||
const pubKey = ref('');
|
||||
const recipients = ref('');
|
||||
const message = ref('');
|
||||
const encryptedOutput = ref('');
|
||||
const recipientsBinary = ref('');
|
||||
const filesEncrypt = ref<File[]>([]);
|
||||
const identities = ref('');
|
||||
const encryptedText = ref('');
|
||||
const decryptedOutput = ref('');
|
||||
const identitiesBinary = ref('');
|
||||
const filesDecrypt = ref<File[]>([]);
|
||||
const error = ref('');
|
||||
|
||||
function downloadURL(data: string, fileName: string) {
|
||||
const a = document.createElement('a');
|
||||
a.href = data;
|
||||
a.download = fileName;
|
||||
document.body.appendChild(a);
|
||||
a.style.display = 'none';
|
||||
a.click();
|
||||
a.remove();
|
||||
}
|
||||
|
||||
function downloadBlob(data: Uint8Array, fileName: string) {
|
||||
const blob = new Blob([data], {
|
||||
type: 'application/octet-stream',
|
||||
});
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
downloadURL(url, fileName);
|
||||
setTimeout(() => window.URL.revokeObjectURL(url), 1000);
|
||||
}
|
||||
|
||||
function generateKeys() {
|
||||
const keys = window.generateX25519Identity();
|
||||
privKey.value = keys.privateKey;
|
||||
pubKey.value = keys.publicKey;
|
||||
}
|
||||
|
||||
function encrypt() {
|
||||
error.value = '';
|
||||
const result = window.encrypt(recipients.value, message.value);
|
||||
if (result.error) {
|
||||
error.value = result.error;
|
||||
}
|
||||
else {
|
||||
encryptedOutput.value = result.output;
|
||||
}
|
||||
}
|
||||
|
||||
function encryptBinary() {
|
||||
error.value = '';
|
||||
const file = filesEncrypt.value;
|
||||
if (!file.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
file.forEach((f) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const buffer = new Uint8Array(reader.result as ArrayBuffer);
|
||||
const result = window.encryptBinary(recipientsBinary.value, buffer);
|
||||
if (typeof result === 'string') {
|
||||
error.value = result;
|
||||
}
|
||||
else {
|
||||
downloadBlob(result, `${f.name}.age`);
|
||||
}
|
||||
};
|
||||
reader.readAsArrayBuffer(f);
|
||||
});
|
||||
|
||||
filesEncrypt.value = [];
|
||||
}
|
||||
|
||||
function decrypt() {
|
||||
error.value = '';
|
||||
const result = window.decrypt(identities.value, encryptedText.value);
|
||||
if (result.error) {
|
||||
error.value = result.error;
|
||||
}
|
||||
else {
|
||||
decryptedOutput.value = result.output;
|
||||
}
|
||||
}
|
||||
|
||||
function decryptBinary() {
|
||||
error.value = '';
|
||||
const file = filesDecrypt.value;
|
||||
if (!file.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
file.forEach((f) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const buffer = new Uint8Array(reader.result as ArrayBuffer);
|
||||
const result = window.decryptBinary(identitiesBinary.value, buffer);
|
||||
if (typeof result === 'string') {
|
||||
error.value = result;
|
||||
}
|
||||
else {
|
||||
downloadBlob(result, f.name.replace('.age', ''));
|
||||
}
|
||||
};
|
||||
reader.readAsArrayBuffer(f);
|
||||
});
|
||||
|
||||
filesDecrypt.value = [];
|
||||
}
|
||||
|
||||
function onEncryptFilesUploaded(uploadedFiles: File[]) {
|
||||
filesEncrypt.value = uploadedFiles;
|
||||
}
|
||||
function onDecryptFilesUploaded(uploadedFiles: File[]) {
|
||||
filesDecrypt.value = uploadedFiles;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-tabs type="card">
|
||||
<!-- Generate Keys -->
|
||||
<n-tab-pane name="keys" :tab="t('tools.age-crypto.text.generate-keys')">
|
||||
<n-card :title="t('tools.age-crypto.texts.title-private-key')" mb-1>
|
||||
<textarea-copyable v-model:value="privKey" rows="3" multiline :placeholder="t('tools.age-crypto.texts.placeholder-your-private-key-will-be-generated-here')" />
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-public-key')" mb-1>
|
||||
<textarea-copyable v-model:value="pubKey" rows="3" multiline :placeholder="t('tools.age-crypto.texts.placeholder-your-public-key-will-be-generated-here')" />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="generateKeys">
|
||||
{{ t('tools.age-crypto.texts.tag-generate-keys') }}
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Encrypt Text -->
|
||||
<n-tab-pane name="encrypt" :tab="t('tools.age-crypto.text.encrypt')">
|
||||
<n-card :title="t('tools.age-crypto.texts.title-public-keys')" mb-1>
|
||||
<n-input v-model:value="recipients" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-recipient-key-or-keys-one-per-line')" required />
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-message')" mb-1>
|
||||
<n-input v-model:value="message" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-message-to-encrypt')" required />
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
|
||||
<textarea-copyable v-model:value="encryptedOutput" rows="3" multiline :placeholder="t('tools.age-crypto.texts.placeholder-encrypted-output-will-be-generated-here')" />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="encrypt">
|
||||
{{ t('tools.age-crypto.texts.tag-encrypt') }}
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Encrypt Binary -->
|
||||
<n-tab-pane name="encryptBinary" :tab="t('tools.age-crypto.text.encrypt-binary')">
|
||||
<n-card :title="t('tools.age-crypto.texts.title-public-keys')" mb-1>
|
||||
<n-input v-model:value="recipientsBinary" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-recipient-key-or-keys-one-per-line')" required />
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-files')" mb-1>
|
||||
<c-file-upload
|
||||
:title="t('tools.age-crypto.texts.title-drag-and-drop-files-here-or-click-to-select-some-files')"
|
||||
multiple
|
||||
@files-upload="onEncryptFilesUploaded"
|
||||
/>
|
||||
<ul>
|
||||
<li v-for="(file, index) in filesEncrypt" :key="index">
|
||||
{{ file.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
|
||||
<p>{{ t('tools.age-crypto.texts.tag-the-encrypted-files-will-be-downloaded') }}</p>
|
||||
</n-card>
|
||||
<n-button type="primary" @click="encryptBinary">
|
||||
{{ t('tools.age-crypto.texts.tag-encrypt-binary') }}
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Decrypt Text -->
|
||||
<n-tab-pane name="decrypt" :tab="t('tools.age-crypto.text.decrypt')">
|
||||
<n-card :title="t('tools.age-crypto.texts.title-private-keys')" mb-1>
|
||||
<n-input v-model:value="identities" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-identity-key-or-keys-one-per-line')" required />
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-encrypted-text')" mb-1>
|
||||
<n-input v-model:value="encryptedText" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-paste-here-encrypted-text')" required />
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
|
||||
<textarea-copyable v-model:value="decryptedOutput" rows="3" multiline :placeholder="t('tools.age-crypto.texts.placeholder-decrypted-output-will-be-generated-here')" />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="decrypt">
|
||||
{{ t('tools.age-crypto.texts.tag-decrypt') }}
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Decrypt Binary -->
|
||||
<n-tab-pane name="decryptBinary" :tab="t('tools.age-crypto.text.decrypt-binary')">
|
||||
<n-card :title="t('tools.age-crypto.texts.title-private-keys')" mb-1>
|
||||
<n-input v-model:value="identitiesBinary" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-identity-key-or-keys-one-per-line')" required />
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-encrypted-files')" mb-1>
|
||||
<c-file-upload
|
||||
:title="t('tools.age-crypto.texts.title-drag-and-drop-files-here-or-click-to-select-some-files')"
|
||||
multiple
|
||||
@files-upload="onDecryptFilesUploaded"
|
||||
/>
|
||||
<ul>
|
||||
<li v-for="(file, index) in filesDecrypt" :key="index">
|
||||
{{ file.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</n-card>
|
||||
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
|
||||
<p>{{ t('tools.age-crypto.texts.tag-the-decrypted-files-will-be-downloaded') }}</p>
|
||||
</n-card>
|
||||
<n-button type="primary" @click="decryptBinary">
|
||||
{{ t('tools.age-crypto.texts.tag-decrypt-binary') }}
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
</n-tabs>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { EyeOff } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.age-crypto.title'),
|
||||
path: '/age-crypto',
|
||||
description: t('tools.age-crypto.description'),
|
||||
keywords: ['age'],
|
||||
component: () => import('./age-crypto.vue'),
|
||||
icon: EyeOff,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Crypto',
|
||||
});
|
||||
@@ -1,9 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import promptSplitter from 'chatgpt-prompt-splitter';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
import { useQueryParam } from '@/composable/queryParams';
|
||||
|
||||
const prompt = ref('');
|
||||
const splitLength = ref(1024);
|
||||
const { t } = useI18n();
|
||||
|
||||
const prompt = useQueryParam({ tool: 'ai-prompt-split', name: 'prompt', defaultValue: '' });
|
||||
const splitLength = useQueryParam({ tool: 'ai-prompt-split', name: 'split', defaultValue: 1024 });
|
||||
|
||||
const splittedPrompts = computed(() => {
|
||||
try {
|
||||
@@ -23,7 +27,7 @@ const promptValidation = useValidation({
|
||||
rules: [
|
||||
{
|
||||
validator: v => v !== '',
|
||||
message: 'Prompt must not be empty',
|
||||
message: t('tools.ai-prompt-splitter.texts.message-prompt-must-not-be-empty'),
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -31,22 +35,22 @@ const promptValidation = useValidation({
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Prompt and options" mb-2>
|
||||
<c-card :title="t('tools.ai-prompt-splitter.texts.title-prompt-and-options')" mb-2>
|
||||
<c-input-text
|
||||
v-model:value="prompt"
|
||||
label="Full Prompt"
|
||||
:label="t('tools.ai-prompt-splitter.texts.label-full-prompt')"
|
||||
multiline
|
||||
placeholder="Put your full prompt here..."
|
||||
:placeholder="t('tools.ai-prompt-splitter.texts.placeholder-put-your-full-prompt-here')"
|
||||
rows="10"
|
||||
:validation="promptValidation"
|
||||
mb-2
|
||||
/>
|
||||
<n-form-item label="Character length for each chunk">
|
||||
<n-input-number v-model:value="splitLength" :min="1" />
|
||||
<n-form-item :label="t('tools.ai-prompt-splitter.texts.label-character-length-for-each-chunk')">
|
||||
<n-input-number-i18n v-model:value="splitLength" :min="1" />
|
||||
</n-form-item>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Divided prompts">
|
||||
<c-card :title="t('tools.ai-prompt-splitter.texts.title-divided-prompts')">
|
||||
<div v-for="(splittedPrompt, index) in splittedPrompts" :key="index">
|
||||
<TextareaCopyable :value="splittedPrompt" />
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Prompt } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: translate('tools.ai-prompt-splitter.title'),
|
||||
name: t('tools.ai-prompt-splitter.title'),
|
||||
path: '/ai-prompt-splitter',
|
||||
description: translate('tools.ai-prompt-splitter.description'),
|
||||
description: t('tools.ai-prompt-splitter.description'),
|
||||
keywords: ['ai', 'chatgpt', 'gpt', 'prompt', 'splitter'],
|
||||
component: () => import('./ai-prompt-splitter.vue'),
|
||||
icon: Prompt,
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('Tool - Amortization Calculator', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/amortization-calculator');
|
||||
});
|
||||
|
||||
test('Has correct title', async ({ page }) => {
|
||||
await expect(page).toHaveTitle('Amortization Calculator - IT Tools');
|
||||
});
|
||||
|
||||
test('Calculates amortization schedule with default values', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await expect(loanAmountInput).toHaveValue('200000');
|
||||
await expect(loanTermInput).toHaveValue('360');
|
||||
await expect(interestRateInput).toHaveValue('6');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$1,199.10');
|
||||
|
||||
const totalPaymentsCell = page.locator('tbody tr td').nth(1);
|
||||
await expect(totalPaymentsCell).toContainText('$431,676.38');
|
||||
});
|
||||
|
||||
test('Updates calculation when loan amount changes', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('100000');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$599.55');
|
||||
|
||||
const totalPaymentsCell = page.locator('tbody tr td').nth(1);
|
||||
await expect(totalPaymentsCell).toContainText('$215,838.19');
|
||||
});
|
||||
|
||||
test('Updates calculation when loan term changes', async ({ page }) => {
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('180');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$1,687.71');
|
||||
});
|
||||
|
||||
test('Updates calculation when interest rate changes', async ({ page }) => {
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await interestRateInput.clear();
|
||||
await interestRateInput.fill('4.5');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$1,013.37');
|
||||
});
|
||||
|
||||
test('Displays amortization schedule table', async ({ page }) => {
|
||||
const scheduleTable = page.locator('table').nth(1);
|
||||
|
||||
await expect(scheduleTable.locator('thead th').nth(0)).toContainText('Month');
|
||||
await expect(scheduleTable.locator('thead th').nth(1)).toContainText('Interest');
|
||||
await expect(scheduleTable.locator('thead th').nth(2)).toContainText('Principal');
|
||||
await expect(scheduleTable.locator('thead th').nth(3)).toContainText('Ending Balance');
|
||||
|
||||
const firstMonthRow = scheduleTable.locator('tbody tr').first();
|
||||
await expect(firstMonthRow.locator('td').nth(0)).toContainText('1');
|
||||
await expect(firstMonthRow.locator('td').nth(1)).toContainText('$1,000.00');
|
||||
await expect(firstMonthRow.locator('td').nth(2)).toContainText('$199.10');
|
||||
await expect(firstMonthRow.locator('td').nth(3)).toContainText('$199,800.90');
|
||||
});
|
||||
|
||||
test('Shows validation error for invalid loan amount', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('-1000');
|
||||
await loanAmountInput.blur();
|
||||
|
||||
await expect(page.locator('text=Loan amount must be a positive value')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for zero loan amount', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('0');
|
||||
await loanAmountInput.blur();
|
||||
|
||||
await expect(page.locator('text=Loan amount must be a positive value')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for non-integer loan term', async ({ page }) => {
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('12.5');
|
||||
await loanTermInput.blur();
|
||||
|
||||
await expect(page.locator('text=Loan term must be a positive integer')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for negative loan term', async ({ page }) => {
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('-12');
|
||||
await loanTermInput.blur();
|
||||
|
||||
await expect(page.locator('text=Loan term must be a positive integer')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for interest rate above 100', async ({ page }) => {
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await interestRateInput.clear();
|
||||
await interestRateInput.fill('101');
|
||||
await interestRateInput.blur();
|
||||
|
||||
await expect(page.locator('text=Interest rate must be a positive value between 0 and 100')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for zero interest rate', async ({ page }) => {
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await interestRateInput.clear();
|
||||
await interestRateInput.fill('0');
|
||||
await interestRateInput.blur();
|
||||
|
||||
await expect(page.locator('text=Interest rate must be a positive value between 0 and 100')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Hides results when inputs are invalid', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('invalid');
|
||||
|
||||
const resultsTable = page.locator('table').first();
|
||||
await expect(resultsTable).not.toBeVisible();
|
||||
});
|
||||
|
||||
test('Calculates correctly for short-term loan', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('10000');
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('12');
|
||||
await interestRateInput.clear();
|
||||
await interestRateInput.fill('12');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$888.49');
|
||||
|
||||
const scheduleTable = page.locator('table').nth(1);
|
||||
// Find the last month row (before the year summary row)
|
||||
const lastMonthRow = scheduleTable.locator('tbody tr').nth(11); // 12th month (0-indexed)
|
||||
await expect(lastMonthRow.locator('td').nth(0)).toContainText('12');
|
||||
await expect(lastMonthRow.locator('td').nth(3)).toContainText('$0.00');
|
||||
});
|
||||
|
||||
test('Schedule shows decreasing balance over time', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('50000');
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('12');
|
||||
|
||||
const scheduleTable = page.locator('table').nth(1);
|
||||
const firstBalance = await scheduleTable.locator('tbody tr').nth(0).locator('td').nth(3).textContent();
|
||||
const sixthBalance = await scheduleTable.locator('tbody tr').nth(5).locator('td').nth(3).textContent();
|
||||
// Get the last month row (12th month, index 11) before the year summary row
|
||||
const lastMonthBalance = await scheduleTable.locator('tbody tr').nth(11).locator('td').nth(3).textContent();
|
||||
|
||||
// The values may contain country code in e2e tests
|
||||
const firstBalanceValue = Number.parseFloat(firstBalance!.replace(/[A-Za-z$,]/g, ''));
|
||||
const sixthBalanceValue = Number.parseFloat(sixthBalance!.replace(/[A-Za-z$,]/g, ''));
|
||||
const lastBalanceValue = Number.parseFloat(lastMonthBalance!.replace(/[A-Za-z$,]/g, ''));
|
||||
|
||||
expect(firstBalanceValue).toBeGreaterThan(sixthBalanceValue);
|
||||
expect(sixthBalanceValue).toBeGreaterThan(lastBalanceValue);
|
||||
expect(lastBalanceValue).toBeCloseTo(0, 0);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,487 @@
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import {
|
||||
AmortizationCalculator,
|
||||
type AmortizationParams,
|
||||
StandardAmortizationCalculator,
|
||||
} from './amortization-calculator.service';
|
||||
|
||||
describe('AmortizationCalculator', () => {
|
||||
describe('validation methods', () => {
|
||||
describe('validateLoanAmount', () => {
|
||||
it('validates positive numbers', () => {
|
||||
expect(AmortizationCalculator.validateLoanAmount('100000')).toBe(true);
|
||||
expect(AmortizationCalculator.validateLoanAmount('1.5')).toBe(true);
|
||||
expect(AmortizationCalculator.validateLoanAmount('0.01')).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects zero and negative numbers', () => {
|
||||
expect(AmortizationCalculator.validateLoanAmount('0')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanAmount('-100')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects invalid inputs', () => {
|
||||
expect(AmortizationCalculator.validateLoanAmount('')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanAmount('abc')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanAmount('NaN')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects infinity', () => {
|
||||
expect(AmortizationCalculator.validateLoanAmount('Infinity')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateLoanMonths', () => {
|
||||
it('validates positive integers', () => {
|
||||
expect(AmortizationCalculator.validateLoanMonths('12')).toBe(true);
|
||||
expect(AmortizationCalculator.validateLoanMonths('360')).toBe(true);
|
||||
expect(AmortizationCalculator.validateLoanMonths('1')).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects non-integers', () => {
|
||||
expect(AmortizationCalculator.validateLoanMonths('12.5')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanMonths('1.1')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects zero and negative numbers', () => {
|
||||
expect(AmortizationCalculator.validateLoanMonths('0')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanMonths('-12')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects invalid inputs', () => {
|
||||
expect(AmortizationCalculator.validateLoanMonths('')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanMonths('abc')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateInterestRate', () => {
|
||||
it('validates fractional interest rates between 0 and 100', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('5.5')).toBe(true);
|
||||
expect(AmortizationCalculator.validateInterestRate('0.01')).toBe(true);
|
||||
expect(AmortizationCalculator.validateInterestRate('100')).toBe(true);
|
||||
expect(AmortizationCalculator.validateInterestRate('12.75')).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects rates above 100', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('100.01')).toBe(false);
|
||||
expect(AmortizationCalculator.validateInterestRate('200')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects zero and negative rates', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('0')).toBe(false);
|
||||
expect(AmortizationCalculator.validateInterestRate('-5')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects invalid inputs', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('')).toBe(false);
|
||||
expect(AmortizationCalculator.validateInterestRate('abc')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects infinity', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('Infinity')).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('StandardAmortizationCalculator', () => {
|
||||
let calculator: StandardAmortizationCalculator;
|
||||
|
||||
beforeEach(() => {
|
||||
calculator = new StandardAmortizationCalculator();
|
||||
});
|
||||
|
||||
describe('getPayment', () => {
|
||||
it('calculates correct payment for standard loan parameters', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005, // 0.5% monthly (6% annual)
|
||||
numberOfPayments: 360, // 30 years
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
|
||||
// Expected payment using standard amortization formula
|
||||
// P = L[c(1 + c)^n]/[(1 + c)^n - 1]
|
||||
// Where P is payment, L is loan amount, c is interest rate per period, n is number of periods
|
||||
expect(result.payment).toBeCloseTo(599.55, 2);
|
||||
expect(result.totalPayments).toBeCloseTo(215838, 0);
|
||||
});
|
||||
|
||||
it('calculates correct payment for short-term loan', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 10000,
|
||||
periodInterestRate: 0.01, // 1% monthly
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
|
||||
expect(result.payment).toBeCloseTo(888.49, 2);
|
||||
expect(result.totalPayments).toBeCloseTo(10661.85, 2);
|
||||
});
|
||||
|
||||
it('calculates correct payment with zero interest rate', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 12000,
|
||||
periodInterestRate: 0,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
|
||||
// With 0% interest, payment should be principal / numberOfPayments
|
||||
expect(result.payment).toBe(1000);
|
||||
expect(result.totalPayments).toBe(12000);
|
||||
});
|
||||
|
||||
it('caches payment calculations', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 50000,
|
||||
periodInterestRate: 0.004,
|
||||
numberOfPayments: 180,
|
||||
};
|
||||
|
||||
const result1 = calculator.getPayment(params);
|
||||
const result2 = calculator.getPayment(params);
|
||||
|
||||
// Should return the same object reference from cache
|
||||
expect(result1).toBe(result2);
|
||||
expect(result1.payment).toBeCloseTo(390.21, 2);
|
||||
});
|
||||
|
||||
it('calculates different payments for different parameters', () => {
|
||||
const params1: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const params2: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.004,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result1 = calculator.getPayment(params1);
|
||||
const result2 = calculator.getPayment(params2);
|
||||
|
||||
expect(result1.payment).not.toBe(result2.payment);
|
||||
expect(result1.payment).toBeGreaterThan(result2.payment);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getNth', () => {
|
||||
it('calculates correct values for first payment', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result = calculator.getNth(params, 1);
|
||||
|
||||
expect(result.paymentIndex).toBe(1);
|
||||
expect(result.payment).toBeCloseTo(599.55, 2);
|
||||
|
||||
// First payment: more interest, less principal in standard amortization
|
||||
expect(result.interestPayment).toBeCloseTo(500, 2); // 100000 * 0.005
|
||||
expect(result.principalPayment).toBeCloseTo(99.55, 2); // 599.55 - 500
|
||||
expect(result.remainingBalance).toBeCloseTo(99900.45, 2); // 100000 - 99.55
|
||||
|
||||
// Payment should equal principal + interest
|
||||
expect(result.principalPayment + result.interestPayment).toBeCloseTo(result.payment, 2);
|
||||
});
|
||||
|
||||
it('calculates correct values for middle payment', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result = calculator.getNth(params, 180);
|
||||
|
||||
expect(result.paymentIndex).toBe(180);
|
||||
expect(result.remainingBalance).toBeGreaterThan(0);
|
||||
expect(result.remainingBalance).toBeLessThan(params.principal);
|
||||
expect(result.principalPayment + result.interestPayment).toBeCloseTo(result.payment, 2);
|
||||
});
|
||||
|
||||
it('calculates correct values for final payment', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result = calculator.getNth(params, 360);
|
||||
|
||||
expect(result.paymentIndex).toBe(360);
|
||||
// Last payment should have remaining balance close to 0
|
||||
expect(result.remainingBalance).toBeCloseTo(0, 0);
|
||||
expect(result.principalPayment + result.interestPayment).toBeCloseTo(result.payment, 2);
|
||||
});
|
||||
|
||||
it('shows increasing principal payment over time for standard amortization', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const payment1 = calculator.getNth(params, 1);
|
||||
const payment180 = calculator.getNth(params, 180);
|
||||
const payment360 = calculator.getNth(params, 360);
|
||||
|
||||
// In standard amortization, principal payment increases as balance decreases
|
||||
expect(payment1.principalPayment).toBeLessThan(payment180.principalPayment);
|
||||
expect(payment180.principalPayment).toBeLessThan(payment360.principalPayment);
|
||||
});
|
||||
|
||||
it('shows decreasing interest payment over time', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const payment1 = calculator.getNth(params, 1);
|
||||
const payment180 = calculator.getNth(params, 180);
|
||||
const payment360 = calculator.getNth(params, 360);
|
||||
|
||||
// Interest payment should decrease over time
|
||||
expect(payment1.interestPayment).toBeGreaterThan(payment180.interestPayment);
|
||||
expect(payment180.interestPayment).toBeGreaterThan(payment360.interestPayment);
|
||||
});
|
||||
|
||||
it('handles zero interest rate correctly', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 12000,
|
||||
periodInterestRate: 0,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const result = calculator.getNth(params, 1);
|
||||
|
||||
expect(result.payment).toBe(1000);
|
||||
expect(result.interestPayment).toBe(0);
|
||||
expect(result.principalPayment).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getAmortizationSchedule', () => {
|
||||
it('generates complete amortization schedule with month and year rows', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 10000,
|
||||
periodInterestRate: 0.01,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
|
||||
// 12 months + 1 year summary row = 13 total
|
||||
expect(schedule).toHaveLength(13);
|
||||
expect(schedule[0].paymentIndex).toBe(1);
|
||||
expect(schedule[0].type).toBe('month');
|
||||
expect(schedule[11].paymentIndex).toBe(12);
|
||||
expect(schedule[11].type).toBe('month');
|
||||
expect(schedule[12].type).toBe('year');
|
||||
expect(schedule[12].paymentIndex).toBe(1); // Year 1
|
||||
});
|
||||
|
||||
it('ensures each payment has consistent structure', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 50000,
|
||||
periodInterestRate: 0.004,
|
||||
numberOfPayments: 60,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
|
||||
// 60 months + 5 year summary rows = 65 total
|
||||
expect(schedule).toHaveLength(65);
|
||||
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
const yearRows = schedule.filter(row => row.type === 'year');
|
||||
|
||||
expect(monthRows).toHaveLength(60);
|
||||
expect(yearRows).toHaveLength(5);
|
||||
|
||||
monthRows.forEach((payment, index) => {
|
||||
expect(payment).toHaveProperty('paymentIndex');
|
||||
expect(payment).toHaveProperty('payment');
|
||||
expect(payment).toHaveProperty('principalPayment');
|
||||
expect(payment).toHaveProperty('interestPayment');
|
||||
expect(payment).toHaveProperty('remainingBalance');
|
||||
expect(payment).toHaveProperty('totalPayments');
|
||||
expect(payment).toHaveProperty('type');
|
||||
|
||||
expect(payment.paymentIndex).toBe(index + 1);
|
||||
expect(payment.principalPayment + payment.interestPayment).toBeCloseTo(payment.payment, 2);
|
||||
});
|
||||
});
|
||||
|
||||
it('shows decreasing remaining balance over time', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 20000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 24,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
|
||||
// Filter to only month rows for balance comparison
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
|
||||
for (let i = 1; i < monthRows.length; i++) {
|
||||
expect(monthRows[i].remainingBalance).toBeLessThan(monthRows[i - 1].remainingBalance);
|
||||
}
|
||||
});
|
||||
|
||||
it('ends with near-zero remaining balance', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 15000,
|
||||
periodInterestRate: 0.0075,
|
||||
numberOfPayments: 36,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
const lastMonthPayment = monthRows[monthRows.length - 1];
|
||||
|
||||
expect(lastMonthPayment.remainingBalance).toBeCloseTo(0, 0);
|
||||
});
|
||||
|
||||
it('handles single payment loan', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 1000,
|
||||
periodInterestRate: 0.05,
|
||||
numberOfPayments: 1,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
|
||||
// Single payment with no year summary (< 12 months)
|
||||
expect(schedule).toHaveLength(1);
|
||||
expect(schedule[0].paymentIndex).toBe(1);
|
||||
expect(schedule[0].type).toBe('month');
|
||||
expect(schedule[0].payment).toBeCloseTo(1050, 2);
|
||||
});
|
||||
|
||||
it('maintains consistent payment amount throughout schedule', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 25000,
|
||||
periodInterestRate: 0.006,
|
||||
numberOfPayments: 48,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
const firstPayment = monthRows[0].payment;
|
||||
|
||||
monthRows.forEach((payment) => {
|
||||
expect(payment.payment).toBeCloseTo(firstPayment, 2);
|
||||
});
|
||||
});
|
||||
|
||||
it('includes year summary rows after every 12 months', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 24,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
const yearRows = schedule.filter(row => row.type === 'year');
|
||||
|
||||
expect(yearRows).toHaveLength(2); // 2 years
|
||||
expect(yearRows[0].paymentIndex).toBe(1); // Year 1
|
||||
expect(yearRows[1].paymentIndex).toBe(2); // Year 2
|
||||
});
|
||||
|
||||
it('year summary rows contain cumulative totals', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 10000,
|
||||
periodInterestRate: 0.01,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
const yearRows = schedule.filter(row => row.type === 'year');
|
||||
|
||||
// Calculate cumulative totals for the year
|
||||
const totalPrincipal = monthRows.reduce((sum, row) => sum + row.principalPayment, 0);
|
||||
const totalInterest = monthRows.reduce((sum, row) => sum + row.interestPayment, 0);
|
||||
|
||||
expect(yearRows[0].principalPayment).toBeCloseTo(totalPrincipal, 2);
|
||||
expect(yearRows[0].interestPayment).toBeCloseTo(totalInterest, 2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('edge cases', () => {
|
||||
it('handles very small loan amounts', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100,
|
||||
periodInterestRate: 0.01,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
expect(result.payment).toBeGreaterThan(0);
|
||||
expect(result.totalPayments).toBeGreaterThan(params.principal);
|
||||
});
|
||||
|
||||
it('handles very large loan amounts', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 10000000,
|
||||
periodInterestRate: 0.003,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
expect(result.payment).toBeGreaterThan(0);
|
||||
expect(Number.isFinite(result.payment)).toBe(true);
|
||||
});
|
||||
|
||||
it('handles very low interest rates', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 50000,
|
||||
periodInterestRate: 0.0001,
|
||||
numberOfPayments: 60,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
expect(result.payment).toBeGreaterThan(params.principal / params.numberOfPayments);
|
||||
});
|
||||
|
||||
it('handles short loan terms', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 5000,
|
||||
periodInterestRate: 0.02,
|
||||
numberOfPayments: 3,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
// 3 months, no year summary (< 12 months)
|
||||
expect(schedule).toHaveLength(3);
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
expect(monthRows[2].remainingBalance).toBeCloseTo(0, 0);
|
||||
});
|
||||
|
||||
it('handles long loan terms', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 200000,
|
||||
periodInterestRate: 0.004,
|
||||
numberOfPayments: 480, // 40 years
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
// 480 months + 40 year summary rows = 520 total
|
||||
expect(schedule).toHaveLength(520);
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
expect(monthRows).toHaveLength(480);
|
||||
expect(monthRows[479].remainingBalance).toBeCloseTo(0, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,183 @@
|
||||
export interface AmortizationParams {
|
||||
readonly principal: number
|
||||
readonly periodInterestRate: number
|
||||
readonly numberOfPayments: number
|
||||
}
|
||||
|
||||
export interface CachedPaymentResults {
|
||||
readonly payment: number
|
||||
readonly totalPayments: number
|
||||
}
|
||||
|
||||
export interface GetNthResult extends CachedPaymentResults {
|
||||
readonly paymentIndex: number
|
||||
readonly principalPayment: number
|
||||
readonly interestPayment: number
|
||||
readonly remainingBalance: number
|
||||
}
|
||||
|
||||
export interface AmortizationScheduleItem extends GetNthResult {
|
||||
readonly type: 'month' | 'year'
|
||||
}
|
||||
|
||||
type AmortizationPaymentCacheKey = `principal:${number};interest-rate:${number};number-of-payments:${number}`;
|
||||
|
||||
export abstract class AmortizationCalculator {
|
||||
public static validateLoanAmount(str: string): boolean {
|
||||
return AmortizationCalculator.validatePositive(str);
|
||||
}
|
||||
|
||||
public static validateLoanMonths(str: string): boolean {
|
||||
return AmortizationCalculator.validatePositiveInteger(str);
|
||||
}
|
||||
|
||||
public static validateInterestRate(str: string): boolean {
|
||||
return AmortizationCalculator.validateFractional(str);
|
||||
}
|
||||
|
||||
abstract getNth(params: AmortizationParams, paymentIndex: number): GetNthResult;
|
||||
|
||||
public *getAmortizationSchedule(params: AmortizationParams): Generator<AmortizationScheduleItem> {
|
||||
let period = 0;
|
||||
let periodTotalPrincipal = 0;
|
||||
let periodTotalInterest = 0;
|
||||
|
||||
while (period < params.numberOfPayments) {
|
||||
const periodResults = this.getNth(params, ++period);
|
||||
|
||||
periodTotalPrincipal += periodResults.principalPayment;
|
||||
periodTotalInterest += periodResults.interestPayment;
|
||||
|
||||
yield {
|
||||
...periodResults,
|
||||
type: 'month',
|
||||
};
|
||||
|
||||
// Yield yearly totals at end of year
|
||||
if (period % 12 === 0) {
|
||||
yield {
|
||||
...periodResults,
|
||||
paymentIndex: period / 12,
|
||||
principalPayment: periodTotalPrincipal,
|
||||
interestPayment: periodTotalInterest,
|
||||
type: 'year',
|
||||
};
|
||||
|
||||
periodTotalPrincipal = 0;
|
||||
periodTotalInterest = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public getPayment(params: AmortizationParams): CachedPaymentResults {
|
||||
const cacheKey = this.getCacheString(params);
|
||||
const cache = this.paymentCache.get(cacheKey);
|
||||
|
||||
if (!cache) {
|
||||
const payment = this.calculatePayment(params);
|
||||
const totalPayments = this.calculateTotalPayments(params, payment);
|
||||
|
||||
const paymentResult = {
|
||||
payment,
|
||||
totalPayments,
|
||||
};
|
||||
|
||||
this.paymentCache.set(cacheKey, paymentResult);
|
||||
|
||||
return paymentResult;
|
||||
}
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
/** Private Methods */
|
||||
private paymentCache: Map<AmortizationPaymentCacheKey, CachedPaymentResults> = new Map();
|
||||
|
||||
private calculatePayment({ principal, periodInterestRate, numberOfPayments }: AmortizationParams): number {
|
||||
if (periodInterestRate === 0) {
|
||||
return principal / numberOfPayments;
|
||||
}
|
||||
|
||||
const numerator = periodInterestRate * (1 + periodInterestRate) ** numberOfPayments;
|
||||
const denominator = (1 + periodInterestRate) ** numberOfPayments - 1;
|
||||
|
||||
return principal * (numerator / denominator);
|
||||
}
|
||||
|
||||
private calculateTotalPayments({ numberOfPayments }: AmortizationParams, payment: number): number {
|
||||
return payment * numberOfPayments;
|
||||
}
|
||||
|
||||
private getCacheString({
|
||||
principal,
|
||||
periodInterestRate,
|
||||
numberOfPayments,
|
||||
}: AmortizationParams): AmortizationPaymentCacheKey {
|
||||
return `principal:${principal};interest-rate:${periodInterestRate};number-of-payments:${numberOfPayments}`;
|
||||
}
|
||||
|
||||
private static validatePositiveInteger(str: string): boolean {
|
||||
const parsed = Number(str);
|
||||
|
||||
return !Number.isNaN(parsed) && Number.isSafeInteger(parsed) && parsed > 0;
|
||||
}
|
||||
|
||||
private static validateFractional(str: string): boolean {
|
||||
const parsed = Number(str);
|
||||
|
||||
return !Number.isNaN(parsed) && Number.isFinite(parsed) && parsed <= 100 && parsed > 0;
|
||||
}
|
||||
|
||||
private static validatePositive(str: string): boolean {
|
||||
const parsed = Number(str);
|
||||
|
||||
return !Number.isNaN(parsed) && Number.isFinite(parsed) && parsed > 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An amortization calculator that uses the standard amortization formula
|
||||
* where interest is calculated on the remaining balance and principal
|
||||
* payment is the difference between the fixed payment and interest
|
||||
*/
|
||||
export class StandardAmortizationCalculator extends AmortizationCalculator {
|
||||
getNth(params: AmortizationParams, paymentIndex: number): GetNthResult {
|
||||
const { payment, totalPayments } = this.getPayment(params);
|
||||
|
||||
const { principal, periodInterestRate, numberOfPayments } = params;
|
||||
|
||||
if (periodInterestRate === 0) {
|
||||
const principalPayment = principal / numberOfPayments;
|
||||
const remainingBalance = principal - principalPayment * paymentIndex;
|
||||
|
||||
return {
|
||||
payment,
|
||||
totalPayments,
|
||||
remainingBalance: Math.max(0, remainingBalance),
|
||||
interestPayment: 0,
|
||||
principalPayment,
|
||||
paymentIndex,
|
||||
};
|
||||
}
|
||||
|
||||
const r = 1 + periodInterestRate;
|
||||
|
||||
const balanceBeforePayment
|
||||
= principal * r ** (paymentIndex - 1) - payment * ((r ** (paymentIndex - 1) - 1) / periodInterestRate);
|
||||
|
||||
const interestPayment = balanceBeforePayment * periodInterestRate;
|
||||
|
||||
const principalPayment = payment - interestPayment;
|
||||
|
||||
const remainingBalance = balanceBeforePayment - principalPayment;
|
||||
|
||||
return {
|
||||
payment,
|
||||
totalPayments,
|
||||
remainingBalance,
|
||||
interestPayment,
|
||||
principalPayment,
|
||||
paymentIndex,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { AmortizationCalculator, StandardAmortizationCalculator } from './amortization-calculator.service';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const amortizationCalculator = ref(new StandardAmortizationCalculator());
|
||||
|
||||
const currencyDisplayNames = computed(() => new Intl.DisplayNames(locale.value, { type: 'currency' }));
|
||||
|
||||
const supportedCurrencies = ref(
|
||||
Intl.supportedValuesOf('currency').map(value => ({
|
||||
value,
|
||||
label: currencyDisplayNames.value.of(value),
|
||||
})),
|
||||
);
|
||||
|
||||
const selectedCurrency = useQueryParamOrStorage({
|
||||
name: 'selectedCurrency',
|
||||
storageName: 'amortization-calculator:selectedCurrency',
|
||||
defaultValue: 'USD',
|
||||
});
|
||||
|
||||
const loanAmount = useQueryParamOrStorage({
|
||||
name: 'amount',
|
||||
storageName: 'amortization-calculator:amount',
|
||||
defaultValue: '200000',
|
||||
});
|
||||
const loanAmountValidation = useValidation({
|
||||
source: loanAmount,
|
||||
rules: [
|
||||
{
|
||||
message: t('tools.amortization-calculator.texts.message-loan-amount-must-be-positive'),
|
||||
validator: AmortizationCalculator.validateLoanAmount,
|
||||
},
|
||||
],
|
||||
});
|
||||
const parsedLoanAmount = computed(() => Number(loanAmount.value));
|
||||
|
||||
const loanMonths = useQueryParamOrStorage({
|
||||
name: 'months',
|
||||
storageName: 'amortization-calculator:months',
|
||||
defaultValue: '360',
|
||||
});
|
||||
const loanMonthsValidation = useValidation({
|
||||
source: loanMonths,
|
||||
rules: [
|
||||
{
|
||||
message: t('tools.amortization-calculator.texts.message-loan-term-must-be-positive-integer'),
|
||||
validator: AmortizationCalculator.validateLoanMonths,
|
||||
},
|
||||
],
|
||||
});
|
||||
const parsedLoanMonths = computed(() => Number(loanMonths.value));
|
||||
|
||||
const interestRate = useQueryParamOrStorage({
|
||||
name: 'interestRate',
|
||||
storageName: 'amortization-calculator:interestRate',
|
||||
defaultValue: '6',
|
||||
});
|
||||
const interestRateValidation = useValidation({
|
||||
source: interestRate,
|
||||
rules: [
|
||||
{
|
||||
message: t('tools.amortization-calculator.texts.message-interest-rate-must-be-between-1-and-100'),
|
||||
validator: AmortizationCalculator.validateInterestRate,
|
||||
},
|
||||
],
|
||||
});
|
||||
const parsedInterestRate = computed(() => Number(interestRate.value));
|
||||
|
||||
const allValid = computed(
|
||||
() => interestRateValidation.isValid && loanMonthsValidation.isValid && loanAmountValidation.isValid,
|
||||
);
|
||||
|
||||
const payment = computed(() =>
|
||||
amortizationCalculator.value.getPayment({
|
||||
principal: parsedLoanAmount.value,
|
||||
periodInterestRate: parsedInterestRate.value / 1200,
|
||||
numberOfPayments: parsedLoanMonths.value,
|
||||
}),
|
||||
);
|
||||
|
||||
const amortizationSchedule = computed(() => {
|
||||
// Force re-render on currency changes
|
||||
// i.e. redeclare generator
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
selectedCurrency.value;
|
||||
return amortizationCalculator.value.getAmortizationSchedule({
|
||||
principal: parsedLoanAmount.value,
|
||||
periodInterestRate: parsedInterestRate.value / 1200,
|
||||
numberOfPayments: parsedLoanMonths.value,
|
||||
});
|
||||
});
|
||||
|
||||
function formatCurrency(num: number): string {
|
||||
return num.toLocaleString(undefined, {
|
||||
style: 'currency',
|
||||
currency: selectedCurrency.value,
|
||||
// "negative" is a valid value for signDisplay and supported by all major browsers:
|
||||
// https://caniuse.com/mdn-javascript_builtins_intl_numberformat_numberformat_options_parameter_options_signdisplay_parameter_negative
|
||||
signDisplay: 'negative' as any,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card :title="t('tools.amortization-calculator.texts.title-loan-parameters')" mb-5>
|
||||
<c-input-text
|
||||
v-model:value="loanAmount"
|
||||
placeholder="e.g. 200000"
|
||||
:label="t('tools.amortization-calculator.texts.label-loan-amount')"
|
||||
raw-text
|
||||
mb-5
|
||||
:validation="loanAmountValidation"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="loanMonths"
|
||||
placeholder="e.g. 360"
|
||||
:label="t('tools.amortization-calculator.texts.label-loan-term')"
|
||||
raw-text
|
||||
mb-5
|
||||
:validation="loanMonthsValidation"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="interestRate"
|
||||
placeholder="e.g. 6.0"
|
||||
:label="t('tools.amortization-calculator.texts.label-interest-rate')"
|
||||
raw-text
|
||||
mb-5
|
||||
:validation="interestRateValidation"
|
||||
/>
|
||||
|
||||
<c-select v-model:value="selectedCurrency" :options="supportedCurrencies" :label="t('tools.amortization-calculator.texts.label-displayed-currency')" mb-5 />
|
||||
</c-card>
|
||||
|
||||
<div v-if="allValid">
|
||||
<n-table mb-5>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-monthly-payment') }}</th>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-total-of-payments') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
{{ formatCurrency(payment.payment) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ formatCurrency(payment.totalPayments) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
<n-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-month') }}</th>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-interest') }}</th>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-principal') }}</th>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-ending-balance') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="period in amortizationSchedule" :key="period.type + period.paymentIndex">
|
||||
<template v-if="period.type === 'month'">
|
||||
<td>{{ period.paymentIndex }}</td>
|
||||
<td>{{ formatCurrency(period.interestPayment) }}</td>
|
||||
<td>{{ formatCurrency(period.principalPayment) }}</td>
|
||||
<td>{{ formatCurrency(period.remainingBalance) }}</td>
|
||||
</template>
|
||||
<template v-else>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-end-of-year', { year: period.paymentIndex }) }}</th>
|
||||
<th>{{ formatCurrency(period.interestPayment) }}</th>
|
||||
<th>{{ formatCurrency(period.principalPayment) }}</th>
|
||||
<th>{{ formatCurrency(period.remainingBalance) }}</th>
|
||||
</template>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { ReportMoney } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.amortization-calculator.title'),
|
||||
path: '/amortization-calculator',
|
||||
description: t('tools.amortization-calculator.description'),
|
||||
keywords: ['amortization', 'calculator'],
|
||||
component: () => import('./amortization-calculator.vue'),
|
||||
icon: ReportMoney,
|
||||
createdAt: new Date('2025-11-22'),
|
||||
category: 'Finance',
|
||||
});
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Angle } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: translate('tools.angle-converter.title'),
|
||||
name: t('tools.angle-converter.title'),
|
||||
path: '/angle-converter',
|
||||
description: translate('tools.angle-converter.description'),
|
||||
keywords: ['angle', 'converter'],
|
||||
description: t('tools.angle-converter.description'),
|
||||
keywords: ['angle', 'converter',
|
||||
'units', 'degree', 'radian', 'turn', 'grad',
|
||||
],
|
||||
component: () => import('./angle-converter.vue'),
|
||||
icon: Angle,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import {
|
||||
NButton, NCheckbox, NCheckboxGroup, NInput,
|
||||
} from 'naive-ui';
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
import '@xterm/xterm/css/xterm.css';
|
||||
import styles from 'ansi-styles';
|
||||
import type { CSPair } from 'ansi-styles';
|
||||
import { useQueryParam, useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const terminalContainer = ref<HTMLElement | null>(null);
|
||||
|
||||
const decoratedText = useQueryParamOrStorage({ name: 'text', storageName: 'ansi:t', defaultValue: 'Sample text' });
|
||||
const foregroundColor = useQueryParamOrStorage({ name: 'fg', storageName: 'ansi:fg', defaultValue: '' });
|
||||
const backgroundColor = useQueryParamOrStorage({ name: 'bg', storageName: 'ansi:bg', defaultValue: '' });
|
||||
const fontStyles = useQueryParamOrStorage({ name: 'styles', storageName: 'ansi:st', defaultValue: [] });
|
||||
const colorMode = useQueryParamOrStorage({ name: 'mode', storageName: 'ansi:m', defaultValue: '256' });
|
||||
|
||||
const outputEscapeSequence = computed(() => {
|
||||
let openSeq = '';
|
||||
let closeSeq = '';
|
||||
|
||||
if (foregroundColor.value) {
|
||||
if (colorMode.value === 'basic') {
|
||||
openSeq += styles.color.ansi(styles.hexToAnsi(foregroundColor.value));
|
||||
}
|
||||
else if (colorMode.value === '256') {
|
||||
openSeq += styles.color.ansi256(styles.hexToAnsi256(foregroundColor.value));
|
||||
}
|
||||
else {
|
||||
openSeq += styles.color.ansi16m(...styles.hexToRgb(foregroundColor.value));
|
||||
}
|
||||
closeSeq = styles.color.close + closeSeq;
|
||||
}
|
||||
if (backgroundColor.value) {
|
||||
if (colorMode.value === 'basic') {
|
||||
openSeq += styles.bgColor.ansi(styles.hexToAnsi(backgroundColor.value));
|
||||
}
|
||||
else if (colorMode.value === '256') {
|
||||
openSeq += styles.bgColor.ansi256(styles.hexToAnsi256(backgroundColor.value));
|
||||
}
|
||||
else {
|
||||
openSeq += styles.bgColor.ansi16m(...styles.hexToRgb(backgroundColor.value));
|
||||
}
|
||||
closeSeq = styles.bgColor.close + closeSeq;
|
||||
}
|
||||
|
||||
fontStyles.value.forEach((style) => {
|
||||
if (styles.modifier[style]) {
|
||||
openSeq += (styles.modifier[style] as CSPair).open;
|
||||
closeSeq = (styles.modifier[style] as CSPair).close + closeSeq;
|
||||
}
|
||||
});
|
||||
|
||||
return `${openSeq}${decoratedText.value}${closeSeq}`;
|
||||
});
|
||||
|
||||
let term: Terminal;
|
||||
function writeTermAndScrollBottom(text: string) {
|
||||
if (!term) {
|
||||
return;
|
||||
}
|
||||
term.writeln(text);
|
||||
term.scrollToBottom();
|
||||
}
|
||||
onMounted(() => {
|
||||
term = new Terminal({
|
||||
rows: 5,
|
||||
});
|
||||
term.open(terminalContainer.value!);
|
||||
writeTermAndScrollBottom(outputEscapeSequence.value);
|
||||
});
|
||||
|
||||
watch(outputEscapeSequence, seq => writeTermAndScrollBottom(seq), { immediate: true });
|
||||
|
||||
const escapeSequenceToTest = useQueryParam({ tool: 'ansi', name: 'seq', defaultValue: '' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<NSpace justify="center">
|
||||
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-mode')" label-placement="left">
|
||||
<n-radio-group v-model:value="colorMode">
|
||||
<n-radio value="basic">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-basic') }}
|
||||
</n-radio>
|
||||
<n-radio value="256">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-256-color') }}
|
||||
</n-radio>
|
||||
<n-radio value="truecolor">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-truecolor') }}
|
||||
</n-radio>
|
||||
</n-radio-group>
|
||||
</n-form-item>
|
||||
</NSpace>
|
||||
|
||||
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-foreground')" label-placement="left" mb-1>
|
||||
<n-color-picker v-model:value="foregroundColor" :modes="['hex']" :show-alpha="false" :actions="['clear']" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-background')" label-placement="left" mb-1>
|
||||
<n-color-picker v-model:value="backgroundColor" :modes="['hex']" :show-alpha="false" :actions="['clear']" />
|
||||
</n-form-item>
|
||||
|
||||
<NSpace justify="center" mb-1>
|
||||
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-styles')" label-placement="left">
|
||||
<NCheckboxGroup v-model:value="fontStyles">
|
||||
<NCheckbox value="bold">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-bold') }}
|
||||
</NCheckbox>
|
||||
<NCheckbox value="italic">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-italic') }}
|
||||
</NCheckbox>
|
||||
<NCheckbox value="underline">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-underline') }}
|
||||
</NCheckbox>
|
||||
<NCheckbox value="overline">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-overline') }}
|
||||
</NCheckbox>
|
||||
<NCheckbox value="inverse">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-inverse') }}
|
||||
</NCheckbox>
|
||||
<NCheckbox value="dim">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-dim') }}
|
||||
</NCheckbox>
|
||||
<NCheckbox value="strikethrough">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-strikethrough') }}
|
||||
</NCheckbox>
|
||||
</NCheckboxGroup>
|
||||
</n-form-item>
|
||||
</NSpace>
|
||||
|
||||
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-decorated-text')" label-placement="left" mb-1>
|
||||
<NInput v-model:value="decoratedText" :placeholder="t('tools.ansi-escape-tester.texts.placeholder-enter-text')" />
|
||||
</n-form-item>
|
||||
|
||||
<c-card :title="t('tools.ansi-escape-tester.texts.title-output-ansi-escape-sequence')">
|
||||
<input-copyable v-model:value="outputEscapeSequence" readonly />
|
||||
</c-card>
|
||||
<c-card :title="t('tools.ansi-escape-tester.texts.title-terminal-preview')">
|
||||
<n-form-item label-placement="left" :label="t('tools.ansi-escape-tester.texts.label-custom-ansi-sequence')">
|
||||
<NInput v-model:value="escapeSequenceToTest" :placeholder="t('tools.ansi-escape-tester.texts.placeholder-enter-ansi-escape-sequence')" />
|
||||
<NButton type="primary" ml-1 @click="term?.writeln(escapeSequenceToTest)">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-test') }}
|
||||
</NButton>
|
||||
<NButton type="primary" ml-1 @click="term?.clear()">
|
||||
{{ t('tools.ansi-escape-tester.texts.tag-clear') }}
|
||||
</NButton>
|
||||
</n-form-item>
|
||||
<div ref="terminalContainer" class="terminal" />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.terminal {
|
||||
height: 6em;
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
Loaded 100 of 1068 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user