You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-27 20:29:45 +02:00
Compare commits
95 Commits
android-v3
...
v3.0.3
Author | SHA1 | Date | |
---|---|---|---|
|
e84ea8ab04 | ||
|
b638056150 | ||
|
ff86c253d3 | ||
|
86d9f7e1cb | ||
|
385fe7bbe0 | ||
|
313587097a | ||
|
8393ccc7f8 | ||
|
e3ba605592 | ||
|
035557de9f | ||
|
97ff2b51f1 | ||
|
87f7fb6841 | ||
|
9fe31544f7 | ||
|
89dfbe3ec1 | ||
|
0c640c5e77 | ||
|
a3eec19b32 | ||
|
c0c3b4d23e | ||
|
1812587970 | ||
|
1bb724fe0e | ||
|
346f49fa66 | ||
|
55d25308f8 | ||
|
514a8cf841 | ||
|
837826ea4f | ||
|
681d1d67f3 | ||
|
d2f3252de2 | ||
|
859d3e867e | ||
|
238683e36f | ||
|
2ae08ff46e | ||
|
ce672915da | ||
|
a2071bfed2 | ||
|
03c3feef16 | ||
|
b3f4414026 | ||
|
04c6863d7f | ||
|
b678e2fb5d | ||
|
1179de7c36 | ||
|
58ca1a938b | ||
|
9713034f18 | ||
|
28b8818c4d | ||
|
2e2a2b3193 | ||
|
42900bcc66 | ||
|
ce451c5850 | ||
|
5b4477f7bd | ||
|
660ebcfc77 | ||
|
86872fb07c | ||
|
c55bb95950 | ||
|
d613d1ab4e | ||
|
cd5d648eec | ||
|
384b17738a | ||
|
500c8facdb | ||
|
6f76fe728f | ||
|
2488dd3806 | ||
|
9d3cccdf71 | ||
|
8dc75efc4c | ||
|
7caed19a32 | ||
|
a301470ac5 | ||
|
f899c97c4c | ||
|
8630c8e630 | ||
|
29daec2c07 | ||
|
ce3a28de70 | ||
|
1e6cc11868 | ||
|
3e0f6994a1 | ||
|
c10e617870 | ||
|
cade585292 | ||
|
f60e105d77 | ||
|
b622f9b938 | ||
|
00084c5798 | ||
|
554fb7026a | ||
|
04a6c36b5c | ||
|
adbf819cc0 | ||
|
3062f83367 | ||
|
bdb2e588f3 | ||
|
688d807eee | ||
|
06aa64016f | ||
|
06c7c132b8 | ||
|
fcb837ca99 | ||
|
7f34afcaea | ||
|
876fa324e5 | ||
|
f781183250 | ||
|
c1ae449ce2 | ||
|
c4aa18a63e | ||
|
27b86fbb00 | ||
|
569c6d8479 | ||
|
d3e2d3fc4a | ||
|
9b5ee63638 | ||
|
dee68681f5 | ||
|
f85db1496e | ||
|
0839b0314e | ||
|
40dbb8bd7f | ||
|
2de5c1bbf8 | ||
|
20edc63785 | ||
|
b936f9ba7c | ||
|
a5419e61d5 | ||
|
ec4d4141ef | ||
|
b5a16f756a | ||
|
0331d2a8db | ||
|
79eedcf6a6 |
@@ -322,9 +322,7 @@ packages/app-desktop/gui/NoteEditor/utils/useNoteSearchBar.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/usePluginServiceRegistration.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useSearchMarkers.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useWindowCommandHandler.js
|
||||
packages/app-desktop/gui/NoteList/NoteList.js
|
||||
packages/app-desktop/gui/NoteList/NoteList2.js
|
||||
packages/app-desktop/gui/NoteList/NoteListSource.js
|
||||
packages/app-desktop/gui/NoteList/commands/focusElementNoteList.js
|
||||
packages/app-desktop/gui/NoteList/commands/index.js
|
||||
packages/app-desktop/gui/NoteList/utils/canManuallySortNotes.js
|
||||
@@ -350,7 +348,6 @@ packages/app-desktop/gui/NoteListHeader/utils/getColumnTitle.js
|
||||
packages/app-desktop/gui/NoteListHeader/utils/useContextMenu.js
|
||||
packages/app-desktop/gui/NoteListHeader/utils/validateColumns.test.js
|
||||
packages/app-desktop/gui/NoteListHeader/utils/validateColumns.js
|
||||
packages/app-desktop/gui/NoteListItem.js
|
||||
packages/app-desktop/gui/NoteListItem/NoteListItem.js
|
||||
packages/app-desktop/gui/NoteListItem/utils/getNoteTitleHtml.js
|
||||
packages/app-desktop/gui/NoteListItem/utils/prepareViewProps.test.js
|
||||
@@ -463,7 +460,6 @@ packages/app-desktop/services/plugins/hooks/useThemeCss.js
|
||||
packages/app-desktop/services/plugins/hooks/useViewIsReady.js
|
||||
packages/app-desktop/services/plugins/hooks/useWebviewToPluginMessages.js
|
||||
packages/app-desktop/services/restart.js
|
||||
packages/app-desktop/services/share/invitationRespond.js
|
||||
packages/app-desktop/services/sortOrder/PerFolderSortOrderService.test.js
|
||||
packages/app-desktop/services/sortOrder/PerFolderSortOrderService.js
|
||||
packages/app-desktop/services/sortOrder/notesSortOrderUtils.test.js
|
||||
@@ -477,6 +473,8 @@ packages/app-desktop/utils/7zip/pathToBundled7Zip.js
|
||||
packages/app-desktop/utils/checkForUpdatesUtils.test.js
|
||||
packages/app-desktop/utils/checkForUpdatesUtils.js
|
||||
packages/app-desktop/utils/checkForUpdatesUtilsTestData.js
|
||||
packages/app-desktop/utils/isSafeToOpen.test.js
|
||||
packages/app-desktop/utils/isSafeToOpen.js
|
||||
packages/app-desktop/utils/markupLanguageUtils.js
|
||||
packages/app-desktop/utils/restartInSafeModeFromMain.test.js
|
||||
packages/app-desktop/utils/restartInSafeModeFromMain.js
|
||||
@@ -496,6 +494,7 @@ packages/app-mobile/components/ExtendedWebView.js
|
||||
packages/app-mobile/components/FolderPicker.js
|
||||
packages/app-mobile/components/Icon.js
|
||||
packages/app-mobile/components/Modal.js
|
||||
packages/app-mobile/components/ModalDialog.js
|
||||
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.js
|
||||
packages/app-mobile/components/NoteBodyViewer/bundledJs/Renderer.test.js
|
||||
packages/app-mobile/components/NoteBodyViewer/bundledJs/Renderer.js
|
||||
@@ -549,7 +548,10 @@ packages/app-mobile/components/NoteList.js
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileEditor.js
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.js
|
||||
packages/app-mobile/components/ProfileSwitcher/useProfileConfig.js
|
||||
packages/app-mobile/components/ScreenHeader.js
|
||||
packages/app-mobile/components/ScreenHeader/WarningBanner.test.js
|
||||
packages/app-mobile/components/ScreenHeader/WarningBanner.js
|
||||
packages/app-mobile/components/ScreenHeader/WarningBox.js
|
||||
packages/app-mobile/components/ScreenHeader/index.js
|
||||
packages/app-mobile/components/SelectDateTimeDialog.js
|
||||
packages/app-mobile/components/SideMenu.js
|
||||
packages/app-mobile/components/TextInput.js
|
||||
@@ -567,9 +569,13 @@ packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportDebu
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportProfileButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/NoteExportButton.test.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/NoteExportButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/NoteImportButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/TaskButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportAllFolders.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportDebugReport.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportProfile.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/makeImportExportCacheDirectory.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SectionDescription.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SectionHeader.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SectionSelector.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SettingComponent.js
|
||||
@@ -577,7 +583,9 @@ packages/app-mobile/components/screens/ConfigScreen/SettingItem.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SettingsButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SettingsToggle.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/configScreenStyles.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/ActionButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/index.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginStates.test.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginStates.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginToggle.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginUploadButton.js
|
||||
@@ -585,17 +593,22 @@ packages/app-mobile/components/screens/ConfigScreen/plugins/SearchPlugins.test.j
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/SearchPlugins.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/newRepoApi.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/pluginServiceSetup.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/isPluginInstallingAllowed.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/openWebsiteForPlugin.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/useRepoApi.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/types.js
|
||||
packages/app-mobile/components/screens/JoplinCloudLoginScreen.js
|
||||
packages/app-mobile/components/screens/LogScreen.js
|
||||
packages/app-mobile/components/screens/Note.js
|
||||
packages/app-mobile/components/screens/NoteTagsDialog.js
|
||||
packages/app-mobile/components/screens/Notes.js
|
||||
packages/app-mobile/components/screens/ShareManager/AcceptedShareItem.js
|
||||
packages/app-mobile/components/screens/ShareManager/IncomingShareItem.js
|
||||
packages/app-mobile/components/screens/ShareManager/index.test.js
|
||||
packages/app-mobile/components/screens/ShareManager/index.js
|
||||
packages/app-mobile/components/screens/UpgradeSyncTargetScreen.js
|
||||
packages/app-mobile/components/screens/encryption-config.js
|
||||
packages/app-mobile/components/screens/search.js
|
||||
packages/app-mobile/components/screens/status.js
|
||||
packages/app-mobile/components/side-menu-content.js
|
||||
packages/app-mobile/components/voiceTyping/VoiceTypingDialog.js
|
||||
packages/app-mobile/gulpfile.js
|
||||
@@ -606,6 +619,8 @@ packages/app-mobile/plugins/PluginRunner/backgroundPage/initializeDialogWebView.
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/initializePluginBackgroundIframe.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/pluginRunnerBackgroundPage.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/startStopPlugin.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/getFormData.test.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/getFormData.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/makeSandboxedIframe.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/reportUnhandledErrors.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/wrapConsoleLog.js
|
||||
@@ -637,6 +652,7 @@ packages/app-mobile/utils/ShareExtension.js
|
||||
packages/app-mobile/utils/ShareUtils.test.js
|
||||
packages/app-mobile/utils/ShareUtils.js
|
||||
packages/app-mobile/utils/TlsUtils.js
|
||||
packages/app-mobile/utils/appDefaultState.js
|
||||
packages/app-mobile/utils/autodetectTheme.js
|
||||
packages/app-mobile/utils/checkPermissions.js
|
||||
packages/app-mobile/utils/createRootStyle.js
|
||||
@@ -658,6 +674,7 @@ packages/app-mobile/utils/polyfills/index.js
|
||||
packages/app-mobile/utils/setupNotifications.js
|
||||
packages/app-mobile/utils/shareHandler.js
|
||||
packages/app-mobile/utils/showMessageBox.js
|
||||
packages/app-mobile/utils/testing/createMockReduxStore.js
|
||||
packages/app-mobile/utils/types.js
|
||||
packages/default-plugins/build.js
|
||||
packages/default-plugins/buildDefaultPlugins.js
|
||||
@@ -855,6 +872,7 @@ packages/lib/models/Tag.test.js
|
||||
packages/lib/models/Tag.js
|
||||
packages/lib/models/dateTimeFormats.test.js
|
||||
packages/lib/models/settings/FileHandler.js
|
||||
packages/lib/models/settings/settingValidations.test.js
|
||||
packages/lib/models/settings/settingValidations.js
|
||||
packages/lib/models/utils/getCollator.js
|
||||
packages/lib/models/utils/getConflictFolderId.js
|
||||
@@ -894,6 +912,7 @@ packages/lib/services/KvStore.js
|
||||
packages/lib/services/MigrationService.js
|
||||
packages/lib/services/NavService.js
|
||||
packages/lib/services/PostMessageService.js
|
||||
packages/lib/services/ReportService.test.js
|
||||
packages/lib/services/ReportService.js
|
||||
packages/lib/services/ResourceEditWatcher/index.js
|
||||
packages/lib/services/ResourceEditWatcher/reducer.js
|
||||
@@ -921,6 +940,7 @@ packages/lib/services/database/migrations/43.js
|
||||
packages/lib/services/database/migrations/44.js
|
||||
packages/lib/services/database/migrations/45.js
|
||||
packages/lib/services/database/migrations/46.js
|
||||
packages/lib/services/database/migrations/47.js
|
||||
packages/lib/services/database/migrations/index.js
|
||||
packages/lib/services/database/sqlStringToLines.js
|
||||
packages/lib/services/database/types.js
|
||||
@@ -1020,6 +1040,13 @@ packages/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo.js
|
||||
packages/lib/services/plugins/reducer.js
|
||||
packages/lib/services/plugins/utils/createViewHandle.js
|
||||
packages/lib/services/plugins/utils/executeSandboxCall.js
|
||||
packages/lib/services/plugins/utils/getPluginNamespacedSettingKey.js
|
||||
packages/lib/services/plugins/utils/getPluginSettingKeyPrefix.js
|
||||
packages/lib/services/plugins/utils/getPluginSettingValue.js
|
||||
packages/lib/services/plugins/utils/isCompatible/index.test.js
|
||||
packages/lib/services/plugins/utils/isCompatible/index.js
|
||||
packages/lib/services/plugins/utils/isCompatible/minVersionForPlatform.js
|
||||
packages/lib/services/plugins/utils/isCompatible/types.js
|
||||
packages/lib/services/plugins/utils/loadContentScripts.js
|
||||
packages/lib/services/plugins/utils/makeListener.js
|
||||
packages/lib/services/plugins/utils/manifestFromObject.js
|
||||
@@ -1027,6 +1054,8 @@ packages/lib/services/plugins/utils/mapEventHandlersToIds.js
|
||||
packages/lib/services/plugins/utils/types.js
|
||||
packages/lib/services/plugins/utils/validatePluginId.test.js
|
||||
packages/lib/services/plugins/utils/validatePluginId.js
|
||||
packages/lib/services/plugins/utils/validatePluginPlatforms.test.js
|
||||
packages/lib/services/plugins/utils/validatePluginPlatforms.js
|
||||
packages/lib/services/plugins/utils/validatePluginVersion.test.js
|
||||
packages/lib/services/plugins/utils/validatePluginVersion.js
|
||||
packages/lib/services/profileConfig/index.test.js
|
||||
@@ -1074,6 +1103,7 @@ packages/lib/services/search/gotoAnythingStyleQuery.js
|
||||
packages/lib/services/search/queryBuilder.js
|
||||
packages/lib/services/share/ShareService.test.js
|
||||
packages/lib/services/share/ShareService.js
|
||||
packages/lib/services/share/invitationRespond.js
|
||||
packages/lib/services/share/reducer.js
|
||||
packages/lib/services/spellChecker/SpellCheckerService.js
|
||||
packages/lib/services/spellChecker/SpellCheckerServiceDriverBase.js
|
||||
@@ -1117,7 +1147,6 @@ packages/lib/services/trash/getTrashFolderId.js
|
||||
packages/lib/services/trash/index.test.js
|
||||
packages/lib/services/trash/index.js
|
||||
packages/lib/services/trash/isTrashableItem.js
|
||||
packages/lib/services/trash/isTrashableNoteOrFolder.js
|
||||
packages/lib/services/trash/permanentlyDeleteOldItems.test.js
|
||||
packages/lib/services/trash/permanentlyDeleteOldItems.js
|
||||
packages/lib/services/trash/restoreItems.test.js
|
||||
@@ -1126,6 +1155,8 @@ packages/lib/shim-init-node.js
|
||||
packages/lib/shim.js
|
||||
packages/lib/string-utils.test.js
|
||||
packages/lib/string-utils.js
|
||||
packages/lib/testing/share/makeMockShareInvitation.js
|
||||
packages/lib/testing/share/mockShareService.js
|
||||
packages/lib/testing/syncTargetUtils.js
|
||||
packages/lib/testing/test-utils-synchronizer.js
|
||||
packages/lib/testing/test-utils.js
|
||||
@@ -1144,6 +1175,7 @@ packages/lib/types.js
|
||||
packages/lib/utils/ActionLogger.test.js
|
||||
packages/lib/utils/ActionLogger.js
|
||||
packages/lib/utils/credentialFiles.js
|
||||
packages/lib/utils/focusHandler.js
|
||||
packages/lib/utils/ipc/RemoteMessenger.test.js
|
||||
packages/lib/utils/ipc/RemoteMessenger.js
|
||||
packages/lib/utils/ipc/TestMessenger.js
|
||||
@@ -1225,6 +1257,7 @@ packages/renderer/MdToHtml/rules/link_open.js
|
||||
packages/renderer/MdToHtml/rules/mermaid.js
|
||||
packages/renderer/MdToHtml/rules/sanitize_html.js
|
||||
packages/renderer/MdToHtml/rules/source_map.js
|
||||
packages/renderer/MdToHtml/rules/tableHorizontallyScrollable.js
|
||||
packages/renderer/MdToHtml/setupLinkify.js
|
||||
packages/renderer/MdToHtml/validateLinks.js
|
||||
packages/renderer/assetsToHeaders.js
|
||||
|
13
.eslintrc.js
13
.eslintrc.js
@@ -101,6 +101,19 @@ module.exports = {
|
||||
'no-unneeded-ternary': 'error',
|
||||
'github/array-foreach': ['error'],
|
||||
|
||||
'no-restricted-properties': ['error',
|
||||
{
|
||||
'property': 'focus',
|
||||
'message': 'Please use focusHandler::focus() instead',
|
||||
},
|
||||
{
|
||||
'property': 'blur',
|
||||
'message': 'Please use focusHandler::blur() instead',
|
||||
},
|
||||
],
|
||||
|
||||
'@typescript-eslint/no-explicit-any': ['error'],
|
||||
|
||||
// -------------------------------
|
||||
// Formatting
|
||||
// -------------------------------
|
||||
|
2
.github/scripts/run_ci.sh
vendored
2
.github/scripts/run_ci.sh
vendored
@@ -90,7 +90,7 @@ if [ "$RUN_TESTS" == "1" ]; then
|
||||
# On Linux, we run the Joplin Server tests using PostgreSQL
|
||||
if [ "$IS_LINUX" == "1" ]; then
|
||||
echo "Running Joplin Server tests using PostgreSQL..."
|
||||
sudo docker-compose --file docker-compose.db-dev.yml up -d
|
||||
sudo docker compose --file docker-compose.db-dev.yml up -d
|
||||
cmdResult=$?
|
||||
if [ $cmdResult -ne 0 ]; then
|
||||
exit $cmdResult
|
||||
|
2
.github/workflows/build-android.yml
vendored
2
.github/workflows/build-android.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'yarn'
|
||||
|
6
.github/workflows/build-macos-m1.yml
vendored
6
.github/workflows/build-macos-m1.yml
vendored
@@ -20,8 +20,8 @@ jobs:
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: olegtarasov/get-tag@v2.1
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: olegtarasov/get-tag@v2.1.3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
# We need to pin the version to 18.15, because 18.16+ fails with this error:
|
||||
# https://github.com/facebook/react-native/issues/36440
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
brew install pango
|
||||
|
||||
# See github-action-main.yml for explanation
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
|
2
.github/workflows/close-stale-issues.yml
vendored
2
.github/workflows/close-stale-issues.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
if: github.repository == 'laurent22/joplin'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v4
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
# Use this to do a dry run from a pull request
|
||||
# debug-only: true
|
||||
|
8
.github/workflows/github-actions-main.yml
vendored
8
.github/workflows/github-actions-main.yml
vendored
@@ -82,8 +82,8 @@ jobs:
|
||||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: olegtarasov/get-tag@v2.1
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: olegtarasov/get-tag@v2.1.3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
# We need to pin the version to 18.15, because 18.16+ fails with this error:
|
||||
# https://github.com/facebook/react-native/issues/36440
|
||||
@@ -109,7 +109,7 @@ jobs:
|
||||
# Python to an earlier version.
|
||||
# Fixes error `ModuleNotFoundError: No module named 'distutils'`
|
||||
# Ref: https://github.com/nodejs/node-gyp/issues/2869
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
@@ -183,7 +183,7 @@ jobs:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'yarn'
|
||||
|
49
.gitignore
vendored
49
.gitignore
vendored
@@ -302,9 +302,7 @@ packages/app-desktop/gui/NoteEditor/utils/useNoteSearchBar.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/usePluginServiceRegistration.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useSearchMarkers.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useWindowCommandHandler.js
|
||||
packages/app-desktop/gui/NoteList/NoteList.js
|
||||
packages/app-desktop/gui/NoteList/NoteList2.js
|
||||
packages/app-desktop/gui/NoteList/NoteListSource.js
|
||||
packages/app-desktop/gui/NoteList/commands/focusElementNoteList.js
|
||||
packages/app-desktop/gui/NoteList/commands/index.js
|
||||
packages/app-desktop/gui/NoteList/utils/canManuallySortNotes.js
|
||||
@@ -330,7 +328,6 @@ packages/app-desktop/gui/NoteListHeader/utils/getColumnTitle.js
|
||||
packages/app-desktop/gui/NoteListHeader/utils/useContextMenu.js
|
||||
packages/app-desktop/gui/NoteListHeader/utils/validateColumns.test.js
|
||||
packages/app-desktop/gui/NoteListHeader/utils/validateColumns.js
|
||||
packages/app-desktop/gui/NoteListItem.js
|
||||
packages/app-desktop/gui/NoteListItem/NoteListItem.js
|
||||
packages/app-desktop/gui/NoteListItem/utils/getNoteTitleHtml.js
|
||||
packages/app-desktop/gui/NoteListItem/utils/prepareViewProps.test.js
|
||||
@@ -443,7 +440,6 @@ packages/app-desktop/services/plugins/hooks/useThemeCss.js
|
||||
packages/app-desktop/services/plugins/hooks/useViewIsReady.js
|
||||
packages/app-desktop/services/plugins/hooks/useWebviewToPluginMessages.js
|
||||
packages/app-desktop/services/restart.js
|
||||
packages/app-desktop/services/share/invitationRespond.js
|
||||
packages/app-desktop/services/sortOrder/PerFolderSortOrderService.test.js
|
||||
packages/app-desktop/services/sortOrder/PerFolderSortOrderService.js
|
||||
packages/app-desktop/services/sortOrder/notesSortOrderUtils.test.js
|
||||
@@ -457,6 +453,8 @@ packages/app-desktop/utils/7zip/pathToBundled7Zip.js
|
||||
packages/app-desktop/utils/checkForUpdatesUtils.test.js
|
||||
packages/app-desktop/utils/checkForUpdatesUtils.js
|
||||
packages/app-desktop/utils/checkForUpdatesUtilsTestData.js
|
||||
packages/app-desktop/utils/isSafeToOpen.test.js
|
||||
packages/app-desktop/utils/isSafeToOpen.js
|
||||
packages/app-desktop/utils/markupLanguageUtils.js
|
||||
packages/app-desktop/utils/restartInSafeModeFromMain.test.js
|
||||
packages/app-desktop/utils/restartInSafeModeFromMain.js
|
||||
@@ -476,6 +474,7 @@ packages/app-mobile/components/ExtendedWebView.js
|
||||
packages/app-mobile/components/FolderPicker.js
|
||||
packages/app-mobile/components/Icon.js
|
||||
packages/app-mobile/components/Modal.js
|
||||
packages/app-mobile/components/ModalDialog.js
|
||||
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.js
|
||||
packages/app-mobile/components/NoteBodyViewer/bundledJs/Renderer.test.js
|
||||
packages/app-mobile/components/NoteBodyViewer/bundledJs/Renderer.js
|
||||
@@ -529,7 +528,10 @@ packages/app-mobile/components/NoteList.js
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileEditor.js
|
||||
packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.js
|
||||
packages/app-mobile/components/ProfileSwitcher/useProfileConfig.js
|
||||
packages/app-mobile/components/ScreenHeader.js
|
||||
packages/app-mobile/components/ScreenHeader/WarningBanner.test.js
|
||||
packages/app-mobile/components/ScreenHeader/WarningBanner.js
|
||||
packages/app-mobile/components/ScreenHeader/WarningBox.js
|
||||
packages/app-mobile/components/ScreenHeader/index.js
|
||||
packages/app-mobile/components/SelectDateTimeDialog.js
|
||||
packages/app-mobile/components/SideMenu.js
|
||||
packages/app-mobile/components/TextInput.js
|
||||
@@ -547,9 +549,13 @@ packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportDebu
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportProfileButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/NoteExportButton.test.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/NoteExportButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/NoteImportButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/TaskButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportAllFolders.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportDebugReport.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportProfile.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/makeImportExportCacheDirectory.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SectionDescription.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SectionHeader.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SectionSelector.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SettingComponent.js
|
||||
@@ -557,7 +563,9 @@ packages/app-mobile/components/screens/ConfigScreen/SettingItem.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SettingsButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SettingsToggle.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/configScreenStyles.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/ActionButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/index.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginStates.test.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginStates.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginToggle.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginUploadButton.js
|
||||
@@ -565,17 +573,22 @@ packages/app-mobile/components/screens/ConfigScreen/plugins/SearchPlugins.test.j
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/SearchPlugins.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/newRepoApi.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/pluginServiceSetup.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/isPluginInstallingAllowed.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/openWebsiteForPlugin.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/useRepoApi.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/types.js
|
||||
packages/app-mobile/components/screens/JoplinCloudLoginScreen.js
|
||||
packages/app-mobile/components/screens/LogScreen.js
|
||||
packages/app-mobile/components/screens/Note.js
|
||||
packages/app-mobile/components/screens/NoteTagsDialog.js
|
||||
packages/app-mobile/components/screens/Notes.js
|
||||
packages/app-mobile/components/screens/ShareManager/AcceptedShareItem.js
|
||||
packages/app-mobile/components/screens/ShareManager/IncomingShareItem.js
|
||||
packages/app-mobile/components/screens/ShareManager/index.test.js
|
||||
packages/app-mobile/components/screens/ShareManager/index.js
|
||||
packages/app-mobile/components/screens/UpgradeSyncTargetScreen.js
|
||||
packages/app-mobile/components/screens/encryption-config.js
|
||||
packages/app-mobile/components/screens/search.js
|
||||
packages/app-mobile/components/screens/status.js
|
||||
packages/app-mobile/components/side-menu-content.js
|
||||
packages/app-mobile/components/voiceTyping/VoiceTypingDialog.js
|
||||
packages/app-mobile/gulpfile.js
|
||||
@@ -586,6 +599,8 @@ packages/app-mobile/plugins/PluginRunner/backgroundPage/initializeDialogWebView.
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/initializePluginBackgroundIframe.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/pluginRunnerBackgroundPage.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/startStopPlugin.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/getFormData.test.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/getFormData.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/makeSandboxedIframe.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/reportUnhandledErrors.js
|
||||
packages/app-mobile/plugins/PluginRunner/backgroundPage/utils/wrapConsoleLog.js
|
||||
@@ -617,6 +632,7 @@ packages/app-mobile/utils/ShareExtension.js
|
||||
packages/app-mobile/utils/ShareUtils.test.js
|
||||
packages/app-mobile/utils/ShareUtils.js
|
||||
packages/app-mobile/utils/TlsUtils.js
|
||||
packages/app-mobile/utils/appDefaultState.js
|
||||
packages/app-mobile/utils/autodetectTheme.js
|
||||
packages/app-mobile/utils/checkPermissions.js
|
||||
packages/app-mobile/utils/createRootStyle.js
|
||||
@@ -638,6 +654,7 @@ packages/app-mobile/utils/polyfills/index.js
|
||||
packages/app-mobile/utils/setupNotifications.js
|
||||
packages/app-mobile/utils/shareHandler.js
|
||||
packages/app-mobile/utils/showMessageBox.js
|
||||
packages/app-mobile/utils/testing/createMockReduxStore.js
|
||||
packages/app-mobile/utils/types.js
|
||||
packages/default-plugins/build.js
|
||||
packages/default-plugins/buildDefaultPlugins.js
|
||||
@@ -835,6 +852,7 @@ packages/lib/models/Tag.test.js
|
||||
packages/lib/models/Tag.js
|
||||
packages/lib/models/dateTimeFormats.test.js
|
||||
packages/lib/models/settings/FileHandler.js
|
||||
packages/lib/models/settings/settingValidations.test.js
|
||||
packages/lib/models/settings/settingValidations.js
|
||||
packages/lib/models/utils/getCollator.js
|
||||
packages/lib/models/utils/getConflictFolderId.js
|
||||
@@ -874,6 +892,7 @@ packages/lib/services/KvStore.js
|
||||
packages/lib/services/MigrationService.js
|
||||
packages/lib/services/NavService.js
|
||||
packages/lib/services/PostMessageService.js
|
||||
packages/lib/services/ReportService.test.js
|
||||
packages/lib/services/ReportService.js
|
||||
packages/lib/services/ResourceEditWatcher/index.js
|
||||
packages/lib/services/ResourceEditWatcher/reducer.js
|
||||
@@ -901,6 +920,7 @@ packages/lib/services/database/migrations/43.js
|
||||
packages/lib/services/database/migrations/44.js
|
||||
packages/lib/services/database/migrations/45.js
|
||||
packages/lib/services/database/migrations/46.js
|
||||
packages/lib/services/database/migrations/47.js
|
||||
packages/lib/services/database/migrations/index.js
|
||||
packages/lib/services/database/sqlStringToLines.js
|
||||
packages/lib/services/database/types.js
|
||||
@@ -1000,6 +1020,13 @@ packages/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo.js
|
||||
packages/lib/services/plugins/reducer.js
|
||||
packages/lib/services/plugins/utils/createViewHandle.js
|
||||
packages/lib/services/plugins/utils/executeSandboxCall.js
|
||||
packages/lib/services/plugins/utils/getPluginNamespacedSettingKey.js
|
||||
packages/lib/services/plugins/utils/getPluginSettingKeyPrefix.js
|
||||
packages/lib/services/plugins/utils/getPluginSettingValue.js
|
||||
packages/lib/services/plugins/utils/isCompatible/index.test.js
|
||||
packages/lib/services/plugins/utils/isCompatible/index.js
|
||||
packages/lib/services/plugins/utils/isCompatible/minVersionForPlatform.js
|
||||
packages/lib/services/plugins/utils/isCompatible/types.js
|
||||
packages/lib/services/plugins/utils/loadContentScripts.js
|
||||
packages/lib/services/plugins/utils/makeListener.js
|
||||
packages/lib/services/plugins/utils/manifestFromObject.js
|
||||
@@ -1007,6 +1034,8 @@ packages/lib/services/plugins/utils/mapEventHandlersToIds.js
|
||||
packages/lib/services/plugins/utils/types.js
|
||||
packages/lib/services/plugins/utils/validatePluginId.test.js
|
||||
packages/lib/services/plugins/utils/validatePluginId.js
|
||||
packages/lib/services/plugins/utils/validatePluginPlatforms.test.js
|
||||
packages/lib/services/plugins/utils/validatePluginPlatforms.js
|
||||
packages/lib/services/plugins/utils/validatePluginVersion.test.js
|
||||
packages/lib/services/plugins/utils/validatePluginVersion.js
|
||||
packages/lib/services/profileConfig/index.test.js
|
||||
@@ -1054,6 +1083,7 @@ packages/lib/services/search/gotoAnythingStyleQuery.js
|
||||
packages/lib/services/search/queryBuilder.js
|
||||
packages/lib/services/share/ShareService.test.js
|
||||
packages/lib/services/share/ShareService.js
|
||||
packages/lib/services/share/invitationRespond.js
|
||||
packages/lib/services/share/reducer.js
|
||||
packages/lib/services/spellChecker/SpellCheckerService.js
|
||||
packages/lib/services/spellChecker/SpellCheckerServiceDriverBase.js
|
||||
@@ -1097,7 +1127,6 @@ packages/lib/services/trash/getTrashFolderId.js
|
||||
packages/lib/services/trash/index.test.js
|
||||
packages/lib/services/trash/index.js
|
||||
packages/lib/services/trash/isTrashableItem.js
|
||||
packages/lib/services/trash/isTrashableNoteOrFolder.js
|
||||
packages/lib/services/trash/permanentlyDeleteOldItems.test.js
|
||||
packages/lib/services/trash/permanentlyDeleteOldItems.js
|
||||
packages/lib/services/trash/restoreItems.test.js
|
||||
@@ -1106,6 +1135,8 @@ packages/lib/shim-init-node.js
|
||||
packages/lib/shim.js
|
||||
packages/lib/string-utils.test.js
|
||||
packages/lib/string-utils.js
|
||||
packages/lib/testing/share/makeMockShareInvitation.js
|
||||
packages/lib/testing/share/mockShareService.js
|
||||
packages/lib/testing/syncTargetUtils.js
|
||||
packages/lib/testing/test-utils-synchronizer.js
|
||||
packages/lib/testing/test-utils.js
|
||||
@@ -1124,6 +1155,7 @@ packages/lib/types.js
|
||||
packages/lib/utils/ActionLogger.test.js
|
||||
packages/lib/utils/ActionLogger.js
|
||||
packages/lib/utils/credentialFiles.js
|
||||
packages/lib/utils/focusHandler.js
|
||||
packages/lib/utils/ipc/RemoteMessenger.test.js
|
||||
packages/lib/utils/ipc/RemoteMessenger.js
|
||||
packages/lib/utils/ipc/TestMessenger.js
|
||||
@@ -1205,6 +1237,7 @@ packages/renderer/MdToHtml/rules/link_open.js
|
||||
packages/renderer/MdToHtml/rules/mermaid.js
|
||||
packages/renderer/MdToHtml/rules/sanitize_html.js
|
||||
packages/renderer/MdToHtml/rules/source_map.js
|
||||
packages/renderer/MdToHtml/rules/tableHorizontallyScrollable.js
|
||||
packages/renderer/MdToHtml/setupLinkify.js
|
||||
packages/renderer/MdToHtml/validateLinks.js
|
||||
packages/renderer/assetsToHeaders.js
|
||||
|
@@ -41,6 +41,7 @@ class LinkSelector {
|
||||
const newLinkStore: LinkStoreEntry[] = [];
|
||||
const lines: string[] = renderedText.split('\n');
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const r = (lines[i] as any).matchAll(this.linkRegex_);
|
||||
const matches = [...r];
|
||||
// eslint-disable-next-line github/array-foreach -- Old code before rule was applied
|
||||
@@ -63,12 +64,14 @@ class LinkSelector {
|
||||
this.linkStore_ = this.findLinks(this.renderedText_);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public updateNote(textWidget: any): void {
|
||||
this.noteId_ = textWidget.noteId;
|
||||
this.scrollTop_ = textWidget.scrollTop_;
|
||||
this.updateText(textWidget.renderedText_);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public scrollWidget(textWidget: any): void {
|
||||
if (this.currentLinkIndex_ === null) return;
|
||||
|
||||
@@ -94,6 +97,7 @@ class LinkSelector {
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public changeLink(textWidget: any, offset: number): void | null {
|
||||
if (textWidget.noteId !== this.noteId_) {
|
||||
this.updateNote(textWidget);
|
||||
@@ -124,6 +128,7 @@ class LinkSelector {
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public openLink(textWidget: any): void {
|
||||
if (textWidget.noteId !== this.noteId_) return;
|
||||
if (textWidget.renderedText_ !== this.renderedText_) return;
|
||||
|
@@ -441,6 +441,7 @@ class AppGui {
|
||||
if (cmd === 'activate') {
|
||||
const w = this.widget('mainWindow').focusedWidget;
|
||||
if (w.name === 'folderList') {
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
this.widget('noteList').focus();
|
||||
} else if (w.name === 'noteList' || w.name === 'noteText') {
|
||||
this.processPromptCommand('edit $n');
|
||||
|
@@ -22,10 +22,14 @@ const { splitCommandBatch } = require('@joplin/lib/string-utils');
|
||||
|
||||
class Application extends BaseApplication {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private commands_: Record<string, any> = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private commandMetadata_: any = null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private activeCommand_: any = null;
|
||||
private allCommandsLoaded_ = false;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private gui_: any = null;
|
||||
private cache_ = new Cache();
|
||||
|
||||
@@ -37,6 +41,7 @@ class Application extends BaseApplication {
|
||||
return this.gui().stdoutMaxWidth();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async guessTypeAndLoadItem(pattern: string, options: any = null) {
|
||||
let type = BaseModel.TYPE_NOTE;
|
||||
if (pattern.indexOf('/') === 0) {
|
||||
@@ -46,6 +51,7 @@ class Application extends BaseApplication {
|
||||
return this.loadItem(type, pattern, options);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async loadItem(type: ModelType | 'folderOrNote', pattern: string, options: any = null) {
|
||||
const output = await this.loadItems(type, pattern, options);
|
||||
|
||||
@@ -70,6 +76,7 @@ class Application extends BaseApplication {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async loadItems(type: ModelType | 'folderOrNote', pattern: string, options: any = null): Promise<(FolderEntity | NoteEntity)[]> {
|
||||
if (type === 'folderOrNote') {
|
||||
const folders: FolderEntity[] = await this.loadItems(BaseModel.TYPE_FOLDER, pattern, options);
|
||||
@@ -160,6 +167,7 @@ class Application extends BaseApplication {
|
||||
}
|
||||
|
||||
if (uiType !== null) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const temp: Record<string, any> = {};
|
||||
for (const n in this.commands_) {
|
||||
if (!this.commands_.hasOwnProperty(n)) continue;
|
||||
@@ -219,6 +227,7 @@ class Application extends BaseApplication {
|
||||
CommandClass = require(`${__dirname}/command-${name}.js`);
|
||||
} catch (error) {
|
||||
if (error.message && error.message.indexOf('Cannot find module') >= 0) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const e: any = new Error(_('No such command: %s', name));
|
||||
e.type = 'notFound';
|
||||
throw e;
|
||||
@@ -238,6 +247,7 @@ class Application extends BaseApplication {
|
||||
isDummy: () => {
|
||||
return true;
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
prompt: (initialText = '', promptString = '', options: any = null) => {
|
||||
return cliUtils.prompt(initialText, promptString, options);
|
||||
},
|
||||
@@ -260,6 +270,7 @@ class Application extends BaseApplication {
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async execCommand(argv: string[]): Promise<any> {
|
||||
if (!argv.length) return this.execCommand(['help']);
|
||||
// reg.logger().debug('execCommand()', argv);
|
||||
@@ -390,6 +401,7 @@ class Application extends BaseApplication {
|
||||
|
||||
argv = await super.start(argv, { keychainEnabled });
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
cliUtils.setStdout((object: any) => {
|
||||
return this.stdout(object);
|
||||
});
|
||||
@@ -439,6 +451,7 @@ class Application extends BaseApplication {
|
||||
// initialised. So we manually call dispatchUpdateAll() to force an update.
|
||||
Setting.dispatchUpdateAll();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
await refreshFolders((action: any) => this.store().dispatch(action));
|
||||
|
||||
const tags = await Tag.allWithNotes();
|
||||
|
@@ -3,14 +3,18 @@ import { reg } from '@joplin/lib/registry.js';
|
||||
|
||||
export default class BaseCommand {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
protected stdout_: any = null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
protected prompt_: any = null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
protected dispatcher_: any;
|
||||
|
||||
public usage(): string {
|
||||
throw new Error('Usage not defined');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public encryptionCheck(item: any) {
|
||||
if (item && item.encryption_applied) throw new Error(_('Cannot change encrypted item'));
|
||||
}
|
||||
@@ -19,6 +23,7 @@ export default class BaseCommand {
|
||||
throw new Error('Description not defined');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async action(_args: any) {
|
||||
throw new Error('Action not defined');
|
||||
}
|
||||
@@ -31,6 +36,7 @@ export default class BaseCommand {
|
||||
return this.compatibleUis().indexOf(ui) >= 0;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public options(): any[] {
|
||||
return [];
|
||||
}
|
||||
@@ -59,6 +65,7 @@ export default class BaseCommand {
|
||||
this.dispatcher_ = fn;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public dispatch(action: any) {
|
||||
if (!this.dispatcher_) throw new Error('Dispatcher not defined');
|
||||
return this.dispatcher_(action);
|
||||
@@ -78,6 +85,7 @@ export default class BaseCommand {
|
||||
this.prompt_ = fn;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async prompt(message: string, options: any = null) {
|
||||
if (!this.prompt_) throw new Error('Prompt is undefined');
|
||||
return await this.prompt_(message, options);
|
||||
|
@@ -37,6 +37,7 @@ class Command extends BaseCommand {
|
||||
return markdownUtils.createMarkdownTable(headers, tableFields);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const models = [
|
||||
{
|
||||
|
@@ -13,6 +13,7 @@ class Command extends BaseCommand {
|
||||
return _('Attaches the given file to the note.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const title = args['note'];
|
||||
|
||||
|
@@ -18,6 +18,7 @@ class Command extends BaseCommand {
|
||||
return [['-v, --verbose', _('Displays the complete information about note.')]];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const title = args['note'];
|
||||
|
||||
|
@@ -27,6 +27,7 @@ class Command extends BaseCommand {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
// being defensive and not attempting to settle twice
|
||||
let isSettled = false;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const chunks: any = [];
|
||||
|
||||
inputStream.on('readable', () => {
|
||||
@@ -67,6 +68,7 @@ class Command extends BaseCommand {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const verbose = args.options.verbose;
|
||||
const isExport = args.options.export;
|
||||
@@ -91,6 +93,7 @@ class Command extends BaseCommand {
|
||||
keys.sort();
|
||||
|
||||
if (isExport) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const resultObj = keys.reduce<Record<string, any>>((acc, key) => {
|
||||
const value = Setting.value(key);
|
||||
if (!verbose && !value) return acc;
|
||||
|
@@ -13,6 +13,7 @@ class Command extends BaseCommand {
|
||||
return _('Duplicates the notes matching <note> to [notebook]. If no notebook is specified the note is duplicated in the current notebook.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
let folder = null;
|
||||
if (args['notebook']) {
|
||||
|
@@ -15,6 +15,7 @@ class Command extends BaseCommand {
|
||||
return _('Marks a to-do as done.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public static async handleAction(commandInstance: BaseCommand, args: any, isCompleted: boolean) {
|
||||
const note: NoteEntity = await app().loadItem(BaseModel.TYPE_NOTE, args.note);
|
||||
commandInstance.encryptionCheck(note);
|
||||
@@ -31,6 +32,7 @@ class Command extends BaseCommand {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
await Command.handleAction(this, args, true);
|
||||
}
|
||||
|
@@ -30,9 +30,11 @@ class Command extends BaseCommand {
|
||||
];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async action(args: any) {
|
||||
const options = args.options;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const askForMasterKey = async (error: any) => {
|
||||
const masterKeyId = error.masterKeyId;
|
||||
const password = await this.prompt(_('Enter master password:'), { type: 'string', secure: true });
|
||||
|
@@ -17,6 +17,7 @@ class Command extends BaseCommand {
|
||||
return _('Edit note.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
let tempFilePath: string|null = null;
|
||||
|
||||
|
@@ -24,6 +24,7 @@ class Command extends BaseCommand {
|
||||
return [['--format <format>', _('Destination format: %s', formats.join(', '))], ['--note <note>', _('Exports only the given note.')], ['--notebook <notebook>', _('Exports only the given notebook.')]];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const exportOptions: ExportOptions = {};
|
||||
exportOptions.path = args.path;
|
||||
@@ -35,10 +36,12 @@ class Command extends BaseCommand {
|
||||
if (args.options.note) {
|
||||
const notes = await app().loadItems(BaseModel.TYPE_NOTE, args.options.note, { parent: app().currentFolder() });
|
||||
if (!notes.length) throw new Error(_('Cannot find "%s".', args.options.note));
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
exportOptions.sourceNoteIds = notes.map((n: any) => n.id);
|
||||
} else if (args.options.notebook) {
|
||||
const folders = await app().loadItems(BaseModel.TYPE_FOLDER, args.options.notebook);
|
||||
if (!folders.length) throw new Error(_('Cannot find "%s".', args.options.notebook));
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
exportOptions.sourceFolderIds = folders.map((n: any) => n.id);
|
||||
}
|
||||
|
||||
|
@@ -13,6 +13,7 @@ class Command extends BaseCommand {
|
||||
return _('Displays a geolocation URL for the note.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const title = args['note'];
|
||||
|
||||
|
@@ -29,6 +29,7 @@ class Command extends BaseCommand {
|
||||
return output;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const stdoutWidth = app().commandStdoutMaxWidth();
|
||||
|
||||
|
@@ -30,6 +30,7 @@ class Command extends BaseCommand {
|
||||
];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const folder = await app().loadItem(BaseModel.TYPE_FOLDER, args.notebook);
|
||||
|
||||
|
@@ -34,11 +34,13 @@ class Command extends BaseCommand {
|
||||
];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const pattern = args['note-pattern'];
|
||||
let items = [];
|
||||
const options = args.options;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const queryOptions: any = {};
|
||||
if (options.limit) queryOptions.limit = options.limit;
|
||||
if (options.sort) {
|
||||
|
@@ -43,6 +43,7 @@ class Command extends BaseCommand {
|
||||
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async action(args: any) {
|
||||
const targetFolder = args.options.parent;
|
||||
|
||||
|
@@ -14,6 +14,7 @@ class Command extends BaseCommand {
|
||||
return _('Moves the given <item> to [notebook]');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const pattern = args['item'];
|
||||
const destination = args['notebook'];
|
||||
|
@@ -14,6 +14,7 @@ class Command extends BaseCommand {
|
||||
return _('Renames the given <item> (note or notebook) to <name>.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const pattern = args['item'];
|
||||
const name = args['name'];
|
||||
|
@@ -12,6 +12,7 @@ class Command extends BaseCommand {
|
||||
return _('Restore the items matching <pattern> from the trash.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const pattern = args['pattern'];
|
||||
|
||||
|
@@ -21,6 +21,7 @@ class Command extends BaseCommand {
|
||||
];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const pattern = args['notebook'];
|
||||
const force = args.options && args.options.force === true;
|
||||
|
@@ -21,6 +21,7 @@ class Command extends BaseCommand {
|
||||
];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const pattern = args['note-pattern'];
|
||||
const force = args.options && args.options.force === true;
|
||||
|
@@ -22,6 +22,7 @@ class Command extends BaseCommand {
|
||||
return _('Sets the property <name> of the given <note> to the given [value]. Possible properties are:\n\n%s', s.join(', '));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const title = args['note'];
|
||||
const propName = args['name'];
|
||||
@@ -36,6 +37,7 @@ class Command extends BaseCommand {
|
||||
|
||||
const timestamp = Date.now();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const newNote: any = {
|
||||
id: notes[i].id,
|
||||
type_: notes[i].type_,
|
||||
|
@@ -35,7 +35,9 @@ class Command extends BaseCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async action(args: any) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const schema: Record<string, any> = {
|
||||
title: 'JSON schema for Joplin setting files',
|
||||
'$id': Setting.schemaUrl,
|
||||
@@ -52,6 +54,7 @@ class Command extends BaseCommand {
|
||||
const type = settingTypeToSchemaType(md.type);
|
||||
if (!type) continue;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const props: Record<string, any> = {};
|
||||
props.type = type;
|
||||
props.default = md.value;
|
||||
@@ -61,6 +64,7 @@ class Command extends BaseCommand {
|
||||
if (md.description && md.description('desktop')) description.push(md.description('desktop'));
|
||||
|
||||
if (description.length) props.description = description.join('. ');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
if (md.isEnum) props.enum = Object.keys(md.options()).map((v: any) => Setting.formatValue(key, v));
|
||||
if ('minimum' in md) props.minimum = md.minimum;
|
||||
if ('maximum' in md) props.maximum = md.maximum;
|
||||
|
@@ -25,6 +25,7 @@ class Command extends BaseCommand {
|
||||
private syncTargetId_: number = null;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
private releaseLockFn_: Function = null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private oneDriveApiUtils_: any = null;
|
||||
|
||||
public usage() {
|
||||
@@ -59,6 +60,7 @@ class Command extends BaseCommand {
|
||||
// OneDrive
|
||||
this.oneDriveApiUtils_ = new OneDriveApiNodeUtils(syncTarget.api());
|
||||
const auth = await this.oneDriveApiUtils_.oauthDance({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
log: (...s: any[]) => {
|
||||
return this.stdout(...s);
|
||||
},
|
||||
@@ -133,6 +135,7 @@ class Command extends BaseCommand {
|
||||
return !!this.oneDriveApiUtils_;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async action(args: any) {
|
||||
this.releaseLockFn_ = null;
|
||||
|
||||
@@ -181,7 +184,9 @@ class Command extends BaseCommand {
|
||||
|
||||
const sync = await syncTarget.synchronizer();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const options: any = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onProgress: (report: any) => {
|
||||
const lines = Synchronizer.reportToLines(report);
|
||||
if (lines.length) cliUtils.redraw(lines.join(' '));
|
||||
|
@@ -6,11 +6,13 @@ import populateDatabase from '@joplin/lib/services/debug/populateDatabase';
|
||||
import { readCredentialFile } from '@joplin/lib/utils/credentialFiles';
|
||||
import JoplinServerApi from '@joplin/lib/JoplinServerApi';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
function randomElement(array: any[]): any {
|
||||
if (!array.length) return null;
|
||||
return array[Math.floor(Math.random() * array.length)];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
function itemCount(args: any) {
|
||||
const count = Number(args.arg0);
|
||||
if (!count || isNaN(count)) throw new Error('Note count must be specified');
|
||||
@@ -30,6 +32,7 @@ class Command extends BaseCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public options(): any[] {
|
||||
return [
|
||||
['--folder-count <count>', 'Folders to create'],
|
||||
@@ -40,6 +43,7 @@ class Command extends BaseCommand {
|
||||
];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async action(args: any) {
|
||||
const { command, options } = args;
|
||||
|
||||
@@ -53,6 +57,7 @@ class Command extends BaseCommand {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const promises: any[] = [];
|
||||
|
||||
if (command === 'createRandomNotes') {
|
||||
|
@@ -16,6 +16,7 @@ class Command extends BaseCommand {
|
||||
return ['cli'];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public override async action(args: any) {
|
||||
const folder = await app().loadItem(BaseModel.TYPE_FOLDER, args['notebook']);
|
||||
if (!folder) throw new Error(_('Cannot find "%s".', args['notebook']));
|
||||
|
@@ -25,6 +25,7 @@ export default class FolderListWidget extends ListWidget {
|
||||
this.trimItemTitle = false;
|
||||
this.showIds = false;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
this.itemRenderer = (item: any) => {
|
||||
const output = [];
|
||||
if (item === '-') {
|
||||
@@ -42,6 +43,7 @@ export default class FolderListWidget extends ListWidget {
|
||||
if (this.folderHasChildren_(this.folders, item.id)) {
|
||||
for (let i = 0; i < this.folders.length; i++) {
|
||||
if (this.folders[i].parent_id === item.id) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
noteCount -= (this.folders[i] as any).note_count;
|
||||
}
|
||||
}
|
||||
@@ -165,6 +167,7 @@ export default class FolderListWidget extends ListWidget {
|
||||
|
||||
this.logger().info('FFFFFFFFFFFFF', JSON.stringify(this.folders, null, 4));
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
let newItems: any[] = [];
|
||||
const orderFolders = (parentId: string) => {
|
||||
this.logger().info('PARENT', parentId);
|
||||
|
@@ -27,6 +27,7 @@ export default class StatusBarWidget extends BaseWidget {
|
||||
this.invalidate();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async prompt(initialText = '', promptString: any = null, options: any = null) {
|
||||
if (this.promptState_) throw new Error('Another prompt already active');
|
||||
if (promptString === null) promptString = ':';
|
||||
@@ -86,6 +87,7 @@ export default class StatusBarWidget extends BaseWidget {
|
||||
|
||||
// const textStyle = this.promptActive ? (s) => s : chalk.bgBlueBright.white;
|
||||
// const textStyle = (s) => s;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const textStyle = this.promptActive ? (s: any) => s : chalk.gray;
|
||||
|
||||
this.term.drawHLine(this.absoluteInnerX, this.absoluteInnerY, this.innerWidth, textStyle(' '));
|
||||
@@ -106,6 +108,7 @@ export default class StatusBarWidget extends BaseWidget {
|
||||
|
||||
const isSecurePrompt = !!this.promptState_.secure;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const options: any = {
|
||||
cancelable: true,
|
||||
history: this.history,
|
||||
@@ -118,6 +121,7 @@ export default class StatusBarWidget extends BaseWidget {
|
||||
if ('cursorPosition' in this.promptState_) options.cursorPosition = this.promptState_.cursorPosition;
|
||||
if (isSecurePrompt) options.echoChar = true;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
this.inputEventEmitter_ = this.term.inputField(options, (error: any, input: any) => {
|
||||
let resolveResult = null;
|
||||
const resolveFn = this.promptState_.resolve;
|
||||
|
@@ -8,14 +8,17 @@ import uuid from '@joplin/lib/uuid';
|
||||
const sandboxProxy = require('@joplin/lib/services/plugins/sandboxProxy');
|
||||
|
||||
function createConsoleWrapper(pluginId: string) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const wrapper: any = {};
|
||||
|
||||
for (const n in console) {
|
||||
// eslint-disable-next-line no-console
|
||||
if (!console.hasOwnProperty(n)) continue;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
wrapper[n] = (...args: any[]) => {
|
||||
const newArgs = args.slice();
|
||||
newArgs.splice(0, 0, `Plugin "${pluginId}":`);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
return (console as any)[n](...newArgs);
|
||||
};
|
||||
}
|
||||
@@ -33,6 +36,7 @@ function createConsoleWrapper(pluginId: string) {
|
||||
export default class PluginRunner extends BasePluginRunner {
|
||||
|
||||
private eventHandlers_: EventHandlers = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private activeSandboxCalls_: any = {};
|
||||
|
||||
public constructor() {
|
||||
@@ -41,12 +45,14 @@ export default class PluginRunner extends BasePluginRunner {
|
||||
this.eventHandler = this.eventHandler.bind(this);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private async eventHandler(eventHandlerId: string, args: any[]) {
|
||||
const cb = this.eventHandlers_[eventHandlerId];
|
||||
return cb(...args);
|
||||
}
|
||||
|
||||
private newSandboxProxy(pluginId: string, sandbox: Global) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const target = async (path: string, args: any[]) => {
|
||||
const callId = `${pluginId}::${path}::${uuid.createNano()}`;
|
||||
this.activeSandboxCalls_[callId] = true;
|
||||
|
@@ -1,11 +1,12 @@
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any -- Old code before rule was applied, Old code before rule was applied
|
||||
export default (cmd: any, stdout: Function, store: Function, gui: Function) => {
|
||||
cmd.setStdout((text: string) => {
|
||||
return stdout(text);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
cmd.setDispatcher((action: any) => {
|
||||
if (store()) {
|
||||
return store().dispatch(action);
|
||||
@@ -14,6 +15,7 @@ export default (cmd: any, stdout: Function, store: Function, gui: Function) => {
|
||||
}
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
cmd.setPrompt(async (message: string, options: any) => {
|
||||
if (!options) options = {};
|
||||
if (!options.type) options.type = 'boolean';
|
||||
|
@@ -3,7 +3,7 @@ import Folder from '@joplin/lib/models/Folder';
|
||||
import BaseCommand from '../base-command';
|
||||
import setupCommand from '../setupCommand';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any -- Old code before rule was applied, Old code before rule was applied
|
||||
export const setupCommandForTesting = (CommandClass: any, stdout: Function = null): BaseCommand => {
|
||||
const command = new CommandClass();
|
||||
setupCommand(command, stdout, null, null);
|
||||
|
@@ -22,6 +22,7 @@ describe('HtmlToMd', () => {
|
||||
|
||||
// if (htmlFilename.indexOf('image_preserve_size') !== 0) continue;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const htmlToMdOptions: any = {};
|
||||
|
||||
if (htmlFilename === 'anchor_local.html') {
|
||||
|
@@ -4,6 +4,7 @@ import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/
|
||||
import shim from '@joplin/lib/shim';
|
||||
const { themeStyle } = require('@joplin/lib/theme');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
function newTestMdToHtml(options: any = null) {
|
||||
options = {
|
||||
ResourceModel: {
|
||||
@@ -37,6 +38,7 @@ describe('MdToHtml', () => {
|
||||
|
||||
// if (mdFilename !== 'sanitize_9.md') continue;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const mdToHtmlOptions: any = {
|
||||
bodyOnly: true,
|
||||
};
|
||||
@@ -86,6 +88,7 @@ describe('MdToHtml', () => {
|
||||
}));
|
||||
|
||||
it('should return enabled plugin assets', (async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const pluginOptions: any = {};
|
||||
const pluginNames = MdToHtml.pluginNames();
|
||||
|
||||
|
@@ -0,0 +1,20 @@
|
||||
<div class="joplin-table-wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>No</td>
|
||||
<td>header</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>And no</td>
|
||||
<td>surprises</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@@ -0,0 +1,4 @@
|
||||
| | |
|
||||
| --- | --- |
|
||||
| No | header |
|
||||
| And no | surprises |
|
@@ -0,0 +1,16 @@
|
||||
<div class="joplin-table-wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Some paragraph<br class="jop-noMdConv"/><br class="jop-noMdConv"/>inside a table cell</td>
|
||||
<td>Second column</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@@ -0,0 +1,3 @@
|
||||
| | |
|
||||
| --- | --- |
|
||||
| Some paragraph<br><br>inside a table cell | Second column |
|
@@ -5,6 +5,7 @@ import shim from '@joplin/lib/shim';
|
||||
import Setting from '@joplin/lib/models/Setting';
|
||||
import { db, setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
function describeIfCompatible(name: string, fn: any, elseFn: any) {
|
||||
if (['win32', 'darwin'].includes(shim.platformName())) {
|
||||
return describe(name, fn);
|
||||
|
@@ -7,7 +7,7 @@ import Setting from '@joplin/lib/models/Setting';
|
||||
import * as fs from 'fs-extra';
|
||||
import Note from '@joplin/lib/models/Note';
|
||||
import Folder from '@joplin/lib/models/Folder';
|
||||
import { expectNotThrow, setupDatabaseAndSynchronizer, switchClient, expectThrow, createTempDir, supportDir } from '@joplin/lib/testing/test-utils';
|
||||
import { expectNotThrow, setupDatabaseAndSynchronizer, switchClient, expectThrow, createTempDir, supportDir, mockMobilePlatform } from '@joplin/lib/testing/test-utils';
|
||||
import { newPluginScript } from '../../testUtils';
|
||||
|
||||
const testPluginDir = `${supportDir}/plugins`;
|
||||
@@ -82,6 +82,7 @@ describe('services_PluginService', () => {
|
||||
|
||||
const allFolders = await Folder.all();
|
||||
expect(allFolders.length).toBe(2);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
expect(allFolders.map((f: any) => f.title).sort().join(', ')).toBe('multi - simple1, multi - simple2');
|
||||
}));
|
||||
|
||||
@@ -262,6 +263,68 @@ describe('services_PluginService', () => {
|
||||
}
|
||||
}));
|
||||
|
||||
it.each([
|
||||
{
|
||||
manifestPlatforms: ['desktop'],
|
||||
isDesktop: true,
|
||||
appVersion: '3.0.0',
|
||||
shouldRun: true,
|
||||
},
|
||||
{
|
||||
manifestPlatforms: ['desktop'],
|
||||
isDesktop: false,
|
||||
appVersion: '3.0.6',
|
||||
shouldRun: false,
|
||||
},
|
||||
{
|
||||
manifestPlatforms: ['desktop', 'mobile'],
|
||||
isDesktop: false,
|
||||
appVersion: '3.0.6',
|
||||
shouldRun: true,
|
||||
},
|
||||
{
|
||||
manifestPlatforms: [],
|
||||
isDesktop: false,
|
||||
appVersion: '3.0.8',
|
||||
shouldRun: true,
|
||||
},
|
||||
])('should enable and disable plugins depending on what platform(s) they support (case %#: %j)', async ({ manifestPlatforms, isDesktop, appVersion, shouldRun }) => {
|
||||
const pluginScript = `
|
||||
/* joplin-manifest:
|
||||
{
|
||||
"id": "org.joplinapp.plugins.PluginTest",
|
||||
"manifest_version": 1,
|
||||
"app_min_version": "1.0.0",
|
||||
"platforms": ${JSON.stringify(manifestPlatforms)},
|
||||
"name": "JS Bundle test",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
*/
|
||||
|
||||
joplin.plugins.register({
|
||||
onStart: async function() { },
|
||||
});
|
||||
`;
|
||||
|
||||
let resetPlatformMock = () => {};
|
||||
if (!isDesktop) {
|
||||
resetPlatformMock = mockMobilePlatform('android').reset;
|
||||
}
|
||||
|
||||
try {
|
||||
const service = newPluginService(appVersion);
|
||||
const plugin = await service.loadPluginFromJsBundle('', pluginScript);
|
||||
|
||||
if (shouldRun) {
|
||||
await expect(service.runPlugin(plugin)).resolves.toBeUndefined();
|
||||
} else {
|
||||
await expect(service.runPlugin(plugin)).rejects.toThrow(/disabled/);
|
||||
}
|
||||
} finally {
|
||||
resetPlatformMock();
|
||||
}
|
||||
});
|
||||
|
||||
it('should install a plugin', (async () => {
|
||||
const service = newPluginService();
|
||||
const pluginPath = `${testPluginDir}/jpl_test/org.joplinapp.FirstJplPlugin.jpl`;
|
||||
|
@@ -1,9 +1,14 @@
|
||||
import RepositoryApi from '@joplin/lib/services/plugins/RepositoryApi';
|
||||
import { AppType } from '@joplin/lib/models/Setting';
|
||||
import RepositoryApi, { AppInfo, InstallMode } from '@joplin/lib/services/plugins/RepositoryApi';
|
||||
import shim from '@joplin/lib/shim';
|
||||
import { setupDatabaseAndSynchronizer, switchClient, supportDir, createTempDir } from '@joplin/lib/testing/test-utils';
|
||||
import { remove } from 'fs-extra';
|
||||
|
||||
async function newRepoApi(): Promise<RepositoryApi> {
|
||||
const repo = new RepositoryApi(`${supportDir}/pluginRepo`, await createTempDir());
|
||||
let tempDirs: string[] = [];
|
||||
async function newRepoApi(appInfo: AppInfo = { type: AppType.Desktop, version: '3.0.0' }): Promise<RepositoryApi> {
|
||||
const tempDir = await createTempDir();
|
||||
tempDirs.push(tempDir);
|
||||
const repo = new RepositoryApi(`${supportDir}/pluginRepo`, tempDir, appInfo, InstallMode.Default);
|
||||
await repo.initialize();
|
||||
return repo;
|
||||
}
|
||||
@@ -14,6 +19,12 @@ describe('services_plugins_RepositoryApi', () => {
|
||||
await setupDatabaseAndSynchronizer(1);
|
||||
await switchClient(1);
|
||||
});
|
||||
afterEach(async () => {
|
||||
for (const tempDir of tempDirs) {
|
||||
await remove(tempDir);
|
||||
}
|
||||
tempDirs = [];
|
||||
});
|
||||
|
||||
it('should get the manifests', (async () => {
|
||||
const api = await newRepoApi();
|
||||
@@ -27,9 +38,10 @@ describe('services_plugins_RepositoryApi', () => {
|
||||
|
||||
{
|
||||
const results = await api.search('to');
|
||||
expect(results.length).toBe(2);
|
||||
expect(results.length).toBe(3);
|
||||
expect(!!results.find(m => m.id === 'joplin.plugin.ambrt.backlinksToNote')).toBe(true);
|
||||
expect(!!results.find(m => m.id === 'org.joplinapp.plugins.ToggleSidebars')).toBe(true);
|
||||
expect(!!results.find(m => m.id === 'org.joplinapp.plugins.AbcSheetMusic')).toBe(true);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -45,13 +57,14 @@ describe('services_plugins_RepositoryApi', () => {
|
||||
expect(await shim.fsDriver().exists(pluginPath)).toBe(true);
|
||||
}));
|
||||
|
||||
it('should tell if a plugin can be updated', (async () => {
|
||||
const api = await newRepoApi();
|
||||
|
||||
expect(await api.pluginCanBeUpdated('org.joplinapp.plugins.ToggleSidebars', '1.0.0', '3.0.0')).toBe(true);
|
||||
expect(await api.pluginCanBeUpdated('org.joplinapp.plugins.ToggleSidebars', '1.0.0', '1.0.0')).toBe(false);
|
||||
expect(await api.pluginCanBeUpdated('org.joplinapp.plugins.ToggleSidebars', '1.0.2', '3.0.0')).toBe(false);
|
||||
expect(await api.pluginCanBeUpdated('does.not.exist', '1.0.0', '3.0.0')).toBe(false);
|
||||
it.each([
|
||||
{ id: 'org.joplinapp.plugins.ToggleSidebars', installedVersion: '1.0.0', appVersion: '3.0.0', shouldBeUpdatable: true },
|
||||
{ id: 'org.joplinapp.plugins.ToggleSidebars', installedVersion: '1.0.0', appVersion: '1.0.0', shouldBeUpdatable: false },
|
||||
{ id: 'org.joplinapp.plugins.ToggleSidebars', installedVersion: '1.0.2', appVersion: '3.0.0', shouldBeUpdatable: false },
|
||||
{ id: 'does.not.exist', installedVersion: '1.0.0', appVersion: '3.0.0', shouldBeUpdatable: false },
|
||||
])('should tell if a plugin can be updated (case %#)', (async ({ id, installedVersion, appVersion, shouldBeUpdatable }) => {
|
||||
const api = await newRepoApi({ version: appVersion, type: AppType.Desktop });
|
||||
expect(await api.pluginCanBeUpdated(id, installedVersion)).toBe(shouldBeUpdatable);
|
||||
}));
|
||||
|
||||
});
|
||||
|
@@ -2,6 +2,7 @@ import Setting from '@joplin/lib/models/Setting';
|
||||
import { waitForFolderCount, setupDatabaseAndSynchronizer, switchClient, afterEachCleanUp } from '@joplin/lib/testing/test-utils';
|
||||
import Folder from '@joplin/lib/models/Folder';
|
||||
import { newPluginScript, newPluginService } from '../../../testUtils';
|
||||
import eventManager, { EventName } from '@joplin/lib/eventManager';
|
||||
|
||||
describe('JoplinSettings', () => {
|
||||
|
||||
@@ -66,6 +67,38 @@ describe('JoplinSettings', () => {
|
||||
await service.destroy();
|
||||
});
|
||||
|
||||
test('should de-register settings change listeners when a plugin is unloaded', async () => {
|
||||
const service = newPluginService();
|
||||
|
||||
const pluginScript = newPluginScript(`
|
||||
joplin.plugins.register({
|
||||
onStart: async function() {
|
||||
await joplin.settings.registerSettings({
|
||||
'test-setting': {
|
||||
value: 1234,
|
||||
type: 1,
|
||||
public: false,
|
||||
label: 'Test',
|
||||
}
|
||||
});
|
||||
|
||||
// Register 8 listeners to improve test reliability in the case
|
||||
// where listeners are added/removed from other sources.
|
||||
for (let i = 0; i < 8; i++) {
|
||||
await joplin.settings.onChange((event) => { });
|
||||
}
|
||||
},
|
||||
});
|
||||
`);
|
||||
|
||||
const plugin = await service.loadPluginFromJsBundle('', pluginScript);
|
||||
await service.runPlugin(plugin);
|
||||
|
||||
const listenerCounter = eventManager.listenerCounter_(EventName.SettingsChange);
|
||||
plugin.onUnload();
|
||||
expect(listenerCounter.getCountRemoved()).toBeGreaterThanOrEqual(8);
|
||||
});
|
||||
|
||||
test('should allow registering multiple settings', async () => {
|
||||
const service = newPluginService();
|
||||
|
||||
|
@@ -4,6 +4,7 @@ import Note from '@joplin/lib/models/Note';
|
||||
import Folder from '@joplin/lib/models/Folder';
|
||||
import ItemChange from '@joplin/lib/models/ItemChange';
|
||||
import { newPluginScript, newPluginService } from '../../../testUtils';
|
||||
import eventManager, { EventName } from '@joplin/lib/eventManager';
|
||||
|
||||
describe('JoplinWorkspace', () => {
|
||||
|
||||
@@ -17,6 +18,7 @@ describe('JoplinWorkspace', () => {
|
||||
});
|
||||
|
||||
test('should listen to noteChange events', async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const appState: Record<string, any> = {
|
||||
selectedNoteIds: [],
|
||||
};
|
||||
@@ -49,6 +51,7 @@ describe('JoplinWorkspace', () => {
|
||||
|
||||
const folder = (await Folder.all())[0];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const result: any = JSON.parse(folder.title);
|
||||
|
||||
expect(result.id).toBe(note.id);
|
||||
@@ -79,4 +82,33 @@ describe('JoplinWorkspace', () => {
|
||||
expect(modFolder.title).toBe('changedtitle');
|
||||
});
|
||||
|
||||
test('should remove event listeners when plugins are unloaded', async () => {
|
||||
const service = newPluginService();
|
||||
|
||||
const pluginScript = newPluginScript(`
|
||||
joplin.plugins.register({
|
||||
onStart: async () => {
|
||||
// Register each listener 8 times to improve test reliability -- it's possible
|
||||
// for listeners for the same events to be added/removed by other sources.
|
||||
for (let i = 0; i < 8; i++) {
|
||||
await joplin.workspace.onNoteChange(async (event) => { });
|
||||
await joplin.workspace.onResourceChange(async (event) => { });
|
||||
await joplin.workspace.filterEditorContextMenu(async (event) => { });
|
||||
}
|
||||
}
|
||||
})
|
||||
`);
|
||||
const plugin = await service.loadPluginFromJsBundle('', pluginScript);
|
||||
await service.runPlugin(plugin);
|
||||
|
||||
const itemChangeListenerCounter = eventManager.listenerCounter_(EventName.ItemChange);
|
||||
const resourceChangeListenerCounter = eventManager.listenerCounter_(EventName.ResourceChange);
|
||||
|
||||
plugin.onUnload();
|
||||
|
||||
expect(itemChangeListenerCounter.getCountRemoved()).toBeGreaterThanOrEqual(8);
|
||||
expect(resourceChangeListenerCounter.getCountRemoved()).toBeGreaterThanOrEqual(8);
|
||||
|
||||
await service.destroy();
|
||||
});
|
||||
});
|
||||
|
@@ -11,11 +11,13 @@ describe('services_plugins_sandboxProxy', () => {
|
||||
it('should create a new sandbox proxy', (async () => {
|
||||
interface Result {
|
||||
path: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
args: any[];
|
||||
}
|
||||
|
||||
const results: Result[] = [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const target: any = (path: string, args: any[]) => {
|
||||
results.push({ path, args });
|
||||
};
|
||||
@@ -34,11 +36,13 @@ describe('services_plugins_sandboxProxy', () => {
|
||||
it('should allow importing a namespace', (async () => {
|
||||
interface Result {
|
||||
path: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
args: any[];
|
||||
}
|
||||
|
||||
const results: Result[] = [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const target: any = (path: string, args: any[]) => {
|
||||
results.push({ path, args });
|
||||
};
|
||||
|
@@ -16,6 +16,7 @@
|
||||
"manifest_version": 1,
|
||||
"id": "org.joplinapp.plugins.ToggleSidebars",
|
||||
"app_min_version": "1.6",
|
||||
"platforms": ["desktop"],
|
||||
"version": "1.0.2",
|
||||
"name": "Note list and side bar toggle buttons",
|
||||
"description": "Adds buttons to toggle note list and sidebar",
|
||||
@@ -25,5 +26,43 @@
|
||||
"_publish_hash": "sha256:e0d833b7ef1bb8f02ee4cb861ef1989621358c45a5614911071302dc0527a3b4",
|
||||
"_publish_commit": "dev:1b5b2342fc25717b77ad9f1627c1a334e5bbae54",
|
||||
"_npm_package_name": "@joplin/joplin-plugin-toggle-sidebars"
|
||||
},
|
||||
"org.joplinapp.plugins.AbcSheetMusic": {
|
||||
"manifest_version": 1,
|
||||
"id": "org.joplinapp.plugins.AbcSheetMusic",
|
||||
"app_min_version": "2.13.5",
|
||||
"version": "1.0.5",
|
||||
"name": "ABC Sheet Music Plugin",
|
||||
"description": "Turns ABC text notation into sheet music",
|
||||
"author": "Laurent Cozic",
|
||||
"homepage_url": "https://github.com/joplin/plugin-abc-sheet-music",
|
||||
"repository_url": "https://github.com/joplin/plugin-abc-sheet-music",
|
||||
"category": "viewer",
|
||||
"keywords": [
|
||||
"sheet music",
|
||||
"abc",
|
||||
"notation"
|
||||
],
|
||||
"screenshots": [
|
||||
{
|
||||
"src": "images/PeacherineRag.png"
|
||||
},
|
||||
{
|
||||
"src": "images/Tablature.png"
|
||||
}
|
||||
],
|
||||
"icons": {
|
||||
"16": "images/icon-16.png",
|
||||
"32": "images/icon-32.png",
|
||||
"48": "images/icon-48.png",
|
||||
"128": "images/icon-128.png"
|
||||
},
|
||||
"promo_tile": {
|
||||
"src": "images/promo_tile.png"
|
||||
},
|
||||
"_publish_hash": "sha256:94a13d4833affbc949ba60174ab77419aa02b0777563a796f7480206b73a864b",
|
||||
"_publish_commit": "master:2b128c7a21f010e9937a112e0cf1fb5c03f9ca75",
|
||||
"_npm_package_name": "joplin-plugin-abc-sheet-music",
|
||||
"_recommended": true
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"id": "org.joplinapp.plugins.AbcSheetMusic",
|
||||
"app_min_version": "2.13.5",
|
||||
"version": "1.0.5",
|
||||
"name": "ABC Sheet Music Plugin",
|
||||
"description": "Turns ABC text notation into sheet music",
|
||||
"author": "Laurent Cozic",
|
||||
"homepage_url": "https://github.com/joplin/plugin-abc-sheet-music",
|
||||
"repository_url": "https://github.com/joplin/plugin-abc-sheet-music",
|
||||
"category": "viewer",
|
||||
"keywords": [
|
||||
"sheet music",
|
||||
"abc",
|
||||
"notation"
|
||||
],
|
||||
"screenshots": [
|
||||
{
|
||||
"src": "images/PeacherineRag.png"
|
||||
},
|
||||
{
|
||||
"src": "images/Tablature.png"
|
||||
}
|
||||
],
|
||||
"icons": {
|
||||
"16": "images/icon-16.png",
|
||||
"32": "images/icon-32.png",
|
||||
"48": "images/icon-48.png",
|
||||
"128": "images/icon-128.png"
|
||||
},
|
||||
"promo_tile": {
|
||||
"src": "images/promo_tile.png"
|
||||
},
|
||||
"_publish_hash": "sha256:94a13d4833affbc949ba60174ab77419aa02b0777563a796f7480206b73a864b",
|
||||
"_publish_commit": "master:2b128c7a21f010e9937a112e0cf1fb5c03f9ca75",
|
||||
"_npm_package_name": "joplin-plugin-abc-sheet-music"
|
||||
}
|
Binary file not shown.
@@ -2,6 +2,7 @@
|
||||
"manifest_version": 1,
|
||||
"id": "org.joplinapp.plugins.ToggleSidebars",
|
||||
"app_min_version": "1.6",
|
||||
"platforms": ["desktop"],
|
||||
"version": "1.0.2",
|
||||
"name": "Note list and side bar toggle buttons",
|
||||
"description": "Adds buttons to toggle note list and sidebar",
|
||||
|
@@ -1,12 +1,35 @@
|
||||
import { Rectangle } from './types';
|
||||
export interface Implementation {
|
||||
nativeImage: any;
|
||||
}
|
||||
export interface CreateFromBufferOptions {
|
||||
width?: number;
|
||||
height?: number;
|
||||
scaleFactor?: number;
|
||||
}
|
||||
export interface CreateFromPdfOptions {
|
||||
/**
|
||||
* The first page to export. Defaults to `1`, the first page in
|
||||
* the document.
|
||||
*/
|
||||
minPage?: number;
|
||||
/**
|
||||
* The number of the last page to convert. Defaults to the last page
|
||||
* if not given.
|
||||
*
|
||||
* If `maxPage` is greater than the number of pages in the PDF, all pages
|
||||
* in the PDF will be converted to images.
|
||||
*/
|
||||
maxPage?: number;
|
||||
scaleFactor?: number;
|
||||
}
|
||||
export interface PdfInfo {
|
||||
pageCount: number;
|
||||
}
|
||||
export interface Implementation {
|
||||
nativeImage: {
|
||||
createFromPath: (path: string) => Promise<any>;
|
||||
createFromPdf: (path: string, options: CreateFromPdfOptions) => Promise<any[]>;
|
||||
};
|
||||
getPdfInfo: (path: string) => Promise<PdfInfo>;
|
||||
}
|
||||
export interface ResizeOptions {
|
||||
width?: number;
|
||||
height?: number;
|
||||
@@ -34,9 +57,13 @@ export default class JoplinImaging {
|
||||
private cacheImage;
|
||||
createFromPath(filePath: string): Promise<Handle>;
|
||||
createFromResource(resourceId: string): Promise<Handle>;
|
||||
createFromPdfPath(path: string, options?: CreateFromPdfOptions): Promise<Handle[]>;
|
||||
createFromPdfResource(resourceId: string, options?: CreateFromPdfOptions): Promise<Handle[]>;
|
||||
getPdfInfoFromPath(path: string): Promise<PdfInfo>;
|
||||
getPdfInfoFromResource(resourceId: string): Promise<PdfInfo>;
|
||||
getSize(handle: Handle): Promise<any>;
|
||||
resize(handle: Handle, options?: ResizeOptions): Promise<string>;
|
||||
crop(handle: Handle, rectange: Rectangle): Promise<string>;
|
||||
crop(handle: Handle, rectangle: Rectangle): Promise<string>;
|
||||
toPngFile(handle: Handle, filePath: string): Promise<void>;
|
||||
/**
|
||||
* Quality is between 0 and 100
|
||||
@@ -57,5 +84,5 @@ export default class JoplinImaging {
|
||||
* Image data is not automatically deleted by Joplin so make sure you call
|
||||
* this method on the handle once you are done.
|
||||
*/
|
||||
free(handle: Handle): Promise<void>;
|
||||
free(handles: Handle[] | Handle): Promise<void>;
|
||||
}
|
||||
|
@@ -1,50 +1,110 @@
|
||||
import joplin from 'api';
|
||||
import { ToolbarButtonLocation } from 'api/types';
|
||||
|
||||
const registerMakeThumbnailCommand = async () => {
|
||||
await joplin.commands.register({
|
||||
name: 'makeThumbnail',
|
||||
execute: async () => {
|
||||
// ---------------------------------------------------------------
|
||||
// Get the current note
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const noteIds = await joplin.workspace.selectedNoteIds();
|
||||
if (noteIds.length !== 1) return;
|
||||
const noteId = noteIds[0];
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Get the top resource in that note (if any)
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const result = await joplin.data.get(['notes', noteId, 'resources']);
|
||||
if (result.items.length <= 0) return;
|
||||
const resource = result.items[0];
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Create an image object and resize it
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const imageHandle = await joplin.imaging.createFromResource(resource.id);
|
||||
const resizedImageHandle = await joplin.imaging.resize(imageHandle, { width: 100 });
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Convert the image to a resource and add it to the note
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const newResource = await joplin.imaging.toJpgResource(resizedImageHandle, { title: "Thumbnail" });
|
||||
await joplin.commands.execute('insertText', '\n');
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Free up the image objects at the end
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
await joplin.imaging.free(imageHandle);
|
||||
await joplin.imaging.free(resizedImageHandle);
|
||||
},
|
||||
});
|
||||
|
||||
await joplin.views.toolbarButtons.create('makeThumbnailButton', 'makeThumbnail', ToolbarButtonLocation.EditorToolbar);
|
||||
};
|
||||
|
||||
|
||||
const registerInlinePdfCommand = async () => {
|
||||
await joplin.commands.register({
|
||||
name: 'inlinePdfs',
|
||||
execute: async () => {
|
||||
// ---------------------------------------------------------------
|
||||
// Get the current selection & extract a resource link
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const selection: string = await joplin.commands.execute('selectedText');
|
||||
|
||||
// Matches content of the form
|
||||
// [text here](:/32-letter-or-num-characters-here)
|
||||
// Where ([a-z0-9]{32}) matches the resource ID.
|
||||
const resourceLinkRegex = /\[.*\]\(:\/([a-z0-9]{32})\)/;
|
||||
|
||||
const resourceLinkMatch = selection.match(resourceLinkRegex);
|
||||
if (!resourceLinkMatch) return;
|
||||
const resourceId = resourceLinkMatch[1]; // The text of the region matching ([a-z0-9]{32})
|
||||
|
||||
const resource = await joplin.data.get(['resources', resourceId], { fields: ['mime'] });
|
||||
const isPdf = resource.mime === 'application/pdf';
|
||||
if (!isPdf) return;
|
||||
|
||||
// Clear the selection
|
||||
await joplin.commands.execute('replaceSelection', '');
|
||||
await joplin.commands.execute('insertText', selection);
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Convert the PDF to images
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const pdfInfo = await joplin.imaging.getPdfInfoFromResource(resourceId);
|
||||
const images = await joplin.imaging.createFromPdfResource(
|
||||
resourceId,
|
||||
// Convert at most 10 pages
|
||||
{ minPage: 1, maxPage: 10, scaleFactor: 0.5 },
|
||||
);
|
||||
|
||||
let pageNumber = 0;
|
||||
for (const image of images) {
|
||||
pageNumber++;
|
||||
const pageResource = await joplin.imaging.toJpgResource(
|
||||
image, { title: `Page ${pageNumber} of ${pdfInfo.pageCount}` }
|
||||
);
|
||||
await joplin.commands.execute('insertText', `\n- `);
|
||||
}
|
||||
|
||||
await joplin.imaging.free(images);
|
||||
},
|
||||
});
|
||||
|
||||
await joplin.views.toolbarButtons.create('inlineSelectedPdfsButton', 'inlinePdfs', ToolbarButtonLocation.EditorToolbar);
|
||||
};
|
||||
|
||||
joplin.plugins.register({
|
||||
onStart: async function() {
|
||||
await joplin.commands.register({
|
||||
name: 'makeThumbnail',
|
||||
execute: async () => {
|
||||
// ---------------------------------------------------------------
|
||||
// Get the current note
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const noteIds = await joplin.workspace.selectedNoteIds();
|
||||
if (noteIds.length !== 1) return;
|
||||
const noteId = noteIds[0];
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Get the top resource in that note (if any)
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const result = await joplin.data.get(['notes', noteId, 'resources']);
|
||||
if (result.items.length <= 0) return;
|
||||
const resource = result.items[0];
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Create an image object and resize it
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const imageHandle = await joplin.imaging.createFromResource(resource.id);
|
||||
const resizedImageHandle = await joplin.imaging.resize(imageHandle, { width: 100 });
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Convert the image to a resource and add it to the note
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const newResource = await joplin.imaging.toJpgResource(resizedImageHandle, { title: "Thumbnail" });
|
||||
await joplin.commands.execute('insertText', '\n');
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Free up the image objects at the end
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
await joplin.imaging.free(imageHandle);
|
||||
await joplin.imaging.free(resizedImageHandle);
|
||||
},
|
||||
});
|
||||
|
||||
await joplin.views.toolbarButtons.create('makeThumbnailButton', 'makeThumbnail', ToolbarButtonLocation.EditorToolbar);
|
||||
await registerMakeThumbnailCommand();
|
||||
await registerInlinePdfCommand();
|
||||
},
|
||||
});
|
||||
|
@@ -2,6 +2,7 @@ import PluginService from '@joplin/lib/services/plugins/PluginService';
|
||||
import PluginRunner from '../app/services/plugins/PluginRunner';
|
||||
|
||||
export interface PluginServiceOptions {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
getState?(): Record<string, any>;
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
//
|
||||
// To get it working:
|
||||
//
|
||||
// - Run the Postgres database -- `sudo docker-compose --file docker-compose.db-dev.yml up`
|
||||
// - Run the Postgres database -- `sudo docker compose --file docker-compose.db-dev.yml up`
|
||||
// - Update the DB parameters in ~/joplin-credentials/server.env to use the dev
|
||||
// database
|
||||
// - Run the server - `JOPLIN_IS_TESTING=1 yarn start-dev`
|
||||
|
@@ -243,6 +243,7 @@ class AppComponent extends Component {
|
||||
if (!ref) break;
|
||||
lastRef = ref;
|
||||
}
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
if (lastRef) lastRef.focus();
|
||||
}
|
||||
}
|
||||
|
@@ -20,24 +20,28 @@ interface RendererProcessQuitReply {
|
||||
}
|
||||
|
||||
interface PluginWindows {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export default class ElectronAppWrapper {
|
||||
|
||||
private logger_: Logger = null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private electronApp_: any;
|
||||
private env_: string;
|
||||
private isDebugMode_: boolean;
|
||||
private profilePath_: string;
|
||||
private win_: BrowserWindow = null;
|
||||
private willQuitApp_ = false;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private tray_: any = null;
|
||||
private buildDir_: string = null;
|
||||
private rendererProcessQuitReply_: RendererProcessQuitReply = null;
|
||||
private pluginWindows_: PluginWindows = {};
|
||||
private initialCallbackUrl_: string = null;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public constructor(electronApp: any, env: string, profilePath: string|null, isDebugMode: boolean, initialCallbackUrl: string) {
|
||||
this.electronApp_ = electronApp;
|
||||
this.env_ = env;
|
||||
@@ -115,6 +119,7 @@ export default class ElectronAppWrapper {
|
||||
const windowStateKeeper = require('electron-window-state');
|
||||
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const stateOptions: any = {
|
||||
defaultWidth: Math.round(0.8 * screen.getPrimaryDisplay().workArea.width),
|
||||
defaultHeight: Math.round(0.8 * screen.getPrimaryDisplay().workArea.height),
|
||||
@@ -126,6 +131,7 @@ export default class ElectronAppWrapper {
|
||||
// Load the previous state with fallback to defaults
|
||||
const windowState = windowStateKeeper(stateOptions);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const windowOptions: any = {
|
||||
x: windowState.x,
|
||||
y: windowState.y,
|
||||
@@ -192,6 +198,7 @@ export default class ElectronAppWrapper {
|
||||
});
|
||||
|
||||
this.win_.webContents.on('did-fail-load', async event => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
if ((event as any).isMainFrame) {
|
||||
await this.handleAppFailure('Renderer process failed to load', false);
|
||||
}
|
||||
@@ -228,6 +235,7 @@ export default class ElectronAppWrapper {
|
||||
}
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
this.win_.on('close', (event: any) => {
|
||||
// If it's on macOS, the app is completely closed only if the user chooses to close the app (willQuitApp_ will be true)
|
||||
// otherwise the window is simply hidden, and will be re-open once the app is "activated" (which happens when the
|
||||
@@ -276,6 +284,7 @@ export default class ElectronAppWrapper {
|
||||
}
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
ipcMain.on('asynchronous-message', (_event: any, message: string, args: any) => {
|
||||
if (message === 'appCloseReply') {
|
||||
// We got the response from the renderer process:
|
||||
@@ -287,6 +296,7 @@ export default class ElectronAppWrapper {
|
||||
|
||||
// This handler receives IPC messages from a plugin or from the main window,
|
||||
// and forwards it to the main window or the plugin window.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
ipcMain.on('pluginMessage', (_event: any, message: PluginMessage) => {
|
||||
try {
|
||||
if (message.target === 'mainWindow') {
|
||||
@@ -325,6 +335,7 @@ export default class ElectronAppWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public registerPluginWindow(pluginId: string, window: any) {
|
||||
this.pluginWindows_[pluginId] = window;
|
||||
}
|
||||
@@ -387,6 +398,7 @@ export default class ElectronAppWrapper {
|
||||
}
|
||||
|
||||
// Note: this must be called only after the "ready" event of the app has been dispatched
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public createTray(contextMenu: any) {
|
||||
try {
|
||||
this.tray_ = new Tray(`${this.buildDir()}/icons/${this.trayIconFilename_()}`);
|
||||
@@ -423,11 +435,13 @@ export default class ElectronAppWrapper {
|
||||
}
|
||||
|
||||
// Someone tried to open a second instance - focus our window instead
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
this.electronApp_.on('second-instance', (_e: any, argv: string[]) => {
|
||||
const win = this.window();
|
||||
if (!win) return;
|
||||
if (win.isMinimized()) win.restore();
|
||||
win.show();
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
win.focus();
|
||||
if (process.platform !== 'darwin') {
|
||||
const url = argv.find((arg) => isCallbackUrl(arg));
|
||||
@@ -462,6 +476,7 @@ export default class ElectronAppWrapper {
|
||||
this.win_.show();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
this.electronApp_.on('open-url', (event: any, url: string) => {
|
||||
event.preventDefault();
|
||||
void this.openCallbackUrl(url);
|
||||
|
@@ -68,6 +68,7 @@ export default class InteropServiceHelper {
|
||||
|
||||
win = bridge().newBrowserWindow(windowOptions);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
|
||||
@@ -85,6 +86,7 @@ export default class InteropServiceHelper {
|
||||
// pdfs.
|
||||
// https://github.com/laurent22/joplin/issues/6254.
|
||||
await win.webContents.executeJavaScript('document.querySelectorAll(\'details\').forEach(el=>el.setAttribute(\'open\',\'\'))');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const data = await win.webContents.printToPDF(options as any);
|
||||
resolve(data);
|
||||
} catch (error) {
|
||||
@@ -126,6 +128,7 @@ export default class InteropServiceHelper {
|
||||
resolve(null);
|
||||
}, 1000);
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
win.webContents.print(options as any, (success: boolean, reason: string) => {
|
||||
cleanup();
|
||||
if (!success && reason !== 'cancelled') reject(new Error(`Could not print: ${reason}`));
|
||||
|
@@ -11,6 +11,7 @@ const logger = Logger.create('app.reducer');
|
||||
export interface AppStateRoute {
|
||||
type: string;
|
||||
routeName: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
props: any;
|
||||
}
|
||||
|
||||
@@ -21,29 +22,36 @@ export enum AppStateDialogName {
|
||||
|
||||
export interface AppStateDialog {
|
||||
name: AppStateDialogName;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
props: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface AppState extends State {
|
||||
route: AppStateRoute;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
navHistory: any[];
|
||||
noteVisiblePanes: string[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
windowContentSize: any;
|
||||
watchedNoteFiles: string[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
lastEditorScrollPercents: any;
|
||||
devToolsVisible: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
visibleDialogs: any; // empty object if no dialog is visible. Otherwise contains the list of visible dialogs.
|
||||
focusedField: string;
|
||||
layoutMoveMode: boolean;
|
||||
startupPluginsLoaded: boolean;
|
||||
|
||||
// Extra reducer keys go here
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
watchedResources: any;
|
||||
mainLayout: LayoutItem;
|
||||
dialogs: AppStateDialog[];
|
||||
isResettingLayout: boolean;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
export function createAppDefaultState(windowContentSize: any, resourceEditWatcherDefaultState: any): AppState {
|
||||
return {
|
||||
...defaultState,
|
||||
@@ -69,6 +77,7 @@ export function createAppDefaultState(windowContentSize: any, resourceEditWatche
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
export default function(state: AppState, action: any) {
|
||||
let newState = state;
|
||||
|
||||
@@ -129,6 +138,7 @@ export default function(state: AppState, action: any) {
|
||||
case 'NOTE_VISIBLE_PANES_TOGGLE':
|
||||
|
||||
{
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const getNextLayout = (currentLayout: any) => {
|
||||
currentLayout = panes.length === 2 ? 'both' : currentLayout[0];
|
||||
|
||||
@@ -183,6 +193,7 @@ export default function(state: AppState, action: any) {
|
||||
logger.warn('MAIN_LAYOUT_SET_ITEM_PROP: Found an empty item in layout: ', JSON.stringify(state.mainLayout));
|
||||
} else {
|
||||
if (item.key === action.itemKey) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
(item as any)[action.propName] = action.propValue;
|
||||
return false;
|
||||
}
|
||||
|
@@ -84,6 +84,7 @@ const appDefaultState = createAppDefaultState(
|
||||
|
||||
class Application extends BaseApplication {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private checkAllPluginStartedIID_: any = null;
|
||||
private initPluginServiceDone_ = false;
|
||||
private ocrService_: OcrService;
|
||||
@@ -98,6 +99,7 @@ class Application extends BaseApplication {
|
||||
return true;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public reducer(state: AppState = appDefaultState, action: any) {
|
||||
let newState = appReducer(state, action);
|
||||
newState = resourceEditWatcherReducer(newState, action);
|
||||
@@ -113,6 +115,7 @@ class Application extends BaseApplication {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
protected async generalMiddleware(store: any, next: any, action: any) {
|
||||
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'locale' || action.type === 'SETTING_UPDATE_ALL') {
|
||||
setLocale(Setting.value('locale'));
|
||||
@@ -137,6 +140,10 @@ class Application extends BaseApplication {
|
||||
webFrame.setZoomFactor(Setting.value('windowContentZoomFactor') / 100);
|
||||
}
|
||||
|
||||
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'linking.extraAllowedExtensions' || action.type === 'SETTING_UPDATE_ALL') {
|
||||
bridge().extraAllowedOpenExtensions = Setting.value('linking.extraAllowedExtensions');
|
||||
}
|
||||
|
||||
if (['EVENT_NOTE_ALARM_FIELD_CHANGE', 'NOTE_DELETE'].indexOf(action.type) >= 0) {
|
||||
await AlarmService.updateNoteNotification(action.id, action.type === 'NOTE_DELETE');
|
||||
}
|
||||
@@ -229,13 +236,16 @@ class Application extends BaseApplication {
|
||||
// The context menu must be setup in renderer process because that's where
|
||||
// the spell checker service lives.
|
||||
electronContextMenu({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
shouldShowMenu: (_event: any, params: any) => {
|
||||
// params.inputFieldType === 'none' when right-clicking the text editor. This is a bit of a hack to detect it because in this
|
||||
// case we don't want to use the built-in context menu but a custom one.
|
||||
return params.isEditable && params.inputFieldType !== 'none';
|
||||
},
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
menu: (actions: any, props: any) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const spellCheckerMenuItems = SpellCheckerService.instance().contextMenuItems(props.misspelledWord, props.dictionarySuggestions).map((item: any) => new MenuItem(item));
|
||||
|
||||
const output = [
|
||||
@@ -346,6 +356,7 @@ class Application extends BaseApplication {
|
||||
private setupOcrService() {
|
||||
if (Setting.value('ocr.enabled')) {
|
||||
if (!this.ocrService_) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const Tesseract = (window as any).Tesseract;
|
||||
|
||||
const driver = new OcrDriverTesseract(
|
||||
@@ -371,6 +382,7 @@ class Application extends BaseApplication {
|
||||
eventManager.on(EventName.ResourceChange, handleResourceChange);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async start(argv: string[], startOptions: StartOptions = null): Promise<any> {
|
||||
// If running inside a package, the command line, instead of being "node.exe <path> <flags>" is "joplin.exe <flags>" so
|
||||
// insert an extra argument so that they can be processed in a consistent way everywhere.
|
||||
@@ -452,6 +464,7 @@ class Application extends BaseApplication {
|
||||
// manually call dispatchUpdateAll() to force an update.
|
||||
Setting.dispatchUpdateAll();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
await refreshFolders((action: any) => this.dispatch(action));
|
||||
|
||||
const tags = await Tag.allWithNotes();
|
||||
@@ -580,12 +593,14 @@ class Application extends BaseApplication {
|
||||
|
||||
ResourceEditWatcher.instance().initialize(
|
||||
reg.logger(),
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
(action: any) => { this.store().dispatch(action); },
|
||||
(path: string) => bridge().openItem(path),
|
||||
);
|
||||
|
||||
// Forwards the local event to the global event manager, so that it can
|
||||
// be picked up by the plugin manager.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
ResourceEditWatcher.instance().on('resourceChange', (event: any) => {
|
||||
eventManager.emit(EventName.ResourceChange, event);
|
||||
});
|
||||
@@ -594,6 +609,7 @@ class Application extends BaseApplication {
|
||||
|
||||
// Make it available to the console window - useful to call revisionService.collectRevisions()
|
||||
if (Setting.value('env') === 'dev') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
(window as any).joplin = {
|
||||
revisionService: RevisionService.instance(),
|
||||
migrationService: MigrationService.instance(),
|
||||
@@ -609,6 +625,9 @@ class Application extends BaseApplication {
|
||||
}
|
||||
|
||||
bridge().addEventListener('nativeThemeUpdated', this.bridge_nativeThemeUpdated);
|
||||
bridge().setOnAllowedExtensionsChangeListener((newExtensions) => {
|
||||
Setting.setValue('linking.extraAllowedExtensions', newExtensions);
|
||||
});
|
||||
|
||||
await this.initPluginService();
|
||||
|
||||
@@ -628,12 +647,17 @@ class Application extends BaseApplication {
|
||||
SearchEngine.instance().scheduleSyncTables();
|
||||
});
|
||||
|
||||
// await populateDatabase(reg.db(), {
|
||||
// clearDatabase: true,
|
||||
// folderCount: 1000,
|
||||
// rootFolderCount: 1,
|
||||
// subFolderDepth: 1,
|
||||
// });
|
||||
// setTimeout(() => {
|
||||
// void populateDatabase(reg.db(), {
|
||||
// clearDatabase: true,
|
||||
// folderCount: 200,
|
||||
// noteCount: 3000,
|
||||
// tagCount: 2000,
|
||||
// tagsPerNote: 10,
|
||||
// rootFolderCount: 20,
|
||||
// subFolderDepth: 3,
|
||||
// });
|
||||
// }, 5000);
|
||||
|
||||
// setTimeout(() => {
|
||||
// console.info(CommandService.instance().commandsToMarkdownTable(this.store().getState()));
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import ElectronAppWrapper from './ElectronAppWrapper';
|
||||
import shim from '@joplin/lib/shim';
|
||||
import { _, setLocale } from '@joplin/lib/locale';
|
||||
import { BrowserWindow, nativeTheme, nativeImage, dialog, shell, MessageBoxSyncOptions } from 'electron';
|
||||
import { BrowserWindow, nativeTheme, nativeImage, shell, dialog, MessageBoxSyncOptions } from 'electron';
|
||||
import { dirname, toSystemSlashes } from '@joplin/lib/path-utils';
|
||||
import { fileUriToPath } from '@joplin/utils/url';
|
||||
import { urlDecode } from '@joplin/lib/string-utils';
|
||||
@@ -9,7 +9,8 @@ import * as Sentry from '@sentry/electron/main';
|
||||
import { homedir } from 'os';
|
||||
import { msleep } from '@joplin/utils/time';
|
||||
import { pathExists, writeFileSync } from 'fs-extra';
|
||||
import { normalize } from 'path';
|
||||
import { extname, normalize } from 'path';
|
||||
import isSafeToOpen from './utils/isSafeToOpen';
|
||||
|
||||
interface LastSelectedPath {
|
||||
file: string;
|
||||
@@ -20,9 +21,11 @@ interface OpenDialogOptions {
|
||||
properties?: string[];
|
||||
defaultPath?: string;
|
||||
createDirectory?: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
filters?: any[];
|
||||
}
|
||||
|
||||
type OnAllowedExtensionsChange = (newExtensions: string[])=> void;
|
||||
interface MessageDialogOptions extends Omit<MessageBoxSyncOptions, 'message'> {
|
||||
message?: string;
|
||||
}
|
||||
@@ -36,6 +39,9 @@ export class Bridge {
|
||||
private appName_: string;
|
||||
private appId_: string;
|
||||
|
||||
private extraAllowedExtensions_: string[] = [];
|
||||
private onAllowedExtensionsChangeListener_: OnAllowedExtensionsChange = ()=>{};
|
||||
|
||||
public constructor(electronWrapper: ElectronAppWrapper, appId: string, appName: string, rootProfileDir: string, autoUploadCrashDumps: boolean) {
|
||||
this.electronWrapper_ = electronWrapper;
|
||||
this.appId_ = appId;
|
||||
@@ -104,6 +110,24 @@ export class Bridge {
|
||||
this.autoUploadCrashDumps_ = v;
|
||||
}
|
||||
|
||||
public get extraAllowedOpenExtensions() {
|
||||
return this.extraAllowedExtensions_;
|
||||
}
|
||||
|
||||
public set extraAllowedOpenExtensions(newValue: string[]) {
|
||||
const oldValue = this.extraAllowedExtensions_;
|
||||
const changed = newValue.length !== oldValue.length || newValue.some((v, idx) => v !== oldValue[idx]);
|
||||
if (changed) {
|
||||
this.extraAllowedExtensions_ = newValue;
|
||||
this.onAllowedExtensionsChangeListener_?.(this.extraAllowedExtensions_);
|
||||
}
|
||||
}
|
||||
|
||||
public setOnAllowedExtensionsChangeListener(listener: OnAllowedExtensionsChange) {
|
||||
this.onAllowedExtensionsChangeListener_ = listener;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async captureException(error: any) {
|
||||
Sentry.captureException(error);
|
||||
// We wait to give the "beforeSend" event handler time to process the crash dump and write
|
||||
@@ -169,6 +193,7 @@ export class Bridge {
|
||||
|
||||
electronApp: this.electronApp(),
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
shouldShowMenu: (_event: any, params: any) => {
|
||||
return params.isEditable;
|
||||
},
|
||||
@@ -197,6 +222,7 @@ export class Bridge {
|
||||
return require('electron').shell.showItemInFolder(toSystemSlashes(fullPath));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public newBrowserWindow(options: any) {
|
||||
return new BrowserWindow(options);
|
||||
}
|
||||
@@ -226,6 +252,7 @@ export class Bridge {
|
||||
return this.window().webContents.closeDevTools();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async showSaveDialog(options: any) {
|
||||
if (!options) options = {};
|
||||
if (!('defaultPath' in options) && this.lastSelectedPaths_.file) options.defaultPath = this.lastSelectedPaths_.file;
|
||||
@@ -240,16 +267,20 @@ export class Bridge {
|
||||
if (!options) options = {};
|
||||
let fileType = 'file';
|
||||
if (options.properties && options.properties.includes('openDirectory')) fileType = 'directory';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
if (!('defaultPath' in options) && (this.lastSelectedPaths_ as any)[fileType]) options.defaultPath = (this.lastSelectedPaths_ as any)[fileType];
|
||||
if (!('createDirectory' in options)) options.createDirectory = true;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const { filePaths } = await dialog.showOpenDialog(this.window(), options as any);
|
||||
if (filePaths && filePaths.length) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
(this.lastSelectedPaths_ as any)[fileType] = dirname(filePaths[0]);
|
||||
}
|
||||
return filePaths;
|
||||
}
|
||||
|
||||
// Don't use this directly - call one of the showXxxxxxxMessageBox() instead
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private showMessageBox_(window: any, options: MessageDialogOptions): number {
|
||||
if (!window) window = this.window();
|
||||
return dialog.showMessageBoxSync(window, { message: '', ...options });
|
||||
@@ -291,6 +322,7 @@ export class Bridge {
|
||||
return result;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public showInfoMessageBox(message: string, options: any = {}) {
|
||||
const result = this.showMessageBox_(this.window(), { type: 'info',
|
||||
message: message,
|
||||
@@ -325,11 +357,43 @@ export class Bridge {
|
||||
fullPath = fileUriToPath(urlDecode(fullPath), shim.platformName());
|
||||
}
|
||||
fullPath = normalize(fullPath);
|
||||
|
||||
// Note: pathExists is intended to mitigate a security issue related to network drives
|
||||
// on Windows.
|
||||
if (await pathExists(fullPath)) {
|
||||
return shell.openPath(fullPath);
|
||||
const fileExtension = extname(fullPath);
|
||||
const userAllowedExtension = this.extraAllowedOpenExtensions.includes(fileExtension);
|
||||
if (userAllowedExtension || await isSafeToOpen(fullPath)) {
|
||||
return shell.openPath(fullPath);
|
||||
} else {
|
||||
const allowOpenId = 2;
|
||||
const learnMoreId = 1;
|
||||
const fileExtensionDescription = JSON.stringify(fileExtension);
|
||||
const result = await dialog.showMessageBox(this.window(), {
|
||||
title: _('Unknown file type'),
|
||||
message:
|
||||
_('Joplin doesn\'t recognise the %s extension. Opening this file could be dangerous. What would you like to do?', fileExtensionDescription),
|
||||
type: 'warning',
|
||||
checkboxLabel: _('Always open %s files without asking.', fileExtensionDescription),
|
||||
buttons: [
|
||||
_('Cancel'),
|
||||
_('Learn more'),
|
||||
_('Open it'),
|
||||
],
|
||||
});
|
||||
|
||||
if (result.response === learnMoreId) {
|
||||
void this.openExternal('https://joplinapp.org/help/apps/attachments#unknown-filetype-warning');
|
||||
return 'Learn more shown';
|
||||
} else if (result.response !== allowOpenId) {
|
||||
return 'Cancelled by user';
|
||||
}
|
||||
|
||||
if (result.checkboxChecked) {
|
||||
this.extraAllowedOpenExtensions = this.extraAllowedOpenExtensions.concat(fileExtension);
|
||||
}
|
||||
|
||||
return shell.openPath(fullPath);
|
||||
}
|
||||
} else {
|
||||
return 'Path does not exist.';
|
||||
}
|
||||
|
@@ -64,6 +64,7 @@ async function addSkippedVersion(s: string) {
|
||||
await KvStore.instance().setValue('updateCheck::skippedVersions', JSON.stringify(versions));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
export default async function checkForUpdates(inBackground: boolean, parentWindow: any, options: CheckForUpdateOptions) {
|
||||
if (isCheckingForUpdate_) {
|
||||
logger.info('Skipping check because it is already running');
|
||||
|
@@ -11,6 +11,7 @@ export const runtime = (): CommandRuntime => {
|
||||
return {
|
||||
// "targetPath" should be a file for JEX export (because the format can
|
||||
// contain multiple folders) or a directory otherwise.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
execute: async (_context: any, folderIds: string[], format: ExportModuleOutputFormat, targetPath: string) => {
|
||||
const exportOptions: ExportOptions = {
|
||||
sourceFolderIds: folderIds,
|
||||
|
@@ -8,6 +8,7 @@ export const declaration: CommandDeclaration = {
|
||||
|
||||
export const runtime = (): CommandRuntime => {
|
||||
return {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
execute: async (_context: any, noteIds: string[], format: ExportModuleOutputFormat, targetDirectoryPath: string) => {
|
||||
const exportOptions: ExportOptions = {
|
||||
path: targetDirectoryPath,
|
||||
|
@@ -6,6 +6,7 @@ export const declaration: CommandDeclaration = {
|
||||
|
||||
export const runtime = (): CommandRuntime => {
|
||||
return {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
execute: async (_context: any, target: string) => {
|
||||
if (target === 'noteBody') return CommandService.instance().execute('focusElementNoteBody');
|
||||
if (target === 'noteList') return CommandService.instance().execute('focusElementNoteList');
|
||||
|
@@ -23,6 +23,7 @@ export const runtime = (): CommandRuntime => {
|
||||
}
|
||||
},
|
||||
enabledCondition: 'oneNoteSelected && !noteIsReadOnly && (!modalDialogVisible || gotoAnythingVisible)',
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
mapStateToTitle: (state: any) => {
|
||||
const noteId = stateUtils.selectedNoteId(state);
|
||||
return state.watchedNoteFiles.includes(noteId) ? _('Stop') : '';
|
||||
|
@@ -2,6 +2,9 @@ import * as React from 'react';
|
||||
const styled = require('styled-components').default;
|
||||
const { space } = require('styled-system');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||
type StyleProps = any;
|
||||
|
||||
export enum ButtonLevel {
|
||||
Primary = 'primary',
|
||||
Secondary = 'secondary',
|
||||
@@ -26,6 +29,7 @@ interface Props {
|
||||
iconAnimation?: string;
|
||||
tooltip?: string;
|
||||
disabled?: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||
style?: any;
|
||||
size?: ButtonSize;
|
||||
isSquare?: boolean;
|
||||
@@ -71,131 +75,131 @@ const StyledButtonBase = styled.button`
|
||||
`;
|
||||
|
||||
const StyledIcon = styled(styled.span(space))`
|
||||
font-size: ${(props: any) => props.theme.toolbarIconSize}px;
|
||||
${(props: any) => props.animation ? `animation: ${props.animation}` : ''};
|
||||
font-size: ${(props: StyleProps) => props.theme.toolbarIconSize}px;
|
||||
${(props: StyleProps) => props.animation ? `animation: ${props.animation}` : ''};
|
||||
`;
|
||||
|
||||
const StyledButtonPrimary = styled(StyledButtonBase)`
|
||||
border: none;
|
||||
background-color: ${(props: any) => props.theme.backgroundColor5};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColor5};
|
||||
|
||||
${(props: any) => props.disabled} {
|
||||
${(props: StyleProps) => props.disabled} {
|
||||
&:hover {
|
||||
background-color: ${(props: any) => props.theme.backgroundColorHover5};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColorHover5};
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: ${(props: any) => props.theme.backgroundColorActive5};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColorActive5};
|
||||
}
|
||||
}
|
||||
|
||||
${StyledIcon} {
|
||||
color: ${(props: any) => props.theme.color5};
|
||||
color: ${(props: StyleProps) => props.theme.color5};
|
||||
}
|
||||
|
||||
${StyledTitle} {
|
||||
color: ${(props: any) => props.theme.color5};
|
||||
color: ${(props: StyleProps) => props.theme.color5};
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledButtonSecondary = styled(StyledButtonBase)`
|
||||
border: 1px solid ${(props: any) => props.theme.borderColor4};
|
||||
background-color: ${(props: any) => props.theme.backgroundColor4};
|
||||
border: 1px solid ${(props: StyleProps) => props.theme.borderColor4};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColor4};
|
||||
|
||||
${(props: any) => props.disabled} {
|
||||
${(props: StyleProps) => props.disabled} {
|
||||
&:hover {
|
||||
background-color: ${(props: any) => props.theme.backgroundColorHover4};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColorHover4};
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: ${(props: any) => props.theme.backgroundColorActive4};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColorActive4};
|
||||
}
|
||||
}
|
||||
|
||||
${StyledIcon} {
|
||||
color: ${(props: any) => props.theme.color4};
|
||||
color: ${(props: StyleProps) => props.theme.color4};
|
||||
}
|
||||
|
||||
${StyledTitle} {
|
||||
color: ${(props: any) => props.theme.color4};
|
||||
color: ${(props: StyleProps) => props.theme.color4};
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledButtonTertiary = styled(StyledButtonBase)`
|
||||
border: 1px solid ${(props: any) => props.theme.color3};
|
||||
background-color: ${(props: any) => props.theme.backgroundColor3};
|
||||
border: 1px solid ${(props: StyleProps) => props.theme.color3};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColor3};
|
||||
|
||||
&:hover {
|
||||
background-color: ${(props: any) => props.theme.backgroundColorHoverDim3};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColorHoverDim3};
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: ${(props: any) => props.theme.backgroundColorActive3};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColorActive3};
|
||||
}
|
||||
|
||||
${StyledIcon} {
|
||||
color: ${(props: any) => props.theme.color};
|
||||
color: ${(props: StyleProps) => props.theme.color};
|
||||
}
|
||||
|
||||
${StyledTitle} {
|
||||
color: ${(props: any) => props.theme.color};
|
||||
color: ${(props: StyleProps) => props.theme.color};
|
||||
opacity: 0.9;
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledButtonRecommended = styled(StyledButtonBase)`
|
||||
border: 1px solid ${(props: any) => props.theme.borderColor4};
|
||||
background-color: ${(props: any) => props.theme.warningBackgroundColor};
|
||||
border: 1px solid ${(props: StyleProps) => props.theme.borderColor4};
|
||||
background-color: ${(props: StyleProps) => props.theme.warningBackgroundColor};
|
||||
|
||||
${StyledIcon} {
|
||||
color: ${(props: any) => props.theme.color};
|
||||
color: ${(props: StyleProps) => props.theme.color};
|
||||
}
|
||||
|
||||
${StyledTitle} {
|
||||
color: ${(props: any) => props.theme.color};
|
||||
color: ${(props: StyleProps) => props.theme.color};
|
||||
opacity: 0.9;
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledButtonSidebarSecondary = styled(StyledButtonBase)`
|
||||
background: none;
|
||||
border-color: ${(props: any) => props.theme.color2};
|
||||
color: ${(props: any) => props.theme.color2};
|
||||
border-color: ${(props: StyleProps) => props.theme.color2};
|
||||
color: ${(props: StyleProps) => props.theme.color2};
|
||||
|
||||
&:hover {
|
||||
color: ${(props: any) => props.theme.colorHover2};
|
||||
border-color: ${(props: any) => props.theme.colorHover2};
|
||||
color: ${(props: StyleProps) => props.theme.colorHover2};
|
||||
border-color: ${(props: StyleProps) => props.theme.colorHover2};
|
||||
background: none;
|
||||
|
||||
${StyledTitle} {
|
||||
color: ${(props: any) => props.theme.colorHover2};
|
||||
color: ${(props: StyleProps) => props.theme.colorHover2};
|
||||
}
|
||||
|
||||
${StyledIcon} {
|
||||
color: ${(props: any) => props.theme.colorHover2};
|
||||
color: ${(props: StyleProps) => props.theme.colorHover2};
|
||||
}
|
||||
}
|
||||
|
||||
&:active {
|
||||
color: ${(props: any) => props.theme.colorActive2};
|
||||
border-color: ${(props: any) => props.theme.colorActive2};
|
||||
color: ${(props: StyleProps) => props.theme.colorActive2};
|
||||
border-color: ${(props: StyleProps) => props.theme.colorActive2};
|
||||
background: none;
|
||||
|
||||
${StyledTitle} {
|
||||
color: ${(props: any) => props.theme.colorActive2};
|
||||
color: ${(props: StyleProps) => props.theme.colorActive2};
|
||||
}
|
||||
|
||||
${StyledIcon} {
|
||||
color: ${(props: any) => props.theme.colorActive2};
|
||||
color: ${(props: StyleProps) => props.theme.colorActive2};
|
||||
}
|
||||
}
|
||||
|
||||
${StyledTitle} {
|
||||
color: ${(props: any) => props.theme.color2};
|
||||
color: ${(props: StyleProps) => props.theme.color2};
|
||||
}
|
||||
|
||||
${StyledIcon} {
|
||||
color: ${(props: any) => props.theme.color2};
|
||||
color: ${(props: StyleProps) => props.theme.color2};
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -207,6 +211,7 @@ function buttonClass(level: ButtonLevel) {
|
||||
return StyledButtonSecondary;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||
const Button = React.forwardRef((props: Props, ref: any) => {
|
||||
const iconOnly = props.iconName && !props.title;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
const React = require('react');
|
||||
import { CSSProperties } from 'react';
|
||||
const { connect } = require('react-redux');
|
||||
const { clipboard } = require('electron');
|
||||
import ExtensionBadge from './ExtensionBadge';
|
||||
@@ -46,7 +47,8 @@ class ClipperConfigScreenComponent extends React.Component {
|
||||
public render() {
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
|
||||
const containerStyle = { ...theme.containerStyle, overflowY: 'scroll',
|
||||
const containerStyle: CSSProperties = { ...theme.containerStyle,
|
||||
overflowY: 'scroll',
|
||||
// padding: theme.configScreenPadding,
|
||||
backgroundColor: theme.backgroundColor3 };
|
||||
|
||||
@@ -104,7 +106,8 @@ class ClipperConfigScreenComponent extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
const apiTokenStyle = { ...theme.textStyle, color: theme.colorFaded,
|
||||
const apiTokenStyle: CSSProperties = { ...theme.textStyle,
|
||||
color: theme.colorFaded,
|
||||
wordBreak: 'break-all',
|
||||
paddingTop: 10,
|
||||
paddingBottom: 10 };
|
||||
|
@@ -3,6 +3,9 @@ import Button, { ButtonLevel } from '../Button/Button';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
const styled = require('styled-components').default;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||
type StyleProps = any;
|
||||
|
||||
interface Props {
|
||||
backButtonTitle?: string;
|
||||
hasChanges?: boolean;
|
||||
@@ -18,11 +21,11 @@ export const StyledRoot = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
background-color: ${(props: any) => props.theme.backgroundColor3};
|
||||
padding-left: ${(props: any) => props.theme.configScreenPadding}px;
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColor3};
|
||||
padding-left: ${(props: StyleProps) => props.theme.configScreenPadding}px;
|
||||
border-top-width: 1px;
|
||||
border-top-style: solid;
|
||||
border-top-color: ${(props: any) => props.theme.dividerColor};
|
||||
border-top-color: ${(props: StyleProps) => props.theme.dividerColor};
|
||||
`;
|
||||
|
||||
export default function ButtonBar(props: Props) {
|
||||
|
@@ -21,14 +21,18 @@ import shouldShowMissingPasswordWarning from '@joplin/lib/components/shared/conf
|
||||
import MacOSMissingPasswordHelpLink from './controls/MissingPasswordHelpLink';
|
||||
const { KeymapConfigScreen } = require('../KeymapConfig/KeymapConfigScreen');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const settingKeyToControl: any = {
|
||||
'plugins.states': control_PluginsStates,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
class ConfigScreenComponent extends React.Component<any, any> {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private rowStyle_: any = null;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public constructor(props: any) {
|
||||
super(props);
|
||||
|
||||
@@ -138,12 +142,14 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
this.setState({ selectedSectionName: section.name, screenName: screenName });
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private sidebar_selectionChange(event: any) {
|
||||
void this.switchSection(event.section.name);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public renderSectionDescription(section: any) {
|
||||
const description = Setting.sectionDescription(section.name);
|
||||
const description = Setting.sectionDescription(section.name, AppType.Desktop);
|
||||
if (!description) return null;
|
||||
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
@@ -154,6 +160,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public sectionToComponent(key: string, section: any, settings: any, selected: boolean) {
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
|
||||
@@ -172,10 +179,12 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
const settingComps = createSettingComponents(false);
|
||||
const advancedSettingComps = createSettingComponents(true);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const sectionWidths: Record<string, any> = {
|
||||
plugins: '100%',
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const sectionStyle: any = {
|
||||
marginTop: 20,
|
||||
marginBottom: 20,
|
||||
@@ -281,6 +290,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private renderHeader(themeId: number, label: string, style: any = null) {
|
||||
const theme = themeStyle(themeId);
|
||||
|
||||
@@ -302,9 +312,11 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
return description ? <div style={this.descriptionStyle(themeId)}>{description}</div> : null;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public settingToComponent(key: string, value: any) {
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const output: any = null;
|
||||
|
||||
const rowStyle = {
|
||||
@@ -339,6 +351,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
paddingTop: 4,
|
||||
paddingBottom: 4 };
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const updateSettingValue = (key: string, value: any) => {
|
||||
const md = Setting.settingMetadata(key);
|
||||
if (md.needRestart) {
|
||||
@@ -363,6 +376,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
metadata={md}
|
||||
value={value}
|
||||
themeId={this.props.themeId}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onChange={(event: any) => {
|
||||
updateSettingValue(key, event.value);
|
||||
}}
|
||||
@@ -404,6 +418,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
<select
|
||||
value={value}
|
||||
style={selectStyle}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onChange={(event: any) => {
|
||||
updateSettingValue(key, event.target.value);
|
||||
}}
|
||||
@@ -449,6 +464,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
</div>
|
||||
);
|
||||
} else if (md.type === Setting.TYPE_STRING) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const inputStyle: any = { ...textInputBaseStyle, width: '50%',
|
||||
minWidth: '20em' };
|
||||
const inputType = md.secure === true ? 'password' : 'text';
|
||||
@@ -476,6 +492,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
return cmdString;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const onPathChange = (event: any) => {
|
||||
if (md.subType === 'file_path_and_args') {
|
||||
const cmd = splitCmd(this.state.settings[key]);
|
||||
@@ -486,6 +503,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const onArgsChange = (event: any) => {
|
||||
const cmd = splitCmd(this.state.settings[key]);
|
||||
cmd[1] = event.target.value;
|
||||
@@ -522,6 +540,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
<input
|
||||
type={inputType}
|
||||
style={inputStyle}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onChange={(event: any) => {
|
||||
onArgsChange(event);
|
||||
}}
|
||||
@@ -547,6 +566,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
<input
|
||||
type={inputType}
|
||||
style={{ ...inputStyle, marginBottom: 0, marginRight: 5 }}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onChange={(event: any) => {
|
||||
onPathChange(event);
|
||||
}}
|
||||
@@ -567,6 +587,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const onTextChange = (event: any) => {
|
||||
updateSettingValue(key, event.target.value);
|
||||
};
|
||||
@@ -580,6 +601,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
type={inputType}
|
||||
style={inputStyle}
|
||||
value={this.state.settings[key]}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onChange={(event: any) => {
|
||||
onTextChange(event);
|
||||
}}
|
||||
@@ -592,6 +614,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
);
|
||||
}
|
||||
} else if (md.type === Setting.TYPE_INT) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const onNumChange = (event: any) => {
|
||||
updateSettingValue(key, event.target.value);
|
||||
};
|
||||
@@ -599,6 +622,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
const label = [md.label()];
|
||||
if (md.unitLabel) label.push(`(${md.unitLabel()})`);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const inputStyle: any = { ...textInputBaseStyle };
|
||||
|
||||
return (
|
||||
@@ -610,6 +634,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
type="number"
|
||||
style={inputStyle}
|
||||
value={this.state.settings[key]}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onChange={(event: any) => {
|
||||
onNumChange(event);
|
||||
}}
|
||||
@@ -717,6 +742,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
|
||||
const sections = shared.settingsSections({ device: AppType.Desktop, settings });
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const needRestartComp: any = this.state.needRestart ? (
|
||||
<div style={{ ...theme.textStyle, padding: 10, paddingLeft: 24, backgroundColor: theme.warningBackgroundColor, color: theme.color }}>
|
||||
{this.restartMessage()}
|
||||
@@ -751,6 +777,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const mapStateToProps = (state: any) => {
|
||||
return {
|
||||
themeId: state.settings.theme,
|
||||
|
@@ -4,16 +4,20 @@ import Setting from '@joplin/lib/models/Setting';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
const styled = require('styled-components').default;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||
type StyleProps = any;
|
||||
|
||||
interface Props {
|
||||
selection: string;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
onSelectionChange: Function;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||
sections: any[];
|
||||
}
|
||||
|
||||
export const StyledRoot = styled.div`
|
||||
display: flex;
|
||||
background-color: ${(props: any) => props.theme.backgroundColor2};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColor2};
|
||||
flex-direction: column;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
@@ -23,16 +27,16 @@ export const StyledListItem = styled.a`
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: ${(props: any) => props.theme.mainPadding}px;
|
||||
background: ${(props: any) => props.selected ? props.theme.selectedColor2 : 'none'};
|
||||
padding: ${(props: StyleProps) => props.theme.mainPadding}px;
|
||||
background: ${(props: StyleProps) => props.selected ? props.theme.selectedColor2 : 'none'};
|
||||
transition: 0.1s;
|
||||
text-decoration: none;
|
||||
cursor: default;
|
||||
opacity: ${(props: any) => props.selected ? 1 : 0.8};
|
||||
padding-left: ${(props: any) => props.isSubSection ? '35' : props.theme.mainPadding}px;
|
||||
opacity: ${(props: StyleProps) => props.selected ? 1 : 0.8};
|
||||
padding-left: ${(props: StyleProps) => props.isSubSection ? '35' : props.theme.mainPadding}px;
|
||||
|
||||
&:hover {
|
||||
background-color: ${(props: any) => props.theme.backgroundColorHover2};
|
||||
background-color: ${(props: StyleProps) => props.theme.backgroundColorHover2};
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -40,21 +44,21 @@ export const StyledDivider = styled.div`
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
color: ${(props: any) => props.theme.color2};
|
||||
padding: ${(props: any) => props.theme.mainPadding}px;
|
||||
padding-top: ${(props: any) => props.theme.mainPadding * .8}px;
|
||||
padding-bottom: ${(props: any) => props.theme.mainPadding * .8}px;
|
||||
border-top: 1px solid ${(props: any) => props.theme.dividerColor};
|
||||
border-bottom: 1px solid ${(props: any) => props.theme.dividerColor};
|
||||
background-color: ${(props: any) => props.theme.selectedColor2};
|
||||
font-size: ${(props: any) => Math.round(props.theme.fontSize)}px;
|
||||
color: ${(props: StyleProps) => props.theme.color2};
|
||||
padding: ${(props: StyleProps) => props.theme.mainPadding}px;
|
||||
padding-top: ${(props: StyleProps) => props.theme.mainPadding * .8}px;
|
||||
padding-bottom: ${(props: StyleProps) => props.theme.mainPadding * .8}px;
|
||||
border-top: 1px solid ${(props: StyleProps) => props.theme.dividerColor};
|
||||
border-bottom: 1px solid ${(props: StyleProps) => props.theme.dividerColor};
|
||||
background-color: ${(props: StyleProps) => props.theme.selectedColor2};
|
||||
font-size: ${(props: StyleProps) => Math.round(props.theme.fontSize)}px;
|
||||
opacity: 0.5;
|
||||
`;
|
||||
|
||||
export const StyledListItemLabel = styled.span`
|
||||
font-size: ${(props: any) => Math.round(props.theme.fontSize * 1.2)}px;
|
||||
font-size: ${(props: StyleProps) => Math.round(props.theme.fontSize * 1.2)}px;
|
||||
font-weight: 500;
|
||||
color: ${(props: any) => props.theme.color2};
|
||||
color: ${(props: StyleProps) => props.theme.color2};
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
@@ -63,14 +67,16 @@ export const StyledListItemLabel = styled.span`
|
||||
`;
|
||||
|
||||
export const StyledListItemIcon = styled.i`
|
||||
font-size: ${(props: any) => Math.round(props.theme.fontSize * 1.4)}px;
|
||||
color: ${(props: any) => props.theme.color2};
|
||||
margin-right: ${(props: any) => props.theme.mainPadding / 1.5}px;
|
||||
font-size: ${(props: StyleProps) => Math.round(props.theme.fontSize * 1.4)}px;
|
||||
color: ${(props: StyleProps) => props.theme.color2};
|
||||
margin-right: ${(props: StyleProps) => props.theme.mainPadding / 1.5}px;
|
||||
`;
|
||||
|
||||
export default function Sidebar(props: Props) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||
const buttons: any[] = [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||
function renderButton(section: any) {
|
||||
const selected = props.selection === section.name;
|
||||
return (
|
||||
|
@@ -3,9 +3,10 @@ import * as React from 'react';
|
||||
import shim from '@joplin/lib/shim';
|
||||
import bridge from '../../../services/bridge';
|
||||
import StyledLink from '../../style/StyledLink';
|
||||
import { ThemeStyle } from '@joplin/lib/theme';
|
||||
|
||||
interface Props {
|
||||
theme: any;
|
||||
theme: ThemeStyle;
|
||||
text: string;
|
||||
}
|
||||
|
||||
@@ -18,7 +19,7 @@ const MacOSMissingPasswordHelpLink: React.FunctionComponent<Props> = props => {
|
||||
const macInfoLink = (
|
||||
<StyledLink href="#"
|
||||
onClick={openMissingPasswordFAQ}
|
||||
style={props.theme.linkStyle}
|
||||
style={props.theme.urlStyle}
|
||||
>
|
||||
{props.text}
|
||||
</StyledLink>
|
||||
|
@@ -7,6 +7,7 @@ import Button, { ButtonLevel } from '../../../Button/Button';
|
||||
import { PluginManifest } from '@joplin/lib/services/plugins/utils/types';
|
||||
import bridge from '../../../../services/bridge';
|
||||
import { ItemEvent, PluginItem } from '@joplin/lib/components/shared/config/plugins/types';
|
||||
import PluginService from '@joplin/lib/services/plugins/PluginService';
|
||||
|
||||
export enum InstallState {
|
||||
NotInstalled = 1,
|
||||
@@ -97,6 +98,7 @@ const BoxedLabel = styled.div`
|
||||
margin-top: auto;
|
||||
`;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const StyledNameAndVersion = styled.div<{ mb: any }>`
|
||||
font-family: ${props => props.theme.fontFamily};
|
||||
color: ${props => props.theme.color};
|
||||
@@ -230,7 +232,7 @@ export default function(props: Props) {
|
||||
return (
|
||||
<CellFooter>
|
||||
<NeedUpgradeMessage>
|
||||
{_('Please upgrade Joplin to use this plugin')}
|
||||
{PluginService.instance().describeIncompatibility(props.manifest)}
|
||||
</NeedUpgradeMessage>
|
||||
</CellFooter>
|
||||
);
|
||||
|
@@ -10,8 +10,8 @@ import bridge from '../../../../services/bridge';
|
||||
import produce from 'immer';
|
||||
import { OnChangeEvent } from '../../../lib/SearchInput/SearchInput';
|
||||
import { PluginItem, ItemEvent, OnPluginSettingChangeEvent } from '@joplin/lib/components/shared/config/plugins/types';
|
||||
import RepositoryApi from '@joplin/lib/services/plugins/RepositoryApi';
|
||||
import Setting from '@joplin/lib/models/Setting';
|
||||
import RepositoryApi, { InstallMode } from '@joplin/lib/services/plugins/RepositoryApi';
|
||||
import Setting, { AppType } from '@joplin/lib/models/Setting';
|
||||
import useOnInstallHandler from '@joplin/lib/components/shared/config/plugins/useOnInstallHandler';
|
||||
import useOnDeleteHandler from '@joplin/lib/components/shared/config/plugins/useOnDeleteHandler';
|
||||
import Logger from '@joplin/utils/Logger';
|
||||
@@ -28,6 +28,7 @@ const Root = styled.div`
|
||||
flex-direction: column;
|
||||
`;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const UserPluginsRoot = styled.div<any>`
|
||||
${space}
|
||||
display: flex;
|
||||
@@ -38,12 +39,14 @@ const ToolsButton = styled(Button)`
|
||||
margin-right: 6px;
|
||||
`;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const RepoApiErrorMessage = styled(StyledMessage)<any>`
|
||||
max-width: ${props => props.maxWidth}px;
|
||||
margin-bottom: 10px;
|
||||
`;
|
||||
|
||||
interface Props {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
value: any;
|
||||
themeId: number;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
@@ -60,7 +63,8 @@ let repoApi_: RepositoryApi = null;
|
||||
|
||||
function repoApi(): RepositoryApi {
|
||||
if (repoApi_) return repoApi_;
|
||||
repoApi_ = RepositoryApi.ofDefaultJoplinRepo(Setting.value('tempDir'));
|
||||
const appInfo = { type: AppType.Desktop, version: PluginService.instance().appVersion };
|
||||
repoApi_ = RepositoryApi.ofDefaultJoplinRepo(Setting.value('tempDir'), appInfo, InstallMode.Default);
|
||||
// repoApi_ = new RepositoryApi('/Users/laurent/src/joplin-plugins-test', Setting.value('tempDir'));
|
||||
return repoApi_;
|
||||
}
|
||||
@@ -154,7 +158,7 @@ export default function(props: Props) {
|
||||
.filter(plugin => !plugin.builtIn)
|
||||
.map(p => p.manifest);
|
||||
|
||||
const pluginIds = await repoApi().canBeUpdatedPlugins(nonDefaultPlugins, pluginService.appVersion);
|
||||
const pluginIds = await repoApi().canBeUpdatedPlugins(nonDefaultPlugins);
|
||||
if (cancelled) return;
|
||||
|
||||
const conv: Record<string, boolean> = {};
|
||||
@@ -232,6 +236,7 @@ export default function(props: Props) {
|
||||
setSearchQuery(event.value);
|
||||
}, []);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const onSearchPluginSettingsChange = useCallback((event: any) => {
|
||||
props.onChange({ value: pluginService.serializePluginSettings(event.value) });
|
||||
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
||||
@@ -256,7 +261,7 @@ export default function(props: Props) {
|
||||
item={item}
|
||||
themeId={props.themeId}
|
||||
updateState={updateState}
|
||||
isCompatible={PluginService.instance().isCompatible(item.manifest.app_min_version)}
|
||||
isCompatible={PluginService.instance().isCompatible(item.manifest)}
|
||||
onDelete={onDelete}
|
||||
onToggle={onToggle}
|
||||
onUpdate={onUpdateHandler}
|
||||
|
@@ -24,6 +24,7 @@ interface Props {
|
||||
searchQuery: string;
|
||||
onSearchQueryChange(event: OnChangeEvent): void;
|
||||
pluginSettings: PluginSettings;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onPluginSettingsChange(event: any): void;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
renderDescription: Function;
|
||||
@@ -86,7 +87,7 @@ export default function(props: Props) {
|
||||
key={manifest.id}
|
||||
manifest={manifest}
|
||||
themeId={props.themeId}
|
||||
isCompatible={PluginService.instance().isCompatible(manifest.app_min_version)}
|
||||
isCompatible={PluginService.instance().isCompatible(manifest)}
|
||||
onInstall={onInstall}
|
||||
installState={installState(manifest.id)}
|
||||
/>);
|
||||
|
@@ -23,6 +23,7 @@ interface Props {
|
||||
cancelButtonDisabled?: boolean;
|
||||
okButtonShow?: boolean;
|
||||
okButtonLabel?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
okButtonRef?: any;
|
||||
okButtonDisabled?: boolean;
|
||||
customButtons?: ButtonSpec[];
|
||||
|
@@ -29,6 +29,7 @@ export default (props: Props) => {
|
||||
return ln && globalKeydownHandlersRef.current[ln - 1] === elementId;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const isInSubModal = (targetElement: any) => {
|
||||
// If we are inside a sub-modal within the dialog, we shouldn't handle
|
||||
// global key events. It can be for example the emoji picker. In general
|
||||
@@ -39,6 +40,7 @@ export default (props: Props) => {
|
||||
return false;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const onKeyDown = useCallback((event: any) => {
|
||||
// Early exit if it's neither ENTER nor ESCAPE, because isInSubModal
|
||||
// function can be costly.
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import styled from 'styled-components';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const Root = styled.div<any>`
|
||||
display: flex;
|
||||
justify-content: ${props => props.justifyContent ? props.justifyContent : 'center'};
|
||||
|
@@ -11,8 +11,10 @@ interface Props {
|
||||
themeId: string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
class DropboxLoginScreenComponent extends React.Component<any, any> {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private shared_: any;
|
||||
|
||||
public constructor(props: Props) {
|
||||
@@ -61,6 +63,7 @@ class DropboxLoginScreenComponent extends React.Component<any, any> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const mapStateToProps = (state: any) => {
|
||||
return {
|
||||
themeId: state.settings.theme,
|
||||
|
@@ -31,6 +31,7 @@ export const Dropdown = (props: Props) => {
|
||||
return optionComps;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const onChange = useCallback((event: any) => {
|
||||
props.onChange({ value: event.target.value });
|
||||
}, [props.onChange]);
|
||||
|
@@ -13,6 +13,7 @@ import Button from '../Button/Button';
|
||||
import bridge from '../../services/bridge';
|
||||
import shim from '@joplin/lib/shim';
|
||||
import FolderIconBox from '../FolderIconBox';
|
||||
import { focus } from '@joplin/lib/utils/focusHandler';
|
||||
|
||||
interface Props {
|
||||
themeId: number;
|
||||
@@ -46,7 +47,7 @@ export default function(props: Props) {
|
||||
}, [props.dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
titleInputRef.current.focus();
|
||||
focus('Dialog::titleInputRef', titleInputRef.current);
|
||||
|
||||
setTimeout(() => {
|
||||
titleInputRef.current.select();
|
||||
@@ -85,6 +86,7 @@ export default function(props: Props) {
|
||||
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
||||
}, [onClose, folderTitle, folderIcon, props.folderId, props.parentId]);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const onFolderTitleChange = useCallback((event: any) => {
|
||||
setFolderTitle(event.target.value);
|
||||
}, []);
|
||||
|
@@ -58,6 +58,7 @@ export const IconSelector = (props: Props) => {
|
||||
useEffect(() => {
|
||||
if (!emojiButtonClassReady) return () => {};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const p: EmojiButton = new (window as any).EmojiButton({
|
||||
zIndex: 10000,
|
||||
});
|
||||
|
@@ -20,6 +20,7 @@ import ToggleAdvancedSettingsButton from '../ConfigScreen/controls/ToggleAdvance
|
||||
import MacOSMissingPasswordHelpLink from '../ConfigScreen/controls/MissingPasswordHelpLink';
|
||||
|
||||
interface Props {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
themeId: any;
|
||||
masterKeys: MasterKeyEntity[];
|
||||
passwords: Record<string, string>;
|
||||
@@ -34,7 +35,7 @@ interface Props {
|
||||
const EncryptionConfigScreen = (props: Props) => {
|
||||
const { inputPasswords, onInputPasswordChange } = useInputPasswords(props.passwords);
|
||||
|
||||
const theme: any = useMemo(() => {
|
||||
const theme = useMemo(() => {
|
||||
return themeStyle(props.themeId);
|
||||
}, [props.themeId]);
|
||||
|
||||
@@ -157,6 +158,7 @@ const EncryptionConfigScreen = (props: Props) => {
|
||||
}
|
||||
|
||||
const headerComp = isEnabledMasterKeys ? <h2>{_('Encryption keys')}</h2> : <a onClick={() => toggleShowDisabledMasterKeys() } style={{ ...theme.urlStyle, display: 'inline-block', marginBottom: 10 }} href="#">{showTable ? _('Hide disabled keys') : _('Show disabled keys')}</a>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const infoComp: any = null; // isEnabledMasterKeys ? <p>{'Note: Only one key is going to be used for encryption (the one marked as "active"). Any of the keys might be used for decryption, depending on how the notes or notebooks were originally encrypted.'}</p> : null;
|
||||
const tableComp = !showTable ? null : (
|
||||
<table>
|
||||
|
@@ -26,6 +26,7 @@ interface State {
|
||||
|
||||
interface Props {
|
||||
message?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
children: any;
|
||||
}
|
||||
|
||||
@@ -33,6 +34,7 @@ export default class ErrorBoundary extends React.Component<Props, State> {
|
||||
|
||||
public state: State = { error: null, errorInfo: null, pluginInfos: [], plugins: {} };
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public componentDidCatch(error: any, errorInfo: ErrorInfo) {
|
||||
if (typeof error === 'string') error = { message: error };
|
||||
|
||||
|
@@ -1,21 +1,23 @@
|
||||
import * as React from 'react';
|
||||
import bridge from '../services/bridge';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
import { themeStyle } from '@joplin/lib/theme';
|
||||
import { ThemeStyle, themeStyle } from '@joplin/lib/theme';
|
||||
const { createSelector } = require('reselect');
|
||||
|
||||
interface Props {
|
||||
themeId: number;
|
||||
type: string;
|
||||
url: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
style?: any;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const themeSelector = (_state: any, props: any) => themeStyle(props.themeId);
|
||||
|
||||
const styleSelector = createSelector(
|
||||
themeSelector,
|
||||
(theme: any) => {
|
||||
(theme: ThemeStyle) => {
|
||||
const output = {
|
||||
root: {
|
||||
width: 220,
|
||||
|
@@ -8,6 +8,7 @@ interface Props {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
onClick: Function;
|
||||
themeId: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
style: any;
|
||||
}
|
||||
|
||||
@@ -26,6 +27,7 @@ class HelpButtonComponent extends React.Component<Props> {
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
const style = { ...this.props.style, color: theme.color, textDecoration: 'none' };
|
||||
const helpIconStyle = { flex: 0, width: 16, height: 16, marginLeft: 10 };
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const extraProps: any = {};
|
||||
if (this.props.tip) extraProps['data-tip'] = this.props.tip;
|
||||
return (
|
||||
|
@@ -3,6 +3,7 @@ import { themeStyle } from '@joplin/lib/theme';
|
||||
|
||||
interface Props {
|
||||
themeId: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
style: any;
|
||||
iconName: string;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
|
@@ -83,6 +83,7 @@ class ImportScreenComponent extends React.Component<Props, State> {
|
||||
let lastProgress = '';
|
||||
|
||||
const options = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onProgress: (progressState: any) => {
|
||||
const line = [];
|
||||
line.push(_('Found: %d.', progressState.loaded));
|
||||
@@ -94,6 +95,7 @@ class ImportScreenComponent extends React.Component<Props, State> {
|
||||
lastProgress = line.join(' ');
|
||||
this.addMessage('progress', lastProgress);
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onError: (error: any) => {
|
||||
// Don't display the error directly because most of the time it doesn't matter
|
||||
// (eg. for weird broken HTML, but the note is still imported)
|
||||
|
@@ -1,8 +1,10 @@
|
||||
import * as React from 'react';
|
||||
|
||||
interface Props {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
style: any;
|
||||
itemHeight: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
items: any[];
|
||||
disabled?: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
@@ -22,6 +24,7 @@ interface State {
|
||||
class ItemList extends React.Component<Props, State> {
|
||||
|
||||
private scrollTop_: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private listRef: any;
|
||||
|
||||
public constructor(props: Props) {
|
||||
@@ -72,15 +75,18 @@ class ItemList extends React.Component<Props, State> {
|
||||
this.updateStateItemIndexes(newProps);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public onScroll(event: any) {
|
||||
this.scrollTop_ = event.target.scrollTop;
|
||||
this.updateStateItemIndexes();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public onKeyDown(event: any) {
|
||||
if (this.props.onKeyDown) this.props.onKeyDown(event);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public onDrop(event: any) {
|
||||
if (this.props.onNoteDrop) this.props.onNoteDrop(event);
|
||||
}
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import { ThemeStyle } from '@joplin/lib/theme';
|
||||
|
||||
const { buildStyle } = require('@joplin/lib/theme');
|
||||
|
||||
export default function styles(themeId: number) {
|
||||
return buildStyle('KeymapConfigScreen', themeId, (theme: any) => {
|
||||
return buildStyle('KeymapConfigScreen', themeId, (theme: ThemeStyle) => {
|
||||
return {
|
||||
container: {
|
||||
...theme.containerStyle,
|
||||
|
@@ -26,7 +26,7 @@ import shim from '@joplin/lib/shim';
|
||||
import bridge from '../../services/bridge';
|
||||
import time from '@joplin/lib/time';
|
||||
import styled from 'styled-components';
|
||||
import { themeStyle } from '@joplin/lib/theme';
|
||||
import { themeStyle, ThemeStyle } from '@joplin/lib/theme';
|
||||
import validateLayout from '../ResizableLayout/utils/validateLayout';
|
||||
import iterateItems from '../ResizableLayout/utils/iterateItems';
|
||||
import removeItem from '../ResizableLayout/utils/removeItem';
|
||||
@@ -40,7 +40,7 @@ import ElectronAppWrapper from '../../ElectronAppWrapper';
|
||||
import { showMissingMasterKeyMessage } from '@joplin/lib/services/e2ee/utils';
|
||||
import { MasterKeyEntity } from '@joplin/lib/services/e2ee/types';
|
||||
import commands from './commands/index';
|
||||
import invitationRespond from '../../services/share/invitationRespond';
|
||||
import invitationRespond from '@joplin/lib/services/share/invitationRespond';
|
||||
import restart from '../../services/restart';
|
||||
const { connect } = require('react-redux');
|
||||
import PromptDialog from '../PromptDialog';
|
||||
@@ -65,8 +65,10 @@ interface Props {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
dispatch: Function;
|
||||
mainLayout: LayoutItem;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
style: any;
|
||||
layoutMoveMode: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
editorNoteStatuses: any;
|
||||
customCss: string;
|
||||
shouldUpgradeSyncTarget: boolean;
|
||||
@@ -78,6 +80,7 @@ interface Props {
|
||||
showShouldReencryptMessage: boolean;
|
||||
themeId: number;
|
||||
settingEditorCodeView: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
pluginsLegacy: any;
|
||||
startupPluginsLoaded: boolean;
|
||||
shareInvitations: ShareInvitation[];
|
||||
@@ -102,10 +105,14 @@ interface ShareFolderDialogOptions {
|
||||
}
|
||||
|
||||
interface State {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
promptOptions: any;
|
||||
modalLayer: LayerModalState;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
notePropertiesDialogOptions: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
noteContentPropertiesDialogOptions: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
shareNoteDialogOptions: any;
|
||||
shareFolderDialogOptions: ShareFolderDialogOptions;
|
||||
}
|
||||
@@ -132,9 +139,11 @@ const defaultLayout: LayoutItem = {
|
||||
|
||||
class MainScreenComponent extends React.Component<Props, State> {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private waitForNotesSavedIID_: any;
|
||||
private isPrinting_: boolean;
|
||||
private styleKey_: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private styles_: any;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
private promptOnClose_: Function;
|
||||
@@ -176,6 +185,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
|
||||
window.addEventListener('resize', this.window_resize);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
ipcRenderer.on('asynchronous-message', (_event: any, message: string, args: any) => {
|
||||
if (message === 'openCallbackUrl') {
|
||||
this.openCallbackUrl(args.url);
|
||||
@@ -330,6 +340,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
public updateRootLayoutSize() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
this.updateMainLayout(produce(this.props.mainLayout, (draft: any) => {
|
||||
const s = this.rootLayoutSize();
|
||||
draft.width = s.width;
|
||||
@@ -400,6 +411,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public layoutModeListenerKeyDown(event: any) {
|
||||
if (event.key !== 'Escape') return;
|
||||
if (!this.props.layoutMoveMode) return;
|
||||
@@ -425,6 +437,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public async printTo_(target: string, options: any) {
|
||||
// Concurrent print calls are disallowed to avoid incorrect settings being restored upon completion
|
||||
if (this.isPrinting_) {
|
||||
@@ -533,6 +546,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
private renderNotificationMessage(message: string, callForAction: string = null, callForActionHandler: Function = null, callForAction2: string = null, callForActionHandler2: Function = null) {
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const urlStyle: any = { color: theme.colorWarnUrl, textDecoration: 'underline' };
|
||||
|
||||
if (!callForAction) return <span>{message}</span>;
|
||||
@@ -557,7 +571,8 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
);
|
||||
}
|
||||
|
||||
public renderNotification(theme: any, styles: any) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public renderNotification(theme: ThemeStyle, styles: any) {
|
||||
if (!this.messageBoxVisible()) return null;
|
||||
|
||||
const onViewStatusScreen = () => {
|
||||
@@ -705,6 +720,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private resizableLayout_resize(event: any) {
|
||||
this.updateMainLayout(event.layout);
|
||||
}
|
||||
@@ -714,6 +730,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
this.updateMainLayout(newLayout);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private resizableLayout_renderItem(key: string, event: any) {
|
||||
// Key should never be undefined but somehow it can happen, also not
|
||||
// clear how. For now in this case render nothing so that the app
|
||||
@@ -728,6 +745,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
|
||||
// const viewsToRemove:string[] = [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const components: any = {
|
||||
sideBar: () => {
|
||||
return <Sidebar key={key} />;
|
||||
@@ -854,6 +872,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
const styles = this.styles(this.props.themeId, style.width, style.height, this.messageBoxVisible());
|
||||
|
||||
if (!this.promptOnClose_) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
this.promptOnClose_ = (answer: any, buttonType: any) => {
|
||||
return this.state.promptOptions.onClose(answer, buttonType);
|
||||
};
|
||||
@@ -898,6 +917,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
lastDeletion={this.props.lastDeletion}
|
||||
lastDeletionNotificationTime={this.props.lastDeletionNotificationTime}
|
||||
themeId={this.props.themeId}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
dispatch={this.props.dispatch as any}
|
||||
/>
|
||||
{messageComp}
|
||||
|
@@ -9,6 +9,7 @@ export const declaration: CommandDeclaration = {
|
||||
label: () => _('Create new profile...'),
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
export const runtime = (comp: any): CommandRuntime => {
|
||||
return {
|
||||
execute: async (context: CommandContext) => {
|
||||
|
@@ -12,6 +12,7 @@ export const declaration: CommandDeclaration = {
|
||||
iconName: 'icon-alarm',
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
export const runtime = (comp: any): CommandRuntime => {
|
||||
return {
|
||||
execute: async (context: CommandContext, noteId: string = null) => {
|
||||
@@ -29,6 +30,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
||||
inputType: 'datetime',
|
||||
buttons: ['ok', 'cancel', 'clear'],
|
||||
value: note.todo_due ? new Date(note.todo_due) : defaultDate,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
onClose: async (answer: any, buttonType: string) => {
|
||||
let newNote: NoteEntity = null;
|
||||
|
||||
@@ -57,6 +59,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
||||
|
||||
enabledCondition: 'oneNoteSelected && noteIsTodo && !noteTodoCompleted',
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
mapStateToTitle: (state: any) => {
|
||||
const note = stateUtils.selectedNote(state);
|
||||
return note && note.todo_due ? time.formatMsToLocal(note.todo_due) : null;
|
||||
|
@@ -10,6 +10,7 @@ export const declaration: CommandDeclaration = {
|
||||
label: () => `PDF - ${_('PDF File')}`,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
export const runtime = (comp: any): CommandRuntime => {
|
||||
return {
|
||||
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user