mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
Merge remote-tracking branch 'origin/main' into feature/table_view
; Conflicts: ; pnpm-lock.yaml
This commit is contained in:
commit
4b86fedce1
@ -41,7 +41,7 @@
|
|||||||
"@types/node": "22.16.0",
|
"@types/node": "22.16.0",
|
||||||
"@types/yargs": "17.0.33",
|
"@types/yargs": "17.0.33",
|
||||||
"@vitest/coverage-v8": "3.2.4",
|
"@vitest/coverage-v8": "3.2.4",
|
||||||
"eslint": "9.30.0",
|
"eslint": "9.30.1",
|
||||||
"eslint-plugin-simple-import-sort": "12.1.1",
|
"eslint-plugin-simple-import-sort": "12.1.1",
|
||||||
"esm": "3.2.25",
|
"esm": "3.2.25",
|
||||||
"jsdoc": "4.0.4",
|
"jsdoc": "4.0.4",
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"url": "https://github.com/TriliumNext/Notes"
|
"url": "https://github.com/TriliumNext/Notes"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/js": "9.30.0",
|
"@eslint/js": "9.30.1",
|
||||||
"@excalidraw/excalidraw": "0.18.0",
|
"@excalidraw/excalidraw": "0.18.0",
|
||||||
"@fullcalendar/core": "6.1.18",
|
"@fullcalendar/core": "6.1.18",
|
||||||
"@fullcalendar/daygrid": "6.1.18",
|
"@fullcalendar/daygrid": "6.1.18",
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"dayjs-plugin-utc": "0.1.2",
|
"dayjs-plugin-utc": "0.1.2",
|
||||||
"debounce": "2.2.0",
|
"debounce": "2.2.0",
|
||||||
"draggabilly": "3.0.0",
|
"draggabilly": "3.0.0",
|
||||||
"force-graph": "1.49.6",
|
"force-graph": "1.50.1",
|
||||||
"globals": "16.3.0",
|
"globals": "16.3.0",
|
||||||
"i18next": "25.3.0",
|
"i18next": "25.3.0",
|
||||||
"i18next-http-backend": "3.0.2",
|
"i18next-http-backend": "3.0.2",
|
||||||
@ -47,7 +47,7 @@
|
|||||||
"leaflet-gpx": "2.2.0",
|
"leaflet-gpx": "2.2.0",
|
||||||
"mark.js": "8.11.1",
|
"mark.js": "8.11.1",
|
||||||
"marked": "16.0.0",
|
"marked": "16.0.0",
|
||||||
"mermaid": "11.7.0",
|
"mermaid": "11.8.0",
|
||||||
"mind-elixir": "4.6.2",
|
"mind-elixir": "4.6.2",
|
||||||
"normalize.css": "8.0.1",
|
"normalize.css": "8.0.1",
|
||||||
"panzoom": "9.4.3",
|
"panzoom": "9.4.3",
|
||||||
|
@ -8,18 +8,35 @@ const SEPARATOR = { title: "----" };
|
|||||||
|
|
||||||
async function getNoteTypeItems(command?: TreeCommandNames) {
|
async function getNoteTypeItems(command?: TreeCommandNames) {
|
||||||
const items: MenuItem<TreeCommandNames>[] = [
|
const items: MenuItem<TreeCommandNames>[] = [
|
||||||
|
// The suggested note type ordering method: insert the item into the corresponding group,
|
||||||
|
// then ensure the items within the group are ordered alphabetically.
|
||||||
|
// Please keep the order synced with the listing found also in aps/client/src/widgets/note_types.ts.
|
||||||
|
|
||||||
|
// The default note type (always the first item)
|
||||||
{ title: t("note_types.text"), command, type: "text", uiIcon: "bx bx-note" },
|
{ title: t("note_types.text"), command, type: "text", uiIcon: "bx bx-note" },
|
||||||
{ title: t("note_types.code"), command, type: "code", uiIcon: "bx bx-code" },
|
|
||||||
{ title: t("note_types.saved-search"), command, type: "search", uiIcon: "bx bx-file-find" },
|
// Text notes group
|
||||||
{ title: t("note_types.relation-map"), command, type: "relationMap", uiIcon: "bx bxs-network-chart" },
|
|
||||||
{ title: t("note_types.note-map"), command, type: "noteMap", uiIcon: "bx bxs-network-chart" },
|
|
||||||
{ title: t("note_types.render-note"), command, type: "render", uiIcon: "bx bx-extension" },
|
|
||||||
{ title: t("note_types.book"), command, type: "book", uiIcon: "bx bx-book" },
|
{ title: t("note_types.book"), command, type: "book", uiIcon: "bx bx-book" },
|
||||||
{ title: t("note_types.mermaid-diagram"), command, type: "mermaid", uiIcon: "bx bx-selection" },
|
|
||||||
|
// Graphic notes
|
||||||
{ title: t("note_types.canvas"), command, type: "canvas", uiIcon: "bx bx-pen" },
|
{ title: t("note_types.canvas"), command, type: "canvas", uiIcon: "bx bx-pen" },
|
||||||
{ title: t("note_types.web-view"), command, type: "webView", uiIcon: "bx bx-globe-alt" },
|
{ title: t("note_types.mermaid-diagram"), command, type: "mermaid", uiIcon: "bx bx-selection" },
|
||||||
{ title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" },
|
|
||||||
|
// Map notes
|
||||||
{ title: t("note_types.geo-map"), command, type: "geoMap", uiIcon: "bx bx-map-alt" },
|
{ title: t("note_types.geo-map"), command, type: "geoMap", uiIcon: "bx bx-map-alt" },
|
||||||
|
{ title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" },
|
||||||
|
{ title: t("note_types.note-map"), command, type: "noteMap", uiIcon: "bx bxs-network-chart" },
|
||||||
|
{ title: t("note_types.relation-map"), command, type: "relationMap", uiIcon: "bx bxs-network-chart" },
|
||||||
|
|
||||||
|
// Misc note types
|
||||||
|
{ title: t("note_types.render-note"), command, type: "render", uiIcon: "bx bx-extension" },
|
||||||
|
{ title: t("note_types.saved-search"), command, type: "search", uiIcon: "bx bx-file-find" },
|
||||||
|
{ title: t("note_types.web-view"), command, type: "webView", uiIcon: "bx bx-globe-alt" },
|
||||||
|
|
||||||
|
// Code notes
|
||||||
|
{ title: t("note_types.code"), command, type: "code", uiIcon: "bx bx-code" },
|
||||||
|
|
||||||
|
// Templates
|
||||||
...await getBuiltInTemplates(command),
|
...await getBuiltInTemplates(command),
|
||||||
...await getUserTemplates(command)
|
...await getUserTemplates(command)
|
||||||
];
|
];
|
||||||
|
@ -382,6 +382,10 @@ div.tn-tool-dialog {
|
|||||||
|
|
||||||
/* DELETE NOTE PREVIEW DIALOG */
|
/* DELETE NOTE PREVIEW DIALOG */
|
||||||
|
|
||||||
|
.delete-notes-dialog .modal-dialog {
|
||||||
|
--bs-modal-width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
.delete-notes-list .note-path {
|
.delete-notes-list .note-path {
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,12 @@ div.promoted-attributes-container {
|
|||||||
.image-properties > div:first-child > span > strong {
|
.image-properties > div:first-child > span > strong {
|
||||||
opacity: 0.65;
|
opacity: 0.65;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-info-widget-table td,
|
||||||
|
.file-properties-widget .file-table td {
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-properties-widget {
|
.file-properties-widget {
|
||||||
|
@ -71,7 +71,7 @@ body.background-effects.platform-win32.layout-vertical #vertical-main-container
|
|||||||
/* #endregion */
|
/* #endregion */
|
||||||
|
|
||||||
/* Matches when the left pane is collapsed */
|
/* Matches when the left pane is collapsed */
|
||||||
:has(.layout-vertical #left-pane.hidden-int) {
|
#horizontal-main-container:has(#left-pane.hidden-int) {
|
||||||
--center-pane-border-radius: 0;
|
--center-pane-border-radius: 0;
|
||||||
--tab-first-item-horiz-offset: 5px;
|
--tab-first-item-horiz-offset: 5px;
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,13 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const mapRootNoteId = this.getMapRootNoteId();
|
const mapRootNoteId = this.getMapRootNoteId();
|
||||||
const data = await this.loadNotesAndRelations(mapRootNoteId);
|
|
||||||
|
const labelValues = (name: string) => this.note?.getLabels(name).map(l => l.value) ?? [];
|
||||||
|
|
||||||
|
const excludeRelations = labelValues("mapExcludeRelation");
|
||||||
|
const includeRelations = labelValues("mapIncludeRelation");
|
||||||
|
|
||||||
|
const data = await this.loadNotesAndRelations(mapRootNoteId, excludeRelations, includeRelations);
|
||||||
|
|
||||||
const nodeLinkRatio = data.nodes.length / data.links.length;
|
const nodeLinkRatio = data.nodes.length / data.links.length;
|
||||||
const magnifiedRatio = Math.pow(nodeLinkRatio, 1.5);
|
const magnifiedRatio = Math.pow(nodeLinkRatio, 1.5);
|
||||||
@ -473,8 +479,10 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
|
|||||||
ctx.restore();
|
ctx.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadNotesAndRelations(mapRootNoteId: string): Promise<NotesAndRelationsData> {
|
async loadNotesAndRelations(mapRootNoteId: string, excludeRelations: string[], includeRelations: string[]): Promise<NotesAndRelationsData> {
|
||||||
const resp = await server.post<PostNotesMapResponse>(`note-map/${mapRootNoteId}/${this.mapType}`);
|
const resp = await server.post<PostNotesMapResponse>(`note-map/${mapRootNoteId}/${this.mapType}`, {
|
||||||
|
excludeRelations, includeRelations
|
||||||
|
});
|
||||||
|
|
||||||
this.calculateNodeSizes(resp);
|
this.calculateNodeSizes(resp);
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ interface NoteTypeMapping {
|
|||||||
const NOTE_TYPES: NoteTypeMapping[] = [
|
const NOTE_TYPES: NoteTypeMapping[] = [
|
||||||
// The suggested note type ordering method: insert the item into the corresponding group,
|
// The suggested note type ordering method: insert the item into the corresponding group,
|
||||||
// then ensure the items within the group are ordered alphabetically.
|
// then ensure the items within the group are ordered alphabetically.
|
||||||
|
// Please keep the order synced with the listing found also in apps/client/src/services/note_types.ts.
|
||||||
|
|
||||||
// The default note type (always the first item)
|
// 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 },
|
||||||
|
@ -19,6 +19,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dotenv": "17.0.1",
|
"dotenv": "17.0.1",
|
||||||
"electron": "37.1.0"
|
"electron": "37.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"@types/electron-squirrel-startup": "1.0.2",
|
"@types/electron-squirrel-startup": "1.0.2",
|
||||||
"@triliumnext/server": "workspace:*",
|
"@triliumnext/server": "workspace:*",
|
||||||
"copy-webpack-plugin": "13.0.0",
|
"copy-webpack-plugin": "13.0.0",
|
||||||
"electron": "37.1.0",
|
"electron": "37.2.0",
|
||||||
"@electron-forge/cli": "7.8.1",
|
"@electron-forge/cli": "7.8.1",
|
||||||
"@electron-forge/maker-deb": "7.8.1",
|
"@electron-forge/maker-deb": "7.8.1",
|
||||||
"@electron-forge/maker-dmg": "7.8.1",
|
"@electron-forge/maker-dmg": "7.8.1",
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"@triliumnext/desktop": "workspace:*",
|
"@triliumnext/desktop": "workspace:*",
|
||||||
"@types/fs-extra": "11.0.4",
|
"@types/fs-extra": "11.0.4",
|
||||||
"copy-webpack-plugin": "13.0.0",
|
"copy-webpack-plugin": "13.0.0",
|
||||||
"electron": "37.1.0",
|
"electron": "37.2.0",
|
||||||
"fs-extra": "11.3.0"
|
"fs-extra": "11.3.0"
|
||||||
},
|
},
|
||||||
"nx": {
|
"nx": {
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
"debounce": "2.2.0",
|
"debounce": "2.2.0",
|
||||||
"debug": "4.4.1",
|
"debug": "4.4.1",
|
||||||
"ejs": "3.1.10",
|
"ejs": "3.1.10",
|
||||||
"electron": "37.1.0",
|
"electron": "37.2.0",
|
||||||
"electron-debug": "4.1.0",
|
"electron-debug": "4.1.0",
|
||||||
"electron-window-state": "5.0.3",
|
"electron-window-state": "5.0.3",
|
||||||
"escape-html": "1.0.3",
|
"escape-html": "1.0.3",
|
||||||
|
@ -110,6 +110,11 @@ function getLinkMap(req: Request) {
|
|||||||
const ignoreExcludeFromNoteMap = mapRootNote.isLabelTruthy("excludeFromNoteMap");
|
const ignoreExcludeFromNoteMap = mapRootNote.isLabelTruthy("excludeFromNoteMap");
|
||||||
let unfilteredNotes;
|
let unfilteredNotes;
|
||||||
|
|
||||||
|
const toSet = (data: unknown) => new Set<string>(data instanceof Array ? data : []);
|
||||||
|
|
||||||
|
const excludeRelations = toSet(req.body.excludeRelations);
|
||||||
|
const includeRelations = toSet(req.body.includeRelations);
|
||||||
|
|
||||||
if (mapRootNote.type === "search") {
|
if (mapRootNote.type === "search") {
|
||||||
// for search notes, we want to consider the direct search results only without the descendants
|
// for search notes, we want to consider the direct search results only without the descendants
|
||||||
unfilteredNotes = mapRootNote.getSearchResultNotes();
|
unfilteredNotes = mapRootNote.getSearchResultNotes();
|
||||||
@ -152,6 +157,10 @@ function getLinkMap(req: Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return !parentNote.getChildNotes().find((childNote) => childNote.noteId === rel.value);
|
return !parentNote.getChildNotes().find((childNote) => childNote.noteId === rel.value);
|
||||||
|
} else if (includeRelations.size != 0 && !includeRelations.has(rel.name)) {
|
||||||
|
return false;
|
||||||
|
} else if (excludeRelations.has(rel.name)) {
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,8 @@ export default [
|
|||||||
{ type: "label", name: "pageSize" },
|
{ type: "label", name: "pageSize" },
|
||||||
{ type: "label", name: "viewType" },
|
{ type: "label", name: "viewType" },
|
||||||
{ type: "label", name: "mapRootNoteId" },
|
{ type: "label", name: "mapRootNoteId" },
|
||||||
|
{ type: "label", name: "mapExcludeRelation" },
|
||||||
|
{ type: "label", name: "mapIncludeRelation" },
|
||||||
{ type: "label", name: "bookmarkFolder" },
|
{ type: "label", name: "bookmarkFolder" },
|
||||||
{ type: "label", name: "sorted" },
|
{ type: "label", name: "sorted" },
|
||||||
{ type: "label", name: "sortDirection" },
|
{ type: "label", name: "sortDirection" },
|
||||||
|
@ -4,3 +4,5 @@
|
|||||||
A Note map is a note type which displays a standalone version of the feature of the same name: [Note Map (Link map, Tree map)](../Advanced%20Usage/Note%20Map%20\(Link%20map%2C%20Tree%20map\).md).
|
A Note map is a note type which displays a standalone version of the feature of the same name: [Note Map (Link map, Tree map)](../Advanced%20Usage/Note%20Map%20\(Link%20map%2C%20Tree%20map\).md).
|
||||||
|
|
||||||
Once created, the note map will display the relations between notes. Only the notes that are part of the parent of the note map will be displayed (including their children).
|
Once created, the note map will display the relations between notes. Only the notes that are part of the parent of the note map will be displayed (including their children).
|
||||||
|
|
||||||
|
The labels `mapIncludeRelation` and `mapExcludeRelation`, if set, filter the note map to include only the specified relations or to exclude the specified relations, respectively.
|
||||||
|
24
package.json
24
package.json
@ -27,16 +27,16 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@electron/rebuild": "4.0.1",
|
"@electron/rebuild": "4.0.1",
|
||||||
"@nx/devkit": "21.2.1",
|
"@nx/devkit": "21.2.2",
|
||||||
"@nx/esbuild": "21.2.1",
|
"@nx/esbuild": "21.2.2",
|
||||||
"@nx/eslint": "21.2.1",
|
"@nx/eslint": "21.2.2",
|
||||||
"@nx/eslint-plugin": "21.2.1",
|
"@nx/eslint-plugin": "21.2.2",
|
||||||
"@nx/express": "21.2.1",
|
"@nx/express": "21.2.2",
|
||||||
"@nx/js": "21.2.1",
|
"@nx/js": "21.2.2",
|
||||||
"@nx/node": "21.2.1",
|
"@nx/node": "21.2.2",
|
||||||
"@nx/playwright": "21.2.1",
|
"@nx/playwright": "21.2.2",
|
||||||
"@nx/vite": "21.2.1",
|
"@nx/vite": "21.2.2",
|
||||||
"@nx/web": "21.2.1",
|
"@nx/web": "21.2.2",
|
||||||
"@playwright/test": "^1.36.0",
|
"@playwright/test": "^1.36.0",
|
||||||
"@triliumnext/server": "workspace:*",
|
"@triliumnext/server": "workspace:*",
|
||||||
"@types/express": "^5.0.0",
|
"@types/express": "^5.0.0",
|
||||||
@ -54,7 +54,7 @@
|
|||||||
"jiti": "2.4.2",
|
"jiti": "2.4.2",
|
||||||
"jsdom": "~26.1.0",
|
"jsdom": "~26.1.0",
|
||||||
"jsonc-eslint-parser": "^2.1.0",
|
"jsonc-eslint-parser": "^2.1.0",
|
||||||
"nx": "21.2.1",
|
"nx": "21.2.2",
|
||||||
"react-refresh": "^0.17.0",
|
"react-refresh": "^0.17.0",
|
||||||
"rollup-plugin-webpack-stats": "2.1.0",
|
"rollup-plugin-webpack-stats": "2.1.0",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
@ -89,7 +89,7 @@
|
|||||||
"@nx/js": "patches/@nx__js.patch"
|
"@nx/js": "patches/@nx__js.patch"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"mermaid": "11.7.0",
|
"mermaid": "11.8.0",
|
||||||
"preact": "10.26.9",
|
"preact": "10.26.9",
|
||||||
"roughjs": "4.6.6",
|
"roughjs": "4.6.6",
|
||||||
"@types/express-serve-static-core": "5.0.6",
|
"@types/express-serve-static-core": "5.0.6",
|
||||||
|
2902
pnpm-lock.yaml
generated
2902
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user