diff --git a/.eslintignore b/.eslintignore index 52a18a18a7..732147a895 100644 --- a/.eslintignore +++ b/.eslintignore @@ -335,9 +335,9 @@ packages/app-desktop/gui/ConfigScreen/ButtonBar.js.map packages/app-desktop/gui/ConfigScreen/ConfigScreen.d.ts packages/app-desktop/gui/ConfigScreen/ConfigScreen.js packages/app-desktop/gui/ConfigScreen/ConfigScreen.js.map -packages/app-desktop/gui/ConfigScreen/SideBar.d.ts -packages/app-desktop/gui/ConfigScreen/SideBar.js -packages/app-desktop/gui/ConfigScreen/SideBar.js.map +packages/app-desktop/gui/ConfigScreen/Sidebar.d.ts +packages/app-desktop/gui/ConfigScreen/Sidebar.js +packages/app-desktop/gui/ConfigScreen/Sidebar.js.map packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.d.ts packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.js packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.js.map @@ -452,9 +452,9 @@ packages/app-desktop/gui/MainScreen/commands/toggleLayoutMoveMode.js.map packages/app-desktop/gui/MainScreen/commands/toggleNoteList.d.ts packages/app-desktop/gui/MainScreen/commands/toggleNoteList.js packages/app-desktop/gui/MainScreen/commands/toggleNoteList.js.map -packages/app-desktop/gui/MainScreen/commands/toggleSideBar.d.ts -packages/app-desktop/gui/MainScreen/commands/toggleSideBar.js -packages/app-desktop/gui/MainScreen/commands/toggleSideBar.js.map +packages/app-desktop/gui/MainScreen/commands/toggleSidebar.d.ts +packages/app-desktop/gui/MainScreen/commands/toggleSidebar.js +packages/app-desktop/gui/MainScreen/commands/toggleSidebar.js.map packages/app-desktop/gui/MainScreen/commands/toggleVisiblePanes.d.ts packages/app-desktop/gui/MainScreen/commands/toggleVisiblePanes.js packages/app-desktop/gui/MainScreen/commands/toggleVisiblePanes.js.map @@ -680,15 +680,15 @@ packages/app-desktop/gui/SearchBar/SearchBar.js.map packages/app-desktop/gui/ShareNoteDialog.d.ts packages/app-desktop/gui/ShareNoteDialog.js packages/app-desktop/gui/ShareNoteDialog.js.map -packages/app-desktop/gui/SideBar/SideBar.d.ts -packages/app-desktop/gui/SideBar/SideBar.js -packages/app-desktop/gui/SideBar/SideBar.js.map -packages/app-desktop/gui/SideBar/commands/focusElementSideBar.d.ts -packages/app-desktop/gui/SideBar/commands/focusElementSideBar.js -packages/app-desktop/gui/SideBar/commands/focusElementSideBar.js.map -packages/app-desktop/gui/SideBar/styles/index.d.ts -packages/app-desktop/gui/SideBar/styles/index.js -packages/app-desktop/gui/SideBar/styles/index.js.map +packages/app-desktop/gui/Sidebar/Sidebar.d.ts +packages/app-desktop/gui/Sidebar/Sidebar.js +packages/app-desktop/gui/Sidebar/Sidebar.js.map +packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.d.ts +packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.js +packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.js.map +packages/app-desktop/gui/Sidebar/styles/index.d.ts +packages/app-desktop/gui/Sidebar/styles/index.js +packages/app-desktop/gui/Sidebar/styles/index.js.map packages/app-desktop/gui/StatusScreen/StatusScreen.d.ts packages/app-desktop/gui/StatusScreen/StatusScreen.js packages/app-desktop/gui/StatusScreen/StatusScreen.js.map @@ -1370,15 +1370,15 @@ packages/lib/uuid.js.map packages/lib/versionInfo.d.ts packages/lib/versionInfo.js packages/lib/versionInfo.js.map -packages/plugins/ToggleSideBars/api/index.d.ts -packages/plugins/ToggleSideBars/api/index.js -packages/plugins/ToggleSideBars/api/index.js.map -packages/plugins/ToggleSideBars/api/types.d.ts -packages/plugins/ToggleSideBars/api/types.js -packages/plugins/ToggleSideBars/api/types.js.map -packages/plugins/ToggleSideBars/src/index.d.ts -packages/plugins/ToggleSideBars/src/index.js -packages/plugins/ToggleSideBars/src/index.js.map +packages/plugins/ToggleSidebars/api/index.d.ts +packages/plugins/ToggleSidebars/api/index.js +packages/plugins/ToggleSidebars/api/index.js.map +packages/plugins/ToggleSidebars/api/types.d.ts +packages/plugins/ToggleSidebars/api/types.js +packages/plugins/ToggleSidebars/api/types.js.map +packages/plugins/ToggleSidebars/src/index.d.ts +packages/plugins/ToggleSidebars/src/index.js +packages/plugins/ToggleSidebars/src/index.js.map packages/renderer/HtmlToHtml.d.ts packages/renderer/HtmlToHtml.js packages/renderer/HtmlToHtml.js.map diff --git a/.gitignore b/.gitignore index 54659efb67..3dcd4042d1 100644 --- a/.gitignore +++ b/.gitignore @@ -324,9 +324,9 @@ packages/app-desktop/gui/ConfigScreen/ButtonBar.js.map packages/app-desktop/gui/ConfigScreen/ConfigScreen.d.ts packages/app-desktop/gui/ConfigScreen/ConfigScreen.js packages/app-desktop/gui/ConfigScreen/ConfigScreen.js.map -packages/app-desktop/gui/ConfigScreen/SideBar.d.ts -packages/app-desktop/gui/ConfigScreen/SideBar.js -packages/app-desktop/gui/ConfigScreen/SideBar.js.map +packages/app-desktop/gui/ConfigScreen/Sidebar.d.ts +packages/app-desktop/gui/ConfigScreen/Sidebar.js +packages/app-desktop/gui/ConfigScreen/Sidebar.js.map packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.d.ts packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.js packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.js.map @@ -441,9 +441,9 @@ packages/app-desktop/gui/MainScreen/commands/toggleLayoutMoveMode.js.map packages/app-desktop/gui/MainScreen/commands/toggleNoteList.d.ts packages/app-desktop/gui/MainScreen/commands/toggleNoteList.js packages/app-desktop/gui/MainScreen/commands/toggleNoteList.js.map -packages/app-desktop/gui/MainScreen/commands/toggleSideBar.d.ts -packages/app-desktop/gui/MainScreen/commands/toggleSideBar.js -packages/app-desktop/gui/MainScreen/commands/toggleSideBar.js.map +packages/app-desktop/gui/MainScreen/commands/toggleSidebar.d.ts +packages/app-desktop/gui/MainScreen/commands/toggleSidebar.js +packages/app-desktop/gui/MainScreen/commands/toggleSidebar.js.map packages/app-desktop/gui/MainScreen/commands/toggleVisiblePanes.d.ts packages/app-desktop/gui/MainScreen/commands/toggleVisiblePanes.js packages/app-desktop/gui/MainScreen/commands/toggleVisiblePanes.js.map @@ -669,15 +669,15 @@ packages/app-desktop/gui/SearchBar/SearchBar.js.map packages/app-desktop/gui/ShareNoteDialog.d.ts packages/app-desktop/gui/ShareNoteDialog.js packages/app-desktop/gui/ShareNoteDialog.js.map -packages/app-desktop/gui/SideBar/SideBar.d.ts -packages/app-desktop/gui/SideBar/SideBar.js -packages/app-desktop/gui/SideBar/SideBar.js.map -packages/app-desktop/gui/SideBar/commands/focusElementSideBar.d.ts -packages/app-desktop/gui/SideBar/commands/focusElementSideBar.js -packages/app-desktop/gui/SideBar/commands/focusElementSideBar.js.map -packages/app-desktop/gui/SideBar/styles/index.d.ts -packages/app-desktop/gui/SideBar/styles/index.js -packages/app-desktop/gui/SideBar/styles/index.js.map +packages/app-desktop/gui/Sidebar/Sidebar.d.ts +packages/app-desktop/gui/Sidebar/Sidebar.js +packages/app-desktop/gui/Sidebar/Sidebar.js.map +packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.d.ts +packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.js +packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.js.map +packages/app-desktop/gui/Sidebar/styles/index.d.ts +packages/app-desktop/gui/Sidebar/styles/index.js +packages/app-desktop/gui/Sidebar/styles/index.js.map packages/app-desktop/gui/StatusScreen/StatusScreen.d.ts packages/app-desktop/gui/StatusScreen/StatusScreen.js packages/app-desktop/gui/StatusScreen/StatusScreen.js.map @@ -1359,15 +1359,15 @@ packages/lib/uuid.js.map packages/lib/versionInfo.d.ts packages/lib/versionInfo.js packages/lib/versionInfo.js.map -packages/plugins/ToggleSideBars/api/index.d.ts -packages/plugins/ToggleSideBars/api/index.js -packages/plugins/ToggleSideBars/api/index.js.map -packages/plugins/ToggleSideBars/api/types.d.ts -packages/plugins/ToggleSideBars/api/types.js -packages/plugins/ToggleSideBars/api/types.js.map -packages/plugins/ToggleSideBars/src/index.d.ts -packages/plugins/ToggleSideBars/src/index.js -packages/plugins/ToggleSideBars/src/index.js.map +packages/plugins/ToggleSidebars/api/index.d.ts +packages/plugins/ToggleSidebars/api/index.js +packages/plugins/ToggleSidebars/api/index.js.map +packages/plugins/ToggleSidebars/api/types.d.ts +packages/plugins/ToggleSidebars/api/types.js +packages/plugins/ToggleSidebars/api/types.js.map +packages/plugins/ToggleSidebars/src/index.d.ts +packages/plugins/ToggleSidebars/src/index.js +packages/plugins/ToggleSidebars/src/index.js.map packages/renderer/HtmlToHtml.d.ts packages/renderer/HtmlToHtml.js packages/renderer/HtmlToHtml.js.map diff --git a/packages/app-desktop/gui/Button/Button.tsx b/packages/app-desktop/gui/Button/Button.tsx index 8b7c71abe2..f29bd69323 100644 --- a/packages/app-desktop/gui/Button/Button.tsx +++ b/packages/app-desktop/gui/Button/Button.tsx @@ -6,7 +6,7 @@ export enum ButtonLevel { Primary = 'primary', Secondary = 'secondary', Tertiary = 'tertiary', - SideBarSecondary = 'sideBarSecondary', + SidebarSecondary = 'sidebarSecondary', } interface Props { @@ -121,7 +121,7 @@ const StyledButtonTertiary = styled(StyledButtonBase)` } `; -const StyledButtonSideBarSecondary = styled(StyledButtonBase)` +const StyledButtonSidebarSecondary = styled(StyledButtonBase)` background: none; border-color: ${(props: any) => props.theme.color2}; color: ${(props: any) => props.theme.color2}; @@ -166,7 +166,7 @@ const StyledButtonSideBarSecondary = styled(StyledButtonBase)` function buttonClass(level: ButtonLevel) { if (level === ButtonLevel.Primary) return StyledButtonPrimary; if (level === ButtonLevel.Tertiary) return StyledButtonTertiary; - if (level === ButtonLevel.SideBarSecondary) return StyledButtonSideBarSecondary; + if (level === ButtonLevel.SidebarSecondary) return StyledButtonSidebarSecondary; return StyledButtonSecondary; } diff --git a/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx b/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx index f1e893bdf1..abfd140884 100644 --- a/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx +++ b/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import SideBar from './SideBar'; +import Sidebar from './Sidebar'; import ButtonBar from './ButtonBar'; import Button, { ButtonLevel } from '../Button/Button'; import { _ } from '@joplin/lib/locale'; @@ -40,7 +40,7 @@ class ConfigScreenComponent extends React.Component<any, any> { marginBottom: 10, }; - this.sideBar_selectionChange = this.sideBar_selectionChange.bind(this); + this.sidebar_selectionChange = this.sidebar_selectionChange.bind(this); this.checkSyncConfig_ = this.checkSyncConfig_.bind(this); this.checkNextcloudAppButton_click = this.checkNextcloudAppButton_click.bind(this); this.showLogButton_click = this.showLogButton_click.bind(this); @@ -114,7 +114,7 @@ class ConfigScreenComponent extends React.Component<any, any> { this.setState({ selectedSectionName: section.name, screenName: screenName }); } - sideBar_selectionChange(event: any) { + sidebar_selectionChange(event: any) { this.switchSection(event.section.name); } @@ -729,9 +729,9 @@ class ConfigScreenComponent extends React.Component<any, any> { return ( <div style={{ display: 'flex', flexDirection: 'row' }}> - <SideBar + <Sidebar selection={this.state.selectedSectionName} - onSelectionChange={this.sideBar_selectionChange} + onSelectionChange={this.sidebar_selectionChange} sections={sections} /> <div style={style}> diff --git a/packages/app-desktop/gui/ConfigScreen/SideBar.tsx b/packages/app-desktop/gui/ConfigScreen/Sidebar.tsx similarity index 97% rename from packages/app-desktop/gui/ConfigScreen/SideBar.tsx rename to packages/app-desktop/gui/ConfigScreen/Sidebar.tsx index 19c07b25f8..fbf3af4a16 100644 --- a/packages/app-desktop/gui/ConfigScreen/SideBar.tsx +++ b/packages/app-desktop/gui/ConfigScreen/Sidebar.tsx @@ -47,7 +47,7 @@ export const StyledListItemIcon = styled.i` margin-right: ${(props: any) => props.theme.mainPadding / 1.5}px; `; -export default function SideBar(props: Props) { +export default function Sidebar(props: Props) { const buttons: any[] = []; function renderButton(section: any) { diff --git a/packages/app-desktop/gui/MainScreen/MainScreen.tsx b/packages/app-desktop/gui/MainScreen/MainScreen.tsx index be19011b67..7bdf18a456 100644 --- a/packages/app-desktop/gui/MainScreen/MainScreen.tsx +++ b/packages/app-desktop/gui/MainScreen/MainScreen.tsx @@ -9,7 +9,7 @@ import NoteContentPropertiesDialog from '../NoteContentPropertiesDialog'; import ShareNoteDialog from '../ShareNoteDialog'; import CommandService from '@joplin/lib/services/CommandService'; import { PluginStates, utils as pluginUtils } from '@joplin/lib/services/plugins/reducer'; -import SideBar from '../SideBar/SideBar'; +import Sidebar from '../Sidebar/Sidebar'; import UserWebview from '../../services/plugins/UserWebview'; import UserWebviewDialog from '../../services/plugins/UserWebviewDialog'; import { ContainerType } from '@joplin/lib/services/plugins/WebviewController'; @@ -578,7 +578,7 @@ class MainScreenComponent extends React.Component<Props, State> { const components: any = { sideBar: () => { - return <SideBar key={key} />; + return <Sidebar key={key} />; }, noteList: () => { diff --git a/packages/app-desktop/gui/SideBar/SideBar.tsx b/packages/app-desktop/gui/Sidebar/Sidebar.tsx similarity index 98% rename from packages/app-desktop/gui/SideBar/SideBar.tsx rename to packages/app-desktop/gui/Sidebar/Sidebar.tsx index d3a5493dab..9d747ad356 100644 --- a/packages/app-desktop/gui/SideBar/SideBar.tsx +++ b/packages/app-desktop/gui/Sidebar/Sidebar.tsx @@ -100,7 +100,7 @@ function FolderItem(props: any) { const menuUtils = new MenuUtils(CommandService.instance()); -class SideBarComponent extends React.Component<Props, State> { +class SidebarComponent extends React.Component<Props, State> { private folderItemsOrder_: any[] = []; private tagItemsOrder_: any[] = []; @@ -472,7 +472,7 @@ class SideBarComponent extends React.Component<Props, State> { <StyledHeaderIcon className={iconName}/> <StyledHeaderLabel>{label}</StyledHeaderLabel> </StyledHeader> - { onPlusButtonClick && <StyledAddButton onClick={onPlusButtonClick} iconName="fas fa-plus" level={ButtonLevel.SideBarSecondary}/> } + { onPlusButtonClick && <StyledAddButton onClick={onPlusButtonClick} iconName="fas fa-plus" level={ButtonLevel.SidebarSecondary}/> } </div> ); } @@ -581,7 +581,7 @@ class SideBarComponent extends React.Component<Props, State> { return ( <StyledSynchronizeButton - level={ButtonLevel.SideBarSecondary} + level={ButtonLevel.SidebarSecondary} iconName="icon-sync" key="sync_button" iconAnimation={iconAnimation} @@ -687,7 +687,7 @@ class SideBarComponent extends React.Component<Props, State> { ); return ( - <StyledRoot ref={this.rootRef} onKeyDown={this.onKeyDown} className="side-bar"> + <StyledRoot ref={this.rootRef} onKeyDown={this.onKeyDown} className="sidebar"> <div style={{ flex: 1, overflowX: 'hidden', overflowY: 'auto' }}>{items}</div> <div style={{ flex: 0, padding: theme.mainPadding }}> {syncReportComp} @@ -719,4 +719,4 @@ const mapStateToProps = (state: AppState) => { }; }; -export default connect(mapStateToProps)(SideBarComponent); +export default connect(mapStateToProps)(SidebarComponent); diff --git a/packages/app-desktop/gui/SideBar/commands/focusElementSideBar.ts b/packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.ts similarity index 91% rename from packages/app-desktop/gui/SideBar/commands/focusElementSideBar.ts rename to packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.ts index 986e14aa58..2bfeab3923 100644 --- a/packages/app-desktop/gui/SideBar/commands/focusElementSideBar.ts +++ b/packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.ts @@ -12,9 +12,9 @@ export const declaration: CommandDeclaration = { export const runtime = (comp: any): CommandRuntime => { return { execute: async (context: CommandContext) => { - const sideBarVisible = layoutItemProp((context.state as AppState).mainLayout, 'sideBar', 'visible'); + const sidebarVisible = layoutItemProp((context.state as AppState).mainLayout, 'sideBar', 'visible'); - if (sideBarVisible) { + if (sidebarVisible) { const item = comp.selectedItem(); if (item) { const anchorRef = comp.anchorItemRefs[item.type][item.id]; diff --git a/packages/app-desktop/gui/SideBar/styles/index.ts b/packages/app-desktop/gui/Sidebar/styles/index.ts similarity index 100% rename from packages/app-desktop/gui/SideBar/styles/index.ts rename to packages/app-desktop/gui/Sidebar/styles/index.ts diff --git a/packages/app-desktop/services/commands/stateToWhenClauseContext.ts b/packages/app-desktop/services/commands/stateToWhenClauseContext.ts index 4dbe1c26ab..32d46beb01 100644 --- a/packages/app-desktop/services/commands/stateToWhenClauseContext.ts +++ b/packages/app-desktop/services/commands/stateToWhenClauseContext.ts @@ -17,7 +17,10 @@ export default function stateToWhenClauseContext(state: AppState) { markdownEditorPaneVisible: state.settings['editor.codeView'] && state.noteVisiblePanes.includes('editor'), markdownViewerPaneVisible: state.settings['editor.codeView'] && state.noteVisiblePanes.includes('viewer'), modalDialogVisible: !!Object.keys(state.visibleDialogs).length, - sideBarVisible: !!state.mainLayout && layoutItemProp(state.mainLayout, 'sideBar', 'visible'), + sidebarVisible: !!state.mainLayout && layoutItemProp(state.mainLayout, 'sideBar', 'visible'), noteListHasNotes: !!state.notes.length, + + // Deprecated + sideBarVisible: !!state.mainLayout && layoutItemProp(state.mainLayout, 'sideBar', 'visible'), }; } diff --git a/packages/app-mobile/components/side-menu-content-note.js b/packages/app-mobile/components/side-menu-content-note.js index d23394c2d5..485d2c4837 100644 --- a/packages/app-mobile/components/side-menu-content-note.js +++ b/packages/app-mobile/components/side-menu-content-note.js @@ -54,7 +54,7 @@ class SideMenuContentNoteComponent extends Component { return <View style={{ marginTop: 15, marginBottom: 15, flex: -1, borderBottomWidth: 1, borderBottomColor: theme.dividerColor }} key={key}></View>; } - renderSideBarButton(key, title, iconName, onPressHandler) { + renderSidebarButton(key, title, iconName, onPressHandler) { const content = ( <View key={key} style={onPressHandler ? this.styles().sideButton : this.styles().sideButtonDisabled}> {!iconName ? null : <Icon name={iconName} style={this.styles().sidebarIcon} />} @@ -83,7 +83,7 @@ class SideMenuContentNoteComponent extends Component { if (option.isDivider) { items.push(this.renderDivider(`divider_${dividerIndex++}`)); } else { - items.push(this.renderSideBarButton(option.title, option.title, null, option.onPress)); + items.push(this.renderSidebarButton(option.title, option.title, null, option.onPress)); } } diff --git a/packages/app-mobile/components/side-menu-content.js b/packages/app-mobile/components/side-menu-content.js index e13cfb04c2..4a5fd90e13 100644 --- a/packages/app-mobile/components/side-menu-content.js +++ b/packages/app-mobile/components/side-menu-content.js @@ -274,7 +274,7 @@ class SideMenuContentComponent extends Component { ); } - renderSideBarButton(key, title, iconName, onPressHandler = null, selected = false) { + renderSidebarButton(key, title, iconName, onPressHandler = null, selected = false) { let icon = <Icon name={iconName} style={this.styles().sidebarIcon} />; if (key === 'synchronize_button') { @@ -309,11 +309,11 @@ class SideMenuContentComponent extends Component { items.push(this.makeDivider('divider_1')); - items.push(this.renderSideBarButton('newFolder_button', _('New Notebook'), 'md-folder-open', this.newFolderButton_press)); + items.push(this.renderSidebarButton('newFolder_button', _('New Notebook'), 'md-folder-open', this.newFolderButton_press)); - items.push(this.renderSideBarButton('tag_button', _('Tags'), 'md-pricetag', this.tagButton_press)); + items.push(this.renderSidebarButton('tag_button', _('Tags'), 'md-pricetag', this.tagButton_press)); - items.push(this.renderSideBarButton('config_button', _('Configuration'), 'md-settings', this.configButton_press)); + items.push(this.renderSidebarButton('config_button', _('Configuration'), 'md-settings', this.configButton_press)); items.push(this.makeDivider('divider_2')); @@ -335,7 +335,7 @@ class SideMenuContentComponent extends Component { if (resourceFetcherText) fullReport.push(resourceFetcherText); if (decryptionReportText) fullReport.push(decryptionReportText); - items.push(this.renderSideBarButton('synchronize_button', !this.props.syncStarted ? _('Synchronise') : _('Cancel'), 'md-sync', this.synchronize_press)); + items.push(this.renderSidebarButton('synchronize_button', !this.props.syncStarted ? _('Synchronise') : _('Cancel'), 'md-sync', this.synchronize_press)); if (fullReport.length) { items.push( @@ -357,11 +357,11 @@ class SideMenuContentComponent extends Component { // using padding. So instead creating blank elements for padding bottom and top. items.push(<View style={{ height: theme.marginTop }} key="bottom_top_hack" />); - items.push(this.renderSideBarButton('all_notes', _('All notes'), 'md-document', this.allNotesButton_press, this.props.notesParentType === 'SmartFilter')); + items.push(this.renderSidebarButton('all_notes', _('All notes'), 'md-document', this.allNotesButton_press, this.props.notesParentType === 'SmartFilter')); items.push(this.makeDivider('divider_all')); - items.push(this.renderSideBarButton('folder_header', _('Notebooks'), 'md-folder')); + items.push(this.renderSidebarButton('folder_header', _('Notebooks'), 'md-folder')); if (this.props.folders.length) { const result = shared.renderFolders(this.props, this.renderFolderItem); diff --git a/packages/plugins/ToggleSideBars/.gitignore b/packages/plugins/ToggleSidebars/.gitignore similarity index 100% rename from packages/plugins/ToggleSideBars/.gitignore rename to packages/plugins/ToggleSidebars/.gitignore diff --git a/packages/plugins/ToggleSideBars/.npmignore b/packages/plugins/ToggleSidebars/.npmignore similarity index 100% rename from packages/plugins/ToggleSideBars/.npmignore rename to packages/plugins/ToggleSidebars/.npmignore diff --git a/packages/plugins/ToggleSideBars/GENERATOR_DOC.md b/packages/plugins/ToggleSidebars/GENERATOR_DOC.md similarity index 100% rename from packages/plugins/ToggleSideBars/GENERATOR_DOC.md rename to packages/plugins/ToggleSidebars/GENERATOR_DOC.md diff --git a/packages/plugins/ToggleSideBars/README.md b/packages/plugins/ToggleSidebars/README.md similarity index 100% rename from packages/plugins/ToggleSideBars/README.md rename to packages/plugins/ToggleSidebars/README.md diff --git a/packages/plugins/ToggleSideBars/api/Global.d.ts b/packages/plugins/ToggleSidebars/api/Global.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/Global.d.ts rename to packages/plugins/ToggleSidebars/api/Global.d.ts diff --git a/packages/plugins/ToggleSideBars/api/Joplin.d.ts b/packages/plugins/ToggleSidebars/api/Joplin.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/Joplin.d.ts rename to packages/plugins/ToggleSidebars/api/Joplin.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinCommands.d.ts b/packages/plugins/ToggleSidebars/api/JoplinCommands.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinCommands.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinCommands.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinData.d.ts b/packages/plugins/ToggleSidebars/api/JoplinData.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinData.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinData.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinFilters.d.ts b/packages/plugins/ToggleSidebars/api/JoplinFilters.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinFilters.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinFilters.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinInterop.d.ts b/packages/plugins/ToggleSidebars/api/JoplinInterop.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinInterop.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinInterop.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinPlugins.d.ts b/packages/plugins/ToggleSidebars/api/JoplinPlugins.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinPlugins.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinPlugins.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinSettings.d.ts b/packages/plugins/ToggleSidebars/api/JoplinSettings.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinSettings.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinSettings.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinViews.d.ts b/packages/plugins/ToggleSidebars/api/JoplinViews.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinViews.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinViews.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinViewsDialogs.d.ts b/packages/plugins/ToggleSidebars/api/JoplinViewsDialogs.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinViewsDialogs.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinViewsDialogs.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinViewsMenuItems.d.ts b/packages/plugins/ToggleSidebars/api/JoplinViewsMenuItems.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinViewsMenuItems.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinViewsMenuItems.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinViewsMenus.d.ts b/packages/plugins/ToggleSidebars/api/JoplinViewsMenus.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinViewsMenus.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinViewsMenus.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinViewsPanels.d.ts b/packages/plugins/ToggleSidebars/api/JoplinViewsPanels.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinViewsPanels.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinViewsPanels.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinViewsToolbarButtons.d.ts b/packages/plugins/ToggleSidebars/api/JoplinViewsToolbarButtons.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinViewsToolbarButtons.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinViewsToolbarButtons.d.ts diff --git a/packages/plugins/ToggleSideBars/api/JoplinWorkspace.d.ts b/packages/plugins/ToggleSidebars/api/JoplinWorkspace.d.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/JoplinWorkspace.d.ts rename to packages/plugins/ToggleSidebars/api/JoplinWorkspace.d.ts diff --git a/packages/plugins/ToggleSideBars/api/index.ts b/packages/plugins/ToggleSidebars/api/index.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/index.ts rename to packages/plugins/ToggleSidebars/api/index.ts diff --git a/packages/plugins/ToggleSideBars/api/types.ts b/packages/plugins/ToggleSidebars/api/types.ts similarity index 100% rename from packages/plugins/ToggleSideBars/api/types.ts rename to packages/plugins/ToggleSidebars/api/types.ts diff --git a/packages/plugins/ToggleSideBars/package-lock.json b/packages/plugins/ToggleSidebars/package-lock.json similarity index 100% rename from packages/plugins/ToggleSideBars/package-lock.json rename to packages/plugins/ToggleSidebars/package-lock.json diff --git a/packages/plugins/ToggleSideBars/package.json b/packages/plugins/ToggleSidebars/package.json similarity index 91% rename from packages/plugins/ToggleSideBars/package.json rename to packages/plugins/ToggleSidebars/package.json index e281390417..0f5aeb4aa9 100644 --- a/packages/plugins/ToggleSideBars/package.json +++ b/packages/plugins/ToggleSidebars/package.json @@ -1,5 +1,5 @@ { - "name": "joplin-plugin-toggle-side-bars", + "name": "joplin-plugin-toggle-sidebars", "version": "1.0.0", "scripts": { "dist": "webpack", diff --git a/packages/plugins/ToggleSideBars/src/index.ts b/packages/plugins/ToggleSidebars/src/index.ts similarity index 57% rename from packages/plugins/ToggleSideBars/src/index.ts rename to packages/plugins/ToggleSidebars/src/index.ts index adfcae6c1b..93beca5560 100644 --- a/packages/plugins/ToggleSideBars/src/index.ts +++ b/packages/plugins/ToggleSidebars/src/index.ts @@ -1,8 +1,9 @@ import joplin from 'api'; +import { ToolbarButtonLocation } from 'api/types'; joplin.plugins.register({ onStart: async function() { - await joplin.views.toolbarButtons.create('toggleSideBarButton', 'toggleSideBar', 'noteToolbar'); - await joplin.views.toolbarButtons.create('toggleNoteListButton', 'toggleNoteList', 'noteToolbar'); + await joplin.views.toolbarButtons.create('toggleSideBarButton', 'toggleSideBar', ToolbarButtonLocation.NoteToolbar); + await joplin.views.toolbarButtons.create('toggleNoteListButton', 'toggleNoteList', ToolbarButtonLocation.NoteToolbar); }, }); diff --git a/packages/plugins/ToggleSideBars/src/manifest.json b/packages/plugins/ToggleSidebars/src/manifest.json similarity index 61% rename from packages/plugins/ToggleSideBars/src/manifest.json rename to packages/plugins/ToggleSidebars/src/manifest.json index 0834f70449..fcc61a3dd6 100644 --- a/packages/plugins/ToggleSideBars/src/manifest.json +++ b/packages/plugins/ToggleSidebars/src/manifest.json @@ -1,11 +1,11 @@ { "manifest_version": 1, - "id": "org.joplinapp.plugins.ToggleSideBars", + "id": "org.joplinapp.plugins.ToggleSidebars", "app_min_version": "1.6", "version": "1.0.1", "name": "Note list and side bar toggle buttons", - "description": "Adds buttons to toggle note list and side bar", + "description": "Adds buttons to toggle note list and sidebar", "author": "Laurent Cozic", - "homepage_url": "https://github.com/laurent22/joplin/tree/dev/packages/plugins/ToggleSideBars", - "repository_url": "https://github.com/laurent22/joplin/tree/dev/packages/plugins/ToggleSideBars" + "homepage_url": "https://github.com/laurent22/joplin/tree/dev/packages/plugins/ToggleSidebars", + "repository_url": "https://github.com/laurent22/joplin/tree/dev/packages/plugins/ToggleSidebars" } diff --git a/packages/plugins/ToggleSideBars/tsconfig.json b/packages/plugins/ToggleSidebars/tsconfig.json similarity index 100% rename from packages/plugins/ToggleSideBars/tsconfig.json rename to packages/plugins/ToggleSidebars/tsconfig.json diff --git a/packages/plugins/ToggleSideBars/webpack.config.js b/packages/plugins/ToggleSidebars/webpack.config.js similarity index 100% rename from packages/plugins/ToggleSideBars/webpack.config.js rename to packages/plugins/ToggleSidebars/webpack.config.js