mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 06:40:20 +03:00
Compare commits
46
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
name: Deploy static content to Pages
|
||||
|
||||
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: 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@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
|
||||
+126
@@ -2,6 +2,132 @@
|
||||
|
||||
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 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
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`.
|
||||
|
||||
### Check out these change here: <https://sharevb-it-tools.vercel.app/>
|
||||
### 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 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.
|
||||
|
||||
@@ -10,6 +10,13 @@ You can use my image in your docker-compose file if you want an update to date v
|
||||
|
||||
(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)
|
||||
|
||||
|
||||
## Added features
|
||||
|
||||
Almost [all tools PR of it-tools](https://github.com/sharevb/it-tools/pulls).
|
||||
@@ -20,6 +27,17 @@ Almost [all tools PR of it-tools](https://github.com/sharevb/it-tools/pulls).
|
||||
|
||||
[Docker Hub](https://hub.docker.com/r/sharevb/it-tools): `sharevb/it-tools:latest`
|
||||
|
||||
## HTTPS is recommanded
|
||||
|
||||
Some tools like PGP encryption rely on WebCrypto API that is only available in HTTPS/SSL.
|
||||
|
||||
So even on internal installations, you can 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
|
||||
|
||||
## Use in Docker Compose file
|
||||
|
||||
```yml
|
||||
@@ -95,72 +113,7 @@ 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:
|
||||
|
||||
.github/workflows/deploy-pages.yaml
|
||||
```yaml
|
||||
name: Deploy static content to Pages
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
# 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@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
|
||||
```
|
||||
2. Add the following GitHub action to your repo: https://github.com/sharevb/it-tools/.github/workflows/sharevb-github-pages-publish.yml
|
||||
|
||||
## Installation methods
|
||||
|
||||
|
||||
Vendored
+11
-24
@@ -12,6 +12,7 @@ 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']
|
||||
AngleConverter: typeof import('./src/tools/angle-converter/angle-converter.vue')['default']
|
||||
@@ -28,6 +29,8 @@ 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']
|
||||
@@ -84,6 +87,7 @@ 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']
|
||||
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']
|
||||
@@ -116,9 +120,7 @@ declare module '@vue/runtime-core' {
|
||||
DiffViewer: typeof import('./src/tools/json-diff/diff-viewer/diff-viewer.vue')['default']
|
||||
DistinctWords: typeof import('./src/tools/distinct-words/distinct-words.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']
|
||||
DnsQueries: typeof import('./src/tools/dns-queries/dns-queries.vue')['default']
|
||||
Docker: typeof import('./src/tools/docker-memo/docker.md')['default']
|
||||
@@ -260,6 +262,8 @@ 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']
|
||||
KeycodeInfo: typeof import('./src/tools/keycode-info/keycode-info.vue')['default']
|
||||
LengthConverter: typeof import('./src/tools/length-converter/length-converter.vue')['default']
|
||||
ListComparer: typeof import('./src/tools/list-comparer/list-comparer.vue')['default']
|
||||
@@ -298,36 +302,18 @@ declare module '@vue/runtime-core' {
|
||||
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']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
NInput: typeof import('naive-ui')['NInput']
|
||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
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']
|
||||
OcrImage: typeof import('./src/tools/ocr-image/ocr-image.vue')['default']
|
||||
@@ -346,6 +332,7 @@ declare module '@vue/runtime-core' {
|
||||
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,7 +350,6 @@ 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']
|
||||
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']
|
||||
@@ -400,7 +386,6 @@ declare module '@vue/runtime-core' {
|
||||
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']
|
||||
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
|
||||
@@ -445,6 +430,8 @@ 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']
|
||||
WebsocketTester: typeof import('./src/tools/websocket-tester/websocket-tester.vue')['default']
|
||||
WeekNumberConverter: typeof import('./src/tools/week-number-converter/week-number-converter.vue')['default']
|
||||
|
||||
+2
-2
@@ -448,7 +448,7 @@ tools:
|
||||
|
||||
image-resizer:
|
||||
title: Image resizer
|
||||
description: Convert the width and height of an image file, preview, and download it in a desired format (.jpg, .jpeg, .png, .bmp, .ico, .svg)
|
||||
description: Convert the width and height of an image file, preview, and download it in a desired format
|
||||
|
||||
json-to-object:
|
||||
title: JSON to object
|
||||
@@ -471,7 +471,7 @@ tools:
|
||||
message: SIP message
|
||||
message-tips: Paste your SIP message here...
|
||||
result: Result
|
||||
sucess: Sucess
|
||||
sucess: Success
|
||||
failure: Failure
|
||||
|
||||
uuid-converter:
|
||||
|
||||
+1
-1
@@ -443,7 +443,7 @@ tools:
|
||||
|
||||
image-resizer:
|
||||
title: Изменение размера изображения
|
||||
description: Изменяйте ширину и высоту изображения, предварительно просматривайте и загружайте его в нужном формате (.jpg, .jpeg, .png, .bmp, .ico, .svg).
|
||||
description: Изменяйте ширину и высоту изображения, предварительно просматривайте и загружайте его в нужном формате.
|
||||
|
||||
multi-link-downloader:
|
||||
title: Множественный загрузчик ссылок
|
||||
|
||||
+1
-1
@@ -446,7 +446,7 @@ tools:
|
||||
|
||||
image-resizer:
|
||||
title: Зміна розміру зображення
|
||||
description: Змініть ширину та висоту файлу зображення, перегляньте та завантажте його у бажаному форматі (.jpg, .jpeg, .png, .bmp, .ico, .svg).
|
||||
description: Змініть ширину та висоту файлу зображення, перегляньте та завантажте його у бажаному форматі.
|
||||
|
||||
json-to-object:
|
||||
title: JSON в об'єкт
|
||||
|
||||
@@ -5,6 +5,13 @@ server {
|
||||
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'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self'; font-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self';";
|
||||
location / {
|
||||
rewrite ^/it-tools/(.*) /$1 break;
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
+12
-6
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "it-tools",
|
||||
"type": "module",
|
||||
"version": "2025.4.21-70194069",
|
||||
"version": "2025.6.15-20a26514",
|
||||
"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)",
|
||||
@@ -125,7 +125,7 @@
|
||||
"duration-fns": "^3.0.2",
|
||||
"email-bounce-parser-browser": "^1.1.0",
|
||||
"email-normalizer": "^1.0.0",
|
||||
"emojilib": "^4.0.1",
|
||||
"emojilib": "^4.0.2",
|
||||
"event-cron-parser": "^1.0.35",
|
||||
"exif-be-gone": "^1.5.1",
|
||||
"exifreader": "^4.26.1",
|
||||
@@ -136,6 +136,7 @@
|
||||
"figue": "^1.2.0",
|
||||
"file-type": "^20.1.0",
|
||||
"flatten-anything": "^4.0.1",
|
||||
"flexsearch": "^0.8.167",
|
||||
"fuse.js": "^7.1.0",
|
||||
"generate-schema": "^2.6.0",
|
||||
"get-timezone-offset": "^1.0.5",
|
||||
@@ -218,7 +219,7 @@
|
||||
"netstack.js": "^2.1.1",
|
||||
"nginx-config-formatter": "^1.4.5",
|
||||
"node-forge": "^1.3.1",
|
||||
"openpgp": "^6.1.0",
|
||||
"openpgp": "^6.1.1",
|
||||
"oui-data": "^1.1.281",
|
||||
"parse-duration": "^2.1.2",
|
||||
"parse-torrent": "^11.0.18",
|
||||
@@ -261,14 +262,17 @@
|
||||
"svgo": "^3.3.2",
|
||||
"tesseract.js": "^5.1.1",
|
||||
"text-encoding-utf-8": "^1.0.2",
|
||||
"tick-time": "^1.0.1",
|
||||
"tidy-url": "^1.18.3",
|
||||
"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",
|
||||
"unicode-emoji-json": "^0.8.0",
|
||||
"unique-random": "^4.0.0",
|
||||
"unixcrypt-browser": "^2.0.4",
|
||||
"unpdf": "^1.0.5",
|
||||
"unplugin-auto-import": "^0.16.4",
|
||||
"utf8": "^3.0.0",
|
||||
"uuid": "^11.0.5",
|
||||
@@ -276,17 +280,18 @@
|
||||
"vue": "^3.3.4",
|
||||
"vue-color-wheel": "^0.1.1",
|
||||
"vue-i18n": "^9.14.3",
|
||||
"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",
|
||||
@@ -361,8 +366,9 @@
|
||||
"unplugin-icons": "^0.17.0",
|
||||
"unplugin-vue-components": "^0.25.0",
|
||||
"vite": "^4.4.9",
|
||||
"vite-plugin-node-polyfills": "^0.22.0",
|
||||
"vite-plugin-node-polyfills": "^0.23.0",
|
||||
"vite-plugin-pwa": "^1.0.0",
|
||||
"vite-plugin-splash-screen": "^0.2.0",
|
||||
"vite-plugin-vue-markdown": "^0.23.5",
|
||||
"vite-plugin-wasm": "^3.4.1",
|
||||
"vite-svg-loader": "^4.0.0",
|
||||
|
||||
Generated
+242
-183
@@ -273,8 +273,8 @@ dependencies:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0
|
||||
emojilib:
|
||||
specifier: ^4.0.1
|
||||
version: 4.0.1
|
||||
specifier: ^4.0.2
|
||||
version: 4.0.2
|
||||
event-cron-parser:
|
||||
specifier: ^1.0.35
|
||||
version: 1.0.35
|
||||
@@ -305,6 +305,9 @@ dependencies:
|
||||
flatten-anything:
|
||||
specifier: ^4.0.1
|
||||
version: 4.0.1
|
||||
flexsearch:
|
||||
specifier: ^0.8.167
|
||||
version: 0.8.167
|
||||
fuse.js:
|
||||
specifier: ^7.1.0
|
||||
version: 7.1.0
|
||||
@@ -552,8 +555,8 @@ dependencies:
|
||||
specifier: ^1.3.1
|
||||
version: 1.3.1
|
||||
openpgp:
|
||||
specifier: ^6.1.0
|
||||
version: 6.1.0
|
||||
specifier: ^6.1.1
|
||||
version: 6.1.1
|
||||
oui-data:
|
||||
specifier: ^1.1.281
|
||||
version: 1.1.281
|
||||
@@ -680,6 +683,9 @@ dependencies:
|
||||
text-encoding-utf-8:
|
||||
specifier: ^1.0.2
|
||||
version: 1.0.2
|
||||
tick-time:
|
||||
specifier: ^1.0.1
|
||||
version: 1.0.1
|
||||
tidy-url:
|
||||
specifier: ^1.18.3
|
||||
version: 1.18.3
|
||||
@@ -699,11 +705,17 @@ dependencies:
|
||||
specifier: ^2.3.0
|
||||
version: 2.3.0
|
||||
unicode-emoji-json:
|
||||
specifier: ^0.4.0
|
||||
version: 0.4.0
|
||||
specifier: ^0.8.0
|
||||
version: 0.8.0
|
||||
unique-random:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
unixcrypt-browser:
|
||||
specifier: ^2.0.4
|
||||
version: 2.0.4
|
||||
unpdf:
|
||||
specifier: ^1.0.5
|
||||
version: 1.0.5
|
||||
unplugin-auto-import:
|
||||
specifier: ^0.16.4
|
||||
version: 0.16.4(@vueuse/core@10.11.1)(rollup@2.79.2)
|
||||
@@ -725,6 +737,9 @@ dependencies:
|
||||
vue-i18n:
|
||||
specifier: ^9.14.3
|
||||
version: 9.14.4(vue@3.3.4)
|
||||
vue-loading-overlay:
|
||||
specifier: ^6.0
|
||||
version: 6.0.6(vue@3.3.4)
|
||||
vue-markdown-render:
|
||||
specifier: ^2.2.1
|
||||
version: 2.2.1(vue@3.3.4)
|
||||
@@ -743,9 +758,6 @@ dependencies:
|
||||
vue3-flip-countdown:
|
||||
specifier: ^0.1.6
|
||||
version: 0.1.6
|
||||
vue3-fortune-wheel:
|
||||
specifier: ^2.0.5
|
||||
version: 2.0.5(vue@3.3.4)
|
||||
vuedraggable:
|
||||
specifier: ^4.1.0
|
||||
version: 4.1.0(vue@3.3.4)
|
||||
@@ -758,6 +770,9 @@ dependencies:
|
||||
webcrack:
|
||||
specifier: ^2.15.0
|
||||
version: 2.15.0
|
||||
webcrypto-liner-shim:
|
||||
specifier: ^1.4.8
|
||||
version: 1.4.8
|
||||
webp-converter-browser:
|
||||
specifier: ^1.0.4
|
||||
version: 1.0.4
|
||||
@@ -977,11 +992,14 @@ devDependencies:
|
||||
specifier: ^4.4.9
|
||||
version: 4.4.9(@types/node@18.19.75)(less@4.2.2)
|
||||
vite-plugin-node-polyfills:
|
||||
specifier: ^0.22.0
|
||||
version: 0.22.0(rollup@2.79.2)(vite@4.4.9)
|
||||
specifier: ^0.23.0
|
||||
version: 0.23.0(rollup@2.79.2)(vite@4.4.9)
|
||||
vite-plugin-pwa:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(vite@4.4.9)(workbox-build@7.3.0)(workbox-window@7.3.0)
|
||||
vite-plugin-splash-screen:
|
||||
specifier: ^0.2.0
|
||||
version: 0.2.0
|
||||
vite-plugin-vue-markdown:
|
||||
specifier: ^0.23.5
|
||||
version: 0.23.5(rollup@2.79.2)(vite@4.4.9)
|
||||
@@ -5401,6 +5419,21 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@peculiar/asn1-schema@2.3.15:
|
||||
resolution: {integrity: sha512-QPeD8UA8axQREpgR5UTAfu2mqQmm97oUqahDtNdBcfj3qAnoXzFdQW+aNf/tD2WVXF8Fhmftxoj0eMIT++gX2w==}
|
||||
dependencies:
|
||||
asn1js: 3.0.6
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/@peculiar/json-schema@1.1.12:
|
||||
resolution: {integrity: sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==}
|
||||
engines: {node: '>=8.0.0'}
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/@pkgjs/parseargs@0.11.0:
|
||||
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -5621,7 +5654,6 @@ packages:
|
||||
estree-walker: 2.0.2
|
||||
picomatch: 4.0.2
|
||||
rollup: 2.79.2
|
||||
dev: true
|
||||
|
||||
/@rushstack/eslint-patch@1.2.0:
|
||||
resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==}
|
||||
@@ -5713,6 +5745,12 @@ packages:
|
||||
resolution: {integrity: sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/binary@1.0.1:
|
||||
resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==}
|
||||
dependencies:
|
||||
'@stablelib/int': 1.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/binary@2.0.1:
|
||||
resolution: {integrity: sha512-U9iAO8lXgEDONsA0zPPSgcf3HUBNAqHiJmSHgZz62OvC3Hi2Bhc5kTnQ3S1/L+sthDTHtCMhcEiklmIly6uQ3w==}
|
||||
dependencies:
|
||||
@@ -5742,10 +5780,18 @@ packages:
|
||||
'@stablelib/wipe': 2.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/hash@1.0.1:
|
||||
resolution: {integrity: sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/hash@2.0.0:
|
||||
resolution: {integrity: sha512-u3WPSqGido8lwJuMcrBgM5K54LrPGhkWAdtsyccf7dGsLixAZUds77zOAbu7bvKPwQlmoByH0txBi5rTmEKuHg==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/int@1.0.1:
|
||||
resolution: {integrity: sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/int@2.0.1:
|
||||
resolution: {integrity: sha512-Ht63fQp3wz/F8U4AlXEPb7hfJOIILs8Lq55jgtD7KueWtyjhVuzcsGLSTAWtZs3XJDZYdF1WcSKn+kBtbzupww==}
|
||||
dev: false
|
||||
@@ -5757,6 +5803,14 @@ packages:
|
||||
'@stablelib/wipe': 2.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/sha3@1.0.1:
|
||||
resolution: {integrity: sha512-82OHZcxWsJAS34L64VItIbqZdcdYgBJmeToYaou9lUA+iMjajdfOVZDDrditfV8C8yXUDrlS3BuMRWmKf9NQhQ==}
|
||||
dependencies:
|
||||
'@stablelib/binary': 1.0.1
|
||||
'@stablelib/hash': 1.0.1
|
||||
'@stablelib/wipe': 1.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/sha512@2.0.1:
|
||||
resolution: {integrity: sha512-DUNe5cbnoH3sSIN+MG04RvTCLXtkbyy/SnQxiNO+GgF/KSXkkUSlF6mUVvCUdZBZ2X3NgogR+tAvaRSn8wxnLw==}
|
||||
dependencies:
|
||||
@@ -5765,6 +5819,10 @@ packages:
|
||||
'@stablelib/wipe': 2.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/wipe@1.0.1:
|
||||
resolution: {integrity: sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/wipe@2.0.1:
|
||||
resolution: {integrity: sha512-1eU2K9EgOcV4qc9jcP6G72xxZxEm5PfeI5H55l08W95b4oRJaqhmlWRc4xZAm6IVSKhVNxMi66V67hCzzuMTAg==}
|
||||
dev: false
|
||||
@@ -6968,7 +7026,7 @@ packages:
|
||||
dependencies:
|
||||
'@unhead/dom': 0.5.1
|
||||
'@unhead/schema': 0.5.1
|
||||
'@vueuse/shared': 13.2.0(vue@3.3.4)
|
||||
'@vueuse/shared': 13.3.0(vue@3.3.4)
|
||||
unhead: 0.5.1
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
@@ -7640,8 +7698,8 @@ packages:
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
/@vueuse/shared@13.2.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-vx9ZPDF5HcU9up3Jgt3G62dMUfZEdk6tLyBAHYAG4F4n73vpaA7J5hdncDI/lS9Vm7GA/FPlbOmh9TrDZROTpg==}
|
||||
/@vueuse/shared@13.3.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-L1QKsF0Eg9tiZSFXTgodYnu0Rsa2P0En2LuLrIs/jgrkyiDuJSsPZK+tx+wU0mMsYHUYEjNsuE41uqqkuR8VhA==}
|
||||
peerDependencies:
|
||||
vue: ^3.5.0
|
||||
dependencies:
|
||||
@@ -7953,6 +8011,10 @@ packages:
|
||||
get-intrinsic: 1.3.0
|
||||
is-array-buffer: 3.0.5
|
||||
|
||||
/asmcrypto.js@2.3.2:
|
||||
resolution: {integrity: sha512-3FgFARf7RupsZETQ1nHnhLUUvpcttcCq1iZCaVAbJZbCZ5VNRrNyvpDyHTOb0KC3llFcsyOT/a99NZcCbeiEsA==}
|
||||
dev: false
|
||||
|
||||
/asn1.js@4.10.1:
|
||||
resolution: {integrity: sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==}
|
||||
dependencies:
|
||||
@@ -7967,6 +8029,15 @@ packages:
|
||||
safer-buffer: 2.1.2
|
||||
dev: false
|
||||
|
||||
/asn1js@3.0.6:
|
||||
resolution: {integrity: sha512-UOCGPYbl0tv8+006qks/dTgV9ajs97X2p0FAbyS2iyCRrmLSRolDaHdp+v/CLgnzHc3fVB+CwYiUmei7ndFcgA==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dependencies:
|
||||
pvtsutils: 1.3.6
|
||||
pvutils: 1.1.3
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/assert-plus@1.0.0:
|
||||
resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==}
|
||||
engines: {node: '>=0.8'}
|
||||
@@ -7975,10 +8046,10 @@ packages:
|
||||
/assert@2.1.0:
|
||||
resolution: {integrity: sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==}
|
||||
dependencies:
|
||||
call-bind: 1.0.5
|
||||
call-bind: 1.0.8
|
||||
is-nan: 1.3.2
|
||||
object-is: 1.1.6
|
||||
object.assign: 4.1.4
|
||||
object.assign: 4.1.7
|
||||
util: 0.12.5
|
||||
dev: true
|
||||
|
||||
@@ -8031,10 +8102,6 @@ packages:
|
||||
engines: {node: '>= 4.0.0'}
|
||||
dev: true
|
||||
|
||||
/available-typed-arrays@1.0.5:
|
||||
resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/available-typed-arrays@1.0.7:
|
||||
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8166,7 +8233,6 @@ packages:
|
||||
|
||||
/bn.js@4.12.1:
|
||||
resolution: {integrity: sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==}
|
||||
dev: true
|
||||
|
||||
/bn.js@5.2.1:
|
||||
resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==}
|
||||
@@ -8194,7 +8260,6 @@ packages:
|
||||
|
||||
/brorand@1.1.0:
|
||||
resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==}
|
||||
dev: true
|
||||
|
||||
/browser-or-node@3.0.0:
|
||||
resolution: {integrity: sha512-iczIdVJzGEYhP5DqQxYM9Hh7Ztpqqi+CXZpSmX8ALFs9ecXkQIeqRyM6TfxEfMVpwhl3dSuDvxdzzo9sUOIVBQ==}
|
||||
@@ -8362,13 +8427,6 @@ packages:
|
||||
moment-timezone: 0.5.47
|
||||
dev: false
|
||||
|
||||
/call-bind-apply-helpers@1.0.1:
|
||||
resolution: {integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
es-errors: 1.3.0
|
||||
function-bind: 1.1.2
|
||||
|
||||
/call-bind-apply-helpers@1.0.2:
|
||||
resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8376,13 +8434,6 @@ packages:
|
||||
es-errors: 1.3.0
|
||||
function-bind: 1.1.2
|
||||
|
||||
/call-bind@1.0.5:
|
||||
resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==}
|
||||
dependencies:
|
||||
function-bind: 1.1.2
|
||||
get-intrinsic: 1.2.2
|
||||
set-function-length: 1.1.1
|
||||
|
||||
/call-bind@1.0.8:
|
||||
resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8392,13 +8443,6 @@ packages:
|
||||
get-intrinsic: 1.3.0
|
||||
set-function-length: 1.2.2
|
||||
|
||||
/call-bound@1.0.3:
|
||||
resolution: {integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind-apply-helpers: 1.0.1
|
||||
get-intrinsic: 1.2.7
|
||||
|
||||
/call-bound@1.0.4:
|
||||
resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8950,6 +8994,11 @@ packages:
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
|
||||
/core-js@3.42.0:
|
||||
resolution: {integrity: sha512-Sz4PP4ZA+Rq4II21qkNqOEDTDrCvcANId3xpIgB34NDkWc3UduWj2dqEtN9yZIq8Dk3HyPI33x9sqqU5C8sr0g==}
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
|
||||
/core-util-is@1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||
|
||||
@@ -9782,14 +9831,6 @@ packages:
|
||||
clone: 1.0.4
|
||||
dev: true
|
||||
|
||||
/define-data-property@1.1.1:
|
||||
resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
get-intrinsic: 1.3.0
|
||||
gopd: 1.2.0
|
||||
has-property-descriptors: 1.0.2
|
||||
|
||||
/define-data-property@1.1.4:
|
||||
resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -9807,8 +9848,8 @@ packages:
|
||||
resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
define-data-property: 1.1.1
|
||||
has-property-descriptors: 1.0.1
|
||||
define-data-property: 1.1.4
|
||||
has-property-descriptors: 1.0.2
|
||||
object-keys: 1.1.1
|
||||
|
||||
/defined@1.0.1:
|
||||
@@ -9845,7 +9886,6 @@ packages:
|
||||
dependencies:
|
||||
inherits: 2.0.4
|
||||
minimalistic-assert: 1.0.1
|
||||
dev: true
|
||||
|
||||
/destr@2.0.3:
|
||||
resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==}
|
||||
@@ -10139,8 +10179,8 @@ packages:
|
||||
resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
|
||||
dev: false
|
||||
|
||||
/emojilib@4.0.1:
|
||||
resolution: {integrity: sha512-zVY5JGxycujUimHkBn2lg5NCVwASJiQA2fhKfDPgyDFmNTftiw6KdOcq2fQt1HCVw0YeYW/ccYxQHQNjZpNeuw==}
|
||||
/emojilib@4.0.2:
|
||||
resolution: {integrity: sha512-8sP3sfAi861cNaFFp7RmyKi4S26K34ZKy4si75ojUW627AIVBHhMSu2SFJo3YRoK66YWnbysIbOk/d48uEqtKQ==}
|
||||
dev: false
|
||||
|
||||
/encoding-japanese@2.2.0:
|
||||
@@ -10191,18 +10231,18 @@ packages:
|
||||
dependencies:
|
||||
array-buffer-byte-length: 1.0.0
|
||||
arraybuffer.prototype.slice: 1.0.2
|
||||
available-typed-arrays: 1.0.5
|
||||
available-typed-arrays: 1.0.7
|
||||
call-bind: 1.0.8
|
||||
es-set-tostringtag: 2.0.2
|
||||
es-to-primitive: 1.2.1
|
||||
function.prototype.name: 1.1.6
|
||||
get-intrinsic: 1.2.2
|
||||
get-intrinsic: 1.3.0
|
||||
get-symbol-description: 1.0.0
|
||||
globalthis: 1.0.3
|
||||
gopd: 1.0.1
|
||||
has-property-descriptors: 1.0.1
|
||||
gopd: 1.2.0
|
||||
has-property-descriptors: 1.0.2
|
||||
has-proto: 1.0.1
|
||||
has-symbols: 1.0.3
|
||||
has-symbols: 1.1.0
|
||||
hasown: 2.0.2
|
||||
internal-slot: 1.0.6
|
||||
is-array-buffer: 3.0.2
|
||||
@@ -10211,14 +10251,14 @@ packages:
|
||||
is-regex: 1.2.1
|
||||
is-shared-array-buffer: 1.0.2
|
||||
is-string: 1.0.7
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
is-weakref: 1.0.2
|
||||
object-inspect: 1.13.3
|
||||
object-keys: 1.1.1
|
||||
object.assign: 4.1.4
|
||||
object.assign: 4.1.7
|
||||
regexp.prototype.flags: 1.5.1
|
||||
safe-array-concat: 1.0.1
|
||||
safe-regex-test: 1.0.0
|
||||
safe-regex-test: 1.1.0
|
||||
string.prototype.trim: 1.2.10
|
||||
string.prototype.trimend: 1.0.7
|
||||
string.prototype.trimstart: 1.0.7
|
||||
@@ -10227,7 +10267,7 @@ packages:
|
||||
typed-array-byte-offset: 1.0.0
|
||||
typed-array-length: 1.0.4
|
||||
unbox-primitive: 1.0.2
|
||||
which-typed-array: 1.1.13
|
||||
which-typed-array: 1.1.18
|
||||
dev: false
|
||||
|
||||
/es-abstract@1.23.9:
|
||||
@@ -10238,7 +10278,7 @@ packages:
|
||||
arraybuffer.prototype.slice: 1.0.4
|
||||
available-typed-arrays: 1.0.7
|
||||
call-bind: 1.0.8
|
||||
call-bound: 1.0.3
|
||||
call-bound: 1.0.4
|
||||
data-view-buffer: 1.0.2
|
||||
data-view-byte-length: 1.0.2
|
||||
data-view-byte-offset: 1.0.1
|
||||
@@ -10248,7 +10288,7 @@ packages:
|
||||
es-set-tostringtag: 2.1.0
|
||||
es-to-primitive: 1.3.0
|
||||
function.prototype.name: 1.1.8
|
||||
get-intrinsic: 1.2.7
|
||||
get-intrinsic: 1.3.0
|
||||
get-proto: 1.0.1
|
||||
get-symbol-description: 1.1.0
|
||||
globalthis: 1.0.4
|
||||
@@ -11203,6 +11243,10 @@ packages:
|
||||
is-what: 5.0.2
|
||||
dev: false
|
||||
|
||||
/flexsearch@0.8.167:
|
||||
resolution: {integrity: sha512-iCBbY9npWhNlTCiHha2pwGqtbhpSEHx8+m5FJab+DLr/IKMneLNDgWbu2+IOvsAHo/Euo2Fu/5awrAEhN4q8Jw==}
|
||||
dev: false
|
||||
|
||||
/follow-redirects@1.15.9:
|
||||
resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==}
|
||||
engines: {node: '>=4.0'}
|
||||
@@ -11412,19 +11456,11 @@ packages:
|
||||
resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==}
|
||||
dev: true
|
||||
|
||||
/get-intrinsic@1.2.2:
|
||||
resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==}
|
||||
dependencies:
|
||||
function-bind: 1.1.2
|
||||
has-proto: 1.0.1
|
||||
has-symbols: 1.1.0
|
||||
hasown: 2.0.2
|
||||
|
||||
/get-intrinsic@1.2.7:
|
||||
resolution: {integrity: sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind-apply-helpers: 1.0.1
|
||||
call-bind-apply-helpers: 1.0.2
|
||||
es-define-property: 1.0.1
|
||||
es-errors: 1.3.0
|
||||
es-object-atoms: 1.1.1
|
||||
@@ -11434,6 +11470,7 @@ packages:
|
||||
has-symbols: 1.1.0
|
||||
hasown: 2.0.2
|
||||
math-intrinsics: 1.1.0
|
||||
dev: false
|
||||
|
||||
/get-intrinsic@1.3.0:
|
||||
resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
|
||||
@@ -11696,7 +11733,8 @@ packages:
|
||||
/gopd@1.0.1:
|
||||
resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
|
||||
dependencies:
|
||||
get-intrinsic: 1.2.2
|
||||
get-intrinsic: 1.3.0
|
||||
dev: false
|
||||
|
||||
/gopd@1.2.0:
|
||||
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
|
||||
@@ -11794,11 +11832,6 @@ packages:
|
||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
/has-property-descriptors@1.0.1:
|
||||
resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==}
|
||||
dependencies:
|
||||
get-intrinsic: 1.3.0
|
||||
|
||||
/has-property-descriptors@1.0.2:
|
||||
resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
|
||||
dependencies:
|
||||
@@ -11807,6 +11840,7 @@ packages:
|
||||
/has-proto@1.0.1:
|
||||
resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dev: false
|
||||
|
||||
/has-proto@1.2.0:
|
||||
resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==}
|
||||
@@ -11814,20 +11848,10 @@ packages:
|
||||
dependencies:
|
||||
dunder-proto: 1.0.1
|
||||
|
||||
/has-symbols@1.0.3:
|
||||
resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/has-symbols@1.1.0:
|
||||
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/has-tostringtag@1.0.0:
|
||||
resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
has-symbols: 1.1.0
|
||||
|
||||
/has-tostringtag@1.0.2:
|
||||
resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -11932,7 +11956,6 @@ packages:
|
||||
hash.js: 1.1.7
|
||||
minimalistic-assert: 1.0.1
|
||||
minimalistic-crypto-utils: 1.0.1
|
||||
dev: true
|
||||
|
||||
/homedir-polyfill@1.0.3:
|
||||
resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==}
|
||||
@@ -12212,7 +12235,7 @@ packages:
|
||||
dependencies:
|
||||
get-intrinsic: 1.3.0
|
||||
hasown: 2.0.2
|
||||
side-channel: 1.0.4
|
||||
side-channel: 1.1.0
|
||||
dev: false
|
||||
|
||||
/internal-slot@1.1.0:
|
||||
@@ -12306,7 +12329,7 @@ packages:
|
||||
resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bound: 1.0.3
|
||||
call-bound: 1.0.4
|
||||
has-tostringtag: 1.0.2
|
||||
|
||||
/is-array-buffer@3.0.2:
|
||||
@@ -12314,7 +12337,7 @@ packages:
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
get-intrinsic: 1.3.0
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/is-array-buffer@3.0.5:
|
||||
@@ -12468,7 +12491,7 @@ packages:
|
||||
resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bound: 1.0.3
|
||||
call-bound: 1.0.4
|
||||
get-proto: 1.0.1
|
||||
has-tostringtag: 1.0.2
|
||||
safe-regex-test: 1.1.0
|
||||
@@ -12643,7 +12666,7 @@ packages:
|
||||
resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
has-tostringtag: 1.0.0
|
||||
has-tostringtag: 1.0.2
|
||||
dev: false
|
||||
|
||||
/is-string@1.1.1:
|
||||
@@ -12667,12 +12690,6 @@ packages:
|
||||
has-symbols: 1.1.0
|
||||
safe-regex-test: 1.1.0
|
||||
|
||||
/is-typed-array@1.1.12:
|
||||
resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
which-typed-array: 1.1.13
|
||||
|
||||
/is-typed-array@1.1.15:
|
||||
resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -13929,7 +13946,6 @@ packages:
|
||||
|
||||
/minimalistic-crypto-utils@1.0.1:
|
||||
resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==}
|
||||
dev: true
|
||||
|
||||
/minimatch@10.0.1:
|
||||
resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==}
|
||||
@@ -14109,6 +14125,11 @@ packages:
|
||||
vueuc: 0.4.64(vue@3.3.4)
|
||||
dev: false
|
||||
|
||||
/nano-seconds@1.2.2:
|
||||
resolution: {integrity: sha512-s06EY41x1hM6BJE2HhIFRzvXuVUlZNd4761lduv+hjgtDDR7W4RzhShkap2wJcWMO6+CahR+49cCQJfFmgf7gw==}
|
||||
engines: {node: '>=4.0.0'}
|
||||
dev: false
|
||||
|
||||
/nanoid-dictionary@4.3.0:
|
||||
resolution: {integrity: sha512-Xw1+/QnRGWO1KJ0rLfU1xR85qXmAHyLbE3TUkklu9gOIDburP6CsUnLmTaNECGpBh5SHb2uPFmx0VT8UPyoeyw==}
|
||||
dev: false
|
||||
@@ -14398,15 +14419,6 @@ packages:
|
||||
resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/object.assign@4.1.4:
|
||||
resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
define-properties: 1.2.1
|
||||
has-symbols: 1.0.3
|
||||
object-keys: 1.1.1
|
||||
|
||||
/object.assign@4.1.7:
|
||||
resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -14462,7 +14474,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
call-bound: 1.0.3
|
||||
call-bound: 1.0.4
|
||||
define-properties: 1.2.1
|
||||
es-object-atoms: 1.1.1
|
||||
dev: false
|
||||
@@ -14544,8 +14556,8 @@ packages:
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/openpgp@6.1.0:
|
||||
resolution: {integrity: sha512-fRTeitP+hoGJD3kbdUlAI++wE6MvfvXw1rBqHwmBMxIpLjowatJ2zb5ThkORpIkSz5F12wO+xCYRSTbT7M4qKA==}
|
||||
/openpgp@6.1.1:
|
||||
resolution: {integrity: sha512-V/DXZ5AGCz3q4X8psUSc3q4SxnH/bfICaTSpNcla7wvBFhrxa9/ajm31rtMwZ1qj7Fu2oMpfX6ZcxKmTBlb6Yg==}
|
||||
engines: {node: '>= 18.0.0'}
|
||||
dev: false
|
||||
|
||||
@@ -14975,7 +14987,6 @@ packages:
|
||||
/picomatch@4.0.2:
|
||||
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
|
||||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
|
||||
/pify@4.0.1:
|
||||
resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==}
|
||||
@@ -15475,6 +15486,17 @@ packages:
|
||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
/pvtsutils@1.3.6:
|
||||
resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==}
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/pvutils@1.1.3:
|
||||
resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
dev: false
|
||||
|
||||
/pyodide@0.24.1:
|
||||
resolution: {integrity: sha512-fkNolNwiv41E2KKCP2bgW+dwr95B+0KSC/WG9WCmlWM9MNFbRVX0rF9i4OikRM78bGeVUvLdVJw8jY17wxKoRQ==}
|
||||
dependencies:
|
||||
@@ -15589,6 +15611,11 @@ packages:
|
||||
ret: 0.2.2
|
||||
dev: false
|
||||
|
||||
/random-int@3.0.0:
|
||||
resolution: {integrity: sha512-QvewnOwigesW2WFyTHiQzR6XUUcSQO/BqmfgRz5N5GpGrKQnTf7ebMz8UtuwaET8IfO1n0wLx8/fHsI8E0Jpow==}
|
||||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/random-js@2.1.0:
|
||||
resolution: {integrity: sha512-CRUyWmnzmZBA7RZSVGq0xMqmgCyPPxbiKNLFA5ud7KenojVX2s7Gv+V7eB52beKTPGxWRnVZ7D/tCIgYJJ8vNQ==}
|
||||
dev: false
|
||||
@@ -16012,8 +16039,8 @@ packages:
|
||||
engines: {node: '>=0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
call-bound: 1.0.3
|
||||
get-intrinsic: 1.2.7
|
||||
call-bound: 1.0.4
|
||||
get-intrinsic: 1.3.0
|
||||
has-symbols: 1.1.0
|
||||
isarray: 2.0.5
|
||||
|
||||
@@ -16034,14 +16061,6 @@ packages:
|
||||
es-errors: 1.3.0
|
||||
isarray: 2.0.5
|
||||
|
||||
/safe-regex-test@1.0.0:
|
||||
resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
get-intrinsic: 1.3.0
|
||||
is-regex: 1.2.1
|
||||
dev: false
|
||||
|
||||
/safe-regex-test@1.1.0:
|
||||
resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -16175,15 +16194,6 @@ packages:
|
||||
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
|
||||
dev: false
|
||||
|
||||
/set-function-length@1.1.1:
|
||||
resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
define-data-property: 1.1.4
|
||||
get-intrinsic: 1.3.0
|
||||
gopd: 1.2.0
|
||||
has-property-descriptors: 1.0.2
|
||||
|
||||
/set-function-length@1.2.2:
|
||||
resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -16221,7 +16231,6 @@ packages:
|
||||
dependencies:
|
||||
inherits: 2.0.4
|
||||
safe-buffer: 5.2.1
|
||||
dev: true
|
||||
|
||||
/sharp@0.33.5:
|
||||
resolution: {integrity: sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==}
|
||||
@@ -16300,14 +16309,6 @@ packages:
|
||||
object-inspect: 1.13.3
|
||||
side-channel-map: 1.0.1
|
||||
|
||||
/side-channel@1.0.4:
|
||||
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
get-intrinsic: 1.3.0
|
||||
object-inspect: 1.13.3
|
||||
dev: false
|
||||
|
||||
/side-channel@1.1.0:
|
||||
resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -16689,7 +16690,7 @@ packages:
|
||||
resolution: {integrity: sha512-699Ibssmj/awVzvdNk4g83/Iu8U9vDohzmA/ly2BrQWGhamuY4Tlvs5XKmKliDt3ky6SKbE1bzPhASKCFlx9Sg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.5
|
||||
call-bind: 1.0.8
|
||||
define-properties: 1.2.1
|
||||
string.prototype.trimstart: 1.0.7
|
||||
dev: false
|
||||
@@ -16698,7 +16699,7 @@ packages:
|
||||
resolution: {integrity: sha512-hoOq56oRFnnfDuXNy2lGHiwT77MehHv9d0zGfRZ8QdC+4zjrkFB9vd5i/zYTd/ymFBd4YxtbdgHt3U6ksGeuBw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.5
|
||||
call-bind: 1.0.8
|
||||
define-properties: 1.2.1
|
||||
string.prototype.trimend: 1.0.7
|
||||
dev: false
|
||||
@@ -17067,6 +17068,13 @@ packages:
|
||||
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
|
||||
dev: true
|
||||
|
||||
/tick-time@1.0.1:
|
||||
resolution: {integrity: sha512-de0ah4VT+jK7Kaz9aGShjW72avFfsEAeacYouM2IF27Rz4l9XPr3xVBS1vI64LUL3gKBbW1OBttWlLCfhFfX9A==}
|
||||
engines: {node: '>=6'}
|
||||
dependencies:
|
||||
nano-seconds: 1.2.2
|
||||
dev: false
|
||||
|
||||
/tidy-url@1.18.3:
|
||||
resolution: {integrity: sha512-NnbmullqE/3loiDoopNltfLb/v6EhX5GYNUVU4EuZjnDjh/NIBzy5dHnhvH3EfIAnZZZMf3cW0HgNw9E+easyg==}
|
||||
dev: false
|
||||
@@ -17397,7 +17405,7 @@ packages:
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
get-intrinsic: 1.3.0
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/typed-array-buffer@1.0.3:
|
||||
@@ -17415,7 +17423,7 @@ packages:
|
||||
call-bind: 1.0.8
|
||||
for-each: 0.3.3
|
||||
has-proto: 1.0.1
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/typed-array-byte-length@1.0.3:
|
||||
@@ -17432,11 +17440,11 @@ packages:
|
||||
resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
available-typed-arrays: 1.0.5
|
||||
available-typed-arrays: 1.0.7
|
||||
call-bind: 1.0.8
|
||||
for-each: 0.3.3
|
||||
has-proto: 1.0.1
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/typed-array-byte-offset@1.0.4:
|
||||
@@ -17456,7 +17464,7 @@ packages:
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
for-each: 0.3.3
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/typed-array-length@1.0.7:
|
||||
@@ -17609,8 +17617,8 @@ packages:
|
||||
engines: {node: '>=4'}
|
||||
dev: true
|
||||
|
||||
/unicode-emoji-json@0.4.0:
|
||||
resolution: {integrity: sha512-lVNOwh2AnmbwqtSrEVjAWKQoVzWgyWmXVqPuPkPfKb0tnA0+uYN/4ILCTdy9IRj/+3drAVhmjwjNJQr2dhCwnA==}
|
||||
/unicode-emoji-json@0.8.0:
|
||||
resolution: {integrity: sha512-3wDXXvp6YGoKGhS2O2H7+V+bYduOBydN1lnI0uVfr1cIdY02uFFiEH1i3kE5CCE4l6UqbLKVmEFW9USxTAMD1g==}
|
||||
dev: false
|
||||
|
||||
/unicode-match-property-ecmascript@2.0.0:
|
||||
@@ -17648,11 +17656,11 @@ packages:
|
||||
/unimport@3.0.8(rollup@2.79.2):
|
||||
resolution: {integrity: sha512-AOt6xj3QMwqcTZRPB+NhFkyVEjCKnpTVoPm5x6424zz2NYYtCfym2bpJofzPHIJKPNIh5ko2/t2q46ZIMgdmbw==}
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.0.2(rollup@2.79.2)
|
||||
'@rollup/pluginutils': 5.1.4(rollup@2.79.2)
|
||||
escape-string-regexp: 5.0.0
|
||||
fast-glob: 3.3.1
|
||||
local-pkg: 0.4.3
|
||||
magic-string: 0.30.2
|
||||
magic-string: 0.30.17
|
||||
mlly: 1.4.0
|
||||
pathe: 1.1.1
|
||||
pkg-types: 1.0.3
|
||||
@@ -17729,6 +17737,15 @@ packages:
|
||||
engines: {node: '>= 10.0.0'}
|
||||
dev: true
|
||||
|
||||
/unixcrypt-browser@2.0.4:
|
||||
resolution: {integrity: sha512-c1Onql8IVzUjQVW0jra39VEa4f8iIr1XAlZ2oOa0U094gM77rcbDbkcWMQux+j2Qqr7wFXByIcvL6CoL0DkkmQ==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
dependencies:
|
||||
buffer: 6.0.3
|
||||
random-int: 3.0.0
|
||||
sha.js: 2.4.11
|
||||
dev: false
|
||||
|
||||
/unocss-preset-scrollbar@0.2.1(unocss@0.57.7):
|
||||
resolution: {integrity: sha512-7ubHdOaUwr7xBn1glPpICNNsM2SZGjvWK5uRPNiQYsrZ9YFjsCGHk9x5S2R8pTkuMDQeiaSa/UQbYhjC8Fra5g==}
|
||||
peerDependencies:
|
||||
@@ -17777,6 +17794,15 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/unpdf@1.0.5:
|
||||
resolution: {integrity: sha512-f06b1bT0Cu96UpQmU4wQbir4nJrZ8kMU9dC3zUg7Ac+Sy5iKuh/aHq58rlyk6ggue0xjhed2Q5uu0AJVSl7qHA==}
|
||||
peerDependencies:
|
||||
'@napi-rs/canvas': ^0.1.69
|
||||
peerDependenciesMeta:
|
||||
'@napi-rs/canvas':
|
||||
optional: true
|
||||
dev: false
|
||||
|
||||
/unplugin-auto-import@0.16.4(@vueuse/core@10.11.1)(rollup@2.79.2):
|
||||
resolution: {integrity: sha512-xdgBa9NAS3JG8HjkAZHSbGSMlrjKpaWKXGUzaF6RzEtr980RCl1t0Zsu0skUInNYrEQfqaHc7aGWPv41DLTK/w==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -17992,8 +18018,8 @@ packages:
|
||||
inherits: 2.0.4
|
||||
is-arguments: 1.2.0
|
||||
is-generator-function: 1.1.0
|
||||
is-typed-array: 1.1.12
|
||||
which-typed-array: 1.1.13
|
||||
is-typed-array: 1.1.15
|
||||
which-typed-array: 1.1.18
|
||||
dev: true
|
||||
|
||||
/uuid-random@1.3.2:
|
||||
@@ -18168,10 +18194,10 @@ packages:
|
||||
- terser
|
||||
dev: true
|
||||
|
||||
/vite-plugin-node-polyfills@0.22.0(rollup@2.79.2)(vite@4.4.9):
|
||||
resolution: {integrity: sha512-F+G3LjiGbG8QpbH9bZ//GSBr9i1InSTkaulfUHFa9jkLqVGORFBoqc2A/Yu5Mmh1kNAbiAeKeK+6aaQUf3x0JA==}
|
||||
/vite-plugin-node-polyfills@0.23.0(rollup@2.79.2)(vite@4.4.9):
|
||||
resolution: {integrity: sha512-4n+Ys+2bKHQohPBKigFlndwWQ5fFKwaGY6muNDMTb0fSQLyBzS+jjUNRZG9sKF0S/Go4ApG6LFnUGopjkILg3w==}
|
||||
peerDependencies:
|
||||
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0
|
||||
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0
|
||||
dependencies:
|
||||
'@rollup/plugin-inject': 5.0.5(rollup@2.79.2)
|
||||
node-stdlib-browser: 1.3.0
|
||||
@@ -18202,6 +18228,10 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/vite-plugin-splash-screen@0.2.0:
|
||||
resolution: {integrity: sha512-PCUiVq8wjx7dHMa9vOqnB+bewKp60VFbhPJJjQOA8UdwmPdf9ChBGuxh+sku4szrnJFsriB0gIDAURAmOqBcUQ==}
|
||||
dev: true
|
||||
|
||||
/vite-plugin-vue-markdown@0.23.5(rollup@2.79.2)(vite@4.4.9):
|
||||
resolution: {integrity: sha512-NXTZ4y+n691gLPWayMBbh4jldQeaqDp9e9WjWUYbn9obsLqS9qU+hr4RAruDq5kP4siTOp7JDV34Sw5eA7WxLg==}
|
||||
peerDependencies:
|
||||
@@ -18464,6 +18494,15 @@ packages:
|
||||
'@vue/devtools-api': 6.5.0
|
||||
vue: 3.3.4
|
||||
|
||||
/vue-loading-overlay@6.0.6(vue@3.3.4):
|
||||
resolution: {integrity: sha512-ZPrWawjCoNKGbCG9z4nePgbs/K9KXPa1j1oAJXP6T8FQho3NO+/chhjx4MLYFzfpwr+xkiQ8SNrV1kUG1bZPAw==}
|
||||
engines: {node: '>=12.13.0'}
|
||||
peerDependencies:
|
||||
vue: ^3.2.0
|
||||
dependencies:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-markdown-render@2.2.1(vue@3.3.4):
|
||||
resolution: {integrity: sha512-XkYnC0PMdbs6Vy6j/gZXSvCuOS0787Se5COwXlepRqiqPiunyCIeTPQAO2XnB4Yl04EOHXwLx5y6IuszMWSgyQ==}
|
||||
peerDependencies:
|
||||
@@ -18519,16 +18558,6 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue3-fortune-wheel@2.0.5(vue@3.3.4):
|
||||
resolution: {integrity: sha512-fMCmyT8sE79+O6fs2IWWrQMa1UjU+cuzu92C6EDCNaXaHaJKLReQxkAKLDiHyUC/GFpcsbpuBFbketWE3cKL0A==}
|
||||
engines: {node: '>=20.14.0', pnpm: '>=9.5.0'}
|
||||
peerDependencies:
|
||||
vue: ^3.4.0
|
||||
dependencies:
|
||||
d3: 7.9.0
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue@3.3.4:
|
||||
resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==}
|
||||
dependencies:
|
||||
@@ -18630,6 +18659,32 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/webcrypto-core@1.8.1:
|
||||
resolution: {integrity: sha512-P+x1MvlNCXlKbLSOY4cYrdreqPG5hbzkmawbcXLKN/mf6DZW0SdNNkZ+sjwsqVkI4A4Ko2sPZmkZtCKY58w83A==}
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/json-schema': 1.1.12
|
||||
asn1js: 3.0.6
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/webcrypto-liner-shim@1.4.8:
|
||||
resolution: {integrity: sha512-ZTHoyFySHpagRM79LODyRZPxZWp022jaECgVpEHZSX4Y0dcMKlQ0Che9R/EgTypAnds6li7qe8Corc1dNgvnxg==}
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/json-schema': 1.1.12
|
||||
'@stablelib/sha3': 1.0.1
|
||||
asmcrypto.js: 2.3.2
|
||||
asn1js: 3.0.6
|
||||
core-js: 3.42.0
|
||||
des.js: 1.1.0
|
||||
elliptic: github.com/mahrud/elliptic/75637c76678e83c31682fd967c2fa9ff4761b3fc
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
webcrypto-core: 1.8.1
|
||||
dev: false
|
||||
|
||||
/webidl-conversions@3.0.1:
|
||||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||
dev: false
|
||||
@@ -18751,16 +18806,6 @@ packages:
|
||||
resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==}
|
||||
dev: false
|
||||
|
||||
/which-typed-array@1.1.13:
|
||||
resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
available-typed-arrays: 1.0.5
|
||||
call-bind: 1.0.8
|
||||
for-each: 0.3.3
|
||||
gopd: 1.0.1
|
||||
has-tostringtag: 1.0.0
|
||||
|
||||
/which-typed-array@1.1.18:
|
||||
resolution: {integrity: sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -19288,3 +19333,17 @@ packages:
|
||||
engines: {node: '>=0.8'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
github.com/mahrud/elliptic/75637c76678e83c31682fd967c2fa9ff4761b3fc:
|
||||
resolution: {tarball: https://codeload.github.com/mahrud/elliptic/tar.gz/75637c76678e83c31682fd967c2fa9ff4761b3fc}
|
||||
name: elliptic
|
||||
version: 6.5.0
|
||||
dependencies:
|
||||
bn.js: 4.12.1
|
||||
brorand: 1.1.0
|
||||
hash.js: 1.1.7
|
||||
hmac-drbg: 1.0.1
|
||||
inherits: 2.0.4
|
||||
minimalistic-assert: 1.0.1
|
||||
minimalistic-crypto-utils: 1.0.1
|
||||
dev: false
|
||||
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;
|
||||
};
|
||||
}
|
||||
}
|
||||
})();
|
||||
+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 |
+14
@@ -49,4 +49,18 @@ html {
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body .vld-container {
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: #101014;
|
||||
z-index: 9999;
|
||||
text-align: center;
|
||||
}
|
||||
body .vld-container .vl-overlay.vl-active {
|
||||
margin-top: 15%;
|
||||
}
|
||||
</style>
|
||||
@@ -25,37 +25,40 @@ const collapsedCategories = useStorage<Record<string, boolean>>(
|
||||
},
|
||||
);
|
||||
|
||||
const isToggling = ref(false);
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
/**
|
||||
* toggleAllCategories (new)
|
||||
* --------------------------------------------------------------------------
|
||||
* If all categories are collapsed, expand them all; otherwise, collapse them all.
|
||||
*/
|
||||
function toggleAllCategories() {
|
||||
const nextState = !areAllCollapsed.value;
|
||||
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;
|
||||
}
|
||||
|
||||
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] === undefined ? true : collapsedCategories.value[name],
|
||||
tools: components.map(tool => ({
|
||||
label: makeLabel(tool),
|
||||
icon: makeIcon(tool),
|
||||
@@ -68,18 +71,18 @@ 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' }}
|
||||
<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 v-for="{ name, tools, isCollapsed } of menuOptions" :key="name" class="category-container">
|
||||
<div ml-6px mt-12px 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 />
|
||||
@@ -90,7 +93,7 @@ const themeVars = useThemeVars();
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<n-collapse-transition :show="!isCollapsed">
|
||||
<div class="menu-container" :class="{ collapsed: isCollapsed }">
|
||||
<div class="menu-wrapper">
|
||||
<div class="toggle-bar" @click="toggleCategoryCollapse({ name })" />
|
||||
|
||||
@@ -104,44 +107,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-container {
|
||||
.menu-container {
|
||||
overflow: hidden;
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
::v-deep(.n-menu-item-content::before) {
|
||||
left: 0;
|
||||
right: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
&:not(.collapsed) {
|
||||
max-height: 1000px;
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
opacity: 0.5;
|
||||
&.collapsed {
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
|
||||
.menu-wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
|
||||
|
||||
.menu-container:not(.collapsed) & {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.menu-container.collapsed & {
|
||||
transform: translateY(-20px);
|
||||
}
|
||||
|
||||
.menu {
|
||||
flex: 1;
|
||||
margin-bottom: 5px;
|
||||
|
||||
::v-deep(.n-menu-item-content::before) {
|
||||
left: 0;
|
||||
right: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ const props = defineProps<{
|
||||
multiline?: boolean
|
||||
rows?: number | string
|
||||
autosize?: boolean
|
||||
readonly?: boolean
|
||||
}>();
|
||||
const emit = defineEmits(['update:value']);
|
||||
|
||||
@@ -21,6 +22,7 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : 'Copy to cli
|
||||
:multiline="multiline"
|
||||
:rows="rows"
|
||||
:autosize="autosize"
|
||||
:readonly="readonly"
|
||||
>
|
||||
<template #suffix>
|
||||
<c-tooltip :tooltip="tooltipText">
|
||||
|
||||
@@ -75,7 +75,10 @@ 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
|
||||
trigger="none"
|
||||
@@ -87,9 +90,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
|
||||
>
|
||||
<c-tooltip v-if="value && copyPlacement !== 'outside'" :tooltip="tooltipText" position="left">
|
||||
<c-button circle important:h-10 important:w-10 @click="copy()">
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
import { type MaybeRef, get } from '@vueuse/core';
|
||||
import { computed, ref, watch } 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 = () => {
|
||||
dataMap.value.clear();
|
||||
indices.forEach(({ index }) => index.clear());
|
||||
|
||||
data.forEach((item, idx) => {
|
||||
const itemKey = getItemKey(item, idx);
|
||||
dataMap.value.set(itemKey, item);
|
||||
|
||||
indices.forEach(({ key, index }) => {
|
||||
// Support nested keys (e.g., 'foo.bar')
|
||||
const value = key.split('.').reduce((obj, path) => obj?.[path], item);
|
||||
if (value) {
|
||||
index.add(itemKey, String(value));
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Initialize on creation
|
||||
initializeIndices();
|
||||
|
||||
// Watch for data changes (deep watch for array content)
|
||||
watch(
|
||||
() => data,
|
||||
initializeIndices,
|
||||
{ deep: true },
|
||||
);
|
||||
|
||||
// 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,
|
||||
|
||||
@@ -72,7 +72,9 @@ const themeVars = useThemeVars();
|
||||
</div>
|
||||
|
||||
<div class="tool-content">
|
||||
<slot />
|
||||
<Suspense>
|
||||
<slot />
|
||||
</Suspense>
|
||||
</div>
|
||||
|
||||
<div class="tool-footer">
|
||||
|
||||
+5
-7
@@ -3,12 +3,11 @@ 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 { install as VueMonacoEditorPlugin, loader } from '@guolao/vue-monaco-editor';
|
||||
import * as monaco from 'monaco-editor';
|
||||
import { LoadingPlugin } from 'vue-loading-overlay';
|
||||
|
||||
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 'virtual:uno.css';
|
||||
@@ -23,14 +22,11 @@ import store from './tools/pomodoro-timer/app/store';
|
||||
|
||||
library.add(fas);
|
||||
|
||||
// loaded monaco-editor from `node_modules`
|
||||
loader.config({ monaco });
|
||||
|
||||
registerSW();
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
app.use(VueMonacoEditorPlugin);
|
||||
app.use(LoadingPlugin);
|
||||
app.use(createPinia());
|
||||
app.use(createHead());
|
||||
app.use(i18nPlugin);
|
||||
@@ -41,3 +37,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,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
+84
-4
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { IconDragDrop, IconFileDescription, 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';
|
||||
@@ -28,10 +28,81 @@ 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>
|
||||
@@ -82,7 +153,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 +181,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>
|
||||
Loading more tools... ({{ visibleTools.length }}/{{ toolStore.tools.length }})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
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';
|
||||
@@ -6,6 +7,8 @@ import { tools } from './tools';
|
||||
import { config } from './config';
|
||||
import { routes as demoRoutes } from './ui/demo/demo.routes';
|
||||
|
||||
const $loading = useLoading();
|
||||
|
||||
const toolsRoutes = tools.map(({ path, name, component, ...config }) => ({
|
||||
path,
|
||||
name,
|
||||
@@ -38,4 +41,23 @@ const router = createRouter({
|
||||
],
|
||||
});
|
||||
|
||||
let loader: ActiveLoader | null = null;
|
||||
|
||||
router.beforeEach((to, from) => {
|
||||
// Only show loading for actual route changes, not just query param changes
|
||||
if (to.path !== from.path) {
|
||||
loader = $loading?.show({
|
||||
color: '#fff',
|
||||
backgroundColor: '#292929',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
if (loader) {
|
||||
loader.hide();
|
||||
loader = null;
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
Vendored
+5
-1
@@ -38,4 +38,8 @@ declare module 'pdf-signature-reader' {
|
||||
const verifySignature: (pdf: ArrayBuffer) => ({signatures: SignatureInfo[]});
|
||||
|
||||
export default verifySignature;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vite-plugin-splash-screen/runtime' {
|
||||
export function hideSplashScreen();
|
||||
}
|
||||
@@ -1,20 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
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 data = mappingData;
|
||||
const search = ref('');
|
||||
|
||||
const { searchResult } = useFuzzySearch({
|
||||
search: searchQuery,
|
||||
const { searchResult } = useFlexSearch({
|
||||
search,
|
||||
data,
|
||||
options: {
|
||||
keys: ['all'],
|
||||
threshold: 0.2,
|
||||
isCaseSensitive: false,
|
||||
minMatchCharLength: 3,
|
||||
useExtendedSearch: true,
|
||||
keys: ['TAB', 'ActiveDirectoryField', 'LDAPAttribute'],
|
||||
filterEmpty: false,
|
||||
},
|
||||
});
|
||||
@@ -24,7 +19,7 @@ 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"
|
||||
v-model:value="search"
|
||||
placeholder="Search Active Directory LDAP mapping"
|
||||
mx-auto max-w-600px
|
||||
>
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<script setup lang="ts">
|
||||
import { useScriptTag } from '@vueuse/core';
|
||||
import ageWasmUrl from '/age-wasm/age.wasm?url';
|
||||
|
||||
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 { load: loadGo } = useScriptTag('/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="Generate Keys">
|
||||
<n-card title="Private Key" mb-1>
|
||||
<textarea-copyable v-model:value="privKey" rows="3" multiline placeholder="Your private key will be generated here." />
|
||||
</n-card>
|
||||
<n-card title="Public Key" mb-1>
|
||||
<textarea-copyable v-model:value="pubKey" rows="3" multiline placeholder="Your public key will be generated here." />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="generateKeys">
|
||||
Generate Keys
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Encrypt Text -->
|
||||
<n-tab-pane name="encrypt" tab="Encrypt">
|
||||
<n-card title="Public Keys" mb-1>
|
||||
<n-input v-model:value="recipients" type="textarea" placeholder="Recipient key or keys one per line" required />
|
||||
</n-card>
|
||||
<n-card title="Message" mb-1>
|
||||
<n-input v-model:value="message" type="textarea" placeholder="Message to encrypt" required />
|
||||
</n-card>
|
||||
<n-card title="Output" mb-1>
|
||||
<textarea-copyable v-model:value="encryptedOutput" rows="3" multiline placeholder="Encrypted output will be generated here." />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="encrypt">
|
||||
Encrypt
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Encrypt Binary -->
|
||||
<n-tab-pane name="encryptBinary" tab="Encrypt Binary">
|
||||
<n-card title="Public Keys" mb-1>
|
||||
<n-input v-model:value="recipientsBinary" type="textarea" placeholder="Recipient key or keys one per line" required />
|
||||
</n-card>
|
||||
<n-card title="Files" mb-1>
|
||||
<c-file-upload
|
||||
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="Output" mb-1>
|
||||
<p>The encrypted files will be downloaded.</p>
|
||||
</n-card>
|
||||
<n-button type="primary" @click="encryptBinary">
|
||||
Encrypt Binary
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Decrypt Text -->
|
||||
<n-tab-pane name="decrypt" tab="Decrypt">
|
||||
<n-card title="Private Keys" mb-1>
|
||||
<n-input v-model:value="identities" type="textarea" placeholder="Identity key or keys one per line" required />
|
||||
</n-card>
|
||||
<n-card title="Encrypted Text" mb-1>
|
||||
<n-input v-model:value="encryptedText" type="textarea" placeholder="Paste here encrypted text" required />
|
||||
</n-card>
|
||||
<n-card title="Output" mb-1>
|
||||
<textarea-copyable v-model:value="decryptedOutput" rows="3" multiline placeholder="Decrypted output will be generated here." />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="decrypt">
|
||||
Decrypt
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Decrypt Binary -->
|
||||
<n-tab-pane name="decryptBinary" tab="Decrypt Binary">
|
||||
<n-card title="Private Keys" mb-1>
|
||||
<n-input v-model:value="identitiesBinary" type="textarea" placeholder="Identity key or keys one per line" required />
|
||||
</n-card>
|
||||
<n-card title="Encrypted Files" mb-1>
|
||||
<c-file-upload
|
||||
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="Output" mb-1>
|
||||
<p>The decrypted files will be downloaded.</p>
|
||||
</n-card>
|
||||
<n-button type="primary" @click="decryptBinary">
|
||||
Decrypt Binary
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
</n-tabs>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { EyeOff } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'AGE Cryptography',
|
||||
path: '/age-crypto',
|
||||
description: 'Provides a simple and easy-to-use open-source Age tool for generating keys, encrypting, and decrypting messages.',
|
||||
keywords: ['age'],
|
||||
component: () => import('./age-crypto.vue'),
|
||||
icon: EyeOff,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Crypto',
|
||||
});
|
||||
@@ -49,7 +49,7 @@ watchEffect(async () => {
|
||||
processing.value = false;
|
||||
});
|
||||
|
||||
const fonts = ['1Row', '3-D', '3D Diagonal', '3D-ASCII', '3x5', '4Max', '5 Line Oblique', 'AMC 3 Line', 'AMC 3 Liv1', 'AMC AAA01', 'AMC Neko', 'AMC Razor', 'AMC Razor2', 'AMC Slash', 'AMC Slider', 'AMC Thin', 'AMC Tubes', 'AMC Untitled', 'ANSI Shadow', 'ASCII New Roman', 'Acrobatic', 'Alligator', 'Alligator2', 'Alpha', 'Alphabet', 'Arrows', 'Avatar', 'B1FF', 'B1FF', 'Banner', 'Banner3-D', 'Banner3', 'Banner4', 'Barbwire', 'Basic', 'Bear', 'Bell', 'Benjamin', 'Big Chief', 'Big Money-ne', 'Big Money-nw', 'Big Money-se', 'Big Money-sw', 'Big', 'Bigfig', 'Binary', 'Block', 'Blocks', 'Bloody', 'Bolger', 'Braced', 'Bright', 'Broadway KB', 'Broadway', 'Bubble', 'Bulbhead', 'Caligraphy', 'Caligraphy2', 'Calvin S', 'Cards', 'Catwalk', 'Chiseled', 'Chunky', 'Coinstak', 'Cola', 'Colossal', 'Computer', 'Contessa', 'Contrast', 'Cosmike', 'Crawford', 'Crawford2', 'Crazy', 'Cricket', 'Cursive', 'Cyberlarge', 'Cybermedium', 'Cybersmall', 'Cygnet', 'DANC4', 'DOS Rebel', 'DWhistled', 'Dancing Font', 'Decimal', 'Def Leppard', 'Delta Corps Priest 1', 'Diamond', 'Diet Cola', 'Digital', 'Doh', 'Doom', 'Dot Matrix', 'Double Shorts', 'Double', 'Dr Pepper', 'Efti Chess', 'Efti Font', 'Efti Italic', 'Efti Piti', 'Efti Robot', 'Efti Wall', 'Efti Water', 'Electronic', 'Elite', 'Epic', 'Fender', 'Filter', 'Fire Font-k', 'Fire Font-s', 'Flipped', 'Flower Power', 'Four Tops', 'Fraktur', 'Fun Face', 'Fun Faces', 'Fuzzy', 'Georgi16', 'Georgia11', 'Ghost', 'Ghoulish', 'Glenyn', 'Goofy', 'Gothic', 'Graceful', 'Gradient', 'Graffiti', 'Greek', 'Heart Left', 'Heart Right', 'Henry 3D', 'Hex', 'Hieroglyphs', 'Hollywood', 'Horizontal Left', 'Horizontal Right', 'ICL-1900', 'Impossible', 'Invita', 'Isometric1', 'Isometric2', 'Isometric3', 'Isometric4', 'Italic', 'Ivrit', 'JS Block Letters', 'JS Bracket Letters', 'JS Capital Curves', 'JS Cursive', 'JS Stick Letters', 'Jacky', 'Jazmine', 'Jerusalem', 'Katakana', 'Kban', 'Keyboard', 'Knob', 'Konto Slant', 'Konto', 'LCD', 'Larry 3D 2', 'Larry 3D', 'Lean', 'Letters', 'Lil Devil', 'Line Blocks', 'Linux', 'Lockergnome', 'Madrid', 'Marquee', 'Maxfour', 'Merlin1', 'Merlin2', 'Mike', 'Mini', 'Mirror', 'Mnemonic', 'Modular', 'Morse', 'Morse2', 'Moscow', 'Mshebrew210', 'Muzzle', 'NScript', 'NT Greek', 'NV Script', 'Nancyj-Fancy', 'Nancyj-Improved', 'Nancyj-Underlined', 'Nancyj', 'Nipples', 'O8', 'OS2', 'Octal', 'Ogre', 'Old Banner', 'Patorjk\'s Cheese', 'Patorjk-HeX', 'Pawp', 'Peaks Slant', 'Peaks', 'Pebbles', 'Pepper', 'Poison', 'Puffy', 'Puzzle', 'Pyramid', 'Rammstein', 'Rectangles', 'Red Phoenix', 'Relief', 'Relief2', 'Reverse', 'Roman', 'Rot13', 'Rot13', 'Rotated', 'Rounded', 'Rowan Cap', 'Rozzo', 'Runic', 'Runyc', 'S Blood', 'SL Script', 'Santa Clara', 'Script', 'Serifcap', 'Shadow', 'Shimrod', 'Short', 'Slant Relief', 'Slant', 'Slide', 'Small Caps', 'Small Isometric1', 'Small Keyboard', 'Small Poison', 'Small Script', 'Small Shadow', 'Small Slant', 'Small Tengwar', 'Small', 'Soft', 'Speed', 'Spliff', 'Stacey', 'Stampate', 'Stampatello', 'Standard', 'Star Strips', 'Star Wars', 'Stellar', 'Stforek', 'Stick Letters', 'Stop', 'Straight', 'Stronger Than All', 'Sub-Zero', 'Swamp Land', 'Swan', 'Sweet', 'THIS', 'Tanja', 'Tengwar', 'Term', 'Test1', 'The Edge', 'Thick', 'Thin', 'Thorned', 'Three Point', 'Ticks Slant', 'Ticks', 'Tiles', 'Tinker-Toy', 'Tombstone', 'Train', 'Trek', 'Tsalagi', 'Tubular', 'Twisted', 'Two Point', 'USA Flag', 'Univers', 'Varsity', 'Wavy', 'Weird', 'Wet Letter', 'Whimsy', 'Wow'];
|
||||
const fonts = ['1Row', '3-D', '3D Diagonal', '3D-ASCII', '3x5', '4Max', '5 Line Oblique', 'AMC 3 Line', 'AMC 3 Liv1', 'AMC AAA01', 'AMC Neko', 'AMC Razor', 'AMC Razor2', 'AMC Slash', 'AMC Slider', 'AMC Thin', 'AMC Tubes', 'AMC Untitled', 'ANSI Shadow', 'ASCII New Roman', 'Acrobatic', 'Alligator', 'Alligator2', 'Alpha', 'Alphabet', 'Arrows', 'Avatar', 'B1FF', 'Banner', 'Banner3-D', 'Banner3', 'Banner4', 'Barbwire', 'Basic', 'Bear', 'Bell', 'Benjamin', 'Big Chief', 'Big Money-ne', 'Big Money-nw', 'Big Money-se', 'Big Money-sw', 'Big', 'Bigfig', 'Binary', 'Block', 'Blocks', 'Bloody', 'Bolger', 'Braced', 'Bright', 'Broadway KB', 'Broadway', 'Bubble', 'Bulbhead', 'Caligraphy', 'Caligraphy2', 'Calvin S', 'Cards', 'Catwalk', 'Chiseled', 'Chunky', 'Coinstak', 'Cola', 'Colossal', 'Computer', 'Contessa', 'Contrast', 'Cosmike', 'Crawford', 'Crawford2', 'Crazy', 'Cricket', 'Cursive', 'Cyberlarge', 'Cybermedium', 'Cybersmall', 'Cygnet', 'DANC4', 'DOS Rebel', 'DWhistled', 'Dancing Font', 'Decimal', 'Def Leppard', 'Delta Corps Priest 1', 'Diamond', 'Diet Cola', 'Digital', 'Doh', 'Doom', 'Dot Matrix', 'Double Shorts', 'Double', 'Dr Pepper', 'Efti Chess', 'Efti Font', 'Efti Italic', 'Efti Piti', 'Efti Robot', 'Efti Wall', 'Efti Water', 'Electronic', 'Elite', 'Epic', 'Fender', 'Filter', 'Fire Font-k', 'Fire Font-s', 'Flipped', 'Flower Power', 'Four Tops', 'Fraktur', 'Fun Face', 'Fun Faces', 'Fuzzy', 'Georgi16', 'Georgia11', 'Ghost', 'Ghoulish', 'Glenyn', 'Goofy', 'Gothic', 'Graceful', 'Gradient', 'Graffiti', 'Greek', 'Heart Left', 'Heart Right', 'Henry 3D', 'Hex', 'Hieroglyphs', 'Hollywood', 'Horizontal Left', 'Horizontal Right', 'ICL-1900', 'Impossible', 'Invita', 'Isometric1', 'Isometric2', 'Isometric3', 'Isometric4', 'Italic', 'Ivrit', 'JS Block Letters', 'JS Bracket Letters', 'JS Capital Curves', 'JS Cursive', 'JS Stick Letters', 'Jacky', 'Jazmine', 'Jerusalem', 'Katakana', 'Kban', 'Keyboard', 'Knob', 'Konto Slant', 'Konto', 'LCD', 'Larry 3D 2', 'Larry 3D', 'Lean', 'Letters', 'Lil Devil', 'Line Blocks', 'Linux', 'Lockergnome', 'Madrid', 'Marquee', 'Maxfour', 'Merlin1', 'Merlin2', 'Mike', 'Mini', 'Mirror', 'Mnemonic', 'Modular', 'Morse', 'Morse2', 'Moscow', 'Mshebrew210', 'Muzzle', 'NScript', 'NT Greek', 'NV Script', 'Nancyj-Fancy', 'Nancyj-Improved', 'Nancyj-Underlined', 'Nancyj', 'Nipples', 'O8', 'OS2', 'Octal', 'Ogre', 'Old Banner', 'Patorjk\'s Cheese', 'Patorjk-HeX', 'Pawp', 'Peaks Slant', 'Peaks', 'Pebbles', 'Pepper', 'Poison', 'Puffy', 'Puzzle', 'Pyramid', 'Rammstein', 'Rectangles', 'Red Phoenix', 'Relief', 'Relief2', 'Reverse', 'Roman', 'Rot13', 'Rotated', 'Rounded', 'Rowan Cap', 'Rozzo', 'Runic', 'Runyc', 'S Blood', 'SL Script', 'Santa Clara', 'Script', 'Serifcap', 'Shadow', 'Shimrod', 'Short', 'Slant Relief', 'Slant', 'Slide', 'Small Caps', 'Small Isometric1', 'Small Keyboard', 'Small Poison', 'Small Script', 'Small Shadow', 'Small Slant', 'Small Tengwar', 'Small', 'Soft', 'Speed', 'Spliff', 'Stacey', 'Stampate', 'Stampatello', 'Standard', 'Star Strips', 'Star Wars', 'Stellar', 'Stforek', 'Stick Letters', 'Stop', 'Straight', 'Stronger Than All', 'Sub-Zero', 'Swamp Land', 'Swan', 'Sweet', 'THIS', 'Tanja', 'Tengwar', 'Term', 'Test1', 'The Edge', 'Thick', 'Thin', 'Thorned', 'Three Point', 'Ticks Slant', 'Ticks', 'Tiles', 'Tinker-Toy', 'Tombstone', 'Train', 'Trek', 'Tsalagi', 'Tubular', 'Twisted', 'Two Point', 'USA Flag', 'Univers', 'Varsity', 'Wavy', 'Weird', 'Wet Letter', 'Whimsy', 'Wow'];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -0,0 +1,573 @@
|
||||
```bash
|
||||
#!/bin/bash
|
||||
##############################################################################
|
||||
# SHORTCUTS and HISTORY
|
||||
##############################################################################
|
||||
|
||||
CTRL+A # move to beginning of line
|
||||
CTRL+B # moves backward one character
|
||||
CTRL+C # halts the current command
|
||||
CTRL+D # deletes one character backward or logs out of current session, similar to exit
|
||||
CTRL+E # moves to end of line
|
||||
CTRL+F # moves forward one character
|
||||
CTRL+G # aborts the current editing command and ring the terminal bell
|
||||
CTRL+H # deletes one character under cursor (same as DELETE)
|
||||
CTRL+J # same as RETURN
|
||||
CTRL+K # deletes (kill) forward to end of line
|
||||
CTRL+L # clears screen and redisplay the line
|
||||
CTRL+M # same as RETURN
|
||||
CTRL+N # next line in command history
|
||||
CTRL+O # same as RETURN, then displays next line in history file
|
||||
CTRL+P # previous line in command history
|
||||
CTRL+Q # resumes suspended shell output
|
||||
CTRL+R # searches backward
|
||||
CTRL+S # searches forward or suspends shell output
|
||||
CTRL+T # transposes two characters
|
||||
CTRL+U # kills backward from point to the beginning of line
|
||||
CTRL+V # makes the next character typed verbatim
|
||||
CTRL+W # kills the word behind the cursor
|
||||
CTRL+X # lists the possible filename completions of the current word
|
||||
CTRL+Y # retrieves (yank) last item killed
|
||||
CTRL+Z # stops the current command, resume with fg in the foreground or bg in the background
|
||||
|
||||
ALT+B # moves backward one word
|
||||
ALT+D # deletes next word
|
||||
ALT+F # moves forward one word
|
||||
ALT+H # deletes one character backward
|
||||
ALT+T # transposes two words
|
||||
ALT+. # pastes last word from the last command. Pressing it repeatedly traverses through command history.
|
||||
ALT+U # capitalizes every character from the current cursor position to the end of the word
|
||||
ALT+L # uncapitalizes every character from the current cursor position to the end of the word
|
||||
ALT+C # capitalizes the letter under the cursor. The cursor then moves to the end of the word.
|
||||
ALT+R # reverts any changes to a command you’ve pulled from your history if you’ve edited it.
|
||||
ALT+? # list possible completions to what is typed
|
||||
ALT+^ # expand line to most recent match from history
|
||||
|
||||
CTRL+X then ( # start recording a keyboard macro
|
||||
CTRL+X then ) # finish recording keyboard macro
|
||||
CTRL+X then E # recall last recorded keyboard macro
|
||||
CTRL+X then CTRL+E # invoke text editor (specified by $EDITOR) on current command line then execute resultes as shell commands
|
||||
CTRL+A then D # logout from screen but don't kill it, if any command exist, it will continue
|
||||
|
||||
BACKSPACE # deletes one character backward
|
||||
DELETE # deletes one character under cursor
|
||||
|
||||
history # shows command line history
|
||||
!! # repeats the last command
|
||||
!<n> # refers to command line 'n'
|
||||
!<string> # refers to command starting with 'string'
|
||||
esc :wq # exits and saves script
|
||||
|
||||
exit # logs out of current session
|
||||
|
||||
|
||||
##############################################################################
|
||||
# BASH BASICS
|
||||
##############################################################################
|
||||
|
||||
env # displays all environment variables
|
||||
|
||||
echo $SHELL # displays the shell you're using
|
||||
echo $BASH_VERSION # displays bash version
|
||||
|
||||
bash # if you want to use bash (type exit to go back to your previously opened shell)
|
||||
whereis bash # locates the binary, source and manual-page for a command
|
||||
which bash # finds out which program is executed as 'bash' (default: /bin/bash, can change across environments)
|
||||
|
||||
clear # clears content on window (hide displayed lines)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# FILE COMMANDS
|
||||
##############################################################################
|
||||
|
||||
|
||||
ls # lists your files in current directory, ls <dir> to print files in a specific directory
|
||||
ls -l # lists your files in 'long format', which contains the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified
|
||||
ls -a # lists all files in 'long format', including hidden files (name beginning with '.')
|
||||
ln -s <filename> <link> # creates symbolic link to file
|
||||
readlink <filename> # shows where a symbolic links points to
|
||||
tree # show directories and subdirectories in easilly readable file tree
|
||||
mc # terminal file explorer (alternative to ncdu)
|
||||
touch <filename> # creates or updates (edit) your file
|
||||
mktemp -t <filename> # make a temp file in /tmp/ which is deleted at next boot (-d to make directory)
|
||||
cat <filename> # displays file raw content (will not be interpreted)
|
||||
cat -n <filename> # shows number of lines
|
||||
nl <file.sh> # shows number of lines in file
|
||||
cat filename1 > filename2 # Copy filename1 to filename2
|
||||
cat filename1 >> filename2 # merge two files texts together
|
||||
any_command > <filename> # '>' is used to perform redirections, it will set any_command's stdout to file instead of "real stdout" (generally /dev/stdout)
|
||||
more <filename> # shows the first part of a file (move with space and type q to quit)
|
||||
head <filename> # outputs the first lines of file (default: 10 lines)
|
||||
tail <filename> # outputs the last lines of file (useful with -f option) (default: 10 lines)
|
||||
vim <filename> # opens a file in VIM (VI iMproved) text editor, will create it if it doesn't exist
|
||||
mv <filename1> <dest> # moves a file to destination, behavior will change based on 'dest' type (dir: file is placed into dir; file: file will replace dest (tip: useful for renaming))
|
||||
cp <filename1> <dest> # copies a file
|
||||
rm <filename> # removes a file
|
||||
find . -name <name> <type> # searches for a file or a directory in the current directory and all its sub-directories by its name
|
||||
diff <filename1> <filename2> # compares files, and shows where they differ
|
||||
wc <filename> # tells you how many lines, words and characters there are in a file. Use -lwc (lines, word, character) to ouput only 1 of those informations
|
||||
sort <filename> # sorts the contents of a text file line by line in alphabetical order, use -n for numeric sort and -r for reversing order.
|
||||
sort -t -k <filename> # sorts the contents on specific sort key field starting from 1, using the field separator t.
|
||||
rev # reverse string characters (hello becomes olleh)
|
||||
chmod -options <filename> # lets you change the read, write, and execute permissions on your files (more infos: SUID, GUID)
|
||||
gzip <filename> # compresses files using gzip algorithm
|
||||
gunzip <filename> # uncompresses files compressed by gzip
|
||||
gzcat <filename> # lets you look at gzipped file without actually having to gunzip it
|
||||
lpr <filename> # prints the file
|
||||
lpq # checks out the printer queue
|
||||
lprm <jobnumber> # removes something from the printer queue
|
||||
genscript # converts plain text files into postscript for printing and gives you some options for formatting
|
||||
dvips <filename> # prints .dvi files (i.e. files produced by LaTeX)
|
||||
grep <pattern> <filenames> # looks for the string in the files
|
||||
grep -r <pattern> <dir> # search recursively for pattern in directory
|
||||
head -n file_name | tail +n # Print nth line from file.
|
||||
head -y lines.txt | tail +x # want to display all the lines from x to y. This includes the xth and yth lines.
|
||||
|
||||
sed 's/<pattern>/<replacement>/g' <filename> # replace pattern in file with replacement value to std output the character after s (/) is the delimeter
|
||||
sed -i 's/<pattern>/<replacement>/g' <filename> # replace pattern in file with replacement value in place
|
||||
echo "this" | sed 's/is/at/g' # replace pattern from input stream with replacement value
|
||||
|
||||
##############################################################################
|
||||
# DIRECTORY COMMANDS
|
||||
##############################################################################
|
||||
|
||||
|
||||
mkdir <dirname> # makes a new directory
|
||||
rmdir <dirname> # remove an empty directory
|
||||
rmdir -rf <dirname> # remove a non-empty directory
|
||||
mv <dir1> <dir2> # rename a directory from <dir1> to <dir2>
|
||||
cd # changes to home
|
||||
cd .. # changes to the parent directory
|
||||
cd <dirname> # changes directory
|
||||
cp -r <dir1> <dir2> # copy <dir1> into <dir2> including sub-directories
|
||||
pwd # tells you where you currently are
|
||||
cd ~ # changes to home.
|
||||
cd - # changes to previous working directory
|
||||
|
||||
##############################################################################
|
||||
# SSH, SYSTEM INFO & NETWORK COMMANDS
|
||||
##############################################################################
|
||||
|
||||
|
||||
ssh user@host # connects to host as user
|
||||
ssh -p <port> user@host # connects to host on specified port as user
|
||||
ssh-copy-id user@host # adds your ssh key to host for user to enable a keyed or passwordless login
|
||||
|
||||
whoami # returns your username
|
||||
su <user> # switch to a different user
|
||||
su - # switch to root, likely needs to be sudo su -
|
||||
sudo <command> # execute command as the root user
|
||||
passwd # lets you change your password
|
||||
quota -v # shows what your disk quota is
|
||||
date # shows the current date and time
|
||||
cal # shows the month's calendar
|
||||
uptime # shows current uptime
|
||||
w # displays whois online
|
||||
finger <user> # displays information about user
|
||||
uname -a # shows kernel information
|
||||
man <command> # shows the manual for specified command
|
||||
info <command> # shows another documentation system for the specific command
|
||||
help # shows documentation about built-in commands and functions
|
||||
df # shows disk usage
|
||||
du <filename> # shows the disk usage of the files and directories in filename (du -s give only a total)
|
||||
resize2fs # ext2/ext3/ext4 file system resizer
|
||||
last <yourUsername> # lists your last logins
|
||||
ps -u yourusername # lists your processes
|
||||
kill <PID> # kills the processes with the ID you gave
|
||||
killall <processname> # kill all processes with the name
|
||||
top # displays your currently active processes
|
||||
lsof # lists open files
|
||||
bg # lists stopped or background jobs ; resume a stopped job in the background
|
||||
fg # brings the most recent job in the foreground
|
||||
fg <job> # brings job to the foreground
|
||||
|
||||
ping <host> # pings host and outputs results
|
||||
whois <domain> # gets whois information for domain
|
||||
dig <domain> # gets DNS information for domain
|
||||
dig -x <host> # reverses lookup host
|
||||
wget <file> # downloads file
|
||||
netstat # Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
|
||||
|
||||
time <command> # report time consumed by command execution
|
||||
|
||||
|
||||
##############################################################################
|
||||
# VARIABLES
|
||||
##############################################################################
|
||||
|
||||
|
||||
varname=value # defines a variable
|
||||
varname=value command # defines a variable to be in the environment of a particular subprocess
|
||||
echo $varname # checks a variable's value
|
||||
echo $$ # prints process ID of the current shell
|
||||
echo $! # prints process ID of the most recently invoked background job
|
||||
echo $? # displays the exit status of the last command
|
||||
read <varname> # reads a string from the input and assigns it to a variable
|
||||
read -p "prompt" <varname> # same as above but outputs a prompt to ask user for value
|
||||
column -t <filename> # display info in pretty columns (often used with pipe)
|
||||
let <varname> = <equation> # performs mathematical calculation using operators like +, -, *, /, %
|
||||
export VARNAME=value # defines an environment variable (will be available in subprocesses)
|
||||
export -f <funcname> # Exports function 'funcname'
|
||||
export var1="var1 value" # Export and assign in the same statement
|
||||
export <varname> # Copy Bash variable
|
||||
declare -x <varname> # Copy Bash variable
|
||||
|
||||
array[0]=valA # how to define an array
|
||||
array[1]=valB
|
||||
array[2]=valC
|
||||
array=([2]=valC [0]=valA [1]=valB) # another way
|
||||
array=(valA valB valC) # and another
|
||||
|
||||
${array[i]} # displays array's value for this index. If no index is supplied, array element 0 is assumed
|
||||
${#array[i]} # to find out the length of any element in the array
|
||||
${#array[@]} # to find out how many values there are in the array
|
||||
|
||||
declare -a # the variables are treated as arrays
|
||||
declare -f # uses function names only
|
||||
declare -F # displays function names without definitions
|
||||
declare -i # the variables are treated as integers
|
||||
declare -r # makes the variables read-only
|
||||
declare -x # marks the variables for export via the environment
|
||||
declare -l # uppercase values in the variable are converted to lowercase
|
||||
declare -A # makes it an associative array
|
||||
|
||||
${varname:-word} # if varname exists and isn't null, return its value; otherwise return word
|
||||
${varname:word} # if varname exists and isn't null, return its value; otherwise return word
|
||||
${varname:=word} # if varname exists and isn't null, return its value; otherwise set it word and then return its value
|
||||
${varname:?message} # if varname exists and isn't null, return its value; otherwise print varname, followed by message and abort the current command or script
|
||||
${varname:+word} # if varname exists and isn't null, return word; otherwise return null
|
||||
${varname:offset:length} # performs substring expansion. It returns the substring of $varname starting at offset and up to length characters
|
||||
|
||||
${variable#pattern} # if the pattern matches the beginning of the variable's value, delete the shortest part that matches and return the rest
|
||||
${variable##pattern} # if the pattern matches the beginning of the variable's value, delete the longest part that matches and return the rest
|
||||
${variable%pattern} # if the pattern matches the end of the variable's value, delete the shortest part that matches and return the rest
|
||||
${variable%%pattern} # if the pattern matches the end of the variable's value, delete the longest part that matches and return the rest
|
||||
${variable/pattern/string} # the longest match to pattern in variable is replaced by string. Only the first match is replaced
|
||||
${variable//pattern/string} # the longest match to pattern in variable is replaced by string. All matches are replaced
|
||||
|
||||
${#varname} # returns the length of the value of the variable as a character string
|
||||
|
||||
*(patternlist) # matches zero or more occurrences of the given patterns
|
||||
+(patternlist) # matches one or more occurrences of the given patterns
|
||||
?(patternlist) # matches zero or one occurrence of the given patterns
|
||||
@(patternlist) # matches exactly one of the given patterns
|
||||
!(patternlist) # matches anything except one of the given patterns
|
||||
|
||||
$(UNIX command) # command substitution: runs the command and returns standard output
|
||||
|
||||
typeset -l <x> # makes variable local - <x> must be an interger
|
||||
|
||||
##############################################################################
|
||||
# FUNCTIONS
|
||||
##############################################################################
|
||||
|
||||
|
||||
# The function refers to passed arguments by position (as if they were positional parameters), that is, $1, $2, and so forth.
|
||||
# $@ is equal to "$1" "$2"... "$N", where N is the number of positional parameters. $# holds the number of positional parameters.
|
||||
|
||||
|
||||
function functname() {
|
||||
shell commands
|
||||
}
|
||||
|
||||
unset -f functname # deletes a function definition
|
||||
declare -f # displays all defined functions in your login session
|
||||
|
||||
|
||||
##############################################################################
|
||||
# FLOW CONTROLS
|
||||
##############################################################################
|
||||
|
||||
|
||||
statement1 && statement2 # and operator
|
||||
statement1 || statement2 # or operator
|
||||
|
||||
-a # and operator inside a test conditional expression
|
||||
-o # or operator inside a test conditional expression
|
||||
|
||||
# STRINGS
|
||||
|
||||
str1 == str2 # str1 matches str2
|
||||
str1 != str2 # str1 does not match str2
|
||||
str1 < str2 # str1 is less than str2 (alphabetically)
|
||||
str1 > str2 # str1 is greater than str2 (alphabetically)
|
||||
str1 \> str2 # str1 is sorted after str2
|
||||
str1 \< str2 # str1 is sorted before str2
|
||||
-n str1 # str1 is not null (has length greater than 0)
|
||||
-z str1 # str1 is null (has length 0)
|
||||
|
||||
# FILES
|
||||
|
||||
-a file # file exists or its compilation is successful
|
||||
-d file # file exists and is a directory
|
||||
-e file # file exists; same -a
|
||||
-f file # file exists and is a regular file (i.e., not a directory or other special type of file)
|
||||
-r file # you have read permission
|
||||
-s file # file exists and is not empty
|
||||
-w file # your have write permission
|
||||
-x file # you have execute permission on file, or directory search permission if it is a directory
|
||||
-N file # file was modified since it was last read
|
||||
-O file # you own file
|
||||
-G file # file's group ID matches yours (or one of yours, if you are in multiple groups)
|
||||
file1 -nt file2 # file1 is newer than file2
|
||||
file1 -ot file2 # file1 is older than file2
|
||||
|
||||
# NUMBERS
|
||||
|
||||
-lt # less than
|
||||
-le # less than or equal
|
||||
-eq # equal
|
||||
-ge # greater than or equal
|
||||
-gt # greater than
|
||||
-ne # not equal
|
||||
|
||||
if condition
|
||||
then
|
||||
statements
|
||||
[elif condition
|
||||
then statements...]
|
||||
[else
|
||||
statements]
|
||||
fi
|
||||
|
||||
for x in {1..10}
|
||||
do
|
||||
statements
|
||||
done
|
||||
|
||||
for name [in list]
|
||||
do
|
||||
statements that can use $name
|
||||
done
|
||||
|
||||
for (( initialisation ; ending condition ; update ))
|
||||
do
|
||||
statements...
|
||||
done
|
||||
|
||||
case expression in
|
||||
pattern1 )
|
||||
statements ;;
|
||||
pattern2 )
|
||||
statements ;;
|
||||
esac
|
||||
|
||||
select name [in list]
|
||||
do
|
||||
statements that can use $name
|
||||
done
|
||||
|
||||
while condition; do
|
||||
statements
|
||||
done
|
||||
|
||||
until condition; do
|
||||
statements
|
||||
done
|
||||
|
||||
##############################################################################
|
||||
# COMMAND-LINE PROCESSING CYCLE
|
||||
##############################################################################
|
||||
|
||||
|
||||
# The default order for command lookup is functions, followed by built-ins, with scripts and executables last.
|
||||
# There are three built-ins that you can use to override this order: `command`, `builtin` and `enable`.
|
||||
|
||||
command # removes alias and function lookup. Only built-ins and commands found in the search path are executed
|
||||
builtin # looks up only built-in commands, ignoring functions and commands found in PATH
|
||||
enable # enables and disables shell built-ins
|
||||
|
||||
eval # takes arguments and run them through the command-line processing steps all over again
|
||||
|
||||
|
||||
##############################################################################
|
||||
# INPUT/OUTPUT REDIRECTORS
|
||||
##############################################################################
|
||||
|
||||
|
||||
cmd1|cmd2 # pipe; takes standard output of cmd1 as standard input to cmd2
|
||||
< file # takes standard input from file
|
||||
> file # directs standard output to file
|
||||
>> file # directs standard output to file; append to file if it already exists
|
||||
>|file # forces standard output to file even if noclobber is set
|
||||
n>|file # forces output to file from file descriptor n even if noclobber is set
|
||||
<> file # uses file as both standard input and standard output
|
||||
n<>file # uses file as both input and output for file descriptor n
|
||||
n>file # directs file descriptor n to file
|
||||
n<file # takes file descriptor n from file
|
||||
n>>file # directs file description n to file; append to file if it already exists
|
||||
n>& # duplicates standard output to file descriptor n
|
||||
n<& # duplicates standard input from file descriptor n
|
||||
n>&m # file descriptor n is made to be a copy of the output file descriptor
|
||||
n<&m # file descriptor n is made to be a copy of the input file descriptor
|
||||
&>file # directs standard output and standard error to file
|
||||
<&- # closes the standard input
|
||||
>&- # closes the standard output
|
||||
n>&- # closes the ouput from file descriptor n
|
||||
n<&- # closes the input from file descriptor n
|
||||
|
||||
|tee <file># output command to both terminal and a file (-a to append to file)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PROCESS HANDLING
|
||||
##############################################################################
|
||||
|
||||
|
||||
# To suspend a job, type CTRL+Z while it is running. You can also suspend a job with CTRL+Y.
|
||||
# This is slightly different from CTRL+Z in that the process is only stopped when it attempts to read input from terminal.
|
||||
# Of course, to interrupt a job, type CTRL+C.
|
||||
|
||||
myCommand & # runs job in the background and prompts back the shell
|
||||
|
||||
jobs # lists all jobs (use with -l to see associated PID)
|
||||
|
||||
fg # brings a background job into the foreground
|
||||
fg %+ # brings most recently invoked background job
|
||||
fg %- # brings second most recently invoked background job
|
||||
fg %N # brings job number N
|
||||
fg %string # brings job whose command begins with string
|
||||
fg %?string # brings job whose command contains string
|
||||
|
||||
kill -l # returns a list of all signals on the system, by name and number
|
||||
kill PID # terminates process with specified PID
|
||||
kill -s SIGKILL 4500 # sends a signal to force or terminate the process
|
||||
kill -15 913 # Ending PID 913 process with signal 15 (TERM)
|
||||
kill %1 # Where %1 is the number of job as read from 'jobs' command.
|
||||
|
||||
ps # prints a line of information about the current running login shell and any processes running under it
|
||||
ps -a # selects all processes with a tty except session leaders
|
||||
|
||||
trap cmd sig1 sig2 # executes a command when a signal is received by the script
|
||||
trap "" sig1 sig2 # ignores that signals
|
||||
trap - sig1 sig2 # resets the action taken when the signal is received to the default
|
||||
|
||||
disown <PID|JID> # removes the process from the list of jobs
|
||||
|
||||
wait # waits until all background jobs have finished
|
||||
sleep <number> # wait # of seconds before continuing
|
||||
|
||||
pv # display progress bar for data handling commands. often used with pipe like |pv
|
||||
yes # give yes response everytime an input is requested from script/process
|
||||
|
||||
|
||||
##############################################################################
|
||||
# TIPS & TRICKS
|
||||
##############################################################################
|
||||
|
||||
|
||||
# set an alias
|
||||
cd; nano .bash_profile
|
||||
> alias gentlenode='ssh admin@gentlenode.com -p 3404' # add your alias in .bash_profile
|
||||
|
||||
# to quickly go to a specific directory
|
||||
cd; nano .bashrc
|
||||
> shopt -s cdable_vars
|
||||
> export websites="/Users/mac/Documents/websites"
|
||||
|
||||
source .bashrc
|
||||
cd $websites
|
||||
|
||||
|
||||
##############################################################################
|
||||
# DEBUGGING SHELL PROGRAMS
|
||||
##############################################################################
|
||||
|
||||
|
||||
bash -n scriptname # don't run commands; check for syntax errors only
|
||||
set -o noexec # alternative (set option in script)
|
||||
|
||||
bash -v scriptname # echo commands before running them
|
||||
set -o verbose # alternative (set option in script)
|
||||
|
||||
bash -x scriptname # echo commands after command-line processing
|
||||
set -o xtrace # alternative (set option in script)
|
||||
|
||||
trap 'echo $varname' EXIT # useful when you want to print out the values of variables at the point that your script exits
|
||||
|
||||
function errtrap {
|
||||
es=$?
|
||||
echo "ERROR line $1: Command exited with status $es."
|
||||
}
|
||||
|
||||
trap 'errtrap $LINENO' ERR # is run whenever a command in the surrounding script or function exits with non-zero status
|
||||
|
||||
function dbgtrap {
|
||||
echo "badvar is $badvar"
|
||||
}
|
||||
|
||||
trap dbgtrap DEBUG # causes the trap code to be executed before every statement in a function or script
|
||||
# ...section of code in which the problem occurs...
|
||||
trap - DEBUG # turn off the DEBUG trap
|
||||
|
||||
function returntrap {
|
||||
echo "A return occurred"
|
||||
}
|
||||
|
||||
trap returntrap RETURN # is executed each time a shell function or a script executed with the . or source commands finishes executing
|
||||
|
||||
##############################################################################
|
||||
# COLORS AND BACKGROUNDS
|
||||
##############################################################################
|
||||
# note: \e or \x1B also work instead of \033
|
||||
# Reset
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
# Regular Colors
|
||||
Black='\033[0;30m' # Black
|
||||
Red='\033[0;31m' # Red
|
||||
Green='\033[0;32m' # Green
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
Blue='\033[0;34m' # Blue
|
||||
Purple='\033[0;35m' # Purple
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;97m' # White
|
||||
|
||||
# Additional colors
|
||||
LGrey='\033[0;37m' # Light Gray
|
||||
DGrey='\033[0;90m' # Dark Gray
|
||||
LRed='\033[0;91m' # Light Red
|
||||
LGreen='\033[0;92m' # Light Green
|
||||
LYellow='\033[0;93m'# Light Yellow
|
||||
LBlue='\033[0;94m' # Light Blue
|
||||
LPurple='\033[0;95m'# Light Purple
|
||||
LCyan='\033[0;96m' # Light Cyan
|
||||
|
||||
|
||||
# Bold
|
||||
BBlack='\033[1;30m' # Black
|
||||
BRed='\033[1;31m' # Red
|
||||
BGreen='\033[1;32m' # Green
|
||||
BYellow='\033[1;33m'# Yellow
|
||||
BBlue='\033[1;34m' # Blue
|
||||
BPurple='\033[1;35m'# Purple
|
||||
BCyan='\033[1;36m' # Cyan
|
||||
BWhite='\033[1;37m' # White
|
||||
|
||||
# Underline
|
||||
UBlack='\033[4;30m' # Black
|
||||
URed='\033[4;31m' # Red
|
||||
UGreen='\033[4;32m' # Green
|
||||
UYellow='\033[4;33m'# Yellow
|
||||
UBlue='\033[4;34m' # Blue
|
||||
UPurple='\033[4;35m'# Purple
|
||||
UCyan='\033[4;36m' # Cyan
|
||||
UWhite='\033[4;37m' # White
|
||||
|
||||
# Background
|
||||
On_Black='\033[40m' # Black
|
||||
On_Red='\033[41m' # Red
|
||||
On_Green='\033[42m' # Green
|
||||
On_Yellow='\033[43m'# Yellow
|
||||
On_Blue='\033[44m' # Blue
|
||||
On_Purple='\033[45m'# Purple
|
||||
On_Cyan='\033[46m' # Cyan
|
||||
On_White='\033[47m' # White
|
||||
|
||||
# Example of usage
|
||||
echo -e "${Green}This is GREEN text${Color_Off} and normal text"
|
||||
echo -e "${Red}${On_White}This is Red test on White background${Color_Off}"
|
||||
# option -e is mandatory, it enable interpretation of backslash escapes
|
||||
printf "${Red} This is red \n"
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './bash-memo.content.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Command } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Bash Cheatsheet',
|
||||
path: '/bash-memo',
|
||||
description: 'Bash common commands',
|
||||
keywords: ['bash', 'shell'],
|
||||
component: () => import('./bash-memo.vue'),
|
||||
icon: Command,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
Key,
|
||||
PrivateKey, Signature,
|
||||
} from 'sshpk';
|
||||
import 'webcrypto-liner-shim';
|
||||
import type * as openpgp from 'openpgp';
|
||||
import * as forge from 'node-forge';
|
||||
import oids from './oids.json';
|
||||
@@ -63,6 +64,11 @@ export function getPublicKeyLabelValues(publicKey: Key) {
|
||||
value: onErrorReturnErrorMessage(() => publicKey.fingerprint('sha512')),
|
||||
multiline: true,
|
||||
},
|
||||
{
|
||||
label: 'Key (PEM):',
|
||||
value: onErrorReturnErrorMessage(() => publicKey.toString('pem')),
|
||||
multiline: true,
|
||||
},
|
||||
] as LabelValue[];
|
||||
}
|
||||
|
||||
@@ -99,6 +105,11 @@ export function getPrivateKeyLabelValues(privateKey: PrivateKey) {
|
||||
value: onErrorReturnErrorMessage(() => privateKey.fingerprint('sha512')),
|
||||
multiline: true,
|
||||
},
|
||||
{
|
||||
label: 'Key (PEM):',
|
||||
value: onErrorReturnErrorMessage(() => privateKey.toString('pem')),
|
||||
multiline: true,
|
||||
},
|
||||
] as LabelValue[];
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import type {
|
||||
PrivateKey, Signature, SignatureFormatType,
|
||||
} from 'sshpk';
|
||||
import { Base64 } from 'js-base64';
|
||||
import 'webcrypto-liner-shim';
|
||||
import * as openpgp from 'openpgp';
|
||||
import * as forge from 'node-forge';
|
||||
import { type LabelValue, getCSRLabelValues, getCertificateLabelValues, getFingerprintLabelValues, getPGPPrivateKeyLabelValuesAsync, getPGPPublicKeyLabelValuesAsync, getPrivateKeyLabelValues, getPublicKeyLabelValues, getSignatureLabelValues } from './certificate-key-parser.infos';
|
||||
|
||||
@@ -47,14 +47,21 @@ const parsedSections = computedAsync<LabelValue[][]>(async () => {
|
||||
else if (inputType.value === 'content' && inputContent) {
|
||||
inputKeyOrCertificateValue = inputContent;
|
||||
}
|
||||
const parsed = await getKeysOrCertificatesInfosAsync(inputKeyOrCertificateValue, passphrase.value);
|
||||
if (parsed.length === 1) {
|
||||
const { values, certificateX509DER: certPEM } = parsed[0];
|
||||
certificateX509DER.value = certPEM || '';
|
||||
return [values];
|
||||
try {
|
||||
const parsed = await getKeysOrCertificatesInfosAsync(inputKeyOrCertificateValue, passphrase.value);
|
||||
if (parsed.length === 1) {
|
||||
const { values, certificateX509DER: certPEM } = parsed[0];
|
||||
certificateX509DER.value = certPEM || '';
|
||||
return [values];
|
||||
}
|
||||
else {
|
||||
return parsed.map(p => p.values);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return parsed.map(p => p.values);
|
||||
catch (e: any) {
|
||||
return [
|
||||
[{ label: 'Parsing Error', value: e.toString() }],
|
||||
];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -21,7 +21,7 @@ function getCountDownHref(c: CountDown) {
|
||||
|
||||
const days = useQueryParam({ name: 'd', defaultValue: 0 });
|
||||
const hours = useQueryParam({ name: 'h', defaultValue: 0 });
|
||||
const minutes = useQueryParam({ name: 'm', defaultValue: 15 });
|
||||
const minutes = useQueryParam({ name: 'm', defaultValue: 0 });
|
||||
const seconds = useQueryParam({ name: 's', defaultValue: 0 });
|
||||
const history = useStorage<CountDown[]>('countdown:hst', []);
|
||||
|
||||
@@ -72,6 +72,23 @@ function ended() {
|
||||
if (status.value === 'running') {
|
||||
status.value = 'ended';
|
||||
}
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const fullScreenElement = ref<HTMLElement>();
|
||||
function toggleFullScreen() {
|
||||
const element = fullScreenElement.value;
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
if (!document.fullscreenElement) {
|
||||
element?.requestFullscreen();
|
||||
}
|
||||
else {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const isEnded = computed(() => status.value === 'ended');
|
||||
@@ -112,19 +129,19 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<Countdown :deadline="deadlineFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
|
||||
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
|
||||
<div>
|
||||
<Countdown :deadline="deadlineFormatted" :stop="status !== 'running'" mb-2 countdown-size="4rem" @time-elapsed="ended()" />
|
||||
|
||||
<n-p align="center">
|
||||
Alarm at: {{ deadlineDate }}
|
||||
</n-p>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="toggleFullScreen"
|
||||
>
|
||||
Toggle Fullscreen
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<n-modal v-model:show="isEnded" mask-closable="false">
|
||||
@@ -145,6 +162,19 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
</n-card>
|
||||
</n-modal>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<n-p align="center">
|
||||
Alarm at: {{ deadlineDate }}
|
||||
</n-p>
|
||||
|
||||
<c-card v-if="history" title="History">
|
||||
<div flex justify-center gap-1>
|
||||
<template v-for="(entry, index) in history" :key="index">
|
||||
@@ -162,3 +192,12 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
<audio ref="audio" loop src="/Beep.mp3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#fullScreenElement:fullscreen {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,190 @@
|
||||
<script setup lang="ts">
|
||||
import { Countdown } from 'vue3-flip-countdown';
|
||||
import { parseExpression } from 'cron-parser';
|
||||
import moment from 'moment';
|
||||
import { useQueryParam } from '@/composable/queryParams';
|
||||
|
||||
const allDays = '0,1,2,3,4,5,6';
|
||||
const alarmAt = useQueryParam({ name: 'at', defaultValue: '17:30:00' });
|
||||
const alarmDays = useQueryParam({ name: 'days', defaultValue: allDays });
|
||||
const history = useStorage<{ days: string; at: string }[]>('cronalarm:hst', []);
|
||||
|
||||
function getTimeHref(at: string, days: string) {
|
||||
const parsedUrl = new URL(window.location.href);
|
||||
parsedUrl.searchParams.set('at', at);
|
||||
parsedUrl.searchParams.set('days', days);
|
||||
return parsedUrl.toString();
|
||||
}
|
||||
|
||||
const status = ref<'stopped' | 'ended' | 'running'>('stopped');
|
||||
|
||||
const audio = ref<HTMLAudioElement | null>(null);
|
||||
|
||||
watchEffect(() => {
|
||||
if (status.value === 'ended') {
|
||||
audio.value?.play();
|
||||
}
|
||||
});
|
||||
|
||||
const now = ref(moment());
|
||||
const daysArray = computed<string[]>({
|
||||
get() {
|
||||
return (alarmDays.value || allDays).split(',').map(s => s.trim());
|
||||
},
|
||||
set(newValue) {
|
||||
alarmDays.value = newValue.join(',');
|
||||
},
|
||||
});
|
||||
const cronExpression = computed(() => {
|
||||
const [h, m, s] = alarmAt.value.split(':');
|
||||
return `${s} ${m} ${h} * * ${alarmDays.value}`;
|
||||
});
|
||||
const alarmAtDate = computed(() => {
|
||||
const interval = parseExpression(cronExpression.value);
|
||||
return interval.next().toDate();
|
||||
});
|
||||
|
||||
const fmt = 'YYYY-MM-DD HH:mm:ss';
|
||||
const alarmAtFormatted = computed(() => {
|
||||
return moment(alarmAtDate.value).format(fmt);
|
||||
});
|
||||
|
||||
function start() {
|
||||
now.value = moment();
|
||||
status.value = 'running';
|
||||
const histoEntry = { at: alarmAt.value, days: alarmDays.value };
|
||||
if (!history.value.find(h => h.at === histoEntry.at && h.days === histoEntry.days)) {
|
||||
history.value = [histoEntry, ...history.value];
|
||||
}
|
||||
}
|
||||
|
||||
function stop() {
|
||||
status.value = 'stopped';
|
||||
audio.value?.pause();
|
||||
}
|
||||
|
||||
function ended() {
|
||||
if (status.value === 'running') {
|
||||
status.value = 'ended';
|
||||
}
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const fullScreenElement = ref<HTMLElement>();
|
||||
function toggleFullScreen() {
|
||||
const element = fullScreenElement.value;
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
if (!document.fullscreenElement) {
|
||||
element?.requestFullscreen();
|
||||
}
|
||||
else {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const isEnded = computed(() => status.value === 'ended');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div max-w-600px>
|
||||
<c-card :disabled="status !== 'stopped'" title="Alarm" mb-4>
|
||||
<div mb-1 flex justify-center>
|
||||
<n-form-item label="Alarm at:" label-placement="left">
|
||||
<n-time-picker v-model:formatted-value="alarmAt" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
<div flex justify-center>
|
||||
<n-checkbox-group v-model:value="daysArray">
|
||||
<n-space item-style="display: flex;">
|
||||
<n-checkbox value="1" label="Monday" />
|
||||
<n-checkbox value="2" label="Tuesday" />
|
||||
<n-checkbox value="3" label="Wednesday" />
|
||||
<n-checkbox value="4" label="Thursday" />
|
||||
<n-checkbox value="5" label="Friday" />
|
||||
<n-checkbox value="6" label="Saturday" />
|
||||
<n-checkbox value="0" label="Sunday" />
|
||||
</n-space>
|
||||
</n-checkbox-group>
|
||||
</div>
|
||||
|
||||
<div flex justify-center>
|
||||
<c-button
|
||||
@click="start"
|
||||
>
|
||||
Start
|
||||
</c-button>
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
|
||||
<div>
|
||||
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="toggleFullScreen"
|
||||
>
|
||||
Toggle Fullscreen
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<n-p align="center">
|
||||
Next alarm at: {{ alarmAtDate }}
|
||||
</n-p>
|
||||
|
||||
<n-modal v-model:show="isEnded" mask-closable="false">
|
||||
<n-card
|
||||
style="width: 600px"
|
||||
title="Timer finished"
|
||||
:bordered="false"
|
||||
size="huge"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
<p>Timer elapsed!</p>
|
||||
<template #footer>
|
||||
<n-button @click="stop()">
|
||||
OK
|
||||
</n-button>
|
||||
</template>
|
||||
</n-card>
|
||||
</n-modal>
|
||||
|
||||
<c-card v-if="history" title="History">
|
||||
<div flex justify-center gap-1>
|
||||
<template v-for="(entry, index) in history" :key="index">
|
||||
{{ index > 0 ? ' / ' : '' }}
|
||||
<n-a :href="getTimeHref(entry.at, entry.days)">
|
||||
At: {{ entry.at }} ; Days: {{ entry.days || '*' }}
|
||||
</n-a>
|
||||
</template>
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<audio ref="audio" loop src="/Beep.mp3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#fullScreenElement:fullscreen {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Alarm } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Cron/Weekday Alarm',
|
||||
path: '/cron-alarm',
|
||||
description: 'Alarm based on time and weekdays expression',
|
||||
keywords: ['cron', 'week', 'day', 'alarm'],
|
||||
component: () => import('./cron-alarm.vue'),
|
||||
icon: Alarm,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Datetime',
|
||||
});
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
isValid,
|
||||
parseISO,
|
||||
} from 'date-fns';
|
||||
import { ticksFromDate, ticksToDate } from 'tick-time';
|
||||
import { UTCDate } from '@date-fns/utc';
|
||||
import type { DateFormat, ToDateMapper } from './date-time-converter.types';
|
||||
import {
|
||||
@@ -128,6 +129,12 @@ const formats: DateFormat[] = [
|
||||
toDate: date => win32FileTimeToUnix(date),
|
||||
formatMatcher: isWin32FileTime,
|
||||
},
|
||||
{
|
||||
name: '.Net ticks',
|
||||
fromDate: date => ticksFromDate(date),
|
||||
toDate: date => ticksToDate(date) || new Date(),
|
||||
formatMatcher: date => /\d+/.test(date || ''),
|
||||
},
|
||||
];
|
||||
|
||||
const formatIndex = ref(6);
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
declare module 'tick-time' {
|
||||
export function ticksFromDate(date: Date): string;
|
||||
export function ticksToDate(ticks: string): Date;
|
||||
}
|
||||
@@ -1,42 +1,203 @@
|
||||
<script setup lang="ts">
|
||||
import type { EmojiInfo } from './emoji.types';
|
||||
import { getAllCodePoints, isEmojiSupported } from './emoji-utils';
|
||||
import { useCopy } from '@/composable/copy';
|
||||
|
||||
const props = (defineProps<{ emojiInfo: EmojiInfo }>());
|
||||
const props = defineProps<{ emojiInfo: EmojiInfo }>();
|
||||
const { emojiInfo } = toRefs(props);
|
||||
|
||||
const { copy } = useCopy();
|
||||
|
||||
// Check if emoji is properly supported
|
||||
const emojiSupported = computed(() => isEmojiSupported(emojiInfo.value.emoji));
|
||||
|
||||
// Get complete code point information
|
||||
const completeCodePoints = computed(() => getAllCodePoints(emojiInfo.value.emoji));
|
||||
|
||||
// Check if keywords are truncated
|
||||
const keywordsEl = ref<HTMLElement>();
|
||||
const isKeywordsTruncated = computed(() => {
|
||||
if (!keywordsEl.value) {
|
||||
return false;
|
||||
}
|
||||
return keywordsEl.value.scrollWidth > keywordsEl.value.clientWidth;
|
||||
});
|
||||
|
||||
// Copy functions with better notifications
|
||||
async function copyEmoji() {
|
||||
await copy(emojiInfo.value.emoji, {
|
||||
notificationMessage: `Emoji ${emojiInfo.value.emoji} copied to clipboard`,
|
||||
});
|
||||
}
|
||||
|
||||
async function copyCodePoints() {
|
||||
await copy(completeCodePoints.value, {
|
||||
notificationMessage: `Code points '${completeCodePoints.value}' copied to clipboard`,
|
||||
});
|
||||
}
|
||||
|
||||
async function copyUnicode() {
|
||||
await copy(emojiInfo.value.unicode, {
|
||||
notificationMessage: `Unicode '${emojiInfo.value.unicode}' copied to clipboard`,
|
||||
});
|
||||
}
|
||||
|
||||
async function copyName() {
|
||||
await copy(emojiInfo.value.title, {
|
||||
notificationMessage: `Name '${emojiInfo.value.title}' copied to clipboard`,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card flex items-center gap-3 important:py-8px important:pl-10px important:pr-5px>
|
||||
<div cursor-pointer text-30px @click="copy(emojiInfo.emoji, { notificationMessage: `Emoji ${emojiInfo.emoji} copied to the clipboard` })">
|
||||
<c-card
|
||||
:class="{ 'emoji-unsupported': !emojiSupported }"
|
||||
flex
|
||||
items-center
|
||||
gap-3
|
||||
transition-all
|
||||
important:py-8px
|
||||
important:pl-10px
|
||||
important:pr-5px
|
||||
hover:shadow-md
|
||||
>
|
||||
<!-- Emoji Display -->
|
||||
<div
|
||||
cursor-pointer
|
||||
text-30px
|
||||
class="emoji-display"
|
||||
:class="{
|
||||
'emoji-fallback': !emojiSupported,
|
||||
'emoji-supported': emojiSupported,
|
||||
}"
|
||||
:title="`Click to copy ${emojiInfo.emoji}`"
|
||||
@click="copyEmoji"
|
||||
>
|
||||
{{ emojiInfo.emoji }}
|
||||
</div>
|
||||
|
||||
<!-- Emoji Information -->
|
||||
<div min-w-0 flex-1>
|
||||
<div truncate font-bold>
|
||||
<!-- Title (clickable to copy name) -->
|
||||
<div
|
||||
cursor-pointer
|
||||
truncate
|
||||
font-bold
|
||||
transition
|
||||
hover:text-primary
|
||||
:title="`Click to copy name: ${emojiInfo.title}`"
|
||||
@click="copyName"
|
||||
>
|
||||
{{ emojiInfo.title }}
|
||||
</div>
|
||||
|
||||
<!-- <div>
|
||||
<c-link>
|
||||
{{ emojiInfo.codePoints }}
|
||||
</c-link>
|
||||
<!-- Keywords (if available) -->
|
||||
<div
|
||||
v-if="emojiInfo.keywords && emojiInfo.keywords.length > 0"
|
||||
ref="keywordsEl"
|
||||
mb-1
|
||||
truncate
|
||||
text-xs
|
||||
op-60
|
||||
:title="isKeywordsTruncated ? emojiInfo.keywords.join(', ') : undefined"
|
||||
>
|
||||
{{ emojiInfo.keywords.join(', ') }}
|
||||
</div>
|
||||
<div />
|
||||
<div rounded op-70>
|
||||
Unicode: <span border="1px solid current op-30" b-rd-xl px-12px py-4px>{{ emojiInfo.unicode }}</span>
|
||||
</div> -->
|
||||
|
||||
<div flex gap-2 text-xs font-mono op-70>
|
||||
<span cursor-pointer transition hover:text-primary @click="copy(emojiInfo.codePoints, { notificationMessage: `Code points '${emojiInfo.codePoints}' copied to the clipboard` })">
|
||||
{{ emojiInfo.codePoints }}
|
||||
<!-- Code Points and Unicode -->
|
||||
<div flex flex-col text-xs font-mono op-70>
|
||||
<!-- Code Points -->
|
||||
<span
|
||||
cursor-pointer
|
||||
truncate
|
||||
px-1
|
||||
py-0.25
|
||||
transition
|
||||
hover:bg-gray-100
|
||||
hover:text-primary
|
||||
hover:op-100
|
||||
dark:hover:bg-gray-800
|
||||
:title="`Click to copy: ${completeCodePoints}`"
|
||||
@click="copyCodePoints"
|
||||
>
|
||||
{{ completeCodePoints }}
|
||||
</span>
|
||||
<span cursor-pointer truncate transition hover:text-primary @click="copy(emojiInfo.unicode, { notificationMessage: `Unicode '${emojiInfo.unicode}' copied to the clipboard` })">
|
||||
|
||||
<!-- Unicode Escape -->
|
||||
<span
|
||||
cursor-pointer
|
||||
truncate
|
||||
rounded
|
||||
px-1
|
||||
py-0.25
|
||||
transition
|
||||
hover:bg-gray-100
|
||||
hover:text-primary
|
||||
hover:op-100
|
||||
dark:hover:bg-gray-800
|
||||
:title="`Click to copy: ${emojiInfo.unicode}`"
|
||||
@click="copyUnicode"
|
||||
>
|
||||
{{ emojiInfo.unicode }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Support indicator -->
|
||||
<div v-if="!emojiSupported" text-xs op-50 title="This emoji might not display correctly on your system">
|
||||
⚠️
|
||||
</div>
|
||||
</c-card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.emoji-display {
|
||||
font-family:
|
||||
'Noto Color Emoji', /* Best flag and complex emoji support */
|
||||
'Apple Color Emoji', /* Apple devices */
|
||||
'Segoe UI Emoji', /* Windows */
|
||||
'Twemoji Mozilla', /* Firefox fallback */
|
||||
'EmojiOne Color', /* Additional fallback */
|
||||
sans-serif;
|
||||
font-feature-settings: 'liga' off;
|
||||
font-variant-emoji: emoji;
|
||||
text-rendering: optimizeQuality;
|
||||
line-height: 1;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.emoji-display:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.emoji-supported {
|
||||
/* Additional styles for well-supported emojis */
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.emoji-fallback {
|
||||
/* Styling for potentially unsupported emojis */
|
||||
background-color: rgba(128, 128, 128, 0.1);
|
||||
border-radius: 4px;
|
||||
padding: 2px 4px;
|
||||
border: 1px dashed rgba(128, 128, 128, 0.3);
|
||||
}
|
||||
|
||||
.emoji-unsupported {
|
||||
opacity: 0.8;
|
||||
border-left: 3px solid orange;
|
||||
}
|
||||
|
||||
/* Hover effects for interactive elements */
|
||||
.emoji-display,
|
||||
[title*='Click to copy'] {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* Better responsive design */
|
||||
@media (max-width: 640px) {
|
||||
.emoji-display {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,12 +3,55 @@ import emojiUnicodeData from 'unicode-emoji-json';
|
||||
import emojiKeywords from 'emojilib';
|
||||
import _ from 'lodash';
|
||||
import type { EmojiInfo } from './emoji.types';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import { escapeUnicodeComplete, getAllCodePoints } from './emoji-utils';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const escapeUnicode = ({ emoji }: { emoji: string }) => emoji.split('').map(unit => `\\u${unit.charCodeAt(0).toString(16).padStart(4, '0')}`).join('');
|
||||
const getEmojiCodePoints = ({ emoji }: { emoji: string }) => emoji.codePointAt(0) ? `0x${emoji.codePointAt(0)?.toString(16)}` : undefined;
|
||||
// Enhanced emoji processing functions
|
||||
const escapeUnicode = ({ emoji }: { emoji: string }) => escapeUnicodeComplete(emoji);
|
||||
|
||||
function getEmojiCodePoints({ emoji }: { emoji: string }) {
|
||||
// Get all code points for complex emojis (like flags)
|
||||
const codePoints: string[] = [];
|
||||
for (const char of emoji) {
|
||||
const codePoint = char.codePointAt(0);
|
||||
if (codePoint) {
|
||||
codePoints.push(`0x${codePoint.toString(16)}`);
|
||||
}
|
||||
}
|
||||
return codePoints.length > 0 ? codePoints.join(' ') : undefined;
|
||||
}
|
||||
|
||||
// Function to detect if a string contains emojis
|
||||
function containsEmoji(text: string): boolean {
|
||||
// Check each character in the text against our emoji data
|
||||
for (const char of text) {
|
||||
if (emojiUnicodeData[char]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Function to convert emojis in text to their unicode representations
|
||||
function convertEmojisToUnicode(text: string): string {
|
||||
let result = text;
|
||||
|
||||
// Process each character/emoji in the string
|
||||
for (const char of text) {
|
||||
// Check if this character is an emoji by looking it up in our emoji data
|
||||
if (emojiUnicodeData[char]) {
|
||||
const unicodeString = escapeUnicode({ emoji: char });
|
||||
if (unicodeString) {
|
||||
// Replace the emoji with its unicode representation
|
||||
result = result.replace(char, unicodeString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Process emojis with enhanced code point handling
|
||||
const emojis = _.map(emojiUnicodeData, (emojiInfo, emoji) => ({
|
||||
...emojiInfo,
|
||||
emoji,
|
||||
@@ -16,75 +59,167 @@ const emojis = _.map(emojiUnicodeData, (emojiInfo, emoji) => ({
|
||||
keywords: emojiKeywords[emoji as keyof typeof emojiKeywords],
|
||||
codePoints: getEmojiCodePoints({ emoji }),
|
||||
unicode: escapeUnicode({ emoji }),
|
||||
allCodePoints: getAllCodePoints(emoji), // Add complete code point info
|
||||
}));
|
||||
|
||||
const emojisGroups: { emojiInfos: EmojiInfo[]; group: string }[] = _
|
||||
.chain(emojis)
|
||||
// Group emojis and sort groups for better organization
|
||||
const emojisGroups: { emojiInfos: EmojiInfo[]; group: string }[] = _.chain(emojis)
|
||||
.groupBy('group')
|
||||
.map((emojiInfos, group) => ({ group, emojiInfos }))
|
||||
.map((emojiInfos, group) => ({
|
||||
group: _.startCase(group), // Better group name formatting
|
||||
emojiInfos,
|
||||
}))
|
||||
.value();
|
||||
|
||||
const limit = ref(100);
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const limit = ref(150);
|
||||
const rawSearchQuery = ref('');
|
||||
const searchQuery = useDebouncedRef('', 250);
|
||||
|
||||
const { searchResult } = useFuzzySearch({
|
||||
// Add automated lazy loading for emoji groups
|
||||
const visibleGroupsCount = ref(1); // Start with 1 group
|
||||
let loadingInterval: NodeJS.Timeout | null = null;
|
||||
|
||||
// Watch for raw search query changes and process emojis
|
||||
watch(rawSearchQuery, (newQuery) => {
|
||||
if (containsEmoji(newQuery)) {
|
||||
// Convert emojis to unicode and update the debounced search query
|
||||
const unicodeQuery = convertEmojisToUnicode(newQuery);
|
||||
searchQuery.value = unicodeQuery;
|
||||
}
|
||||
else {
|
||||
// Regular text search
|
||||
searchQuery.value = newQuery;
|
||||
}
|
||||
});
|
||||
|
||||
const { searchResult } = useFlexSearch({
|
||||
search: searchQuery,
|
||||
data: emojis,
|
||||
options: {
|
||||
keys: ['group', { name: 'name', weight: 3 }, 'keywords', 'unicode', 'codePoints', 'emoji'],
|
||||
threshold: 0.3,
|
||||
useExtendedSearch: true,
|
||||
isCaseSensitive: false,
|
||||
keys: ['group', { name: 'name', weight: 3 }, 'keywords', 'unicode', 'codePoints', 'allCodePoints', 'emoji'],
|
||||
filterEmpty: false,
|
||||
},
|
||||
limit: limit.value,
|
||||
limit,
|
||||
});
|
||||
|
||||
// Computed property for filtered results
|
||||
const displayedSearchResults = computed(() => {
|
||||
return searchResult.value.slice(0, limit.value);
|
||||
});
|
||||
|
||||
// Computed property for visible emoji groups
|
||||
const visibleEmojisGroups = computed(() => {
|
||||
return emojisGroups.slice(0, visibleGroupsCount.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 groups every 150ms
|
||||
loadingInterval = setInterval(() => {
|
||||
if (visibleGroupsCount.value < emojisGroups.length) {
|
||||
visibleGroupsCount.value++;
|
||||
}
|
||||
else {
|
||||
// Stop loading when all groups are visible
|
||||
stopAutomatedLoading();
|
||||
}
|
||||
}, 150);
|
||||
}
|
||||
|
||||
// Watch for search query changes
|
||||
watch(searchQuery, (newQuery, oldQuery) => {
|
||||
if (newQuery.trim()) {
|
||||
// Stop automated loading when searching
|
||||
stopAutomatedLoading();
|
||||
}
|
||||
else if (oldQuery && oldQuery.trim()) {
|
||||
// Reset and start automated loading when switching from search to browse
|
||||
visibleGroupsCount.value = 1;
|
||||
nextTick(() => {
|
||||
startAutomatedLoading();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Start automated loading on component mount (when not searching)
|
||||
onMounted(() => {
|
||||
if (!searchQuery.value.trim()) {
|
||||
startAutomatedLoading();
|
||||
}
|
||||
});
|
||||
|
||||
// Clean up on component unmount
|
||||
onUnmounted(() => {
|
||||
stopAutomatedLoading();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div mx-auto max-w-2400px important:flex-1>
|
||||
<div mx-auto max-w-600px flex justify-center gap-3>
|
||||
<div mx-auto mb-4 max-w-600px flex justify-center gap-3>
|
||||
<c-input-text
|
||||
v-model:value="searchQuery"
|
||||
placeholder="Search emojis (e.g. 'smile')..."
|
||||
v-model:value="rawSearchQuery"
|
||||
placeholder="Search emojis (e.g. 'smile') or paste an emoji (e.g. '😄')"
|
||||
class="flex-1"
|
||||
>
|
||||
<template #prefix>
|
||||
<icon-mdi-search mr-6px color-black op-70 dark:color-white />
|
||||
</template>
|
||||
</c-input-text>
|
||||
<n-form-item label="Max results:" label-placement="left">
|
||||
<n-input-number v-model:value="limit" :min="1" />
|
||||
<n-input-number v-model:value="limit" :min="10" :max="500" :step="10" style="width: 100px" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
|
||||
<!-- Search Results -->
|
||||
<div v-if="searchQuery.trim().length > 0">
|
||||
<div
|
||||
v-if="searchResult.length === 0"
|
||||
mt-4
|
||||
text-20px
|
||||
font-bold
|
||||
>
|
||||
No results
|
||||
<div v-if="displayedSearchResults.length === 0" mt-4 text-center text-20px font-bold op-70>
|
||||
<div>No results found</div>
|
||||
<div mt-2 text-14px font-normal>
|
||||
Try searching for something else like "smile", "flag", or "😄"
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<div mt-4 text-20px font-bold>
|
||||
Search result
|
||||
<div mb-3 mt-4 flex items-center gap-2 text-20px font-bold>
|
||||
<span>Search Results</span>
|
||||
<span text-14px font-normal op-70>({{ displayedSearchResults.length }} found)</span>
|
||||
</div>
|
||||
|
||||
<emoji-grid :emoji-infos="searchResult" />
|
||||
<emoji-grid :emoji-infos="displayedSearchResults" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-for="{ group, emojiInfos } in emojisGroups"
|
||||
v-else
|
||||
:key="group"
|
||||
>
|
||||
<div mt-4 text-20px font-bold>
|
||||
{{ group }}
|
||||
<!-- All Emojis by Groups (Auto-loaded) -->
|
||||
<div v-else>
|
||||
<div v-for="{ group, emojiInfos } in visibleEmojisGroups" :key="group" mb-6>
|
||||
<div mb-3 mt-4 flex items-center gap-2 text-20px font-bold>
|
||||
<span>{{ group }}</span>
|
||||
<span text-14px font-normal op-70>({{ emojiInfos.length }})</span>
|
||||
</div>
|
||||
|
||||
<emoji-grid :emoji-infos="emojiInfos" />
|
||||
</div>
|
||||
|
||||
<emoji-grid :emoji-infos="emojiInfos" />
|
||||
<!-- Loading indicator when more groups are coming -->
|
||||
<div v-if="visibleGroupsCount < emojisGroups.length" mt-6 text-center>
|
||||
<div text-14px op-70>
|
||||
Loading more groups... ({{ visibleGroupsCount }}/{{ emojisGroups.length }})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,48 @@
|
||||
export function getAllCodePoints(emoji: string): string {
|
||||
const codePoints: string[] = [];
|
||||
for (const char of emoji) {
|
||||
const codePoint = char.codePointAt(0);
|
||||
if (codePoint) {
|
||||
codePoints.push(`U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`);
|
||||
}
|
||||
}
|
||||
return codePoints.join(' ');
|
||||
}
|
||||
|
||||
export function escapeUnicodeComplete(emoji: string): string {
|
||||
return Array.from(emoji)
|
||||
.map((char) => {
|
||||
const codePoint = char.codePointAt(0);
|
||||
return codePoint ? `\\u${codePoint.toString(16).padStart(4, '0')}` : '';
|
||||
})
|
||||
.join('');
|
||||
}
|
||||
|
||||
export function isEmojiSupported(emoji: string): boolean {
|
||||
if (typeof document === 'undefined') {
|
||||
return true;
|
||||
} // SSR fallback
|
||||
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (!ctx) {
|
||||
return true;
|
||||
}
|
||||
|
||||
canvas.width = 32;
|
||||
canvas.height = 32;
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.font = '24px "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji"';
|
||||
|
||||
const beforeImageData = ctx.getImageData(0, 0, 32, 32).data;
|
||||
ctx.fillText(emoji, 0, 0);
|
||||
const afterImageData = ctx.getImageData(0, 0, 32, 32).data;
|
||||
|
||||
// Check if any pixels changed
|
||||
for (let i = 0; i < beforeImageData.length; i++) {
|
||||
if (beforeImageData[i] !== afterImageData[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import type emojiUnicodeData from 'unicode-emoji-json';
|
||||
|
||||
export type EmojiInfo = {
|
||||
title: string
|
||||
export interface EmojiInfo {
|
||||
emoji: string
|
||||
codePoints: string | undefined
|
||||
name: string
|
||||
title: string
|
||||
group: string
|
||||
keywords?: string[]
|
||||
codePoints?: string
|
||||
unicode: string
|
||||
} & typeof emojiUnicodeData[string];
|
||||
allCodePoints?: string
|
||||
}
|
||||
@@ -1,85 +1,657 @@
|
||||
<script setup lang="ts">
|
||||
import { FortuneWheel } from 'vue3-fortune-wheel';
|
||||
import type { Data, ImgParams } from 'vue3-fortune-wheel';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
import { computedRefreshable } from '@/composable/computedRefreshable';
|
||||
|
||||
const base = import.meta.env.BASE_URL;
|
||||
// Centralized wheel configuration - edit these values to change wheel size
|
||||
const WHEEL_CONFIG = {
|
||||
size: 550, // Overall wheel size
|
||||
outerRadius: 275, // Outer edge of segments
|
||||
innerRadius: 95, // Inner edge of segments (center hole)
|
||||
textRadius: 185, // Where text is positioned
|
||||
centerSize: 190, // Size of center circle
|
||||
mobileSize: 250, // Wheel size on mobile
|
||||
} as const;
|
||||
|
||||
const choices = useQueryParamOrStorage({ name: 'choices', storageName: 'fortune-wheel:chs', defaultValue: '' });
|
||||
const spinDuration = useQueryParamOrStorage({ name: 'duration', storageName: 'fortune-wheel:dur', defaultValue: 5 });
|
||||
const WHEEL_CENTER = WHEEL_CONFIG.size / 2;
|
||||
|
||||
const colors = [
|
||||
{ bgColor: '#FF5733', color: '#FFFFFF' },
|
||||
{ bgColor: '#2E86C1', color: '#FFFFFF' },
|
||||
{ bgColor: '#28B463', color: '#FFFFFF' },
|
||||
{ bgColor: '#F1C40F', color: '#000000' },
|
||||
{ bgColor: '#8E44AD', color: '#FFFFFF' },
|
||||
{ bgColor: '#E74C3C', color: '#FFFFFF' },
|
||||
{ bgColor: '#1ABC9C', color: '#000000' },
|
||||
{ bgColor: '#34495E', color: '#FFFFFF' },
|
||||
{ bgColor: '#D35400', color: '#FFFFFF' },
|
||||
{ bgColor: '#2C3E50', color: '#FFFFFF' },
|
||||
];
|
||||
|
||||
const wheel = ref<InstanceType<typeof FortuneWheel> | null>(null);
|
||||
const data = computed(() => {
|
||||
return (choices.value || '').split('\n')
|
||||
.filter(s => s && s !== '')
|
||||
.map((choice, index) => ({ id: index + 1, value: choice, ...colors[index % colors.length] }));
|
||||
});
|
||||
|
||||
const logo: ImgParams = {
|
||||
src: `${base}logo.png`,
|
||||
width: 100,
|
||||
height: 100,
|
||||
};
|
||||
|
||||
const [randomGift, refreshGift] = computedRefreshable(() => {
|
||||
return Math.floor(Math.random() * data.value.length) + 1;
|
||||
});
|
||||
|
||||
const result = ref<Data>();
|
||||
function done(wheelResult: Data) {
|
||||
result.value = wheelResult;
|
||||
interface WheelOption {
|
||||
id: string
|
||||
text: string
|
||||
color: string
|
||||
bgColor: string
|
||||
}
|
||||
|
||||
function restart() {
|
||||
refreshGift();
|
||||
wheel.value?.spin();
|
||||
// Generate random offset once on initialization to vary starting colors
|
||||
const colorOffset = Math.random() * 360;
|
||||
|
||||
function generateUniqueColor(index: number) {
|
||||
// Use HSL for better color distribution with random offset
|
||||
const hue = (index * 137.508 + colorOffset) % 360; // Golden angle + random offset
|
||||
const saturation = 65 + (index % 3) * 10; // Vary saturation slightly
|
||||
const lightness = 45 + (index % 4) * 8; // Vary lightness for distinction
|
||||
|
||||
const bgColor = `hsl(${hue}, ${saturation}%, ${lightness}%)`;
|
||||
|
||||
// Calculate if we need white or black text based on luminance
|
||||
const color = getContrastColor(hue, saturation, lightness);
|
||||
|
||||
return { bgColor, color };
|
||||
}
|
||||
|
||||
function getContrastColor(hue: number, saturation: number, lightness: number): string {
|
||||
// Convert HSL to RGB to calculate luminance
|
||||
const h = hue / 360;
|
||||
const s = saturation / 100;
|
||||
const l = lightness / 100;
|
||||
|
||||
const c = (1 - Math.abs(2 * l - 1)) * s;
|
||||
const x = c * (1 - Math.abs((h * 6) % 2 - 1));
|
||||
const m = l - c / 2;
|
||||
|
||||
// Compact RGB calculation using array indexing
|
||||
const hueSegment = Math.floor(h * 6);
|
||||
const rgbValues = [
|
||||
[c, x, 0], // 0-60°
|
||||
[x, c, 0], // 60-120°
|
||||
[0, c, x], // 120-180°
|
||||
[0, x, c], // 180-240°
|
||||
[x, 0, c], // 240-300°
|
||||
[c, 0, x], // 300-360°
|
||||
];
|
||||
|
||||
const [r, g, b] = rgbValues[hueSegment].map(val => (val + m) * 255);
|
||||
|
||||
// Calculate relative luminance and return appropriate contrast color
|
||||
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
||||
return luminance < 0.6 ? '#ffffff' : '#000000';
|
||||
}
|
||||
|
||||
const spinDuration = useQueryParamOrStorage({
|
||||
name: 'duration',
|
||||
storageName: 'fortune-wheel:dur',
|
||||
defaultValue: 3,
|
||||
});
|
||||
|
||||
const savedOptions = useQueryParamOrStorage({
|
||||
name: 'options',
|
||||
storageName: 'fortune-wheel:options',
|
||||
defaultValue: '[]',
|
||||
});
|
||||
|
||||
const wheelOptions = ref<WheelOption[]>([]);
|
||||
const newOptionText = ref('');
|
||||
const isSpinning = ref(false);
|
||||
const wheelRotation = ref(0);
|
||||
const result = ref<WheelOption | null>(null);
|
||||
const lastResultIndex = ref<number | null>(null); // Track last result
|
||||
|
||||
// Load saved options
|
||||
watchEffect(() => {
|
||||
try {
|
||||
const parsed = JSON.parse(savedOptions.value);
|
||||
wheelOptions.value = parsed.map((text: string, index: number) => ({
|
||||
id: `option-${index}`,
|
||||
text,
|
||||
...generateUniqueColor(index),
|
||||
}));
|
||||
}
|
||||
catch {
|
||||
wheelOptions.value = [];
|
||||
}
|
||||
});
|
||||
|
||||
// Save options when changed
|
||||
watchEffect(() => {
|
||||
savedOptions.value = JSON.stringify(wheelOptions.value.map(opt => opt.text));
|
||||
});
|
||||
|
||||
const segmentAngle = computed(() =>
|
||||
wheelOptions.value.length > 0 ? 360 / wheelOptions.value.length : 0,
|
||||
);
|
||||
|
||||
function addOption() {
|
||||
if (!newOptionText.value.trim()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newOption: WheelOption = {
|
||||
id: `option-${Date.now()}`,
|
||||
text: newOptionText.value.trim(),
|
||||
...generateUniqueColor(wheelOptions.value.length),
|
||||
};
|
||||
|
||||
wheelOptions.value.push(newOption);
|
||||
newOptionText.value = '';
|
||||
}
|
||||
|
||||
function removeOption(id: string) {
|
||||
const index = wheelOptions.value.findIndex(opt => opt.id === id);
|
||||
if (index > -1) {
|
||||
wheelOptions.value.splice(index, 1);
|
||||
// Reassign colors after removal
|
||||
wheelOptions.value.forEach((opt, i) => {
|
||||
Object.assign(opt, generateUniqueColor(i));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function removeAllOptions() {
|
||||
wheelOptions.value = [];
|
||||
}
|
||||
|
||||
function moveOption(fromIndex: number, toIndex: number) {
|
||||
if (toIndex < 0 || toIndex >= wheelOptions.value.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const item = wheelOptions.value.splice(fromIndex, 1)[0];
|
||||
wheelOptions.value.splice(toIndex, 0, item);
|
||||
|
||||
// Reassign colors after reordering
|
||||
wheelOptions.value.forEach((opt, i) => {
|
||||
Object.assign(opt, generateUniqueColor(i));
|
||||
});
|
||||
}
|
||||
|
||||
function spinWheel() {
|
||||
if (isSpinning.value || wheelOptions.value.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
isSpinning.value = true;
|
||||
result.value = null;
|
||||
|
||||
// Calculate rotations based on duration to maintain consistent speed
|
||||
const baseRotationsPerSecond = 3;
|
||||
const calculatedRotations = Math.max(3, Math.floor(spinDuration.value * baseRotationsPerSecond));
|
||||
const extraRotations = Math.floor(Math.random() * 4);
|
||||
const fullRotations = calculatedRotations + extraRotations;
|
||||
|
||||
// Improved randomness: weighted selection to avoid recent results
|
||||
let targetSegment: number;
|
||||
|
||||
if (wheelOptions.value.length > 1) {
|
||||
// Create weights array - all segments start with equal weight
|
||||
const weights = Array.from({ length: wheelOptions.value.length }).fill(1) as number[];
|
||||
|
||||
// Reduce weights for recently selected segments
|
||||
const recentResults = JSON.parse(localStorage.getItem('fortune-wheel:recent-results') || '[]');
|
||||
|
||||
// Apply penalties to recent results (stronger penalty for more recent)
|
||||
recentResults.forEach((recentIndex: number, arrayIndex: number) => {
|
||||
if (recentIndex >= 0 && recentIndex < weights.length) {
|
||||
// More recent results get heavier penalties
|
||||
const penalty = arrayIndex === 0 ? 0.1 : (arrayIndex === 1 ? 0.3 : 0.6);
|
||||
weights[recentIndex] *= penalty;
|
||||
}
|
||||
});
|
||||
|
||||
// Weighted random selection
|
||||
const totalWeight = weights.reduce((sum, weight) => sum + weight, 0);
|
||||
let random = Math.random() * totalWeight;
|
||||
|
||||
targetSegment = 0;
|
||||
for (let i = 0; i < weights.length; i++) {
|
||||
random -= weights[i];
|
||||
if (random <= 0) {
|
||||
targetSegment = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Update recent results history (keep last 3)
|
||||
const updatedRecent = [targetSegment, ...recentResults.slice(0, 2)];
|
||||
localStorage.setItem('fortune-wheel:recent-results', JSON.stringify(updatedRecent));
|
||||
}
|
||||
else {
|
||||
targetSegment = 0;
|
||||
}
|
||||
|
||||
// Add randomness within the target segment (not always center)
|
||||
const segmentStart = targetSegment * segmentAngle.value;
|
||||
const randomWithinSegment = segmentStart + Math.random() * segmentAngle.value;
|
||||
|
||||
// Calculate final rotation to land in the target segment
|
||||
const targetAngle = 360 - randomWithinSegment;
|
||||
const finalRotation = wheelRotation.value + fullRotations * 360 + targetAngle;
|
||||
|
||||
wheelRotation.value = finalRotation;
|
||||
|
||||
setTimeout(() => {
|
||||
isSpinning.value = false;
|
||||
|
||||
// Calculate which segment the pointer is actually pointing to
|
||||
const normalizedRotation = finalRotation % 360;
|
||||
const pointerAngle = (360 - normalizedRotation) % 360;
|
||||
const segmentIndex = Math.floor(pointerAngle / segmentAngle.value) % wheelOptions.value.length;
|
||||
|
||||
result.value = wheelOptions.value[segmentIndex];
|
||||
lastResultIndex.value = segmentIndex; // Keep for compatibility
|
||||
}, spinDuration.value * 1000);
|
||||
}
|
||||
|
||||
function getSegmentPath(index: number) {
|
||||
const angle = segmentAngle.value;
|
||||
const outerRadius = WHEEL_CONFIG.outerRadius;
|
||||
const innerRadius = WHEEL_CONFIG.innerRadius;
|
||||
const centerX = WHEEL_CENTER;
|
||||
const centerY = WHEEL_CENTER;
|
||||
|
||||
// Special case for single option (360 degree segment)
|
||||
if (wheelOptions.value.length === 1) {
|
||||
// Create a donut shape using two circles
|
||||
return `M ${centerX - outerRadius} ${centerY}
|
||||
A ${outerRadius} ${outerRadius} 0 1 1 ${centerX + outerRadius} ${centerY}
|
||||
A ${outerRadius} ${outerRadius} 0 1 1 ${centerX - outerRadius} ${centerY} Z
|
||||
M ${centerX - innerRadius} ${centerY}
|
||||
A ${innerRadius} ${innerRadius} 0 1 0 ${centerX + innerRadius} ${centerY}
|
||||
A ${innerRadius} ${innerRadius} 0 1 0 ${centerX - innerRadius} ${centerY} Z`;
|
||||
}
|
||||
const startAngle = (index * angle - 90) * Math.PI / 180;
|
||||
const endAngle = ((index + 1) * angle - 90) * Math.PI / 180;
|
||||
|
||||
const x1 = centerX + outerRadius * Math.cos(startAngle);
|
||||
const y1 = centerY + outerRadius * Math.sin(startAngle);
|
||||
const x2 = centerX + outerRadius * Math.cos(endAngle);
|
||||
const y2 = centerY + outerRadius * Math.sin(endAngle);
|
||||
|
||||
const x3 = centerX + innerRadius * Math.cos(endAngle);
|
||||
const y3 = centerY + innerRadius * Math.sin(endAngle);
|
||||
const x4 = centerX + innerRadius * Math.cos(startAngle);
|
||||
const y4 = centerY + innerRadius * Math.sin(startAngle);
|
||||
|
||||
const largeArcFlag = angle > 180 ? 1 : 0;
|
||||
|
||||
return `M ${x4} ${y4} L ${x1} ${y1} A ${outerRadius} ${outerRadius} 0 ${largeArcFlag} 1 ${x2} ${y2} L ${x3} ${y3} A ${innerRadius} ${innerRadius} 0 ${largeArcFlag} 0 ${x4} ${y4} Z`;
|
||||
}
|
||||
|
||||
function getTextPosition(index: number) {
|
||||
const angle = segmentAngle.value;
|
||||
const radius = WHEEL_CONFIG.textRadius;
|
||||
const centerX = WHEEL_CENTER;
|
||||
const centerY = WHEEL_CENTER;
|
||||
|
||||
const textAngle = (index * angle + angle / 2 - 90) * Math.PI / 180;
|
||||
// Round coordinates to whole numbers for sharp text rendering
|
||||
const x = Math.round(centerX + radius * Math.cos(textAngle));
|
||||
const y = Math.round(centerY + radius * Math.sin(textAngle));
|
||||
|
||||
return { x, y, rotation: index * angle + angle / 2 + 90 };
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<n-form-item label="Spin Duration (seconds):" label-placement="left">
|
||||
<n-input-number v-model:value="spinDuration" :min="1" />
|
||||
</n-form-item>
|
||||
<div class="fortune-wheel-container">
|
||||
<!-- Controls -->
|
||||
<div class="wheel-controls">
|
||||
<n-form-item label="Spin Duration (seconds):" label-placement="left" my--5>
|
||||
<n-input-number v-model:value="spinDuration" :min="0" :max="10" />
|
||||
</n-form-item>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="choices"
|
||||
label="Wheel choices (one per line):"
|
||||
placeholder="Wheel choices (one per line)"
|
||||
multiline
|
||||
rows="5"
|
||||
/>
|
||||
<n-divider />
|
||||
|
||||
<!-- Add new option -->
|
||||
<div class="add-option-section">
|
||||
<h3>Add New Option</h3>
|
||||
<div class="add-option-form">
|
||||
<c-input-text
|
||||
v-model:value="newOptionText"
|
||||
placeholder="Enter wheel option"
|
||||
@keyup.enter="addOption"
|
||||
/>
|
||||
<c-button :disabled="!newOptionText.trim()" @click="addOption">
|
||||
Add Option
|
||||
</c-button>
|
||||
<c-button class="clear-all-button" @click="removeAllOptions">
|
||||
Clear All Options
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Options list -->
|
||||
<div class="options-section">
|
||||
<h3>Wheel Options ({{ wheelOptions.length }})</h3>
|
||||
<div v-if="wheelOptions.length === 0" class="empty-state">
|
||||
No options added yet. Add some options to start spinning!
|
||||
</div>
|
||||
<div v-else class="options-list">
|
||||
<div
|
||||
v-for="(option, index) in wheelOptions"
|
||||
:key="option.id"
|
||||
class="option-item"
|
||||
:style="{ borderLeftColor: option.bgColor }"
|
||||
>
|
||||
<div class="option-content">
|
||||
<span class="option-text">{{ option.text }}</span>
|
||||
<div class="option-actions">
|
||||
<c-button
|
||||
size="small"
|
||||
:disabled="index === 0"
|
||||
title="Move up"
|
||||
@click="moveOption(index, index - 1)"
|
||||
>
|
||||
↑
|
||||
</c-button>
|
||||
<c-button
|
||||
size="small"
|
||||
:disabled="index === wheelOptions.length - 1"
|
||||
title="Move down"
|
||||
@click="moveOption(index, index + 1)"
|
||||
>
|
||||
↓
|
||||
</c-button>
|
||||
<c-button
|
||||
size="small"
|
||||
title="Remove"
|
||||
@click="removeOption(option.id)"
|
||||
>
|
||||
✕
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<FortuneWheel
|
||||
ref="wheel"
|
||||
v-model="randomGift"
|
||||
middle-circle
|
||||
:img-params="logo"
|
||||
:anim-duration="spinDuration * 1000"
|
||||
:data="data"
|
||||
@done="done"
|
||||
/>
|
||||
<!-- Wheel -->
|
||||
<div class="wheel-section">
|
||||
<div class="wheel-container">
|
||||
<svg
|
||||
class="wheel"
|
||||
:class="{ spinning: isSpinning }"
|
||||
:style="{
|
||||
transform: `rotate(${wheelRotation}deg)`,
|
||||
transitionDuration: isSpinning ? `${spinDuration}s` : '0s',
|
||||
}"
|
||||
:width="WHEEL_CONFIG.size"
|
||||
:height="WHEEL_CONFIG.size"
|
||||
:viewBox="`0 0 ${WHEEL_CONFIG.size} ${WHEEL_CONFIG.size}`"
|
||||
>
|
||||
<g>
|
||||
<path
|
||||
v-for="(option, index) in wheelOptions"
|
||||
:key="option.id"
|
||||
:d="getSegmentPath(index)"
|
||||
:fill="option.bgColor"
|
||||
stroke="rgba(255,255,255,0.3)"
|
||||
stroke-width="2"
|
||||
/>
|
||||
|
||||
<div flex justify-center>
|
||||
<c-button @click="restart()">
|
||||
Spin!
|
||||
</c-button>
|
||||
<text
|
||||
v-for="(option, index) in wheelOptions"
|
||||
:key="`text-${option.id}`"
|
||||
:x="getTextPosition(index).x"
|
||||
:y="getTextPosition(index).y"
|
||||
:fill="option.color"
|
||||
:transform="`rotate(${getTextPosition(index).rotation}, ${getTextPosition(index).x}, ${getTextPosition(index).y})`"
|
||||
text-anchor="middle"
|
||||
dominant-baseline="middle"
|
||||
class="segment-text"
|
||||
>
|
||||
{{ option.text.length > 20 ? `${option.text.slice(0, 20)}...` : option.text }}
|
||||
</text>
|
||||
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<!-- Center circle with result display -->
|
||||
<div
|
||||
class="wheel-center"
|
||||
:style="{ backgroundColor: result?.bgColor }"
|
||||
>
|
||||
<div v-if="result" class="center-result">
|
||||
<div
|
||||
class="result-text"
|
||||
:style="{
|
||||
color: result?.color || '#ffffff',
|
||||
}"
|
||||
>
|
||||
{{ result.text }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="center-placeholder">
|
||||
<div class="placeholder-text">
|
||||
{{ isSpinning ? 'Spinning...' : 'Spin to Win!' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wheel-pointer" />
|
||||
</div>
|
||||
|
||||
<div class="spin-controls">
|
||||
<c-button
|
||||
:disabled="isSpinning || wheelOptions.length === 0"
|
||||
size="large"
|
||||
@click="spinWheel"
|
||||
>
|
||||
{{ isSpinning ? 'Spinning...' : 'Spin the Wheel!' }}
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.fortune-wheel-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.wheel-controls {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.add-option-section h3,
|
||||
.options-section h3 {
|
||||
margin: 16px 0 8px 0;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.add-option-form {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: end;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.add-option-form .c-input-text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.options-list {
|
||||
max-height: 120px;
|
||||
overflow-y: auto;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, 280px);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
color: var(--text-color-secondary);
|
||||
padding: 40px 20px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.option-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 6px 12px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
border-left: 4px solid;
|
||||
border-right: 1px solid var(--border-color);
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.option-item:hover {
|
||||
background-color: var(--hover-color);
|
||||
}
|
||||
|
||||
.option-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.option-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.option-text {
|
||||
flex: 1;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 180px;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.option-actions {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.option-actions .c-button {
|
||||
padding: 2px 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.wheel-section {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wheel-container {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin: 20px;
|
||||
/* Force pixel-aligned positioning */
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
.wheel {
|
||||
width: v-bind('`${WHEEL_CONFIG.size}px`');
|
||||
height: v-bind('`${WHEEL_CONFIG.size}px`');
|
||||
border-radius: 50%;
|
||||
border: 4px solid #333;
|
||||
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
|
||||
/* Additional sharpness improvements */
|
||||
transform-style: flat;
|
||||
backface-visibility: hidden;
|
||||
/* Ensure the SVG is positioned on pixel boundaries */
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
.wheel.spinning {
|
||||
transition-property: transform;
|
||||
}
|
||||
|
||||
.segment-text {
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
pointer-events: none;
|
||||
text-rendering: geometricPrecision;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
/* Force crisp edges */
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.wheel-center {
|
||||
position: absolute;
|
||||
top: 49.5%;
|
||||
left: 50%;
|
||||
width: v-bind('`${WHEEL_CONFIG.centerSize}px`');
|
||||
height: v-bind('`${WHEEL_CONFIG.centerSize}px`');
|
||||
border-radius: 50%;
|
||||
background: #414141;
|
||||
border: 4px solid #333;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.wheel-pointer {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 15px solid transparent;
|
||||
border-right: 15px solid transparent;
|
||||
border-top: 30px solid #333;
|
||||
transform: translateX(-50%);
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.spin-controls {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.center-result {
|
||||
text-align: center;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.result-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.result-text {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: 1.2;
|
||||
word-wrap: break-word;
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
.center-placeholder {
|
||||
text-align: center;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.placeholder-text {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #666;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.clear-all-button {
|
||||
background-color: #b31a29 !important;
|
||||
color: white !important;
|
||||
border-color: #b31a29 !important;
|
||||
}
|
||||
|
||||
.clear-all-button:hover {
|
||||
background-color: #c82333 !important;
|
||||
border-color: #bd2130 !important;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.add-option-form {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.wheel {
|
||||
width: v-bind('`${WHEEL_CONFIG.mobileSize}px`');
|
||||
height: v-bind('`${WHEEL_CONFIG.mobileSize}px`');
|
||||
}
|
||||
|
||||
.segment-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,7 +4,7 @@ import { defineTool } from '../tool';
|
||||
export const tool = defineTool({
|
||||
name: 'Fortune wheel',
|
||||
path: '/fortune-wheel',
|
||||
description: '',
|
||||
description: 'A configurable fortune wheel',
|
||||
keywords: ['fortune', 'wheel'],
|
||||
component: () => import('./fortune-wheel.vue'),
|
||||
icon: ArrowsShuffle,
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { generateHtpasswd } from './htpasswd-generator.service';
|
||||
|
||||
describe('htpasswd-generator', () => {
|
||||
it('generate correct entries', () => {
|
||||
const commonValues = { username: 'a', password: 'a' };
|
||||
|
||||
expect(generateHtpasswd({ ...commonValues, saltRounds: 10, algorithm: 'bcrypt' })).toContain('a:$2a$10$');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'k9azwE5H', algorithm: 'apr1' })).toBe('a:$apr1$k9azwE5H$zIyj4gqCWXiwB2Iof6jHf1');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'xs4x6VWJ', algorithm: 'md5' })).toBe('a:$1$xs4x6VWJ$lOH0fBF6QyWdTOEeqcFnP/');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'grEPbuEp', algorithm: 'sha256' })).toBe('a:$5$grEPbuEp$DUmEMT5C4TRgZCs9ZFKOJZ/IgR5FJIOUH0dasQFPw57');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'ud.q0DEx', algorithm: 'sha512' })).toBe('a:$6$ud.q0DEx$qEMZW6k/1q3ABm4af1WrFdUj1Mc2vCFxnVNHy/pDyk1L8JjoNwzRABgAHnpRON/xrdD/f9Neo6HNIU1z1LQk9.');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'Uk8SVGLsBuSmD75R', algorithm: 'sha512' })).toBe('a:$6$Uk8SVGLsBuSmD75R$GKnMHXxioi7K97EOtIypnjBLQQVLRyMzF1FTjNhvULyuEDOWdYngkgNTxxAdYchQ9Q0BRC3gka/NSA5RoOFzY.');
|
||||
});
|
||||
|
||||
it('generate correct entries (unicode)', () => {
|
||||
const commonValues = { username: 'a', password: 'àùé' };
|
||||
|
||||
expect(generateHtpasswd({ ...commonValues, saltRounds: 10, algorithm: 'bcrypt' })).toContain('a:$2a$10$');
|
||||
expect(() => generateHtpasswd({ ...commonValues, salt: 'mL016JCr', algorithm: 'apr1' })).toThrow();
|
||||
expect(() => generateHtpasswd({ ...commonValues, salt: 'YshCU1p1', algorithm: 'md5' })).toThrow();
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'Rojf48Kp', algorithm: 'sha256' })).toBe('a:$5$Rojf48Kp$/dY3S.yDqW2ZH/YKrF85q6JszyP.bhIF/Qu31Q49Oa5');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: '1BPDHHko', algorithm: 'sha512' })).toBe('a:$6$1BPDHHko$jKZNRvgloMD2eAyyPRZt59hOifLwCK0FCSNr35eVgQd0tK0LJQWIp1IsmomVjHWUjiSWjSiP9AGO.G8FbkV3a.');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'Uk8SVGLsBuSmD75R', algorithm: 'sha512' })).toBe('a:$6$Uk8SVGLsBuSmD75R$j7tejonAnUpOkwVTzTwQnfmq14SDJsGaFvW67m2pLCeaCjy.IT0aniZaRFnx3Azh9x5Lui60F76F9K6mZRbma.');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
import { hashSync } from 'bcryptjs';
|
||||
import { encrypt } from 'unixcrypt-browser';
|
||||
import md5 from 'apache-md5';
|
||||
import { multiRandFromArray } from '@/utils/random';
|
||||
|
||||
const itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
export function generateHtpasswd({
|
||||
username,
|
||||
password,
|
||||
algorithm,
|
||||
salt = null,
|
||||
saltRounds = 10,
|
||||
}: {
|
||||
username: string
|
||||
password: string
|
||||
algorithm: 'bcrypt' | 'md5' | 'apr1' | 'sha256' | 'sha512'
|
||||
salt?: string | null
|
||||
saltRounds?: number
|
||||
}): string {
|
||||
const generateSalt = (length: number) => multiRandFromArray([...itoa64], length).join('');
|
||||
let hash: string;
|
||||
const finalSalt = salt || generateSalt(algorithm === 'sha512' ? 16 : 8);
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const non_ascii = /[^\x00-\x7F]/;
|
||||
|
||||
switch (algorithm) {
|
||||
case 'bcrypt':
|
||||
hash = hashSync(password, saltRounds);
|
||||
break;
|
||||
case 'md5':
|
||||
|
||||
if (non_ascii.test(password)) {
|
||||
throw new Error('MD5 does not currently support non ASCII characters');
|
||||
}
|
||||
hash = md5(password, `$1$${finalSalt}`);
|
||||
break;
|
||||
case 'apr1':
|
||||
|
||||
if (non_ascii.test(password)) {
|
||||
throw new Error('MD5 does not currently support non ASCII characters');
|
||||
}
|
||||
hash = md5(password, `$apr1$${finalSalt}`);
|
||||
break;
|
||||
case 'sha256':
|
||||
hash = encrypt(password, `$5$${finalSalt}`);
|
||||
break;
|
||||
case 'sha512':
|
||||
hash = encrypt(password, `$6$${finalSalt}`);
|
||||
break;
|
||||
default:
|
||||
throw new Error('Unsupported algorithm');
|
||||
}
|
||||
|
||||
return `${username}:${hash}`;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { hashSync } from 'bcryptjs';
|
||||
import md5 from 'apache-md5';
|
||||
import { generateHtpasswd } from './htpasswd-generator.service';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const username = ref('');
|
||||
@@ -8,18 +7,25 @@ const password = ref('');
|
||||
const hashMethod = ref('bcrypt');
|
||||
const saltCount = ref(10);
|
||||
|
||||
const algos = [
|
||||
{ value: 'bcrypt', label: 'Bcrypt' },
|
||||
{ value: 'md5', label: 'MD5' },
|
||||
{ value: 'apr1', label: 'Apache MD5 (apr1)' },
|
||||
{ value: 'sha256', label: 'SHA256' },
|
||||
{ value: 'sha512', label: 'SHA512' },
|
||||
];
|
||||
|
||||
const htpasswd = computed(() => {
|
||||
if (username.value === '' || password.value === '') {
|
||||
return '# username and password must not be empty';
|
||||
}
|
||||
let hash;
|
||||
if (hashMethod.value === 'md5') {
|
||||
hash = md5(password.value);
|
||||
}
|
||||
else {
|
||||
hash = hashSync(password.value, saltCount.value);
|
||||
}
|
||||
return `${username.value}:${hash}`;
|
||||
|
||||
return generateHtpasswd({
|
||||
username: username.value,
|
||||
password: password.value,
|
||||
saltRounds: saltCount.value,
|
||||
algorithm: hashMethod.value as never,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -44,10 +50,11 @@ const htpasswd = computed(() => {
|
||||
<c-select
|
||||
v-model:value="hashMethod"
|
||||
label="Hash method:"
|
||||
:options="['bcrypt', 'md5']"
|
||||
:options="algos"
|
||||
mb-2
|
||||
/>
|
||||
|
||||
<n-form-item v-if="hashMethod === 'bcrypt'" label="Salt count: " label-placement="left" label-width="120">
|
||||
<n-form-item v-if="hashMethod === 'bcrypt'" label="Salt rounds: " label-placement="left" label-width="120">
|
||||
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="100" :min="0" w-full />
|
||||
</n-form-item>
|
||||
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
IconCircleArrowUpRight,
|
||||
IconCircleCheck,
|
||||
IconDatabaseExclamation,
|
||||
IconDeviceDesktopExclamation,
|
||||
IconExternalLink,
|
||||
IconInfoCircle,
|
||||
IconSearch,
|
||||
} from '@tabler/icons-vue';
|
||||
import { codesByCategories } from './http-status-codes.constants';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const search = ref('');
|
||||
|
||||
const { searchResult } = useFuzzySearch({
|
||||
const { searchResult } = useFlexSearch({
|
||||
search,
|
||||
data: codesByCategories.flatMap(({ codes, category }) => codes.map(code => ({ ...code, category }))),
|
||||
options: {
|
||||
@@ -19,6 +28,32 @@ const codesByCategoryFiltered = computed(() => {
|
||||
|
||||
return [{ category: 'Search results', codes: searchResult.value }];
|
||||
});
|
||||
|
||||
function getCategoryIcon(category: string) {
|
||||
const categoryLower = category.toLowerCase();
|
||||
|
||||
if (categoryLower.includes('1xx')) {
|
||||
return IconInfoCircle;
|
||||
}
|
||||
if (categoryLower.includes('2xx')) {
|
||||
return IconCircleCheck;
|
||||
}
|
||||
if (categoryLower.includes('3xx')) {
|
||||
return IconCircleArrowUpRight;
|
||||
}
|
||||
if (categoryLower.includes('4xx')) {
|
||||
return IconDeviceDesktopExclamation;
|
||||
}
|
||||
if (categoryLower.includes('5xx')) {
|
||||
return IconDatabaseExclamation;
|
||||
}
|
||||
// Default icon for search results or unknown categories
|
||||
return IconSearch;
|
||||
}
|
||||
|
||||
function openMdnDocs(code: number) {
|
||||
window.open(`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${code}`, '_blank', 'noopener,noreferrer');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -30,13 +65,21 @@ const codesByCategoryFiltered = computed(() => {
|
||||
/>
|
||||
|
||||
<div v-for="{ codes, category } of codesByCategoryFiltered" :key="category" mb-8>
|
||||
<div mb-2 text-xl>
|
||||
<div mb-2 flex items-center gap-2 text-xl font-bold>
|
||||
<n-icon :component="getCategoryIcon(category)" size="26" />
|
||||
{{ category }}
|
||||
</div>
|
||||
|
||||
<c-card v-for="{ code, description, name, type } of codes" :key="code" mb-2>
|
||||
<div text-lg font-bold>
|
||||
<div flex items-center gap-2 text-lg font-bold>
|
||||
{{ code }} {{ name }}
|
||||
<div
|
||||
class="flex cursor-pointer items-center justify-center rounded text-gray-500 transition-colors hover:text-blue-600"
|
||||
title="View MDN documentation"
|
||||
@click="openMdnDocs(code)"
|
||||
>
|
||||
<n-icon :component="IconExternalLink" size="18" />
|
||||
</div>
|
||||
</div>
|
||||
<div op-70>
|
||||
{{ description }} {{ type !== 'HTTP' ? `For ${type}.` : '' }}
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import iesData from './ies-lighting-data.json';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const data = iesData.map(i => ({ ...i, all: `${i.industryType} - ${i.industryApplication}` }));
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const data = iesData;
|
||||
const searchQuery = useDebouncedRef('', 250);
|
||||
|
||||
const { searchResult } = useFuzzySearch({
|
||||
const { searchResult } = useFlexSearch({
|
||||
search: searchQuery,
|
||||
data,
|
||||
options: {
|
||||
keys: ['all'],
|
||||
threshold: 0.2,
|
||||
isCaseSensitive: false,
|
||||
minMatchCharLength: 3,
|
||||
useExtendedSearch: true,
|
||||
keys: ['industryType', 'industryApplication', 'footCandlesRange', 'recommendedLighting'],
|
||||
filterEmpty: false,
|
||||
},
|
||||
});
|
||||
@@ -25,7 +21,7 @@ const { searchResult } = useFuzzySearch({
|
||||
<div flex items-center gap-3>
|
||||
<c-input-text
|
||||
v-model:value="searchQuery"
|
||||
placeholder="Search IES recommandation by industry or application"
|
||||
placeholder="Search IES recommendation by industry or application"
|
||||
mx-auto max-w-600px
|
||||
>
|
||||
<template #prefix>
|
||||
@@ -64,16 +60,16 @@ const { searchResult } = useFuzzySearch({
|
||||
<tbody>
|
||||
<tr v-for="(result, ix) in searchResult" :key="ix">
|
||||
<td>
|
||||
<input-copyable :value="result.industryType" />
|
||||
<input-copyable :readonly="true" :value="result.industryType" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="result.industryApplication" />
|
||||
<input-copyable :readonly="true" :value="result.industryApplication" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="result.footCandlesRange" />
|
||||
<input-copyable :readonly="true" :value="result.footCandlesRange" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="result.recommendedLighting" />
|
||||
<input-copyable :readonly="true" :value="result.recommendedLighting" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,24 +1,259 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { IconLock, IconLockOpen2, IconReload } from '@tabler/icons-vue';
|
||||
|
||||
// State variables
|
||||
const imageFile = ref<File | null>(null);
|
||||
const imageUrl = ref<string | null>(null);
|
||||
const originalImageUrl = ref<string | null>(null); // To store original image data
|
||||
const imageWidth = ref(500); // Default width
|
||||
const imageHeight = ref(350); // Default height
|
||||
const imageWidth = ref(1920); // Default width
|
||||
const imageHeight = ref(1080); // Default height
|
||||
const originalImageWidth = ref<number | null>(null); // Store original image width
|
||||
const originalImageHeight = ref<number | null>(null); // Store original image height
|
||||
const resizedImageUrl = ref<string | null>(null);
|
||||
const aspectRatioLocked = ref(false);
|
||||
const aspectRatio = ref<number | null>(null);
|
||||
const isUpdatingDimensions = ref(false);
|
||||
const selectedAspectRatio = ref<string>('custom');
|
||||
const customAspectRatioWidth = ref<number>(16);
|
||||
const customAspectRatioHeight = ref<number>(9);
|
||||
const aspectRatioPriority = ref<'width' | 'height'>('width');
|
||||
|
||||
// Watch width to trigger resizing
|
||||
watch(imageWidth, () => {
|
||||
resizeImage();
|
||||
// Predefined aspect ratios
|
||||
const aspectRatioOptions = [
|
||||
{ label: 'Custom', value: 'custom' },
|
||||
{ label: 'Original', value: 'original' },
|
||||
{ label: '21:9 (Ultrawide)', value: '21:9' },
|
||||
{ label: '16:9 (Widescreen)', value: '16:9' },
|
||||
{ label: '4:3 (Standard)', value: '4:3' },
|
||||
{ label: '3:2 (Photography)', value: '3:2' },
|
||||
{ label: '1:1 (Square)', value: '1:1' },
|
||||
{ label: '3:4 (Portrait)', value: '3:4' },
|
||||
{ label: '9:16 (Portrait)', value: '9:16' },
|
||||
];
|
||||
|
||||
const MAX_CANVAS_DIMENSION = 32767; // Maximum pixels per side
|
||||
const MAX_CANVAS_AREA = 268435456; // Maximum total pixels (conservative estimate)
|
||||
|
||||
const isCanvasTooLarge = computed(() => {
|
||||
return imageWidth.value > MAX_CANVAS_DIMENSION
|
||||
|| imageHeight.value > MAX_CANVAS_DIMENSION
|
||||
|| (imageWidth.value * imageHeight.value) > MAX_CANVAS_AREA;
|
||||
});
|
||||
|
||||
const isPreviewTooLarge = computed(() => {
|
||||
return imageWidth.value > 7680 || imageHeight.value > 7680;
|
||||
});
|
||||
|
||||
// Computed property to check if dimensions are valid for download
|
||||
const canDownload = computed(() => {
|
||||
return (resizedImageUrl.value || (originalImageUrl.value && isPreviewTooLarge.value))
|
||||
&& imageFile.value
|
||||
&& imageWidth.value > 0
|
||||
&& imageHeight.value > 0
|
||||
&& !isCanvasTooLarge.value;
|
||||
});
|
||||
|
||||
// Computed property to check if reset is available
|
||||
const canReset = computed(() => {
|
||||
return originalImageWidth.value !== null && originalImageHeight.value !== null;
|
||||
});
|
||||
|
||||
// Helper function to calculate Greatest Common Divisor
|
||||
function gcd(a: number, b: number): number {
|
||||
return b === 0 ? a : gcd(b, a % b);
|
||||
}
|
||||
|
||||
// Computed property to display aspect ratio
|
||||
const displayedAspectRatio = computed(() => {
|
||||
if (!imageWidth.value || !imageHeight.value || imageWidth.value <= 0 || imageHeight.value <= 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const currentRatio = imageWidth.value / imageHeight.value;
|
||||
const tolerance = 0.01; // Allow 1% tolerance for matching standard ratios
|
||||
|
||||
// Standard aspect ratios to check against
|
||||
const standardRatios = [
|
||||
{ ratio: 21 / 9, display: '21:9' },
|
||||
{ ratio: 16 / 9, display: '16:9' },
|
||||
{ ratio: 4 / 3, display: '4:3' },
|
||||
{ ratio: 3 / 2, display: '3:2' },
|
||||
{ ratio: 1 / 1, display: '1:1' },
|
||||
{ ratio: 3 / 4, display: '3:4' },
|
||||
{ ratio: 2 / 3, display: '2:3' },
|
||||
{ ratio: 9 / 16, display: '9:16' },
|
||||
];
|
||||
|
||||
// Check if current ratio matches any standard ratio within tolerance
|
||||
for (const standard of standardRatios) {
|
||||
if (Math.abs(currentRatio - standard.ratio) <= tolerance) {
|
||||
return standard.display;
|
||||
}
|
||||
}
|
||||
|
||||
// If no standard ratio matches, calculate simplified ratio using GCD
|
||||
const width = Math.round(imageWidth.value);
|
||||
const height = Math.round(imageHeight.value);
|
||||
const divisor = gcd(width, height);
|
||||
const simplifiedWidth = width / divisor;
|
||||
const simplifiedHeight = height / divisor;
|
||||
|
||||
return `${simplifiedWidth}:${simplifiedHeight}`;
|
||||
});
|
||||
|
||||
// Function to get aspect ratio value from selection
|
||||
function getAspectRatioValue(ratioString: string): number | null {
|
||||
switch (ratioString) {
|
||||
case 'original':
|
||||
return originalImageWidth.value && originalImageHeight.value
|
||||
? originalImageWidth.value / originalImageHeight.value
|
||||
: null;
|
||||
case '16:9':
|
||||
return 16 / 9;
|
||||
case '4:3':
|
||||
return 4 / 3;
|
||||
case '1:1':
|
||||
return 1;
|
||||
case '3:2':
|
||||
return 3 / 2;
|
||||
case '21:9':
|
||||
return 21 / 9;
|
||||
case '9:16':
|
||||
return 9 / 16;
|
||||
case '3:4':
|
||||
return 3 / 4;
|
||||
case 'custom':
|
||||
return customAspectRatioWidth.value && customAspectRatioHeight.value
|
||||
? customAspectRatioWidth.value / customAspectRatioHeight.value
|
||||
: null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Watch for aspect ratio selection changes
|
||||
watch(selectedAspectRatio, (newRatio) => {
|
||||
const newAspectRatioValue = getAspectRatioValue(newRatio);
|
||||
if (newAspectRatioValue) {
|
||||
aspectRatio.value = newAspectRatioValue;
|
||||
if (!aspectRatioLocked.value) {
|
||||
aspectRatioLocked.value = true;
|
||||
}
|
||||
imageHeight.value = Math.round(imageWidth.value / newAspectRatioValue);
|
||||
}
|
||||
});
|
||||
|
||||
// Watch for custom aspect ratio changes
|
||||
watch([customAspectRatioWidth, customAspectRatioHeight], () => {
|
||||
if (selectedAspectRatio.value === 'custom' && aspectRatioLocked.value) {
|
||||
const newAspectRatioValue = getAspectRatioValue('custom');
|
||||
if (newAspectRatioValue) {
|
||||
aspectRatio.value = newAspectRatioValue;
|
||||
imageHeight.value = Math.round(imageWidth.value / newAspectRatioValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function toggleAspectRatioLock() {
|
||||
aspectRatioLocked.value = !aspectRatioLocked.value;
|
||||
|
||||
if (aspectRatioLocked.value) {
|
||||
if (selectedAspectRatio.value !== 'custom') {
|
||||
aspectRatio.value = getAspectRatioValue(selectedAspectRatio.value);
|
||||
}
|
||||
else if (imageWidth.value && imageHeight.value && imageWidth.value > 0 && imageHeight.value > 0) {
|
||||
aspectRatio.value = imageWidth.value / imageHeight.value;
|
||||
const divisor = gcd(Math.round(imageWidth.value), Math.round(imageHeight.value));
|
||||
customAspectRatioWidth.value = Math.round(imageWidth.value) / divisor;
|
||||
customAspectRatioHeight.value = Math.round(imageHeight.value) / divisor;
|
||||
}
|
||||
else {
|
||||
// Don't lock if dimensions are invalid
|
||||
aspectRatioLocked.value = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
aspectRatio.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
function getLockStateIcon() {
|
||||
return aspectRatioLocked.value ? IconLock : IconLockOpen2;
|
||||
}
|
||||
|
||||
// Function to apply selected aspect ratio
|
||||
function applyAspectRatio() {
|
||||
const newAspectRatioValue = getAspectRatioValue(selectedAspectRatio.value);
|
||||
if (newAspectRatioValue) {
|
||||
aspectRatio.value = newAspectRatioValue;
|
||||
if (!aspectRatioLocked.value) {
|
||||
aspectRatioLocked.value = true;
|
||||
}
|
||||
imageHeight.value = Math.round(imageWidth.value / newAspectRatioValue);
|
||||
}
|
||||
}
|
||||
|
||||
// Function to reset dimensions to original values
|
||||
function resetToOriginal() {
|
||||
if (originalImageWidth.value && originalImageHeight.value) {
|
||||
// Temporarily turn off aspect ratio lock to prevent issues during reset
|
||||
if (aspectRatioLocked.value) {
|
||||
toggleAspectRatioLock();
|
||||
}
|
||||
|
||||
imageWidth.value = originalImageWidth.value;
|
||||
imageHeight.value = originalImageHeight.value;
|
||||
|
||||
// Update custom aspect ratio to match original image
|
||||
const divisor = gcd(originalImageWidth.value, originalImageHeight.value);
|
||||
customAspectRatioWidth.value = originalImageWidth.value / divisor;
|
||||
customAspectRatioHeight.value = originalImageHeight.value / divisor;
|
||||
}
|
||||
}
|
||||
|
||||
function onWidthFocus() {
|
||||
aspectRatioPriority.value = 'width';
|
||||
}
|
||||
|
||||
function onHeightFocus() {
|
||||
aspectRatioPriority.value = 'height';
|
||||
}
|
||||
|
||||
watch(imageWidth, () => {
|
||||
if (aspectRatioLocked.value && aspectRatio.value && !isUpdatingDimensions.value && imageWidth.value > 0) {
|
||||
if (aspectRatioPriority.value === 'width') {
|
||||
isUpdatingDimensions.value = true;
|
||||
const newHeight = Math.round(imageWidth.value / aspectRatio.value);
|
||||
if (newHeight > 0) {
|
||||
imageHeight.value = newHeight;
|
||||
}
|
||||
isUpdatingDimensions.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Only resize if not too large for preview
|
||||
if (!isPreviewTooLarge.value) {
|
||||
resizeImage();
|
||||
}
|
||||
});
|
||||
|
||||
// Watch height to trigger resizing
|
||||
watch(imageHeight, () => {
|
||||
resizeImage();
|
||||
if (aspectRatioLocked.value && aspectRatio.value && !isUpdatingDimensions.value && imageHeight.value > 0) {
|
||||
if (aspectRatioPriority.value === 'height') {
|
||||
isUpdatingDimensions.value = true;
|
||||
const newWidth = Math.round(imageHeight.value * aspectRatio.value);
|
||||
if (newWidth > 0) {
|
||||
imageWidth.value = newWidth;
|
||||
}
|
||||
isUpdatingDimensions.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Only resize if not too large for preview
|
||||
if (!isPreviewTooLarge.value) {
|
||||
resizeImage();
|
||||
}
|
||||
});
|
||||
|
||||
// Handle file upload
|
||||
@@ -52,6 +287,27 @@ async function handleFileUpload(uploadedFile: File) {
|
||||
originalImageWidth.value = img.naturalWidth;
|
||||
originalImageHeight.value = img.naturalHeight;
|
||||
|
||||
// Temporarily turn off the aspect ratio lock to prevent issues during setting the new values if it is turned on
|
||||
let restoreAspectRatioLock = false;
|
||||
if (aspectRatioLocked.value) {
|
||||
restoreAspectRatioLock = true;
|
||||
toggleAspectRatioLock();
|
||||
}
|
||||
|
||||
// Load the current image dimensions into the width and height inputs
|
||||
imageWidth.value = img.naturalWidth;
|
||||
imageHeight.value = img.naturalHeight;
|
||||
|
||||
// Update custom aspect ratio to match original image
|
||||
const divisor = gcd(img.naturalWidth, img.naturalHeight);
|
||||
customAspectRatioWidth.value = img.naturalWidth / divisor;
|
||||
customAspectRatioHeight.value = img.naturalHeight / divisor;
|
||||
|
||||
// Restore the aspect ratio lock if it was on before
|
||||
if (restoreAspectRatioLock) {
|
||||
toggleAspectRatioLock();
|
||||
}
|
||||
|
||||
// Automatically resize if width and height are set
|
||||
if (imageWidth.value > 0 && imageHeight.value > 0) {
|
||||
resizeImage();
|
||||
@@ -66,12 +322,17 @@ async function handleFileUpload(uploadedFile: File) {
|
||||
}
|
||||
}
|
||||
|
||||
// Function to resize the image
|
||||
async function resizeImage() {
|
||||
if (!originalImageUrl.value) {
|
||||
return; // Ensure there's an original image to work with
|
||||
}
|
||||
|
||||
// Check if canvas would exceed browser limits
|
||||
if (isCanvasTooLarge.value) {
|
||||
resizedImageUrl.value = null; // Clear preview
|
||||
return;
|
||||
}
|
||||
|
||||
const img = new Image();
|
||||
img.src = originalImageUrl.value; // Use the original image for resizing
|
||||
|
||||
@@ -86,18 +347,76 @@ async function resizeImage() {
|
||||
};
|
||||
}
|
||||
|
||||
// Function to download resized image
|
||||
// Function to download resized image with validation and correct format conversion
|
||||
function downloadImage(format: string) {
|
||||
if (!resizedImageUrl.value || !imageFile.value) {
|
||||
// Validate dimensions before download
|
||||
if (!imageFile.value || !originalImageUrl.value) {
|
||||
console.warn('No image available for download');
|
||||
return;
|
||||
}
|
||||
|
||||
const originalFilename = imageFile.value.name.replace(/\.[^/.]+$/, ''); // Remove file extension
|
||||
const newFilename = `${originalFilename}-${imageWidth.value}x${imageHeight.value}.${format}`;
|
||||
const link = document.createElement('a');
|
||||
link.href = resizedImageUrl.value;
|
||||
link.download = newFilename;
|
||||
link.click();
|
||||
// Check for invalid dimensions
|
||||
if (imageWidth.value <= 0 || imageHeight.value <= 0) {
|
||||
console.warn('Invalid dimensions: Width and height must be greater than 0');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for canvas size limits
|
||||
if (isCanvasTooLarge.value) {
|
||||
console.warn('Canvas size exceeds browser limits');
|
||||
return;
|
||||
}
|
||||
|
||||
// Create a new canvas for the specific format
|
||||
const img = new Image();
|
||||
img.src = originalImageUrl.value;
|
||||
|
||||
img.onload = () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = imageWidth.value;
|
||||
canvas.height = imageHeight.value;
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// For JPG format, fill with white background since JPG doesn't support transparency
|
||||
if (format === 'jpg' || format === 'jpeg') {
|
||||
ctx!.fillStyle = 'white';
|
||||
ctx!.fillRect(0, 0, imageWidth.value, imageHeight.value);
|
||||
}
|
||||
|
||||
ctx?.drawImage(img, 0, 0, imageWidth.value, imageHeight.value);
|
||||
|
||||
// Get the correct MIME type and convert to the requested format
|
||||
let mimeType: string;
|
||||
const quality = 0.9; // Default quality for lossy formats
|
||||
|
||||
switch (format.toLowerCase()) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
mimeType = 'image/jpeg';
|
||||
break;
|
||||
case 'png':
|
||||
mimeType = 'image/png';
|
||||
break;
|
||||
case 'webp':
|
||||
mimeType = 'image/webp';
|
||||
break;
|
||||
default:
|
||||
mimeType = 'image/png';
|
||||
format = 'png';
|
||||
}
|
||||
|
||||
// Convert canvas to the specified format
|
||||
const dataUrl = canvas.toDataURL(mimeType, quality);
|
||||
|
||||
// Create download
|
||||
const originalFilename = imageFile.value!.name.replace(/\.[^/.]+$/, ''); // Remove file extension
|
||||
const newFilename = `${originalFilename}-${imageWidth.value}x${imageHeight.value}.${format}`;
|
||||
const link = document.createElement('a');
|
||||
link.href = dataUrl;
|
||||
link.download = newFilename;
|
||||
link.click();
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -105,66 +424,318 @@ function downloadImage(format: string) {
|
||||
<n-card>
|
||||
<div>
|
||||
<!-- File input -->
|
||||
<c-file-upload mb-2 accept=".jpg,.jpeg,.png,.bmp,.ico,.svg" title="Drag and drop a .jpg, .jpeg, .png, .bmp, .ico, .svg file here" @file-upload="handleFileUpload" />
|
||||
<c-file-upload
|
||||
mb-2
|
||||
accept="image/*"
|
||||
title="Drag and drop an image file here"
|
||||
@file-upload="handleFileUpload"
|
||||
/>
|
||||
|
||||
<!-- Original image dimensions -->
|
||||
<div v-if="originalImageWidth && originalImageHeight">
|
||||
<p>Original Image Dimensions: {{ originalImageWidth }}x{{ originalImageHeight }}px</p>
|
||||
<div v-if="originalImageWidth && originalImageHeight" display="flex" direction="row" style="align-items: center;">
|
||||
<p style="margin: 0; margin-right: 10px;">
|
||||
Original Image Dimensions: {{ originalImageWidth }}x{{ originalImageHeight }}px
|
||||
</p>
|
||||
<n-button
|
||||
v-if="canReset"
|
||||
type="tertiary"
|
||||
title="Reset to Original Dimensions"
|
||||
mt-1
|
||||
@click="resetToOriginal"
|
||||
>
|
||||
<n-icon :component="IconReload" size="16" style="margin-right: 5px;" />
|
||||
Reset width and height to image dimensions
|
||||
</n-button>
|
||||
</div>
|
||||
|
||||
<!-- Width and height inputs -->
|
||||
<div class="input-group">
|
||||
<label for="widthInput">Width (px):</label>
|
||||
<n-input-number id="widthInput" v-model:value="imageWidth" placeholder="Width (px)" mb-3 />
|
||||
<!-- Compact Width/Height and Aspect Ratio Controls -->
|
||||
<div class="compact-controls" style="margin-bottom: 20px; margin-top: 20px;">
|
||||
<!-- Left side: Width and Height inputs -->
|
||||
<div class="dimensions-section">
|
||||
<h4>Dimensions</h4>
|
||||
<div class="input-group">
|
||||
<label for="widthInput">Width (px):</label>
|
||||
<n-input-number
|
||||
id="widthInput"
|
||||
v-model:value="imageWidth"
|
||||
placeholder="Width (px)"
|
||||
:min="1"
|
||||
:max="MAX_CANVAS_DIMENSION"
|
||||
@focus="onWidthFocus"
|
||||
/>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label for="heightInput">Height (px):</label>
|
||||
<n-input-number
|
||||
id="heightInput"
|
||||
v-model:value="imageHeight"
|
||||
placeholder="Height (px)"
|
||||
:min="1"
|
||||
:max="MAX_CANVAS_DIMENSION"
|
||||
@focus="onHeightFocus"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Validation warnings -->
|
||||
<div v-if="imageWidth <= 0 || imageHeight <= 0" class="validation-warning">
|
||||
<p style="color: red; font-size: 12px; margin: 5px 0 0 0;">
|
||||
⚠️ Width and height must be greater than 0
|
||||
</p>
|
||||
</div>
|
||||
<div v-else-if="isCanvasTooLarge" class="validation-warning">
|
||||
<p style="color: red; font-size: 12px; margin: 5px 0 0 0;">
|
||||
⚠️ Canvas size exceeds browser limits (max: {{ MAX_CANVAS_DIMENSION.toLocaleString() }}px per side, max area: {{ Math.floor(MAX_CANVAS_AREA / 1000000) }}M pixels)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Middle: Current aspect ratio display, lock, and priority -->
|
||||
<div class="aspect-ratio-middle">
|
||||
<h4>Aspect Ratio</h4>
|
||||
|
||||
<!-- Current aspect ratio display -->
|
||||
<div v-if="displayedAspectRatio" class="current-ratio-display">
|
||||
{{ displayedAspectRatio }}
|
||||
</div>
|
||||
|
||||
<!-- Lock icon -->
|
||||
<div
|
||||
class="lock-icon flex cursor-pointer items-center justify-center rounded text-gray-500 transition-colors hover:text-blue-600"
|
||||
title="Lock/Unlock Aspect Ratio"
|
||||
@click="toggleAspectRatioLock()"
|
||||
>
|
||||
<n-icon :component="getLockStateIcon()" size="26" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right side: Aspect Ratio presets only -->
|
||||
<div class="aspect-ratio-section-compact">
|
||||
<h4>Aspect Ratio Presets</h4>
|
||||
|
||||
<!-- Aspect ratio selector -->
|
||||
<div class="aspect-ratio-selector-compact">
|
||||
<n-select
|
||||
id="aspectRatioSelect"
|
||||
v-model:value="selectedAspectRatio"
|
||||
:options="aspectRatioOptions"
|
||||
placeholder="Choose ratio"
|
||||
size="small"
|
||||
style="width: 160px;"
|
||||
/>
|
||||
<n-button type="primary" size="small" @click="applyAspectRatio">
|
||||
Apply
|
||||
</n-button>
|
||||
</div>
|
||||
|
||||
<!-- Custom aspect ratio inputs -->
|
||||
<div v-if="selectedAspectRatio === 'custom'" class="custom-ratio-inputs-compact">
|
||||
<div class="custom-ratio-group-compact">
|
||||
<n-input-number
|
||||
v-model:value="customAspectRatioWidth"
|
||||
placeholder="W"
|
||||
:min="1"
|
||||
size="small"
|
||||
style="width: 100px;"
|
||||
/>
|
||||
<span>:</span>
|
||||
<n-input-number
|
||||
v-model:value="customAspectRatioHeight"
|
||||
placeholder="H"
|
||||
:min="1"
|
||||
size="small"
|
||||
style="width: 100px;"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<label for="heightInput">Height (px):</label>
|
||||
<n-input-number id="heightInput" v-model:value="imageHeight" placeholder="Height (px)" mb-1 />
|
||||
</div>
|
||||
</div>
|
||||
<!-- Image preview and download section -->
|
||||
<div v-if="originalImageUrl" class="image-container" style="text-align: center; margin-top: 20px;">
|
||||
<!-- Show preview when dimensions are within limits -->
|
||||
<div v-if="resizedImageUrl && !isPreviewTooLarge" class="image-wrapper">
|
||||
<img :src="resizedImageUrl" :alt="`Resized Preview (${imageWidth}px x ${imageHeight}px)`" :style="{ width: `${imageWidth}px`, height: `${imageHeight}px` }">
|
||||
<p>Preview: {{ imageWidth }}x{{ imageHeight }}px</p>
|
||||
</div>
|
||||
|
||||
<!-- Image preview -->
|
||||
<div v-if="resizedImageUrl" class="image-container" style="text-align: center; margin-top: 20px;">
|
||||
<div class="image-wrapper">
|
||||
<img :src="resizedImageUrl" :alt="`Resized Preview (${imageWidth}px x ${imageHeight}px)`" :style="{ width: `${imageWidth}px`, height: `${imageHeight}px` }">
|
||||
</div>
|
||||
<p>Preview: {{ imageWidth }}x{{ imageHeight }}px</p>
|
||||
<!-- Show message when preview is too large -->
|
||||
<div v-if="isPreviewTooLarge" class="preview-too-large">
|
||||
<p style="color: #666; font-style: italic; margin: 20px 0;">
|
||||
⚠️ Preview not shown - dimensions too large ({{ imageWidth }}x{{ imageHeight }}px)
|
||||
<br>
|
||||
Preview is disabled when width or height exceeds 7,680 pixels for performance reasons.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Download options -->
|
||||
<h3>Download Options:</h3>
|
||||
<div class="download-grid">
|
||||
<n-button @click.prevent="downloadImage('jpg')">
|
||||
Download JPG
|
||||
</n-button>
|
||||
<n-button @click.prevent="downloadImage('png')">
|
||||
Download PNG
|
||||
</n-button>
|
||||
<n-button @click.prevent="downloadImage('bmp')">
|
||||
Download BMP
|
||||
</n-button>
|
||||
<n-button @click.prevent="downloadImage('svg')">
|
||||
Download SVG
|
||||
</n-button>
|
||||
<n-button @click.prevent="downloadImage('ico')">
|
||||
Download ICO
|
||||
</n-button>
|
||||
<!-- Download options (always show when image is loaded) -->
|
||||
<div v-if="originalImageUrl">
|
||||
<h3>Download Options:</h3>
|
||||
<div class="download-grid">
|
||||
<n-button :disabled="!canDownload" @click.prevent="downloadImage('jpg')">
|
||||
Download JPG
|
||||
</n-button>
|
||||
<n-button :disabled="!canDownload" @click.prevent="downloadImage('png')">
|
||||
Download PNG
|
||||
</n-button>
|
||||
<n-button :disabled="!canDownload" @click.prevent="downloadImage('webp')">
|
||||
Download WebP
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.input-group {
|
||||
.compact-controls {
|
||||
display: flex;
|
||||
gap: 30px;
|
||||
padding: 15px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.dimensions-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: left;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.dimensions-section h4 {
|
||||
margin: 0 0 10px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.input-group label {
|
||||
margin-right: 10px;
|
||||
width: 100px;
|
||||
min-width: 80px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.aspect-ratio-middle {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aspect-ratio-middle h4 {
|
||||
margin: 0 0 10px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.current-ratio-display {
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color: #1ea54c;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.lock-icon {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.aspect-ratio-section-compact {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aspect-ratio-section-compact h4 {
|
||||
margin: 0 0 10px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.aspect-ratio-selector-compact {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.custom-ratio-inputs-compact {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.custom-ratio-group-compact {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.custom-ratio-group-compact span {
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.validation-warning {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
@media (max-width: 768px) {
|
||||
.compact-controls {
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.aspect-ratio-controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.aspect-ratio-selector {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aspect-ratio-selector label {
|
||||
font-weight: 600;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.custom-ratio-inputs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.custom-ratio-inputs label {
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.custom-ratio-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.custom-ratio-group span {
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.image-container {
|
||||
@@ -178,6 +749,13 @@ function downloadImage(format: string) {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.preview-too-large {
|
||||
padding: 20px;
|
||||
border: 1px dashed #ccc;
|
||||
border-radius: 8px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.download-grid {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
@@ -5,7 +5,7 @@ export const tool = defineTool({
|
||||
name: 'Image resizer',
|
||||
path: '/image-resizer',
|
||||
description: '',
|
||||
keywords: ['image', 'resizer', 'favicon', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg'],
|
||||
keywords: ['image', 'resizer', 'favicon', 'jpg', 'jpeg', 'png', 'webp'],
|
||||
component: () => import('./image-resizer.vue'),
|
||||
icon: IconResize,
|
||||
createdAt: new Date('2024-10-22'),
|
||||
|
||||
@@ -1,30 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, onUnmounted, ref } from 'vue';
|
||||
import CountriesDB from 'countries-db';
|
||||
import ISO6391 from 'iso-639-1';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const countriesSearchData = Object.entries(CountriesDB.getAllCountries()).map(([_, info]) => {
|
||||
return {
|
||||
iso2: info.iso2,
|
||||
iso3: info.iso3,
|
||||
domain: info.domain,
|
||||
name: `${info.name} ${info.officialName}`,
|
||||
info,
|
||||
};
|
||||
});
|
||||
const limit = ref(100);
|
||||
const { searchResult } = useFuzzySearch({
|
||||
const searchQuery = useDebouncedRef('', 250);
|
||||
const countriesSearchData = Object.values(CountriesDB.getAllCountries());
|
||||
const limit = ref(20);
|
||||
const { searchResult } = useFlexSearch({
|
||||
search: searchQuery,
|
||||
data: countriesSearchData,
|
||||
options: {
|
||||
keys: ['name', { name: 'iso3', weight: 3 }, { name: 'iso2', weight: 2 }, 'domain'],
|
||||
threshold: 0.3,
|
||||
isCaseSensitive: false,
|
||||
useExtendedSearch: true,
|
||||
keys: [{ name: 'name', weight: 2 }, { name: 'iso3', weight: 3 }, { name: 'iso2', weight: 2 }, 'officialName', 'domain', 'continentId', 'currencyCode', 'currencyName', 'phoneCode'],
|
||||
},
|
||||
limit: limit.value,
|
||||
limit,
|
||||
});
|
||||
|
||||
function langToName(code: string) {
|
||||
@@ -34,15 +24,72 @@ function langToName(code: string) {
|
||||
}
|
||||
return `${code} (${name})`;
|
||||
}
|
||||
|
||||
// Batch loading logic for search results
|
||||
const RESULTS_PER_BATCH = 2; // Show 2 results per batch
|
||||
const visibleResultsCount = ref(RESULTS_PER_BATCH); // Start with first batch
|
||||
let loadingInterval: NodeJS.Timeout | null = null;
|
||||
|
||||
// Computed property for visible search results
|
||||
const visibleSearchResults = computed(() => {
|
||||
return searchResult.value.slice(0, visibleResultsCount.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);
|
||||
}
|
||||
|
||||
// Reset visible count when starting new search
|
||||
visibleResultsCount.value = RESULTS_PER_BATCH;
|
||||
|
||||
// Start loading batches every 150ms
|
||||
loadingInterval = setInterval(() => {
|
||||
if (visibleResultsCount.value < searchResult.value.length) {
|
||||
visibleResultsCount.value = Math.min(
|
||||
visibleResultsCount.value + RESULTS_PER_BATCH,
|
||||
searchResult.value.length,
|
||||
);
|
||||
}
|
||||
else {
|
||||
// Stop loading when all results are visible
|
||||
stopAutomatedLoading();
|
||||
}
|
||||
}, 150);
|
||||
}
|
||||
|
||||
// Watch for changes in search results to restart batching
|
||||
watch(searchResult, (newResults) => {
|
||||
if (newResults.length > 0) {
|
||||
nextTick(() => {
|
||||
startAutomatedLoading();
|
||||
});
|
||||
}
|
||||
else {
|
||||
stopAutomatedLoading();
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
// Clean up on component unmount
|
||||
onUnmounted(() => {
|
||||
stopAutomatedLoading();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div mx-auto max-w-2400px important:flex-1>
|
||||
<div mx-auto max-w-600px flex justify-center gap-3>
|
||||
<c-input-text
|
||||
v-model:value="searchQuery"
|
||||
placeholder="Search Countries by name, iso2, iso3..."
|
||||
>
|
||||
<c-input-text v-model:value="searchQuery" placeholder="Search Countries by name, iso2, iso3...">
|
||||
<template #prefix>
|
||||
<icon-mdi-search mr-6px color-black op-70 dark:color-white />
|
||||
</template>
|
||||
@@ -53,12 +100,7 @@ function langToName(code: string) {
|
||||
</div>
|
||||
|
||||
<div v-if="searchQuery.trim().length > 0">
|
||||
<div
|
||||
v-if="searchResult.length === 0"
|
||||
mt-4
|
||||
text-20px
|
||||
font-bold
|
||||
>
|
||||
<div v-if="searchResult.length === 0" mt-4 text-20px font-bold>
|
||||
No results
|
||||
</div>
|
||||
|
||||
@@ -73,35 +115,148 @@ function langToName(code: string) {
|
||||
<th>Name and Info</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(result, ix) in searchResult" :key="ix">
|
||||
<tr v-for="(result, ix) in visibleSearchResults" :key="ix">
|
||||
<td style="vertical-align: top">
|
||||
<input-copyable :value="result.iso2" />
|
||||
<input-copyable :value="result.iso3" />
|
||||
<input-copyable :value="result.iso2" :readonly="true" />
|
||||
<input-copyable :value="result.iso3" :readonly="true" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable label-width="150px" label="Name" label-position="left" :value="result.name" mb-1 />
|
||||
<input-copyable label-width="150px" label="Official Name" label-position="left" :value="result.info.officialName" mb-1 />
|
||||
<input-copyable label-width="150px" label="Domain" label-position="left" :value="result.info.domain" mb-1 />
|
||||
<input-copyable label-width="150px" label="Emoji" label-position="left" :value="`${result.info.emoji} (${result.info.emojiUnicode})`" mb-1 />
|
||||
<input-copyable label-width="150px" label="ISO Num" label-position="left" :value="result.info.isoNumeric" mb-1 />
|
||||
<input-copyable label-width="150px" label="Continent" label-position="left" :value="result.info.continentId" mb-1 />
|
||||
<input-copyable label-width="150px" label="Elevation (m)" label-position="left" :value="result.info.elevation" mb-1 />
|
||||
<input-copyable label-width="150px" label="Population" label-position="left" :value="result.info.population" mb-1 />
|
||||
<input-copyable label-width="150px" label="Area (km²)" label-position="left" :value="result.info.areaSqKm" mb-1 />
|
||||
<input-copyable label-width="150px" label="Timezones" label-position="left" :value="result.info.timezones.join('\n')" mb-1 />
|
||||
<input-copyable label-width="150px" label="Currency" label-position="left" :value="`${result.info.currencyCode} / ${result.info.currencyName}`" mb-1 />
|
||||
<input-copyable label-width="150px" label="Postal Code" label-position="left" :value="`${result.info.postalCodeFormat} / ${result.info.postalCodeRegex}`" mb-1 />
|
||||
<input-copyable label-width="150px" label="Phone Code" label-position="left" :value="result.info.phoneCode" mb-1 />
|
||||
<input-copyable label-width="150px" label="Neighbor Countries" label-position="left" :value="result.info.neighborCountryIds.map(id => CountriesDB.getCountry(id, 'name')?.toString() || id).join(', ')" mb-1 />
|
||||
<input-copyable label-width="150px" label="Languages" label-position="left" :value="result.info.languages.map(langToName).join(', ')" mb-1 />
|
||||
<input-copyable label-width="150px" label="Locales" label-position="left" :value="result.info.locales.map(langToName).join(', ')" mb-1 />
|
||||
<!-- //NOSONAR --><n-a :href="`https://www.openstreetmap.org/#map=5/${result.info.coordinates.latitude}/${result.info.coordinates.longitude}`" target="_blank">
|
||||
<input-copyable label-width="150px" label="Name" label-position="left" :value="result.name" :readonly="true" mb-1 />
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Official Name"
|
||||
label-position="left"
|
||||
:value="result.officialName"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable label-width="150px" label="Domain" label-position="left" :value="result.domain" :readonly="true" mb-1 />
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Emoji"
|
||||
label-position="left"
|
||||
:value="`${result.emoji}`"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="ISO Num"
|
||||
label-position="left"
|
||||
:value="result.isoNumeric"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Continent"
|
||||
label-position="left"
|
||||
:value="result.continentId"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Elevation (m)"
|
||||
label-position="left"
|
||||
:value="result.elevation"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Population"
|
||||
label-position="left"
|
||||
:value="result.population"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Area (km²)"
|
||||
label-position="left"
|
||||
:value="result.areaSqKm"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Timezones"
|
||||
label-position="left"
|
||||
:value="result.timezones.join('\n')"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Currency"
|
||||
label-position="left"
|
||||
:value="`${result.currencyCode} / ${result.currencyName}`"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Postal Code"
|
||||
label-position="left"
|
||||
:value="`${result.postalCodeFormat} / ${result.postalCodeRegex}`"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Phone Code"
|
||||
label-position="left"
|
||||
:value="result.phoneCode"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Neighbor Countries"
|
||||
label-position="left"
|
||||
:value="
|
||||
result.neighborCountryIds
|
||||
.map((id) => CountriesDB.getCountry(id, 'name')?.toString() || id)
|
||||
.join(', ')
|
||||
|| 'None'
|
||||
"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Languages"
|
||||
label-position="left"
|
||||
:value="result.languages.map(langToName).join(', ')"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Locales"
|
||||
label-position="left"
|
||||
:value="result.locales.map(langToName).join(', ')"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<!-- //NOSONAR --><n-a
|
||||
:href="`https://www.openstreetmap.org/#map=5/${result.coordinates.latitude}/${result.coordinates.longitude}`"
|
||||
target="_blank"
|
||||
>
|
||||
> See on OpenStreetMap
|
||||
</n-a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
|
||||
<!-- Loading indicator when more results are coming -->
|
||||
<div v-if="visibleResultsCount < searchResult.length" mt-6 text-center>
|
||||
<div text-14px op-70>
|
||||
Loading more results... ({{ visibleSearchResults.length }}/{{ searchResult.length }})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Cloud } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'K8s Cheatsheet',
|
||||
path: '/k8s-memo',
|
||||
description: 'Kubernetes useful commands',
|
||||
keywords: ['k8s', 'kubernetes'],
|
||||
component: () => import('./k8s-memo.vue'),
|
||||
icon: Cloud,
|
||||
createdAt: new Date('2025-05-19'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -0,0 +1,183 @@
|
||||
# Kubernetes
|
||||
|
||||
* PDF: https://sematext.com/kubernetes-cheat-sheet/
|
||||
* WEBSITE: https://kubernetes.io/
|
||||
* DOCUMENTATION: https://kubernetes.io/docs/home
|
||||
|
||||
## Client Configuration
|
||||
|
||||
* Setup autocomplete in bash; bash-completion package should be installed first
|
||||
```
|
||||
source <(kubectl completion bash)
|
||||
```
|
||||
|
||||
* View Kubernetes config
|
||||
```
|
||||
kubectl config view
|
||||
```
|
||||
|
||||
* View specific config items by json path
|
||||
```
|
||||
kubectl config view -o jsonpath='{.users[?(@.name == "k8s")].user.password}'
|
||||
```
|
||||
|
||||
* Set credentials for `foo.kuberntes.com`
|
||||
```
|
||||
kubectl config set-credentials kubeuser/foo.kubernetes.com --username=kubeuser --password=kubepassword
|
||||
```
|
||||
|
||||
* Set active namespace
|
||||
```
|
||||
kubectl config set-context --current --namespace=namespace_name
|
||||
```
|
||||
|
||||
## Viewing, Finding resources
|
||||
|
||||
* List all services in the namespace
|
||||
```
|
||||
kubectl get services
|
||||
```
|
||||
|
||||
* List all pods in all namespaces in wide format
|
||||
```
|
||||
kubectl get pods -o wide --all-namespaces
|
||||
```
|
||||
|
||||
* List all pods in json (or yaml) format
|
||||
```
|
||||
kubectl get pods -o json
|
||||
```
|
||||
|
||||
* Describe resource details (node, pod, svc)
|
||||
```
|
||||
kubectl describe nodes my-node
|
||||
```
|
||||
|
||||
* List services sorted by name
|
||||
```
|
||||
kubectl get services --sort-by=.metadata.name
|
||||
```
|
||||
|
||||
* List pods sorted by restart count
|
||||
```
|
||||
kubectl get pods --sort-by='.status.containerStatuses[0].restartCount'
|
||||
```
|
||||
|
||||
* Rolling update pods for frontend-v1
|
||||
```
|
||||
kubectl rolling-update frontend-v1 -f frontend-v2.json
|
||||
```
|
||||
|
||||
* Scale a replicaset named 'foo' to 3
|
||||
```
|
||||
kubectl scale --replicas=3 rs/foo
|
||||
```
|
||||
|
||||
* Scale a resource specified in "foo.yaml" to 3
|
||||
```
|
||||
kubectl scale --replicas=3 -f foo.yaml
|
||||
```
|
||||
|
||||
* Execute a command in every pod / replica
|
||||
```
|
||||
for i in 0 1; do kubectl exec foo-$i -- sh -c 'echo $(hostname) > /usr/share/nginx/html/index.html'; done
|
||||
```
|
||||
|
||||
## Manage Resources
|
||||
|
||||
* Get documentation for pod or service
|
||||
```
|
||||
kubectl explain pods,svc
|
||||
```
|
||||
|
||||
* Create resource(s) like pods, services or daemonsets
|
||||
```
|
||||
kubectl create -f ./my-manifest.yaml
|
||||
```
|
||||
|
||||
* Apply a configuration to a resource
|
||||
```
|
||||
kubectl apply -f ./my-manifest.yaml
|
||||
```
|
||||
|
||||
* Start a single instance of Nginx
|
||||
```
|
||||
kubectl run nginx --image=nginx
|
||||
```
|
||||
|
||||
* Create a secret with several keys
|
||||
```
|
||||
cat <<EOF | kubectl create -f -
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mysecret
|
||||
type: Opaque
|
||||
data:
|
||||
password: $(echo "s33msi4" | base64)
|
||||
username: $(echo "jane"| base64)
|
||||
EOF
|
||||
```
|
||||
|
||||
* Delete a resource
|
||||
```
|
||||
kubectl delete -f ./my-manifest.yaml
|
||||
```
|
||||
|
||||
## Monitoring & Logging
|
||||
|
||||
* Deploy Heapster from Github repository
|
||||
```
|
||||
kubectl create -f deploy/kube-config/standalone/
|
||||
```
|
||||
|
||||
* Show metrics for nodes
|
||||
```
|
||||
kubectl top node
|
||||
```
|
||||
|
||||
* Show metrics for pods
|
||||
```
|
||||
kubectl top pod
|
||||
```
|
||||
|
||||
* Show metrics for a given pod and its containers
|
||||
```
|
||||
kubectl top pod pod_name --containers
|
||||
```
|
||||
|
||||
* Dump pod logs (stdout)
|
||||
```
|
||||
kubectl logs pod_name
|
||||
```
|
||||
|
||||
* Stream pod container logs (stdout, multi-container case)
|
||||
```
|
||||
kubectl logs -f pod_name -c my-container
|
||||
```
|
||||
|
||||
## Interacting with running pods
|
||||
|
||||
* Run command in pod
|
||||
```
|
||||
kubectl exec pod_name -- command_name
|
||||
```
|
||||
|
||||
* Run command in pod with multiple containers
|
||||
```
|
||||
kubectl exec pod_name -c container_name -- command_name
|
||||
```
|
||||
|
||||
* Get terminal of pod
|
||||
```
|
||||
kubectl exec -it pod_name /bin/sh
|
||||
```
|
||||
|
||||
* Get terminal of a container running in pod with multiple containers
|
||||
```
|
||||
kubectl exec -it pod_name -c container_name /bin/sh
|
||||
```
|
||||
|
||||
### Credits
|
||||
|
||||
https://raw.githubusercontent.com/LeCoupa/awesome-cheatsheets/refs/heads/master/tools/kubernetes.md
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './k8s-memo.content.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { DeviceDesktop } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Nginx Cheatsheet',
|
||||
path: '/nginx-memo',
|
||||
description: 'Nginx configuration and useful commands',
|
||||
keywords: ['nginx'],
|
||||
component: () => import('./nginx-memo.vue'),
|
||||
icon: DeviceDesktop,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -0,0 +1,218 @@
|
||||
```bash
|
||||
##############################################################################
|
||||
# NGINX
|
||||
# DOCUMENTATION: https://nginx.org/en/docs/
|
||||
##############################################################################
|
||||
|
||||
sudo nginx -t # Check syntax
|
||||
sudo systemctl status nginx # nginx current status
|
||||
sudo systemctl reload nginx # Reload nginx
|
||||
sudo systemctl restart nginx # Restart nginx
|
||||
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/ # Link website
|
||||
sudo tail -f /var/log/nginx/access.log # Tail logs to inspect requests
|
||||
|
||||
# *****************************************************************************
|
||||
# General Settings
|
||||
# *****************************************************************************
|
||||
|
||||
# Ports
|
||||
|
||||
server {
|
||||
# Use HTTP protocol
|
||||
listen 80;
|
||||
|
||||
# Use HTTPS protocol
|
||||
listen 443 ssl;
|
||||
|
||||
# Listen on port 80 using IPv6
|
||||
listen [::]:80;
|
||||
|
||||
# Listen on port 80 using **only** IPv6
|
||||
listen [::]:80 ipv6only=on;
|
||||
}
|
||||
|
||||
# Domain name (server_name)
|
||||
|
||||
server {
|
||||
# Listen to example.com
|
||||
server_name example.com;
|
||||
|
||||
# Listen to multiple domains
|
||||
server_name example.com www.example.com;
|
||||
|
||||
# Listen to all sub-domains
|
||||
server_name *.example.com;
|
||||
|
||||
# Listen to all top-level domains
|
||||
server_name example.*;
|
||||
|
||||
# Listen to unspecified hostnames (listens to IP address itself)
|
||||
server_name "";
|
||||
}
|
||||
|
||||
# *****************************************************************************
|
||||
# Serving Files
|
||||
# *****************************************************************************
|
||||
|
||||
# Static assets (traditional web server)
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
root /path/to/website;
|
||||
# root /www/data/ for example
|
||||
|
||||
# If there's no 'root' inside, it will look for /www/data/index.html
|
||||
location / {
|
||||
}
|
||||
|
||||
# If there's no 'root' inside, it will look for /www/data/images/index.html
|
||||
location /images/ {
|
||||
}
|
||||
|
||||
# Since there's 'root' inside, it will look for /www/media/videos/index.html
|
||||
location /videos/ {
|
||||
root /www/media;
|
||||
}
|
||||
}
|
||||
|
||||
# *****************************************************************************
|
||||
# Redirects
|
||||
# *****************************************************************************
|
||||
|
||||
# 301 Permanent
|
||||
|
||||
server {
|
||||
# Redirect www.example.com to example.com
|
||||
listen 80;
|
||||
server_name www.example.com;
|
||||
return 301 http://example.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
# Redirect http to https
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
return 301 https://example.com$request_uri;
|
||||
}
|
||||
|
||||
# 302 Temporary
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name yourdomain.com;
|
||||
return 302 http://otherdomain.com;
|
||||
}
|
||||
|
||||
# *****************************************************************************
|
||||
# Reverse proxy
|
||||
# *****************************************************************************
|
||||
|
||||
# Useful for Node.js, Streamlit, Jupyter, etc
|
||||
|
||||
# Basic
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://0.0.0.0:3000;
|
||||
# where 0.0.0.0:3000 is your Node.js Server bound on 0.0.0.0 listing on port 3000
|
||||
}
|
||||
}
|
||||
|
||||
# Basic + (upstream)
|
||||
|
||||
upstream node_js {
|
||||
server 0.0.0.0:3000;
|
||||
# where 0.0.0.0:3000 is your Node.js Server bound on 0.0.0.0 listing on port 3000
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://node_js;
|
||||
}
|
||||
}
|
||||
|
||||
# Upgraded Connection (useful for applications with support for WebSockets)
|
||||
|
||||
upstream node_js {
|
||||
server 0.0.0.0:3000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://node_js;
|
||||
proxy_redirect off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# *****************************************************************************
|
||||
# HTTPS Protocol
|
||||
# *****************************************************************************
|
||||
|
||||
# The majority of SSL options depend on what your application does or needs
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name example.com;
|
||||
|
||||
ssl on;
|
||||
|
||||
ssl_certificate /path/to/cert.pem;
|
||||
ssl_certificate_key /path/to/privkey.pem;
|
||||
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
ssl_trusted_certificate /path/to/fullchain.pem;
|
||||
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:SSL:50m;
|
||||
add_header Strict-Transport-Security max-age=15768000;
|
||||
}
|
||||
|
||||
# Permanent redirect to HTTPS secured domain
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name yourdomain.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# You can easily secure you website/app using Let's Encrypt.
|
||||
# Go https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx.html for more information
|
||||
|
||||
# *****************************************************************************
|
||||
# Load Balancing
|
||||
# *****************************************************************************
|
||||
|
||||
# Useful for large applications running in multiple instances. Below example is for reverse proxy
|
||||
upstream node_js {
|
||||
server 0.0.0.0:3000;
|
||||
server 0.0.0.0:4000;
|
||||
server 127.155.142.421;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://node_js;
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './nginx-memo.content.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { FileExport } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'PDF Text Extractor',
|
||||
path: '/pdf-text-extractor',
|
||||
description: 'Extract text from PDF',
|
||||
keywords: ['pdf', 'text', 'extractor'],
|
||||
component: () => import('./pdf-text-extractor.vue'),
|
||||
icon: FileExport,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'PDF',
|
||||
});
|
||||
@@ -0,0 +1,81 @@
|
||||
<script setup lang="ts">
|
||||
import { definePDFJSModule, extractText, getDocumentProxy } from 'unpdf';
|
||||
import * as pdfJS from 'pdfjs-dist';
|
||||
import pdfJSWorkerURL from 'pdfjs-dist/build/pdf.worker?url';
|
||||
|
||||
pdfJS.GlobalWorkerOptions.workerSrc = pdfJSWorkerURL;
|
||||
|
||||
// Define the PDF.js build before using any other unpdf method
|
||||
await definePDFJSModule(() => import('pdfjs-dist'));
|
||||
|
||||
const status = ref<'idle' | 'done' | 'error' | 'processing'>('idle');
|
||||
const file = ref<File | null>(null);
|
||||
const totalPages = ref(0);
|
||||
const text = ref('');
|
||||
const errorMessage = ref('');
|
||||
const mergePages = ref(false);
|
||||
|
||||
function onFileUploaded(uploadedFile: File) {
|
||||
file.value = uploadedFile;
|
||||
totalPages.value = 0;
|
||||
text.value = '';
|
||||
}
|
||||
|
||||
async function processPDF() {
|
||||
if (!file.value) {
|
||||
return;
|
||||
}
|
||||
status.value = 'idle';
|
||||
errorMessage.value = '';
|
||||
try {
|
||||
status.value = 'processing';
|
||||
const fileBuffer = await file.value.arrayBuffer();
|
||||
const pdf = await getDocumentProxy(new Uint8Array(fileBuffer));
|
||||
const data = await extractText(pdf, { mergePages: mergePages.value as never });
|
||||
totalPages.value = data.totalPages;
|
||||
text.value = Array.isArray(data.text) ? data.text.join('\n') : data.text;
|
||||
status.value = 'done';
|
||||
}
|
||||
catch (e: any) {
|
||||
errorMessage.value = e.toString();
|
||||
status.value = 'error';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div style="flex: 0 0 100%" mb-1>
|
||||
<div mx-auto max-w-600px>
|
||||
<c-file-upload title="Drag and drop a PDF file here, or click to select a file" accept=".pdf" @file-upload="onFileUploaded" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div flex justify-center>
|
||||
<n-form-item label="Merge pages" label-placement="left">
|
||||
<n-checkbox v-model:checked="mergePages" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
<div flex justify-center>
|
||||
<c-button mb-1 :disabled="!file" @click="processPDF">
|
||||
Extract text
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<div mb-1 mt-3 flex justify-center>
|
||||
<c-alert v-if="errorMessage" type="error">
|
||||
{{ errorMessage }}
|
||||
</c-alert>
|
||||
<n-spin
|
||||
v-if="status === 'processing'"
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<c-card v-if="file && text" title="Output">
|
||||
<input-copyable label="File name:" :value="file?.name" mb-1 />
|
||||
<textarea-copyable label="Text:" :value="text" mb-1 />
|
||||
<input-copyable label="Total Pages:" :value="totalPages.toString()" mb-1 />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,7 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import 'webcrypto-liner-shim';
|
||||
import * as openpgp from 'openpgp';
|
||||
import { computedCatchAsync } from '@/composable/computed/catchedComputed';
|
||||
|
||||
openpgp.config.rejectCurves = new Set();
|
||||
|
||||
const cryptInput = ref('');
|
||||
const cryptPublicKey = ref('');
|
||||
const cryptPrivateKey = ref('');
|
||||
@@ -79,11 +82,20 @@ const [decryptOutput, decryptError] = computedCatchAsync(async () => {
|
||||
defaultValue: { decryptedText: '', signatureError: '' },
|
||||
defaultErrorMessage: 'Unable to encrypt your text',
|
||||
});
|
||||
|
||||
function isWindowSecureContext() {
|
||||
return window.isSecureContext;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Encrypt">
|
||||
<c-alert v-if="!isWindowSecureContext()" mb-2>
|
||||
Your browser is not in <n-a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts" target="_blank">
|
||||
"Secure Context" (HTTPS)
|
||||
</n-a>. This tool may not work correctly and require HTTPS to work fully.
|
||||
</c-alert>
|
||||
<c-card title="Encrypt" mb-2>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="cryptInput"
|
||||
|
||||
@@ -1,23 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import 'webcrypto-liner-shim';
|
||||
import * as openpgp from 'openpgp';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
import { computedRefreshableAsync } from '@/composable/computedRefreshable';
|
||||
|
||||
openpgp.config.rejectCurves = new Set();
|
||||
|
||||
function isWindowSecureContext() {
|
||||
return window.isSecureContext;
|
||||
}
|
||||
|
||||
const bits = ref(4096);
|
||||
const username = ref('');
|
||||
const useremail = ref('');
|
||||
const password = ref('');
|
||||
|
||||
const format = useStorage('pgp-key-pair-generator:format', 'curve25519');
|
||||
const formats = [
|
||||
'rsa',
|
||||
'curve25519',
|
||||
'ed25519',
|
||||
'p256', 'p384', 'p521',
|
||||
'brainpoolP256r1', 'brainpoolP384r1', 'brainpoolP512r1',
|
||||
'secp256k1',
|
||||
];
|
||||
const format = useStorage('pgp-key-pair-generator:format', isWindowSecureContext() ? 'curve25519' : 'p256');
|
||||
|
||||
const formats = isWindowSecureContext()
|
||||
? [
|
||||
'rsa',
|
||||
'curve25519',
|
||||
'curve448',
|
||||
'ed25519',
|
||||
'p256', 'p384', 'p521',
|
||||
'brainpoolP256r1', 'brainpoolP384r1', 'brainpoolP512r1',
|
||||
'secp256k1',
|
||||
]
|
||||
: [
|
||||
'p256', 'p384', 'p521',
|
||||
'brainpoolP256r1', 'brainpoolP384r1', 'brainpoolP512r1',
|
||||
'secp256k1',
|
||||
];
|
||||
|
||||
const { attrs: bitsValidationAttrs } = useValidation({
|
||||
source: bits,
|
||||
@@ -51,7 +66,7 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
||||
}
|
||||
|
||||
const { privateKey, publicKey, revocationCertificate } = await openpgp.generateKey({
|
||||
type: 'ecc', // Type of the key, defaults to ECC
|
||||
type: format.value === 'curve448' ? 'curve448' : 'ecc', // Type of the key, defaults to ECC
|
||||
curve: formatValue as openpgp.EllipticCurveName, // ECC curve name, defaults to curve25519
|
||||
userIDs: [{ name, email }], // you can pass multiple user IDs
|
||||
passphrase, // protects the private key
|
||||
@@ -69,6 +84,11 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
||||
<template>
|
||||
<div>
|
||||
<div mb-4>
|
||||
<c-alert v-if="!isWindowSecureContext()" mb-2>
|
||||
Your browser is not in <n-a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts" target="_blank">
|
||||
"Secure Context" (HTTPS)
|
||||
</n-a>. This tool may not work correctly and require HTTPS to work fully.
|
||||
</c-alert>
|
||||
<div style="flex: 0 0 100%">
|
||||
<div item-style="flex: 1 1 0" style="max-width: 600px" mx-auto flex gap-3>
|
||||
<c-select
|
||||
@@ -77,6 +97,7 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
||||
label="Format:"
|
||||
:options="formats"
|
||||
placeholder="Select a key format"
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
|
||||
<n-form-item v-if="format === 'rsa'" label="RSA Bits :" v-bind="bitsValidationAttrs as any" label-placement="left">
|
||||
|
||||
@@ -61,6 +61,23 @@ function ended() {
|
||||
if (status.value === 'running') {
|
||||
status.value = 'ended';
|
||||
}
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const fullScreenElement = ref<HTMLElement>();
|
||||
function toggleFullScreen() {
|
||||
const element = fullScreenElement.value;
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
if (!document.fullscreenElement) {
|
||||
element?.requestFullscreen();
|
||||
}
|
||||
else {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const isEnded = computed(() => status.value === 'ended');
|
||||
@@ -84,19 +101,18 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
|
||||
|
||||
<n-p align="center">
|
||||
Alarm at: {{ alarmAtDate }}
|
||||
</n-p>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
|
||||
<div>
|
||||
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 countdown-size="5rem" @time-elapsed="ended()" />
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="toggleFullScreen"
|
||||
>
|
||||
Toggle Fullscreen
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<n-modal v-model:show="isEnded" mask-closable="false">
|
||||
@@ -117,6 +133,19 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
</n-card>
|
||||
</n-modal>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<n-p align="center">
|
||||
Alarm at: {{ alarmAtDate }}
|
||||
</n-p>
|
||||
|
||||
<c-card v-if="history" title="History">
|
||||
<div flex justify-center gap-1>
|
||||
<template v-for="(entry, index) in history" :key="index">
|
||||
@@ -131,3 +160,12 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
<audio ref="audio" loop src="/Beep.mp3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#fullScreenElement:fullscreen {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@ import unicodeNames from '@unicode/unicode-15.1.0/Names/index.js';
|
||||
import unicodeCategories from '@unicode/unicode-15.1.0/General_Category';
|
||||
import utf8 from 'utf8';
|
||||
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
|
||||
function toPaddedHex(num: number) {
|
||||
@@ -12,10 +12,11 @@ function toPaddedHex(num: number) {
|
||||
|
||||
function toUTF8(codePoint: number) {
|
||||
const utf8String = utf8.encode(String.fromCodePoint(codePoint));
|
||||
return [...utf8String].map(c => `\\x${c.codePointAt(0)?.toString(16).toUpperCase()}`);
|
||||
const bytes = [...utf8String].map(c => `\\x${c.codePointAt(0)?.toString(16).toUpperCase()}`);
|
||||
return bytes.join(''); // Join the string array into a single string to fix a bug where it would otherwise join the array items with a comma
|
||||
}
|
||||
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const searchQuery = useDebouncedRef('', 250);
|
||||
const parsedSearchQuery = computed(() => {
|
||||
const parsedRegex = /^\s*(?:\&#x(?<hex1>[\da-f]+);|\&#(?<dec>\d+);|(?:U\+|\\u)?\s*(?<hex2>[\da-f]+))\s*$/gi; // NOSONAR
|
||||
const parsedQuery = parsedRegex.exec(searchQuery.value);
|
||||
@@ -39,18 +40,19 @@ const unicodeSearchData = [...unicodeNames].map(([codePoint, characterName]) =>
|
||||
};
|
||||
});
|
||||
|
||||
const limit = ref(100);
|
||||
const { searchResult } = useFuzzySearch({
|
||||
const limit = ref(40);
|
||||
// Using FlexSearch instead of FuzzySearch for better performance
|
||||
const { searchResult } = useFlexSearch({
|
||||
search: parsedSearchQuery,
|
||||
data: unicodeSearchData,
|
||||
options: {
|
||||
keys: ['characterName', 'hex'],
|
||||
threshold: 0.2,
|
||||
isCaseSensitive: false,
|
||||
minMatchCharLength: 3,
|
||||
useExtendedSearch: true,
|
||||
filterEmpty: false,
|
||||
cache: true,
|
||||
resolution: 9,
|
||||
optimize: true,
|
||||
},
|
||||
limit: limit.value,
|
||||
limit,
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -71,12 +73,7 @@ const { searchResult } = useFuzzySearch({
|
||||
</div>
|
||||
|
||||
<div v-if="searchQuery.trim().length > 0">
|
||||
<div
|
||||
v-if="searchResult.length === 0"
|
||||
mt-4
|
||||
text-20px
|
||||
font-bold
|
||||
>
|
||||
<div v-if="searchResult.length === 0" mt-4 text-20px font-bold>
|
||||
No results
|
||||
</div>
|
||||
|
||||
@@ -89,34 +86,37 @@ const { searchResult } = useFuzzySearch({
|
||||
<thead>
|
||||
<th>UCOD</th>
|
||||
<th>Display/UTF8</th>
|
||||
<th style="width:30%">
|
||||
<th style="width: 30%">
|
||||
Category
|
||||
</th>
|
||||
<th>Html</th>
|
||||
<th style="width:30%">
|
||||
<th style="width: 30%">
|
||||
Name
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(result, ix) in searchResult" :key="ix">
|
||||
<td>
|
||||
<input-copyable :value="`U+${toPaddedHex(result.codePoint)}`" mb-1 />
|
||||
<!-- //NOSONAR --><n-a :href="`https://unicodeplus.com/U+${toPaddedHex(result.codePoint)}`" target="_blank">
|
||||
<input-copyable :value="`U+${toPaddedHex(result.codePoint)}`" :readonly="true" mb-1 />
|
||||
<!-- //NOSONAR --><n-a
|
||||
:href="`https://unicodeplus.com/U+${toPaddedHex(result.codePoint)}`"
|
||||
target="_blank"
|
||||
>
|
||||
> More info
|
||||
</n-a>
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="String.fromCodePoint(result.codePoint)" mb-1 />
|
||||
<input-copyable :value="toUTF8(result.codePoint)" />
|
||||
<input-copyable :value="String.fromCodePoint(result.codePoint)" :readonly="true" mb-1 />
|
||||
<input-copyable :value="toUTF8(result.codePoint)" :readonly="true" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="unicodeCategories.get(result.codePoint)" />
|
||||
<input-copyable :value="unicodeCategories.get(result.codePoint)" :readonly="true" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="`\&\#x${toPaddedHex(result.codePoint)};`" mb-1 />
|
||||
<input-copyable :value="`\&\#${result.codePoint};`" />
|
||||
<input-copyable :value="`\&\#x${toPaddedHex(result.codePoint)};`" :readonly="true" mb-1 />
|
||||
<input-copyable :value="`\&\#${result.codePoint};`" :readonly="true" />
|
||||
</td>
|
||||
<td><input-copyable :value="result.characterName" /></td>
|
||||
<td><input-copyable :value="result.characterName" :readonly="true" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { FileText } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'VIM Cheatsheet',
|
||||
path: '/vim-memo',
|
||||
description: 'Vim text editor commands',
|
||||
keywords: ['vim', 'editor'],
|
||||
component: () => import('./vim-memo.vue'),
|
||||
icon: FileText,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -0,0 +1,722 @@
|
||||
```
|
||||
##############################################################################
|
||||
# VIM CHEATSHEET
|
||||
# WEBSITE: http://www.vim.org/
|
||||
# DOCUMENTATION: https://vim.sourceforge.io/docs.php
|
||||
##############################################################################
|
||||
|
||||
|
||||
##############################################################################
|
||||
# CURSOR MOVEMENTS
|
||||
##############################################################################
|
||||
|
||||
|
||||
h move left
|
||||
j move down
|
||||
k move up
|
||||
l move right
|
||||
w jump by start of words (punctuation considered words)
|
||||
W jump by words (spaces separate words)
|
||||
e jump to end of words (punctuation considered words)
|
||||
E jump to end of words (no punctuation)
|
||||
b jump backward by words (punctuation considered words)
|
||||
B jump backward by words (no punctuation)
|
||||
ge jump backward to end of a word
|
||||
gE jump backwards to the end of a word (words can contain punctuation)
|
||||
0 (zero) start of line
|
||||
^ first non-blank character of line
|
||||
$ jump to the end of the line
|
||||
g_ jump to the last non-blank character of the line
|
||||
- move line upwards, on the first non-blank character
|
||||
+ move line downwards, on the first non-blank character
|
||||
<enter> move line downwards, on the first non-blank character
|
||||
gg go to first line
|
||||
G go to last line
|
||||
ngg go to line n
|
||||
nG go To line n
|
||||
:n go To line n
|
||||
) move the cursor forward to the next sentence.
|
||||
( move the cursor backward by a sentence.
|
||||
{ move the cursor a paragraph backwards
|
||||
} move the cursor a paragraph forwards
|
||||
]] move the cursor a section forwards or to the next {
|
||||
[[ move the cursor a section backwards or the previous {
|
||||
H move the cursor to the top of the screen.
|
||||
M move the cursor to the middle of the screen.
|
||||
L move the cursor to the bottom of the screen.
|
||||
fx search line forward for 'x'
|
||||
Fx search line backward for 'x'
|
||||
tx search line forward before 'x'
|
||||
Tx search line backward before 'x'
|
||||
CTRL-y moves screen up one line
|
||||
CTRL-e moves screen down one line
|
||||
CTRL-u moves cursor & screen up ½ page
|
||||
CTRL-d moves cursor & screen down ½ page
|
||||
CTRL-b moves screen up one page, cursor to last line
|
||||
CTRL-f moves screen down one page, cursor to first line
|
||||
zz shift current line to middle of screen
|
||||
z. same as zz but also jumps to the first non-black character
|
||||
zt shift current line to top of screen
|
||||
zb shift current line to bottom of screen
|
||||
|
||||
|
||||
##############################################################################
|
||||
# BOOKMARKS
|
||||
##############################################################################
|
||||
|
||||
|
||||
:marks list all the current marks
|
||||
ma make a bookmark named a at the current cursor position
|
||||
`a go to position of bookmark a
|
||||
'a go to the line with bookmark a
|
||||
`0 go to the position where Vim was previously exited
|
||||
`" go to the position when last editing this file
|
||||
`. go to the line that you last edited
|
||||
`` go to the position before the last jump
|
||||
g, go to newer position in change list
|
||||
g; go to older position in change list
|
||||
|
||||
# Tip: To jump to a mark you can either use a backtick (`) or an apostrophe (').
|
||||
# Using an apostrophe jumps to the beginning (first non-blank) of the line holding the mark.
|
||||
|
||||
##############################################################################
|
||||
# INSERT MODE
|
||||
##############################################################################
|
||||
|
||||
|
||||
i start insert mode at cursor
|
||||
I insert at the beginning of the line
|
||||
gi return to insert mode where you inserted text the last time
|
||||
gI like "I", but always start in column 1
|
||||
a append after the cursor
|
||||
A append at the end of the line
|
||||
o open (append) blank line below current line
|
||||
O open blank line above current line
|
||||
CTRL-o Temporarily enter normal mode to issue one normal-mode command(while in insert mode)
|
||||
Esc exit insert mode
|
||||
|
||||
|
||||
##############################################################################
|
||||
# EDITING
|
||||
##############################################################################
|
||||
|
||||
|
||||
r replace a single character (does not use insert mode)
|
||||
R enter Insert mode, replacing characters rather than inserting
|
||||
J join line below to the current one with one space in between
|
||||
gJ join line below to the current one without space in between
|
||||
cc change (replace) an entire line
|
||||
cw change (replace) to the end of word (same as ce)
|
||||
2cw change (replace) repeat cw twice
|
||||
ciw change (replace) word under the cursor
|
||||
caw change (replace) word under the cursor and the space after or before it
|
||||
ci" change (replace) word inside ""
|
||||
cit change (replace) html tag content
|
||||
cat change (replace) html tag
|
||||
cis change (replace) sentence under the cursor
|
||||
cas change (replace) sentence under the cursor and the space after or before it
|
||||
cib change (replace) inside a block with ()
|
||||
cab change (replace) a block with ()
|
||||
ciB change (replace) inside a block with {}
|
||||
caB change (replace) a block with {}
|
||||
C change (replace) to the end of line(same as c$)
|
||||
cG change (replace) to the end of the file
|
||||
cgg change (replace) from first line to current line
|
||||
ct' change (replace) until the ' character (can change ' for any character)
|
||||
s delete character at cursor and substitute text
|
||||
S delete line at cursor and substitute text (same as cc)
|
||||
xp transpose two letters (delete and paste, technically)
|
||||
u undo
|
||||
CTRL-r redo
|
||||
. repeat last command
|
||||
~ switch case
|
||||
g~iw switch case of current word
|
||||
gUiw make current word uppercase
|
||||
guiw make current word lowercase
|
||||
gU$ make uppercase until end of line
|
||||
gu$ make lowercase until end of line
|
||||
>> indent line one column to right
|
||||
>i{ indent everything in the {}
|
||||
<< indent line one column to left
|
||||
== auto-indent current line
|
||||
ddp swap current line with next
|
||||
ddkP swap current line with previous
|
||||
:%retab fix spaces / tabs issues in whole file
|
||||
:r [name] insert the file [name] below the cursor.
|
||||
:r !{cmd} execute {cmd} and insert its standard output below the cursor.
|
||||
|
||||
# Tip: Instead of b or B one can also use ( or { respectively.
|
||||
|
||||
##############################################################################
|
||||
# DELETING TEXT
|
||||
##############################################################################
|
||||
|
||||
|
||||
x delete current character
|
||||
X delete previous character
|
||||
dw delete (cut) to the end of word (same as de)
|
||||
diw delete (cut) word under the cursor
|
||||
daw delete (cut) word under the cursor and the space after or before it
|
||||
dap delete (cut) a paragraph
|
||||
dd delete (cut) a line
|
||||
dt' delete (cut) until the next ' character on the line (replace ' by any character)
|
||||
dG delete (cut) to the end of the file
|
||||
dgg delete (cut) from first line to current line
|
||||
D delete (cut) from cursor to end of line (same as d$)
|
||||
:[range]d delete [range] lines
|
||||
|
||||
|
||||
##############################################################################
|
||||
# COPYING AND MOVING TEXT
|
||||
##############################################################################
|
||||
|
||||
|
||||
yw yank word
|
||||
yy yank (copy) a line
|
||||
2yy yank 2 lines
|
||||
y$ yank to end of line
|
||||
p put (paste) the clipboard after cursor/current line
|
||||
P put (paste) before cursor/current line
|
||||
gp put (paste) the clipboard after cursor and leave cursor after the new text
|
||||
gP put (paste) before cursor and leave cursor after the new text
|
||||
"+y yank into the system clipboard register
|
||||
"+p paste from the system clipboard register
|
||||
:set paste avoid unexpected effects in pasting
|
||||
:registers display the contents of all registers
|
||||
"xyw yank word into register x
|
||||
"xyy yank line into register x
|
||||
:[range]y x yank [range] lines into register x
|
||||
"xp put the text from register x after the cursor
|
||||
"xP put the text from register x before the cursor
|
||||
"xgp just like "p", but leave the cursor just after the new text
|
||||
"xgP just like "P", but leave the cursor just after the new text
|
||||
:[line]put x put the text from register x after [line]
|
||||
|
||||
# Tip: if you are using vim extension on vs code, you can enable
|
||||
"vim.useSystemClipboard": true
|
||||
in setting.json, this will allow to Use system clipboard for unnamed register.
|
||||
|
||||
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MACROS
|
||||
##############################################################################
|
||||
|
||||
|
||||
qa start recording macro 'a'
|
||||
q end recording macro
|
||||
@a replay macro 'a'
|
||||
@: replay last command
|
||||
@@ repeat macro
|
||||
|
||||
|
||||
##############################################################################
|
||||
# VISUAL MODE
|
||||
##############################################################################
|
||||
|
||||
|
||||
v start visual mode, mark lines, then do command (such as y-yank)
|
||||
V start linewise visual mode
|
||||
o move to other end of marked area
|
||||
U upper case of marked area
|
||||
CTRL-v start visual block mode
|
||||
O move to other corner of block
|
||||
aw mark a word
|
||||
ab a () block (with braces)
|
||||
aB a {} block (with brackets)
|
||||
at a block with <> tags
|
||||
ib inner () block
|
||||
iB inner {} block
|
||||
it inner <> block
|
||||
Esc exit visual mode
|
||||
|
||||
VISUAL MODE COMMANDS
|
||||
--------------------
|
||||
|
||||
> shift right
|
||||
< shift left
|
||||
c change (replace) marked text
|
||||
y yank (copy) marked text
|
||||
d delete marked text
|
||||
~ switch case
|
||||
|
||||
VISUAL MODE SHORTCUTS
|
||||
---------------------
|
||||
|
||||
v% selects matching parenthesis
|
||||
vi{ selects matching curly brace
|
||||
vi" selects text between double quotes
|
||||
vi' selects text between single quotes
|
||||
gv reselect the last selected area
|
||||
|
||||
##############################################################################
|
||||
# SPELLING
|
||||
##############################################################################
|
||||
|
||||
|
||||
]s next misspelled word
|
||||
[s previous misspelled word
|
||||
zg add word to wordlist
|
||||
zug undo last add word
|
||||
z= suggest word
|
||||
|
||||
|
||||
##############################################################################
|
||||
# EXITING
|
||||
##############################################################################
|
||||
|
||||
|
||||
:q quit Vim. This fails when changes have been made.
|
||||
:q! quit without writing.
|
||||
:cq quit always, without writing.
|
||||
:w save without exiting.
|
||||
:wq write the current file and exit.
|
||||
:wq! write the current file and exit always.
|
||||
:wq {file} write to {file}. Exit if not editing the last
|
||||
:wq! {file} write to {file} and exit always.
|
||||
:[range]wq[!] same as above, but only write the lines in [range].
|
||||
ZZ write current file, if modified, and exit.
|
||||
ZQ quit current file and exit (same as ":q!").
|
||||
|
||||
|
||||
##############################################################################
|
||||
# SEARCH/REPLACE
|
||||
##############################################################################
|
||||
|
||||
|
||||
/pattern search for pattern
|
||||
?pattern search backward for pattern
|
||||
n repeat search in same direction
|
||||
N repeat search in opposite direction
|
||||
* search forward, word under cursor
|
||||
# search backward, word under cursor
|
||||
set ic ignore case: turn on
|
||||
set noic ignore case: turn off
|
||||
:%s/old/new/g replace all old with new throughout file
|
||||
:%s/old/new/gc replace all old with new throughout file with confirmation
|
||||
:argdo %s/old/new/gc | wq open multiple files and run this command to replace old
|
||||
with new in every file with confirmation, save and quit
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MULTIPLE FILES
|
||||
##############################################################################
|
||||
|
||||
|
||||
:e filename edit a file in a new buffer
|
||||
:tabe filename edit a file in a new tab (Vim7, gVim)
|
||||
:ls list all buffers
|
||||
:bn go to next buffer
|
||||
:bp go to previous buffer
|
||||
:bd delete a buffer (close a file)
|
||||
:b1 show buffer 1
|
||||
:b vimrc show buffer whose filename begins with "vimrc"
|
||||
:bufdo <command> run 'command(s)' in all buffers
|
||||
:[range]bufdo <command> run 'command(s)' for buffers in 'range'
|
||||
|
||||
|
||||
##############################################################################
|
||||
# WINDOWS
|
||||
##############################################################################
|
||||
|
||||
|
||||
:sp f split open f
|
||||
:vsp f vsplit open f
|
||||
CTRL-w s split windows
|
||||
CTRL-w w switch between windows
|
||||
CTRL-w q quit a window
|
||||
CTRL-w v split windows vertically
|
||||
CTRL-w x swap windows
|
||||
CTRL-w h left window
|
||||
CTRL-w j down window
|
||||
CTRL-w k up window
|
||||
CTRL-w l right window
|
||||
CTRL-w + increase window height
|
||||
CTRL-w - decrease window height
|
||||
CTRL-w < increase window width
|
||||
CTRL-w > decrease window width
|
||||
CTRL-w = equal window
|
||||
CTRL-w o close other windows
|
||||
|
||||
|
||||
##############################################################################
|
||||
# QUICKFIX WINDOW
|
||||
##############################################################################
|
||||
|
||||
|
||||
copen open quickfix window
|
||||
cclose close quickfix window
|
||||
cc [nr] display error [nr]
|
||||
cfirst display the first error
|
||||
clast display the last error
|
||||
[count]cn display [count] next error
|
||||
[count]cp display [count] previous error
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PROGRAMMING
|
||||
##############################################################################
|
||||
|
||||
|
||||
% show matching brace, bracket, or parenthese
|
||||
gf edit the file whose name is under the cursor
|
||||
gF edit the file whose name is under the cursor and jump to the line number
|
||||
gd when the cursor is on a local variable or function, jump to its declaration
|
||||
'' return to the line where the cursor was before the latest jump
|
||||
CTRL-o move to previous position you were at
|
||||
CTRL-i move to more recent position you were at
|
||||
:set nu display numbers (short for :set number)
|
||||
:set nonu hide numbers (short for :set nonumber)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > ACK
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Ack Search recursively in directory
|
||||
o to open (same as enter)
|
||||
go to preview file (open but maintain focus on ack.vim results)
|
||||
t to open in new tab
|
||||
T to open in new tab silently
|
||||
q to close the quickfix window
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > CHEAT
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Cheat open cheat sheet (with autocomplete)
|
||||
<leader>ch open cheat sheet for word under the cursor
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > GIST
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Gist post whole text to gist
|
||||
:Gist XXXXX get gist XXXXX
|
||||
:Gist -l list my gists
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > GUNDO
|
||||
##############################################################################
|
||||
|
||||
|
||||
:GundoToggle show undo tree
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > LUSTYJUGGLER
|
||||
##############################################################################
|
||||
|
||||
|
||||
<Leader>lj show open buffers
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > NERDCOMMENTER
|
||||
##############################################################################
|
||||
|
||||
|
||||
<leader>cc comment out line(s)
|
||||
<leader>c<space> toggle the comment state of the selected line(s)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > NERDTREE
|
||||
##############################################################################
|
||||
|
||||
|
||||
:NERDTreeToggle show / hide file browser
|
||||
:NERDTreeFind show current file in file browser
|
||||
:Bookmark name bookmark the current node as "name"
|
||||
|
||||
FILE
|
||||
----
|
||||
|
||||
o open in prev window
|
||||
go preview
|
||||
t open in new tab
|
||||
T open in new tab silently
|
||||
i open split
|
||||
gi preview split
|
||||
s open vsplit
|
||||
gs preview vsplit
|
||||
|
||||
DIRECTORY
|
||||
---------
|
||||
|
||||
o open & close node
|
||||
O recursively open node
|
||||
x close parent of node
|
||||
X close all child nodes of current node recursively
|
||||
e explore selected dir
|
||||
|
||||
BOOKMARK
|
||||
--------
|
||||
|
||||
o open bookmark
|
||||
t open in new tab
|
||||
T open in new tab silently
|
||||
D delete bookmark
|
||||
|
||||
TREE NAVIGATION
|
||||
---------------
|
||||
|
||||
P go to root
|
||||
p go to parent
|
||||
K go to first child
|
||||
J go to last child
|
||||
CTRL-j go to next sibling
|
||||
CTRL-k go to prev sibling
|
||||
|
||||
FILESYSTEM
|
||||
----------
|
||||
|
||||
C change tree root to the selected dir
|
||||
u move tree root up a dir
|
||||
U move tree root up a dir but leave old root open
|
||||
r refresh cursor dir
|
||||
R refresh current root
|
||||
m show menu
|
||||
cd change the CWD to the selected dir
|
||||
|
||||
TREE FILTERING
|
||||
--------------
|
||||
|
||||
I hidden files
|
||||
f file filters
|
||||
F files
|
||||
B bookmarks
|
||||
|
||||
OTHER
|
||||
-----
|
||||
|
||||
q close the NERDTree window
|
||||
A zoom (maximize-minimize) the NERDTree window
|
||||
? toggle help
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > PDV
|
||||
##############################################################################
|
||||
|
||||
|
||||
CTRL-P generate PHP DOC
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > PICKACOLOR
|
||||
##############################################################################
|
||||
|
||||
|
||||
:PickHEX choose color in system color picker
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > SNIPMATE
|
||||
##############################################################################
|
||||
|
||||
|
||||
<tab> expand snippet
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > SPARKUP
|
||||
##############################################################################
|
||||
|
||||
|
||||
CTRL-e execute sparkup (zen coding expansion)
|
||||
CTRL-n jump to the next empty tag / attribute
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > SURROUND
|
||||
##############################################################################
|
||||
|
||||
|
||||
cs'" change surrounding quotes to double-quotes
|
||||
cs(} change surrounding parens to braces
|
||||
cs({ change surrounding parens to braces with space
|
||||
ds' delete surrounding quotes
|
||||
dst delete surrounding tags
|
||||
ysiw[ surround inner word with brackets
|
||||
vees' surround 2 words (ee) with quotes '
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > TABULAR
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Tabularize /, line the selected lines up on the commas
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > TAGLIST
|
||||
##############################################################################
|
||||
|
||||
|
||||
:TlistToggle open / close taglist window
|
||||
<enter> jump to tag or file
|
||||
<space> display the tag prototype
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > UNIMPAIRED
|
||||
##############################################################################
|
||||
|
||||
|
||||
[space new line above
|
||||
]space new line below
|
||||
[e exchange line above
|
||||
]e exchange line below
|
||||
[x XML encode
|
||||
]x XML decode (with htmlentities)
|
||||
[q jump to previous quickfix item
|
||||
]q jump to next quickfix item
|
||||
[Q jump to first quickfix item
|
||||
]Q jump to last quickfix item
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > VIM-FUGITIVE
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Git run a git command
|
||||
:Gstatus git status : - to (un)stage , p to patch, C to commit
|
||||
:Gcommit git commit
|
||||
:Gread empty the buffer and revert to the last commit
|
||||
:Gwrite write the current file and stage the results
|
||||
:Gmove git mv
|
||||
:Gremove git rm
|
||||
:Glog git log
|
||||
:Gdiff perform a vimdiff against the current file of a certain revision
|
||||
:Gblame open blame information in a scroll bound vertical splitt
|
||||
:Gbrowse open github
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > VIM-MARKDOWN-PREVIEW
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Mm preview markdown document in webbrowser
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > VIM-PEEPOPEN
|
||||
##############################################################################
|
||||
|
||||
|
||||
<Leader>p open the current directory with the peepopen application (fuzzy search)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > VIM-SYMFONY
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Sview open template file
|
||||
:Saction open action file
|
||||
:Smodel open model file
|
||||
:Sfilter open filter file
|
||||
:Sform open form file
|
||||
:Spartial open partial file / write selected content in partial + include
|
||||
:Scomponent open component file / write selected content in component + include
|
||||
:Salternate open alternate model file (class - table class)
|
||||
:Symfony execute task
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PERSONAL .VIMRC
|
||||
##############################################################################
|
||||
|
||||
|
||||
<leader>ev edit vimrc file
|
||||
<leader>sv reload vimrc file
|
||||
<leader>sh show syntax highlighting groups for word under cursor
|
||||
|
||||
<space> page down
|
||||
jj exit insertion mode
|
||||
<leader>q close the current window
|
||||
|
||||
<leader>/ clear the search register
|
||||
|
||||
<leader>h toggle hidden characters
|
||||
|
||||
<leader>W strip all trailing whitespace
|
||||
|
||||
CTRL-h go to left window
|
||||
CTRL-j go to down window
|
||||
CTRL-k go to top window
|
||||
CTRL-l go to right window
|
||||
<leader>w open vertical split window and activate
|
||||
|
||||
%% will expand to current directory
|
||||
<leader>ew open file from current directory
|
||||
<leader>es open file in split window from current directory
|
||||
<leader>cd change directory to parent dir of current file
|
||||
## will expand to webroot
|
||||
|
||||
:Wrap wrap text
|
||||
<F2> toggle wrapped text
|
||||
|
||||
<F3> toggle spell check
|
||||
|
||||
<F4> toggle light/dark background
|
||||
|
||||
<F5> underline with dashes
|
||||
<F6> underline with double lines
|
||||
|
||||
<leader><up> bubble line(s) up
|
||||
<leader><down> bublle line(s) down
|
||||
|
||||
:Ltag load tags file
|
||||
:Project cd to project and load tags file
|
||||
<leader>t show current tag for word under cursor
|
||||
<leader>st show current tag for word under cursor in split window
|
||||
<leader>tj show current tag list for word under cursor
|
||||
<leader>stj show current tag list for word under cursor in split window
|
||||
|
||||
CTRL-<space> show omnicomplete menu
|
||||
|
||||
<leader>b surround with strong tags
|
||||
<leader>i surround with em tags
|
||||
|
||||
CTRL-p generate PHP DOC
|
||||
|
||||
<leader>a run Ack
|
||||
|
||||
<leader>md preview markdown
|
||||
|
||||
<leader>s preview in safari
|
||||
|
||||
<leader>x colorpicker
|
||||
|
||||
<leader>n toggle Nerdtree
|
||||
<leader>N close Nerdtree
|
||||
<leader>f find current file in Nerdtree
|
||||
|
||||
<leader>l toggle Taglist
|
||||
<leader>L close Taglist
|
||||
|
||||
<leader>ph set filetype to php.html
|
||||
<leader>r reload all snipmate snippets
|
||||
|
||||
CTRL-<tab> switch between buffers
|
||||
|
||||
CTRL-y go to next tag of attribute in sparkup plugin
|
||||
|
||||
<leader>g toggle Gundo window
|
||||
|
||||
IMG<CR> show image browser to insert image tag with src, width and height
|
||||
b insert image tag with dimensions from NERDTree
|
||||
(http://stackoverflow.com/questions/5707925/vim-image-placement)
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './vim-memo.content.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -33,16 +33,21 @@ function toBase64(file: File) {
|
||||
|
||||
const fileInput = ref<HTMLInputElement | null>(null);
|
||||
const imgPreview = ref<HTMLImageElement | null>(null);
|
||||
async function handlePreview(image: File) {
|
||||
if (imgPreview.value) {
|
||||
imgPreview.value.src = await toBase64(image);
|
||||
}
|
||||
}
|
||||
function clearPreview() {
|
||||
if (imgPreview.value) {
|
||||
imgPreview.value.src = '';
|
||||
}
|
||||
}
|
||||
async function handlePreview(image: File) {
|
||||
if (imgPreview.value) {
|
||||
if (image.type?.includes('image/')) {
|
||||
imgPreview.value.src = await toBase64(image);
|
||||
}
|
||||
else {
|
||||
clearPreview();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function triggerFileInput() {
|
||||
fileInput.value?.click();
|
||||
|
||||
@@ -62,6 +62,7 @@ const props = withDefaults(
|
||||
pasteHtml: false,
|
||||
},
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value']);
|
||||
const value = useVModel(props, 'value', emit);
|
||||
const showPassword = ref(false);
|
||||
@@ -277,6 +278,7 @@ defineExpose({
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.input-wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -300,8 +302,27 @@ defineExpose({
|
||||
overflow-wrap: break-word;
|
||||
border: none;
|
||||
outline: none;
|
||||
font-family: inherit;
|
||||
/* This font family structure will let the text use one of the fonts that are available on the system.
|
||||
When an emoji is used, it will fall back to the first font that has proper support for it. ('Noto Color Emoji' and below).
|
||||
Thus this structure will make sure that text and emojis are rendered correctly without interfering with each other.
|
||||
*/
|
||||
font-family:
|
||||
system-ui, /* System default */
|
||||
-apple-system, /* Apple system font */
|
||||
'Segoe UI', /* Windows */
|
||||
'Roboto', /* Android */
|
||||
'Helvetica Neue', /* macOS fallback */
|
||||
Arial, /* Universal fallback */
|
||||
'Noto Color Emoji', /* Best flag and complex emoji support */
|
||||
'Apple Color Emoji', /* Apple devices emoji */
|
||||
'Segoe UI Emoji', /* Windows emoji */
|
||||
'Twemoji Mozilla', /* Firefox emoji fallback */
|
||||
'EmojiOne Color', /* Additional emoji fallback */
|
||||
sans-serif;
|
||||
font-size: inherit;
|
||||
font-feature-settings: 'liga' off;
|
||||
text-rendering: optimizeQuality;
|
||||
line-height: 1.2;
|
||||
color: v-bind('appTheme.text.baseColor');
|
||||
|
||||
&::placeholder {
|
||||
@@ -322,6 +343,26 @@ defineExpose({
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
/* This font family structure will let the text use one of the fonts that are available on the system.
|
||||
When an emoji is used, it will fall back to the first font that has proper support for it. ('Noto Color Emoji' and below).
|
||||
Thus this structure will make sure that text and emojis are rendered correctly without interfering with each other.
|
||||
*/
|
||||
font-family:
|
||||
system-ui, /* System default */
|
||||
-apple-system, /* Apple system font */
|
||||
'Segoe UI', /* Windows */
|
||||
'Roboto', /* Android */
|
||||
'Helvetica Neue', /* macOS fallback */
|
||||
Arial, /* Universal fallback */
|
||||
'Noto Color Emoji', /* Best flag and complex emoji support */
|
||||
'Apple Color Emoji', /* Apple devices emoji */
|
||||
'Segoe UI Emoji', /* Windows emoji */
|
||||
'Twemoji Mozilla', /* Firefox emoji fallback */
|
||||
'EmojiOne Color', /* Additional emoji fallback */
|
||||
sans-serif;
|
||||
font-feature-settings: 'liga' off;
|
||||
text-rendering: optimizeQuality;
|
||||
line-height: 1.2;
|
||||
color: v-bind('appTheme.text.baseColor');
|
||||
|
||||
&::placeholder {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import * as monacoEditor from 'monaco-editor';
|
||||
import { VueMonacoEditor, loader } from '@guolao/vue-monaco-editor';
|
||||
import type { MonacoEditor } from '@guolao/vue-monaco-editor';
|
||||
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
||||
import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
||||
@@ -53,6 +54,9 @@ globalThis.MonacoEnvironment = {
|
||||
},
|
||||
};
|
||||
|
||||
// loaded monaco-editor from `node_modules`
|
||||
loader.config({ monaco: monacoEditor });
|
||||
|
||||
export interface EditorProps {
|
||||
defaultValue?: string
|
||||
defaultPath?: string
|
||||
@@ -113,7 +117,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<vue-monaco-editor
|
||||
<VueMonacoEditor
|
||||
v-bind="inheritedAttrs"
|
||||
v-model:value="value"
|
||||
@before-mount="(monaco: MonacoEditor) => emits('beforeMount', monaco)"
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { CLabelProps } from '../c-label/c-label.types';
|
||||
import type { CSelectOption } from './c-select.types';
|
||||
import { useTheme } from './c-select.theme';
|
||||
import { clamp } from '@/modules/shared/number.models';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -74,13 +74,12 @@ watch(
|
||||
},
|
||||
);
|
||||
|
||||
const { searchResult: filteredOptions } = useFuzzySearch<CSelectOption<T>>({
|
||||
const { searchResult: filteredOptions } = useFlexSearch<CSelectOption<T>>({
|
||||
search: searchQuery,
|
||||
data: options.value,
|
||||
options: {
|
||||
keys: ['label'],
|
||||
shouldSort: false,
|
||||
threshold: 0.3,
|
||||
filterEmpty: false,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2,6 +2,8 @@ const random = () => Math.random();
|
||||
|
||||
const randFromArray = (array: unknown[]) => array[Math.floor(random() * array.length)];
|
||||
|
||||
const multiRandFromArray = (array: unknown[], length: number) => Array.from({ length }, () => array[Math.floor(random() * array.length)]);
|
||||
|
||||
const randIntFromInterval = (min: number, max: number) => Math.floor(random() * (max - min) + min);
|
||||
|
||||
// Durstenfeld shuffle
|
||||
@@ -22,6 +24,7 @@ const generateRandomId = () => `id-${random().toString(36).substring(2, 12)}`;
|
||||
|
||||
export {
|
||||
randFromArray,
|
||||
multiRandFromArray,
|
||||
randIntFromInterval,
|
||||
random,
|
||||
shuffleArray,
|
||||
|
||||
+25
-18
@@ -2,6 +2,7 @@ import { URL, fileURLToPath } from 'node:url';
|
||||
import { resolve } from 'node:path';
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
import wasm from 'vite-plugin-wasm';
|
||||
import { splashScreen } from 'vite-plugin-splash-screen';
|
||||
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
@@ -105,6 +106,10 @@ export default defineConfig({
|
||||
Unocss(),
|
||||
nodePolyfills(),
|
||||
wasm(),
|
||||
splashScreen({
|
||||
logoSrc: 'logo.svg',
|
||||
splashBg: '#292929',
|
||||
}),
|
||||
],
|
||||
base: baseUrl,
|
||||
resolve: {
|
||||
@@ -116,6 +121,8 @@ export default defineConfig({
|
||||
'@babel/core': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
'isolated-vm': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
'onnxruntime-node': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
'unpdf/pdfjs': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
'webcrypto-liner-shim': !process.env.VERCEL ? 'webcrypto-liner-shim' : fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
},
|
||||
},
|
||||
define: {
|
||||
@@ -126,35 +133,35 @@ export default defineConfig({
|
||||
},
|
||||
build: {
|
||||
target: 'esnext',
|
||||
// sourcemap: false,
|
||||
// sourcemap: !process.env.VERCEL,
|
||||
minify: !process.env.VERCEL,
|
||||
reportCompressedSize: !process.env.VERCEL,
|
||||
// cssMinify: false,
|
||||
modulePreload: false,
|
||||
// modulePreload: false,
|
||||
rollupOptions: {
|
||||
external: ['regex', './out/isolated_vm', 'isolated-vm', 'onnxruntime-node'],
|
||||
external: ['regex', './out/isolated_vm', 'isolated-vm', 'onnxruntime-node', 'unpdf/pdfjs'],
|
||||
output: {
|
||||
format: 'es',
|
||||
manualChunks: (id) => {
|
||||
if (id.includes('monaco-editor')) return 'monaco-editor';
|
||||
if (id.includes('tesseract.js')) return 'tesseract.js';
|
||||
if (id.includes('pdfjs')) return 'pdfjs';
|
||||
if (id.includes('unicode')) return 'unicode';
|
||||
// if (id.includes('transformers')) return 'transformers';
|
||||
// if (id.includes("node_modules")) {
|
||||
// return "vendor";
|
||||
// }
|
||||
},
|
||||
sourcemapIgnoreList: (relativeSourcePath) => {
|
||||
const normalizedPath = path.normalize(relativeSourcePath);
|
||||
return normalizedPath.includes("node_modules");
|
||||
},
|
||||
// manualChunks: (id) => {
|
||||
// // if (id.includes('monaco-editor')) return 'monaco-editor';
|
||||
// if (id.includes('tesseract.js')) return 'tesseract.js';
|
||||
// if (id.includes('pdfjs')) return 'pdfjs';
|
||||
// if (id.includes('unicode')) return 'unicode';
|
||||
// // if (id.includes('transformers')) return 'transformers';
|
||||
// // if (id.includes("node_modules")) {
|
||||
// // return "vendor";
|
||||
// // }
|
||||
// },
|
||||
// sourcemapIgnoreList: (relativeSourcePath) => {
|
||||
// const normalizedPath = path.normalize(relativeSourcePath);
|
||||
// return normalizedPath.includes("node_modules");
|
||||
// },
|
||||
},
|
||||
cache: false,
|
||||
},
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['isolated-vm', 'pdfjs-dist', 'onnxruntime-node'], // optionally specify dependency name
|
||||
include: ['isolated-vm', 'pdfjs-dist', 'onnxruntime-node', 'unpdf', 'unpdf/pdfjs', ...(process.env.VERCEL ? ['webcrypto-liner-shim'] : [])], // optionally specify dependency name
|
||||
esbuildOptions: {
|
||||
supported: {
|
||||
'top-level-await': true,
|
||||
|
||||
Reference in new issue
Block a user