diff --git a/CHANGELOG.md b/CHANGELOG.md index e08eb85..9720b13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.0.1] - 2022-07-19 +## [2.0.2] - 2022-07-20 ### Added +- Toasts for events. - E2E Tests. - Make backend more configurable diff --git a/frontend/locales/de.json b/frontend/locales/de.json index a59f9fd..051e275 100644 --- a/frontend/locales/de.json +++ b/frontend/locales/de.json @@ -11,6 +11,7 @@ "max": "max", "share_link": "Link teilen", "copy_clipboard": "in die Zwischenablage kopieren", + "copied_to_clipboard": "in die Zwischenablage kopiert", "encrypting": "verschlüsseln", "decrypting": "entschlüsselt", "uploading": "hochladen", @@ -27,7 +28,9 @@ "max": "max: {n}", "empty_content": "Notiz ist leer." }, - "copied_to_clipboard": "in die Zwischenablage kopiert 🔗" + "messages": { + "note_created": "notiz erstellt." + } }, "show": { "errors": { diff --git a/frontend/locales/en.json b/frontend/locales/en.json index 534530e..4e3ef5a 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -11,6 +11,7 @@ "max": "max", "share_link": "share link", "copy_clipboard": "copy to clipboard", + "copied_to_clipboard": "copied to clipboard", "encrypting": "encrypting", "decrypting": "decrypting", "uploading": "uploading", @@ -27,7 +28,9 @@ "max": "max: {n}", "empty_content": "note is empty." }, - "copied_to_clipboard": "copied to clipboard 🔗" + "messages": { + "note_created": "note created." + } }, "show": { "errors": { diff --git a/frontend/locales/es.json b/frontend/locales/es.json index b354ce0..f94d4fa 100644 --- a/frontend/locales/es.json +++ b/frontend/locales/es.json @@ -11,6 +11,7 @@ "max": "max", "share_link": "compartir enlace", "copy_clipboard": "copiar al portapapeles", + "copied_to_clipboard": "copiado al portapapeles", "encrypting": "encriptando", "decrypting": "descifrando", "uploading": "cargando", @@ -27,7 +28,9 @@ "max": "max: {n}", "empty_content": "la nota está vacía." }, - "copied_to_clipboard": "copiado al portapapeles 🔗" + "messages": { + "note_created": "nota creada." + } }, "show": { "errors": { diff --git a/frontend/locales/fr.json b/frontend/locales/fr.json index 770b4c5..125bd21 100644 --- a/frontend/locales/fr.json +++ b/frontend/locales/fr.json @@ -11,6 +11,7 @@ "max": "max", "share_link": "partager le lien", "copy_clipboard": "copier dans le presse-papiers", + "copied_to_clipboard": "copié dans le presse-papiers", "encrypting": "cryptage", "decrypting": "déchiffrer", "uploading": "téléchargement", @@ -27,7 +28,9 @@ "max": "max: {n}", "empty_content": "La note est vide." }, - "copied_to_clipboard": "copié dans le presse-papiers 🔗" + "messages": { + "note_created": "note créée." + } }, "show": { "errors": { diff --git a/frontend/locales/it.json b/frontend/locales/it.json index c87956c..070142e 100644 --- a/frontend/locales/it.json +++ b/frontend/locales/it.json @@ -11,6 +11,7 @@ "max": "max", "share_link": "condividi link", "copy_clipboard": "copia negli appunti", + "copied_to_clipboard": "copiato negli appunti", "encrypting": "criptando", "decrypting": "decifrando", "uploading": "caricamento", @@ -27,7 +28,9 @@ "max": "max: {n}", "empty_content": "la nota è vuota." }, - "copied_to_clipboard": "copiato negli appunti 🔗" + "messages": { + "note_created": "nota creata." + } }, "show": { "errors": { diff --git a/frontend/locales/zh_CN.json b/frontend/locales/zh_CN.json index 08e2c8e..fdfeb71 100644 --- a/frontend/locales/zh_CN.json +++ b/frontend/locales/zh_CN.json @@ -11,6 +11,7 @@ "max": "最大值", "share_link": "分享链接", "copy_clipboard": "复制到剪切版", + "copied_to_clipboard": "已复制到剪切板", "encrypting": "加密", "decrypting": "解密", "uploading": "上传", @@ -27,7 +28,9 @@ "max": "最大文件大小: {n}", "empty_content": "密信为空!" }, - "copied_to_clipboard": "已复制到剪切板 🔗" + "messages": { + "note_created": "注释创建。" + } }, "show": { "errors": { diff --git a/frontend/package.json b/frontend/package.json index 7ff4842..f0b7e7b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,10 +11,11 @@ "type": "module", "devDependencies": { "@lokalise/node-api": "^7.3.1", - "@sveltejs/adapter-static": "^1.0.0-next.37", - "@sveltejs/kit": "^1.0.0-next.377", + "@sveltejs/adapter-static": "^1.0.0-next.38", + "@sveltejs/kit": "^1.0.0-next.384", "@types/dompurify": "^2.3.3", "@types/file-saver": "^2.0.5", + "@zerodevx/svelte-toast": "^0.7.2", "adm-zip": "^0.5.9", "dotenv": "^16.0.1", "svelte": "^3.49.0", @@ -23,12 +24,12 @@ "svelte-preprocess": "^4.10.7", "tslib": "^2.4.0", "typescript": "^4.7.4", - "vite": "^3.0.1" + "vite": "^3.0.2" }, "dependencies": { "@fontsource/fira-mono": "^4.5.8", "copy-to-clipboard": "^3.3.1", - "dompurify": "^2.3.9", + "dompurify": "^2.3.10", "file-saver": "^2.0.5", "pretty-bytes": "^5.6.0" } diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 0d78269..397828f 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -3,13 +3,14 @@ lockfileVersion: 5.4 specifiers: '@fontsource/fira-mono': ^4.5.8 '@lokalise/node-api': ^7.3.1 - '@sveltejs/adapter-static': ^1.0.0-next.37 - '@sveltejs/kit': ^1.0.0-next.377 + '@sveltejs/adapter-static': ^1.0.0-next.38 + '@sveltejs/kit': ^1.0.0-next.384 '@types/dompurify': ^2.3.3 '@types/file-saver': ^2.0.5 + '@zerodevx/svelte-toast': ^0.7.2 adm-zip: ^0.5.9 copy-to-clipboard: ^3.3.1 - dompurify: ^2.3.9 + dompurify: ^2.3.10 dotenv: ^16.0.1 file-saver: ^2.0.5 pretty-bytes: ^5.6.0 @@ -19,21 +20,22 @@ specifiers: svelte-preprocess: ^4.10.7 tslib: ^2.4.0 typescript: ^4.7.4 - vite: ^3.0.1 + vite: ^3.0.2 dependencies: '@fontsource/fira-mono': 4.5.8 copy-to-clipboard: 3.3.1 - dompurify: 2.3.9 + dompurify: 2.3.10 file-saver: 2.0.5 pretty-bytes: 5.6.0 devDependencies: '@lokalise/node-api': 7.3.1 - '@sveltejs/adapter-static': 1.0.0-next.37 - '@sveltejs/kit': 1.0.0-next.377_svelte@3.49.0+vite@3.0.1 + '@sveltejs/adapter-static': 1.0.0-next.38 + '@sveltejs/kit': 1.0.0-next.384_svelte@3.49.0+vite@3.0.2 '@types/dompurify': 2.3.3 '@types/file-saver': 2.0.5 + '@zerodevx/svelte-toast': 0.7.2 adm-zip: 0.5.9 dotenv: 16.0.1 svelte: 3.49.0 @@ -42,7 +44,7 @@ devDependencies: svelte-preprocess: 4.10.7_uslzfc62di2n2otc2tvfklnwji tslib: 2.4.0 typescript: 4.7.4 - vite: 3.0.1 + vite: 3.0.2 packages: @@ -66,20 +68,20 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/core/7.18.6: - resolution: {integrity: sha512-cQbWBpxcbbs/IUredIPkHiAGULLV8iwgNRMFzvbhEXISp4f3rUUXE5+TIw6KwUWUR3DwyI6gmBRnmAtYaWehwQ==} + /@babel/core/7.18.9: + resolution: {integrity: sha512-1LIb1eL8APMy91/IMW+31ckrfBM4yCoLaVzoDhZUKSM4cu1L1nIidyxkCgzPAgrC5WEz36IPEr/eSeSF9pIn+g==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.18.6 - '@babel/generator': 7.18.7 - '@babel/helper-compilation-targets': 7.18.6_@babel+core@7.18.6 - '@babel/helper-module-transforms': 7.18.8 - '@babel/helpers': 7.18.6 - '@babel/parser': 7.18.8 + '@babel/generator': 7.18.9 + '@babel/helper-compilation-targets': 7.18.9_@babel+core@7.18.9 + '@babel/helper-module-transforms': 7.18.9 + '@babel/helpers': 7.18.9 + '@babel/parser': 7.18.9 '@babel/template': 7.18.6 - '@babel/traverse': 7.18.8 - '@babel/types': 7.18.8 + '@babel/traverse': 7.18.9 + '@babel/types': 7.18.9 convert-source-map: 1.8.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -89,73 +91,73 @@ packages: - supports-color dev: true - /@babel/generator/7.18.7: - resolution: {integrity: sha512-shck+7VLlY72a2w9c3zYWuE1pwOKEiQHV7GTUbSnhyl5eu3i04t30tBY82ZRWrDfo3gkakCFtevExnxbkf2a3A==} + /@babel/generator/7.18.9: + resolution: {integrity: sha512-wt5Naw6lJrL1/SGkipMiFxJjtyczUWTP38deiP1PO60HsBjDeKk08CGC3S8iVuvf0FmTdgKwU1KIXzSKL1G0Ug==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.8 + '@babel/types': 7.18.9 '@jridgewell/gen-mapping': 0.3.2 jsesc: 2.5.2 dev: true - /@babel/helper-compilation-targets/7.18.6_@babel+core@7.18.6: - resolution: {integrity: sha512-vFjbfhNCzqdeAtZflUFrG5YIFqGTqsctrtkZ1D/NB0mDW9TwW3GmmUepYY4G9wCET5rY5ugz4OGTcLd614IzQg==} + /@babel/helper-compilation-targets/7.18.9_@babel+core@7.18.9: + resolution: {integrity: sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: '@babel/compat-data': 7.18.8 - '@babel/core': 7.18.6 + '@babel/core': 7.18.9 '@babel/helper-validator-option': 7.18.6 browserslist: 4.21.2 semver: 6.3.0 dev: true - /@babel/helper-environment-visitor/7.18.6: - resolution: {integrity: sha512-8n6gSfn2baOY+qlp+VSzsosjCVGFqWKmDF0cCWOybh52Dw3SEyoWR1KrhMJASjLwIEkkAufZ0xvr+SxLHSpy2Q==} + /@babel/helper-environment-visitor/7.18.9: + resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name/7.18.6: - resolution: {integrity: sha512-0mWMxV1aC97dhjCah5U5Ua7668r5ZmSC2DLfH2EZnf9c3/dHZKiFa5pRLMH5tjSl471tY6496ZWk/kjNONBxhw==} + /@babel/helper-function-name/7.18.9: + resolution: {integrity: sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.18.6 - '@babel/types': 7.18.8 + '@babel/types': 7.18.9 dev: true /@babel/helper-hoist-variables/7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.8 + '@babel/types': 7.18.9 dev: true /@babel/helper-module-imports/7.18.6: resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.8 + '@babel/types': 7.18.9 dev: true - /@babel/helper-module-transforms/7.18.8: - resolution: {integrity: sha512-che3jvZwIcZxrwh63VfnFTUzcAM9v/lznYkkRxIBGMPt1SudOKHAEec0SIRCfiuIzTcF7VGj/CaTT6gY4eWxvA==} + /@babel/helper-module-transforms/7.18.9: + resolution: {integrity: sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-environment-visitor': 7.18.6 + '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-module-imports': 7.18.6 '@babel/helper-simple-access': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 '@babel/helper-validator-identifier': 7.18.6 '@babel/template': 7.18.6 - '@babel/traverse': 7.18.8 - '@babel/types': 7.18.8 + '@babel/traverse': 7.18.9 + '@babel/types': 7.18.9 transitivePeerDependencies: - supports-color dev: true - /@babel/helper-plugin-utils/7.18.6: - resolution: {integrity: sha512-gvZnm1YAAxh13eJdkb9EWHBnF3eAub3XTLCZEehHT2kWxiKVRL64+ae5Y6Ivne0mVHmMYKT+xWgZO+gQhuLUBg==} + /@babel/helper-plugin-utils/7.18.9: + resolution: {integrity: sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w==} engines: {node: '>=6.9.0'} dev: true @@ -163,14 +165,14 @@ packages: resolution: {integrity: sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.8 + '@babel/types': 7.18.9 dev: true /@babel/helper-split-export-declaration/7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.8 + '@babel/types': 7.18.9 dev: true /@babel/helper-validator-identifier/7.18.6: @@ -183,13 +185,13 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helpers/7.18.6: - resolution: {integrity: sha512-vzSiiqbQOghPngUYt/zWGvK3LAsPhz55vc9XNN0xAl2gV4ieShI2OQli5duxWHD+72PZPTKAcfcZDE1Cwc5zsQ==} + /@babel/helpers/7.18.9: + resolution: {integrity: sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.18.6 - '@babel/traverse': 7.18.8 - '@babel/types': 7.18.8 + '@babel/traverse': 7.18.9 + '@babel/types': 7.18.9 transitivePeerDependencies: - supports-color dev: true @@ -203,12 +205,12 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser/7.18.8: - resolution: {integrity: sha512-RSKRfYX20dyH+elbJK2uqAkVyucL+xXzhqlMD5/ZXx+dAAwpyB7HsvnHe/ZUGOF+xLr5Wx9/JoXVTj6BQE2/oA==} + /@babel/parser/7.18.9: + resolution: {integrity: sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.18.8 + '@babel/types': 7.18.9 dev: true /@babel/template/7.18.6: @@ -216,30 +218,30 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.18.8 - '@babel/types': 7.18.8 + '@babel/parser': 7.18.9 + '@babel/types': 7.18.9 dev: true - /@babel/traverse/7.18.8: - resolution: {integrity: sha512-UNg/AcSySJYR/+mIcJQDCv00T+AqRO7j/ZEJLzpaYtgM48rMg5MnkJgyNqkzo88+p4tfRvZJCEiwwfG6h4jkRg==} + /@babel/traverse/7.18.9: + resolution: {integrity: sha512-LcPAnujXGwBgv3/WHv01pHtb2tihcyW1XuL9wd7jqh1Z8AQkTd+QVjMrMijrln0T7ED3UXLIy36P9Ao7W75rYg==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/generator': 7.18.7 - '@babel/helper-environment-visitor': 7.18.6 - '@babel/helper-function-name': 7.18.6 + '@babel/generator': 7.18.9 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.18.9 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.18.8 - '@babel/types': 7.18.8 + '@babel/parser': 7.18.9 + '@babel/types': 7.18.9 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types/7.18.8: - resolution: {integrity: sha512-qwpdsmraq0aJ3osLJRApsc2ouSJCdnMeZwB0DhbtHAtRpZNZCdlbRnHIgcRKzdE1g0iOGg644fzjOBcdOz9cPw==} + /@babel/types/7.18.9: + resolution: {integrity: sha512-WwMLAg2MvJmt/rKEVQBBhIVffMmnilX4oe0sRe7iPOHIGsqpruFHHdrfj4O1CMMtgMtCU4oPafZjDPCRgO57Wg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.18.6 @@ -357,31 +359,31 @@ packages: engines: {node: '>=10'} dev: true - /@sveltejs/adapter-static/1.0.0-next.37: - resolution: {integrity: sha512-BDFkx4CGAd6pG4e3+zYjy/eM9UDbhkRgXqavUzCO5oT8xXao5TeprY1AIbdzjMTmFjsWdeSXE9TbIsT0iikpyQ==} + /@sveltejs/adapter-static/1.0.0-next.38: + resolution: {integrity: sha512-O1b264K62E3OrUnsFxMjKn3CUJF50fxGcW0rWk8fa5kjzskPsSyTxS3jnWNryFaVJ3oSUtx57m4qFW43S1910Q==} dependencies: tiny-glob: 0.2.9 dev: true - /@sveltejs/kit/1.0.0-next.377_svelte@3.49.0+vite@3.0.1: - resolution: {integrity: sha512-DH2v2yUBUuDZ7vzjPXUd/yt1AMR3BIkZN0ubLAvS2C+q5Wbvk7ZvAJhfPZ3OYc3ZpQXe4ZGEcptOjvEYvd1lLA==} + /@sveltejs/kit/1.0.0-next.384_svelte@3.49.0+vite@3.0.2: + resolution: {integrity: sha512-m1i9dhma1JAuDYp8nrPyqsN6VWv/ye90h6mWQvAC3lCNmKlb4F8cxhMYIhGYgzaZYSqToNiTaK2QRVPuB4i2/g==} engines: {node: '>=16.9'} hasBin: true peerDependencies: svelte: ^3.44.0 vite: ^3.0.0 dependencies: - '@sveltejs/vite-plugin-svelte': 1.0.1_svelte@3.49.0+vite@3.0.1 + '@sveltejs/vite-plugin-svelte': 1.0.1_svelte@3.49.0+vite@3.0.2 chokidar: 3.5.3 sade: 1.8.1 svelte: 3.49.0 - vite: 3.0.1 + vite: 3.0.2 transitivePeerDependencies: - diff-match-patch - supports-color dev: true - /@sveltejs/vite-plugin-svelte/1.0.1_svelte@3.49.0+vite@3.0.1: + /@sveltejs/vite-plugin-svelte/1.0.1_svelte@3.49.0+vite@3.0.2: resolution: {integrity: sha512-PorCgUounn0VXcpeJu+hOweZODKmGuLHsLomwqSj+p26IwjjGffmYQfVHtiTWq+NqaUuuHWWG7vPge6UFw4Aeg==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -399,7 +401,7 @@ packages: magic-string: 0.26.2 svelte: 3.49.0 svelte-hmr: 0.14.12_svelte@3.49.0 - vite: 3.0.1 + vite: 3.0.2 transitivePeerDependencies: - supports-color dev: true @@ -468,6 +470,10 @@ packages: resolution: {integrity: sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==} dev: true + /@zerodevx/svelte-toast/0.7.2: + resolution: {integrity: sha512-vWiY6IqsstcOoQ8PFBuFuxgPkj1JFAGhUF9gC7wLx7c5A9SSfdtxWs/39ekGSIeyJK0yqWhTcmzGrCEWSELzDw==} + dev: true + /adm-zip/0.5.9: resolution: {integrity: sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==} engines: {node: '>=6.0'} @@ -495,8 +501,8 @@ packages: /babel-plugin-precompile-intl/0.4.0: resolution: {integrity: sha512-kfZPPgjutWg7nPxvwHscgxdhiOUEgWI+MZwh7NZ8lIAqf/tVKzuaoVNC4Bnl4pgzCMpuRktQz2bwFypF2ehJWg==} dependencies: - '@babel/core': 7.18.6 - '@babel/helper-plugin-utils': 7.18.6 + '@babel/core': 7.18.9 + '@babel/helper-plugin-utils': 7.18.9 '@formatjs/icu-messageformat-parser': 2.1.4 transitivePeerDependencies: - supports-color @@ -531,9 +537,9 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001367 - electron-to-chromium: 1.4.192 + electron-to-chromium: 1.4.195 node-releases: 2.0.6 - update-browserslist-db: 1.0.4_browserslist@4.21.2 + update-browserslist-db: 1.0.5_browserslist@4.21.2 dev: true /buffer-crc32/0.2.13: @@ -555,7 +561,7 @@ packages: keyv: 4.3.3 lowercase-keys: 2.0.0 normalize-url: 6.1.0 - responselike: 2.0.0 + responselike: 2.0.1 dev: true /callsites/3.1.0: @@ -665,8 +671,8 @@ packages: engines: {node: '>=8'} dev: true - /dompurify/2.3.9: - resolution: {integrity: sha512-3zOnuTwup4lPV/GfGS6UzG4ub9nhSYagR/5tB3AvDEwqyy5dtyCM2dVjwGDCnrPerXifBKTYh/UWCGKK7ydhhw==} + /dompurify/2.3.10: + resolution: {integrity: sha512-o7Fg/AgC7p/XpKjf/+RC3Ok6k4St5F7Q6q6+Nnm3p2zGWioAY6dh0CbbuwOhH2UcSzKsdniE/YnE2/92JcsA+g==} dev: false /dotenv/16.0.1: @@ -674,8 +680,8 @@ packages: engines: {node: '>=12'} dev: true - /electron-to-chromium/1.4.192: - resolution: {integrity: sha512-8nCXyIQY9An88NXAp+PuPy5h3/w5ZY7Iu2lag65Q0XREprcat5F8gKhoHsBUnQcFuCRnmevpR8yEBYRU3d2HDw==} + /electron-to-chromium/1.4.195: + resolution: {integrity: sha512-vefjEh0sk871xNmR5whJf9TEngX+KTKS3hOHpjoMpauKkwlGwtMz1H8IaIjAT/GNnX0TbGwAdmVoXCAzXf+PPg==} dev: true /end-of-stream/1.4.4: @@ -1011,7 +1017,7 @@ packages: http2-wrapper: 1.0.3 lowercase-keys: 2.0.0 p-cancelable: 2.1.1 - responselike: 2.0.0 + responselike: 2.0.1 dev: true /graceful-fs/4.2.10: @@ -1326,8 +1332,8 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /responselike/2.0.0: - resolution: {integrity: sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==} + /responselike/2.0.1: + resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} dependencies: lowercase-keys: 2.0.0 dev: true @@ -1566,8 +1572,8 @@ packages: hasBin: true dev: true - /update-browserslist-db/1.0.4_browserslist@4.21.2: - resolution: {integrity: sha512-jnmO2BEGUjsMOe/Fg9u0oczOe/ppIDZPebzccl1yDWGLFP16Pa1/RM5wEoKYPG2zstNcDuAStejyxsOuKINdGA==} + /update-browserslist-db/1.0.5_browserslist@4.21.2: + resolution: {integrity: sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -1577,8 +1583,8 @@ packages: picocolors: 1.0.0 dev: true - /vite/3.0.1: - resolution: {integrity: sha512-nefKSglkoEsDpYUkBuT2++L04ktcP8fz8dxLtmZdDdMyhubFSOLFw6BTh/46Fc6tIX/cibs/NVYWNrsqn0k6pQ==} + /vite/3.0.2: + resolution: {integrity: sha512-TAqydxW/w0U5AoL5AsD9DApTvGb2iNbGs3sN4u2VdT1GFkQVUfgUldt+t08TZgi23uIauh1TUOQJALduo9GXqw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: diff --git a/frontend/src/app.css b/frontend/src/app.css index 6630c5e..f31fd94 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -14,7 +14,9 @@ --ui-text-0: #fefefe; --ui-text-1: #eee; --ui-clr-primary: hsl(186, 65%, 55%); + --ui-clr-primary-alt: hsl(186, 85%, 35%); --ui-clr-error: hsl(357, 77%, 51%); + --ui-clr-error-alt: hsl(357, 87%, 41%); --ui-anim: all 150ms ease; } diff --git a/frontend/src/lib/toast.ts b/frontend/src/lib/toast.ts new file mode 100644 index 0000000..9e2dfd8 --- /dev/null +++ b/frontend/src/lib/toast.ts @@ -0,0 +1,37 @@ +import { toast, type SvelteToastOptions } from '@zerodevx/svelte-toast' + +export enum NotifyType { + Success = 'success', + Error = 'error', +} + +const themeMapping: Record = { + [NotifyType.Success]: { + '--toastBackground': 'var(--ui-clr-primary)', + '--toastBarBackground': 'var(--ui-clr-primary-alt)', + }, + [NotifyType.Error]: { + '--toastBackground': 'var(--ui-clr-error)', + '--toastBarBackground': 'var(--ui-clr-error-alt)', + }, +} + +function notifyFN(message: string, type: NotifyType = NotifyType.Success) { + const options: SvelteToastOptions = { + duration: 5_000, + theme: { + ...themeMapping[type], + '--toastBarHeight': '0.25rem', + '--toastMinHeight': 'auto', + '--toastMsgPadding': '0.5rem', + '--toastBorderRadius': '0', + }, + } + + toast.push(message, options) +} + +export const notify = { + success: (message: string) => notifyFN(message, NotifyType.Success), + error: (message: string) => notifyFN(message, NotifyType.Error), +} diff --git a/frontend/src/lib/ui/ShowNote.svelte b/frontend/src/lib/ui/ShowNote.svelte index ad96153..81f498f 100644 --- a/frontend/src/lib/ui/ShowNote.svelte +++ b/frontend/src/lib/ui/ShowNote.svelte @@ -3,7 +3,6 @@ diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts new file mode 100644 index 0000000..d2e3b90 --- /dev/null +++ b/frontend/src/lib/utils.ts @@ -0,0 +1,11 @@ +import copyToClipboard from 'copy-to-clipboard' +import { t } from 'svelte-intl-precompile' +import { get } from 'svelte/store' + +import { notify } from './toast' + +export function copy(value: string) { + copyToClipboard(value) + const msg = get(t)('common.copied_to_clipboard') + notify.success(msg) +} diff --git a/frontend/src/lib/views/Create.svelte b/frontend/src/lib/views/Create.svelte index d3bd78e..6f45ad4 100644 --- a/frontend/src/lib/views/Create.svelte +++ b/frontend/src/lib/views/Create.svelte @@ -7,6 +7,7 @@ import { create, PayloadToLargeError } from '$lib/api' import { Crypto, Hex } from '$lib/crypto' import { status } from '$lib/stores/status' + import { notify } from '$lib/toast' import AdvancedParameters from '$lib/ui/AdvancedParameters.svelte' import Button from '$lib/ui/Button.svelte' import FileUpload from '$lib/ui/FileUpload.svelte' @@ -29,7 +30,6 @@ let timeExpiration = false let description = '' let loading: string | null = null - let error: string | null = null $: if (!advanced) { note.views = 1 @@ -56,7 +56,6 @@ async function submit() { try { - error = null loading = $t('common.encrypting') const password = Hex.encode(Crypto.getRandomBytes(32)) @@ -82,14 +81,15 @@ password: password, id: response.id, } + notify.success($t('home.messages.note_created')) } catch (e) { if (e instanceof PayloadToLargeError) { - error = $t('home.errors.note_to_big') + notify.error($t('home.errors.note_to_big')) } else if (e instanceof EmptyContentError) { - error = $t('home.errors.empty_content') + notify.error($t('home.errors.empty_content')) } else { console.error(e) - error = $t('home.errors.note_error') + notify.error($t('home.errors.note_error')) } } finally { loading = null @@ -138,10 +138,6 @@ - {#if error} -
{error}
- {/if} -


{#if loading} @@ -175,8 +171,4 @@ .grow { flex: 1; } - - .error-text { - margin-top: 0.5rem; - } diff --git a/frontend/src/routes/__layout.svelte b/frontend/src/routes/__layout.svelte index 05b0cef..6501581 100644 --- a/frontend/src/routes/__layout.svelte +++ b/frontend/src/routes/__layout.svelte @@ -7,11 +7,14 @@