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-07-05 14:46:20 +02:00
|
|
|
import CalendarMenuWidget from "../widgets/buttons/calendar_menu.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";
|
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()
|
|
|
|
.icon("bx-map-alt")
|
2021-09-20 22:19:47 +02:00
|
|
|
.title("Global note map")
|
|
|
|
.targetNote('globalnotemap'))
|
2021-05-18 22:14:35 +02:00
|
|
|
.child(new ButtonWidget()
|
|
|
|
.icon("bx-history")
|
|
|
|
.title("Show recent changes")
|
|
|
|
.command("showRecentChanges"))
|
2021-07-05 14:46:20 +02:00
|
|
|
.child(new CalendarMenuWidget())
|
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-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(() =>
|
|
|
|
new FlexContainer('column')
|
|
|
|
.css("flex-grow", "1")
|
2021-06-13 22:55:31 +02:00
|
|
|
.collapsible()
|
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())
|
|
|
|
.ribbon(new BasicPropertiesWidget())
|
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())
|
|
|
|
.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()
|
|
|
|
.icon('bx bx-history')
|
|
|
|
.title("Note Revisions")
|
|
|
|
.command("showNoteRevisions")
|
|
|
|
.titlePlacement("bottom"))
|
|
|
|
.button(new NoteActionsWidget())
|
|
|
|
)
|
2021-06-13 22:55:31 +02:00
|
|
|
.child(new NoteUpdateStatusWidget())
|
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())
|
2021-09-29 22:10:15 +02:00
|
|
|
.child(new MermaidWidget())
|
2021-06-03 23:34:40 +02:00
|
|
|
.child(new NoteDetailWidget())
|
|
|
|
.child(new NoteListWidget())
|
|
|
|
.child(new SearchResultWidget())
|
|
|
|
.child(new SqlResultWidget())
|
|
|
|
)
|
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()
|
|
|
|
.child(...this.customWidgets.get('right-pane'))
|
2020-12-27 22:19:27 +01:00
|
|
|
)
|
2020-02-27 10:03:14 +01:00
|
|
|
)
|
|
|
|
);
|
2020-02-06 21:47:31 +01:00
|
|
|
}
|
2020-05-12 12:45:32 +02:00
|
|
|
}
|