Compare commits

...

17 Commits

Author SHA1 Message Date
e9dcdab503 Merge branch 'main' into dependabot/npm_and_yarn/vite-4.5.1 2024-02-09 14:48:06 +01:00
71a33a7939 Merge pull request #111 from cupcakearmy/dependabot/cargo/packages/backend/zerocopy-0.7.31
Bump zerocopy from 0.7.21 to 0.7.31 in /packages/backend
2024-02-09 14:47:47 +01:00
4c3480bbb8 Merge branch 'main' into dependabot/npm_and_yarn/vite-4.5.1 2024-02-09 14:47:37 +01:00
dependabot[bot]
83033a4b85 Bump zerocopy from 0.7.21 to 0.7.31 in /packages/backend
Bumps [zerocopy](https://github.com/google/zerocopy) from 0.7.21 to 0.7.31.
- [Release notes](https://github.com/google/zerocopy/releases)
- [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/zerocopy/compare/v0.7.21...v0.7.31)

---
updated-dependencies:
- dependency-name: zerocopy
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 03:50:33 +00:00
40570bbbaf Merge pull request #108 from codiflow/patch-1
Updated German language strings
2023-12-13 21:22:44 +01:00
dependabot[bot]
d5310d4e11 Bump vite from 4.5.0 to 4.5.1
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.1/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-06 00:00:18 +00:00
Christian
f591e589d0 Updated German language strings 2023-12-04 16:01:09 +01:00
d1eebb04f3 Merge pull request #107 from pgschk/locale-fixes
Fixes to locales en and de
2023-11-08 13:49:13 +01:00
pgschk
5a76ea7778 Update locale de
Fix some translation errors
2023-11-01 23:29:02 +01:00
pgschk
45a1af7569 Fix locale en
Fix spelling: to -> too, it's -> its
2023-11-01 23:18:58 +01:00
9578b2bed2 Merge pull request #106 from cupcakearmy/2.4.0
2.4.0
2023-11-01 15:57:12 +01:00
f94e4e3858 sparse bundler is enabled by default now 2023-11-01 15:26:55 +01:00
ffa2c49ea3 don't insert html anymore, use separate link section 2023-11-01 15:26:45 +01:00
0d850aadfc update deps 2023-11-01 15:26:33 +01:00
a9c646c981 update packages 2023-11-01 15:26:20 +01:00
a2803a13da update deps 2023-08-14 10:22:09 +02:00
deef56776d maintenance 2023-08-14 10:12:26 +02:00
20 changed files with 1317 additions and 936 deletions

2
.nvmrc
View File

@@ -1 +1 @@
v18.16 v20.9.0

View File

@@ -5,6 +5,13 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.4.0] - 2023-11-01
### Changed
- Removed HTML sanitation, display the original message as string
- Links are now displayed under the note in a separate section
## [2.3.1] - 2023-06-23 ## [2.3.1] - 2023-06-23
### Added ### Added

View File

@@ -8,12 +8,9 @@ RUN pnpm run build
# BACKEND # BACKEND
FROM rust:1.69-alpine as backend FROM rust:1.73-alpine as backend
WORKDIR /tmp WORKDIR /tmp
RUN apk add libc-dev openssl-dev alpine-sdk RUN apk add libc-dev openssl-dev alpine-sdk
COPY ./packages/backend/Cargo.* ./
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo fetch
COPY ./packages/backend ./ COPY ./packages/backend ./
RUN cargo build --release RUN cargo build --release

View File

@@ -1,5 +1,5 @@
{ {
"packageManager": "pnpm@8.6.3", "packageManager": "pnpm@8.10.1",
"scripts": { "scripts": {
"dev:docker": "docker-compose -f docker-compose.dev.yaml up redis", "dev:docker": "docker-compose -f docker-compose.dev.yaml up redis",
"dev:packages": "pnpm --parallel run dev", "dev:packages": "pnpm --parallel run dev",
@@ -13,8 +13,8 @@
"build": "pnpm run --recursive --filter=!@cryptgeon/backend build" "build": "pnpm run --recursive --filter=!@cryptgeon/backend build"
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.33.0", "@playwright/test": "^1.39.0",
"@types/node": "^20.1.3", "@types/node": "^20.8.10",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"shelljs": "^0.8.5" "shelljs": "^0.8.5"
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,9 @@
[package] [package]
name = "cryptgeon" name = "cryptgeon"
version = "2.3.1" version = "2.4.0"
authors = ["cupcakearmy <hi@nicco.io>"] authors = ["cupcakearmy <hi@nicco.io>"]
edition = "2021" edition = "2021"
rust-version = "1.73"
[[bin]] [[bin]]
name = "cryptgeon" name = "cryptgeon"

View File

@@ -1,5 +1,5 @@
{ {
"version": "2.3.1", "version": "2.4.0",
"name": "cryptgeon", "name": "cryptgeon",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -26,18 +26,18 @@
"dist" "dist"
], ],
"devDependencies": { "devDependencies": {
"@commander-js/extra-typings": "^10.0.3", "@commander-js/extra-typings": "^11.1.0",
"@cryptgeon/shared": "workspace:*", "@cryptgeon/shared": "workspace:*",
"@types/inquirer": "^9.0.3", "@types/inquirer": "^9.0.6",
"@types/mime": "^3.0.1", "@types/mime": "^3.0.3",
"@types/node": "^20.1.3", "@types/node": "^20.8.10",
"commander": "^10.0.1", "commander": "^11.1.0",
"esbuild": "^0.17.19", "esbuild": "^0.19.5",
"inquirer": "^9.2.2", "inquirer": "^9.2.11",
"mime": "^3.0.0", "mime": "^3.0.0",
"occulto": "^2.0.1", "occulto": "^2.0.1",
"pkg": "^5.8.1", "pkg": "^5.8.1",
"pretty-bytes": "^6.1.0", "pretty-bytes": "^6.1.1",
"typescript": "^5.0.4" "typescript": "^5.2.2"
} }
} }

View File

@@ -1,53 +1,54 @@
{ {
"common": { "common": {
"note": "Hinweis", "note": "Notiz",
"file": "Datei", "file": "Datei",
"advanced": "erweitert", "advanced": "Erweiterte Optionen",
"create": "erstellen", "create": "Notiz erstellen",
"loading": "läd", "loading": "Lädt...",
"mode": "Modus", "mode": "Modus",
"views": "{n, plural, =0 {Ansichten} =1 {1 Ansicht} other {# Ansichten}}", "views": "{n, plural, =0 {Ansichten} =1 {1 Ansicht} other {# Ansichten}}",
"minutes": "{n, plural, =0 {Minuten} =1 {1 Minute} other {# Minuten}}", "minutes": "{n, plural, =0 {Minuten} =1 {1 Minute} other {# Minuten}}",
"max": "max", "max": "max",
"share_link": "Link teilen", "share_link": "Link teilen",
"copy_clipboard": "in die Zwischenablage kopieren", "copy_clipboard": "Link in die Zwischenablage kopieren",
"copied_to_clipboard": "in die Zwischenablage kopiert", "copied_to_clipboard": "Link in die Zwischenablage kopiert.",
"encrypting": "verschlüsseln", "encrypting": "Notiz wird verschlüsselt...",
"decrypting": "entschlüsselt", "decrypting": "Notiz wird entschlüsselt...",
"uploading": "hochladen", "uploading": "Hochladen",
"downloading": "wird heruntergeladen", "downloading": "Wird heruntergeladen",
"qr_code": "qr-code", "qr_code": "QR-Code",
"password": "Passwort" "password": "Passwort"
}, },
"home": { "home": {
"intro": "Senden Sie ganz einfach <i>vollständig verschlüsselte</i>, sichere Notizen oder Dateien mit einem Klick. Erstellen Sie einfach eine Notiz und teilen Sie den Link.", "intro": "Senden Sie mit ganz einfach einem Klick <i>vollständig verschlüsselte</i>, sichere Notizen oder Dateien. Erstellen Sie einfach eine Notiz und teilen Sie den Link.",
"explanation": "die Notiz verfällt und wird nach {type} zerstört.", "explanation": "Die Notiz verfällt nach {type}.",
"new_note": "neue Note", "new_note": "Neue Notiz",
"new_note_notice": "<b>Verfügbarkeit:</b><br />es ist nicht garantiert, dass die Notiz gespeichert wird, da alles im Speicher gehalten wird. Wenn dieser voll ist, werden die ältesten Notizen entfernt.<br />(Sie werden wahrscheinlich keine Probleme haben, seien Sie nur gewarnt).", "new_note_notice": "<b>Wichtiger Hinweis zur Verfügbarkeit:</b><br />Es kann nicht garantiert werden, dass diese Notiz gespeichert wird, da diese <b>ausschließlich im Speicher</b> gehalten werden. Ist dieser voll, werden die ältesten Notizen entfernt.<br />(Wahrscheinlich gibt es keine derartigen Probleme, seien Sie nur vorgewarnt).",
"errors": { "errors": {
"note_to_big": "Notiz konnte nicht erstellt werden. Notiz ist zu groß", "note_to_big": "Notiz konnte nicht erstellt werden, da sie zu groß ist.",
"note_error": "konnte keine Notiz erstellen. Bitte versuchen Sie es erneut.", "note_error": "Notiz konnte nicht erstellt werden. Bitte versuchen Sie es erneut.",
"max": "max: {n}", "max": "max: {n}",
"empty_content": "Notiz ist leer." "empty_content": "Notiz ist leer."
}, },
"messages": { "messages": {
"note_created": "notiz erstellt." "note_created": "Notiz wurde erstellt."
}, },
"advanced": { "advanced": {
"explanation": "Standardmäßig wird für jede Notiz ein sicher generiertes Passwort verwendet. Sie können jedoch auch ein eigenes Kennwort wählen, das nicht in dem Link enthalten ist.", "explanation": "Standardmäßig wird für jede Notiz ein sicher generiertes Passwort verwendet. Sie können alternativ ein eigenes Kennwort wählen, das nicht im Link enthalten ist.",
"custom_password": "benutzerdefiniertes Passwort" "custom_password": "Benutzerdefiniertes Passwort"
} }
}, },
"show": { "show": {
"errors": { "errors": {
"not_found": "wurde nicht gefunden oder wurde bereits gelöscht.", "not_found": "Notiz konnte nicht gefunden werden oder wurde bereits gelöscht.",
"decryption_failed": "falsches Passwort. konnte nicht entziffert werden. wahrscheinlich ein defekter Link. Notiz wurde zerstört.", "decryption_failed": "Notiz konnte nicht entschlüsselt werden. Vermutlich ist das Passwort falsch oder der Link defekt. Notiz wurde zerstört.",
"unsupported_type": "nicht unterstützter Notiztyp." "unsupported_type": "Nicht unterstützter Notiztyp."
}, },
"explanation": "Klicken Sie unten, um die Notiz anzuzeigen und zu löschen, wenn der Zähler sein Limit erreicht hat", "explanation": "Klicken Sie unten, um die Notiz anzuzeigen und anschließend zu löschen, falls das Limit erreicht ist.",
"show_note": "Notiz anzeigen", "show_note": "Notiz anzeigen",
"warning_will_not_see_again": "haben Sie <b>keine</b> Gelegenheit, die Notiz noch einmal zu sehen.", "warning_will_not_see_again": "Achtung! Sie haben anschließend <b>keine</b> Gelegenheit, die Notiz noch einmal anzusehen.",
"download_all": "alle herunterladen" "download_all": "Alle Dateien herunterladen",
"links_found": "Links in der Notiz:"
}, },
"file_upload": { "file_upload": {
"selected_files": "Ausgewählte Dateien", "selected_files": "Ausgewählte Dateien",

View File

@@ -23,9 +23,9 @@
"intro": "Easily send <i>fully encrypted</i>, secure notes or files with one click. Just create a note and share the link.", "intro": "Easily send <i>fully encrypted</i>, secure notes or files with one click. Just create a note and share the link.",
"explanation": "the note will expire and be destroyed after {type}.", "explanation": "the note will expire and be destroyed after {type}.",
"new_note": "new note", "new_note": "new note",
"new_note_notice": "<b>availability:</b><br />the note is not guaranteed to be stored, as everything is kept in ram. if it fills up, the oldest notes will be removed.<br />(you probably will be fine, but just be warned.)", "new_note_notice": "<b>availability:</b><br />the note is not guaranteed to be stored as everything is kept in ram, if it fills up the oldest notes will be removed.<br />(you probably will be fine, just be warned.)",
"errors": { "errors": {
"note_to_big": "could not create note. note is too big.", "note_to_big": "could not create note. note is too big",
"note_error": "could not create note. please try again.", "note_error": "could not create note. please try again.",
"max": "max: {n}", "max": "max: {n}",
"empty_content": "note is empty." "empty_content": "note is empty."
@@ -34,7 +34,7 @@
"note_created": "note created." "note_created": "note created."
}, },
"advanced": { "advanced": {
"explanation": "By default, a securely generated password is used for each note. You can, however, also choose your own password, which is not included in the link.", "explanation": "By default, a securely generated password is used for each note. You can however also choose your own password, which is not included in the link.",
"custom_password": "custom password" "custom_password": "custom password"
} }
}, },
@@ -44,10 +44,11 @@
"decryption_failed": "wrong password. could not decipher. probably a broken link. note was destroyed.", "decryption_failed": "wrong password. could not decipher. probably a broken link. note was destroyed.",
"unsupported_type": "unsupported note type." "unsupported_type": "unsupported note type."
}, },
"explanation": "click below to show and delete the note if the counter has reached its limit.", "explanation": "click below to show and delete the note if the counter has reached its limit",
"show_note": "show note", "show_note": "show note",
"warning_will_not_see_again": "you will <b>not</b> get the chance to see the note again.", "warning_will_not_see_again": "you will <b>not</b> get the chance to see the note again.",
"download_all": "download all" "download_all": "download all",
"links_found": "links found inside the note:"
}, },
"file_upload": { "file_upload": {
"selected_files": "Selected Files", "selected_files": "Selected Files",

View File

@@ -23,7 +23,7 @@
"intro": "Envía fácilmente notas o archivos <i>totalmente encriptados</i> y seguros con un solo clic. Solo tienes que crear una nota y compartir el enlace.", "intro": "Envía fácilmente notas o archivos <i>totalmente encriptados</i> y seguros con un solo clic. Solo tienes que crear una nota y compartir el enlace.",
"explanation": "la nota expirará y se destruirá después de {type}.", "explanation": "la nota expirará y se destruirá después de {type}.",
"new_note": "nueva nota", "new_note": "nueva nota",
"new_note_notice": "<b>disponibilidad:</b><br />no se garantiza que la nota se almacene, ya que todo se guarda en la memoria RAM, si se llena se eliminarán las notas más antiguas.<br />(probablemente estará bien, sólo está advertido.)", "new_note_notice": "<b>disponibilidad:</b><br />no se garantiza que la nota se almacene, ya que todo se guarda en la memoria RAM, si se llena se eliminarán las notas más antiguas.<br />(probablemente estará bien, solo está advertido.)",
"errors": { "errors": {
"note_to_big": "no se pudo crear la nota. la nota es demasiado grande", "note_to_big": "no se pudo crear la nota. la nota es demasiado grande",
"note_error": "No se ha podido crear la nota. Por favor, inténtelo de nuevo.", "note_error": "No se ha podido crear la nota. Por favor, inténtelo de nuevo.",
@@ -34,7 +34,7 @@
"note_created": "nota creada." "note_created": "nota creada."
}, },
"advanced": { "advanced": {
"explanation": "Por defecto, se utiliza una contraseña generada de forma segura para cada nota. No obstante, también puede elegir su propia contraseña, que no se incluye en el enlace.", "explanation": "Por defecto, se utiliza una contraseña generada de forma segura para cada nota. No obstante, también puede elegir su propia contraseña, la cual no se incluye en el enlace.",
"custom_password": "contraseña personalizada" "custom_password": "contraseña personalizada"
} }
}, },
@@ -47,7 +47,8 @@
"explanation": "pulse abajo para mostrar y borrar la nota si el contador ha llegado a su límite", "explanation": "pulse abajo para mostrar y borrar la nota si el contador ha llegado a su límite",
"show_note": "mostrar nota", "show_note": "mostrar nota",
"warning_will_not_see_again": "<b>no</b> tendrás la oportunidad de volver a ver la nota.", "warning_will_not_see_again": "<b>no</b> tendrás la oportunidad de volver a ver la nota.",
"download_all": "descargar todo" "download_all": "descargar todo",
"links_found": "enlaces que se encuentran dentro de la nota:"
}, },
"file_upload": { "file_upload": {
"selected_files": "Archivos seleccionados", "selected_files": "Archivos seleccionados",

View File

@@ -47,7 +47,8 @@
"explanation": "Cliquez ci-dessous pour afficher et supprimer la note si le compteur a atteint sa limite.", "explanation": "Cliquez ci-dessous pour afficher et supprimer la note si le compteur a atteint sa limite.",
"show_note": "note de présentation", "show_note": "note de présentation",
"warning_will_not_see_again": "vous <b>n'aurez pas</b> la chance de revoir la note.", "warning_will_not_see_again": "vous <b>n'aurez pas</b> la chance de revoir la note.",
"download_all": "télécharger tout" "download_all": "télécharger tout",
"links_found": "liens trouvés à lintérieur de la note :"
}, },
"file_upload": { "file_upload": {
"selected_files": "Fichiers sélectionnés", "selected_files": "Fichiers sélectionnés",

View File

@@ -47,7 +47,8 @@
"explanation": "clicca sotto per mostrare e cancellare la nota se il contatore ha raggiunto il suo limite", "explanation": "clicca sotto per mostrare e cancellare la nota se il contatore ha raggiunto il suo limite",
"show_note": "mostra la nota", "show_note": "mostra la nota",
"warning_will_not_see_again": "<b>non</b> avrete la possibilità di rivedere la nota.", "warning_will_not_see_again": "<b>non</b> avrete la possibilità di rivedere la nota.",
"download_all": "scarica tutti" "download_all": "scarica tutti",
"links_found": "link presenti all'interno della nota:"
}, },
"file_upload": { "file_upload": {
"selected_files": "File selezionati", "selected_files": "File selezionati",

View File

@@ -47,7 +47,8 @@
"explanation": "カウンターが上限に達した場合、ノートの表示と削除を行うには、以下をクリックします。", "explanation": "カウンターが上限に達した場合、ノートの表示と削除を行うには、以下をクリックします。",
"show_note": "メモを表示", "show_note": "メモを表示",
"warning_will_not_see_again": "あなた <b>できません</b> このノートをもう一度見る", "warning_will_not_see_again": "あなた <b>できません</b> このノートをもう一度見る",
"download_all": "すべてダウンロード" "download_all": "すべてダウンロード",
"links_found": "メモ内にあるリンク:"
}, },
"file_upload": { "file_upload": {
"selected_files": "選択したファイル", "selected_files": "選択したファイル",

View File

@@ -23,10 +23,10 @@
"intro": "Легко отправляйте <i>полностью зашифрованные</i> защищенные заметки или файлы одним щелчком мыши. Просто создайте заметку и поделитесь ссылкой.", "intro": "Легко отправляйте <i>полностью зашифрованные</i> защищенные заметки или файлы одним щелчком мыши. Просто создайте заметку и поделитесь ссылкой.",
"explanation": "заметка истечет и будет уничтожена после {type}.", "explanation": "заметка истечет и будет уничтожена после {type}.",
"new_note": "новая заметка", "new_note": "новая заметка",
"new_note_notice": "<b>предупреждение:</b><br />не гарантируется, что заметка будет сохранена, так как все хранится в оперативной памяти, если она заполнится, самые старые заметки будут удалены..<br />(вероятно всё будет хорошо, просто будьте осторожны.)", "new_note_notice": "<b>availability:</b><br />the note is not guaranteed to be stored as everything is kept in ram, if it fills up the oldest notes will be removed.<br />(you probably will be fine, just be warned.)",
"errors": { "errors": {
"note_to_big": "нельзя создать новую заметку. заметка слишком большая", "note_to_big": "нельзя создать новую заметку. заметка слишком большая",
"note_error": "нельзя создать новую заметку. пожалуйста попробуйте позднее.", "note_error": "нельзя создать новую заметку. пожалйста попробуйте позднее.",
"max": "макс: {n}", "max": "макс: {n}",
"empty_content": "пустая заметка." "empty_content": "пустая заметка."
}, },
@@ -44,10 +44,11 @@
"decryption_failed": "неправильный пароль. не смог расшифровать. возможно ссылка битая. записка уничтожена.", "decryption_failed": "неправильный пароль. не смог расшифровать. возможно ссылка битая. записка уничтожена.",
"unsupported_type": "неподдерживаемый тип заметки." "unsupported_type": "неподдерживаемый тип заметки."
}, },
"explanation": "щелкните ниже, чтобы показать и удалить заметку, если счетчик достиг предела", "explanation": "щелкните ниже, чтобы показать и удалить примечание, если счетчик достиг предела",
"show_note": "показать заметку", "show_note": "показать заметку",
"warning_will_not_see_again": "вы <b>не сможете</b> больше просмотреть заметку.", "warning_will_not_see_again": "вы <b>не сможете</b> больше просмотреть заметку.",
"download_all": "скачать всё" "download_all": "скачать всё",
"links_found": "ссылки внутри заметки:"
}, },
"file_upload": { "file_upload": {
"selected_files": "Выбранные файлы", "selected_files": "Выбранные файлы",

View File

@@ -47,7 +47,8 @@
"explanation": "点击下方按钮即可查看密信,阅后即焚。", "explanation": "点击下方按钮即可查看密信,阅后即焚。",
"show_note": "查看密信", "show_note": "查看密信",
"warning_will_not_see_again": "你将<b>无法</b>再次查看该密信,请尽快复制到粘贴板。", "warning_will_not_see_again": "你将<b>无法</b>再次查看该密信,请尽快复制到粘贴板。",
"download_all": "下载全部" "download_all": "下载全部",
"links_found": "注释中找到的链接:"
}, },
"file_upload": { "file_upload": {
"selected_files": "已选中的文件", "selected_files": "已选中的文件",

View File

@@ -13,29 +13,27 @@
}, },
"type": "module", "type": "module",
"devDependencies": { "devDependencies": {
"@lokalise/node-api": "^9.8.0", "@lokalise/node-api": "^12.0.0",
"@sveltejs/adapter-static": "^2.0.2", "@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.16.3", "@sveltejs/kit": "^1.27.2",
"@types/dompurify": "^3.0.2", "@types/file-saver": "^2.0.6",
"@types/file-saver": "^2.0.5", "@zerodevx/svelte-toast": "^0.9.5",
"@zerodevx/svelte-toast": "^0.9.3",
"adm-zip": "^0.5.10", "adm-zip": "^0.5.10",
"dotenv": "^16.0.3", "dotenv": "^16.3.1",
"svelte": "^3.59.1", "svelte": "^4.2.2",
"svelte-check": "^3.3.2", "svelte-check": "^3.5.2",
"svelte-intl-precompile": "^0.12.1", "svelte-intl-precompile": "^0.12.3",
"tslib": "^2.5.0", "tslib": "^2.6.2",
"typescript": "^5.0.4", "typescript": "^5.2.2",
"vite": "^4.3.5" "vite": "^4.5.1"
}, },
"dependencies": { "dependencies": {
"@cryptgeon/shared": "workspace:*", "@cryptgeon/shared": "workspace:*",
"@fontsource/fira-mono": "^4.5.10", "@fontsource/fira-mono": "^5.0.8",
"copy-to-clipboard": "^3.3.3", "copy-to-clipboard": "^3.3.3",
"dompurify": "^3.0.3",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"occulto": "^2.0.1", "occulto": "^2.0.1",
"pretty-bytes": "^6.1.0", "pretty-bytes": "^6.1.1",
"qrious": "^4.0.2" "qrious": "^4.0.2"
} }
} }

View File

@@ -3,7 +3,6 @@
</script> </script>
<script lang="ts"> <script lang="ts">
import DOMPurify from 'dompurify'
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
import prettyBytes from 'pretty-bytes' import prettyBytes from 'pretty-bytes'
import { t } from 'svelte-intl-precompile' import { t } from 'svelte-intl-precompile'
@@ -34,22 +33,29 @@
saveAs(f) saveAs(f)
} }
function contentWithLinks(content: string): string { $: links = typeof note.contents === 'string' ? note.contents.match(RE_URL) : []
const replaced = content.replace(
RE_URL,
(url) => `<a href="${url}" rel="noreferrer">${url}</a>`
)
return DOMPurify.sanitize(replaced, { USE_PROFILES: { html: true } })
}
</script> </script>
<p class="error-text">{@html $t('show.warning_will_not_see_again')}</p> <p class="error-text">{@html $t('show.warning_will_not_see_again')}</p>
<div data-testid="result"> <div data-testid="result">
{#if note.meta.type === 'text'} {#if note.meta.type === 'text'}
<div class="note"> <div class="note">
{@html contentWithLinks(note.contents)} {note.contents}
</div> </div>
<Button on:click={() => copy(note.contents)}>{$t('common.copy_clipboard')}</Button> <Button on:click={() => copy(note.contents)}>{$t('common.copy_clipboard')}</Button>
{#if links && links.length}
<div class="links">
{$t('show.links_found')}
<ul>
{#each links as link}
<li>
<a href={link} target="_blank" rel="noopener noreferrer">{link}</a>
</li>
{/each}
</ul>
</div>
{/if}
{:else} {:else}
{#each files as file} {#each files as file}
<div class="note file"> <div class="note file">
@@ -92,4 +98,20 @@
.note.file small { .note.file small {
padding-left: 1rem; padding-left: 1rem;
} }
.links {
margin-top: 2rem;
}
.links ul {
margin: 0;
padding: 0;
margin-top: 0.5rem;
padding-left: 1rem;
list-style: square;
}
.links ul li {
margin-bottom: 0.5rem;
word-wrap: break-word;
}
</style> </style>

View File

@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { AES, Hex, Bytes } from 'occulto' import { AES, Hex } from 'occulto'
import { t } from 'svelte-intl-precompile' import { t } from 'svelte-intl-precompile'
import { blur } from 'svelte/transition' import { blur } from 'svelte/transition'
@@ -14,7 +14,7 @@
import Switch from '$lib/ui/Switch.svelte' import Switch from '$lib/ui/Switch.svelte'
import TextArea from '$lib/ui/TextArea.svelte' import TextArea from '$lib/ui/TextArea.svelte'
import type { FileDTO, Note } from '@cryptgeon/shared' import type { FileDTO, Note } from '@cryptgeon/shared'
import { Adapters, create, PayloadToLargeError } from '@cryptgeon/shared' import { Adapters, PayloadToLargeError, create } from '@cryptgeon/shared'
let note: Note = { let note: Note = {
contents: '', contents: '',
@@ -149,7 +149,7 @@
</p> </p>
{#if advanced} {#if advanced}
<div transition:blur={{ duration: 250 }}> <div transition:blur|global={{ duration: 250 }}>
<hr /> <hr />
<AdvancedParameters bind:note bind:timeExpiration bind:customPassword /> <AdvancedParameters bind:note bind:timeExpiration bind:customPassword />
</div> </div>

View File

@@ -14,7 +14,7 @@
"build": "tsc" "build": "tsc"
}, },
"devDependencies": { "devDependencies": {
"typescript": "^5.0.4" "typescript": "^5.2.2"
}, },
"dependencies": { "dependencies": {
"occulto": "^2.0.1" "occulto": "^2.0.1"

1548
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff