client: reorder note types

This commit is contained in:
Adorian Doran 2025-02-06 21:45:17 +02:00
parent 48af3e9cf5
commit 919a977643

View File

@ -5,24 +5,39 @@ import dialogService from "../services/dialog.js";
import { t } from "../services/i18n.js"; import { t } from "../services/i18n.js";
const NOTE_TYPES = [ const NOTE_TYPES = [
{ type: "file", title: t("note_types.file"), selectable: false }, // The suggested note type ordering method: insert the item into the corresponding group,
{ type: "image", title: t("note_types.image"), selectable: false }, // then ensure the items within the group are ordered alphabetically.
{ type: "search", title: t("note_types.saved-search"), selectable: false },
{ type: "noteMap", mime: "", title: t("note_types.note-map"), selectable: false },
{ type: "launcher", mime: "", title: t("note_types.launcher"), selectable: false },
{ type: "doc", mime: "", title: t("note_types.doc"), selectable: false },
{ type: "contentWidget", mime: "", title: t("note_types.widget"), selectable: false },
// The default note type (always the first item)
{ type: "text", mime: "text/html", title: t("note_types.text"), selectable: true }, { type: "text", mime: "text/html", title: t("note_types.text"), selectable: true },
{ type: "relationMap", mime: "application/json", title: t("note_types.relation-map"), selectable: true },
{ type: "mindMap", mime: "application/json", title: t("note_types.mind-map"), selectable: true }, // Text notes group
{ type: "render", mime: "", title: t("note_types.render-note"), selectable: true }, { type: "book", mime: "", title: t("note_types.book"), selectable: true },
// Graphic notes
{ type: "canvas", mime: "application/json", title: t("note_types.canvas"), selectable: true }, { type: "canvas", mime: "application/json", title: t("note_types.canvas"), selectable: true },
{ type: "mermaid", mime: "text/mermaid", title: t("note_types.mermaid-diagram"), selectable: true }, { type: "mermaid", mime: "text/mermaid", title: t("note_types.mermaid-diagram"), selectable: true },
{ type: "book", mime: "", title: t("note_types.book"), selectable: true },
{ type: "webView", mime: "", title: t("note_types.web-view"), selectable: true }, // Map notes
{ type: "geoMap", mime: "application/json", title: t("note_types.geo-map"), isBeta: true, selectable: true }, { type: "geoMap", mime: "application/json", title: t("note_types.geo-map"), isBeta: true, selectable: true },
{ type: "code", mime: "text/plain", title: t("note_types.code"), selectable: true } { type: "mindMap", mime: "application/json", title: t("note_types.mind-map"), selectable: true },
{ type: "relationMap", mime: "application/json", title: t("note_types.relation-map"), selectable: true },
// Misc note types
{ type: "render", mime: "", title: t("note_types.render-note"), selectable: true },
{ type: "webView", mime: "", title: t("note_types.web-view"), selectable: true },
// Code notes
{ type: "code", mime: "text/plain", title: t("note_types.code"), selectable: true },
// Reserved types (cannot be created by the user)
{ type: "contentWidget", mime: "", title: t("note_types.widget"), selectable: false },
{ type: "doc", mime: "", title: t("note_types.doc"), selectable: false },
{ type: "file", title: t("note_types.file"), selectable: false },
{ type: "image", title: t("note_types.image"), selectable: false },
{ type: "launcher", mime: "", title: t("note_types.launcher"), selectable: false },
{ type: "noteMap", mime: "", title: t("note_types.note-map"), selectable: false },
{ type: "search", title: t("note_types.saved-search"), selectable: false }
]; ];
const NOT_SELECTABLE_NOTE_TYPES = NOTE_TYPES.filter((nt) => !nt.selectable).map((nt) => nt.type); const NOT_SELECTABLE_NOTE_TYPES = NOTE_TYPES.filter((nt) => !nt.selectable).map((nt) => nt.type);