Merge branch 'TriliumNext:main' into fix/layout-calls

This commit is contained in:
Lucas 2026-01-01 10:55:25 -08:00 committed by GitHub
commit 0143d6c60d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 137 additions and 35 deletions

View File

@ -0,0 +1,14 @@
import { describe, expect, it } from "vitest";
import { getReadableTextColor } from "./css_class_manager";
describe("getReadableTextColor", () => {
it("doesn't crash for invalid color", () => {
expect(getReadableTextColor("RandomColor")).toBe("#000");
});
it("tolerates different casing", () => {
expect(getReadableTextColor("Blue"))
.toBe(getReadableTextColor("blue"));
});
});

View File

@ -1,21 +1,22 @@
import clsx from "clsx";
import {readCssVar} from "../utils/css-var";
import Color, { ColorInstance } from "color";
import {readCssVar} from "../utils/css-var";
const registeredClasses = new Set<string>();
const colorsWithHue = new Set<string>();
// Read the color lightness limits defined in the theme as CSS variables
const lightThemeColorMaxLightness = readCssVar(
document.documentElement,
"tree-item-light-theme-max-color-lightness"
).asNumber(70);
document.documentElement,
"tree-item-light-theme-max-color-lightness"
).asNumber(70);
const darkThemeColorMinLightness = readCssVar(
document.documentElement,
"tree-item-dark-theme-min-color-lightness"
).asNumber(50);
document.documentElement,
"tree-item-dark-theme-min-color-lightness"
).asNumber(50);
function createClassForColor(colorString: string | null) {
if (!colorString?.trim()) return "";
@ -27,7 +28,7 @@ function createClassForColor(colorString: string | null) {
if (!registeredClasses.has(className)) {
const adjustedColor = adjustColorLightness(color, lightThemeColorMaxLightness!,
darkThemeColorMinLightness!);
darkThemeColorMinLightness!);
const hue = getHue(color);
$("head").append(`<style>
@ -50,7 +51,7 @@ function createClassForColor(colorString: string | null) {
function parseColor(color: string) {
try {
return Color(color);
return Color(color.toLowerCase());
} catch (ex) {
console.error(ex);
}
@ -84,8 +85,8 @@ function getHue(color: ColorInstance) {
}
export function getReadableTextColor(bgColor: string) {
const colorInstance = Color(bgColor);
return colorInstance.isLight() ? "#000" : "#fff";
const colorInstance = parseColor(bgColor);
return !colorInstance || colorInstance?.isLight() ? "#000" : "#fff";
}
export default {

View File

@ -692,7 +692,11 @@
"convert_into_attachment_successful": "Notiz '{{title}}' wurde als Anhang konvertiert.",
"convert_into_attachment_prompt": "Bist du dir sicher, dass du die Notiz '{{title}}' in ein Anhang der übergeordneten Notiz konvertieren möchtest?",
"print_pdf": "Export als PDF...",
"open_note_on_server": "Öffne Notiz auf dem Server"
"open_note_on_server": "Öffne Notiz auf dem Server",
"export_as_image": "Als Bild exportieren",
"export_as_image_png": "PNG (Raster)",
"export_as_image_svg": "SVG (Vektor)",
"note_map": "Notizen Karte"
},
"onclick_button": {
"no_click_handler": "Das Schaltflächen-Widget „{{componentId}}“ hat keinen definierten Klick-Handler"
@ -750,7 +754,15 @@
"note_icon": {
"change_note_icon": "Notiz-Icon ändern",
"search": "Suche:",
"reset-default": "Standard wiederherstellen"
"reset-default": "Standard wiederherstellen",
"search_placeholder_one": "Suche {{number}} Icons über {{count}} Pakete",
"search_placeholder_other": "Suche {{number}} Icons über {{count}} Pakete",
"search_placeholder_filtered": "Suche {{number}} Icons in {{name}}",
"filter": "Filter",
"filter-none": "Alle Icons",
"filter-default": "Standard Icons",
"icon_tooltip": "{{name}}\nIcon Paket: {{iconPack}}",
"no_results": "Keine Icons gefunden."
},
"basic_properties": {
"note_type": "Notiztyp",
@ -810,7 +822,8 @@
},
"inherited_attribute_list": {
"title": "Geerbte Attribute",
"no_inherited_attributes": "Keine geerbten Attribute."
"no_inherited_attributes": "Keine geerbten Attribute.",
"none": "Keine"
},
"note_info_widget": {
"note_id": "Notiz-ID",
@ -821,7 +834,9 @@
"note_size_info": "Die Notizgröße bietet eine grobe Schätzung des Speicherbedarfs für diese Notiz. Es berücksichtigt den Inhalt der Notiz und den Inhalt ihrer Notizrevisionen.",
"calculate": "berechnen",
"subtree_size": "(Teilbaumgröße: {{size}} in {{count}} Notizen)",
"title": "Notizinfo"
"title": "Notizinfo",
"mime": "MIME Typ",
"show_similar_notes": "Zeige ähnliche Notizen"
},
"note_map": {
"open_full": "Vollständig erweitern",
@ -884,7 +899,8 @@
"search_parameters": "Suchparameter",
"unknown_search_option": "Unbekannte Suchoption {{searchOptionName}}",
"search_note_saved": "Suchnotiz wurde in {{-notePathTitle}} gespeichert",
"actions_executed": "Aktionen wurden ausgeführt."
"actions_executed": "Aktionen wurden ausgeführt.",
"view_options": "Anzeigeoptionen:"
},
"similar_notes": {
"title": "Ähnliche Notizen",
@ -988,7 +1004,12 @@
"editable_text": {
"placeholder": "Gebe hier den Inhalt deiner Notiz ein...",
"auto-detect-language": "Automatisch erkannt",
"keeps-crashing": "Die Bearbeitungskomponente stürzt immer wieder ab. Bitte starten Sie Trilium neu. Wenn das Problem weiterhin besteht, erstellen Sie einen Fehlerbericht."
"keeps-crashing": "Die Bearbeitungskomponente stürzt immer wieder ab. Bitte starten Sie Trilium neu. Wenn das Problem weiterhin besteht, erstellen Sie einen Fehlerbericht.",
"editor_crashed_title": "Der Text Editor ist abgestürzt",
"editor_crashed_content": "Ihr Inhalt wurde erfolgreich wiederhergestellt, aber einzelne Ihrer letzten Änderungen waren möglicherweise noch nicht gespeichert.",
"editor_crashed_details_button": "Zeige mehr Details…",
"editor_crashed_details_intro": "Falls Sie diesen Fehler mehrmals sehen, melden Sie dies auf GitHub mit den folgenden Informationen.",
"editor_crashed_details_title": "Technische Informationen"
},
"empty": {
"open_note_instruction": "Öffne eine Notiz, indem du den Titel der Notiz in die Eingabe unten eingibst oder eine Notiz in der Baumstruktur auswählst.",
@ -1503,7 +1524,12 @@
},
"highlights_list_2": {
"title": "Hervorhebungs-Liste",
"options": "Optionen"
"options": "Optionen",
"title_with_count_one": "{{count}} Highlight",
"title_with_count_other": "{{count}} Highlights",
"modal_title": "Highlight Liste konfigurieren",
"menu_configure": "Highlight Liste konfigurieren…",
"no_highlights": "Keine Highlights gefunden."
},
"quick-search": {
"placeholder": "Schnellsuche",
@ -1535,10 +1561,21 @@
"note_detail": {
"could_not_find_typewidget": "Konnte typeWidget für Typ {{type}} nicht finden",
"printing": "Druckvorgang läuft…",
"printing_pdf": "PDF-Export läuft…"
"printing_pdf": "PDF-Export läuft…",
"print_report_title": "Druckreport",
"print_report_collection_details_button": "Details anzeigen",
"print_report_collection_details_ignored_notes": "Ignorierte Notizen"
},
"note_title": {
"placeholder": "Titel der Notiz hier eingeben…"
"placeholder": "Titel der Notiz hier eingeben…",
"created_on": "Erstellt am <Value />",
"last_modified": "Bearbeitet am <Value />",
"note_type_switcher_label": "Ändere von {{type}} zu:",
"note_type_switcher_others": "Andere Notizart",
"note_type_switcher_templates": "Template",
"note_type_switcher_collection": "Sammlung",
"edited_notes": "Notizen, bearbeitet an diesem Tag",
"promoted_attributes": "Hervorgehobene Attribute"
},
"search_result": {
"no_notes_found": "Es wurden keine Notizen mit den angegebenen Suchparametern gefunden.",
@ -1567,7 +1604,8 @@
},
"toc": {
"table_of_contents": "Inhaltsverzeichnis",
"options": "Optionen"
"options": "Optionen",
"no_headings": "Keine Überschriften."
},
"watched_file_update_status": {
"file_last_modified": "Datei <code class=\"file-path\"></code> wurde zuletzt geändert am <span class=\"file-last-modified\"></span>.",
@ -2106,5 +2144,10 @@
},
"popup-editor": {
"maximize": "Wechsele zum vollständigen Editor"
},
"experimental_features": {
"title": "Experimentelle Optionen",
"disclaimer": "Diese Optionen sind experimentell und können Instabilitäten verursachen. Achtsam zu verwenden.",
"new_layout_name": "Neues Layout"
}
}

View File

@ -22,6 +22,12 @@
"bundle-error": {
"title": "Echec du chargement d'un script personnalisé",
"message": "Le script de la note avec l'ID \"{{id}}\", intitulé \"{{title}}\" n'a pas pu être exécuté à cause de\n\n{{message}}"
},
"widget-list-error": {
"title": "Impossible d'obtenir la liste des widgets depuis le serveur"
},
"widget-render-error": {
"title": "Rendu impossible d'un widget React custom"
}
},
"add_link": {
@ -757,7 +763,11 @@
"note_icon": {
"change_note_icon": "Changer l'icône de note",
"search": "Recherche :",
"reset-default": "Réinitialiser l'icône par défaut"
"reset-default": "Réinitialiser l'icône par défaut",
"filter": "Filtre",
"filter-none": "Toutes les icônes",
"filter-default": "Icônes par défaut",
"icon_tooltip": "{{name}}\nPack d'icônes : {{iconPack}}"
},
"basic_properties": {
"note_type": "Type de note",
@ -1541,7 +1551,8 @@
"refresh-saved-search-results": "Rafraîchir les résultats de recherche enregistrée",
"create-child-note": "Créer une note enfant",
"unhoist": "Désactiver le focus",
"toggle-sidebar": "Basculer la barre latérale"
"toggle-sidebar": "Basculer la barre latérale",
"dropping-not-allowed": "Lâcher des notes à cet endroit n'est pas autorisé"
},
"title_bar_buttons": {
"window-on-top": "Épingler cette fenêtre au premier plan"
@ -1549,10 +1560,19 @@
"note_detail": {
"could_not_find_typewidget": "Impossible de trouver typeWidget pour le type '{{type}}'",
"printing": "Impression en cours...",
"printing_pdf": "Export au format PDF en cours..."
"printing_pdf": "Export au format PDF en cours...",
"print_report_title": "Imprimer le rapport",
"print_report_collection_details_button": "Consulter les détails",
"print_report_collection_details_ignored_notes": "Notes ignorées"
},
"note_title": {
"placeholder": "saisir le titre de la note ici..."
"placeholder": "saisir le titre de la note ici...",
"created_on": "Créé le <Value />",
"last_modified": "Modifié le <Value />",
"note_type_switcher_label": "Basculer de {{type}} à :",
"note_type_switcher_others": "Autre type de note",
"note_type_switcher_templates": "Modèle",
"note_type_switcher_collection": "Collection"
},
"search_result": {
"no_notes_found": "Aucune note n'a été trouvée pour les paramètres de recherche donnés.",
@ -1581,7 +1601,8 @@
},
"toc": {
"table_of_contents": "Table des matières",
"options": "Options"
"options": "Options",
"no_headings": "Pas d'en-tête."
},
"watched_file_update_status": {
"file_last_modified": "Le fichier <code class=\"file-path\"></code> a été modifié pour la dernière fois le <span class=\"file-last-modified\"></span>.",
@ -1682,7 +1703,8 @@
"copy-link": "Copier le lien",
"paste": "Coller",
"paste-as-plain-text": "Coller comme texte brut",
"search_online": "Rechercher «{{term}}» avec {{searchEngine}}"
"search_online": "Rechercher «{{term}}» avec {{searchEngine}}",
"search_in_trilium": "Rechercher \"{{term}}\" dans Trilium"
},
"image_context_menu": {
"copy_reference_to_clipboard": "Copier la référence dans le presse-papiers",
@ -1991,7 +2013,8 @@
"add-column": "Ajouter une colonne",
"add-column-placeholder": "Entrez le nom de la colonne...",
"edit-note-title": "Cliquez pour modifier le titre de la note",
"edit-column-title": "Cliquez pour modifier le titre de la colonne"
"edit-column-title": "Cliquez pour modifier le titre de la colonne",
"column-already-exists": "Cette colonne existe déjà dans le tableau."
},
"presentation_view": {
"edit-slide": "Modifier cette diapositive",
@ -2075,7 +2098,8 @@
"button_title": "Exporter le diagramme au format PNG"
},
"svg": {
"export_to_png": "Le diagramme n'a pas pu être exporté au format PNG."
"export_to_png": "Le diagramme n'a pas pu être exporté au format PNG.",
"export_to_svg": "Le diagramme n'a pas pu être exporté en SVG."
},
"code_theme": {
"title": "Apparence",
@ -2108,6 +2132,10 @@
},
"read-only-info": {
"read-only-note": "Vous consultez actuellement une note en lecture seule.",
"auto-read-only-note": "Cette note s'affiche en mode lecture seule pour un chargement plus rapide."
"auto-read-only-note": "Cette note s'affiche en mode lecture seule pour un chargement plus rapide.",
"edit-note": "Editer la note"
},
"calendar_view": {
"delete_note": "Effacer la note..."
}
}

View File

@ -1,5 +1,6 @@
{
"about": {
"title": "ट्रिलियम नोट्स के बारें में"
"title": "ट्रिलियम नोट्स के बारें में",
"build_date": "निर्माण की तारीख:"
}
}

View File

@ -17,6 +17,9 @@ async function main() {
// Integrate the client.
build.triggerBuildAndCopyTo("apps/client", "public/");
build.deleteFromOutput("public/webpack-stats.json");
// pdf.js
build.triggerBuildAndCopyTo("packages/pdfjs-viewer", "pdfjs-viewer");
}
main();

View File

@ -1 +1,8 @@
{}
{
"keyboard_actions": {
"back-in-note-history": "इतिहास में पिछले नोट पर जाएं",
"forward-in-note-history": "इतिहास में अगले नोट पर जाएं",
"open-jump-to-note-dialog": "\"Jump to Note\" डायलॉग खोलें",
"open-command-palette": "कमांड पैलेट खोलें"
}
}

View File

@ -73,7 +73,7 @@ export function getPdfjsAssetDir() {
return path.join(srcRoot, "../../packages/pdfjs-viewer/dist");
}
const resourceDir = getResourceDir();
return path.join(resourceDir, "pdfjs-viewer/assets");
return path.join(resourceDir, "pdfjs-viewer");
}
export function getClientDir() {

View File

@ -1,5 +1,10 @@
{
"get-started": {
"title": "शुरू करें"
"title": "शुरू करें",
"desktop_title": "डेस्कटॉप एप्लिकेशन डाउनलोड करें (v{{version}})",
"older_releases": "पुराने रिलीज़ देखें"
},
"hero_section": {
"title": "अपने विचारों को व्यवस्थित करें। अपना व्यक्तिगत नॉलेज बेस बनाएं।"
}
}

2
docs/README-hi.md vendored
View File

@ -34,7 +34,7 @@ application with focus on building large personal knowledge bases.
<img src="./app.png" alt="Trilium Screenshot" width="1000">
## ⏬ Download
## ⏬ डाउनलोड कीजिए
- [Latest release](https://github.com/TriliumNext/Trilium/releases/latest)
stable version, recommended for most users.
- [Nightly build](https://github.com/TriliumNext/Trilium/releases/tag/nightly)