mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:29:02 +01:00 
			
		
		
		
	Merge branch 'refs/heads/stable'
# Conflicts: # package-lock.json
This commit is contained in:
		
						commit
						a64a0e52ec
					
				| @ -50,10 +50,10 @@ export default class TreeContextMenu { | |||||||
|             { title: 'Open in a new tab <kbd>Ctrl+Click</kbd>', command: "openInTab", uiIcon: "bx bx-empty", enabled: noSelectedNotes }, |             { title: 'Open in a new tab <kbd>Ctrl+Click</kbd>', command: "openInTab", uiIcon: "bx bx-empty", enabled: noSelectedNotes }, | ||||||
|             { title: 'Open in a new split', command: "openNoteInSplit", uiIcon: "bx bx-dock-right", enabled: noSelectedNotes }, |             { title: 'Open in a new split', command: "openNoteInSplit", uiIcon: "bx bx-dock-right", enabled: noSelectedNotes }, | ||||||
|             { title: 'Insert note after <kbd data-command="createNoteAfter"></kbd>', command: "insertNoteAfter", uiIcon: "bx bx-plus", |             { title: 'Insert note after <kbd data-command="createNoteAfter"></kbd>', command: "insertNoteAfter", uiIcon: "bx bx-plus", | ||||||
|                 items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter", {removeDeprecatedTypes: true}) : null, |                 items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter") : null, | ||||||
|                 enabled: insertNoteAfterEnabled && noSelectedNotes }, |                 enabled: insertNoteAfterEnabled && noSelectedNotes }, | ||||||
|             { title: 'Insert child note <kbd data-command="createNoteInto"></kbd>', command: "insertChildNote", uiIcon: "bx bx-plus", |             { title: 'Insert child note <kbd data-command="createNoteInto"></kbd>', command: "insertChildNote", uiIcon: "bx bx-plus", | ||||||
|                 items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote", {removeDeprecatedTypes: true}) : null, |                 items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote") : null, | ||||||
|                 enabled: notSearch && noSelectedNotes }, |                 enabled: notSearch && noSelectedNotes }, | ||||||
|             { title: 'Delete <kbd data-command="deleteNotes"></kbd>', command: "deleteNotes", uiIcon: "bx bx-trash", |             { title: 'Delete <kbd data-command="deleteNotes"></kbd>', command: "deleteNotes", uiIcon: "bx bx-trash", | ||||||
|                 enabled: isNotRoot && !isHoisted && parentNotSearch }, |                 enabled: isNotRoot && !isHoisted && parentNotSearch }, | ||||||
|  | |||||||
| @ -1,21 +1,19 @@ | |||||||
| import server from "./server.js"; | import server from "./server.js"; | ||||||
| import froca from "./froca.js"; | import froca from "./froca.js"; | ||||||
| 
 | 
 | ||||||
| async function getNoteTypeItems(command, opts = {}) { | async function getNoteTypeItems(command) { | ||||||
|     const removeDeprecatedTypes = !!opts.removeDeprecatedTypes; |  | ||||||
| 
 |  | ||||||
|     const items = [ |     const items = [ | ||||||
|         { title: "Text", command: command, type: "text", uiIcon: "bx bx-note" }, |         { title: "Text", command: command, type: "text", uiIcon: "bx bx-note" }, | ||||||
|         { title: "Code", command: command, type: "code", uiIcon: "bx bx-code" }, |         { title: "Code", command: command, type: "code", uiIcon: "bx bx-code" }, | ||||||
|         { title: "Saved Search", command: command, type: "search", uiIcon: "bx bx-file-find" }, |         { title: "Saved Search", command: command, type: "search", uiIcon: "bx bx-file-find" }, | ||||||
|         { title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt", deprecated: true }, |         { title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt" }, | ||||||
|         { title: "Note Map", command: command, type: "noteMap", uiIcon: "bx bx-map-alt" }, |         { title: "Note Map", command: command, type: "noteMap", uiIcon: "bx bx-map-alt" }, | ||||||
|         { title: "Render Note", command: command, type: "render", uiIcon: "bx bx-extension" }, |         { title: "Render Note", command: command, type: "render", uiIcon: "bx bx-extension" }, | ||||||
|         { title: "Book", command: command, type: "book", uiIcon: "bx bx-book" }, |         { title: "Book", command: command, type: "book", uiIcon: "bx bx-book" }, | ||||||
|         { title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" }, |         { title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" }, | ||||||
|         { title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" }, |         { title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" }, | ||||||
|         { title: "Web View", command: command, type: "webView", uiIcon: "bx bx-globe-alt" }, |         { title: "Web View", command: command, type: "webView", uiIcon: "bx bx-globe-alt" }, | ||||||
|     ].filter(item => !removeDeprecatedTypes || !item.deprecated); |     ]; | ||||||
| 
 | 
 | ||||||
|     const templateNoteIds = await server.get("search-templates"); |     const templateNoteIds = await server.get("search-templates"); | ||||||
|     const templateNotes = await froca.getNotes(templateNoteIds); |     const templateNotes = await froca.getNotes(templateNoteIds); | ||||||
|  | |||||||
| @ -184,8 +184,6 @@ export default class RelationMapTypeWidget extends TypeWidget { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async loadMapData() { |     async loadMapData() { | ||||||
|         toastService.showMessage("Relation Map has been deprecated since Trilium 0.63 and will be removed in a future version. Migrate your content to some other note type (e.g. canvas) as soon as possible.", 5000); |  | ||||||
| 
 |  | ||||||
|         this.mapData = { |         this.mapData = { | ||||||
|             notes: [], |             notes: [], | ||||||
|             // it is important to have this exact value here so that initial transform is the same as this
 |             // it is important to have this exact value here so that initial transform is the same as this
 | ||||||
|  | |||||||
| @ -458,6 +458,7 @@ function findIncludeNoteLinks(content, foundLinks) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function findRelationMapLinks(content, foundLinks) { | function findRelationMapLinks(content, foundLinks) { | ||||||
|  |     try { | ||||||
|         const obj = JSON.parse(content); |         const obj = JSON.parse(content); | ||||||
| 
 | 
 | ||||||
|         for (const note of obj.notes) { |         for (const note of obj.notes) { | ||||||
| @ -467,6 +468,10 @@ function findRelationMapLinks(content, foundLinks) { | |||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |     catch (e) { | ||||||
|  |         log.error("Could not scan for relation map links: " + e.message); | ||||||
|  |     } | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| const imageUrlToAttachmentIdMapping = {}; | const imageUrlToAttachmentIdMapping = {}; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam