From 18f24804d2c537f7b0d75d4370c032aed04e9fb5 Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Tue, 11 Aug 2020 11:16:23 +1000 Subject: [PATCH] patch removal and help commands + separate focus mode into an extension --- CHANGELOG.md | 14 ++++++++++---- README.md | 2 +- bin.js | 2 +- mods/core/css/titlebar.css | 17 ----------------- mods/focus-mode/mod.js | 18 ++++++++++++++++++ mods/focus-mode/styles.css | 21 +++++++++++++++++++++ mods/neutral/mod.js | 1 + mods/neutral/styles.css | 4 ++-- package.json | 2 +- pkg/helpers.js | 2 +- 10 files changed, 56 insertions(+), 27 deletions(-) create mode 100644 mods/focus-mode/mod.js create mode 100644 mods/focus-mode/styles.css diff --git a/CHANGELOG.md b/CHANGELOG.md index b947518..27bcf83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,15 +9,21 @@ complete rewrite with node.js. - new: simpler cli installation system (inc. commands: `apply`, `remove`, and `check`). - new: mod loading system (easier to create new mods, adds to notion rather than overwriting). +- new: mod configuration menu. +- improved: more theming variable coverage - inc. light theme and sizing/spacing. - bugfix: non-reproducable errors with python. - bugfix: better launcher patching on linux. +- bugfix: fix frameless window issue introduced by notion desktop 2.0.9. +- extension: "custom inserts" = link files for small client-side tweaks.. +- extension: "bracketed links" = render links surrounded with \[\[brackets]] instead of underlined. +- extension: "focus mode" = hide the titlebar/menubar when the sidebar is closed (will be shown on hover). +- theme: "neutral" = smoother colours and fonts, designed to be more pleasing to the eye. +- theme: "dark+" = a vivid-colour near-black theme. //todo -- improved: greater choice of emoji sets. -- improved: better colour coverage for theming variables. -- new: menu for configuring mods. -- new: syncing dark/light theme with the system. +- extension: "emojiset" = pick from a variety of emoji styles to use. +- extension: "night light" = sync dark/light theme with the system. ### v0.7.0 (2020-07-09) diff --git a/README.md b/README.md index c60dd49..d77cc94 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ want to contribute? check the the [contribution guidelines](CONTRIBUTING.md). ## installation 1. install node.js: [windows/macOS](https://nodejs.org/en/download/), [linux/WSL](https://github.com/mklement0/n-install). - if on windows, the next steps will need to be done in the newly installed "node.js command prompt". + a computer restart may be required here. 2. install notion-enhancer globally via yarn or npm: `npm i -g notion-enhancer` or `yarn global add notion-enhancer` 3. ensure no notion processes are running (you may want to check the task manager to make sure), diff --git a/bin.js b/bin.js index 00d295c..4fb2586 100644 --- a/bin.js +++ b/bin.js @@ -8,7 +8,7 @@ 'use strict'; -const cli = require('cac')(), +const cli = require('cac')('notion-enhancer'), { EnhancerError } = require('./pkg/helpers.js'); // === title === diff --git a/mods/core/css/titlebar.css b/mods/core/css/titlebar.css index f6577bc..23a332a 100644 --- a/mods/core/css/titlebar.css +++ b/mods/core/css/titlebar.css @@ -2,7 +2,6 @@ * notion-enhancer * (c) 2020 dragonwocky (https://dragonwocky.me/) * (c) 2020 TarasokUA - * (c) 2020 Arecsu * under the MIT license */ @@ -46,19 +45,3 @@ justify-content: flex-end; } } - -/* hide topbar when sidebar is hidden */ -.notion-sidebar-container[style*='width: 0px;'] + .notion-frame { - height: calc( - 100% - (var(--configured-dragarea_height, 10px) + 45px) - ) !important; -} -.notion-sidebar-container[style*='width: 0px;'] + .notion-frame .notion-topbar { - opacity: 0 !important; - transition: opacity 200ms ease-in-out !important; -} -.notion-sidebar-container[style*='width: 0px;'] - + .notion-frame - .notion-topbar:hover { - opacity: 1 !important; -} diff --git a/mods/focus-mode/mod.js b/mods/focus-mode/mod.js new file mode 100644 index 0000000..8692aaa --- /dev/null +++ b/mods/focus-mode/mod.js @@ -0,0 +1,18 @@ +/* + * focus mode + * (c) 2020 dragonwocky (https://dragonwocky.me/) + * (c) 2020 Arecsu + * under the MIT license + */ + +'use strict'; + +module.exports = { + id: '5a08598d-bfac-4167-9ae8-2bd0e2ef141e', + tags: ['extension'], + name: 'focus mode', + desc: + 'hide the titlebar/menubar when the sidebar is closed (will be shown on hover).', + version: '0.0.1', + author: 'arecsu', +}; diff --git a/mods/focus-mode/styles.css b/mods/focus-mode/styles.css new file mode 100644 index 0000000..52920d6 --- /dev/null +++ b/mods/focus-mode/styles.css @@ -0,0 +1,21 @@ +/* + * focus mode + * (c) 2020 dragonwocky (https://dragonwocky.me/) + * (c) 2020 Arecsu + * under the MIT license + */ + +.notion-sidebar-container[style*='width: 0px;'] + .notion-frame { + height: calc( + 100% - (var(--configured-dragarea_height, 10px) + 45px) + ) !important; +} +.notion-sidebar-container[style*='width: 0px;'] + .notion-frame .notion-topbar { + opacity: 0 !important; + transition: opacity 200ms ease-in-out !important; +} +.notion-sidebar-container[style*='width: 0px;'] + + .notion-frame + .notion-topbar:hover { + opacity: 1 !important; +} diff --git a/mods/neutral/mod.js b/mods/neutral/mod.js index 6e26654..500d734 100644 --- a/mods/neutral/mod.js +++ b/mods/neutral/mod.js @@ -1,6 +1,7 @@ /* * neutral * (c) 2020 dragonwocky (https://dragonwocky.me/) + * (c) 2020 Arecsu * under the MIT license */ diff --git a/mods/neutral/styles.css b/mods/neutral/styles.css index 6cdd068..0a1530d 100644 --- a/mods/neutral/styles.css +++ b/mods/neutral/styles.css @@ -1,5 +1,5 @@ /* - * notion-enhancer + * neutral * (c) 2020 dragonwocky (https://dragonwocky.me/) * (c) 2020 Arecsu * under the MIT license @@ -36,7 +36,7 @@ --theme_dark--font-heading1_size: 33px; --theme_dark--font-heading2_size: 25.3px; --theme_dark--font-heading3_size: 19.5px; - --theme_dark--font-label_size: 15px; + --theme_dark--font-label_size: 13.5px; --theme_dark--font-body_size: 15px; --theme_dark--font-code_size: 13.5px; diff --git a/package.json b/package.json index 8e3ab81..832ec92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notion-enhancer", - "version": "0.8.0-wip", + "version": "0.8.0-beta", "description": "an enhancer/customiser for the all-in-one productivity workspace notion.so", "main": "index.js", "bin": { diff --git a/pkg/helpers.js b/pkg/helpers.js index fa5f03e..33ab9be 100644 --- a/pkg/helpers.js +++ b/pkg/helpers.js @@ -98,7 +98,7 @@ function getNotion() { fs.pathExistsSync(path.resolve(`${folder}/app`))) ) ) { - const asar_bak = path.resolve(`${__notion}/app.asar.bak`); + const asar_bak = path.resolve(`${folder}/app.asar.bak`); if (fs.pathExistsSync(asar_bak)) { fs.moveSync(asar_bak, app_asar); } else