mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	Revert sort imports refector to avoid conflits
This commit is contained in:
		
							parent
							
								
									1e7f15b3c2
								
							
						
					
					
						commit
						b4dbf4d7a5
					
				@ -1,29 +1,30 @@
 | 
				
			|||||||
import type { Attribute } from "../services/attribute_parser.js";
 | 
					 | 
				
			||||||
import bundleService from "../services/bundle.js";
 | 
					 | 
				
			||||||
import froca from "../services/froca.js";
 | 
					import froca from "../services/froca.js";
 | 
				
			||||||
import { initLocale,t } from "../services/i18n.js";
 | 
					import bundleService from "../services/bundle.js";
 | 
				
			||||||
 | 
					import RootCommandExecutor from "./root_command_executor.js";
 | 
				
			||||||
 | 
					import Entrypoints, { type SqlExecuteResults } from "./entrypoints.js";
 | 
				
			||||||
 | 
					import options from "../services/options.js";
 | 
				
			||||||
 | 
					import utils from "../services/utils.js";
 | 
				
			||||||
 | 
					import zoomComponent from "./zoom.js";
 | 
				
			||||||
 | 
					import TabManager from "./tab_manager.js";
 | 
				
			||||||
 | 
					import Component from "./component.js";
 | 
				
			||||||
import keyboardActionsService from "../services/keyboard_actions.js";
 | 
					import keyboardActionsService from "../services/keyboard_actions.js";
 | 
				
			||||||
import linkService, { type ViewScope } from "../services/link.js";
 | 
					import linkService, { type ViewScope } from "../services/link.js";
 | 
				
			||||||
import type LoadResults from "../services/load_results.js";
 | 
					import MobileScreenSwitcherExecutor, { type Screen } from "./mobile_screen_switcher.js";
 | 
				
			||||||
import options from "../services/options.js";
 | 
					import MainTreeExecutors from "./main_tree_executors.js";
 | 
				
			||||||
import toast from "../services/toast.js";
 | 
					import toast from "../services/toast.js";
 | 
				
			||||||
import utils from "../services/utils.js";
 | 
					import ShortcutComponent from "./shortcut_component.js";
 | 
				
			||||||
import type { ConfirmWithMessageOptions, ConfirmWithTitleOptions } from "../widgets/dialogs/confirm.js";
 | 
					import { t, initLocale } from "../services/i18n.js";
 | 
				
			||||||
 | 
					import type NoteDetailWidget from "../widgets/note_detail.js";
 | 
				
			||||||
import type { ResolveOptions } from "../widgets/dialogs/delete_notes.js";
 | 
					import type { ResolveOptions } from "../widgets/dialogs/delete_notes.js";
 | 
				
			||||||
import type { PromptDialogOptions } from "../widgets/dialogs/prompt.js";
 | 
					import type { PromptDialogOptions } from "../widgets/dialogs/prompt.js";
 | 
				
			||||||
import type NoteDetailWidget from "../widgets/note_detail.js";
 | 
					import type { ConfirmWithMessageOptions, ConfirmWithTitleOptions } from "../widgets/dialogs/confirm.js";
 | 
				
			||||||
 | 
					import type LoadResults from "../services/load_results.js";
 | 
				
			||||||
 | 
					import type { Attribute } from "../services/attribute_parser.js";
 | 
				
			||||||
import type NoteTreeWidget from "../widgets/note_tree.js";
 | 
					import type NoteTreeWidget from "../widgets/note_tree.js";
 | 
				
			||||||
import type EditableTextTypeWidget from "../widgets/type_widgets/editable_text.js";
 | 
					 | 
				
			||||||
import type TypeWidget from "../widgets/type_widgets/type_widget.js";
 | 
					 | 
				
			||||||
import Component from "./component.js";
 | 
					 | 
				
			||||||
import Entrypoints, { type SqlExecuteResults } from "./entrypoints.js";
 | 
					 | 
				
			||||||
import MainTreeExecutors from "./main_tree_executors.js";
 | 
					 | 
				
			||||||
import MobileScreenSwitcherExecutor, { type Screen } from "./mobile_screen_switcher.js";
 | 
					 | 
				
			||||||
import type { default as NoteContext, GetTextEditorCallback } from "./note_context.js";
 | 
					import type { default as NoteContext, GetTextEditorCallback } from "./note_context.js";
 | 
				
			||||||
import RootCommandExecutor from "./root_command_executor.js";
 | 
					import type TypeWidget from "../widgets/type_widgets/type_widget.js";
 | 
				
			||||||
import ShortcutComponent from "./shortcut_component.js";
 | 
					import type EditableTextTypeWidget from "../widgets/type_widgets/editable_text.js";
 | 
				
			||||||
import TabManager from "./tab_manager.js";
 | 
					import type FAttribute from "../entities/fattribute.js";
 | 
				
			||||||
import zoomComponent from "./zoom.js";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface Layout {
 | 
					interface Layout {
 | 
				
			||||||
    getRootWidget: (appContext: AppContext) => RootWidget;
 | 
					    getRootWidget: (appContext: AppContext) => RootWidget;
 | 
				
			||||||
 | 
				
			|||||||
@ -1,11 +1,13 @@
 | 
				
			|||||||
import appContext from "../components/app_context.js";
 | 
					 | 
				
			||||||
import hoistedNoteService from "../services/hoisted_note.js";
 | 
					 | 
				
			||||||
import froca from "./froca.js";
 | 
					 | 
				
			||||||
import utils from "./utils.js";
 | 
					 | 
				
			||||||
import ws from "./ws.js";
 | 
					import ws from "./ws.js";
 | 
				
			||||||
 | 
					import utils from "./utils.js";
 | 
				
			||||||
 | 
					import froca from "./froca.js";
 | 
				
			||||||
 | 
					import hoistedNoteService from "../services/hoisted_note.js";
 | 
				
			||||||
 | 
					import appContext from "../components/app_context.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
async function resolveNotePath(notePath: string, hoistedNoteId = "root"): Promise<string | null> {
 | 
					 * @returns {string|null}
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					async function resolveNotePath(notePath: string, hoistedNoteId = "root") {
 | 
				
			||||||
    const runPath = await resolveNotePathToSegments(notePath, hoistedNoteId);
 | 
					    const runPath = await resolveNotePathToSegments(notePath, hoistedNoteId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return runPath ? runPath.join("/") : null;
 | 
					    return runPath ? runPath.join("/") : null;
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								src/public/app/types-fancytree.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/public/app/types-fancytree.d.ts
									
									
									
									
										vendored
									
									
								
							@ -969,7 +969,7 @@ declare namespace Fancytree {
 | 
				
			|||||||
            /**
 | 
					            /**
 | 
				
			||||||
             * Callback(targetNode, data), return true, to enable dnd drop
 | 
					             * Callback(targetNode, data), return true, to enable dnd drop
 | 
				
			||||||
             */
 | 
					             */
 | 
				
			||||||
            dragEnter?: ((targetNode: FancytreeNode) => void) | undefined;
 | 
					            dragEnter?: ((targetNode: FancytreeNode, data: any) => void) | undefined;
 | 
				
			||||||
            /**
 | 
					            /**
 | 
				
			||||||
             * Events (drag over)
 | 
					             * Events (drag over)
 | 
				
			||||||
             */
 | 
					             */
 | 
				
			||||||
 | 
				
			|||||||
@ -1,19 +1,17 @@
 | 
				
			|||||||
import "../../../stylesheets/calendar.css";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import { Dropdown } from "bootstrap";
 | 
					 | 
				
			||||||
import dayjs, { Dayjs } from "dayjs";
 | 
					 | 
				
			||||||
import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
 | 
					 | 
				
			||||||
import utc from "dayjs/plugin/utc.js";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import type BAttribute from "../../../../becca/entities/battribute.js";
 | 
					 | 
				
			||||||
import type { EventData } from "../../components/app_context.js";
 | 
					 | 
				
			||||||
import appContext from "../../components/app_context.js";
 | 
					 | 
				
			||||||
import dateNoteService from "../../services/date_notes.js";
 | 
					 | 
				
			||||||
import { t } from "../../services/i18n.js";
 | 
					import { t } from "../../services/i18n.js";
 | 
				
			||||||
import options from "../../services/options.js";
 | 
					import dateNoteService from "../../services/date_notes.js";
 | 
				
			||||||
import server from "../../services/server.js";
 | 
					import server from "../../services/server.js";
 | 
				
			||||||
import toastService from "../../services/toast.js";
 | 
					import appContext from "../../components/app_context.js";
 | 
				
			||||||
import RightDropdownButtonWidget from "./right_dropdown_button.js";
 | 
					import RightDropdownButtonWidget from "./right_dropdown_button.js";
 | 
				
			||||||
 | 
					import toastService from "../../services/toast.js";
 | 
				
			||||||
 | 
					import options from "../../services/options.js";
 | 
				
			||||||
 | 
					import { Dropdown } from "bootstrap";
 | 
				
			||||||
 | 
					import type { EventData } from "../../components/app_context.js";
 | 
				
			||||||
 | 
					import dayjs, { Dayjs } from "dayjs";
 | 
				
			||||||
 | 
					import utc from "dayjs/plugin/utc.js";
 | 
				
			||||||
 | 
					import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
 | 
				
			||||||
 | 
					import type BAttribute from "../../../../becca/entities/battribute.js";
 | 
				
			||||||
 | 
					import "../../../stylesheets/calendar.css";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dayjs.extend(utc);
 | 
					dayjs.extend(utc);
 | 
				
			||||||
dayjs.extend(isSameOrAfter);
 | 
					dayjs.extend(isSameOrAfter);
 | 
				
			||||||
 | 
				
			|||||||
@ -1,30 +1,30 @@
 | 
				
			|||||||
import appContext, { type CommandListenerData, type EventData } from "../components/app_context.js";
 | 
					 | 
				
			||||||
import type { SetNoteOpts } from "../components/note_context.js";
 | 
					 | 
				
			||||||
import type FBranch from "../entities/fbranch.js";
 | 
					 | 
				
			||||||
import type FNote from "../entities/fnote.js";
 | 
					 | 
				
			||||||
import type { NoteType } from "../entities/fnote.js";
 | 
					 | 
				
			||||||
import contextMenu from "../menus/context_menu.js";
 | 
					 | 
				
			||||||
import branchService from "../services/branches.js";
 | 
					 | 
				
			||||||
import clipboard from "../services/clipboard.js";
 | 
					 | 
				
			||||||
import dialogService from "../services/dialog.js";
 | 
					 | 
				
			||||||
import froca from "../services/froca.js";
 | 
					 | 
				
			||||||
import hoistedNoteService from "../services/hoisted_note.js";
 | 
					import hoistedNoteService from "../services/hoisted_note.js";
 | 
				
			||||||
import { t } from "../services/i18n.js";
 | 
					 | 
				
			||||||
import keyboardActionsService from "../services/keyboard_actions.js";
 | 
					 | 
				
			||||||
import linkService from "../services/link.js";
 | 
					 | 
				
			||||||
import type LoadResults from "../services/load_results.js";
 | 
					 | 
				
			||||||
import type { AttributeRow, BranchRow } from "../services/load_results.js";
 | 
					 | 
				
			||||||
import noteCreateService from "../services/note_create.js";
 | 
					 | 
				
			||||||
import options from "../services/options.js";
 | 
					 | 
				
			||||||
import protectedSessionService from "../services/protected_session.js";
 | 
					 | 
				
			||||||
import protectedSessionHolder from "../services/protected_session_holder.js";
 | 
					 | 
				
			||||||
import server from "../services/server.js";
 | 
					 | 
				
			||||||
import shortcutService from "../services/shortcuts.js";
 | 
					 | 
				
			||||||
import toastService from "../services/toast.js";
 | 
					 | 
				
			||||||
import treeService from "../services/tree.js";
 | 
					import treeService from "../services/tree.js";
 | 
				
			||||||
import utils from "../services/utils.js";
 | 
					import utils from "../services/utils.js";
 | 
				
			||||||
 | 
					import contextMenu from "../menus/context_menu.js";
 | 
				
			||||||
 | 
					import froca from "../services/froca.js";
 | 
				
			||||||
 | 
					import branchService from "../services/branches.js";
 | 
				
			||||||
import ws from "../services/ws.js";
 | 
					import ws from "../services/ws.js";
 | 
				
			||||||
import NoteContextAwareWidget from "./note_context_aware_widget.js";
 | 
					import NoteContextAwareWidget from "./note_context_aware_widget.js";
 | 
				
			||||||
 | 
					import server from "../services/server.js";
 | 
				
			||||||
 | 
					import noteCreateService from "../services/note_create.js";
 | 
				
			||||||
 | 
					import toastService from "../services/toast.js";
 | 
				
			||||||
 | 
					import appContext, { type CommandListenerData, type EventData } from "../components/app_context.js";
 | 
				
			||||||
 | 
					import keyboardActionsService from "../services/keyboard_actions.js";
 | 
				
			||||||
 | 
					import clipboard from "../services/clipboard.js";
 | 
				
			||||||
 | 
					import protectedSessionService from "../services/protected_session.js";
 | 
				
			||||||
 | 
					import linkService from "../services/link.js";
 | 
				
			||||||
 | 
					import options from "../services/options.js";
 | 
				
			||||||
 | 
					import protectedSessionHolder from "../services/protected_session_holder.js";
 | 
				
			||||||
 | 
					import dialogService from "../services/dialog.js";
 | 
				
			||||||
 | 
					import shortcutService from "../services/shortcuts.js";
 | 
				
			||||||
 | 
					import { t } from "../services/i18n.js";
 | 
				
			||||||
 | 
					import type FBranch from "../entities/fbranch.js";
 | 
				
			||||||
 | 
					import type LoadResults from "../services/load_results.js";
 | 
				
			||||||
 | 
					import type FNote from "../entities/fnote.js";
 | 
				
			||||||
 | 
					import type { NoteType } from "../entities/fnote.js";
 | 
				
			||||||
 | 
					import type { AttributeRow, BranchRow } from "../services/load_results.js";
 | 
				
			||||||
 | 
					import type { SetNoteOpts } from "../components/note_context.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const TPL = /*html*/`
 | 
					const TPL = /*html*/`
 | 
				
			||||||
<div class="tree-wrapper">
 | 
					<div class="tree-wrapper">
 | 
				
			||||||
@ -241,7 +241,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
        this.$autoCollapseNoteTree = this.$treeSettingsPopup.find(".auto-collapse-note-tree");
 | 
					        this.$autoCollapseNoteTree = this.$treeSettingsPopup.find(".auto-collapse-note-tree");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.$treeSettingsButton = this.$widget.find(".tree-settings-button");
 | 
					        this.$treeSettingsButton = this.$widget.find(".tree-settings-button");
 | 
				
			||||||
        this.$treeSettingsButton.on("click", () => {
 | 
					        this.$treeSettingsButton.on("click", (e) => {
 | 
				
			||||||
            if (this.$treeSettingsPopup.is(":visible")) {
 | 
					            if (this.$treeSettingsPopup.is(":visible")) {
 | 
				
			||||||
                this.$treeSettingsPopup.hide();
 | 
					                this.$treeSettingsPopup.hide();
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
@ -466,7 +466,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
                    data.dataTransfer.setData("text", JSON.stringify(notes));
 | 
					                    data.dataTransfer.setData("text", JSON.stringify(notes));
 | 
				
			||||||
                    return true; // allow dragging to start
 | 
					                    return true; // allow dragging to start
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                dragEnter: (node) => {
 | 
					                dragEnter: (node, data) => {
 | 
				
			||||||
                    if (node.data.noteType === "search") {
 | 
					                    if (node.data.noteType === "search") {
 | 
				
			||||||
                        return false;
 | 
					                        return false;
 | 
				
			||||||
                    } else if (node.data.noteId === "_lbRoot") {
 | 
					                    } else if (node.data.noteId === "_lbRoot") {
 | 
				
			||||||
@ -512,12 +512,8 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                        try {
 | 
					                        try {
 | 
				
			||||||
                            notes = JSON.parse(jsonStr);
 | 
					                            notes = JSON.parse(jsonStr);
 | 
				
			||||||
                        } catch (error: unknown) {
 | 
					                        } catch (e) {
 | 
				
			||||||
                            if (error instanceof Error) {
 | 
					                            logError(`Cannot parse JSON '${jsonStr}' into notes for drop`);
 | 
				
			||||||
                                logError(`Cannot parse JSON '${jsonStr}' into notes for drop: ${error.message}`);
 | 
					 | 
				
			||||||
                            } else {
 | 
					 | 
				
			||||||
                                logError(`Cannot parse JSON '${jsonStr}' into notes for drop: Unknown error`);
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            return;
 | 
					                            return;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -675,16 +671,17 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
            let showTimeout: Timeout;
 | 
					            let showTimeout: Timeout;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.$tree.on("touchstart", ".fancytree-node", (e) => {
 | 
					            this.$tree.on("touchstart", ".fancytree-node", (e) => {
 | 
				
			||||||
 | 
					                touchStart = new Date().getTime();
 | 
				
			||||||
                showTimeout = setTimeout(() => {
 | 
					                showTimeout = setTimeout(() => {
 | 
				
			||||||
                    this.showContextMenu(e);
 | 
					                    this.showContextMenu(e);
 | 
				
			||||||
                }, 300);
 | 
					                }, 300);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.$tree.on("touchmove", ".fancytree-node", () => {
 | 
					            this.$tree.on("touchmove", ".fancytree-node", (e) => {
 | 
				
			||||||
                clearTimeout(showTimeout);
 | 
					                clearTimeout(showTimeout);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.$tree.on("touchend", ".fancytree-node", () => {
 | 
					            this.$tree.on("touchend", ".fancytree-node", (e) => {
 | 
				
			||||||
                clearTimeout(showTimeout);
 | 
					                clearTimeout(showTimeout);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
@ -706,6 +703,8 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
            });
 | 
					            });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        let touchStart;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.tree = $.ui.fancytree.getTree(this.$tree);
 | 
					        this.tree = $.ui.fancytree.getTree(this.$tree);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1252,7 +1251,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        // activeNode is supposed to be moved when we find out activeNode is deleted but not all branches are deleted. save it for fixing activeNodePath after all nodes loaded.
 | 
					        // activeNode is supposed to be moved when we find out activeNode is deleted but not all branches are deleted. save it for fixing activeNodePath after all nodes loaded.
 | 
				
			||||||
        let movedActiveNode = null;
 | 
					        let movedActiveNode = null;
 | 
				
			||||||
        const parentsOfAddedNodes = [];
 | 
					        let parentsOfAddedNodes = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (const branchRow of branchRows) {
 | 
					        for (const branchRow of branchRows) {
 | 
				
			||||||
            if (branchRow.noteId) {
 | 
					            if (branchRow.noteId) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user