Compare commits

..

3 Commits

Author SHA1 Message Date
SiriusXT
be19d1f5b5 fix(split pane): hide the close button when no split panes exist 2025-11-17 09:24:18 +08:00
SiriusXT
a22687e2d8 Merge branch 'main' into siriusbcd_close_split 2025-11-16 20:15:43 +08:00
SiriusXT
44475853df feat(split): allow closing any split pane 2025-11-16 20:12:56 +08:00
26 changed files with 692 additions and 877 deletions

View File

@@ -302,10 +302,7 @@
"edit_branch_prefix": "Editează prefixul ramurii",
"help_on_tree_prefix": "Informații despre prefixe de ierarhie",
"prefix": "Prefix: ",
"save": "Salvează",
"edit_branch_prefix_multiple": "Editează prefixul pentru {{count}} ramuri",
"branch_prefix_saved_multiple": "Prefixul a fost modificat pentru {{count}} ramuri.",
"affected_branches": "Ramuri afectate ({{count}}):"
"save": "Salvează"
},
"bulk_actions": {
"affected_notes": "Notițe afectate",
@@ -540,8 +537,7 @@
"opml_version_1": "OPML v1.0 - text simplu",
"opml_version_2": "OPML v2.0 - permite și HTML",
"format_html": "HTML - recomandat deoarece păstrează toata formatarea",
"format_pdf": "PDF - cu scopul de printare sau partajare.",
"share-format": "HTML pentru publicare web - folosește aceeași temă pentru notițele partajate, dar se pot publica într-un website static."
"format_pdf": "PDF - cu scopul de printare sau partajare."
},
"fast_search": {
"description": "Căutarea rapidă dezactivează căutarea la nivel de conținut al notițelor cu scopul de a îmbunătăți performanța de căutare pentru baze de date mari.",
@@ -757,8 +753,7 @@
"placeholder": "Introduceți etichetele HTML, câte unul pe linie",
"reset_button": "Resetează la lista implicită",
"title": "Etichete HTML la importare"
},
"importZipRecommendation": "Când importați un fișier ZIP, ierarhia notițelor va reflecta structura subdirectoarelor din arhivă."
}
},
"include_archived_notes": {
"include_archived_notes": "Include notițele arhivate"
@@ -804,8 +799,7 @@
"default_description": "În mod implicit Trilium limitează lățimea conținutului pentru a îmbunătăți lizibilitatea pentru ferestrele maximizate pe ecrane late.",
"max_width_label": "Lungimea maximă a conținutului",
"max_width_unit": "pixeli",
"title": "Lățime conținut",
"centerContent": "Centrează conținutul"
"title": "Lățime conținut"
},
"mobile_detail_menu": {
"delete_this_note": "Șterge această notiță",
@@ -862,8 +856,7 @@
"convert_into_attachment_failed": "Nu s-a putut converti notița „{{title}}”.",
"convert_into_attachment_successful": "Notița „{{title}}” a fost convertită în atașament.",
"convert_into_attachment_prompt": "Doriți convertirea notiței „{{title}}” într-un atașament al notiței părinte?",
"print_pdf": "Exportare ca PDF...",
"open_note_on_server": "Deschide notița pe server"
"print_pdf": "Exportare ca PDF..."
},
"note_erasure_timeout": {
"deleted_notes_erased": "Notițele șterse au fost eliminate permanent.",
@@ -1253,11 +1246,11 @@
"timeout_unit": "milisecunde"
},
"table_of_contents": {
"description": "Cuprinsul va apărea în notițele de tip text atunci când notița are un număr de titluri mai mare decât cel definit. Acest număr se poate personaliza:",
"description": "Tabela de conținut va apărea în notițele de tip text atunci când notița are un număr de titluri mai mare decât cel definit. Acest număr se poate personaliza:",
"unit": "titluri",
"disable_info": "De asemenea se poate dezactiva cuprinsul setând o valoare foarte mare.",
"shortcut_info": "Se poate configura și o scurtatură pentru a comuta rapid vizibilitatea panoului din dreapta (inclusiv cuprinsul) în Opțiuni -> Scurtături (denumirea „toggleRightPane”).",
"title": "Cuprins"
"disable_info": "De asemenea se poate dezactiva tabela de conținut setând o valoare foarte mare.",
"shortcut_info": "Se poate configura și o scurtatură pentru a comuta rapid vizibilitatea panoului din dreapta (inclusiv tabela de conținut) în Opțiuni -> Scurtături (denumirea „toggleRightPane”).",
"title": "Tabelă de conținut"
},
"text_auto_read_only_size": {
"description": "Marchează pragul în care o notiță de o anumită dimensiune va fi afișată în mod de citire (pentru motive de performanță).",
@@ -1510,9 +1503,7 @@
"window-on-top": "Menține fereastra mereu vizibilă"
},
"note_detail": {
"could_not_find_typewidget": "Nu s-a putut găsi widget-ul corespunzător tipului „{{type}}”",
"printing": "Imprimare în curs...",
"printing_pdf": "Exportare ca PDF în curs..."
"could_not_find_typewidget": "Nu s-a putut găsi widget-ul corespunzător tipului „{{type}}”"
},
"note_title": {
"placeholder": "introduceți titlul notiței aici..."
@@ -2023,8 +2014,7 @@
"new-item-placeholder": "Introduceți titlul notiței...",
"add-column-placeholder": "Introduceți denumirea coloanei...",
"edit-note-title": "Clic pentru a edita titlul notiței",
"edit-column-title": "Clic pentru a edita titlul coloanei",
"column-already-exists": "Această coloană deja există."
"edit-column-title": "Clic pentru a edita titlul coloanei"
},
"command_palette": {
"tree-action-name": "Listă de notițe: {{name}}",
@@ -2086,14 +2076,5 @@
"edit-slide": "Editați acest slide",
"start-presentation": "Începeți prezentarea",
"slide-overview": "Afișați o imagine de ansamblu a slide-urilor"
},
"read-only-info": {
"read-only-note": "Vizualizați o notiță în modul doar în citire.",
"auto-read-only-note": "Această notiță este afișată în modul doar în citire din motive de performanță.",
"auto-read-only-learn-more": "Mai multe detalii",
"edit-note": "Editează notița"
},
"calendar_view": {
"delete_note": "Șterge notița..."
}
}

View File

@@ -1,17 +1,19 @@
import { useEffect, useState } from "preact/hooks";
import { t } from "../../services/i18n";
import ActionButton from "../react/ActionButton";
import { useNoteContext, useTriliumEvent } from "../react/hooks";
import { useNoteContext, useTriliumEvents } from "../react/hooks";
import appContext from "../../components/app_context";
export default function ClosePaneButton() {
const { noteContext, ntxId, parentComponent } = useNoteContext();
const [isEnabled, setIsEnabled] = useState(false);
function refresh() {
setIsEnabled(!!(noteContext && !!noteContext.mainNtxId));
const isMainOfSomeContext = appContext.tabManager.noteContexts.some(c => c.mainNtxId === ntxId);
setIsEnabled(!!(noteContext && (!!noteContext.mainNtxId || isMainOfSomeContext)));
}
useTriliumEvent("noteContextReorder", refresh);
useTriliumEvents(["noteContextRemoved", "noteContextReorder", "newNoteContextCreated"], refresh);
useEffect(refresh, [ntxId]);
return (

View File

@@ -100,9 +100,23 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
}
async closeThisNoteSplitCommand({ ntxId }: CommandListenerData<"closeThisNoteSplit">) {
if (ntxId) {
await appContext.tabManager.removeNoteContext(ntxId);
if (!ntxId) return;
const contexts = appContext.tabManager.noteContexts;
const currentIndex = contexts.findIndex((c) => c.ntxId === ntxId);
if (currentIndex === -1) return;
const isRemoveMainContext = !contexts[currentIndex].mainNtxId;
if (isRemoveMainContext && currentIndex + 1 <= contexts.length) {
const ntxIds = contexts.map((c) => c.ntxId).filter((c) => !!c) as string[];
this.triggerCommand("noteContextReorder", {
ntxIdsInOrder: ntxIds,
oldMainNtxId: ntxId,
newMainNtxId: ntxIds[currentIndex + 1]
});
}
await appContext.tabManager.removeNoteContext(ntxId);
}
async moveThisNoteSplitCommand({ ntxId, isMovingLeft }: CommandListenerData<"moveThisNoteSplit">) {

View File

@@ -1,16 +1,15 @@
import { useCallback, useEffect, useRef } from "preact/hooks";
import { TypeWidgetProps } from "./type_widget";
import { MindElixirData, MindElixirInstance, Operation, Options, default as VanillaMindElixir } from "mind-elixir";
import { MindElixirData, MindElixirInstance, Operation, default as VanillaMindElixir } from "mind-elixir";
import { HTMLAttributes, RefObject } from "preact";
// allow node-menu plugin css to be bundled by webpack
import nodeMenu from "@mind-elixir/node-menu";
import "mind-elixir/style";
import "@mind-elixir/node-menu/dist/style.css";
import "./MindMap.css";
import { useEditorSpacedUpdate, useNoteLabelBoolean, useSyncedRef, useTriliumEvent, useTriliumEvents, useTriliumOption } from "../react/hooks";
import { useEditorSpacedUpdate, useNoteLabelBoolean, useSyncedRef, useTriliumEvent, useTriliumEvents } from "../react/hooks";
import { refToJQuerySelector } from "../react/react_utils";
import utils from "../../services/utils";
import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";
const NEW_TOPIC_NAME = "";
@@ -22,24 +21,6 @@ interface MindElixirProps {
onChange?: () => void;
}
const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, Options["locale"] | null> = {
ar: null,
cn: "zh_CN",
de: null,
en: "en",
en_rtl: "en",
es: "es",
fr: "fr",
it: "it",
ja: "ja",
pt: "pt",
pt_br: "pt",
ro: null,
ru: "ru",
tw: "zh_TW",
uk: null
};
export default function MindMap({ note, ntxId, noteContext }: TypeWidgetProps) {
const apiRef = useRef<MindElixirInstance>(null);
const containerRef = useRef<HTMLDivElement>(null);
@@ -129,14 +110,12 @@ export default function MindMap({ note, ntxId, noteContext }: TypeWidgetProps) {
function MindElixir({ containerRef: externalContainerRef, containerProps, apiRef: externalApiRef, onChange, editable }: MindElixirProps) {
const containerRef = useSyncedRef<HTMLDivElement>(externalContainerRef, null);
const apiRef = useRef<MindElixirInstance>(null);
const [ locale ] = useTriliumOption("locale");
function reinitialize() {
if (!containerRef.current) return;
const mind = new VanillaMindElixir({
el: containerRef.current,
locale: LOCALE_MAPPINGS[locale as DISPLAYABLE_LOCALE_IDS] ?? undefined,
editable
});
@@ -164,7 +143,7 @@ function MindElixir({ containerRef: externalContainerRef, containerProps, apiRef
if (data) {
apiRef.current?.init(data);
}
}, [ editable, locale ]);
}, [ editable ]);
// On change listener.
useEffect(() => {

View File

@@ -1,7 +1,7 @@
import { Excalidraw } from "@excalidraw/excalidraw";
import { TypeWidgetProps } from "../type_widget";
import "@excalidraw/excalidraw/index.css";
import { useNoteLabelBoolean, useTriliumOption } from "../../react/hooks";
import { useNoteLabelBoolean } from "../../react/hooks";
import { useCallback, useMemo, useRef } from "preact/hooks";
import { type ExcalidrawImperativeAPI, type AppState } from "@excalidraw/excalidraw/types";
import options from "../../../services/options";
@@ -9,8 +9,6 @@ import "./Canvas.css";
import { NonDeletedExcalidrawElement } from "@excalidraw/excalidraw/element/types";
import { goToLinkExt } from "../../../services/link";
import useCanvasPersistence from "./persistence";
import { LANGUAGE_MAPPINGS } from "./i18n";
import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";
// currently required by excalidraw, in order to allows self-hosting fonts locally.
// this avoids making excalidraw load the fonts from an external CDN.
@@ -23,7 +21,6 @@ export default function Canvas({ note, noteContext }: TypeWidgetProps) {
const documentStyle = window.getComputedStyle(document.documentElement);
return documentStyle.getPropertyValue("--theme-style")?.trim() as AppState["theme"];
}, []);
const [ locale ] = useTriliumOption("locale");
const persistence = useCanvasPersistence(note, noteContext, apiRef, themeStyle, isReadOnly);
/** Use excalidraw's native zoom instead of the global zoom. */
@@ -61,7 +58,6 @@ export default function Canvas({ note, noteContext }: TypeWidgetProps) {
detectScroll={false}
handleKeyboardGlobally={false}
autoFocus={false}
langCode={LANGUAGE_MAPPINGS[locale as DISPLAYABLE_LOCALE_IDS] ?? undefined}
UIOptions={{
canvasActions: {
saveToActiveFile: false,

View File

@@ -1,29 +0,0 @@
import { LOCALES } from "@triliumnext/commons";
import { readdirSync } from "fs";
import { join } from "path";
import { describe, expect, it } from "vitest";
import { LANGUAGE_MAPPINGS } from "./i18n.js";
const localeDir = join(__dirname, "../../../../../../node_modules/@excalidraw/excalidraw/dist/prod/locales");
describe("Canvas i18n", () => {
it("all languages are mapped correctly", () => {
// Read the node_modules dir to obtain all the supported locales.
const supportedLanguageCodes = new Set<string>();
for (const file of readdirSync(localeDir)) {
if (file.startsWith("percentages")) continue;
const match = file.match("^[a-z]{2,3}(?:-[A-Z]{2,3})?");
if (!match) continue;
supportedLanguageCodes.add(match[0]);
}
// Cross-check the locales.
for (const locale of LOCALES) {
if (locale.contentOnly || locale.devOnly) continue;
const languageCode = LANGUAGE_MAPPINGS[locale.id];
if (!supportedLanguageCodes.has(languageCode)) {
expect.fail(`Unable to find locale for ${locale.id} -> ${languageCode}.`)
}
}
});
});

View File

@@ -1,19 +0,0 @@
import type { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";
export const LANGUAGE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, string | null> = {
ar: "ar-SA",
cn: "zh-CN",
de: "de-DE",
en: "en",
en_rtl: "en",
es: "es-ES",
fr: "fr-FR",
it: "it-IT",
ja: "ja-JP",
pt: "pt-PT",
pt_br: "pt-BR",
ro: "ro-RO",
ru: "ru-RU",
tw: "zh-TW",
uk: "uk-UA"
};

View File

@@ -1,10 +1,9 @@
import { HTMLProps, RefObject, useEffect, useImperativeHandle, useRef, useState } from "preact/compat";
import { PopupEditor, ClassicEditor, EditorWatchdog, type WatchdogConfig, CKTextEditor, TemplateDefinition } from "@triliumnext/ckeditor5";
import { buildConfig, BuildEditorOptions } from "./config";
import { useKeyboardShortcuts, useLegacyImperativeHandlers, useNoteContext, useSyncedRef, useTriliumOption } from "../../react/hooks";
import { useKeyboardShortcuts, useLegacyImperativeHandlers, useNoteContext, useSyncedRef } from "../../react/hooks";
import link from "../../../services/link";
import froca from "../../../services/froca";
import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";
export type BoxSize = "small" | "medium" | "full";
@@ -38,7 +37,6 @@ interface CKEditorWithWatchdogProps extends Pick<HTMLProps<HTMLDivElement>, "cla
export default function CKEditorWithWatchdog({ containerRef: externalContainerRef, content, contentLanguage, className, tabIndex, isClassicEditor, watchdogRef: externalWatchdogRef, watchdogConfig, onNotificationWarning, onWatchdogStateChange, onChange, onEditorInitialized, editorApi, templates }: CKEditorWithWatchdogProps) {
const containerRef = useSyncedRef<HTMLDivElement>(externalContainerRef, null);
const watchdogRef = useRef<EditorWatchdog>(null);
const [ uiLanguage ] = useTriliumOption("locale");
const [ editor, setEditor ] = useState<CKTextEditor>();
const { parentComponent } = useNoteContext();
@@ -158,7 +156,6 @@ export default function CKEditorWithWatchdog({ containerRef: externalContainerRe
const editor = await buildEditor(container, !!isClassicEditor, {
forceGplLicense: false,
isClassicEditor: !!isClassicEditor,
uiLanguage: uiLanguage as DISPLAYABLE_LOCALE_IDS,
contentLanguage: contentLanguage ?? null,
templates
});
@@ -183,7 +180,7 @@ export default function CKEditorWithWatchdog({ containerRef: externalContainerRe
watchdog.create(container);
return () => watchdog.destroy();
}, [ contentLanguage, templates, uiLanguage ]);
}, [ contentLanguage, templates ]);
// React to content changes.
useEffect(() => editor?.setData(content ?? ""), [ editor, content ]);

View File

@@ -1,39 +0,0 @@
import { DISPLAYABLE_LOCALE_IDS, LOCALES } from "@triliumnext/commons";
import { describe, expect, it, vi } from "vitest";
vi.mock('../../../services/options.js', () => ({
default: {
get(name: string) {
if (name === "allowedHtmlTags") return "[]";
return undefined;
},
getJson: () => []
}
}));
describe("CK config", () => {
it("maps all languages correctly", async () => {
const { buildConfig } = await import("./config.js");
for (const locale of LOCALES) {
if (locale.contentOnly || locale.devOnly) continue;
const config = await buildConfig({
uiLanguage: locale.id as DISPLAYABLE_LOCALE_IDS,
contentLanguage: locale.id,
forceGplLicense: false,
isClassicEditor: false,
templates: []
});
let expectedLocale = locale.id.substring(0, 2);
if (expectedLocale === "cn") expectedLocale = "zh";
if (expectedLocale === "tw") expectedLocale = "zh-tw";
if (locale.id !== "en") {
expect((config.language as any).ui).toMatch(new RegExp(`^${expectedLocale}`));
expect(config.translations, locale.id).toBeDefined();
expect(config.translations, locale.id).toHaveLength(2);
}
}
});
});

View File

@@ -1,5 +1,5 @@
import { ALLOWED_PROTOCOLS, DISPLAYABLE_LOCALE_IDS, MIME_TYPE_AUTO } from "@triliumnext/commons";
import { buildExtraCommands, type EditorConfig, getCkLocale, PREMIUM_PLUGINS, TemplateDefinition } from "@triliumnext/ckeditor5";
import { ALLOWED_PROTOCOLS, MIME_TYPE_AUTO } from "@triliumnext/commons";
import { buildExtraCommands, type EditorConfig, PREMIUM_PLUGINS, TemplateDefinition } from "@triliumnext/ckeditor5";
import { getHighlightJsNameForMime } from "../../../services/mime_types.js";
import options from "../../../services/options.js";
import { ensureMimeTypesForHighlighting, isSyntaxHighlightEnabled } from "../../../services/syntax_highlight.js";
@@ -17,7 +17,6 @@ export const OPEN_SOURCE_LICENSE_KEY = "GPL";
export interface BuildEditorOptions {
forceGplLicense: boolean;
isClassicEditor: boolean;
uiLanguage: DISPLAYABLE_LOCALE_IDS;
contentLanguage: string | null;
templates: TemplateDefinition[];
}
@@ -162,8 +161,9 @@ export async function buildConfig(opts: BuildEditorOptions): Promise<EditorConfi
htmlSupport: {
allow: JSON.parse(options.get("allowedHtmlTags"))
},
removePlugins: getDisabledPlugins(),
...await getCkLocale(opts.uiLanguage)
// This value must be kept in sync with the language defined in webpack.config.js.
language: "en",
removePlugins: getDisabledPlugins()
};
// Set up content language.

View File

@@ -5,14 +5,14 @@
<p>In Trilium, attributes are key-value pairs assigned to notes, providing
additional metadata or functionality. There are two primary types of attributes:</p>
<ol>
<li>
<li data-list-item-id="ef9c097e5af906754a4056ace4d16dbee">
<p><a class="reference-link" href="#root/_help_HI6GBBIduIgv">Labels</a>&nbsp;can
be used for a variety of purposes, such as storing metadata or configuring
the behavior of notes. Labels are also searchable, enhancing note retrieval.</p>
<p>For more information, including predefined labels, see&nbsp;<a class="reference-link"
href="#root/_help_HI6GBBIduIgv">Labels</a>.</p>
</li>
<li>
<li data-list-item-id="e8416f6f5188a4d8a25917c610a1482c0">
<p><a class="reference-link" href="#root/_help_Cq5X6iKQop6R">Relations</a>&nbsp;define
connections between notes, similar to links. These can be used for metadata
and scripting purposes.</p>
@@ -27,24 +27,25 @@
<p>Conceptually there are two types of attributes (applying to both labels
and relations):</p>
<ol>
<li><strong>System attributes</strong>
<li data-list-item-id="e778cee42c209e30e41f7d2c99895495d"><strong>System attributes</strong>
<br>As the name suggest, these attributes have a special meaning since they
are interpreted by Trilium. For example the <code>color</code> attribute
will change the color of the note as displayed in the&nbsp;<a class="reference-link"
href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;and links, and <code>iconClass</code> will
change the icon of a note.</li>
<li><strong>User-defined attributes</strong>
href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;and
links, and <code>iconClass</code> will change the icon of a note.
<br>&nbsp;</li>
<li data-list-item-id="e0ca0ab889b471e7c18e3d4f6ae6a61e0"><strong>User-defined attributes</strong>
<br>These are free-form labels or relations that can be used by the user.
They can be used purely for categorization purposes (especially if combined
with&nbsp;<a class="reference-link" href="#root/_help_eIg8jdvaoNNd">Search</a>),
with&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/wArbEsdSae6g/_help_eIg8jdvaoNNd">Search</a>),
or they can be given meaning through the use of&nbsp;<a class="reference-link"
href="#root/_help_CdNpE2pqjmI6">Scripting</a>.</li>
href="#root/pOsGYCXsbNQG/_help_CdNpE2pqjmI6">Scripting</a>.</li>
</ol>
<p>In practice, Trilium makes no direct distinction of whether an attribute
is a system one or a user-defined one. A label or relation is considered
a system attribute if it matches one of the built-in names (e.g. like the
aforementioned <code>iconClass</code>). Keep this in mind when creating
&nbsp;<a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;in
&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;in
order not to accidentally alter a system attribute (unless intended).</p>
<h2>Viewing the list of attributes</h2>
<p>Both the labels and relations for the current note are displayed in the <em>Owned Attributes</em> section
@@ -55,13 +56,14 @@
<p>In the list of attributes, labels are prefixed with the <code>#</code> character
whereas relations are prefixed with the <code>~</code> character.</p>
<h2>Attribute Definitions and Promoted Attributes</h2>
<p><a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;create
<p><a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;create
a form-like editing experience for attributes, which makes it easy to enhancing
the organization and management of attributes</p>
<h2>Multiplicity</h2>
<p>Attributes in Trilium can be "multi-valued", meaning multiple attributes
with the same name can co-exist. This can be combined with&nbsp;<a class="reference-link"
href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;to easily add them.</p>
href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;to
easily add them.</p>
<h2>Attribute Inheritance</h2>
<p>Trilium supports attribute inheritance, allowing child notes to inherit
attributes from their parents. For more information, see&nbsp;<a class="reference-link"

View File

@@ -22,28 +22,30 @@
value are strings.</p>
<p>The <em>Attribute definition</em> specifies how should this value be interpreted:</p>
<ul>
<li>Is it just string, or is it a date?</li>
<li>Should we allow multiple values or note?</li>
<li>Should we <em>promote</em> the attribute or not?</li>
<li data-list-item-id="e73e2d8dffca4fe59d009bfc5a245da88">Is it just string, or is it a date?</li>
<li data-list-item-id="e115a58c2d81149f481c385479cf06965">Should we allow multiple values or note?</li>
<li data-list-item-id="eb8cab0b2fdcefb7af9128f63b3b9f4ee">Should we <em>promote</em> the attribute or not?</li>
</ul>
<h2>Creating a new promoted attribute definition</h2>
<p>To create a new promoted attribute:</p>
<ol>
<li>Go to a note.</li>
<li>Go to <em>Owned Attributes</em> in the&nbsp;<a class="reference-link" href="#root/_help_BlN9DFI679QC">Ribbon</a>.</li>
<li>Press the + button.</li>
<li>Select either <em>Add new label definition</em> or <em>Add new relation definition</em>.</li>
<li>Select the name which will be name of the label or relation that will
<li data-list-item-id="e118d34c98d285e3a7492876f73a49ed5">Go to a note.</li>
<li data-list-item-id="e480cc90d938f7f728011679df29f6ce0">Go to <em>Owned Attributes</em> in the&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_BlN9DFI679QC">Ribbon</a>.</li>
<li
data-list-item-id="e40a26a8a32714572e670d8c7c18d1355">Press the + button.</li>
<li data-list-item-id="e5ba4dcc8ae48c7f043de2c8fc5ec1c2c">Select either <em>Add new label definition</em> or <em>Add new relation definition</em>.</li>
<li
data-list-item-id="e14e894cf6d207a410adbe87c56143799">Select the name which will be name of the label or relation that will
be created when the promoted attribute is edited.</li>
<li>Ensure <em>Promoted</em> is checked in order to display it at the top of
<li data-list-item-id="e5d803cd5a37a7169a5aa770d769f2dd4">Ensure <em>Promoted</em> is checked in order to display it at the top of
notes.</li>
<li>Optionally, choose an <em>Alias</em> which will be displayed next to the
<li data-list-item-id="e50c81da6343840b2a06b46a20e21181e">Optionally, choose an <em>Alias</em> which will be displayed next to the
promoted attribute instead of the attribute name. Generally it's best to
choose a “user-friendly” name since it can contain spaces and other characters
which are not supported as attribute names.</li>
<li>Check <em>Inheritable</em> to apply it to this note and all its descendants.
<li data-list-item-id="e0e08c63296b88ea8ec8ae17104eed366">Check <em>Inheritable</em> to apply it to this note and all its descendants.
To keep it only for the current note, un-check it.</li>
<li>Press “Save &amp; Close” to apply the changes.</li>
<li data-list-item-id="ededc09be314b651d919aebd026cc5b86">Press “Save &amp; Close” to apply the changes.</li>
</ol>
<h2>How attribute definitions actually work</h2>
<p>When a new promoted attribute definition is created, it creates a corresponding
@@ -52,13 +54,12 @@
<p>The only purpose of the attribute definition is to set up a template.
If the attribute was marked as promoted, then it's also displayed to the
user for easy editing.</p>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<figure class="table" style="width:100%;">
<table class="ck-table-resized">
<colgroup>
<col style="width:47.64%;">
<col style="width:52.36%;">
</colgroup>
<tbody>
<tr>
<td>
@@ -83,6 +84,7 @@
</tr>
</tbody>
</table>
</figure>
<p>So there's one attribute for value and one for definition. But notice
how an definition attribute can be made <a href="#root/_help_bwZpz2ajCEwO">Inheritable</a>,
meaning that it's also applied to all descendant notes. In this case, the
@@ -93,22 +95,22 @@
to be able to easily alter them.</p>
<p>Here are a few practical examples:</p>
<ul>
<li><a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>&nbsp;already
<li data-list-item-id="eb7e4e362b582d6bf480375d1e5648ac3"><a class="reference-link" href="#root/pOsGYCXsbNQG/_help_GTwFsgaA0lCt">Collections</a>&nbsp;already
make use of this practice, for example:
<ul>
<li>Calendars add “Start Date”, “End Date”, “Start Time” and “End Time” as
<li data-list-item-id="e0831925d935c7a90f90bd5fed94d089e">Calendars add “Start Date”, “End Date”, “Start Time” and “End Time” as
promoted attributes. These map to system attributes such as <code>startDate</code> which
are then interpreted by the calendar view.</li>
<li><a class="reference-link" href="#root/_help_zP3PMqaG71Ct">Presentation</a>&nbsp;adds
<li data-list-item-id="e4a235f12a7934803ba7706e309511c82"><a class="reference-link" href="#root/pOsGYCXsbNQG/GTwFsgaA0lCt/_help_zP3PMqaG71Ct">Presentation</a>&nbsp;adds
a “Background” promoted attribute for each of the slide to easily be able
to customize.</li>
</ul>
</li>
<li>The Trilium documentation (which is edited in Trilium) uses a promoted
<li data-list-item-id="e9069ad779c177b7ed0d3ece786e73cd3">The Trilium documentation (which is edited in Trilium) uses a promoted
attribute to be able to easily edit the <code>#shareAlias</code> (see&nbsp;
<a
class="reference-link" href="#root/_help_R9pX4DGra2Vt">Sharing</a>) in order to form clean URLs.</li>
<li>If you always edit a particular system attribute such as <code>#color</code>,
class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_R9pX4DGra2Vt">Sharing</a>) in order to form clean URLs.</li>
<li data-list-item-id="ed14685a7279b42a1769be97ffe7f5e8f">If you always edit a particular system attribute such as <code>#color</code>,
simply create a promoted attribute for it to make it easier.</li>
</ul>
<h3>Inverse relation</h3>

View File

@@ -1,9 +1,11 @@
<aside class="admonition important">
<p><a class="reference-link" href="#root/_help_zEY4DaJG4YT5">Attributes</a><a class="reference-link"
href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a><a class="reference-link"
href="#root/_help_zEY4DaJG4YT5">Attributes</a>Starting with Trilium v0.97.0,
the geo map has been converted from a standalone <a href="#root/_help_KSZ04uQ2D1St">note type</a> to
a type of view for the&nbsp;<a class="reference-link" href="#root/_help_0ESUbbAxVnoK">Note List</a>.&nbsp;</p>
<p><a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_zEY4DaJG4YT5">Attributes</a>
<a
class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_OFXdgB2nNk1F">Promoted Attributes</a><a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_zEY4DaJG4YT5">Attributes</a>Starting
with Trilium v0.97.0, the geo map has been converted from a standalone
<a
href="#root/_help_KSZ04uQ2D1St">note type</a>to a type of view for the&nbsp;<a class="reference-link"
href="#root/_help_0ESUbbAxVnoK">Note List</a>.&nbsp;</p>
</aside>
<figure class="image image-style-align-center">
<img style="aspect-ratio:892/675;" src="9_Geo Map_image.png"
@@ -13,12 +15,13 @@
on an attribute. It is also possible to add new notes at a specific location
using the built-in interface.</p>
<h2>Creating a new geo map</h2>
<figure class="table">
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -44,23 +47,24 @@
</tr>
</tbody>
</table>
</figure>
<h2>Repositioning the map</h2>
<ul>
<li>Click and drag the map in order to move across the map.</li>
<li>Use the mouse wheel, two-finger gesture on a touchpad or the +/- buttons
<li data-list-item-id="ec3df228f80922b4531e2dd1a977d81b8">Click and drag the map in order to move across the map.</li>
<li data-list-item-id="ee505c643c5bacffffc42119cc2f19c60">Use the mouse wheel, two-finger gesture on a touchpad or the +/- buttons
on the top-left to adjust the zoom.</li>
</ul>
<p>The position on the map and the zoom are saved inside the map note and
restored when visiting again the note.</p>
<h2>Adding a marker using the map</h2>
<h3>Adding a new note using the plus button</h3>
<figure class="table">
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -74,7 +78,7 @@
<br>If the button is not visible, make sure the button section is visible
by pressing the chevron button (
<img src="17_Geo Map_image.png">) in the top-right of the map.</td>
<td></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>2</td>
@@ -107,28 +111,31 @@
</tr>
</tbody>
</table>
</figure>
<h3>Adding a new note using the contextual menu</h3>
<ol>
<li>Right click anywhere on the map, where to place the newly created marker
<li data-list-item-id="ea014287557d9fbca07dd30b32405f92a">Right click anywhere on the map, where to place the newly created marker
(and corresponding note).</li>
<li>Select <em>Add a marker at this location</em>.</li>
<li>Enter the name of the ne<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>wly
<li data-list-item-id="ef758bd1a52c2ced75e402fd68e3d1e67">Select <em>Add a marker at this location</em>.</li>
<li data-list-item-id="e6f1d66e9d872ac4908a7c11b401a9d80">Enter the name of the ne<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_oPVyFC7WL2Lp">Note Tree</a>wly
created note.</li>
<li>The map should be updated with the new marker.</li>
<li data-list-item-id="eed9a3fbe500d61c76729f6147ceed925">The map should be updated with the new marker.</li>
</ol>
<h3>Adding an existing note on note from the note tree</h3>
<ol>
<li>Select the desired note in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.</li>
<li>Hold the mouse on the note and drag it to the map to the desired location.</li>
<li>The map should be updated with the new marker.</li>
<li data-list-item-id="ecba60e77600a1660e947ce54c633df04">Select the desired note in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.</li>
<li
data-list-item-id="e00bb8f41cf79fef2b5ce215bc678f808">Hold the mouse on the note and drag it to the map to the desired location.</li>
<li
data-list-item-id="e3fc69dc9e44db125872274e68223cd4e">The map should be updated with the new marker.</li>
</ol>
<p>This works for:</p>
<ul>
<li>Notes that are not part of the geo map, case in which a <a href="#root/_help_IakOLONlIfGI">clone</a> will
<li data-list-item-id="e0821dbcf20fa4a83a9cfada4bea95521">Notes that are not part of the geo map, case in which a <a href="#root/_help_IakOLONlIfGI">clone</a> will
be created.</li>
<li>Notes that are a child of the geo map but not yet positioned on the map.</li>
<li>Notes that are a child of the geo map and also positioned, case in which
<li data-list-item-id="e859aa76bcb592afd7414cccb60cdd3ed">Notes that are a child of the geo map but not yet positioned on the map.</li>
<li
data-list-item-id="e74fb2b74919aba44e1a457a5f8aec6b8">Notes that are a child of the geo map and also positioned, case in which
the marker will be relocated to the new position.</li>
</ul>
<aside class="admonition note">
@@ -138,8 +145,10 @@
<h2>How the location of the markers is stored</h2>
<p>The location of a marker is stored in the <code>#geolocation</code> attribute
of the child notes:</p>
<img src="18_Geo Map_image.png"
width="1288" height="278">
<p>
<img src="18_Geo Map_image.png" width="1288"
height="278">
</p>
<p>This value can be added manually if needed. The value of the attribute
is made up of the latitude and longitude separated by a comma.</p>
<h2>Repositioning markers</h2>
@@ -151,16 +160,17 @@ width="1288" height="278">
page (<kbd>Ctrl</kbd>+<kbd>R</kbd> ) to cancel it.</p>
<h2>Interaction with the markers</h2>
<ul>
<li>Hovering over a marker will display a&nbsp;<a class="reference-link" href="#root/_help_lgKX7r3aL30x">Note Tooltip</a>&nbsp;with
<li data-list-item-id="e953e0022167e10d476bbf438b71029ee">Hovering over a marker will display a&nbsp;<a class="reference-link" href="#root/_help_lgKX7r3aL30x">Note Tooltip</a>&nbsp;with
the content of the note it belongs to.
<ul>
<li>Clicking on the note title in the tooltip will navigate to the note in
<li data-list-item-id="e24f6ec1307f470fc8a9c0681282dd424">Clicking on the note title in the tooltip will navigate to the note in
the current view.</li>
</ul>
</li>
<li>Middle-clicking the marker will open the note in a new tab.</li>
<li>Right-clicking the marker will open a contextual menu (as described below).</li>
<li>If the map is in read-only mode, clicking on a marker will open a&nbsp;
<li data-list-item-id="ea6f9b375776db475c00f3d308f170cb1">Middle-clicking the marker will open the note in a new tab.</li>
<li data-list-item-id="e26942774d668ca9d49e1cfc797801516">Right-clicking the marker will open a contextual menu (as described below).</li>
<li
data-list-item-id="edcf8a4a4e252ae3757303fc28c6e549e">If the map is in read-only mode, clicking on a marker will open a&nbsp;
<a
class="reference-link" href="#root/_help_ZjLYv08Rp3qC">Quick edit</a>&nbsp;popup for the corresponding note.</li>
</ul>
@@ -168,24 +178,24 @@ width="1288" height="278">
<p>It's possible to press the right mouse button to display a contextual
menu.</p>
<ol>
<li>If right-clicking an empty section of the map (not on a marker), it allows
<li data-list-item-id="e529cc53e555215e949135d9998ac4d06">If right-clicking an empty section of the map (not on a marker), it allows
to:
<ol>
<li>Displays the latitude and longitude. Clicking this option will copy them
<li data-list-item-id="e18b27ec2d655ca2e29328c6cc899cccf">Displays the latitude and longitude. Clicking this option will copy them
to the clipboard.</li>
<li>Open the location using an external application (if the operating system
<li data-list-item-id="ebecfc3495ce94589ebdaa3479e70a8ea">Open the location using an external application (if the operating system
supports it).</li>
<li>Adding a new marker at that location.</li>
<li data-list-item-id="e1e1e816904064ed2457553dbcf58f373">Adding a new marker at that location.</li>
</ol>
</li>
<li>If right-clicking on a marker, it allows to:
<li data-list-item-id="eadf4de9e1e967bfcbf7274b8e7613c8e">If right-clicking on a marker, it allows to:
<ol>
<li>Displays the latitude and longitude. Clicking this option will copy them
<li data-list-item-id="ebd32992e411b3a755008b1036448f7e9">Displays the latitude and longitude. Clicking this option will copy them
to the clipboard.</li>
<li>Open the location using an external application (if the operating system
<li data-list-item-id="e5e8bf64b872e1bf32a53459b05d05263">Open the location using an external application (if the operating system
supports it).</li>
<li>Open the note in a new tab, split or window.</li>
<li>Remove the marker from the map, which will remove the <code>#geolocation</code> attribute
<li data-list-item-id="ec83b4469031db305a1d3f9a4d36b395d">Open the note in a new tab, split or window.</li>
<li data-list-item-id="e49f6d549515bec0d6bd8bccf3d34d269">Remove the marker from the map, which will remove the <code>#geolocation</code> attribute
of the note. To add it back again, the coordinates have to be manually
added back in.</li>
</ol>
@@ -205,12 +215,13 @@ width="1288" height="278">
<p>The value of the attribute is made up of the latitude and longitude separated
by a comma.</p>
<h3>Adding from Google Maps</h3>
<figure class="table">
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -256,15 +267,16 @@ width="1288" height="278">
</tr>
</tbody>
</table>
</figure>
<h3>Adding from OpenStreetMap</h3>
<p>Similarly to the Google Maps approach:</p>
<figure class="table">
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -299,15 +311,17 @@ width="1288" height="278">
</tr>
</tbody>
</table>
</figure>
<h2>Adding GPS tracks (.gpx)</h2>
<p>Trilium has basic support for displaying GPS tracks on the geo map.</p>
<figure
class="table">
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -347,6 +361,7 @@ width="1288" height="278">
</tr>
</tbody>
</table>
</figure>
<aside class="admonition note">
<p>The starting point of the track will be displayed as a marker, with the
name of the note underneath. The start marker will also respect the icon
@@ -359,9 +374,10 @@ width="1288" height="278">
<p>When a map is in read-only all editing features will be disabled such
as:</p>
<ul>
<li>The add button in the&nbsp;<a class="reference-link" href="#root/_help_XpOYSgsLkTJy">Floating buttons</a>.</li>
<li>Dragging markers.</li>
<li>Editing from the contextual menu (removing locations or adding new items).</li>
<li data-list-item-id="e78bca8f945a953c13efaf287001d0edb">The add button in the&nbsp;<a class="reference-link" href="#root/_help_XpOYSgsLkTJy">Floating buttons</a>.</li>
<li
data-list-item-id="e022d4fc44c13cf5f529ea18729df3897">Dragging markers.</li>
<li data-list-item-id="e0d024b930867c0253e98c322d3bea021">Editing from the contextual menu (removing locations or adding new items).</li>
</ul>
<p>To enable read-only mode simply press the <em>Lock</em> icon from the&nbsp;
<a
@@ -373,22 +389,23 @@ width="1288" height="278">
manually via the <code>#map:style</code> attribute.</p>
<p>The geo map comes with two different types of styles:</p>
<ul>
<li>Raster styles
<li data-list-item-id="ee111daf471290ce8f16adb8ff6255e78">Raster styles
<ul>
<li>For these styles the map is represented as a grid of images at different
<li data-list-item-id="ebecb845ceda41068a106693c5a1244e3">For these styles the map is represented as a grid of images at different
zoom levels. This is the traditional way OpenStreetMap used to work.</li>
<li>Zoom is slightly restricted.</li>
<li>Currently, the only raster theme is the original OpenStreetMap style.</li>
<li
data-list-item-id="e60a827a1f29105ea8321184d4fb4f0a2">Zoom is slightly restricted.</li>
<li data-list-item-id="e2eb8282db9496f32beeddd53a72fea2a">Currently, the only raster theme is the original OpenStreetMap style.</li>
</ul>
</li>
<li>Vector styles
<li data-list-item-id="e01494841aec47f71245855fe95ad4adb">Vector styles
<ul>
<li>Vector styles are not represented as images, but as geometrical shapes.
<li data-list-item-id="e87e7f879a4c7475769e73f1cfa1bc1b8">Vector styles are not represented as images, but as geometrical shapes.
This makes the rendering much smoother, especially when zooming and looking
at the building edges, for example.</li>
<li>The map can be zoomed in much further.</li>
<li>These come both in a light and a dark version.</li>
<li>The vector styles come from <a href="https://versatiles.org/">VersaTiles</a>,
<li data-list-item-id="ef95260bc6fcb49e63ff708077929b263">The map can be zoomed in much further.</li>
<li data-list-item-id="e339157e4fdacc1b59f6c44cf29711032">These come both in a light and a dark version.</li>
<li data-list-item-id="e9be34d3c44b5dc1ecaa8c856642fc610">The vector styles come from <a href="https://versatiles.org/">VersaTiles</a>,
a free and open-source project providing map tiles based on OpenStreetMap.</li>
</ul>
</li>
@@ -405,7 +422,6 @@ width="1288" height="278">
<img style="aspect-ratio:678/499;" src="13_Geo Map_image.png"
width="678" height="499">
</figure>
<h3>Grid-like artifacts on the map</h3>
<p>This occurs if the application is not at 100% zoom which causes the pixels
of the map to not render correctly due to fractional scaling. The only

View File

@@ -15,86 +15,90 @@
<h2>Interaction</h2>
<h3>Working with columns</h3>
<ul>
<li>Create a new column by pressing <em>Add Column</em> near the last column.
<li data-list-item-id="ed78b9e2ac3200e097ae29e2d528c5e89">Create a new column by pressing <em>Add Column</em> near the last column.
<ul>
<li>Once pressed, a text box will be displayed to set the name of the column.
<li data-list-item-id="ed5ddfffe11d0b328a8072e52be9c7492">Once pressed, a text box will be displayed to set the name of the column.
Press <kbd>Enter</kbd> to confirm, or <kbd>Escape</kbd> to dismiss.</li>
</ul>
</li>
<li>To reorder a column, simply hold the mouse over the title and drag it
<li data-list-item-id="eeecd7ac7b32b1c29e7088ad172411862">To reorder a column, simply hold the mouse over the title and drag it
to the desired position.</li>
<li>To delete a column, right click on its title and select <em>Delete column</em>.</li>
<li>To rename a column, click on the note title.
<li data-list-item-id="e6bc6a4b20236a9d2c382a9564eef528f">To delete a column, right click on its title and select <em>Delete column</em>.</li>
<li
data-list-item-id="ea3bd7adf8521c4c2fb2f3ef0cf4def28">To rename a column, click on the note title.
<ul>
<li>Press Enter to confirm.</li>
<li>Upon renaming a column, the corresponding status attribute of all its
<li data-list-item-id="eb1b0ee1c933e5ca2f4cb57a05b5c07eb">Press Enter to confirm.</li>
<li data-list-item-id="eabddc4dae9e10189e9c7dc087496e846">Upon renaming a column, the corresponding status attribute of all its
notes will be changed in bulk.</li>
</ul>
</li>
<li>If there are many columns, use the mouse wheel to scroll.</li>
<li data-list-item-id="efc70bbc5f0d1dc25e919a5b9e41a54e2">If there are many columns, use the mouse wheel to scroll.</li>
</ul>
<h3>Working with notes</h3>
<ul>
<li>Create a new note in any column by pressing <em>New item</em>
<li data-list-item-id="ee1000666f3c92f251a0262d5e2e30cbf">Create a new note in any column by pressing <em>New item</em>
<ul>
<li>Enter the name of the note and press <kbd>Enter</kbd> or click away. To
<li data-list-item-id="ea3d86963b86f6820335c3994e3c7a00c">Enter the name of the note and press <kbd>Enter</kbd> or click away. To
dismiss the creation of a new note, simply press <kbd>Escape</kbd> or leave
the name empty.</li>
<li>Once created, the new note will have an attribute (<code>status</code> label
<li data-list-item-id="ee8280e96edd38a1bc247ee34ea514c88">Once created, the new note will have an attribute (<code>status</code> label
by default) set to the name of the column.</li>
</ul>
</li>
<li>To open the note, simply click on it.</li>
<li>To change the title of the note directly from the board, hover the mouse
<li data-list-item-id="eb03f96167236a14a55a7538b588bed05">To open the note, simply click on it.</li>
<li data-list-item-id="e29a6c1186c096f5ec6316edd9d44e626">To change the title of the note directly from the board, hover the mouse
over its card and press the edit button on the right.</li>
<li>To change the state of a note, simply drag a note from one column to the
<li data-list-item-id="e201e4e28bad20f532c5e2c0ada6398f7">To change the state of a note, simply drag a note from one column to the
other to change its state.</li>
<li>The order of the notes in each column corresponds to their position in
<li data-list-item-id="e98766e577d03db3dfd8acb850ddf8268">The order of the notes in each column corresponds to their position in
the tree.
<ul>
<li>It's possible to reorder notes simply by dragging them to the desired
<li data-list-item-id="e905430d6d0a5e51e2596611ccb3a0f2a">It's possible to reorder notes simply by dragging them to the desired
position within the same columns.</li>
<li>It's also possible to drag notes across columns, at the desired position.</li>
<li data-list-item-id="e66108d33aee9387b325a554e12a85a73">It's also possible to drag notes across columns, at the desired position.</li>
</ul>
</li>
<li>For more options, right click on a note to display a context menu with
<li data-list-item-id="ebb5b8df8459f8b32d2e1712d268b63df">For more options, right click on a note to display a context menu with
the following options:
<ul>
<li>Open the note in a new tab/split/window or quick edit.</li>
<li>Move the note to any column.</li>
<li>Insert a new note above/below the current one.</li>
<li>Archive/unarchive the current note.</li>
<li>Delete the current note.</li>
<li data-list-item-id="efe7840fa83c41d4a23759927bbe824d2">Open the note in a new tab/split/window or quick edit.</li>
<li data-list-item-id="ea44a2cd0895413620eff0720524e9938">Move the note to any column.</li>
<li data-list-item-id="e505699fc18903f73f96ddfe29a4cc694">Insert a new note above/below the current one.</li>
<li data-list-item-id="e153bf42c4f955bb1421d586f9e7b5498">Archive/unarchive the current note.</li>
<li data-list-item-id="e3c0a0113e5bb4a69a9dfe90862f5ee1e">Delete the current note.</li>
</ul>
</li>
<li>If there are many notes within the column, move the mouse over the column
<li data-list-item-id="e1d6b1303eb3567b51fec1174993dcb71">If there are many notes within the column, move the mouse over the column
and use the mouse wheel to scroll.</li>
</ul>
<h3>Working with the note tree</h3>
<p>It's also possible to add items on the board using the&nbsp;<a class="reference-link"
href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.</p>
<ol>
<li>Select the desired note in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.</li>
<li>Hold the mouse on the note and drag it to the to the desired column.</li>
<li data-list-item-id="ef31c436ab587f75725f224880891c063">Select the desired note in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.</li>
<li
data-list-item-id="e4e3b01f6a772fe9f5ea2bbb91f2b1f6d">Hold the mouse on the note and drag it to the to the desired column.</li>
</ol>
<p>This works for:</p>
<ul>
<li>Notes that are not children of the board, case in which a <a href="#root/_help_IakOLONlIfGI">clone</a> will
<li data-list-item-id="e4b395d82d6e6220afbacdca93b80bea3">Notes that are not children of the board, case in which a <a href="#root/_help_IakOLONlIfGI">clone</a> will
be created.</li>
<li>Notes that are children of the board, but not yet assigned on the board.</li>
<li>Notes that are children of the board, case in which they will be moved
<li data-list-item-id="ef1eeff2b993c6285ed33440520254f7f">Notes that are children of the board, but not yet assigned on the board.</li>
<li
data-list-item-id="ee4610f6d74645e030570bfa9420dad61">Notes that are children of the board, case in which they will be moved
to the new column.</li>
</ul>
<h3>Keyboard interaction</h3>
<p>The board view has mild support for keyboard-based navigation:</p>
<ul>
<li>Use <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> to navigate between
<li data-list-item-id="ef209d621d05adddb8648e11c1aff106a">Use <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> to navigate between
column titles, notes and the “New item” button for each of the columns,
in sequential order.</li>
<li>To rename a column or a note, press <kbd>F2</kbd> while it is focused.</li>
<li>To open a specific note or create a new item, press <kbd>Enter</kbd> while
<li data-list-item-id="e48cffbf4ee1a7452c1e01277c8dd2cbf">To rename a column or a note, press <kbd>F2</kbd> while it is focused.</li>
<li
data-list-item-id="e02a6fb1c98d4e4b75e9e4245cf7cf6b1">To open a specific note or create a new item, press <kbd>Enter</kbd> while
it is focused.</li>
<li>To dismiss a rename of a note or a column, press <kbd>Escape</kbd>.</li>
<li data-list-item-id="eec6f2285fa4d8e95f6a3d40cf51e3d69">To dismiss a rename of a note or a column, press <kbd>Escape</kbd>.</li>
</ul>
<h2>Configuration</h2>
<h3>Displaying custom attributes</h3>
@@ -105,27 +109,30 @@
<p>Note attributes can be displayed on the board to enhance it with custom
information such as adding a Due date for your tasks.</p>
<p>This feature works exclusively via attribute definitions (<a class="reference-link"
href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>). The easiest way to
add these is:</p>
href="#root/zEY4DaJG4YT5/_help_OFXdgB2nNk1F">Promoted Attributes</a>). The easiest
way to add these is:</p>
<ol>
<li>Go to board note.</li>
<li>In the ribbon select <em>Owned Attributes</em> → plus button → <em>Add new label/relation definition</em>.</li>
<li>Configure the attribute as desired.</li>
<li>Check <em>Inheritable</em> to make it applicable to child notes automatically.</li>
<li data-list-item-id="eb2220bf769a14b4d3c3763ddb412215a">Go to board note.</li>
<li data-list-item-id="ef2b3775a79f59cc97c77a69ca78a345e">In the ribbon select <em>Owned Attributes</em> → plus button → <em>Add new label/relation definition</em>.</li>
<li
data-list-item-id="e2565a4dfea04fba704b37927e6252ce4">Configure the attribute as desired.</li>
<li data-list-item-id="ee18605ea5b4a07f7b3f5529ba00b2a57">Check <em>Inheritable</em> to make it applicable to child notes automatically.</li>
</ol>
<p>After creating the attribute, click on a note and fill in the promoted
attributes which should then reflect inside the board.</p>
<p>Of note:</p>
<ul>
<li>Both promoted and non-promoted attribute definitions are supported. The
<li data-list-item-id="e5a19ed95dbafe9a850690bea201deba1">Both promoted and non-promoted attribute definitions are supported. The
only difference is that non-promoted attributes don't have an “Alias” for
assigning a custom name.</li>
<li>Both “Single value” and “Multi value” attributes are supported. In case
<li data-list-item-id="e7ec69af7257cfe86e14bb803910872b4">Both “Single value” and “Multi value” attributes are supported. In case
of multi-value, a badge is displayed for every instance of the attribute.</li>
<li>All label types are supported, including dates, booleans and URLs.</li>
<li>Relation attributes are also supported as well, showing a link with the
<li
data-list-item-id="e810a5dbe56db7e59f9091e45c545a611">All label types are supported, including dates, booleans and URLs.</li>
<li
data-list-item-id="e49414fe2d9d206692332cd7d7ff1d4c0">Relation attributes are also supported as well, showing a link with the
target note title and icon.</li>
<li>Currently, it's not possible to adjust which promoted attributes are displayed,
<li data-list-item-id="e1c3fb07ae71ca498c04613917eca93d4">Currently, it's not possible to adjust which promoted attributes are displayed,
since all promoted attributes will be displayed (except the <code>board:groupBy</code> one).
There are plans to improve upon this being able to hide promoted attributes
individually.</li>
@@ -140,38 +147,36 @@
<img style="aspect-ratio:535/245;" src="1_Kanban Board_image.png"
width="535" height="245">
</figure>
<p>A more advanced use-case is grouping by <a href="#root/_help_Cq5X6iKQop6R">Relations</a>.</p>
<p>A more advanced use-case is grouping by <a href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_Cq5X6iKQop6R">Relations</a>.</p>
<p>During this mode:</p>
<ul>
<li>The columns represent the <em>target notes</em> of a relation.</li>
<li>When creating a new column, a note is selected instead of a column name.</li>
<li>The column icon will match the target note.</li>
<li>Moving notes between columns will change its relation.</li>
<li>Renaming an existing column will change the target note of all the notes
<li data-list-item-id="e597b9ecddfae34bb858559de09ee1f6a">The columns represent the <em>target notes</em> of a relation.</li>
<li data-list-item-id="eb59f890b2223d7f3f43e7ebae747002d">When creating a new column, a note is selected instead of a column name.</li>
<li
data-list-item-id="e566f9ab556f5c47b00ce0854def37bea">The column icon will match the target note.</li>
<li data-list-item-id="e43d3786e7e6590a003f16f3eb437bba5">Moving notes between columns will change its relation.</li>
<li data-list-item-id="e5c2a414d0c80f0d1a67066078c7a4f79">Renaming an existing column will change the target note of all the notes
in that column.</li>
</ul>
<p>Using relations instead of labels has some benefits:</p>
<ul>
<li>The status/grouping of the notes is visible outside the Kanban board,
for example on the&nbsp;<a class="reference-link" href="#root/_help_bdUJEHsAPYQR">Note Map</a>.</li>
<li>Columns can have icons.</li>
<li>Renaming columns is less intensive since it simply involves changing the
<li data-list-item-id="e580344f5638c09e80f566dc789db656a">The status/grouping of the notes is visible outside the Kanban board,
for example on the&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_bdUJEHsAPYQR">Note Map</a>.</li>
<li
data-list-item-id="e1d59fe7873950babd8e1f3dbcb913e1a">Columns can have icons.</li>
<li data-list-item-id="e9933195c1f7708326f434321482cd917">Renaming columns is less intensive since it simply involves changing the
note title of the target note instead of having to do a bulk rename.</li>
</ul>
<p>To do so:</p>
<ol>
<li>
<p>First, create a Kanban board from scratch and not a template:</p>
</li>
<li>
<p>Assign <code>#viewType=board #hidePromotedAttributes</code> to emulate the
default template.</p>
</li>
<li>
<p>Set <code>#board:groupBy</code> to the name of a relation to group by, <strong>including the</strong> <code>**~**</code> <strong>prefix</strong> (e.g. <code>~status</code>).</p>
</li>
<li>
<p>Optionally, use&nbsp;<a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;for
<li data-list-item-id="e66855292cf2639a13ecd642482681653">First, create a Kanban board from scratch and not a template:</li>
<li
data-list-item-id="eaf16b94767674ca24de65ae102b84fc7">Assign <code>#viewType=board #hidePromotedAttributes</code> to emulate the
default template.</li>
<li data-list-item-id="e861d2859085e0dba83a44946fdc67c32">Set <code>#board:groupBy</code> to the name of a relation to group by, <strong>including the </strong><code><strong>~</strong></code><strong> prefix</strong> (e.g. <code>~status</code>).</li>
<li
data-list-item-id="efd300f3e766d485e28b7c8fd0a73364c">
<p>Optionally, use&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;for
easy status change within the note:</p><pre><code class="language-text-x-trilium-auto">#relation:status(inheritable)="promoted,alias=Status,single"</code></pre>
</li>
</ol>

View File

@@ -256,9 +256,7 @@
"multi-factor-authentication-title": "Autentificare multi-factor",
"ai-llm-title": "AI/LLM",
"localization": "Limbă și regiune",
"inbox-title": "Inbox",
"command-palette": "Deschide paleta de comenzi",
"zen-mode": "Mod zen"
"inbox-title": "Inbox"
},
"notes": {
"new-note": "Notiță nouă",
@@ -276,8 +274,7 @@
"export_filter": "Document PDF (*.pdf)",
"unable-to-export-message": "Notița curentă nu a putut fi exportată ca PDF.",
"unable-to-export-title": "Nu s-a putut exporta ca PDF",
"unable-to-save-message": "Nu s-a putut scrie fișierul selectat. Încercați din nou sau selectați altă destinație.",
"unable-to-print": "Nu s-a putut imprima notița"
"unable-to-save-message": "Nu s-a putut scrie fișierul selectat. Încercați din nou sau selectați altă destinație."
},
"tray": {
"bookmarks": "Semne de carte",
@@ -430,8 +427,7 @@
"presentation": "Prezentare",
"presentation_slide": "Slide de prezentare",
"presentation_slide_first": "Primul slide",
"presentation_slide_second": "Al doilea slide",
"background": "Fundal"
"presentation_slide_second": "Al doilea slide"
},
"sql_init": {
"db_not_initialized_desktop": "Baza de date nu este inițializată, urmați instrucțiunile de pe ecran.",

View File

@@ -51,8 +51,7 @@
"mermaid_description": "Creați diagrame precum flowchart-uri, diagrame de secvență sau de clase, Gantt și multe altele, folosind sintaxa Mermaid.",
"mindmap_title": "Hartă mentală",
"mindmap_description": "Organizați-vă gândurile vizual sau organizați o sesiune de brainstorming.",
"others_list": "și altele: <0>hartă a notițelor</0>, <1>hartă a relațiilor</1>, <2>căutări salvate</2>, <3>randare a notițelor</3>, și <4>vizualizări web</4>.",
"title": "Multiple modalități de a reprezenta informația"
"others_list": "și altele: <0>hartă a notițelor</0>, <1>hartă a relațiilor</1>, <2>căutări salvate</2>, <3>randare a notițelor</3>, și <4>vizualizări web</4>."
},
"extensibility_benefits": {
"title": "Partajare și extensibilitate",
@@ -73,10 +72,7 @@
"board_title": "Tabelă Kanban",
"board_description": "Organizați-vă sarcinile sau proiectele într-o tabelă Kanban cu o modalitate ușoară de a adăuga elemente și coloane noi și schimbarea stării acestora prin glisare cu mouse-ul.",
"geomap_title": "Hartă geografică",
"geomap_description": "Planificați-vă vacanțele sau marcați-vă punctele de interes direct pe o hartă geografică. Afișați traseele GPX înregistrate pentru a putea urmări itinerarii.",
"title": "Colecții",
"presentation_title": "Prezentare",
"presentation_description": "Organizați informația în diapozitive și prezentați-le pe tot ecranul, cu tranziții fine. Diapozitivele pot fi ulterior exportate ca PDF pentru o partajare ușoară."
"geomap_description": "Planificați-vă vacanțele sau marcați-vă punctele de interes direct pe o hartă geografică. Afișați traseele GPX înregistrate pentru a putea urmări itinerarii."
},
"faq": {
"title": "Întrebări frecvente",

View File

@@ -1974,13 +1974,6 @@
"value": "i18n",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "lXjOyKpUSKgE",
"isInheritable": false,
"position": 30
}
],
"format": "markdown",
@@ -2078,34 +2071,6 @@
"format": "markdown",
"dataFileName": "Server translations.md",
"attachments": []
},
{
"isClone": false,
"noteId": "lXjOyKpUSKgE",
"notePath": [
"jdjRLhLV3TtI",
"yeqU0zo0ZQ83",
"TLXJwBDo8Rdv",
"lXjOyKpUSKgE"
],
"title": "Adding a new locale",
"notePosition": 40,
"prefix": null,
"isExpanded": false,
"type": "text",
"mime": "text/html",
"attributes": [
{
"type": "label",
"name": "shareAlias",
"value": "new-locale",
"isInheritable": false,
"position": 20
}
],
"format": "markdown",
"dataFileName": "Adding a new locale.md",
"attachments": []
}
]
},

View File

@@ -27,7 +27,11 @@ Follow the <a class="reference-link" href="Internationalisation%20%20Translatio
### Adding a new locale
See <a class="reference-link" href="Internationalisation%20%20Translations/Adding%20a%20new%20locale.md">Adding a new locale</a>.
To add a new locale, go to `src/public/translations` with your favorite text editor and copy the `en` directory.
Rename the copy to the ISO code (e.g. `fr`, `ro`) of the language being translated.
Translations with a country-language combination, using their corresponding ISO code (e.g. `fr_FR`, `fr_BE`), has not been tested yet.
### Changing the language

View File

@@ -1,11 +0,0 @@
# Adding a new locale
Once the Weblate translations for a single language have reached ~50% in coverage, it's time to add it to the application.
To do so:
1. In `packages/commons` look for `i18n.ts` and add a new entry to `UNSORTED_LOCALES` for the language.
2. In `apps/server` look for `services/i18n.ts` and add a mapping for the new language in `DAYJS_LOADER`. Sort the entire list.
3. In `apps/client`, look for `collections/calendar/index.tsx` and modify `LOCALE_MAPPINGS` to add support to the new language.
4. In `apps/client`, look for `widgets/type_widgets/canvas/i18n.ts` and modify `LANGUAGE_MAPPINGS`. A unit test ensures that the language is actually loadable.
5. In `apps/client`, look for `widgets/type_widgets/MindMap.tsx` and modify `LOCALE_MAPPINGS`. The type definitions should already validate if the new value is supported by Mind Elixir.
6. In `packages/ckeditor5`, look for `i18n.ts` and modify `LOCALE_MAPPINGS`. The import validation should already check if the new value is supported by CKEditor, and there's also a test to ensure it.

View File

@@ -1,5 +1,5 @@
# Documentation
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/5q5br2G87GtN/Documentation_image.png" width="205" height="162">
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/cJTTOrI5C1jn/Documentation_image.png" width="205" height="162">
* The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing <kbd>F1</kbd>.
* The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers.

11
docs/README-ro.md vendored
View File

@@ -34,13 +34,12 @@ ecran](https://triliumnext.github.io/Docs/Wiki/screenshot-tour):
<a href="https://triliumnext.github.io/Docs/Wiki/screenshot-tour"><img src="./docs/app.png" alt="Trilium Screenshot" width="1000"></a>
## ⏬ Descarcă
## ⏬ Download
- [Latest release](https://github.com/TriliumNext/Trilium/releases/latest)
versiune stabilă, recomandată pentru majoritatea utilizatorilor.
- [Versiune
periodică](https://github.com/TriliumNext/Trilium/releases/tag/nightly)
versiune pentru dezvoltare și testare, actualizată zilnic și cu ultimele
funcționalități și buguri reparate.
stable version, recommended for most users.
- [Nightly build](https://github.com/TriliumNext/Trilium/releases/tag/nightly)
unstable development version, updated daily with the latest features and
fixes.
## 📚 Documentație

View File

@@ -9872,16 +9872,23 @@
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "oPVyFC7WL2Lp",
"type": "label",
"name": "iconClass",
"value": "bx bx-columns",
"isInheritable": false,
"position": 10
},
{
"type": "label",
"name": "shareAlias",
"value": "kanban-board",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "IakOLONlIfGI",
"value": "Cq5X6iKQop6R",
"isInheritable": false,
"position": 30
},
@@ -9895,30 +9902,23 @@
{
"type": "relation",
"name": "internalLink",
"value": "Cq5X6iKQop6R",
"value": "bdUJEHsAPYQR",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "bdUJEHsAPYQR",
"value": "oPVyFC7WL2Lp",
"isInheritable": false,
"position": 60
},
{
"type": "label",
"name": "iconClass",
"value": "bx bx-columns",
"type": "relation",
"name": "internalLink",
"value": "IakOLONlIfGI",
"isInheritable": false,
"position": 10
},
{
"type": "label",
"name": "shareAlias",
"value": "kanban-board",
"isInheritable": false,
"position": 20
"position": 70
}
],
"format": "markdown",
@@ -9968,72 +9968,58 @@
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"value": "KSZ04uQ2D1St",
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "OFXdgB2nNk1F",
"value": "0ESUbbAxVnoK",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "KSZ04uQ2D1St",
"value": "XpOYSgsLkTJy",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "0ESUbbAxVnoK",
"value": "oPVyFC7WL2Lp",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "XpOYSgsLkTJy",
"value": "IakOLONlIfGI",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "oPVyFC7WL2Lp",
"value": "lgKX7r3aL30x",
"isInheritable": false,
"position": 60
},
{
"type": "relation",
"name": "internalLink",
"value": "IakOLONlIfGI",
"value": "ZjLYv08Rp3qC",
"isInheritable": false,
"position": 70
},
{
"type": "relation",
"name": "internalLink",
"value": "lgKX7r3aL30x",
"isInheritable": false,
"position": 80
},
{
"type": "relation",
"name": "internalLink",
"value": "ZjLYv08Rp3qC",
"isInheritable": false,
"position": 90
},
{
"type": "relation",
"name": "internalLink",
"value": "BlN9DFI679QC",
"isInheritable": false,
"position": 100
"position": 80
},
{
"type": "label",
@@ -10048,6 +10034,20 @@
"value": "geomap",
"isInheritable": false,
"position": 90
},
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"isInheritable": false,
"position": 100
},
{
"type": "relation",
"name": "internalLink",
"value": "OFXdgB2nNk1F",
"isInheritable": false,
"position": 110
}
],
"format": "markdown",
@@ -11240,44 +11240,23 @@
{
"type": "relation",
"name": "internalLink",
"value": "oPVyFC7WL2Lp",
"value": "BlN9DFI679QC",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "eIg8jdvaoNNd",
"value": "OFXdgB2nNk1F",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "CdNpE2pqjmI6",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "OFXdgB2nNk1F",
"isInheritable": false,
"position": 60
},
{
"type": "relation",
"name": "internalLink",
"value": "BlN9DFI679QC",
"isInheritable": false,
"position": 70
},
{
"type": "relation",
"name": "internalLink",
"value": "bwZpz2ajCEwO",
"isInheritable": false,
"position": 80
"position": 50
},
{
"type": "label",
@@ -11292,6 +11271,27 @@
"value": "bx bx-list-check",
"isInheritable": false,
"position": 110
},
{
"type": "relation",
"name": "internalLink",
"value": "oPVyFC7WL2Lp",
"isInheritable": false,
"position": 120
},
{
"type": "relation",
"name": "internalLink",
"value": "eIg8jdvaoNNd",
"isInheritable": false,
"position": 130
},
{
"type": "relation",
"name": "internalLink",
"value": "CdNpE2pqjmI6",
"isInheritable": false,
"position": 140
}
],
"format": "markdown",
@@ -11737,40 +11737,12 @@
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "BlN9DFI679QC",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "bwZpz2ajCEwO",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "GTwFsgaA0lCt",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "zP3PMqaG71Ct",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "R9pX4DGra2Vt",
"isInheritable": false,
"position": 60
"position": 20
},
{
"type": "label",
@@ -11785,6 +11757,34 @@
"value": "bx bx-table",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "BlN9DFI679QC",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "GTwFsgaA0lCt",
"isInheritable": false,
"position": 60
},
{
"type": "relation",
"name": "internalLink",
"value": "zP3PMqaG71Ct",
"isInheritable": false,
"position": 70
},
{
"type": "relation",
"name": "internalLink",
"value": "R9pX4DGra2Vt",
"isInheritable": false,
"position": 80
}
],
"format": "markdown",

View File

@@ -6,7 +6,6 @@
"type": "module",
"main": "./src/index.ts",
"dependencies": {
"@triliumnext/commons": "workspace:*",
"@triliumnext/ckeditor5-admonition": "workspace:*",
"@triliumnext/ckeditor5-footnotes": "workspace:*",
"@triliumnext/ckeditor5-keyboard-marker": "workspace:*",

View File

@@ -1,90 +0,0 @@
import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";
import { EditorConfig, Translations } from "ckeditor5";
interface LocaleMapping {
languageCode: string;
coreTranslation: () => Promise<{ default: Translations }>;
premiumFeaturesTranslation: () => Promise<{ default: Translations }>;
}
const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, LocaleMapping | null> = {
en: null,
en_rtl: null,
ar: {
languageCode: "ar",
coreTranslation: () => import("ckeditor5/translations/ar.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/ar.js"),
},
cn: {
languageCode: "zh",
coreTranslation: () => import("ckeditor5/translations/zh-cn.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/zh-cn.js"),
},
de: {
languageCode: "de",
coreTranslation: () => import("ckeditor5/translations/de.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/de.js"),
},
es: {
languageCode: "es",
coreTranslation: () => import("ckeditor5/translations/es.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/es.js"),
},
fr: {
languageCode: "fr",
coreTranslation: () => import("ckeditor5/translations/fr.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/fr.js"),
},
it: {
languageCode: "it",
coreTranslation: () => import("ckeditor5/translations/it.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/it.js"),
},
ja: {
languageCode: "ja",
coreTranslation: () => import("ckeditor5/translations/ja.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/ja.js"),
},
pt: {
languageCode: "pt",
coreTranslation: () => import("ckeditor5/translations/pt.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/pt.js"),
},
pt_br: {
languageCode: "pt-br",
coreTranslation: () => import("ckeditor5/translations/pt-br.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/pt-br.js"),
},
ro: {
languageCode: "ro",
coreTranslation: () => import("ckeditor5/translations/ro.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/ro.js"),
},
tw: {
languageCode: "zh-tw",
coreTranslation: () => import("ckeditor5/translations/zh.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/zh.js"),
},
uk: {
languageCode: "uk",
coreTranslation: () => import("ckeditor5/translations/uk.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/uk.js"),
},
ru: {
languageCode: "ru",
coreTranslation: () => import("ckeditor5/translations/ru.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/ru.js")
},
};
export default async function getCkLocale(locale: DISPLAYABLE_LOCALE_IDS): Promise<Pick<EditorConfig, "language" | "translations">> {
const mapping = LOCALE_MAPPINGS[locale];
if (!mapping) return {};
const coreTranslation = (await (mapping.coreTranslation())).default;
const premiumFeaturesTranslation = (await (mapping.premiumFeaturesTranslation())).default;
return {
language: mapping.languageCode,
translations: [ coreTranslation, premiumFeaturesTranslation ]
};
}

View File

@@ -8,7 +8,6 @@ export { PREMIUM_PLUGINS } from "./plugins.js";
export type { EditorConfig, MentionFeed, MentionFeedObjectItem, ModelNode, ModelPosition, ModelElement, WatchdogConfig, WatchdogState } from "ckeditor5";
export type { TemplateDefinition } from "ckeditor5-premium-features";
export { default as buildExtraCommands } from "./extra_slash_commands.js";
export { default as getCkLocale } from "./i18n.js";
// Import with sideffects to ensure that type augmentations are present.
import "@triliumnext/ckeditor5-math";

57
pnpm-lock.yaml generated
View File

@@ -856,9 +856,6 @@ importers:
'@triliumnext/ckeditor5-mermaid':
specifier: workspace:*
version: link:../ckeditor5-mermaid
'@triliumnext/commons':
specifier: workspace:*
version: link:../commons
ckeditor5:
specifier: 47.2.0
version: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
@@ -15546,6 +15543,8 @@ snapshots:
'@ckeditor/ckeditor5-core': 47.2.0
'@ckeditor/ckeditor5-upload': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-ai@47.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)':
dependencies:
@@ -15616,6 +15615,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-block-quote@47.2.0':
dependencies:
@@ -15626,6 +15627,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-bookmark@47.2.0':
dependencies:
@@ -15636,6 +15639,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.2.0
'@ckeditor/ckeditor5-widget': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-case-change@47.2.0':
dependencies:
@@ -15686,6 +15691,8 @@ snapshots:
'@ckeditor/ckeditor5-core': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-code-block@47.2.0(patch_hash=2361d8caad7d6b5bddacc3a3b4aa37dbfba260b1c1b22a450413a79c1bb1ce95)':
dependencies:
@@ -15919,6 +15926,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-classic@47.2.0':
dependencies:
@@ -15928,6 +15937,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-decoupled@47.2.0':
dependencies:
@@ -15937,6 +15948,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-inline@47.2.0':
dependencies:
@@ -15946,6 +15959,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-multi-root@47.2.0':
dependencies:
@@ -15968,6 +15983,8 @@ snapshots:
'@ckeditor/ckeditor5-table': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-emoji@47.2.0':
dependencies:
@@ -15980,6 +15997,8 @@ snapshots:
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
fuzzysort: 3.1.0
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-engine@47.2.0':
dependencies:
@@ -16022,6 +16041,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-export-word@47.2.0':
dependencies:
@@ -16046,6 +16067,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-font@47.2.0':
dependencies:
@@ -16087,6 +16110,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-heading@47.2.0':
dependencies:
@@ -16097,6 +16122,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-highlight@47.2.0':
dependencies:
@@ -16116,6 +16143,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.2.0
'@ckeditor/ckeditor5-widget': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-html-embed@47.2.0':
dependencies:
@@ -16142,6 +16171,8 @@ snapshots:
'@ckeditor/ckeditor5-widget': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-icons@47.2.0': {}
@@ -16173,6 +16204,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-indent@47.2.0':
dependencies:
@@ -16309,6 +16342,8 @@ snapshots:
'@ckeditor/ckeditor5-widget': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-minimap@47.2.0':
dependencies:
@@ -16401,6 +16436,8 @@ snapshots:
'@ckeditor/ckeditor5-paste-from-office': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-paste-from-office@47.2.0':
dependencies:
@@ -16408,6 +16445,8 @@ snapshots:
'@ckeditor/ckeditor5-core': 47.2.0
'@ckeditor/ckeditor5-engine': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-real-time-collaboration@47.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)':
dependencies:
@@ -16438,6 +16477,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-restricted-editing@47.2.0':
dependencies:
@@ -16447,6 +16488,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-revision-history@47.2.0':
dependencies:
@@ -16524,6 +16567,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-special-characters@47.2.0':
dependencies:
@@ -16533,6 +16578,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-style@47.2.0':
dependencies:
@@ -16635,6 +16682,8 @@ snapshots:
'@ckeditor/ckeditor5-icons': 47.2.0
'@ckeditor/ckeditor5-ui': 47.2.0
'@ckeditor/ckeditor5-utils': 47.2.0
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-upload@47.2.0':
dependencies:
@@ -16692,6 +16741,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.2.0
ckeditor5: 47.2.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@codemirror/autocomplete@6.18.6':
dependencies: