diff options
Diffstat (limited to 'src/webview')
-rw-r--r-- | src/webview/contextMenuBuilder.ts | 13 | ||||
-rw-r--r-- | src/webview/lib/RecipeWebview.ts | 4 | ||||
-rw-r--r-- | src/webview/recipe.ts | 22 | ||||
-rw-r--r-- | src/webview/spellchecker.ts | 2 |
4 files changed, 23 insertions, 18 deletions
diff --git a/src/webview/contextMenuBuilder.ts b/src/webview/contextMenuBuilder.ts index ee55fbe62..155e533e9 100644 --- a/src/webview/contextMenuBuilder.ts +++ b/src/webview/contextMenuBuilder.ts | |||
@@ -7,20 +7,25 @@ | |||
7 | * Source: https://github.com/electron-userland/electron-spellchecker/blob/master/src/context-menu-builder.js | 7 | * Source: https://github.com/electron-userland/electron-spellchecker/blob/master/src/context-menu-builder.js |
8 | */ | 8 | */ |
9 | 9 | ||
10 | import { clipboard, ipcRenderer, nativeImage, WebContents } from 'electron'; | ||
11 | import { Menu, MenuItem } from '@electron/remote'; | 10 | import { Menu, MenuItem } from '@electron/remote'; |
11 | import { | ||
12 | type WebContents, | ||
13 | clipboard, | ||
14 | ipcRenderer, | ||
15 | nativeImage, | ||
16 | } from 'electron'; | ||
12 | import { cmdOrCtrlShortcutKey, isMac } from '../environment'; | 17 | import { cmdOrCtrlShortcutKey, isMac } from '../environment'; |
13 | 18 | ||
14 | import { | 19 | import { |
20 | GOOGLE_TRANSLATOR_LANGUAGES, | ||
21 | LIBRETRANSLATE_TRANSLATOR_LANGUAGES, | ||
15 | SEARCH_ENGINE_NAMES, | 22 | SEARCH_ENGINE_NAMES, |
16 | SEARCH_ENGINE_URLS, | 23 | SEARCH_ENGINE_URLS, |
17 | GOOGLE_TRANSLATOR_LANGUAGES, | ||
18 | TRANSLATOR_ENGINE_GOOGLE, | 24 | TRANSLATOR_ENGINE_GOOGLE, |
19 | TRANSLATOR_ENGINE_LIBRETRANSLATE, | 25 | TRANSLATOR_ENGINE_LIBRETRANSLATE, |
20 | LIBRETRANSLATE_TRANSLATOR_LANGUAGES, | ||
21 | } from '../config'; | 26 | } from '../config'; |
22 | import { openExternalUrl } from '../helpers/url-helpers'; | 27 | import { openExternalUrl } from '../helpers/url-helpers'; |
23 | import IContextMenuParams from '../models/IContextMenuParams'; | 28 | import type IContextMenuParams from '../models/IContextMenuParams'; |
24 | 29 | ||
25 | function matchesWord(string: string) { | 30 | function matchesWord(string: string) { |
26 | const regex = | 31 | const regex = |
diff --git a/src/webview/lib/RecipeWebview.ts b/src/webview/lib/RecipeWebview.ts index 31e9a288d..3b6b9cc88 100644 --- a/src/webview/lib/RecipeWebview.ts +++ b/src/webview/lib/RecipeWebview.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { ipcRenderer } from 'electron'; | ||
2 | import { BrowserWindow } from '@electron/remote'; | 1 | import { BrowserWindow } from '@electron/remote'; |
3 | import { pathExistsSync, readFileSync, existsSync } from 'fs-extra'; | 2 | import { ipcRenderer } from 'electron'; |
3 | import { existsSync, pathExistsSync, readFileSync } from 'fs-extra'; | ||
4 | import { safeParseInt } from '../../jsUtils'; | 4 | import { safeParseInt } from '../../jsUtils'; |
5 | 5 | ||
6 | const debug = require('../../preload-safe-debug')( | 6 | const debug = require('../../preload-safe-debug')( |
diff --git a/src/webview/recipe.ts b/src/webview/recipe.ts index 148ea6fab..d6db39779 100644 --- a/src/webview/recipe.ts +++ b/src/webview/recipe.ts | |||
@@ -1,26 +1,24 @@ | |||
1 | /* eslint-disable global-require */ | 1 | /* eslint-disable global-require */ |
2 | /* eslint-disable import/no-dynamic-require */ | 2 | /* eslint-disable import/no-dynamic-require */ |
3 | 3 | ||
4 | import { join } from 'node:path'; | ||
5 | import { existsSync } from 'node:fs'; | 4 | import { existsSync } from 'node:fs'; |
6 | import { noop, debounce } from 'lodash'; | 5 | import { join } from 'node:path'; |
7 | import { contextBridge, ipcRenderer } from 'electron'; | ||
8 | import { autorun, computed, makeObservable, observable } from 'mobx'; | ||
9 | import { pathExistsSync, readFileSync } from 'fs-extra'; | ||
10 | import { | 6 | import { |
11 | disable as disableDarkMode, | 7 | disable as disableDarkMode, |
12 | enable as enableDarkMode, | 8 | enable as enableDarkMode, |
13 | } from 'darkreader'; | 9 | } from 'darkreader'; |
10 | import { contextBridge, ipcRenderer } from 'electron'; | ||
11 | import { pathExistsSync, readFileSync } from 'fs-extra'; | ||
12 | import { debounce, noop } from 'lodash'; | ||
13 | import { autorun, computed, makeObservable, observable } from 'mobx'; | ||
14 | 14 | ||
15 | import ignoreList from './darkmode/ignore'; | ||
16 | import customDarkModeCss from './darkmode/custom'; | 15 | import customDarkModeCss from './darkmode/custom'; |
16 | import ignoreList from './darkmode/ignore'; | ||
17 | 17 | ||
18 | import RecipeWebview from './lib/RecipeWebview'; | 18 | import RecipeWebview from './lib/RecipeWebview'; |
19 | import Userscript from './lib/Userscript'; | 19 | import Userscript from './lib/Userscript'; |
20 | 20 | ||
21 | import BadgeHandler from './badge'; | 21 | import BadgeHandler from './badge'; |
22 | import DialogTitleHandler from './dialogTitle'; | ||
23 | import SessionHandler from './sessionHandler'; | ||
24 | import contextMenu from './contextMenu'; | 22 | import contextMenu from './contextMenu'; |
25 | import { | 23 | import { |
26 | darkModeStyleExists, | 24 | darkModeStyleExists, |
@@ -28,25 +26,27 @@ import { | |||
28 | isDarkModeStyleInjected, | 26 | isDarkModeStyleInjected, |
29 | removeDarkModeStyle, | 27 | removeDarkModeStyle, |
30 | } from './darkmode'; | 28 | } from './darkmode'; |
29 | import DialogTitleHandler from './dialogTitle'; | ||
31 | import FindInPage from './find'; | 30 | import FindInPage from './find'; |
32 | import { | 31 | import { |
33 | notificationsClassDefinition, | ||
34 | NotificationsHandler, | 32 | NotificationsHandler, |
33 | notificationsClassDefinition, | ||
35 | } from './notifications'; | 34 | } from './notifications'; |
36 | import { | 35 | import { |
37 | getDisplayMediaSelector, | 36 | getDisplayMediaSelector, |
38 | screenShareCss, | 37 | screenShareCss, |
39 | screenShareJs, | 38 | screenShareJs, |
40 | } from './screenshare'; | 39 | } from './screenshare'; |
40 | import SessionHandler from './sessionHandler'; | ||
41 | import { | 41 | import { |
42 | getSpellcheckerLocaleByFuzzyIdentifier, | 42 | getSpellcheckerLocaleByFuzzyIdentifier, |
43 | switchDict, | 43 | switchDict, |
44 | } from './spellchecker'; | 44 | } from './spellchecker'; |
45 | 45 | ||
46 | import type { AppStore } from '../@types/stores.types'; | ||
46 | import { DEFAULT_APP_SETTINGS } from '../config'; | 47 | import { DEFAULT_APP_SETTINGS } from '../config'; |
47 | import { cleanseJSObject, ifUndefined, safeParseInt } from '../jsUtils'; | 48 | import { cleanseJSObject, ifUndefined, safeParseInt } from '../jsUtils'; |
48 | import { AppStore } from '../@types/stores.types'; | 49 | import type Service from '../models/Service'; |
49 | import Service from '../models/Service'; | ||
50 | 50 | ||
51 | // For some services darkreader tries to use the chrome extension message API | 51 | // For some services darkreader tries to use the chrome extension message API |
52 | // This will cause the service to fail loading | 52 | // This will cause the service to fail loading |
diff --git a/src/webview/spellchecker.ts b/src/webview/spellchecker.ts index 8e452c791..92024b9b0 100644 --- a/src/webview/spellchecker.ts +++ b/src/webview/spellchecker.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { ipcRenderer } from 'electron'; | 1 | import { ipcRenderer } from 'electron'; |
2 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; | ||
3 | import { isMac } from '../environment'; | 2 | import { isMac } from '../environment'; |
3 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; | ||
4 | 4 | ||
5 | const debug = require('../preload-safe-debug')('Ferdium:spellchecker'); | 5 | const debug = require('../preload-safe-debug')('Ferdium:spellchecker'); |
6 | 6 | ||