diff --git a/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.mjs b/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.mjs index 8c14502..bff9c77 100644 --- a/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.mjs +++ b/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.mjs @@ -8,7 +8,6 @@ export default async function (api, db) { const { web, notion } = api; - await web.whenReady(); let _openPage = {}; function getCurrentPage() { diff --git a/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.mjs b/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.mjs index 6a4e1b0..b6585c6 100644 --- a/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.mjs +++ b/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.mjs @@ -1,5 +1,5 @@ /* - * notion-enhancer core: bypass-preview + * notion-enhancer: calendar-scroll * (c) 2021 dragonwocky (https://dragonwocky.me/) * (https://notion-enhancer.github.io/) under the MIT license */ @@ -60,6 +60,6 @@ export default async function (api, db) { const toolbar = document.querySelector(toolbarSelector); if (toolbar) toolbar.insertBefore($scrollButton, toolbar.children[2]); }; - web.addDocumentObserver(insertButton, [toolbarSelector]); + web.addDocumentObserver(insertButton, ['.notion-calendar-view']); insertButton(); } diff --git a/repo/components@36a2ffc9-27ff-480e-84a7-c7700a7d232d/mod.json b/repo/components@36a2ffc9-27ff-480e-84a7-c7700a7d232d/mod.json index bb0cc36..4a9f238 100644 --- a/repo/components@36a2ffc9-27ff-480e-84a7-c7700a7d232d/mod.json +++ b/repo/components@36a2ffc9-27ff-480e-84a7-c7700a7d232d/mod.json @@ -27,7 +27,7 @@ "key": "panel.hotkey", "label": "toggle panel hotkey", "value": "Ctrl+Alt+\\", - "tooltip": "opens/closes the side panel in notion - will only work if a mod is making use of it." + "tooltip": "**opens/closes the side panel in notion** if a mod that uses it has been enabled" } ] } diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/markdown.css b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/markdown.css index dc41b90..ce74a81 100644 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/markdown.css +++ b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/markdown.css @@ -46,12 +46,14 @@ .markdown hr { border: 0.5px solid var(--theme--ui_divider); } -.markdown.markdown-inline a { +.markdown-inline a, +.markdown a { opacity: 0.7; text-decoration: none; border-bottom: 0.05em solid var(--theme--text_secondary); } -.markdown.markdown-inline a:hover { +.markdown-inline a:hover, +.markdown a:hover { opacity: 0.9; } @@ -72,7 +74,8 @@ color: var(--theme--code_plain); } .markdown pre, -.markdown.markdown-inline code { +.markdown code, +.markdown-inline code { font-family: var(--theme--font_code); font-size: 0.796875rem; text-align: left; diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.mjs b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.mjs index 3e9fb83..4804648 100644 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.mjs +++ b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.mjs @@ -194,6 +194,7 @@ const _$modListCache = {}, options: async (mod) => { const $fragment = document.createDocumentFragment(); for (const opt of mod.options) { + if (!opt.environments.includes(env.name)) continue; web.render($fragment, await options[opt.type](mod, opt)); } if (!mod.options.length) { diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/mod.json b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/mod.json index 0aa7b7f..3fdbfd0 100644 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/mod.json +++ b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/mod.json @@ -25,7 +25,7 @@ "key": "hotkey", "label": "toggle focus hotkey", "value": "Ctrl+Alt+E", - "tooltip": "switches between notion & the enhancer menu" + "tooltip": "**switches between notion & the enhancer menu**" } ] } diff --git a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/theme.css b/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/theme.css index 7dd4c69..3ebed22 100644 --- a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/theme.css +++ b/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/theme.css @@ -602,7 +602,6 @@ body, .notion-collection_view-block > [style*='box-shadow: white -3px 0px 0px;'] { box-shadow: transparent -3px 0px 0px !important; - margin-left: 20px; } .notion-focusable[role='button'][style*='box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px;'] { box-shadow: var(--theme--ui_divider) 0px 0px 0px 1px !important; diff --git a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.css b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.css index b0bca23..5713e49 100644 --- a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.css +++ b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.css @@ -5,57 +5,117 @@ * (https://notion-enhancer.github.io/) under the MIT license */ -.tweak--snappy_transitions * { - animation-duration: 0s !important; - transition-duration: 0s !important; -} -.tweak--snappy_transitions .notion-selectable-halo { - opacity: 1 !important; -} - -.tweak--hide_help .notion-help-button { - display: none !important; -} - -.tweak--thicker_bold .notion-page-content span[style*='font-weight:600'] { - font-weight: 700 !important; -} - -.tweak--spaced_lines .notion-page-content .notion-selectable.notion-text-block { - line-height: 1.65 !important; - margin-top: 0.75em !important; -} - -.tweak--condensed_bullets .notion-selectable.notion-bulleted_list-block { - margin-top: -1.5px !important; - margin-bottom: -1.5px !important; -} - -.tweak--responsive_breakpoint .notion-column_list-block [style='display: flex;'] > div { +.enhancer--tweak-responsive_breakpoint + .notion-column_list-block + [style='display: flex;'] + > div { width: 100% !important; } -.tweak--responsive_breakpoint .notion-column_list-block [style='display: flex;'] { +.enhancer--tweak-responsive_breakpoint .notion-column_list-block [style='display: flex;'] { flex-direction: column !important; } -.tweak--responsive_breakpoint .notion-app-inner { +.enhancer--tweak-responsive_breakpoint .notion-app-inner { --theme--page-width: 100%; --theme--page-padding: calc(48px + env(safe-area-inset-left)); } -.tweak--bracketed_links .notion-link-token span { +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block[style*=' width'], +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block[style^='width'] { + width: 100% !important; +} +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + [style*='padding-left: 50px'], +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + [style*='padding-left: 96px'], +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + [style*='padding-left: 126px'] { + padding-left: 0 !important; +} +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + [style*='padding-right: 50px'], +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + [style*='padding-right: 96px'], +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + [style*='padding-right: 126px'] { + padding-right: 0 !important; +} +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + [style*='min-width: calc(100% - 192px);'], +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + [style*='min-width: 708px;'] { + min-width: 100% !important; +} +.enhancer--tweak-normalise_table_scroll + .notion-page-content + .notion-collection_view-block + > div { + padding: 0 1px; +} + +.enhancer--tweak-snappy_transitions * { + animation-duration: 0s !important; + transition-duration: 0s !important; +} +.enhancer--tweak-snappy_transitions .notion-selectable-halo { + opacity: 1 !important; +} + +.enhancer--tweak-hide_help .notion-help-button { + display: none !important; +} + +.enhancer--tweak-hide_slash_for_commands [contenteditable]:empty:after { + content: ' ' !important; +} + +.enhancer--tweak-thicker_bold .notion-page-content span[style*='font-weight:600'] { + font-weight: 700 !important; +} + +.enhancer--tweak-spaced_lines .notion-page-content .notion-selectable.notion-text-block { + line-height: 1.65 !important; + margin-top: 0.75em !important; +} + +.enhancer--tweak-condensed_bullets .notion-selectable.notion-bulleted_list-block { + margin-top: -1.5px !important; + margin-bottom: -1.5px !important; +} + +.enhancer--tweak-bracketed_links .notion-link-token span { border-bottom: none !important; } -.tweak--bracketed_links .notion-link-token:before { +.enhancer--tweak-bracketed_links .notion-link-token:before { content: '[['; opacity: 0.7; transition: opacity 100ms ease-in; } -.tweak--bracketed_links .notion-link-token:after { +.enhancer--tweak-bracketed_links .notion-link-token:after { content: ']]'; opacity: 0.7; transition: opacity 100ms ease-in; } -.tweak--bracketed_links .notion-link-token:hover::before, -.tweak--bracketed_links .notion-link-token:hover::after { +.enhancer--tweak-bracketed_links .notion-link-token:hover::before, +.enhancer--tweak-bracketed_links .notion-link-token:hover::after { opacity: 1; } diff --git a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.mjs b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.mjs index 42ae21c..4f490e2 100644 --- a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.mjs +++ b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.mjs @@ -6,44 +6,37 @@ 'use strict'; -const _id = '5174a483-c88d-4bf8-a95f-35cd330b76e2'; -import { env, storage, web } from '../../api/_.mjs'; +export default async function (api, db) { + const { web } = api; -web.whenReady().then(async () => { - const cssInsert = await storage.get(_id, '_file.insert.css'); - if (cssInsert) { - document.body.append( - web.createElement( - web.html` - ` - ) - ); - } + const cssInsert = await db.get(['insert.css']); + document.head.append( + web.html`` + ); - if (['linux', 'win32'].includes(env.name)) { - // dragarea_height - } - - for (const tweak of [ - 'snappy_transitions', - 'thicker_bold', - 'spaced_lines', - 'hide_help', - 'condensed_bullets', - 'bracketed_links', - ]) { - if (await storage.get(_id, `tweak.${tweak}`)) { - document.body.classList.add(`tweak--${tweak}`); - } - } - - const responsiveBreakpoint = await storage.get(_id, 'tweak.responsive_breakpoint'), + const responsiveBreakpoint = await db.get(['tweak.responsive_breakpoint']), addResponsiveBreakpoint = () => { - document.body.classList.remove('tweak--responsive_breakpoint'); + document.body.classList.remove('enhancer--tweak-responsive_breakpoint'); if (window.innerWidth <= responsiveBreakpoint) { - document.body.classList.add('tweak--responsive_breakpoint'); + document.body.classList.add('enhancer--tweak-responsive_breakpoint'); } }; window.addEventListener('resize', addResponsiveBreakpoint); addResponsiveBreakpoint(); -}); + + const tweaks = [ + 'normalise_table_scroll', + 'hide_help', + 'hide_slash_for_commands', + 'snappy_transitions', + 'thicker_bold', + 'spaced_lines', + 'condensed_bullets', + 'bracketed_links', + ]; + for (const tweak of tweaks) { + if (await db.get([`tweak.${tweak}`])) { + document.body.classList.add(`enhancer--tweak-${tweak}`); + } + } +} diff --git a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/mod.json b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/mod.json index 6b5203e..62d7c4e 100644 --- a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/mod.json +++ b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/mod.json @@ -2,7 +2,7 @@ "name": "tweaks", "id": "5174a483-c88d-4bf8-a95f-35cd330b76e2", "version": "0.2.0", - "description": "common style/layout changes and custom CSS insertion.", + "description": "common style/layout changes and custom code insertion. check out the [tweaks page](https://github.com/notion-enhancer/tweaks) for more.", "tags": ["extension", "customisation"], "authors": [ { @@ -23,61 +23,67 @@ "type": "file", "key": "insert.css", "label": "css insert", + "tooltip": "**upload a css file that will be applied to the notion client**", "extensions": [".css"] }, { - "key": "tweak.dragarea_height", - "label": "height of frameless dragarea:", - "tooltip": "the rectangle added at the top of a window in 'integrated titlebar' mode, used to drag/move the window.", "type": "number", - "value": 15, - "environments": ["linux", "win32"] - }, - { "key": "tweak.responsive_breakpoint", "label": "responsive columns breakpoint (px)", - "tooltip": "the width in pixels below which in-page columns are resized to appear full-width so content isn't squished.", - "type": "number", + "tooltip": "the **width in pixels below which in-page columns are resized** to appear full-width to reduce content squishing", "value": 600 }, { - "key": "tweak.snappy_transitions", - "label": "snappy transitions", - "tooltip": "set animation time for all css-driven animations to 0s. may not affect element motion e.g. the sidebar popping out.", - "type": "toggle", - "value": false - }, - { - "key": "tweak.hide_help", - "label": "hide help button", - "type": "toggle", - "value": false - }, - { - "key": "tweak.thicker_bold", - "label": "thicker bold text", "type": "toggle", + "key": "tweak.normalise_table_scroll", + "label": "wrap tables to page width", + "tooltip": "**force horizontally scrollable tables to respect the width and padding of a page when they overflow**", "value": true }, { + "type": "toggle", + "key": "tweak.snappy_transitions", + "label": "snappy transitions", + "tooltip": "enabling this **eliminates css animation time**, but will not prevent motion e.g. the sidebar popping out", + "value": false + }, + { + "type": "toggle", + "key": "tweak.hide_help", + "label": "hide help button", + "value": false + }, + { + "type": "toggle", + "key": "tweak.hide_slash_for_commands", + "label": "hide \"Type '/' for commands\"", + "value": false + }, + { + "type": "toggle", + "key": "tweak.thicker_bold", + "label": "thicker bold text", + "value": true + }, + { + "type": "toggle", "key": "tweak.spaced_lines", "label": "readable line spacing", - "tooltip": "greater line spacing between text blocks.", - "type": "toggle", + "tooltip": "**greater line spacing between text blocks**", "value": false }, { + "type": "toggle", "key": "tweak.condensed_bullets", "label": "condense bullet points", - "tooltip": "tighter line spacing between bullet point blocks.", - "type": "toggle", + "tooltip": "**tighter line spacing between bullet point blocks**", "value": false }, { + "type": "toggle", "key": "tweak.bracketed_links", "label": "bracketed links", - "tooltip": "render links surrounded with [[brackets]] instead of __underlined__.", - "type": "toggle", + "tooltip": "**render links surrounded with [[brackets]] instead of __underlined__**", "value": false } ]