Merge branch 'main' of https://github.com/TriliumNext/Trilium into feat/theme/improvements

This commit is contained in:
Adorian Doran 2025-08-30 01:06:02 +03:00
commit 526c5a6dd8
2 changed files with 15 additions and 2 deletions

View File

@ -982,6 +982,11 @@ div[data-notify="container"] {
font-family: var(--monospace-font-family);
}
svg.ck-icon .note-icon {
color: var(--main-text-color);
font-size: 20px;
}
.ck-content {
--ck-content-font-family: var(--detail-font-family);
--ck-content-font-size: 1.1em;

View File

@ -4,7 +4,6 @@ import type LoadResults from "../../../services/load_results.js";
import search from "../../../services/search.js";
import type { TemplateDefinition } from "@triliumnext/ckeditor5";
import appContext from "../../../components/app_context.js";
import TemplateIcon from "@ckeditor/ckeditor5-icons/theme/icons/template.svg?raw";
import type FNote from "../../../entities/fnote.js";
interface TemplateData {
@ -31,7 +30,7 @@ export default async function getTemplates() {
definitions.push({
title: snippet.title,
data: () => templateCache.get(snippet.noteId)?.content ?? "",
icon: TemplateIcon,
icon: buildIcon(snippet),
description
});
}
@ -49,6 +48,15 @@ async function invalidateCacheFor(snippet: FNote) {
return data;
}
function buildIcon(snippet: FNote) {
return /*xml*/`\
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<foreignObject x="0" y="0" width="20" height="20">
<span class="note-icon ${snippet.getIcon()} ${snippet.getColorClass()}" xmlns="http://www.w3.org/1999/xhtml"></span>
</foreignObject>
</svg>`
}
function handleFullReload() {
console.warn("Full text editor reload needed");
appContext.triggerCommand("reloadTextEditor");