update imports for api folder structure

This commit is contained in:
dragonwocky 2021-11-30 18:01:15 +11:00
parent 6ee8086b51
commit 6874b905eb
12 changed files with 174 additions and 34 deletions

View File

@ -50,6 +50,7 @@
[style*='position: absolute; top: 3px; left: -20px; width: 18px; height: 24px; pointer-events: auto; cursor: -webkit-grab;']
[data-block-id] {
background: var(--theme--bg) !important;
border-radius: 3px;
}
.notion-frame
> [style*='position: absolute; top: 0px; left: 0px;']
@ -90,5 +91,5 @@
[style*='position: absolute; top: 3px; left: -20px; width: 18px; height: 24px; pointer-events: auto; cursor: -webkit-grab;']
+ .notion-focusable
> .plus:hover {
background: rgba(255, 255, 255, 0.1) !important;
background: var(--theme--ui_interactive-hover) !important;
}

View File

View File

@ -0,0 +1,11 @@
/*
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
*/
'use strict';
export default async function (api, db) {
//
}

View File

@ -0,0 +1,82 @@
/*
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
*/
'use strict';
module.exports = async function (api, db, __exports) {
const notionCreateWindow = __exports.createWindow;
// __exports.createWindow = (relativeUrl = '', args) => {
// const windowState = require('electron-window-state').default({
// defaultWidth: 1320,
// defaultHeight: 860,
// });
// const focusedWindow = electron_1.BrowserWindow.getFocusedWindow();
// const rect = getRectFromFocusedWindow(windowState);
// const windowCreationArgs = Object.assign(Object.assign({}, rect), {
// show: false,
// backgroundColor: '#ffffff',
// titleBarStyle: 'hiddenInset',
// autoHideMenuBar: true,
// webPreferences: {
// preload: path_1.default.resolve(__dirname, '../renderer/index.js'),
// webviewTag: true,
// session: electron_1.session.fromPartition(constants_1.electronSessionPartition),
// enableRemoteModule: true,
// },
// });
// const { window, warmed } = getNextWindow(windowCreationArgs);
// window.setMenuBarVisibility(false);
// warmWindowState.warmedWindow = undefined;
// window.once('ready-to-show', () => {
// if (args && args.isLocalhost) {
// return;
// }
// if (!warmed) {
// window.show();
// }
// });
// if (warmed) {
// if (warmWindowState.warmedLoaded) {
// notionIpc.sendMainToNotionWindow(window, 'notion:navigate-to-url', relativeUrl);
// } else {
// void window.loadURL(urlHelpers_1.getIndexUrl(relativeUrl));
// }
// window.setBounds(getRectFromFocusedWindow(windowState));
// window.show();
// } else {
// void window.loadURL(urlHelpers_1.getIndexUrl(relativeUrl));
// }
// if (focusedWindow) {
// if (focusedWindow.isFullScreen()) {
// window.setFullScreen(true);
// }
// } else {
// if (windowState.isFullScreen) {
// window.setFullScreen(true);
// }
// }
// window.on('close', () => {
// windowState.saveState(window);
// if (process.platform === 'win32') {
// const currentWindows = electron_1.BrowserWindow.getAllWindows();
// const hasNoOtherOpenWindows = currentWindows.every((currentWindow) =>
// Boolean(
// currentWindow.id === window.id ||
// (warmWindowState.warmedWindow &&
// currentWindow.id === warmWindowState.warmedWindow.id)
// )
// );
// if (hasNoOtherOpenWindows) {
// electron_2.app.quit();
// }
// }
// });
// setImmediate(() => {
// warmWindowState.warmedLoaded = false;
// });
// return window;
// };
};

View File

@ -0,0 +1,11 @@
/*
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
*/
'use strict';
export default async function (api, db) {
//
}

View File

@ -0,0 +1,34 @@
{
"name": "integrated titlebar",
"id": "a5658d03-21c6-4088-bade-fa4780459133",
"environments": ["linux", "win32"],
"version": "0.11.0",
"description": "replaces the native window titlebar with buttons inset into the app.",
"tags": ["extension", "layout"],
"authors": [
{
"name": "dragonwocky",
"email": "thedragonring.bod@gmail.com",
"homepage": "https://dragonwocky.me/",
"avatar": "https://dragonwocky.me/avatar.jpg"
}
],
"css": {
"client": ["buttons.css"],
"menu": ["buttons.css"]
},
"js": {
"client": ["client.mjs"],
"menu": ["menu.mjs"],
"electron": [{ "source": "createWindow.cjs", "target": "main/createWindow.js" }]
},
"options": [
{
"type": "toggle",
"key": "tiling",
"label": "tiling window manager mode",
"tooltip": "**completely remove the close/minimise/maximise buttons** (only for advanced use, not recommended)",
"value": false
}
]
}

View File

@ -6,7 +6,7 @@
'use strict';
import { fmt, web, registry, components } from '../../api/_.mjs';
import { fmt, web, registry, components } from '../../api/index.mjs';
import { notifications } from './notifications.mjs';
export const modComponents = {

View File

@ -6,7 +6,7 @@
'use strict';
import * as api from '../../api/_.mjs';
import * as api from '../../api/index.mjs';
import { notifications, $changelogModal } from './notifications.mjs';
import { modComponents, options } from './components.mjs';
import * as router from './router.mjs';

View File

@ -4,7 +4,7 @@
* (https://notion-enhancer.github.io/) under the MIT license
*/
import { env, fs, storage, fmt, web, components } from '../../api/_.mjs';
import { env, fs, storage, fmt, web, components } from '../../api/index.mjs';
import { tw } from './styles.mjs';
const notificationsURL = 'https://notion-enhancer.github.io/notifications.json';

View File

@ -6,7 +6,7 @@
'use strict';
import { web } from '../../api/_.mjs';
import { web } from '../../api/index.mjs';
const _queryListeners = new Set();

View File

@ -10,21 +10,21 @@
import { tw, apply, setup } from '../../dep/twind.mjs';
import { content } from '../../dep/twind-content.mjs';
const pseudoContent = content('""');
const mapColorVariables = (color) => ({
'text': `var(--theme--text_${color})`,
'highlight': `var(--theme--highlight_${color})`,
'highlight-text': `var(--theme--highlight_${color}-text)`,
'callout': `var(--theme--callout_${color})`,
'callout-text': `var(--theme--callout_${color}-text)`,
'tag': `var(--theme--tag_${color})`,
'tag-text': `var(--theme--tag_${color}-text)`,
'board': `var(--theme--board_${color})`,
'board-text': `var(--theme--board_${color}-text)`,
'board-card': `var(--theme--board_${color}-card)`,
'board-card_text': `var(--theme--board_${color}-card_text)`,
});
const pseudoContent = content('""'),
mapColorVariables = (color) => ({
'text': `var(--theme--text_${color})`,
'highlight': `var(--theme--highlight_${color})`,
'highlight-text': `var(--theme--highlight_${color}-text)`,
'callout': `var(--theme--callout_${color})`,
'callout-text': `var(--theme--callout_${color}-text)`,
'tag': `var(--theme--tag_${color})`,
'tag-text': `var(--theme--tag_${color}-text)`,
'board': `var(--theme--board_${color})`,
'board-text': `var(--theme--board_${color}-text)`,
'board-card': `var(--theme--board_${color}-card)`,
'board-card_text': `var(--theme--board_${color}-card_text)`,
});
const customClasses = {
'notifications-container': apply`absolute bottom-0 right-0 px-4 py-3 max-w-full w-96 z-10`,

View File

@ -2,21 +2,9 @@
"menu",
"theming",
"components",
"integrated-titlebar",
"tweaks",
"material-ocean",
"cherry-cola",
"dark+",
"light+",
"dracula",
"pastel-dark",
"neutral",
"nord",
"gruvbox-dark",
"gruvbox-light",
"playful-purple",
"pinky-boom",
"font-chooser",
"outliner",
"scroll-to-top",
@ -37,5 +25,18 @@
"global-block-links",
"icon-sets",
"quick-note"
"quick-note",
"material-ocean",
"cherry-cola",
"dark+",
"light+",
"dracula",
"pastel-dark",
"neutral",
"nord",
"gruvbox-dark",
"gruvbox-light",
"playful-purple",
"pinky-boom"
]