diff --git a/repo/indentation-lines/client.css b/repo/indentation-lines/client.css index 5f0f0c6..c7ab6b5 100644 --- a/repo/indentation-lines/client.css +++ b/repo/indentation-lines/client.css @@ -9,6 +9,9 @@ .notion-page-content .notion-numbered_list-block > div > div:last-child, .notion-page-content .notion-to_do-block > div > div:last-child, .notion-page-content .notion-toggle-block > div > div:last-child, +.notion-page-content .notion-selectable.notion-sub_header-block > div > div > div:last-child, +.notion-page-content .notion-selectable.notion-sub_sub_header-block > div > div > div:last-child, +.notion-page-content .notion-selectable.notion-sub_sub_sub_header-block > div > div > div:last-child, .notion-page-content .notion-table_of_contents-block > div > div > a > div > div { position: relative; } @@ -16,7 +19,11 @@ .notion-page-content .notion-bulleted_list-block > div > div:last-child::before, .notion-page-content .notion-numbered_list-block > div > div:last-child::before, .notion-page-content .notion-to_do-block > div > div:last-child::before, -.notion-page-content .notion-toggle-block > div > div:last-child::before { +.notion-page-content .notion-toggle-block > div > div:last-child::before, +.notion-page-content .notion-selectable.notion-sub_header-block > div > div > div:last-child::before, +.notion-page-content .notion-selectable.notion-sub_sub_header-block > div > div > div:last-child::before, +.notion-page-content .notion-selectable.notion-sub_sub_sub_header-block > div > div > div:last-child::before, +.notion-page-content .pseudoSelection > div > div:last-child::before { content: ''; position: absolute; height: calc(100% - 2em); @@ -93,3 +100,4 @@ > .plus:hover { background: var(--theme--ui_interactive-hover) !important; } + diff --git a/repo/indentation-lines/client.mjs b/repo/indentation-lines/client.mjs index 26440e5..865b119 100644 --- a/repo/indentation-lines/client.mjs +++ b/repo/indentation-lines/client.mjs @@ -48,7 +48,21 @@ export default async function ({ web }, db) { } } } - + if (await db.get(['toggle_header'])) { + css += ` + .notion-page-content .notion-selectable.notion-sub_sub_header-block > div > div > div:last-child::before { + border-left: 1px ${style} var(--indentation_lines--color, currentColor); + opacity: ${opacity}; + } + .notion-page-content .notion-selectable.notion-sub_header-block > div > div > div:last-child::before { + border-left: 1px ${style} var(--indentation_lines--color, currentColor); + opacity: ${opacity}; + } + .notion-page-content .notion-selectable.notion-sub_sub_sub_header-block > div > div > div:last-child::before { + border-left: 1px ${style} var(--indentation_lines--color, currentColor); + opacity: ${opacity}; + }`; + } if (db.get(['table_of_contents'])) { css += ` .notion-page-content .notion-table_of_contents-block > div > div > a > div diff --git a/repo/indentation-lines/mod.json b/repo/indentation-lines/mod.json index 61ab0be..33a82d9 100644 --- a/repo/indentation-lines/mod.json +++ b/repo/indentation-lines/mod.json @@ -50,6 +50,12 @@ "label": "toggle lists", "value": true }, + { + "type": "toggle", + "key": "toggle_header", + "label": "toggle headers", + "value": true + }, { "type": "toggle", "key": "table_of_contents", diff --git a/repo/tabs/client.mjs b/repo/tabs/client.mjs index 8f0960b..9373351 100644 --- a/repo/tabs/client.mjs +++ b/repo/tabs/client.mjs @@ -10,14 +10,14 @@ export default async function ({ web, electron }, db) { const newTabHotkey = await db.get(['new_tab']), closeTabHotkey = await db.get(['close_tab']), restoreTabHotkey = await db.get(['restore_tab']), - selectTabModifier = await db.get(['select_modifier']); + selectTabModifier = await db.get(['select_modifier']), + prevTabHotkey = await db.get(['prev_tab']), + nextTabHotkey = await db.get(['next_tab']); web.addHotkeyListener(newTabHotkey, () => { electron.sendMessageToHost('new-tab'); - console.log('new-tab'); }); web.addHotkeyListener(restoreTabHotkey, () => { electron.sendMessageToHost('restore-tab'); - console.log('restore-tab'); }); web.addHotkeyListener(closeTabHotkey, () => electron.sendMessageToHost('close-tab')); for (let i = 1; i < 10; i++) { @@ -25,6 +25,12 @@ export default async function ({ web, electron }, db) { electron.sendMessageToHost('select-tab', i); }); } + web.addHotkeyListener(prevTabHotkey, () => { + electron.sendMessageToHost('select-prev-tab') + }); + web.addHotkeyListener(nextTabHotkey, () => { + electron.sendMessageToHost('select-next-tab') + }); const breadcrumbSelector = '.notion-topbar > div > [class="notranslate"] > .notion-focusable:last-child', diff --git a/repo/tabs/mod.json b/repo/tabs/mod.json index 29dc614..0d3004b 100644 --- a/repo/tabs/mod.json +++ b/repo/tabs/mod.json @@ -62,6 +62,18 @@ "Super+Shift" ] }, + { + "type": "hotkey", + "key": "prev_tab", + "label": "previous tab hotkey", + "value": "Control+Shift+Tab" + }, + { + "type": "hotkey", + "key": "next_tab", + "label": "next tab hotkey", + "value": "Control+Tab" + }, { "type": "hotkey", "key": "new_tab", diff --git a/repo/tabs/tab.cjs b/repo/tabs/tab.cjs index 76cf622..4e44cc0 100644 --- a/repo/tabs/tab.cjs +++ b/repo/tabs/tab.cjs @@ -228,6 +228,36 @@ module.exports = async function (api, db, tabCache = new Map()) { const $tab = i === 9 ? this.$tabList.lastElementChild : this.$tabList.children[i - 1]; if ($tab) $tab.click(); }); + fromNotion('notion-enhancer:select-prev-tab', () => { + if (this.$tabList.count == 1) { + return; + } + const $sibling = this.$tab.previousElementSibling; + if ($sibling) { + $sibling.click(); + } + else { + let $tab = this.$tabList.lastElementChild; + if ($tab) { + $tab.click(); + } + } + }); + fromNotion('notion-enhancer:select-next-tab', () => { + if (this.$tabList.count == 1) { + return; + } + const $sibling = this.$tab.nextElementSibling; + if ($sibling) { + $sibling.click(); + } + else { + let $tab = this.$tabList.children[0] + if ($tab) { + $tab.click(); + } + } + }); } #firstQuery = true;