2021-03-28 22:24:24 +02:00
|
|
|
import FlexContainer from "../widgets/containers/flex_container.js";
|
2021-05-24 22:29:49 +02:00
|
|
|
import GlobalMenuWidget from "../widgets/buttons/global_menu.js";
|
2020-04-25 23:52:13 +02:00
|
|
|
import TabRowWidget from "../widgets/tab_row.js";
|
|
|
|
import TitleBarButtonsWidget from "../widgets/title_bar_buttons.js";
|
2021-06-03 22:23:11 +02:00
|
|
|
import LeftPaneContainer from "../widgets/containers/left_pane_container.js";
|
2020-04-25 23:52:13 +02:00
|
|
|
import NoteTreeWidget from "../widgets/note_tree.js";
|
|
|
|
import NoteTitleWidget from "../widgets/note_title.js";
|
2021-06-03 12:47:13 +02:00
|
|
|
import OwnedAttributeListWidget from "../widgets/ribbon_widgets/owned_attribute_list.js";
|
2021-05-24 22:29:49 +02:00
|
|
|
import NoteActionsWidget from "../widgets/buttons/note_actions.js";
|
2020-04-25 23:52:13 +02:00
|
|
|
import NoteDetailWidget from "../widgets/note_detail.js";
|
2021-06-03 12:47:13 +02:00
|
|
|
import RibbonContainer from "../widgets/containers/ribbon_container.js";
|
|
|
|
import PromotedAttributesWidget from "../widgets/ribbon_widgets/promoted_attributes.js";
|
|
|
|
import InheritedAttributesWidget from "../widgets/ribbon_widgets/inherited_attribute_list.js";
|
2020-11-25 23:18:30 +01:00
|
|
|
import NoteListWidget from "../widgets/note_list.js";
|
2021-06-03 12:47:13 +02:00
|
|
|
import SearchDefinitionWidget from "../widgets/ribbon_widgets/search_definition.js";
|
2020-12-29 22:27:31 +01:00
|
|
|
import SqlResultWidget from "../widgets/sql_result.js";
|
|
|
|
import SqlTableSchemasWidget from "../widgets/sql_table_schemas.js";
|
2021-06-03 12:47:13 +02:00
|
|
|
import FilePropertiesWidget from "../widgets/ribbon_widgets/file_properties.js";
|
|
|
|
import ImagePropertiesWidget from "../widgets/ribbon_widgets/image_properties.js";
|
|
|
|
import NotePropertiesWidget from "../widgets/ribbon_widgets/note_properties.js";
|
2021-02-13 20:07:08 +01:00
|
|
|
import NoteIconWidget from "../widgets/note_icon.js";
|
2021-02-19 22:15:56 +01:00
|
|
|
import SearchResultWidget from "../widgets/search_result.js";
|
2021-03-20 00:00:49 +01:00
|
|
|
import SyncStatusWidget from "../widgets/sync_status.js";
|
2021-03-28 22:24:24 +02:00
|
|
|
import ScrollingContainer from "../widgets/containers/scrolling_container.js";
|
|
|
|
import RootContainer from "../widgets/containers/root_container.js";
|
2021-04-24 21:56:44 +02:00
|
|
|
import NoteUpdateStatusWidget from "../widgets/note_update_status.js";
|
2021-05-17 21:46:18 +02:00
|
|
|
import SpacerWidget from "../widgets/spacer.js";
|
|
|
|
import QuickSearchWidget from "../widgets/quick_search.js";
|
2021-05-24 22:29:49 +02:00
|
|
|
import ButtonWidget from "../widgets/buttons/button_widget.js";
|
|
|
|
import ProtectedSessionStatusWidget from "../widgets/buttons/protected_session_status.js";
|
2021-06-03 22:23:11 +02:00
|
|
|
import SplitNoteContainer from "../widgets/containers/split_note_container.js";
|
|
|
|
import LeftPaneToggleWidget from "../widgets/buttons/left_pane_toggle.js";
|
2021-05-24 22:29:49 +02:00
|
|
|
import CreatePaneButton from "../widgets/buttons/create_pane_button.js";
|
|
|
|
import ClosePaneButton from "../widgets/buttons/close_pane_button.js";
|
2021-06-03 12:47:13 +02:00
|
|
|
import BasicPropertiesWidget from "../widgets/ribbon_widgets/basic_properties.js";
|
|
|
|
import NoteInfoWidget from "../widgets/ribbon_widgets/note_info_widget.js";
|
|
|
|
import BookPropertiesWidget from "../widgets/ribbon_widgets/book_properties.js";
|
2021-09-22 21:11:36 +02:00
|
|
|
import NoteMapRibbonWidget from "../widgets/ribbon_widgets/note_map.js";
|
2021-06-03 12:47:13 +02:00
|
|
|
import NotePathsWidget from "../widgets/ribbon_widgets/note_paths.js";
|
|
|
|
import SimilarNotesWidget from "../widgets/ribbon_widgets/similar_notes.js";
|
2021-06-03 23:34:40 +02:00
|
|
|
import RightPaneContainer from "../widgets/containers/right_pane_container.js";
|
2021-06-15 22:59:13 +02:00
|
|
|
import EditButton from "../widgets/buttons/edit_button.js";
|
2021-10-07 21:57:20 +02:00
|
|
|
import CalendarWidget from "../widgets/buttons/calendar.js";
|
2021-07-05 14:56:40 +02:00
|
|
|
import EditedNotesWidget from "../widgets/ribbon_widgets/edited_notes.js";
|
2021-09-16 23:09:48 +02:00
|
|
|
import OpenNoteButtonWidget from "../widgets/buttons/open_note_button_widget.js";
|
2021-09-29 22:10:15 +02:00
|
|
|
import MermaidWidget from "../widgets/mermaid.js";
|
2021-10-05 22:08:02 +02:00
|
|
|
import BookmarkButtons from "../widgets/bookmark_buttons.js";
|
2021-11-24 21:27:55 +01:00
|
|
|
import NoteWrapperWidget from "../widgets/note_wrapper.js";
|
2021-12-01 23:12:54 +01:00
|
|
|
import BacklinksWidget from "../widgets/backlinks.js";
|
2021-12-20 17:30:47 +01:00
|
|
|
import SharedInfoWidget from "../widgets/shared_info.js";
|
2022-05-09 23:13:34 +02:00
|
|
|
import FindWidget from "../widgets/find.js";
|
2022-05-29 21:44:26 +02:00
|
|
|
import TocWidget from "../widgets/toc.js";
|
2022-06-11 23:29:52 +02:00
|
|
|
import BulkActionsDialog from "../widgets/dialogs/bulk_actions.js";
|
2022-06-12 14:03:59 +02:00
|
|
|
import AboutDialog from "../widgets/dialogs/about.js";
|
2022-06-14 23:51:16 +02:00
|
|
|
import NoteSourceDialog from "../widgets/dialogs/note_source.js";
|
2022-06-13 00:00:15 +02:00
|
|
|
import HelpDialog from "../widgets/dialogs/help.js";
|
2022-06-14 22:55:07 +02:00
|
|
|
import RecentChangesDialog from "../widgets/dialogs/recent_changes.js";
|
2022-06-14 23:00:24 +02:00
|
|
|
import BackendLogDialog from "../widgets/dialogs/backend_log.js";
|
2022-06-14 23:07:42 +02:00
|
|
|
import BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js";
|
2022-06-14 23:19:41 +02:00
|
|
|
import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js";
|
2022-06-14 23:32:16 +02:00
|
|
|
import PasswordNoteSetDialog from "../widgets/dialogs/password_not_set.js";
|
2022-06-14 23:51:16 +02:00
|
|
|
import IncludeNoteDialog from "../widgets/dialogs/include_note.js";
|
2022-06-15 00:10:32 +02:00
|
|
|
import NoteTypeChooserDialog from "../widgets/dialogs/note_type_chooser.js";
|
2022-06-16 10:42:49 +02:00
|
|
|
import JumpToNoteDialog from "../widgets/dialogs/jump_to_note.js";
|
2022-06-16 11:03:04 +02:00
|
|
|
import AddLinkDialog from "../widgets/dialogs/add_link.js";
|
2022-06-16 14:02:43 +02:00
|
|
|
import CloneToDialog from "../widgets/dialogs/clone_to.js";
|
2022-06-16 14:08:33 +02:00
|
|
|
import MoveToDialog from "../widgets/dialogs/move_to.js";
|
2020-02-06 21:47:31 +01:00
|
|
|
|
2021-03-21 23:05:31 +01:00
|
|
|
export default class DesktopLayout {
|
2020-03-16 21:16:09 +01:00
|
|
|
constructor(customWidgets) {
|
|
|
|
this.customWidgets = customWidgets;
|
|
|
|
}
|
|
|
|
|
2020-02-06 21:47:31 +01:00
|
|
|
getRootWidget(appContext) {
|
2020-05-02 00:28:40 +02:00
|
|
|
appContext.mainTreeWidget = new NoteTreeWidget("main");
|
2020-03-15 21:52:04 +01:00
|
|
|
|
2021-03-28 22:24:24 +02:00
|
|
|
return new RootContainer()
|
2020-02-27 12:26:42 +01:00
|
|
|
.setParent(appContext)
|
2021-05-18 22:14:35 +02:00
|
|
|
.child(new FlexContainer("column")
|
2021-06-03 22:23:11 +02:00
|
|
|
.id("launcher-pane")
|
2021-06-13 22:55:31 +02:00
|
|
|
.css("width", "53px")
|
2021-05-18 22:14:35 +02:00
|
|
|
.child(new GlobalMenuWidget())
|
|
|
|
.child(new ButtonWidget()
|
|
|
|
.icon("bx-file-blank")
|
|
|
|
.title("New note")
|
|
|
|
.command("createNoteIntoInbox"))
|
|
|
|
.child(new ButtonWidget()
|
|
|
|
.icon("bx-search")
|
|
|
|
.title("Search")
|
|
|
|
.command("searchNotes"))
|
|
|
|
.child(new ButtonWidget()
|
|
|
|
.icon("bx-send")
|
|
|
|
.title("Jump to note")
|
|
|
|
.command("jumpToNote"))
|
2021-09-16 23:09:48 +02:00
|
|
|
.child(new OpenNoteButtonWidget()
|
2021-09-20 22:19:47 +02:00
|
|
|
.targetNote('globalnotemap'))
|
2021-05-18 22:14:35 +02:00
|
|
|
.child(new ButtonWidget()
|
|
|
|
.icon("bx-history")
|
|
|
|
.title("Show recent changes")
|
|
|
|
.command("showRecentChanges"))
|
2021-10-07 21:57:20 +02:00
|
|
|
.child(new CalendarWidget())
|
2021-06-05 14:12:17 +02:00
|
|
|
.child(new SpacerWidget(40, 0))
|
|
|
|
.child(new FlexContainer("column")
|
2021-06-13 22:55:31 +02:00
|
|
|
.id("plugin-buttons")
|
|
|
|
.contentSized())
|
2021-10-05 22:08:02 +02:00
|
|
|
.child(new BookmarkButtons())
|
2021-06-05 14:12:17 +02:00
|
|
|
.child(new SpacerWidget(0, 1000))
|
2021-05-18 22:14:35 +02:00
|
|
|
.child(new ProtectedSessionStatusWidget())
|
|
|
|
.child(new SyncStatusWidget())
|
2021-06-03 22:23:11 +02:00
|
|
|
.child(new LeftPaneToggleWidget())
|
2021-05-18 22:14:35 +02:00
|
|
|
)
|
2021-06-03 22:23:11 +02:00
|
|
|
.child(new LeftPaneContainer()
|
2021-05-17 21:46:18 +02:00
|
|
|
.child(new QuickSearchWidget())
|
|
|
|
.child(appContext.mainTreeWidget)
|
2021-06-03 22:23:11 +02:00
|
|
|
.child(...this.customWidgets.get('left-pane'))
|
2021-05-17 21:46:18 +02:00
|
|
|
)
|
|
|
|
.child(new FlexContainer('column')
|
2021-06-05 14:01:21 +02:00
|
|
|
.id('rest-pane')
|
2021-05-17 21:46:18 +02:00
|
|
|
.css("flex-grow", "1")
|
2021-06-05 22:07:15 +02:00
|
|
|
.child(new FlexContainer('row')
|
2021-05-18 22:14:35 +02:00
|
|
|
.child(new TabRowWidget())
|
2021-05-17 21:46:18 +02:00
|
|
|
.child(new TitleBarButtonsWidget())
|
2021-05-23 21:24:22 +02:00
|
|
|
.css('height', '40px')
|
2020-02-27 10:03:14 +01:00
|
|
|
)
|
2021-06-03 23:34:40 +02:00
|
|
|
.child(new FlexContainer('row')
|
|
|
|
.filling()
|
2021-06-13 22:55:31 +02:00
|
|
|
.collapsible()
|
2021-06-03 23:34:40 +02:00
|
|
|
.child(new FlexContainer('column')
|
|
|
|
.filling()
|
2021-06-13 22:55:31 +02:00
|
|
|
.collapsible()
|
2021-06-03 23:34:40 +02:00
|
|
|
.id('center-pane')
|
|
|
|
.child(new SplitNoteContainer(() =>
|
2021-11-24 21:27:55 +01:00
|
|
|
new NoteWrapperWidget()
|
2021-06-03 23:34:40 +02:00
|
|
|
.child(new FlexContainer('row').class('title-row')
|
2021-06-13 22:55:31 +02:00
|
|
|
.css("height", "50px")
|
|
|
|
.css('align-items', "center")
|
2021-06-03 23:34:40 +02:00
|
|
|
.cssBlock('.title-row > * { margin: 5px; }')
|
|
|
|
.child(new NoteIconWidget())
|
|
|
|
.child(new NoteTitleWidget())
|
2021-06-05 14:12:17 +02:00
|
|
|
.child(new SpacerWidget(0, 1))
|
2021-06-03 23:34:40 +02:00
|
|
|
.child(new ClosePaneButton())
|
|
|
|
.child(new CreatePaneButton())
|
|
|
|
)
|
|
|
|
.child(
|
|
|
|
new RibbonContainer()
|
|
|
|
.ribbon(new SearchDefinitionWidget())
|
2021-07-05 14:56:40 +02:00
|
|
|
.ribbon(new EditedNotesWidget())
|
2021-06-03 23:34:40 +02:00
|
|
|
.ribbon(new BookPropertiesWidget())
|
|
|
|
.ribbon(new NotePropertiesWidget())
|
|
|
|
.ribbon(new FilePropertiesWidget())
|
|
|
|
.ribbon(new ImagePropertiesWidget())
|
|
|
|
.ribbon(new PromotedAttributesWidget())
|
2021-10-10 21:47:56 +02:00
|
|
|
.ribbon(new BasicPropertiesWidget())
|
2021-06-03 23:34:40 +02:00
|
|
|
.ribbon(new OwnedAttributeListWidget())
|
|
|
|
.ribbon(new InheritedAttributesWidget())
|
|
|
|
.ribbon(new NotePathsWidget())
|
2021-09-22 21:11:36 +02:00
|
|
|
.ribbon(new NoteMapRibbonWidget())
|
2021-06-03 23:34:40 +02:00
|
|
|
.ribbon(new SimilarNotesWidget())
|
|
|
|
.ribbon(new NoteInfoWidget())
|
2021-06-15 22:59:13 +02:00
|
|
|
.button(new EditButton())
|
2021-06-03 23:34:40 +02:00
|
|
|
.button(new ButtonWidget()
|
2021-10-03 10:42:46 +02:00
|
|
|
.icon('bx-history')
|
2021-06-03 23:34:40 +02:00
|
|
|
.title("Note Revisions")
|
|
|
|
.command("showNoteRevisions")
|
|
|
|
.titlePlacement("bottom"))
|
|
|
|
.button(new NoteActionsWidget())
|
|
|
|
)
|
2021-12-20 17:30:47 +01:00
|
|
|
.child(new SharedInfoWidget())
|
2021-06-13 22:55:31 +02:00
|
|
|
.child(new NoteUpdateStatusWidget())
|
2021-12-01 23:12:54 +01:00
|
|
|
.child(new BacklinksWidget())
|
2021-09-30 09:48:03 +02:00
|
|
|
.child(new MermaidWidget())
|
2021-06-03 23:34:40 +02:00
|
|
|
.child(
|
|
|
|
new ScrollingContainer()
|
2021-06-13 22:55:31 +02:00
|
|
|
.filling()
|
2021-06-03 23:34:40 +02:00
|
|
|
.child(new SqlTableSchemasWidget())
|
|
|
|
.child(new NoteDetailWidget())
|
|
|
|
.child(new NoteListWidget())
|
|
|
|
.child(new SearchResultWidget())
|
|
|
|
.child(new SqlResultWidget())
|
|
|
|
)
|
2022-05-17 23:22:28 +02:00
|
|
|
.child(new FindWidget())
|
2021-06-05 23:35:47 +02:00
|
|
|
.child(...this.customWidgets.get('node-detail-pane'))
|
2021-06-03 23:34:40 +02:00
|
|
|
)
|
2021-05-19 22:45:34 +02:00
|
|
|
)
|
2021-06-05 23:35:47 +02:00
|
|
|
.child(...this.customWidgets.get('center-pane'))
|
2021-06-03 23:34:40 +02:00
|
|
|
)
|
|
|
|
.child(new RightPaneContainer()
|
2022-05-29 21:44:26 +02:00
|
|
|
.child(new TocWidget())
|
2021-06-03 23:34:40 +02:00
|
|
|
.child(...this.customWidgets.get('right-pane'))
|
2020-12-27 22:19:27 +01:00
|
|
|
)
|
2020-02-27 10:03:14 +01:00
|
|
|
)
|
2022-06-11 23:29:52 +02:00
|
|
|
)
|
2022-06-12 14:03:59 +02:00
|
|
|
.child(new BulkActionsDialog())
|
2022-06-12 19:38:28 +02:00
|
|
|
.child(new AboutDialog())
|
2022-06-13 00:00:15 +02:00
|
|
|
.child(new NoteSourceDialog())
|
2022-06-14 22:55:07 +02:00
|
|
|
.child(new HelpDialog())
|
2022-06-14 23:00:24 +02:00
|
|
|
.child(new RecentChangesDialog())
|
2022-06-14 23:07:42 +02:00
|
|
|
.child(new BackendLogDialog())
|
2022-06-14 23:19:41 +02:00
|
|
|
.child(new BranchPrefixDialog())
|
2022-06-14 23:32:16 +02:00
|
|
|
.child(new SortChildNotesDialog())
|
2022-06-14 23:51:16 +02:00
|
|
|
.child(new PasswordNoteSetDialog())
|
2022-06-15 00:10:32 +02:00
|
|
|
.child(new IncludeNoteDialog())
|
2022-06-16 10:42:49 +02:00
|
|
|
.child(new NoteTypeChooserDialog())
|
2022-06-16 11:03:04 +02:00
|
|
|
.child(new JumpToNoteDialog())
|
2022-06-16 14:02:43 +02:00
|
|
|
.child(new AddLinkDialog())
|
2022-06-16 14:08:33 +02:00
|
|
|
.child(new CloneToDialog())
|
|
|
|
.child(new MoveToDialog());
|
2020-02-06 21:47:31 +01:00
|
|
|
}
|
2020-05-12 12:45:32 +02:00
|
|
|
}
|