Compare commits
308 Commits
v3.0.3
...
android-v3
Author | SHA1 | Date | |
---|---|---|---|
|
636fbdf7d0 | ||
|
ee97434bb0 | ||
|
599cf5b86f | ||
|
2fd6a3a2fa | ||
|
a3e04103de | ||
|
320d0df60d | ||
|
f32fe63205 | ||
|
3e0fb48e44 | ||
|
4a475f1b53 | ||
|
8679cc5704 | ||
|
a48c4ba93f | ||
|
16e82b5462 | ||
|
1a82255865 | ||
|
a64d6e3270 | ||
|
ae1620dd50 | ||
|
d804e95d06 | ||
|
78d9a7e636 | ||
|
3270122419 | ||
|
e4b8976aa0 | ||
|
17e1eecb11 | ||
|
dd9a389711 | ||
|
55eaedb8b2 | ||
|
f8d772de87 | ||
|
77c39ac084 | ||
|
3557138c84 | ||
|
77e74112ad | ||
|
4115e2054f | ||
|
8485277dcf | ||
|
fac9ea3b42 | ||
|
45f8e27d6a | ||
|
c8a478d970 | ||
|
75dfb0af5f | ||
|
5e592a3096 | ||
|
84e46ad874 | ||
|
0ec917bb96 | ||
|
818f9f58d1 | ||
|
e1abe0b4cb | ||
|
c972ce223e | ||
|
d9dadf28cb | ||
|
1fb392ff4e | ||
|
affa620983 | ||
|
ed31d8202b | ||
|
573ea6051c | ||
|
f1ec54532f | ||
|
5eb96d71e1 | ||
|
73251bac4a | ||
|
f40a0da195 | ||
|
8dc1ab2cc5 | ||
|
1b46c9f5e7 | ||
|
483ab55a36 | ||
|
502002f9f6 | ||
|
8d8014511f | ||
|
28569e652e | ||
|
9acf36d802 | ||
|
06d26767ed | ||
|
88858d4413 | ||
|
27309427a1 | ||
|
e83a18a907 | ||
|
9bd8b11f67 | ||
|
3a14c7ce2d | ||
|
fe4c9a2401 | ||
|
d2fb19cf6d | ||
|
1f8e3fb620 | ||
|
8bbe1d30b4 | ||
|
ec92f716de | ||
|
ab819d9210 | ||
|
e465b45d6e | ||
|
a4a4170d49 | ||
|
1dcf528443 | ||
|
8cf4ef88b5 | ||
|
bf634270be | ||
|
56437d3e1b | ||
|
d095ab2be7 | ||
|
4751b4dd74 | ||
|
ce22d8238c | ||
|
9e2b9e5b8d | ||
|
4952980e0a | ||
|
59989d2735 | ||
|
eb7f2855b0 | ||
|
a0e3e4fefb | ||
|
de9661448b | ||
|
562aabafa1 | ||
|
a659e45a68 | ||
|
8e44a15c8d | ||
|
a086358824 | ||
|
889c395818 | ||
|
7d0cc675aa | ||
|
73d3f92ae2 | ||
|
f5ceb4064c | ||
|
53d7bc86ca | ||
|
4495fc9a03 | ||
|
7ee5cad21e | ||
|
940739ce12 | ||
|
5730c1efcd | ||
|
b17f28ce94 | ||
|
629e968878 | ||
|
47a924ff4e | ||
|
c511fb59c7 | ||
|
80aeff6ecd | ||
|
97d15bb26a | ||
|
99b36cbff1 | ||
|
74c3d2c9fb | ||
|
df8c7fd31c | ||
|
3a780b9490 | ||
|
97ddb67f68 | ||
|
f50a27985b | ||
|
061a9d5bff | ||
|
06f42e8246 | ||
|
19f0b667b1 | ||
|
ac7165461a | ||
|
efb48e6145 | ||
|
f94c16b22e | ||
|
0938dc9d52 | ||
|
e049698012 | ||
|
c9fb06fd0c | ||
|
96850b7b98 | ||
|
32710e44c3 | ||
|
32e16f6e51 | ||
|
f938d5f489 | ||
|
99b840da34 | ||
|
55c222c577 | ||
|
418a6e455f | ||
|
789d19b18c | ||
|
59b26f2c63 | ||
|
f1eeeabdc5 | ||
|
d2a33b006b | ||
|
2386f583e8 | ||
|
70c5448402 | ||
|
4e3326b12f | ||
|
34092d8491 | ||
|
b8caf08fac | ||
|
b0d0e641ea | ||
|
3a1de4e941 | ||
|
97274c95a5 | ||
|
300d0e3ca5 | ||
|
50d08cd178 | ||
|
28f3d53b3b | ||
|
768e59938c | ||
|
6c7948a087 | ||
|
cc2b442519 | ||
|
fa285a9404 | ||
|
84faa7229d | ||
|
254747ee78 | ||
|
ef167051d6 | ||
|
1ccbdc2341 | ||
|
14747b79cd | ||
|
111385f1ef | ||
|
f36d395a84 | ||
|
5d997084f7 | ||
|
132548181f | ||
|
452c71e8cb | ||
|
f7ac95f850 | ||
|
33286efe9a | ||
|
f21a93febe | ||
|
f817c47dc0 | ||
|
9ccca16df7 | ||
|
114f5695b7 | ||
|
916fa39012 | ||
|
db77a51129 | ||
|
b09d6e8568 | ||
|
3bf9438a59 | ||
|
554894e910 | ||
|
51f1e0202f | ||
|
8b7758442b | ||
|
63bf7694f0 | ||
|
df3aaa7dfd | ||
|
826006ce8b | ||
|
1e085ee619 | ||
|
efb753e229 | ||
|
faf332a0e8 | ||
|
83308337b5 | ||
|
73193df120 | ||
|
2dd27cdd00 | ||
|
c5e3672e9e | ||
|
366517999f | ||
|
8445ffaa86 | ||
|
2a76970461 | ||
|
9fcaf5bd18 | ||
|
652add9af2 | ||
|
c632ea5c48 | ||
|
7ee5f68770 | ||
|
1040675781 | ||
|
24a37e0fef | ||
|
bfe2d262a5 | ||
|
8faf5148a6 | ||
|
27c5dd1852 | ||
|
fae51b90a7 | ||
|
ccd181851c | ||
|
cd0ff94c0c | ||
|
e9e6d8a69c | ||
|
7ad3b34ec3 | ||
|
f39021d373 | ||
|
13116fec76 | ||
|
d49b2ec0e9 | ||
|
09d088b2b5 | ||
|
3312bd27c9 | ||
|
453bdb293f | ||
|
6b0e1598ed | ||
|
56f25d3094 | ||
|
3e458c0028 | ||
|
a747828276 | ||
|
a90e3e04a4 | ||
|
487f01d2ec | ||
|
36c25fdd86 | ||
|
a9fecb31c3 | ||
|
ca8fd8d7ae | ||
|
fb345b1317 | ||
|
966fe38ae3 | ||
|
3042e615ac | ||
|
fd2ae51b93 | ||
|
1227730393 | ||
|
8622bd506f | ||
|
5d6a39ce51 | ||
|
5245c06ed3 | ||
|
3c5977346e | ||
|
a3dc9c2721 | ||
|
90ec1f5bc6 | ||
|
99caa014ca | ||
|
00d0cd1cf7 | ||
|
d6480e50d2 | ||
|
a1a06dd7d0 | ||
|
95b73b5f41 | ||
|
cc00cdfa55 | ||
|
548ba7d712 | ||
|
1ea0c56d7b | ||
|
f764e76f01 | ||
|
4862c2e8ea | ||
|
cbb4d43981 | ||
|
87269e6bcd | ||
|
7d19d294a6 | ||
|
5f3ac323ff | ||
|
0a766d7314 | ||
|
e73535ace0 | ||
|
8e93f0975f | ||
|
57c316a591 | ||
|
f1691b7743 | ||
|
92a025011e | ||
|
d5fa8d0216 | ||
|
1f74a42dfa | ||
|
569b567f21 | ||
|
85f890e7c5 | ||
|
4056fc2281 | ||
|
70c2f0a70a | ||
|
aac8d58372 | ||
|
8ec233f59c | ||
|
a0dd7f58ac | ||
|
443e04b369 | ||
|
cfd9bca4d6 | ||
|
f17157f7e2 | ||
|
18b9f5c79b | ||
|
1b060925a4 | ||
|
00fa618596 | ||
|
131ec9e913 | ||
|
e31ec031f4 | ||
|
431ce430a0 | ||
|
5cdc1e93b3 | ||
|
09216b8b59 | ||
|
1bb3632a70 | ||
|
03617eb8a7 | ||
|
034e568d26 | ||
|
a0faca0997 | ||
|
5268b5bf6b | ||
|
5b3f05f939 | ||
|
b1a669de01 | ||
|
a5f118bc26 | ||
|
10978781cd | ||
|
8bdec4c2b4 | ||
|
be58fced93 | ||
|
c5dfa4c055 | ||
|
74bc9b36aa | ||
|
993fbfb93f | ||
|
97b5276f81 | ||
|
c6c7de286a | ||
|
aec77b543c | ||
|
34b265475d | ||
|
4e95486c5c | ||
|
296b60800a | ||
|
332e19ce64 | ||
|
8984243020 | ||
|
65c47189f9 | ||
|
6aca77a0ae | ||
|
0670ad92d7 | ||
|
bce71a00e9 | ||
|
83b50aaa8e | ||
|
c7c4371902 | ||
|
4978a473a1 | ||
|
4d89d9f285 | ||
|
15770e9298 | ||
|
06797ec0ab | ||
|
b69bf84ab6 | ||
|
7ec02fc8d8 | ||
|
dd28c9f4d7 | ||
|
7fe98e9dc9 | ||
|
6358c39810 | ||
|
294cc4a440 | ||
|
ae1347bb7c | ||
|
b6d659baf2 | ||
|
5756e160da | ||
|
113c046de6 | ||
|
1ef4e574b7 | ||
|
eccc74cf72 | ||
|
a4137a83d8 | ||
|
ed9b4fb831 | ||
|
1d31f63947 | ||
|
74cda4e2ab | ||
|
39db5cd061 | ||
|
11d9e0a72f | ||
|
7683284352 |
102
.eslintignore
@@ -167,6 +167,7 @@ packages/app-desktop/gui/Button/Button.js
|
||||
packages/app-desktop/gui/ClipperConfigScreen.js
|
||||
packages/app-desktop/gui/ConfigScreen/ButtonBar.js
|
||||
packages/app-desktop/gui/ConfigScreen/ConfigScreen.js
|
||||
packages/app-desktop/gui/ConfigScreen/FontSearch.js
|
||||
packages/app-desktop/gui/ConfigScreen/Sidebar.js
|
||||
packages/app-desktop/gui/ConfigScreen/controls/MissingPasswordHelpLink.js
|
||||
packages/app-desktop/gui/ConfigScreen/controls/ToggleAdvancedSettingsButton.js
|
||||
@@ -241,6 +242,7 @@ packages/app-desktop/gui/MainScreen/commands/showSpellCheckerMenu.test.js
|
||||
packages/app-desktop/gui/MainScreen/commands/showSpellCheckerMenu.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleEditors.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleLayoutMoveMode.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleMenuBar.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleNoteList.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleNoteType.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleNotesSortOrderField.js
|
||||
@@ -289,6 +291,7 @@ packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/shouldPasteResources.
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/shouldPasteResources.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/types.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useContextMenu.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useLinkTooltips.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useWebViewApi.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteEditor.js
|
||||
@@ -320,6 +323,8 @@ packages/app-desktop/gui/NoteEditor/utils/useMarkupToHtml.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useMessageHandler.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useNoteSearchBar.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/usePluginServiceRegistration.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useScheduleSaveCallbacks.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useScrollWhenReadyOptions.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useSearchMarkers.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useWindowCommandHandler.js
|
||||
packages/app-desktop/gui/NoteList/NoteList2.js
|
||||
@@ -395,10 +400,26 @@ packages/app-desktop/gui/Root_UpgradeSyncTarget.js
|
||||
packages/app-desktop/gui/SearchBar/SearchBar.js
|
||||
packages/app-desktop/gui/ShareFolderDialog/ShareFolderDialog.js
|
||||
packages/app-desktop/gui/ShareNoteDialog.js
|
||||
packages/app-desktop/gui/Sidebar/FolderAndTagList.js
|
||||
packages/app-desktop/gui/Sidebar/Sidebar.js
|
||||
packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.js
|
||||
packages/app-desktop/gui/Sidebar/commands/index.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useFocusHandler.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useOnRenderItem.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useOnSidebarKeyDownHandler.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useSelectedSidebarIndex.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useSidebarCommandHandler.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useSidebarListData.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/AllNotesItem.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/EmptyExpandLink.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/ExpandIcon.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/ExpandLink.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/FolderItem.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/HeaderItem.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/NoteCount.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/TagItem.js
|
||||
packages/app-desktop/gui/Sidebar/styles/index.js
|
||||
packages/app-desktop/gui/Sidebar/types.js
|
||||
packages/app-desktop/gui/StatusScreen/StatusScreen.js
|
||||
packages/app-desktop/gui/StyleSheets/StyleSheetContainer.js
|
||||
packages/app-desktop/gui/SyncWizard/Dialog.js
|
||||
@@ -413,6 +434,7 @@ packages/app-desktop/gui/ToolbarSpace.js
|
||||
packages/app-desktop/gui/TrashNotification/TrashNotification.js
|
||||
packages/app-desktop/gui/dialogs.js
|
||||
packages/app-desktop/gui/hooks/useEffectDebugger.js
|
||||
packages/app-desktop/gui/hooks/useElementHeight.js
|
||||
packages/app-desktop/gui/hooks/useImperativeHandlerDebugger.js
|
||||
packages/app-desktop/gui/hooks/usePrevious.js
|
||||
packages/app-desktop/gui/hooks/usePropsDebugger.js
|
||||
@@ -433,6 +455,10 @@ packages/app-desktop/integration-tests/main.spec.js
|
||||
packages/app-desktop/integration-tests/models/MainScreen.js
|
||||
packages/app-desktop/integration-tests/models/NoteEditorScreen.js
|
||||
packages/app-desktop/integration-tests/models/SettingsScreen.js
|
||||
packages/app-desktop/integration-tests/models/Sidebar.js
|
||||
packages/app-desktop/integration-tests/noteList.spec.js
|
||||
packages/app-desktop/integration-tests/richTextEditor.spec.js
|
||||
packages/app-desktop/integration-tests/sidebar.spec.js
|
||||
packages/app-desktop/integration-tests/simpleBackup.spec.js
|
||||
packages/app-desktop/integration-tests/util/activateMainMenuItem.js
|
||||
packages/app-desktop/integration-tests/util/createStartupArgs.js
|
||||
@@ -440,6 +466,7 @@ packages/app-desktop/integration-tests/util/firstNonDevToolsWindow.js
|
||||
packages/app-desktop/integration-tests/util/setFilePickerResponse.js
|
||||
packages/app-desktop/integration-tests/util/setMessageBoxResponse.js
|
||||
packages/app-desktop/integration-tests/util/test.js
|
||||
packages/app-desktop/integration-tests/util/waitForNextOpenPath.js
|
||||
packages/app-desktop/playwright.config.js
|
||||
packages/app-desktop/plugins/GotoAnything.js
|
||||
packages/app-desktop/services/bridge.js
|
||||
@@ -480,19 +507,23 @@ packages/app-desktop/utils/restartInSafeModeFromMain.test.js
|
||||
packages/app-desktop/utils/restartInSafeModeFromMain.js
|
||||
packages/app-mobile/PluginAssetsLoader.js
|
||||
packages/app-mobile/commands/index.js
|
||||
packages/app-mobile/commands/newNote.test.js
|
||||
packages/app-mobile/commands/newNote.js
|
||||
packages/app-mobile/commands/openItem.js
|
||||
packages/app-mobile/commands/openNote.js
|
||||
packages/app-mobile/commands/scrollToHash.js
|
||||
packages/app-mobile/commands/util/goToNote.js
|
||||
packages/app-mobile/components/ActionButton.js
|
||||
packages/app-mobile/components/BackButtonDialogBox.js
|
||||
packages/app-mobile/components/BetaChip.js
|
||||
packages/app-mobile/components/CameraView.js
|
||||
packages/app-mobile/components/CustomButton.js
|
||||
packages/app-mobile/components/DismissibleDialog.js
|
||||
packages/app-mobile/components/Dropdown.test.js
|
||||
packages/app-mobile/components/Dropdown.js
|
||||
packages/app-mobile/components/ExtendedWebView.js
|
||||
packages/app-mobile/components/FolderPicker.js
|
||||
packages/app-mobile/components/Icon.js
|
||||
packages/app-mobile/components/IconButton.js
|
||||
packages/app-mobile/components/Modal.js
|
||||
packages/app-mobile/components/ModalDialog.js
|
||||
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.js
|
||||
@@ -560,11 +591,14 @@ packages/app-mobile/components/base-screen.js
|
||||
packages/app-mobile/components/biometrics/BiometricPopup.js
|
||||
packages/app-mobile/components/biometrics/biometricAuthenticate.js
|
||||
packages/app-mobile/components/biometrics/sensorInfo.js
|
||||
packages/app-mobile/components/buttons/TextButton.js
|
||||
packages/app-mobile/components/buttons/index.js
|
||||
packages/app-mobile/components/getResponsiveValue.test.js
|
||||
packages/app-mobile/components/getResponsiveValue.js
|
||||
packages/app-mobile/components/global-style.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/FileSystemPathSelector.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/JoplinCloudConfig.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportDebugReportButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportProfileButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/NoteExportButton.test.js
|
||||
@@ -577,24 +611,38 @@ packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/expo
|
||||
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/SectionSelector/SectionTab.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SectionSelector/index.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SettingComponent.js
|
||||
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/ActionButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/EnablePluginSupportPage.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/InstalledPluginBox.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/PluginChip.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/PluginChips.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/PluginTitle.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/RecommendedBadge.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/PluginInfoModal.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginStates.installed.test.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginStates.search.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
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/SearchPlugins.test.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/SearchPlugins.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/SectionLabel.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/buttons/ActionButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/buttons/InstallButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/WrappedPluginStates.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/mockRepositoryApiConstructor.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/openWebsiteForPlugin.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/usePluginCallbacks.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/usePluginItem.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/useRepoApi.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/useUpdateState.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/types.js
|
||||
packages/app-mobile/components/screens/JoplinCloudLoginScreen.js
|
||||
packages/app-mobile/components/screens/LogScreen.js
|
||||
@@ -635,7 +683,9 @@ packages/app-mobile/plugins/PluginRunner/dialogs/hooks/useWebViewSetup.js
|
||||
packages/app-mobile/plugins/PluginRunner/types.js
|
||||
packages/app-mobile/plugins/PluginRunner/utils/createOnLogHandler.js
|
||||
packages/app-mobile/plugins/hooks/usePlugin.js
|
||||
packages/app-mobile/plugins/loadPlugins.test.js
|
||||
packages/app-mobile/plugins/loadPlugins.js
|
||||
packages/app-mobile/plugins/testing/MockPluginRunner.js
|
||||
packages/app-mobile/root.js
|
||||
packages/app-mobile/services/AlarmServiceDriver.android.js
|
||||
packages/app-mobile/services/AlarmServiceDriver.ios.js
|
||||
@@ -665,6 +715,8 @@ packages/app-mobile/utils/fs-driver/tarExtract.test.js
|
||||
packages/app-mobile/utils/fs-driver/tarExtract.js
|
||||
packages/app-mobile/utils/fs-driver/testUtil/createFilesFromPathRecord.js
|
||||
packages/app-mobile/utils/fs-driver/testUtil/verifyDirectoryMatches.js
|
||||
packages/app-mobile/utils/getPackageInfo.js
|
||||
packages/app-mobile/utils/getVersionInfoText.js
|
||||
packages/app-mobile/utils/initializeCommandService.js
|
||||
packages/app-mobile/utils/ipc/RNToWebViewMessenger.js
|
||||
packages/app-mobile/utils/ipc/WebViewToRNMessenger.js
|
||||
@@ -717,8 +769,9 @@ packages/editor/CodeMirror/markdown/markdownCommands.toggleList.test.js
|
||||
packages/editor/CodeMirror/markdown/markdownCommands.js
|
||||
packages/editor/CodeMirror/markdown/markdownMathParser.test.js
|
||||
packages/editor/CodeMirror/markdown/markdownMathParser.js
|
||||
packages/editor/CodeMirror/markdown/markdownReformatter.test.js
|
||||
packages/editor/CodeMirror/markdown/markdownReformatter.js
|
||||
packages/editor/CodeMirror/markdown/utils/renumberSelectedLists.test.js
|
||||
packages/editor/CodeMirror/markdown/utils/renumberSelectedLists.js
|
||||
packages/editor/CodeMirror/markdown/utils/stripBlockquote.js
|
||||
packages/editor/CodeMirror/pluginApi/PluginLoader.js
|
||||
packages/editor/CodeMirror/pluginApi/codeMirrorRequire.js
|
||||
packages/editor/CodeMirror/pluginApi/customEditorCompletion.test.js
|
||||
@@ -731,8 +784,22 @@ packages/editor/CodeMirror/testUtil/loadLanguages.js
|
||||
packages/editor/CodeMirror/testUtil/pressReleaseKey.js
|
||||
packages/editor/CodeMirror/testUtil/typeText.js
|
||||
packages/editor/CodeMirror/theme.js
|
||||
packages/editor/CodeMirror/util/isInSyntaxNode.js
|
||||
packages/editor/CodeMirror/util/setupVim.js
|
||||
packages/editor/CodeMirror/utils/formatting/RegionSpec.js
|
||||
packages/editor/CodeMirror/utils/formatting/findInlineMatch.test.js
|
||||
packages/editor/CodeMirror/utils/formatting/findInlineMatch.js
|
||||
packages/editor/CodeMirror/utils/formatting/isIndentationEquivalent.js
|
||||
packages/editor/CodeMirror/utils/formatting/tabsToSpaces.test.js
|
||||
packages/editor/CodeMirror/utils/formatting/tabsToSpaces.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleInlineFormatGlobally.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleInlineRegionSurrounded.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleInlineSelectionFormat.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleRegionFormatGlobally.test.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleRegionFormatGlobally.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleSelectedLinesStartWith.js
|
||||
packages/editor/CodeMirror/utils/formatting/types.js
|
||||
packages/editor/CodeMirror/utils/growSelectionToNode.js
|
||||
packages/editor/CodeMirror/utils/isInSyntaxNode.js
|
||||
packages/editor/CodeMirror/utils/setupVim.js
|
||||
packages/editor/SelectionFormatting.js
|
||||
packages/editor/events.js
|
||||
packages/editor/types.js
|
||||
@@ -758,6 +825,7 @@ packages/generator-joplin/generators/app/templates/src/index.js
|
||||
packages/generator-joplin/tools/updateCategories.js
|
||||
packages/htmlpack/src/index.js
|
||||
packages/lib/ArrayUtils.js
|
||||
packages/lib/AsyncActionQueue.test.js
|
||||
packages/lib/AsyncActionQueue.js
|
||||
packages/lib/BaseApplication.js
|
||||
packages/lib/BaseModel.js
|
||||
@@ -776,6 +844,7 @@ packages/lib/ObjectUtils.js
|
||||
packages/lib/PoorManIntervals.js
|
||||
packages/lib/RotatingLogs.test.js
|
||||
packages/lib/RotatingLogs.js
|
||||
packages/lib/SyncTargetFilesystem.js
|
||||
packages/lib/SyncTargetJoplinCloud.js
|
||||
packages/lib/SyncTargetJoplinServer.js
|
||||
packages/lib/SyncTargetNone.js
|
||||
@@ -794,6 +863,7 @@ packages/lib/commands/index.js
|
||||
packages/lib/commands/openMasterPasswordDialog.js
|
||||
packages/lib/commands/synchronize.js
|
||||
packages/lib/components/EncryptionConfigScreen/utils.js
|
||||
packages/lib/components/shared/NoteList/getEmptyFolderMessage.js
|
||||
packages/lib/components/shared/config/config-shared.js
|
||||
packages/lib/components/shared/config/plugins/types.js
|
||||
packages/lib/components/shared/config/plugins/useOnDeleteHandler.js
|
||||
@@ -815,6 +885,7 @@ packages/lib/errorUtils.js
|
||||
packages/lib/errors.js
|
||||
packages/lib/eventManager.js
|
||||
packages/lib/file-api-driver-joplinServer.js
|
||||
packages/lib/file-api-driver-local.js
|
||||
packages/lib/file-api-driver-memory.js
|
||||
packages/lib/file-api-driver.test.js
|
||||
packages/lib/file-api.test.js
|
||||
@@ -844,6 +915,7 @@ packages/lib/markdownUtils.js
|
||||
packages/lib/markdownUtils2.test.js
|
||||
packages/lib/markupLanguageUtils.js
|
||||
packages/lib/migrations/42.js
|
||||
packages/lib/mime-utils.js
|
||||
packages/lib/models/Alarm.js
|
||||
packages/lib/models/BaseItem.test.js
|
||||
packages/lib/models/BaseItem.js
|
||||
@@ -893,6 +965,7 @@ packages/lib/ntp.js
|
||||
packages/lib/onedrive-api.test.js
|
||||
packages/lib/onedrive-api.js
|
||||
packages/lib/path-utils.js
|
||||
packages/lib/reducer.test.js
|
||||
packages/lib/reducer.js
|
||||
packages/lib/registry.test.js
|
||||
packages/lib/registry.js
|
||||
@@ -1040,9 +1113,12 @@ 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/getPluginIssueReportUrl.test.js
|
||||
packages/lib/services/plugins/utils/getPluginIssueReportUrl.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/getDefaultPlatforms.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
|
||||
@@ -1172,10 +1248,12 @@ packages/lib/themes/solarizedLight.js
|
||||
packages/lib/themes/type.js
|
||||
packages/lib/time.js
|
||||
packages/lib/types.js
|
||||
packages/lib/urlUtils.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/frontMatter.js
|
||||
packages/lib/utils/ipc/RemoteMessenger.test.js
|
||||
packages/lib/utils/ipc/RemoteMessenger.js
|
||||
packages/lib/utils/ipc/TestMessenger.js
|
||||
@@ -1186,7 +1264,8 @@ packages/lib/utils/ipc/utils/mergeCallbacksAndSerializable.js
|
||||
packages/lib/utils/ipc/utils/separateCallbacksFromSerializable.test.js
|
||||
packages/lib/utils/ipc/utils/separateCallbacksFromSerializable.js
|
||||
packages/lib/utils/ipc/utils/separateCallbacksFromSerializableArray.js
|
||||
packages/lib/utils/joplinCloud.js
|
||||
packages/lib/utils/joplinCloud/index.js
|
||||
packages/lib/utils/joplinCloud/types.js
|
||||
packages/lib/utils/processStartFlags.js
|
||||
packages/lib/utils/replaceUnsupportedCharacters.test.js
|
||||
packages/lib/utils/replaceUnsupportedCharacters.js
|
||||
@@ -1258,6 +1337,7 @@ 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/rules/utils/defaultRule.js
|
||||
packages/renderer/MdToHtml/setupLinkify.js
|
||||
packages/renderer/MdToHtml/validateLinks.js
|
||||
packages/renderer/assetsToHeaders.js
|
||||
|
@@ -70,6 +70,10 @@ module.exports = {
|
||||
'no-var': ['error'],
|
||||
'no-new-func': ['error'],
|
||||
'import/prefer-default-export': ['error'],
|
||||
'prefer-promise-reject-errors': ['error', {
|
||||
allowEmptyReject: true,
|
||||
}],
|
||||
'no-throw-literal': ['error'],
|
||||
|
||||
// This rule should not be enabled since it matters in what order
|
||||
// imports are done, in particular in relation to the shim.setReact
|
||||
|
13
.github/workflows/build-android.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
with:
|
||||
concurrent_skipping: 'same_content_newer'
|
||||
|
||||
BuildAndroidDebug:
|
||||
AssembleRelease:
|
||||
needs: pre_job
|
||||
if: github.repository == 'laurent22/joplin' && needs.pre_job.outputs.should_skip != 'true'
|
||||
runs-on: ubuntu-latest
|
||||
@@ -25,6 +25,11 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get update || true
|
||||
sudo apt-get install -y libsecret-1-dev
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '20'
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -40,7 +45,9 @@ jobs:
|
||||
- name: Install
|
||||
run: yarn install
|
||||
|
||||
- name: Build Android Release
|
||||
- name: Assemble Android Release
|
||||
run: |
|
||||
cd packages/app-mobile/android && ./gradlew assembleDebug
|
||||
cd packages/app-mobile/android
|
||||
sed -i -- 's/signingConfig signingConfigs.release/signingConfig signingConfigs.debug/' app/build.gradle
|
||||
./gradlew assembleRelease
|
||||
|
2
.github/workflows/cla.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
- name: "CLA Assistant"
|
||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||
# Beta Release
|
||||
uses: contributor-assistant/github-action@v2.3.1
|
||||
uses: contributor-assistant/github-action@v2.3.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# the below token should have repo scope and must be manually added by you in the repository's secret
|
||||
|
2
.github/workflows/github-actions-main.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
matrix:
|
||||
# Do not use unbuntu-latest because it causes `The operation was canceled` failures:
|
||||
# https://github.com/actions/runner-images/issues/6709
|
||||
os: [macos-latest, ubuntu-20.04, windows-2019]
|
||||
os: [macos-12, ubuntu-20.04, windows-2019]
|
||||
steps:
|
||||
|
||||
# Trying to fix random networking issues on Windows
|
||||
|
103
.gitignore
vendored
@@ -10,7 +10,6 @@ _vieux/
|
||||
!var/sessions/.gitkeep
|
||||
!var/SymfonyRequirements.php
|
||||
.DS_Store
|
||||
.vscode/*
|
||||
*.map
|
||||
*.pro.user
|
||||
*.sublime-workspace
|
||||
@@ -147,6 +146,7 @@ packages/app-desktop/gui/Button/Button.js
|
||||
packages/app-desktop/gui/ClipperConfigScreen.js
|
||||
packages/app-desktop/gui/ConfigScreen/ButtonBar.js
|
||||
packages/app-desktop/gui/ConfigScreen/ConfigScreen.js
|
||||
packages/app-desktop/gui/ConfigScreen/FontSearch.js
|
||||
packages/app-desktop/gui/ConfigScreen/Sidebar.js
|
||||
packages/app-desktop/gui/ConfigScreen/controls/MissingPasswordHelpLink.js
|
||||
packages/app-desktop/gui/ConfigScreen/controls/ToggleAdvancedSettingsButton.js
|
||||
@@ -221,6 +221,7 @@ packages/app-desktop/gui/MainScreen/commands/showSpellCheckerMenu.test.js
|
||||
packages/app-desktop/gui/MainScreen/commands/showSpellCheckerMenu.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleEditors.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleLayoutMoveMode.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleMenuBar.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleNoteList.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleNoteType.js
|
||||
packages/app-desktop/gui/MainScreen/commands/toggleNotesSortOrderField.js
|
||||
@@ -269,6 +270,7 @@ packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/shouldPasteResources.
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/shouldPasteResources.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/types.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useContextMenu.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useLinkTooltips.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useWebViewApi.js
|
||||
packages/app-desktop/gui/NoteEditor/NoteEditor.js
|
||||
@@ -300,6 +302,8 @@ packages/app-desktop/gui/NoteEditor/utils/useMarkupToHtml.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useMessageHandler.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useNoteSearchBar.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/usePluginServiceRegistration.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useScheduleSaveCallbacks.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useScrollWhenReadyOptions.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useSearchMarkers.js
|
||||
packages/app-desktop/gui/NoteEditor/utils/useWindowCommandHandler.js
|
||||
packages/app-desktop/gui/NoteList/NoteList2.js
|
||||
@@ -375,10 +379,26 @@ packages/app-desktop/gui/Root_UpgradeSyncTarget.js
|
||||
packages/app-desktop/gui/SearchBar/SearchBar.js
|
||||
packages/app-desktop/gui/ShareFolderDialog/ShareFolderDialog.js
|
||||
packages/app-desktop/gui/ShareNoteDialog.js
|
||||
packages/app-desktop/gui/Sidebar/FolderAndTagList.js
|
||||
packages/app-desktop/gui/Sidebar/Sidebar.js
|
||||
packages/app-desktop/gui/Sidebar/commands/focusElementSideBar.js
|
||||
packages/app-desktop/gui/Sidebar/commands/index.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useFocusHandler.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useOnRenderItem.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useOnSidebarKeyDownHandler.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useSelectedSidebarIndex.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useSidebarCommandHandler.js
|
||||
packages/app-desktop/gui/Sidebar/hooks/useSidebarListData.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/AllNotesItem.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/EmptyExpandLink.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/ExpandIcon.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/ExpandLink.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/FolderItem.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/HeaderItem.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/NoteCount.js
|
||||
packages/app-desktop/gui/Sidebar/listItemComponents/TagItem.js
|
||||
packages/app-desktop/gui/Sidebar/styles/index.js
|
||||
packages/app-desktop/gui/Sidebar/types.js
|
||||
packages/app-desktop/gui/StatusScreen/StatusScreen.js
|
||||
packages/app-desktop/gui/StyleSheets/StyleSheetContainer.js
|
||||
packages/app-desktop/gui/SyncWizard/Dialog.js
|
||||
@@ -393,6 +413,7 @@ packages/app-desktop/gui/ToolbarSpace.js
|
||||
packages/app-desktop/gui/TrashNotification/TrashNotification.js
|
||||
packages/app-desktop/gui/dialogs.js
|
||||
packages/app-desktop/gui/hooks/useEffectDebugger.js
|
||||
packages/app-desktop/gui/hooks/useElementHeight.js
|
||||
packages/app-desktop/gui/hooks/useImperativeHandlerDebugger.js
|
||||
packages/app-desktop/gui/hooks/usePrevious.js
|
||||
packages/app-desktop/gui/hooks/usePropsDebugger.js
|
||||
@@ -413,6 +434,10 @@ packages/app-desktop/integration-tests/main.spec.js
|
||||
packages/app-desktop/integration-tests/models/MainScreen.js
|
||||
packages/app-desktop/integration-tests/models/NoteEditorScreen.js
|
||||
packages/app-desktop/integration-tests/models/SettingsScreen.js
|
||||
packages/app-desktop/integration-tests/models/Sidebar.js
|
||||
packages/app-desktop/integration-tests/noteList.spec.js
|
||||
packages/app-desktop/integration-tests/richTextEditor.spec.js
|
||||
packages/app-desktop/integration-tests/sidebar.spec.js
|
||||
packages/app-desktop/integration-tests/simpleBackup.spec.js
|
||||
packages/app-desktop/integration-tests/util/activateMainMenuItem.js
|
||||
packages/app-desktop/integration-tests/util/createStartupArgs.js
|
||||
@@ -420,6 +445,7 @@ packages/app-desktop/integration-tests/util/firstNonDevToolsWindow.js
|
||||
packages/app-desktop/integration-tests/util/setFilePickerResponse.js
|
||||
packages/app-desktop/integration-tests/util/setMessageBoxResponse.js
|
||||
packages/app-desktop/integration-tests/util/test.js
|
||||
packages/app-desktop/integration-tests/util/waitForNextOpenPath.js
|
||||
packages/app-desktop/playwright.config.js
|
||||
packages/app-desktop/plugins/GotoAnything.js
|
||||
packages/app-desktop/services/bridge.js
|
||||
@@ -460,19 +486,23 @@ packages/app-desktop/utils/restartInSafeModeFromMain.test.js
|
||||
packages/app-desktop/utils/restartInSafeModeFromMain.js
|
||||
packages/app-mobile/PluginAssetsLoader.js
|
||||
packages/app-mobile/commands/index.js
|
||||
packages/app-mobile/commands/newNote.test.js
|
||||
packages/app-mobile/commands/newNote.js
|
||||
packages/app-mobile/commands/openItem.js
|
||||
packages/app-mobile/commands/openNote.js
|
||||
packages/app-mobile/commands/scrollToHash.js
|
||||
packages/app-mobile/commands/util/goToNote.js
|
||||
packages/app-mobile/components/ActionButton.js
|
||||
packages/app-mobile/components/BackButtonDialogBox.js
|
||||
packages/app-mobile/components/BetaChip.js
|
||||
packages/app-mobile/components/CameraView.js
|
||||
packages/app-mobile/components/CustomButton.js
|
||||
packages/app-mobile/components/DismissibleDialog.js
|
||||
packages/app-mobile/components/Dropdown.test.js
|
||||
packages/app-mobile/components/Dropdown.js
|
||||
packages/app-mobile/components/ExtendedWebView.js
|
||||
packages/app-mobile/components/FolderPicker.js
|
||||
packages/app-mobile/components/Icon.js
|
||||
packages/app-mobile/components/IconButton.js
|
||||
packages/app-mobile/components/Modal.js
|
||||
packages/app-mobile/components/ModalDialog.js
|
||||
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.js
|
||||
@@ -540,11 +570,14 @@ packages/app-mobile/components/base-screen.js
|
||||
packages/app-mobile/components/biometrics/BiometricPopup.js
|
||||
packages/app-mobile/components/biometrics/biometricAuthenticate.js
|
||||
packages/app-mobile/components/biometrics/sensorInfo.js
|
||||
packages/app-mobile/components/buttons/TextButton.js
|
||||
packages/app-mobile/components/buttons/index.js
|
||||
packages/app-mobile/components/getResponsiveValue.test.js
|
||||
packages/app-mobile/components/getResponsiveValue.js
|
||||
packages/app-mobile/components/global-style.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/FileSystemPathSelector.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/JoplinCloudConfig.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportDebugReportButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportProfileButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/NoteExportButton.test.js
|
||||
@@ -557,24 +590,38 @@ packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/expo
|
||||
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/SectionSelector/SectionTab.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SectionSelector/index.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/SettingComponent.js
|
||||
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/ActionButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/EnablePluginSupportPage.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/InstalledPluginBox.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/PluginChip.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/PluginChips.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/PluginTitle.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginBox/RecommendedBadge.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/PluginInfoModal.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginStates.installed.test.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/PluginStates.search.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
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/SearchPlugins.test.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/SearchPlugins.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/SectionLabel.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/buttons/ActionButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/buttons/InstallButton.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/WrappedPluginStates.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/testUtils/mockRepositoryApiConstructor.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/openWebsiteForPlugin.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/usePluginCallbacks.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/usePluginItem.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/useRepoApi.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/plugins/utils/useUpdateState.js
|
||||
packages/app-mobile/components/screens/ConfigScreen/types.js
|
||||
packages/app-mobile/components/screens/JoplinCloudLoginScreen.js
|
||||
packages/app-mobile/components/screens/LogScreen.js
|
||||
@@ -615,7 +662,9 @@ packages/app-mobile/plugins/PluginRunner/dialogs/hooks/useWebViewSetup.js
|
||||
packages/app-mobile/plugins/PluginRunner/types.js
|
||||
packages/app-mobile/plugins/PluginRunner/utils/createOnLogHandler.js
|
||||
packages/app-mobile/plugins/hooks/usePlugin.js
|
||||
packages/app-mobile/plugins/loadPlugins.test.js
|
||||
packages/app-mobile/plugins/loadPlugins.js
|
||||
packages/app-mobile/plugins/testing/MockPluginRunner.js
|
||||
packages/app-mobile/root.js
|
||||
packages/app-mobile/services/AlarmServiceDriver.android.js
|
||||
packages/app-mobile/services/AlarmServiceDriver.ios.js
|
||||
@@ -645,6 +694,8 @@ packages/app-mobile/utils/fs-driver/tarExtract.test.js
|
||||
packages/app-mobile/utils/fs-driver/tarExtract.js
|
||||
packages/app-mobile/utils/fs-driver/testUtil/createFilesFromPathRecord.js
|
||||
packages/app-mobile/utils/fs-driver/testUtil/verifyDirectoryMatches.js
|
||||
packages/app-mobile/utils/getPackageInfo.js
|
||||
packages/app-mobile/utils/getVersionInfoText.js
|
||||
packages/app-mobile/utils/initializeCommandService.js
|
||||
packages/app-mobile/utils/ipc/RNToWebViewMessenger.js
|
||||
packages/app-mobile/utils/ipc/WebViewToRNMessenger.js
|
||||
@@ -697,8 +748,9 @@ packages/editor/CodeMirror/markdown/markdownCommands.toggleList.test.js
|
||||
packages/editor/CodeMirror/markdown/markdownCommands.js
|
||||
packages/editor/CodeMirror/markdown/markdownMathParser.test.js
|
||||
packages/editor/CodeMirror/markdown/markdownMathParser.js
|
||||
packages/editor/CodeMirror/markdown/markdownReformatter.test.js
|
||||
packages/editor/CodeMirror/markdown/markdownReformatter.js
|
||||
packages/editor/CodeMirror/markdown/utils/renumberSelectedLists.test.js
|
||||
packages/editor/CodeMirror/markdown/utils/renumberSelectedLists.js
|
||||
packages/editor/CodeMirror/markdown/utils/stripBlockquote.js
|
||||
packages/editor/CodeMirror/pluginApi/PluginLoader.js
|
||||
packages/editor/CodeMirror/pluginApi/codeMirrorRequire.js
|
||||
packages/editor/CodeMirror/pluginApi/customEditorCompletion.test.js
|
||||
@@ -711,8 +763,22 @@ packages/editor/CodeMirror/testUtil/loadLanguages.js
|
||||
packages/editor/CodeMirror/testUtil/pressReleaseKey.js
|
||||
packages/editor/CodeMirror/testUtil/typeText.js
|
||||
packages/editor/CodeMirror/theme.js
|
||||
packages/editor/CodeMirror/util/isInSyntaxNode.js
|
||||
packages/editor/CodeMirror/util/setupVim.js
|
||||
packages/editor/CodeMirror/utils/formatting/RegionSpec.js
|
||||
packages/editor/CodeMirror/utils/formatting/findInlineMatch.test.js
|
||||
packages/editor/CodeMirror/utils/formatting/findInlineMatch.js
|
||||
packages/editor/CodeMirror/utils/formatting/isIndentationEquivalent.js
|
||||
packages/editor/CodeMirror/utils/formatting/tabsToSpaces.test.js
|
||||
packages/editor/CodeMirror/utils/formatting/tabsToSpaces.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleInlineFormatGlobally.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleInlineRegionSurrounded.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleInlineSelectionFormat.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleRegionFormatGlobally.test.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleRegionFormatGlobally.js
|
||||
packages/editor/CodeMirror/utils/formatting/toggleSelectedLinesStartWith.js
|
||||
packages/editor/CodeMirror/utils/formatting/types.js
|
||||
packages/editor/CodeMirror/utils/growSelectionToNode.js
|
||||
packages/editor/CodeMirror/utils/isInSyntaxNode.js
|
||||
packages/editor/CodeMirror/utils/setupVim.js
|
||||
packages/editor/SelectionFormatting.js
|
||||
packages/editor/events.js
|
||||
packages/editor/types.js
|
||||
@@ -738,6 +804,7 @@ packages/generator-joplin/generators/app/templates/src/index.js
|
||||
packages/generator-joplin/tools/updateCategories.js
|
||||
packages/htmlpack/src/index.js
|
||||
packages/lib/ArrayUtils.js
|
||||
packages/lib/AsyncActionQueue.test.js
|
||||
packages/lib/AsyncActionQueue.js
|
||||
packages/lib/BaseApplication.js
|
||||
packages/lib/BaseModel.js
|
||||
@@ -756,6 +823,7 @@ packages/lib/ObjectUtils.js
|
||||
packages/lib/PoorManIntervals.js
|
||||
packages/lib/RotatingLogs.test.js
|
||||
packages/lib/RotatingLogs.js
|
||||
packages/lib/SyncTargetFilesystem.js
|
||||
packages/lib/SyncTargetJoplinCloud.js
|
||||
packages/lib/SyncTargetJoplinServer.js
|
||||
packages/lib/SyncTargetNone.js
|
||||
@@ -774,6 +842,7 @@ packages/lib/commands/index.js
|
||||
packages/lib/commands/openMasterPasswordDialog.js
|
||||
packages/lib/commands/synchronize.js
|
||||
packages/lib/components/EncryptionConfigScreen/utils.js
|
||||
packages/lib/components/shared/NoteList/getEmptyFolderMessage.js
|
||||
packages/lib/components/shared/config/config-shared.js
|
||||
packages/lib/components/shared/config/plugins/types.js
|
||||
packages/lib/components/shared/config/plugins/useOnDeleteHandler.js
|
||||
@@ -795,6 +864,7 @@ packages/lib/errorUtils.js
|
||||
packages/lib/errors.js
|
||||
packages/lib/eventManager.js
|
||||
packages/lib/file-api-driver-joplinServer.js
|
||||
packages/lib/file-api-driver-local.js
|
||||
packages/lib/file-api-driver-memory.js
|
||||
packages/lib/file-api-driver.test.js
|
||||
packages/lib/file-api.test.js
|
||||
@@ -824,6 +894,7 @@ packages/lib/markdownUtils.js
|
||||
packages/lib/markdownUtils2.test.js
|
||||
packages/lib/markupLanguageUtils.js
|
||||
packages/lib/migrations/42.js
|
||||
packages/lib/mime-utils.js
|
||||
packages/lib/models/Alarm.js
|
||||
packages/lib/models/BaseItem.test.js
|
||||
packages/lib/models/BaseItem.js
|
||||
@@ -873,6 +944,7 @@ packages/lib/ntp.js
|
||||
packages/lib/onedrive-api.test.js
|
||||
packages/lib/onedrive-api.js
|
||||
packages/lib/path-utils.js
|
||||
packages/lib/reducer.test.js
|
||||
packages/lib/reducer.js
|
||||
packages/lib/registry.test.js
|
||||
packages/lib/registry.js
|
||||
@@ -1020,9 +1092,12 @@ 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/getPluginIssueReportUrl.test.js
|
||||
packages/lib/services/plugins/utils/getPluginIssueReportUrl.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/getDefaultPlatforms.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
|
||||
@@ -1152,10 +1227,12 @@ packages/lib/themes/solarizedLight.js
|
||||
packages/lib/themes/type.js
|
||||
packages/lib/time.js
|
||||
packages/lib/types.js
|
||||
packages/lib/urlUtils.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/frontMatter.js
|
||||
packages/lib/utils/ipc/RemoteMessenger.test.js
|
||||
packages/lib/utils/ipc/RemoteMessenger.js
|
||||
packages/lib/utils/ipc/TestMessenger.js
|
||||
@@ -1166,7 +1243,8 @@ packages/lib/utils/ipc/utils/mergeCallbacksAndSerializable.js
|
||||
packages/lib/utils/ipc/utils/separateCallbacksFromSerializable.test.js
|
||||
packages/lib/utils/ipc/utils/separateCallbacksFromSerializable.js
|
||||
packages/lib/utils/ipc/utils/separateCallbacksFromSerializableArray.js
|
||||
packages/lib/utils/joplinCloud.js
|
||||
packages/lib/utils/joplinCloud/index.js
|
||||
packages/lib/utils/joplinCloud/types.js
|
||||
packages/lib/utils/processStartFlags.js
|
||||
packages/lib/utils/replaceUnsupportedCharacters.test.js
|
||||
packages/lib/utils/replaceUnsupportedCharacters.js
|
||||
@@ -1238,6 +1316,7 @@ 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/rules/utils/defaultRule.js
|
||||
packages/renderer/MdToHtml/setupLinkify.js
|
||||
packages/renderer/MdToHtml/validateLinks.js
|
||||
packages/renderer/assetsToHeaders.js
|
||||
|
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"cSpell.enabled": true
|
||||
}
|
@@ -1,8 +1,8 @@
|
||||
diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java
|
||||
index 0f52b73c61625db2a3081c0950b6bdd2b06e3d40..b0fc3de4be0b3a26b638683613c63c783c2739bb 100644
|
||||
index 8a719ca35af1cc3a4192c5c5f8258fd4f7fea990..5f8831f81cd164a4f627423427ead92fa286b115 100644
|
||||
--- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java
|
||||
+++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java
|
||||
@@ -38,7 +38,7 @@ import com.facebook.react.uimanager.common.ViewUtil;
|
||||
@@ -37,7 +37,7 @@ import com.facebook.react.uimanager.common.ViewUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
@@ -11,7 +11,7 @@ index 0f52b73c61625db2a3081c0950b6bdd2b06e3d40..b0fc3de4be0b3a26b638683613c63c78
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/**
|
||||
@@ -151,7 +151,10 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
@@ -149,7 +149,10 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
}
|
||||
|
||||
private class ConcurrentOperationQueue {
|
1
Assets/WebsiteAssets/images/draw/add-new-image.svg
Normal file
After Width: | Height: | Size: 345 KiB |
BIN
Assets/WebsiteAssets/images/draw/average-selection-color.png
Normal file
After Width: | Height: | Size: 185 KiB |
BIN
Assets/WebsiteAssets/images/draw/change-visible-region.png
Normal file
After Width: | Height: | Size: 568 KiB |
BIN
Assets/WebsiteAssets/images/draw/color-under-cursor.png
Normal file
After Width: | Height: | Size: 199 KiB |
BIN
Assets/WebsiteAssets/images/draw/desktop-create-new-drawing.png
Normal file
After Width: | Height: | Size: 123 KiB |
After Width: | Height: | Size: 184 KiB |
1
Assets/WebsiteAssets/images/draw/edit-from-viewer.svg
Normal file
After Width: | Height: | Size: 200 KiB |
1
Assets/WebsiteAssets/images/draw/editor-toolbar-top.svg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
Assets/WebsiteAssets/images/draw/help-icon.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
Assets/WebsiteAssets/images/draw/infinite-zoom-demo.mp4
Normal file
BIN
Assets/WebsiteAssets/images/draw/lock-rotation.png
Normal file
After Width: | Height: | Size: 104 KiB |
1
Assets/WebsiteAssets/images/draw/long-press-edit.svg
Normal file
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 246 KiB |
BIN
Assets/WebsiteAssets/images/draw/restore-auto-resize.png
Normal file
After Width: | Height: | Size: 310 KiB |
1
Assets/WebsiteAssets/images/draw/show-pen-menu.svg
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
Assets/WebsiteAssets/images/sponsors/SocialFollowers.png
Normal file
After Width: | Height: | Size: 15 KiB |
3
CONTRIBUTING
Normal file
@@ -0,0 +1,3 @@
|
||||
# Contributing to Joplin
|
||||
|
||||
See the guide at https://github.com/laurent22/joplin/blob/dev/readme/dev/index.md
|
@@ -202,16 +202,28 @@ if command -v lsb_release &> /dev/null; then
|
||||
DISTVER=$(lsb_release -is) && DISTVER=$DISTVER$(lsb_release -rs)
|
||||
DISTCODENAME=$(lsb_release -cs)
|
||||
DISTMAJOR=$(lsb_release -rs|cut -d. -f1)
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Check for "The SUID sandbox helper binary was found, but is not configured correctly" problem.
|
||||
# It is present in Debian 1X. A (temporary) patch will be applied at .desktop file
|
||||
# Linux Mint 4 Debbie is based on Debian 10 and requires the same param handling.
|
||||
#
|
||||
# This also works around Ubuntu 23.10+'s restrictions on unprivileged user namespaces. Electron
|
||||
# TODO: Remove: This is likely no longer an issue. See https://issues.chromium.org/issues/40462640.
|
||||
BAD_HELPER_BINARY=false
|
||||
if [[ $DISTVER =~ Debian1. || ( "$DISTVER" = "Linuxmint4" && "$DISTCODENAME" = "debbie" ) || ( "$DISTVER" = "CentOS" && "$DISTMAJOR" =~ 6|7 ) ]]; then
|
||||
BAD_HELPER_BINARY=true
|
||||
fi
|
||||
|
||||
# Work around Ubuntu 23.10+'s restrictions on unprivileged user namespaces. Electron
|
||||
# uses these to sandbox processes. Unfortunately, it doesn't look like we can get around this
|
||||
# without writing the AppImage to a non-user-writable location (without invalidating other security
|
||||
# controls). See https://discourse.joplinapp.org/t/possible-future-requirement-for-no-sandbox-flag-for-ubuntu-23-10/.
|
||||
if [[ $DISTVER = "Ubuntu23.10" || $DISTVER =~ Debian1. || ( "$DISTVER" = "Linuxmint4" && "$DISTCODENAME" = "debbie" ) || ( "$DISTVER" = "CentOS" && "$DISTMAJOR" =~ 6|7 ) ]]; then
|
||||
HAS_USERNS_RESTRICTIONS=false
|
||||
if [[ "$DISTVER" =~ ^Ubuntu && $DISTMAJOR -ge 23 ]]; then
|
||||
HAS_USERNS_RESTRICTIONS=true
|
||||
fi
|
||||
|
||||
if [[ $HAS_USERNS_RESTRICTIONS = true || $BAD_HELPER_BINARY = true ]]; then
|
||||
SANDBOXPARAM="--no-sandbox"
|
||||
print "${COLOR_YELLOW}WARNING${COLOR_RESET} Electron sandboxing disabled."
|
||||
print " See https://discourse.joplinapp.org/t/32160/5 for details."
|
||||
@@ -241,7 +253,7 @@ if [[ $DESKTOP =~ .*gnome.*|.*kde.*|.*xfce.*|.*mate.*|.*lxqt.*|.*unity.*|.*x-cin
|
||||
Encoding=UTF-8
|
||||
Name=Joplin
|
||||
Comment=Joplin for Desktop
|
||||
Exec=${HOME}/.joplin/Joplin.AppImage ${SANDBOXPARAM} %u
|
||||
Exec=env APPIMAGELAUNCHER_DISABLE=TRUE ${HOME}/.joplin/Joplin.AppImage ${SANDBOXPARAM} %u
|
||||
Icon=joplin
|
||||
StartupWMClass=Joplin
|
||||
Type=Application
|
||||
|
@@ -31,7 +31,7 @@ Please see the [donation page](https://github.com/laurent22/joplin/blob/dev/read
|
||||
# Sponsors
|
||||
|
||||
<!-- SPONSORS-ORG -->
|
||||
<a href="https://seirei.ne.jp"><img title="Serei Network" width="256" src="https://joplinapp.org/images/sponsors/SeireiNetwork.png"/></a> <a href="https://www.hosting.de/nextcloud/?mtm_campaign=managed-nextcloud&mtm_kwd=joplinapp&mtm_source=joplinapp-webseite&mtm_medium=banner"><img title="Hosting.de" width="256" src="https://joplinapp.org/images/sponsors/HostingDe.png"/></a> <a href="https://grundstueckspreise.info/"><img title="SP Software GmbH" width="256" src="https://joplinapp.org/images/sponsors/Grundstueckspreise.png"/></a> <a href="https://citricsheep.com"><img title="Citric Sheep" width="256" src="https://joplinapp.org/images/sponsors/CitricSheep.png"/></a> <a href="https://sorted.travel/?utm_source=joplinapp"><img title="Sorted Travel" width="256" src="https://joplinapp.org/images/sponsors/SortedTravel.png"/></a> <a href="https://celebian.com"><img title="Celebian" width="256" src="https://joplinapp.org/images/sponsors/Celebian.png"/></a> <a href="https://bestkru.com"><img title="BestKru" width="256" src="https://joplinapp.org/images/sponsors/BestKru.png"/></a>
|
||||
<a href="https://seirei.ne.jp"><img title="Serei Network" width="256" src="https://joplinapp.org/images/sponsors/SeireiNetwork.png"/></a> <a href="https://www.hosting.de/nextcloud/?mtm_campaign=managed-nextcloud&mtm_kwd=joplinapp&mtm_source=joplinapp-webseite&mtm_medium=banner"><img title="Hosting.de" width="256" src="https://joplinapp.org/images/sponsors/HostingDe.png"/></a> <a href="https://grundstueckspreise.info/"><img title="SP Software GmbH" width="256" src="https://joplinapp.org/images/sponsors/Grundstueckspreise.png"/></a> <a href="https://citricsheep.com"><img title="Citric Sheep" width="256" src="https://joplinapp.org/images/sponsors/CitricSheep.png"/></a> <a href="https://sorted.travel/?utm_source=joplinapp"><img title="Sorted Travel" width="256" src="https://joplinapp.org/images/sponsors/SortedTravel.png"/></a> <a href="https://celebian.com"><img title="Celebian" width="256" src="https://joplinapp.org/images/sponsors/Celebian.png"/></a> <a href="https://bestkru.com"><img title="BestKru" width="256" src="https://joplinapp.org/images/sponsors/BestKru.png"/></a> <a href="https://www.socialfollowers.uk/buy-tiktok-followers/"><img title="Social Followers" width="256" src="https://joplinapp.org/images/sponsors/SocialFollowers.png"/></a>
|
||||
<!-- SPONSORS-ORG -->
|
||||
|
||||
* * *
|
||||
|
@@ -1,24 +1,58 @@
|
||||
# For development this compose file starts the database only. The app can then
|
||||
# be started using `yarn start-dev`, which is useful for development, because
|
||||
# it means the app Docker file doesn't have to be rebuilt on each change.
|
||||
#
|
||||
# Note that log is setup to give as much information as possible, including
|
||||
# whether it's the master or slave database that is being used for a query.
|
||||
#
|
||||
# To setup and test replication, use the following config in Joplin Server. Note
|
||||
# in particular the different port, which means we access the slave and not the
|
||||
# master.
|
||||
#
|
||||
# DB_USE_SLAVE=true
|
||||
# SLAVE_POSTGRES_PASSWORD=joplin
|
||||
# SLAVE_POSTGRES_DATABASE=joplin
|
||||
# SLAVE_POSTGRES_USER=joplin
|
||||
# SLAVE_POSTGRES_PORT=5433
|
||||
# SLAVE_POSTGRES_HOST=localhost
|
||||
# USERS_WITH_REPLICATION=ID1,ID2,...
|
||||
|
||||
version: '3'
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:16
|
||||
command: postgres -c work_mem=100000
|
||||
|
||||
postgresql-master:
|
||||
image: 'bitnami/postgresql:16.3.0'
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- '5432:5432'
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=joplin
|
||||
- POSTGRES_USER=joplin
|
||||
- POSTGRES_DB=joplin
|
||||
|
||||
# Use this to specify additional Postgres
|
||||
# config parameters:
|
||||
#
|
||||
# command:
|
||||
# - "postgres"
|
||||
# - "-c"
|
||||
# - "log_min_duration_statement=0"
|
||||
- POSTGRESQL_PASSWORD=joplin
|
||||
- POSTGRESQL_USERNAME=joplin
|
||||
- POSTGRESQL_DATABASE=joplin
|
||||
|
||||
- POSTGRESQL_REPLICATION_MODE=master
|
||||
- POSTGRESQL_REPLICATION_USER=repl_user
|
||||
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
|
||||
|
||||
- POSTGRESQL_LOG_HOSTNAME=true
|
||||
- POSTGRESQL_PGAUDIT_LOG=READ,WRITE
|
||||
- POSTGRESQL_EXTRA_FLAGS=-c work_mem=100000 -c log_statement=all
|
||||
|
||||
postgresql-slave:
|
||||
image: 'bitnami/postgresql:16.3.0'
|
||||
ports:
|
||||
- '5433:5432'
|
||||
depends_on:
|
||||
- postgresql-master
|
||||
environment:
|
||||
- POSTGRESQL_REPLICATION_MODE=slave
|
||||
- POSTGRESQL_REPLICATION_USER=repl_user
|
||||
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
|
||||
- POSTGRESQL_MASTER_HOST=postgresql-master
|
||||
- POSTGRESQL_PASSWORD=joplin
|
||||
- POSTGRESQL_MASTER_PORT_NUMBER=5432
|
||||
|
||||
- POSTGRESQL_LOG_HOSTNAME=true
|
||||
- POSTGRESQL_PGAUDIT_LOG=READ,WRITE
|
||||
- POSTGRESQL_EXTRA_FLAGS=-c work_mem=100000 -c log_statement=all
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#
|
||||
# APP_BASE_URL: This is the base public URL where the service will be running.
|
||||
# - If Joplin Server needs to be accessible over the internet, configure APP_BASE_URL as follows: https://example.com/joplin.
|
||||
# - If Joplin Server does not need to be accessible over the internet, set the the APP_BASE_URL to your server's hostname.
|
||||
# - If Joplin Server does not need to be accessible over the internet, set the APP_BASE_URL to your server's hostname.
|
||||
# For Example: http://[hostname]:22300. The base URL can include the port.
|
||||
# APP_PORT: The local port on which the Docker container will listen.
|
||||
# - This would typically be mapped to port to 443 (TLS) with a reverse proxy.
|
||||
|
@@ -1 +1,13 @@
|
||||
<strong>Joplin</strong> is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in <a href="https://joplinapp.org/help/apps/markdown">Markdown format</a>.</p><p>Notes exported from Evernote <a href="https://joplinapp.org/help/apps/import_export">can be imported</a> into Joplin, including the formatted content (which is converted to Markdown), resources (images, attachments, etc.) and complete metadata (geolocation, updated time, created time, etc.). Plain Markdown files can also be imported.</p><p>Joplin is "offline first", which means you always have all your data on your phone or computer. This ensures that your notes are always accessible, whether you have an internet connection or not.</p><p>The notes can be securely <a href="https://joplinapp.org/help/apps/sync">synchronised</a> using <a href="https://joplinapp.org/help/apps/sync/e2ee">end-to-end encryption</a> with various cloud services including Nextcloud, Dropbox, OneDrive and <a href="https://joplinapp.org/plans/" target="_blank" rel="noopener noreferrer">Joplin Cloud</a>.</p><p>Full text search is available on all platforms to quickly find the information you need. The app can be customised using plugins and themes, and you can also easily create your own.</p><p>The application is available for Windows, Linux, macOS, Android and iOS. A <a href="https://joplinapp.org/help/apps/clipper">Web Clipper</a>, to save web pages and screenshots from your browser, is also available for <a href="https://addons.mozilla.org/firefox/addon/joplin-web-clipper/" target="_blank" rel="noopener noreferrer">Firefox</a> and <a href="https://chrome.google.com/webstore/detail/joplin-web-clipper/alofnhikmmkdbbbgpnglcpdollgjjfek?hl=en-GB" target="_blank" rel="noopener noreferrer">Chrome</a>.</p><div class="top-screenshot"><img loading="lazy" src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/home-top-img.png" class="img_node_modules-@docusaurus-theme-classic-lib-theme-MDXComponents-Img-styles-module" style="max-width: 100%; max-height: 35em;">
|
||||
<strong>Joplin</strong> is a free and open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor.
|
||||
|
||||
The notes are in <a href="https://joplinapp.org/help/apps/markdown">Markdown format</a>.
|
||||
|
||||
Notes exported from Evernote <a href="https://joplinapp.org/help/apps/import_export">can be imported</a> into Joplin, including the formatted content (which is converted to Markdown), resources (images, attachments, etc.) and complete metadata (geolocation, updated time, created time, etc.). Plain Markdown files can also be imported.
|
||||
|
||||
Joplin is "offline first", which means you always have all your data on your phone or computer. This ensures that your notes are always accessible, whether you have an internet connection or not.</p>
|
||||
|
||||
The notes can be securely <a href="https://joplinapp.org/help/apps/sync">synchronised</a> using <a href="https://joplinapp.org/help/apps/sync/e2ee">end-to-end encryption</a> with various cloud services including Nextcloud, Dropbox, OneDrive and <a href="https://joplinapp.org/plans/">Joplin Cloud</a>.
|
||||
|
||||
Full text search is available on all platforms to quickly find the information you need. The app can be customised using plugins and themes, and you can also easily create your own.
|
||||
|
||||
The application is available for Windows, Linux, macOS, Android and iOS. A <a href="https://joplinapp.org/help/apps/clipper">Web Clipper</a>, to save web pages and screenshots from your browser, is also available for <a href="https://addons.mozilla.org/firefox/addon/joplin-web-clipper/">Firefox</a> and <a href="https://chrome.google.com/webstore/detail/joplin-web-clipper/alofnhikmmkdbbbgpnglcpdollgjjfek">Chrome</a>.
|
||||
|
@@ -1 +1 @@
|
||||
a note taking and to-do app with sync between Linux, macOS, Windows, and mobile
|
||||
A note taking and to-do app with sync between Linux, macOS, Windows, and mobile
|
13
fastlane/metadata/android/ru/full_description.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
<strong>Joplin</strong> это бесплатное и свободное приложение для создания заметок и списков задач, которое может обрабатывать большое количество заметок, организованных в блокноты. По заметкам есть поиск, их можно копировать, помечать ярлыками и изменять как непосредственно из приложения, так и из вашего собственного текстового редактора.
|
||||
|
||||
Заметки представлены в <a href="https://joplinapp.org/help/apps/markdown">формате Markdown</a>.
|
||||
|
||||
Заметки экспортированные из Evernote <a href="https://joplinapp.org/help/apps/import_export">могут быть импортированы</a> в Joplin, включая отформатированный контент (который преобразуется в Markdown), ресурсы (изображения, вложения и т.д.) и полные метаданные (геолокация, время обновления, время создания и т.д.). Обычные файлы Markdown также можно импортировать.
|
||||
|
||||
Joplin работает "в первую очередь в автономном режиме", что означает, что у вас всегда есть все ваши данные на телефоне или компьютере. Это гарантирует, что ваши заметки всегда будут доступны, независимо от того есть у вас подключение к Интернету или нет.
|
||||
|
||||
Заметки могут быть надежно <a href="https://joplinapp.org/help/apps/sync">синхронизированы</a> с помощью <a href="https://joplinapp.org/help/apps/sync/e2ee">сквозного шифрования</a> на различные облачные сервисы, включая Nextcloud, Dropbox, OneDrive и <a href="https://joplinapp.org/plans/">Joplin Cloud</a>.
|
||||
|
||||
Полнотекстовый поиск доступен на всех платформах для быстрого поиска нужной вам информации. Приложение можно настроить с помощью плагинов и тем, а также легко создать свои.
|
||||
|
||||
Приложение доступно для Windows, Linux, macOS, Android и iOS. A <a href="https://joplinapp.org/help/apps/clipper">Веб-клипер</a> для сохранения веб-страниц и скриншотов из вашего браузера, также доступен для <a href="https://addons.mozilla.org/firefox/addon/joplin-web-clipper/">Firefox</a> и <a href="https://chrome.google.com/webstore/detail/joplin-web-clipper/alofnhikmmkdbbbgpnglcpdollgjjfek">Chrome</a>.
|
1
fastlane/metadata/android/ru/short_description.txt
Normal file
@@ -0,0 +1 @@
|
||||
Заметки и списки дел с синхронизацией с Linux, macOS, Windows и мобильным
|
@@ -106,7 +106,6 @@
|
||||
"./packages/renderer/**/node_modules/": true,
|
||||
".eslintignore": true,
|
||||
".gitignore": true,
|
||||
".vscode/*": true,
|
||||
".yarn/cache": true,
|
||||
".yarn/install-state.gz": true,
|
||||
".yarn/plugins": true,
|
||||
|
10
package.json
@@ -9,7 +9,7 @@
|
||||
"url": "git+https://github.com/laurent22/joplin.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=18"
|
||||
},
|
||||
"scripts": {
|
||||
"buildApiDoc": "yarn workspace joplin start apidoc ../../readme/api/references/rest_api.md",
|
||||
@@ -40,7 +40,7 @@
|
||||
"postinstall": "gulp build",
|
||||
"postPreReleasesToForum": "node ./packages/tools/postPreReleasesToForum",
|
||||
"publishAll": "git pull && yarn buildParallel && lerna version --yes --no-private --no-git-tag-version && gulp completePublishAll",
|
||||
"releaseAndroid": "PATH=\"/usr/local/opt/openjdk@11/bin:$PATH\" node packages/tools/release-android.js",
|
||||
"releaseAndroid": "PATH=\"/usr/local/opt/openjdk@17/bin:$PATH\" node packages/tools/release-android.js",
|
||||
"releaseAndroidClean": "node packages/tools/release-android.js",
|
||||
"releaseCli": "node packages/tools/release-cli.js",
|
||||
"releaseClipper": "node packages/tools/release-clipper.js",
|
||||
@@ -86,7 +86,7 @@
|
||||
"gulp": "4.0.2",
|
||||
"husky": "3.1.0",
|
||||
"lerna": "3.22.1",
|
||||
"lint-staged": "15.2.0",
|
||||
"lint-staged": "15.2.2",
|
||||
"madge": "6.1.0",
|
||||
"npm-package-json-lint": "7.1.0",
|
||||
"typescript": "5.2.2"
|
||||
@@ -104,11 +104,11 @@
|
||||
"react-native-vosk@0.1.12": "patch:react-native-vosk@npm%3A0.1.12#./.yarn/patches/react-native-vosk-npm-0.1.12-76b1caaae8.patch",
|
||||
"eslint": "patch:eslint@8.52.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch",
|
||||
"app-builder-lib@24.4.0": "patch:app-builder-lib@npm%3A24.4.0#./.yarn/patches/app-builder-lib-npm-24.4.0-05322ff057.patch",
|
||||
"react-native@0.71.10": "patch:react-native@npm%3A0.71.10#./.yarn/patches/react-native-animation-fix/react-native-npm-0.71.10-f9c32562d8.patch",
|
||||
"nanoid": "patch:nanoid@npm%3A3.3.7#./.yarn/patches/nanoid-npm-3.3.7-98824ba130.patch",
|
||||
"pdfjs-dist": "patch:pdfjs-dist@npm%3A3.11.174#./.yarn/patches/pdfjs-dist-npm-3.11.174-67f2fee6d6.patch",
|
||||
"@react-native-community/slider": "patch:@react-native-community/slider@npm%3A4.4.4#./.yarn/patches/@react-native-community-slider-npm-4.4.4-d78e472f48.patch",
|
||||
"husky": "patch:husky@npm%3A3.1.0#./.yarn/patches/husky-npm-3.1.0-5cc13e4e34.patch",
|
||||
"chokidar@^2.0.0": "3.5.3"
|
||||
"chokidar@^2.0.0": "3.5.3",
|
||||
"react-native@0.74.1": "patch:react-native@npm%3A0.74.1#./.yarn/patches/react-native-npm-0.74.1-754c02ae9e.patch"
|
||||
}
|
||||
}
|
||||
|
@@ -452,7 +452,7 @@ class Application extends BaseApplication {
|
||||
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));
|
||||
await refreshFolders((action: any) => this.store().dispatch(action), '');
|
||||
|
||||
const tags = await Tag.allWithNotes();
|
||||
|
||||
|
@@ -239,11 +239,6 @@ async function fetchAllNotes() {
|
||||
type: Database.enumId('fieldType', 'text'),
|
||||
description: 'If an image is provided, you can also specify an optional rectangle that will be used to crop the image. In format `{ x: x, y: y, width: width, height: height }`',
|
||||
});
|
||||
// tableFields.push({
|
||||
// name: 'tags',
|
||||
// type: Database.enumId('fieldType', 'text'),
|
||||
// description: 'Comma-separated list of tags. eg. `tag1,tag2`.',
|
||||
// });
|
||||
}
|
||||
|
||||
lines.push(`## ${toTitleCase(tableName)}`);
|
||||
@@ -269,6 +264,11 @@ async function fetchAllNotes() {
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
if (model.type === BaseModel.TYPE_NOTE) {
|
||||
lines.push('By default, this call will return the all notes **except** the notes in the trash folder and any conflict note. To include these too, you can specify `include_deleted=1` and `include_conflicts=1` as query parameters.');
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
lines.push(`### GET /${tableName}/:id`);
|
||||
lines.push('');
|
||||
lines.push(`Gets ${singular} with ID :id`);
|
||||
|
@@ -26,7 +26,7 @@ const sharp = require('sharp');
|
||||
const { shimInit } = require('@joplin/lib/shim-init-node.js');
|
||||
const shim = require('@joplin/lib/shim').default;
|
||||
const { _ } = require('@joplin/lib/locale');
|
||||
const { FileApiDriverLocal } = require('@joplin/lib/file-api-driver-local');
|
||||
const FileApiDriverLocal = require('@joplin/lib/file-api-driver-local').default;
|
||||
const EncryptionService = require('@joplin/lib/services/e2ee/EncryptionService').default;
|
||||
const envFromArgs = require('@joplin/lib/envFromArgs');
|
||||
const nodeSqlite = require('sqlite3');
|
||||
|
@@ -5,6 +5,8 @@ import executeSandboxCall from '@joplin/lib/services/plugins/utils/executeSandbo
|
||||
import Global from '@joplin/lib/services/plugins/api/Global';
|
||||
import mapEventHandlersToIds, { EventHandlers } from '@joplin/lib/services/plugins/utils/mapEventHandlersToIds';
|
||||
import uuid from '@joplin/lib/uuid';
|
||||
import Joplin from '@joplin/lib/services/plugins/api/Joplin';
|
||||
import { Console } from 'console';
|
||||
const sandboxProxy = require('@joplin/lib/services/plugins/sandboxProxy');
|
||||
|
||||
function createConsoleWrapper(pluginId: string) {
|
||||
@@ -33,11 +35,18 @@ function createConsoleWrapper(pluginId: string) {
|
||||
// For example, all plugin calls go through a proxy, however they could made directly since
|
||||
// the plugin script is running within the same process as the main app.
|
||||
|
||||
interface SandboxProxy {
|
||||
joplin: Joplin;
|
||||
console: typeof Console;
|
||||
stop: ()=> void;
|
||||
}
|
||||
|
||||
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 = {};
|
||||
private sandboxProxies: Map<string, SandboxProxy> = new Map();
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
@@ -52,8 +61,14 @@ export default class PluginRunner extends BasePluginRunner {
|
||||
}
|
||||
|
||||
private newSandboxProxy(pluginId: string, sandbox: Global) {
|
||||
let stopped = false;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const target = async (path: string, args: any[]) => {
|
||||
if (stopped) {
|
||||
throw new Error(`Plugin with ID ${pluginId} has been stopped. Cannot execute sandbox call.`);
|
||||
}
|
||||
|
||||
const callId = `${pluginId}::${path}::${uuid.createNano()}`;
|
||||
this.activeSandboxCalls_[callId] = true;
|
||||
const promise = executeSandboxCall(pluginId, sandbox, `joplin.${path}`, mapEventHandlersToIds(args, this.eventHandlers_), this.eventHandler);
|
||||
@@ -64,10 +79,15 @@ export default class PluginRunner extends BasePluginRunner {
|
||||
return promise;
|
||||
};
|
||||
|
||||
return {
|
||||
const proxy = {
|
||||
joplin: sandboxProxy(target),
|
||||
console: createConsoleWrapper(pluginId),
|
||||
stop: () => {
|
||||
stopped = true;
|
||||
},
|
||||
};
|
||||
this.sandboxProxies.set(pluginId, proxy);
|
||||
return proxy;
|
||||
}
|
||||
|
||||
public async run(plugin: Plugin, sandbox: Global): Promise<void> {
|
||||
@@ -90,6 +110,13 @@ export default class PluginRunner extends BasePluginRunner {
|
||||
});
|
||||
}
|
||||
|
||||
public async stop(plugin: Plugin): Promise<void> {
|
||||
// TODO: Node VM doesn't support stopping plugins without running them in a child process.
|
||||
// For now, we stop the plugin by making interactions with the Joplin API throw Errors.
|
||||
const proxy = this.sandboxProxies.get(plugin.id);
|
||||
proxy?.stop();
|
||||
}
|
||||
|
||||
public async waitForSandboxCalls(): Promise<void> {
|
||||
const startTime = Date.now();
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
|
@@ -35,7 +35,7 @@
|
||||
],
|
||||
"owner": "Laurent Cozic"
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"bin": "./main.js",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
@@ -63,7 +63,7 @@
|
||||
"string-padding": "1.0.2",
|
||||
"strip-ansi": "6.0.1",
|
||||
"tcp-port-used": "1.0.2",
|
||||
"terminal-kit": "3.0.1",
|
||||
"terminal-kit": "3.0.2",
|
||||
"tkwidgets": "0.5.27",
|
||||
"url-parse": "1.5.10",
|
||||
"word-wrap": "1.2.5",
|
||||
@@ -73,7 +73,7 @@
|
||||
"@joplin/tools": "~3.0",
|
||||
"@types/fs-extra": "11.0.4",
|
||||
"@types/jest": "29.5.8",
|
||||
"@types/node": "18.19.8",
|
||||
"@types/node": "18.19.26",
|
||||
"@types/proper-lockfile": "^4.1.2",
|
||||
"gulp": "4.0.2",
|
||||
"jest": "29.7.0",
|
||||
|
@@ -49,6 +49,8 @@ describe('MdToHtml', () => {
|
||||
checkboxRenderingType: 2,
|
||||
},
|
||||
};
|
||||
} else if (mdFilename.startsWith('sourcemap_')) {
|
||||
mdToHtmlOptions.mapsToLine = true;
|
||||
}
|
||||
|
||||
const markdown = await shim.fsDriver().readFile(mdFilePath);
|
||||
|
24
packages/app-cli/tests/html_to_md/code_multiline_1.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!-- this is from: https://flaviocopes.com/bubble-sort-javascript/ -->
|
||||
<div><pre class="astro-code github-dark" style="background-color: rgb(36, 41, 46); color: rgb(225, 228, 232); overflow-x: auto; --darkreader-inline-bgcolor: #1d2125; --darkreader-inline-color: #d7d4cf; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;" tabindex="0" data-darkreader-inline-bgcolor="" data-darkreader-inline-color=""><code><span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">const</span><span style="color: rgb(179, 146, 240); --darkreader-inline-color: #ab86ee;" data-darkreader-inline-color=""> bubbleSort</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> =</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> (</span><span style="color: rgb(255, 171, 112); --darkreader-inline-color: #ffa668;" data-darkreader-inline-color="">originalArray</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">) </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">=></span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> {</span></span>
|
||||
<span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> let</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> swapped </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">=</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> false</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> const</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> a</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> =</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> [</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">...</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">originalArray]</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> for</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> (</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">let</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> i </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">=</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> 1</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">; i </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""><</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> a.</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color="">length</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> -</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> 1</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">; i</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">++</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">) {</span></span>
|
||||
<span class="line"><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> swapped </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">=</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> false</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> for</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> (</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">let</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> j </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">=</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> 0</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">; j </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""><</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> a.</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color="">length</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> -</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> i; j</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">++</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">) {</span></span>
|
||||
<span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> if</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> (a[j </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">+</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> 1</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">] </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""><</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> a[j]) {</span></span>
|
||||
<span class="line"><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> ;[a[j], a[j </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">+</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> 1</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">]] </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">=</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> [a[j </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">+</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> 1</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">], a[j]]</span></span>
|
||||
<span class="line"><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> swapped </span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">=</span><span style="color: rgb(121, 184, 255); --darkreader-inline-color: #6ebdff;" data-darkreader-inline-color=""> true</span></span>
|
||||
<span class="line"><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> }</span></span>
|
||||
<span class="line"><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> }</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> if</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> (</span><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color="">!</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">swapped) {</span></span>
|
||||
<span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> return</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> a</span></span>
|
||||
<span class="line"><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> }</span></span>
|
||||
<span class="line"><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> }</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color: rgb(249, 117, 131); --darkreader-inline-color: #f96e7c;" data-darkreader-inline-color=""> return</span><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color=""> a</span></span>
|
||||
<span class="line"><span style="color: rgb(225, 228, 232); --darkreader-inline-color: #d7d4cf;" data-darkreader-inline-color="">}</span></span></code></pre>
|
||||
<p></p></div>
|
24
packages/app-cli/tests/html_to_md/code_multiline_1.md
Normal file
@@ -0,0 +1,24 @@
|
||||
```
|
||||
const bubbleSort = (originalArray) => {
|
||||
let swapped = false
|
||||
|
||||
const a = [...originalArray]
|
||||
|
||||
for (let i = 1; i < a.length - 1; i++) {
|
||||
swapped = false
|
||||
|
||||
for (let j = 0; j < a.length - i; j++) {
|
||||
if (a[j + 1] < a[j]) {
|
||||
;[a[j], a[j + 1]] = [a[j + 1], a[j]]
|
||||
swapped = true
|
||||
}
|
||||
}
|
||||
|
||||
if (!swapped) {
|
||||
return a
|
||||
}
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
```
|
21
packages/app-cli/tests/html_to_md/code_multiline_2.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!-- this is from: https://blog.csdn.net/qq_42025798/article/details/121727781 -->
|
||||
<div><pre data-index="6" class="prettyprint set-code-show" style="font-family: "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif;"><code class="prism language-java has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;"><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">User</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">private</span> <span class="token class-name">String</span> name<span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">public</span> <span class="token class-name">String</span> <span class="token function">getName</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span> name<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">setName</span><span class="token punctuation">(</span><span class="token class-name">String</span> name<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">this</span><span class="token punctuation">.</span>name <span class="token operator">=</span> name<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token annotation punctuation">@Override</span>
|
||||
<span class="token keyword">public</span> <span class="token class-name">String</span> <span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span> <span class="token string">"User{"</span> <span class="token operator">+</span>
|
||||
<span class="token string">"name='"</span> <span class="token operator">+</span> name <span class="token operator">+</span> <span class="token string">'\''</span> <span class="token operator">+</span>
|
||||
<span class="token string">'}'</span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">1</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">2</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">3</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">4</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">5</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">6</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">7</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">8</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">9</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">10</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">11</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">12</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">13</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">14</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">15</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">16</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">17</li><li style="color: rgb(153, 153, 153); --darkreader-inline-color: #a8a095;" data-darkreader-inline-color="">18</li></ul></pre>
|
||||
<h4></h4></div>
|
20
packages/app-cli/tests/html_to_md/code_multiline_2.md
Normal file
@@ -0,0 +1,20 @@
|
||||
```
|
||||
public class User {
|
||||
private String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User{" +
|
||||
"name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
```
|
2
packages/app-cli/tests/html_to_md/code_multiline_3.html
Normal file
16
packages/app-cli/tests/html_to_md/code_multiline_3.md
Normal file
@@ -0,0 +1,16 @@
|
||||
```typescript
|
||||
// Import the Joplin API
|
||||
import joplin from 'api';
|
||||
|
||||
// Register the plugin
|
||||
joplin.plugins.register({
|
||||
|
||||
// Run initialisation code in the onStart event handler
|
||||
// Note that due to the plugin multi-process architecture, you should
|
||||
// always assume that all function calls and event handlers are async.
|
||||
onStart: async function() {
|
||||
console.info('TOC plugin started!');
|
||||
},
|
||||
|
||||
});
|
||||
```
|
2
packages/app-cli/tests/html_to_md/code_multiline_4.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<!-- this is from: https://blog.csdn.net/ch5256865/article/details/52957360 -->
|
||||
<pre data-index="0" class="set-code-show" name="code" style="font-family: Consolas, Inconsolata, Courier, monospace;"><code class="hljs language-javascript"><ol class="hljs-ln" style="width:100%"><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="1"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"><span class="hljs-keyword">let</span> str = <span class="hljs-string">` hello world ! `</span>;</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="2"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"><span class="hljs-keyword">let</span> _trim = <span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) {</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="3"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> <span class="hljs-variable language_">this</span> == <span class="hljs-string">"number"</span>) <span class="hljs-keyword">new</span> <span class="hljs-title class_">Error</span>(<span class="hljs-string">"Invalid or unexpected token"</span>);</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="4"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> <span class="hljs-variable language_">this</span> !== <span class="hljs-string">"string"</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="5"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Error</span>(<span class="hljs-string">"Cannot read property 'trim' of"</span> + <span class="hljs-variable language_">this</span>);</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="6"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> <span class="hljs-keyword">let</span> reg = <span class="hljs-regexp">/^\s*|\s*$/g</span>;</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="7"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> <span class="hljs-keyword">return</span> <span class="hljs-variable language_">this</span>.<span class="hljs-title function_">replace</span>(reg, <span class="hljs-string">""</span>);</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="8"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line">};</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="9"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> </div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="10"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"><span class="hljs-title class_">String</span>.<span class="hljs-property"><span class="hljs-keyword">prototype</span></span>.<span class="hljs-property">_trim</span> = _trim;</div></div></li></ol></code></pre>
|
12
packages/app-cli/tests/html_to_md/code_multiline_4.md
Normal file
@@ -0,0 +1,12 @@
|
||||
```
|
||||
let str = ` hello world ! `;
|
||||
let _trim = function () {
|
||||
if (typeof this == "number") new Error("Invalid or unexpected token");
|
||||
if (typeof this !== "string")
|
||||
new Error("Cannot read property 'trim' of" + this);
|
||||
let reg = /^\s*|\s*$/g;
|
||||
return this.replace(reg, "");
|
||||
};
|
||||
|
||||
String.prototype._trim = _trim;
|
||||
```
|
42
packages/app-cli/tests/html_to_md/code_multiline_5.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- this is from: https://www.slingacademy.com/article/python-aiohttp-how-to-download-files-using-streams/ -->
|
||||
<div><pre class="wp-block-code prettyprinted" style="font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;"><code class=" prettyprinted" style=""><span class="com"><span class="com"># SlingAcademy.com</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="com"><span class="com"># This code uses Python 3.11.4</span></span><span class="pln"><span class="pln">
|
||||
|
||||
</span></span><span class="kwd"><span class="kwd">import</span></span><span class="pln"><span class="pln"> asyncio
|
||||
</span></span><span class="kwd"><span class="kwd">import</span></span><span class="pln"><span class="pln"> aiohttp
|
||||
|
||||
</span></span><span class="com"><span class="com"># This function downloads a file from a URL and saves it to a local file</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="com"><span class="com"># The function is asynchronous and can handle large files because it uses aiohttp streams</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">async</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">def</span></span><span class="pln"><span class="pln"> download_file</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">url</span></span><span class="pun"><span class="pun">,</span></span><span class="pln"><span class="pln"> filename</span></span><span class="pun"><span class="pun">):</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">async</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">with</span></span><span class="pln"><span class="pln"> aiohttp</span></span><span class="pun"><span class="pun">.</span></span><span class="typ"><span class="typ">ClientSession</span></span><span class="pun"><span class="pun">()</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">as</span></span><span class="pln"><span class="pln"> session</span></span><span class="pun"><span class="pun">:</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">print</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">f</span></span><span class="str"><span class="str">"Starting download file from {url}"</span></span><span class="pun"><span class="pun">)</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">async</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">with</span></span><span class="pln"><span class="pln"> session</span></span><span class="pun"><span class="pun">.</span></span><span class="kwd"><span class="kwd">get</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">url</span></span><span class="pun"><span class="pun">)</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">as</span></span><span class="pln"><span class="pln"> response</span></span><span class="pun"><span class="pun">:</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">assert</span></span><span class="pln"><span class="pln"> response</span></span><span class="pun"><span class="pun">.</span></span><span class="pln"><span class="pln">status </span></span><span class="pun"><span class="pun">==</span></span><span class="pln"><span class="pln"> </span></span><span class="lit"><span class="lit">200</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">with</span></span><span class="pln"><span class="pln"> open</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">filename</span></span><span class="pun"><span class="pun">,</span></span><span class="pln"><span class="pln"> </span></span><span class="str"><span class="str">"wb"</span></span><span class="pun"><span class="pun">)</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">as</span></span><span class="pln"><span class="pln"> f</span></span><span class="pun"><span class="pun">:</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">while</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">True</span></span><span class="pun"><span class="pun">:</span></span><span class="pln"><span class="pln">
|
||||
chunk </span></span><span class="pun"><span class="pun">=</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">await</span></span><span class="pln"><span class="pln"> response</span></span><span class="pun"><span class="pun">.</span></span><span class="pln"><span class="pln">content</span></span><span class="pun"><span class="pun">.</span></span><span class="pln"><span class="pln">readany</span></span><span class="pun"><span class="pun">()</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">if</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">not</span></span><span class="pln"><span class="pln"> chunk</span></span><span class="pun"><span class="pun">:</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">break</span></span><span class="pln"><span class="pln">
|
||||
f</span></span><span class="pun"><span class="pun">.</span></span><span class="pln"><span class="pln">write</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">chunk</span></span><span class="pun"><span class="pun">)</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">print</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">f</span></span><span class="str"><span class="str">"Downloaded {filename} from {url}"</span></span><span class="pun"><span class="pun">)</span></span><span class="pln"><span class="pln">
|
||||
|
||||
|
||||
</span></span><span class="com"><span class="com"># This function downloads two files at the same time</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">async</span></span><span class="pln"><span class="pln"> </span></span><span class="kwd"><span class="kwd">def</span></span><span class="pln"><span class="pln"> main</span></span><span class="pun"><span class="pun">():</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="kwd"><span class="kwd">await</span></span><span class="pln"><span class="pln"> asyncio</span></span><span class="pun"><span class="pun">.</span></span><span class="pln"><span class="pln">gather</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="com"><span class="com"># download a CSV file</span></span><span class="pln"><span class="pln">
|
||||
download_file</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="str"><span class="str">"https://api.slingacademy.com/v1/sample-data/files/student-scores.csv"</span></span><span class="pun"><span class="pun">,</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="str"><span class="str">"test.csv"</span></span><span class="pun"><span class="pun">,</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="pun"><span class="pun">),</span></span><span class="pln"><span class="pln">
|
||||
|
||||
</span></span><span class="com"><span class="com"># download a PDF file</span></span><span class="pln"><span class="pln">
|
||||
download_file</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="str"><span class="str">"https://api.slingacademy.com/v1/sample-data/files/text-and-table.pdf"</span></span><span class="pun"><span class="pun">,</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="str"><span class="str">"test.pdf"</span></span><span class="pun"><span class="pun">,</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="pun"><span class="pun">),</span></span><span class="pln"><span class="pln">
|
||||
</span></span><span class="pun"><span class="pun">)</span></span><span class="pln"><span class="pln">
|
||||
|
||||
</span></span><span class="com"><span class="com"># Run the main function</span></span><span class="pln"><span class="pln">
|
||||
asyncio</span></span><span class="pun"><span class="pun">.</span></span><span class="pln"><span class="pln">run</span></span><span class="pun"><span class="pun">(</span></span><span class="pln"><span class="pln">main</span></span><span class="pun"><span class="pun">())</span></span></code></pre><span class="ezoic-autoinsert-video ezoic-mid_content"></span>
|
||||
<p></p></div>
|
42
packages/app-cli/tests/html_to_md/code_multiline_5.md
Normal file
@@ -0,0 +1,42 @@
|
||||
```
|
||||
# SlingAcademy.com
|
||||
# This code uses Python 3.11.4
|
||||
|
||||
import asyncio
|
||||
import aiohttp
|
||||
|
||||
# This function downloads a file from a URL and saves it to a local file
|
||||
# The function is asynchronous and can handle large files because it uses aiohttp streams
|
||||
async def download_file(url, filename):
|
||||
async with aiohttp.ClientSession() as session:
|
||||
print(f"Starting download file from {url}")
|
||||
async with session.get(url) as response:
|
||||
assert response.status == 200
|
||||
with open(filename, "wb") as f:
|
||||
while True:
|
||||
chunk = await response.content.readany()
|
||||
if not chunk:
|
||||
break
|
||||
f.write(chunk)
|
||||
print(f"Downloaded {filename} from {url}")
|
||||
|
||||
|
||||
# This function downloads two files at the same time
|
||||
async def main():
|
||||
await asyncio.gather(
|
||||
# download a CSV file
|
||||
download_file(
|
||||
"https://api.slingacademy.com/v1/sample-data/files/student-scores.csv",
|
||||
"test.csv",
|
||||
),
|
||||
|
||||
# download a PDF file
|
||||
download_file(
|
||||
"https://api.slingacademy.com/v1/sample-data/files/text-and-table.pdf",
|
||||
"test.pdf",
|
||||
),
|
||||
)
|
||||
|
||||
# Run the main function
|
||||
asyncio.run(main())
|
||||
```
|
1
packages/app-cli/tests/md_to_html/sanitize_19.html
Normal file
@@ -0,0 +1 @@
|
||||
<div><span class="jop-noMdConv">This is a comment we would like to keep</div></form>
|
1
packages/app-cli/tests/md_to_html/sanitize_19.md
Normal file
@@ -0,0 +1 @@
|
||||
<form><span>This is a comment we would like to keep</span></form>
|
21
packages/app-cli/tests/md_to_html/sourcemap_table.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<div class="joplin-table-wrapper">
|
||||
<table class="maps-to-line" source-line="0" source-line-end="3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>This</th>
|
||||
<th>is</th>
|
||||
<th>a</th>
|
||||
<th>test</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>This</td>
|
||||
<td>table</td>
|
||||
<td>has</td>
|
||||
<td>line numbers</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="maps-to-line" source-line="4" source-line-end="5">When <code class="inline-code">mapsToLine</code> is enabled for this file, the table above should have line numbers that link to the original markdown.</p>
|
5
packages/app-cli/tests/md_to_html/sourcemap_table.md
Normal file
@@ -0,0 +1,5 @@
|
||||
| This | is | a | test |
|
||||
|------|----|---|------|
|
||||
| This | table | has | line numbers |
|
||||
|
||||
When `mapsToLine` is enabled for this file, the table above should have line numbers that link to the original markdown.
|
@@ -1,5 +1,5 @@
|
||||
import PluginRunner from '../../../app/services/plugins/PluginRunner';
|
||||
import PluginService, { PluginSettings } from '@joplin/lib/services/plugins/PluginService';
|
||||
import PluginService, { PluginSettings, defaultPluginSetting } from '@joplin/lib/services/plugins/PluginService';
|
||||
import { ContentScriptType } from '@joplin/lib/services/plugins/api/types';
|
||||
import MdToHtml from '@joplin/renderer/MdToHtml';
|
||||
import shim from '@joplin/lib/shim';
|
||||
@@ -9,6 +9,7 @@ import Note from '@joplin/lib/models/Note';
|
||||
import Folder from '@joplin/lib/models/Folder';
|
||||
import { expectNotThrow, setupDatabaseAndSynchronizer, switchClient, expectThrow, createTempDir, supportDir, mockMobilePlatform } from '@joplin/lib/testing/test-utils';
|
||||
import { newPluginScript } from '../../testUtils';
|
||||
import { join } from 'path';
|
||||
|
||||
const testPluginDir = `${supportDir}/plugins`;
|
||||
|
||||
@@ -283,10 +284,11 @@ describe('services_PluginService', () => {
|
||||
shouldRun: true,
|
||||
},
|
||||
{
|
||||
// Should default to desktop-only
|
||||
manifestPlatforms: [],
|
||||
isDesktop: false,
|
||||
appVersion: '3.0.8',
|
||||
shouldRun: true,
|
||||
shouldRun: false,
|
||||
},
|
||||
])('should enable and disable plugins depending on what platform(s) they support (case %#: %j)', async ({ manifestPlatforms, isDesktop, appVersion, shouldRun }) => {
|
||||
const pluginScript = `
|
||||
@@ -396,4 +398,78 @@ describe('services_PluginService', () => {
|
||||
expect(newPluginSettings[pluginId1]).toBe(undefined);
|
||||
expect(newPluginSettings[pluginId2]).toBe(undefined);
|
||||
});
|
||||
|
||||
it('re-running loadAndRunPlugins should reload plugins that have changed but keep unchanged plugins running', async () => {
|
||||
const testDir = await createTempDir();
|
||||
try {
|
||||
const loadCounterNote = await Note.save({ title: 'Log of plugin loads' });
|
||||
const readLoadCounterNote = async () => {
|
||||
return (await Note.load(loadCounterNote.id)).body;
|
||||
};
|
||||
expect(await readLoadCounterNote()).toBe('');
|
||||
|
||||
const writePluginScript = async (version: string, id: string) => {
|
||||
const script = `
|
||||
/* joplin-manifest:
|
||||
{
|
||||
"id": ${JSON.stringify(id)},
|
||||
"manifest_version": 1,
|
||||
"app_min_version": "1.0.0",
|
||||
"name": "JS Bundle test",
|
||||
"version": ${JSON.stringify(version)}
|
||||
}
|
||||
*/
|
||||
|
||||
joplin.plugins.register({
|
||||
onStart: async function() {
|
||||
const noteId = ${JSON.stringify(loadCounterNote.id)};
|
||||
const pluginId = ${JSON.stringify(id)};
|
||||
const note = await joplin.data.get(['notes', noteId], { fields: ['body'] });
|
||||
const newBody = note.body + '\\n' + pluginId;
|
||||
await joplin.data.put(['notes', noteId], null, { body: newBody.trim() });
|
||||
},
|
||||
});
|
||||
`;
|
||||
await fs.writeFile(join(testDir, `${id}.bundle.js`), script);
|
||||
};
|
||||
|
||||
const service = newPluginService();
|
||||
const pluginId1 = 'org.joplinapp.testPlugin1';
|
||||
await writePluginScript('0.0.1', pluginId1);
|
||||
const pluginId2 = 'org.joplinapp.testPlugin2';
|
||||
await writePluginScript('0.0.1', pluginId2);
|
||||
|
||||
let pluginSettings: PluginSettings = {
|
||||
[pluginId1]: defaultPluginSetting(),
|
||||
[pluginId2]: defaultPluginSetting(),
|
||||
};
|
||||
await service.loadAndRunPlugins(testDir, pluginSettings);
|
||||
|
||||
// Plugins should initially load once
|
||||
expect(service.pluginIds).toHaveLength(2);
|
||||
expect(service.pluginById(pluginId1).running).toBe(true);
|
||||
expect(service.pluginById(pluginId2).running).toBe(true);
|
||||
expect(await readLoadCounterNote()).toBe(`${pluginId1}\n${pluginId2}`);
|
||||
|
||||
// Updating just plugin 1 reload just plugin 1.
|
||||
await writePluginScript('0.0.2', pluginId1);
|
||||
await service.loadAndRunPlugins(testDir, pluginSettings);
|
||||
|
||||
expect(service.pluginById(pluginId1).running).toBe(true);
|
||||
expect(service.pluginById(pluginId2).running).toBe(true);
|
||||
expect(await readLoadCounterNote()).toBe(`${pluginId1}\n${pluginId2}\n${pluginId1}`);
|
||||
|
||||
// Disabling plugin 1 should not reload plugin 2
|
||||
pluginSettings = { ...pluginSettings, [pluginId1]: { ...defaultPluginSetting(), enabled: false } };
|
||||
await service.loadAndRunPlugins(testDir, pluginSettings);
|
||||
|
||||
expect(service.pluginById(pluginId1).running).toBe(false);
|
||||
expect(service.pluginById(pluginId2).running).toBe(true);
|
||||
expect(await readLoadCounterNote()).toBe(`${pluginId1}\n${pluginId2}\n${pluginId1}`);
|
||||
|
||||
await service.destroy();
|
||||
} finally {
|
||||
await fs.remove(testDir);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -47,6 +47,42 @@ const registerMakeThumbnailCommand = async () => {
|
||||
await joplin.views.toolbarButtons.create('makeThumbnailButton', 'makeThumbnail', ToolbarButtonLocation.EditorToolbar);
|
||||
};
|
||||
|
||||
const registerMakeThumbnailFromUrlCommand = async () => {
|
||||
await joplin.commands.register({
|
||||
name: 'makeThumbnailFromUrl',
|
||||
execute: async () => {
|
||||
const urls = [
|
||||
'https://github.com/laurent22/joplin/blob/dev/Assets/ImageSources/RoundedCornersMac_1024x1024.png?raw=true',
|
||||
'https://github.com/laurent22/joplin/blob/dev/packages/app-cli/tests/ocr_samples/multi_page__embedded_text.pdf?raw=true',
|
||||
]
|
||||
|
||||
for (const url of urls) {
|
||||
// ---------------------------------------------------------------
|
||||
// Create an image from URLs
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
const imageHandle = await joplin.imaging.createFromPath(url);
|
||||
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('makeThumbnailFromUrlButton', 'makeThumbnailFromUrl', ToolbarButtonLocation.EditorToolbar);
|
||||
};
|
||||
|
||||
const registerInlinePdfCommand = async () => {
|
||||
await joplin.commands.register({
|
||||
@@ -106,5 +142,6 @@ joplin.plugins.register({
|
||||
onStart: async function() {
|
||||
await registerMakeThumbnailCommand();
|
||||
await registerInlinePdfCommand();
|
||||
await registerMakeThumbnailFromUrlCommand();
|
||||
},
|
||||
});
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -10,5 +10,5 @@ document.addEventListener('click', async (event) => {
|
||||
})
|
||||
|
||||
console.info('webview.js: registering message listener');
|
||||
webviewApi.onMessage((message) => console.info('webview.js: got message:', message));
|
||||
webviewApi.onMessage((event) => console.info('webview.js: got message:', event.message));
|
||||
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -43,9 +43,9 @@ export interface Command {
|
||||
* Or | \|\| | "noteIsTodo \|\| noteTodoCompleted"
|
||||
* And | && | "oneNoteSelected && !inConflictFolder"
|
||||
*
|
||||
* Joplin, unlike VSCode, also supports parenthesis, which allows creating
|
||||
* Joplin, unlike VSCode, also supports parentheses, which allows creating
|
||||
* more complex expressions such as `cond1 || (cond2 && cond3)`. Only one
|
||||
* level of parenthesis is possible (nested ones aren't supported).
|
||||
* level of parentheses is possible (nested ones aren't supported).
|
||||
*
|
||||
* Currently the supported context variables aren't documented, but you can
|
||||
* find the list below:
|
||||
|
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Not a task
|
||||
---
|
||||
|
||||
This is a note.
|
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: Task
|
||||
completed?: yes
|
||||
---
|
||||
|
||||
This is a test. This task should import as completed.
|
@@ -26,6 +26,10 @@ export interface AppStateDialog {
|
||||
props: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface EditorScrollPercents {
|
||||
[noteId: string]: number;
|
||||
}
|
||||
|
||||
export interface AppState extends State {
|
||||
route: AppStateRoute;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
@@ -34,8 +38,7 @@ export interface AppState extends State {
|
||||
// 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;
|
||||
lastEditorScrollPercents: EditorScrollPercents;
|
||||
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.
|
||||
|
@@ -204,7 +204,7 @@ class Application extends BaseApplication {
|
||||
public updateEditorFont() {
|
||||
const fontFamilies = [];
|
||||
if (Setting.value('style.editor.fontFamily')) fontFamilies.push(`"${Setting.value('style.editor.fontFamily')}"`);
|
||||
fontFamilies.push('Avenir, Arial, sans-serif');
|
||||
fontFamilies.push('\'Avenir Next\', Avenir, Arial, sans-serif');
|
||||
|
||||
// The '*' and '!important' parts are necessary to make sure Russian text is displayed properly
|
||||
// https://github.com/laurent22/joplin/issues/155
|
||||
@@ -390,6 +390,8 @@ class Application extends BaseApplication {
|
||||
|
||||
argv = await super.start(argv, startOptions);
|
||||
|
||||
bridge().setLogFilePath(Logger.globalLogger.logFilePath());
|
||||
|
||||
await this.applySettingsSideEffects();
|
||||
|
||||
if (Setting.value('sync.upgradeState') === Setting.SYNC_UPGRADE_STATE_MUST_DO) {
|
||||
@@ -418,6 +420,7 @@ class Application extends BaseApplication {
|
||||
AlarmService.setDriver(new AlarmServiceDriverNode({ appName: packageInfo.build.appId }));
|
||||
AlarmService.setLogger(reg.logger());
|
||||
|
||||
reg.setDispatch(this.dispatch.bind(this));
|
||||
reg.setShowErrorMessageBoxHandler((message: string) => { bridge().showErrorMessageBox(message); });
|
||||
|
||||
if (Setting.value('flagOpenDevTools')) {
|
||||
@@ -465,7 +468,7 @@ class Application extends BaseApplication {
|
||||
Setting.dispatchUpdateAll();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
await refreshFolders((action: any) => this.dispatch(action));
|
||||
await refreshFolders((action: any) => this.dispatch(action), '');
|
||||
|
||||
const tags = await Tag.allWithNotes();
|
||||
|
||||
|
@@ -6,11 +6,14 @@ import { dirname, toSystemSlashes } from '@joplin/lib/path-utils';
|
||||
import { fileUriToPath } from '@joplin/utils/url';
|
||||
import { urlDecode } from '@joplin/lib/string-utils';
|
||||
import * as Sentry from '@sentry/electron/main';
|
||||
import { ErrorEvent } from '@sentry/types/types';
|
||||
import { homedir } from 'os';
|
||||
import { msleep } from '@joplin/utils/time';
|
||||
import { pathExists, writeFileSync } from 'fs-extra';
|
||||
import { pathExists, pathExistsSync, writeFileSync } from 'fs-extra';
|
||||
import { extname, normalize } from 'path';
|
||||
import isSafeToOpen from './utils/isSafeToOpen';
|
||||
import { closeSync, openSync, readSync, statSync } from 'fs';
|
||||
import { KB } from '@joplin/utils/bytes';
|
||||
|
||||
interface LastSelectedPath {
|
||||
file: string;
|
||||
@@ -38,6 +41,7 @@ export class Bridge {
|
||||
private rootProfileDir_: string;
|
||||
private appName_: string;
|
||||
private appId_: string;
|
||||
private logFilePath_ = '';
|
||||
|
||||
private extraAllowedExtensions_: string[] = [];
|
||||
private onAllowedExtensionsChangeListener_: OnAllowedExtensionsChange = ()=>{};
|
||||
@@ -56,12 +60,53 @@ export class Bridge {
|
||||
this.sentryInit();
|
||||
}
|
||||
|
||||
public setLogFilePath(v: string) {
|
||||
this.logFilePath_ = v;
|
||||
}
|
||||
|
||||
private sentryInit() {
|
||||
const getLogLines = () => {
|
||||
try {
|
||||
if (!this.logFilePath_ || !pathExistsSync(this.logFilePath_)) return '';
|
||||
const { size } = statSync(this.logFilePath_);
|
||||
if (!size) return '';
|
||||
|
||||
const bytesToRead = Math.min(size, 100 * KB);
|
||||
const handle = openSync(this.logFilePath_, 'r');
|
||||
const position = size - bytesToRead;
|
||||
const buffer = Buffer.alloc(bytesToRead);
|
||||
readSync(handle, buffer, 0, bytesToRead, position);
|
||||
closeSync(handle);
|
||||
return buffer.toString('utf-8');
|
||||
} catch (error) {
|
||||
// Can't do anything in this context
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
const getLogAttachment = () => {
|
||||
const lines = getLogLines();
|
||||
if (!lines) return null;
|
||||
return { filename: 'joplin-log.txt', data: lines };
|
||||
};
|
||||
|
||||
const options: Sentry.ElectronMainOptions = {
|
||||
beforeSend: event => {
|
||||
beforeSend: (event, hint) => {
|
||||
try {
|
||||
const logAttachment = getLogAttachment();
|
||||
if (logAttachment) hint.attachments = [logAttachment];
|
||||
const date = (new Date()).toISOString().replace(/[:-]/g, '').split('.')[0];
|
||||
writeFileSync(`${homedir()}/joplin_crash_dump_${date}.json`, JSON.stringify(event, null, '\t'), 'utf-8');
|
||||
|
||||
interface ErrorEventWithLog extends ErrorEvent {
|
||||
log: string[];
|
||||
}
|
||||
|
||||
const errorEventWithLog: ErrorEventWithLog = {
|
||||
...event,
|
||||
log: logAttachment ? logAttachment.data.trim().split('\n') : [],
|
||||
};
|
||||
|
||||
writeFileSync(`${homedir()}/joplin_crash_dump_${date}.json`, JSON.stringify(errorEventWithLog, null, '\t'), 'utf-8');
|
||||
} catch (error) {
|
||||
// Ignore the error since we can't handle it here
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ const generateChecksumFile = () => {
|
||||
}
|
||||
}
|
||||
if (appImageName === '') {
|
||||
throw 'AppImage not found!';
|
||||
throw new Error('AppImage not found!');
|
||||
}
|
||||
const appImagePath = path.join(distPath, appImageName);
|
||||
const appImageContent = fs.readFileSync(appImagePath);
|
||||
|
@@ -22,6 +22,7 @@ interface Props {
|
||||
title?: string;
|
||||
iconName?: string;
|
||||
level?: ButtonLevel;
|
||||
iconLabel?: string;
|
||||
className?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
onClick?: Function;
|
||||
@@ -219,7 +220,7 @@ const Button = React.forwardRef((props: Props, ref: any) => {
|
||||
|
||||
function renderIcon() {
|
||||
if (!props.iconName) return null;
|
||||
return <StyledIcon animation={props.iconAnimation} mr={iconOnly ? '0' : '6px'} color={props.color} className={props.iconName}/>;
|
||||
return <StyledIcon aria-label={props.iconLabel} animation={props.iconAnimation} mr={iconOnly ? '0' : '6px'} color={props.color} className={props.iconName}/>;
|
||||
}
|
||||
|
||||
function renderTitle() {
|
||||
|
@@ -4,7 +4,7 @@ import ButtonBar from './ButtonBar';
|
||||
import Button, { ButtonLevel, ButtonSize } from '../Button/Button';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
import bridge from '../../services/bridge';
|
||||
import Setting, { AppType, SyncStartupOperation } from '@joplin/lib/models/Setting';
|
||||
import Setting, { AppType, SettingItemSubType, SyncStartupOperation } from '@joplin/lib/models/Setting';
|
||||
import control_PluginsStates from './controls/plugins/PluginsStates';
|
||||
import EncryptionConfigScreen from '../EncryptionConfigScreen/EncryptionConfigScreen';
|
||||
import { reg } from '@joplin/lib/registry';
|
||||
@@ -20,12 +20,23 @@ import ToggleAdvancedSettingsButton from './controls/ToggleAdvancedSettingsButto
|
||||
import shouldShowMissingPasswordWarning from '@joplin/lib/components/shared/config/shouldShowMissingPasswordWarning';
|
||||
import MacOSMissingPasswordHelpLink from './controls/MissingPasswordHelpLink';
|
||||
const { KeymapConfigScreen } = require('../KeymapConfig/KeymapConfigScreen');
|
||||
import FontSearch from './FontSearch';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
const settingKeyToControl: any = {
|
||||
'plugins.states': control_PluginsStates,
|
||||
};
|
||||
|
||||
interface Font {
|
||||
family: string;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
queryLocalFonts(): Promise<Font[]>;
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
class ConfigScreenComponent extends React.Component<any, any> {
|
||||
|
||||
@@ -44,6 +55,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
screenName: '',
|
||||
changedSettingKeys: [],
|
||||
needRestart: false,
|
||||
fonts: [],
|
||||
};
|
||||
|
||||
this.rowStyle_ = {
|
||||
@@ -78,12 +90,16 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
this.setState({ settings: this.props.settings });
|
||||
}
|
||||
|
||||
public componentDidMount() {
|
||||
public async componentDidMount() {
|
||||
if (this.props.defaultSection) {
|
||||
this.setState({ selectedSectionName: this.props.defaultSection }, () => {
|
||||
void this.switchSection(this.props.defaultSection);
|
||||
});
|
||||
}
|
||||
|
||||
const fonts = (await window.queryLocalFonts()).map((font: Font) => font.family);
|
||||
const uniqueFonts = [...new Set(fonts)];
|
||||
this.setState({ fonts: uniqueFonts });
|
||||
}
|
||||
|
||||
private async handleSettingButton(key: string) {
|
||||
@@ -227,6 +243,24 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
</div>
|
||||
);
|
||||
|
||||
if (settings['sync.target'] === SyncTargetRegistry.nameToId('joplinCloud')) {
|
||||
const goToJoplinCloudLogin = () => {
|
||||
this.props.dispatch({
|
||||
type: 'NAV_GO',
|
||||
routeName: 'JoplinCloudLogin',
|
||||
});
|
||||
};
|
||||
settingComps.push(
|
||||
<div key="connect_to_joplin_cloud_button" style={this.rowStyle_}>
|
||||
<Button
|
||||
title={_('Connect to Joplin Cloud')}
|
||||
level={ButtonLevel.Primary}
|
||||
onClick={goToJoplinCloudLogin}
|
||||
/>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
settingComps.push(
|
||||
<div key="check_sync_config_button" style={this.rowStyle_}>
|
||||
<Button
|
||||
@@ -580,6 +614,9 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
size={ButtonSize.Small}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ width: inputStyle.width, minWidth: inputStyle.minWidth }}>
|
||||
{descriptionComp}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -591,22 +628,32 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
const onTextChange = (event: any) => {
|
||||
updateSettingValue(key, event.target.value);
|
||||
};
|
||||
|
||||
return (
|
||||
<div key={key} style={rowStyle}>
|
||||
<div style={labelStyle}>
|
||||
<label>{md.label()}</label>
|
||||
</div>
|
||||
<input
|
||||
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);
|
||||
}}
|
||||
spellCheck={false}
|
||||
/>
|
||||
{
|
||||
md.subType === SettingItemSubType.FontFamily || md.subType === SettingItemSubType.MonospaceFontFamily ?
|
||||
<FontSearch
|
||||
type={inputType}
|
||||
style={inputStyle}
|
||||
value={this.state.settings[key]}
|
||||
availableFonts={this.state.fonts}
|
||||
onChange={fontFamily => updateSettingValue(key, fontFamily)}
|
||||
subtype={md.subType}
|
||||
/> :
|
||||
<input
|
||||
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);
|
||||
}}
|
||||
spellCheck={false}
|
||||
/>
|
||||
}
|
||||
<div style={{ width: inputStyle.width, minWidth: inputStyle.minWidth }}>
|
||||
{descriptionComp}
|
||||
</div>
|
||||
|
232
packages/app-desktop/gui/ConfigScreen/FontSearch.tsx
Normal file
@@ -0,0 +1,232 @@
|
||||
import React = require('react');
|
||||
import { useMemo, useState, useCallback, CSSProperties, useEffect, useRef } from 'react';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
import { SettingItemSubType } from '@joplin/lib/models/Setting';
|
||||
import { focus } from '@joplin/lib/utils/focusHandler';
|
||||
|
||||
interface Props {
|
||||
type: string;
|
||||
style: CSSProperties;
|
||||
value: string;
|
||||
availableFonts: string[];
|
||||
onChange: (font: string)=> void;
|
||||
subtype: string;
|
||||
}
|
||||
|
||||
const FontSearch = (props: Props) => {
|
||||
const { type, style, value, availableFonts, onChange, subtype } = props;
|
||||
const [filteredAvailableFonts, setFilteredAvailableFonts] = useState(availableFonts);
|
||||
const [inputText, setInputText] = useState(value);
|
||||
const [showList, setShowList] = useState(false);
|
||||
const [isListHovered, setIsListHovered] = useState(false);
|
||||
const [isFontSelected, setIsFontSelected] = useState(value !== '');
|
||||
const [visibleFonts, setVisibleFonts] = useState<string[]>([]);
|
||||
const [isMonoBoxChecked, setIsMonoBoxChecked] = useState(false);
|
||||
const isLoadingFonts = filteredAvailableFonts.length === 0;
|
||||
const fontInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (subtype === SettingItemSubType.MonospaceFontFamily) {
|
||||
setIsMonoBoxChecked(true);
|
||||
}
|
||||
}, [subtype]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isMonoBoxChecked) return setFilteredAvailableFonts(availableFonts);
|
||||
const localMonospacedFonts = availableFonts.filter((font: string) =>
|
||||
monospaceKeywords.some((word: string) => font.toLowerCase().includes(word)) ||
|
||||
knownMonospacedFonts.includes(font.toLowerCase()),
|
||||
);
|
||||
setFilteredAvailableFonts(localMonospacedFonts);
|
||||
}, [isMonoBoxChecked, availableFonts]);
|
||||
|
||||
const displayedFonts = useMemo(() => {
|
||||
if (isFontSelected) return filteredAvailableFonts;
|
||||
return filteredAvailableFonts.filter((font: string) =>
|
||||
font.toLowerCase().startsWith(inputText.toLowerCase()),
|
||||
);
|
||||
}, [filteredAvailableFonts, inputText, isFontSelected]);
|
||||
|
||||
useEffect(() => {
|
||||
setVisibleFonts(displayedFonts.slice(0, 20));
|
||||
}, [displayedFonts]);
|
||||
|
||||
// Lazy loading
|
||||
const handleListScroll: React.UIEventHandler<HTMLDivElement> = useCallback((event) => {
|
||||
const scrollTop = (event.target as HTMLDivElement).scrollTop;
|
||||
const scrollHeight = (event.target as HTMLDivElement).scrollHeight;
|
||||
const clientHeight = (event.target as HTMLDivElement).clientHeight;
|
||||
|
||||
// Check if the user has scrolled to the bottom of the container
|
||||
// A small buffer of 20 pixels is subtracted from the total scrollHeight to ensure new content starts loading slightly before the user reaches the absolute bottom, providing a smoother experience.
|
||||
if (scrollTop + clientHeight >= scrollHeight - 20) {
|
||||
// Load the next 20 fonts
|
||||
const remainingFonts = displayedFonts.slice(visibleFonts.length, visibleFonts.length + 20);
|
||||
|
||||
setVisibleFonts([...visibleFonts, ...remainingFonts]);
|
||||
}
|
||||
}, [displayedFonts, visibleFonts]);
|
||||
|
||||
const handleTextChange: React.ChangeEventHandler<HTMLInputElement> = useCallback((event) => {
|
||||
setIsFontSelected(false);
|
||||
setInputText(event.target.value);
|
||||
onChange(event.target.value);
|
||||
}, [onChange]);
|
||||
|
||||
const handleFocus: React.FocusEventHandler<HTMLInputElement> = useCallback(() => setShowList(true), []);
|
||||
|
||||
const handleBlur: React.FocusEventHandler<HTMLInputElement> = useCallback(() => {
|
||||
if (!isListHovered) {
|
||||
setShowList(false);
|
||||
}
|
||||
}, [isListHovered]);
|
||||
|
||||
const handleFontClick: React.MouseEventHandler<HTMLDivElement> = useCallback((event) => {
|
||||
const font = (event.target as HTMLDivElement).innerText;
|
||||
setInputText(font);
|
||||
setShowList(false);
|
||||
onChange(font);
|
||||
setIsFontSelected(true);
|
||||
}, [onChange]);
|
||||
|
||||
const handleListHover: React.MouseEventHandler<HTMLDivElement> = useCallback(() => setIsListHovered(true), []);
|
||||
|
||||
const handleListLeave: React.MouseEventHandler<HTMLDivElement> = useCallback(() => setIsListHovered(false), []);
|
||||
|
||||
const handleMonoBoxCheck: React.ChangeEventHandler<HTMLInputElement> = useCallback(() => {
|
||||
setIsMonoBoxChecked(!isMonoBoxChecked);
|
||||
focus('FontSearch::fontInputRef', fontInputRef.current);
|
||||
}, [isMonoBoxChecked]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<input
|
||||
type={type}
|
||||
style={style}
|
||||
value={inputText}
|
||||
onChange={handleTextChange}
|
||||
onFocus={handleFocus}
|
||||
onBlur={handleBlur}
|
||||
spellCheck={false}
|
||||
ref={fontInputRef}
|
||||
/>
|
||||
<div
|
||||
className={'font-search-list'}
|
||||
style={{ display: showList ? 'block' : 'none' }}
|
||||
onMouseEnter={handleListHover}
|
||||
onMouseLeave={handleListLeave}
|
||||
onScroll={handleListScroll}
|
||||
>
|
||||
{
|
||||
isLoadingFonts ? <div>{_('Loading...')}</div> :
|
||||
<>
|
||||
<div className='monospace-checkbox'>
|
||||
<input
|
||||
type='checkbox'
|
||||
checked={isMonoBoxChecked}
|
||||
onChange={handleMonoBoxCheck}
|
||||
id={`show-monospace-fonts_${subtype}`}
|
||||
/>
|
||||
<label htmlFor={`show-monospace-fonts_${subtype}`}>{_('Show monospace fonts only.')}</label>
|
||||
</div>
|
||||
{
|
||||
visibleFonts.map((font: string) =>
|
||||
<div
|
||||
key={font}
|
||||
style={{ fontFamily: `"${font}"` }}
|
||||
onClick={handleFontClick}
|
||||
className='font-search-item'
|
||||
>
|
||||
{font}
|
||||
</div>,
|
||||
)
|
||||
}
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default FontSearch;
|
||||
|
||||
// Known monospaced fonts from wikipedia
|
||||
// https://en.wikipedia.org/wiki/List_of_monospaced_typefaces
|
||||
// https://en.wikipedia.org/wiki/Category:Monospaced_typefaces
|
||||
// Make sure to add the fonts in lower case
|
||||
// cSpell:disable
|
||||
const knownMonospacedFonts = [
|
||||
'andalé mono',
|
||||
'anonymous pro',
|
||||
'bitstream vera sans mono',
|
||||
'cascadia code',
|
||||
'century schoolbook monospace',
|
||||
'comic mono',
|
||||
'computer modern mono/typewriter',
|
||||
'consolas',
|
||||
'courier',
|
||||
'courier final draft',
|
||||
'courier new',
|
||||
'courier prime',
|
||||
'courier screenplay',
|
||||
'cousine',
|
||||
'dejavu sans mono',
|
||||
'droid sans mono',
|
||||
'envy code r',
|
||||
'everson mono',
|
||||
'fantasque sans mono',
|
||||
'fira code',
|
||||
'fira mono',
|
||||
'fixed',
|
||||
'fixedsys',
|
||||
'freemono',
|
||||
'go mono',
|
||||
'hack',
|
||||
'hyperfont',
|
||||
'ibm courier',
|
||||
'ibm plex mono',
|
||||
'inconsolata',
|
||||
'input',
|
||||
'iosevka',
|
||||
'jetbrains mono',
|
||||
'juliamono',
|
||||
'letter gothic',
|
||||
'liberation mono',
|
||||
'lucida console',
|
||||
'menlo',
|
||||
'monaco',
|
||||
'monofur',
|
||||
'monospace (unicode)',
|
||||
'nimbus mono l',
|
||||
'nk57 monospace',
|
||||
'noto mono',
|
||||
'ocr-a',
|
||||
'ocr-b',
|
||||
'operator mono',
|
||||
'overpass mono',
|
||||
'oxygen mono',
|
||||
'pragmatapro',
|
||||
'profont',
|
||||
'pt mono',
|
||||
'recursive mono',
|
||||
'roboto mono',
|
||||
'sf mono',
|
||||
'source code pro',
|
||||
'spleen',
|
||||
'terminal',
|
||||
'terminus',
|
||||
'tex gyre cursor',
|
||||
'ubuntu mono',
|
||||
'victor mono',
|
||||
'wumpus mono',
|
||||
];
|
||||
|
||||
const monospaceKeywords = [
|
||||
'mono',
|
||||
'code',
|
||||
'courier',
|
||||
'console',
|
||||
'source code',
|
||||
'terminal',
|
||||
'fixed',
|
||||
];
|
@@ -38,6 +38,7 @@ interface Props {
|
||||
function manifestToItem(manifest: PluginManifest): PluginItem {
|
||||
return {
|
||||
manifest: manifest,
|
||||
installed: true,
|
||||
enabled: true,
|
||||
deleted: false,
|
||||
devMode: false,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import PluginService, { defaultPluginSetting, Plugins, PluginSetting, PluginSettings } from '@joplin/lib/services/plugins/PluginService';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
import styled from 'styled-components';
|
||||
@@ -83,6 +83,7 @@ function usePluginItems(plugins: Plugins, settings: PluginSettings): PluginItem[
|
||||
|
||||
output.push({
|
||||
manifest: plugin.manifest,
|
||||
installed: true,
|
||||
enabled: setting.enabled,
|
||||
deleted: setting.deleted,
|
||||
devMode: plugin.devMode,
|
||||
@@ -213,8 +214,11 @@ export default function(props: Props) {
|
||||
props.onChange({ value: pluginService.serializePluginSettings(event.value) });
|
||||
}, [pluginService, props.onChange]);
|
||||
|
||||
const onDelete = useOnDeleteHandler(pluginSettings, onPluginSettingsChange, false);
|
||||
const onUpdate = useOnInstallHandler(setUpdatingPluginIds, pluginSettings, repoApi, onPluginSettingsChange, true);
|
||||
const pluginSettingsRef = useRef(pluginSettings);
|
||||
pluginSettingsRef.current = pluginSettings;
|
||||
|
||||
const onDelete = useOnDeleteHandler(pluginSettingsRef, onPluginSettingsChange, false);
|
||||
const onUpdate = useOnInstallHandler(setUpdatingPluginIds, pluginSettingsRef, repoApi, onPluginSettingsChange, true);
|
||||
|
||||
const onToolsClick = useCallback(async () => {
|
||||
const template = [
|
||||
|
@@ -40,7 +40,10 @@ export default function(props: Props) {
|
||||
const [installingPluginsIds, setInstallingPluginIds] = useState<Record<string, boolean>>({});
|
||||
const [searchResultCount, setSearchResultCount] = useState(null);
|
||||
|
||||
const onInstall = useOnInstallHandler(setInstallingPluginIds, props.pluginSettings, props.repoApi, props.onPluginSettingsChange, false);
|
||||
const pluginSettingsRef = useRef(props.pluginSettings);
|
||||
pluginSettingsRef.current = props.pluginSettings;
|
||||
|
||||
const onInstall = useOnInstallHandler(setInstallingPluginIds, pluginSettingsRef, props.repoApi, props.onPluginSettingsChange, false);
|
||||
|
||||
useEffect(() => {
|
||||
setSearchResultCount(null);
|
||||
|
@@ -12,3 +12,35 @@
|
||||
.config-screen-content > .section:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.font-search-list {
|
||||
background-color: var(--joplin-background-color);
|
||||
max-height: 200px;
|
||||
width: 50%;
|
||||
min-width: 20em;
|
||||
overflow-y: auto;
|
||||
border: 1px solid var(--joplin-border-color4);
|
||||
border-radius: 5px;
|
||||
display: none;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.font-search-list > div {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.font-search-item {
|
||||
border-bottom: 1px solid var(--joplin-border-color4);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.font-search-item:hover {
|
||||
color: var(--joplin-background-color);
|
||||
background-color: var(--joplin-color);
|
||||
}
|
||||
|
||||
.monospace-checkbox {
|
||||
background-color: var(--joplin-background-color3);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { useCallback, useState, useRef, useEffect } from 'react';
|
||||
import { useCallback, useState, useRef, useEffect, useId } from 'react';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
import DialogButtonRow, { ClickEvent } from '../DialogButtonRow';
|
||||
import Dialog from '../Dialog';
|
||||
@@ -127,13 +127,14 @@ export default function(props: Props) {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const formTitleInputId = useId();
|
||||
function renderForm() {
|
||||
return (
|
||||
<div>
|
||||
<div className="form">
|
||||
<div className="form-input-group">
|
||||
<label>{_('Title')}</label>
|
||||
<StyledInput type="text" ref={titleInputRef} value={folderTitle} onChange={onFolderTitleChange}/>
|
||||
<label htmlFor={formTitleInputId}>{_('Title')}</label>
|
||||
<StyledInput id={formTitleInputId} type="text" ref={titleInputRef} value={folderTitle} onChange={onFolderTitleChange}/>
|
||||
</div>
|
||||
|
||||
<div className="form-input-group">
|
||||
|
@@ -1,19 +1,15 @@
|
||||
import * as React from 'react';
|
||||
import { DragEventHandler, KeyboardEventHandler, UIEventHandler } from 'react';
|
||||
|
||||
interface Props {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
style: any;
|
||||
interface Props<ItemType> {
|
||||
style: React.CSSProperties & { height: number };
|
||||
itemHeight: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
items: any[];
|
||||
items: ItemType[];
|
||||
disabled?: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
onKeyDown?: Function;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
itemRenderer: Function;
|
||||
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
||||
itemRenderer: (item: ItemType, index: number)=> React.JSX.Element;
|
||||
className?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||
onNoteDrop?: Function;
|
||||
onItemDrop?: DragEventHandler<HTMLElement>;
|
||||
}
|
||||
|
||||
interface State {
|
||||
@@ -21,13 +17,12 @@ interface State {
|
||||
bottomItemIndex: number;
|
||||
}
|
||||
|
||||
class ItemList extends React.Component<Props, State> {
|
||||
class ItemList<ItemType> extends React.Component<Props<ItemType>, State> {
|
||||
|
||||
private scrollTop_: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
private listRef: any;
|
||||
private listRef: React.MutableRefObject<HTMLDivElement>;
|
||||
|
||||
public constructor(props: Props) {
|
||||
public constructor(props: Props<ItemType>) {
|
||||
super(props);
|
||||
|
||||
this.scrollTop_ = 0;
|
||||
@@ -39,12 +34,12 @@ class ItemList extends React.Component<Props, State> {
|
||||
this.onDrop = this.onDrop.bind(this);
|
||||
}
|
||||
|
||||
public visibleItemCount(props: Props = undefined) {
|
||||
public visibleItemCount(props: Props<ItemType> = undefined) {
|
||||
if (typeof props === 'undefined') props = this.props;
|
||||
return Math.ceil(props.style.height / props.itemHeight);
|
||||
}
|
||||
|
||||
public updateStateItemIndexes(props: Props = undefined) {
|
||||
public updateStateItemIndexes(props: Props<ItemType> = undefined) {
|
||||
if (typeof props === 'undefined') props = this.props;
|
||||
|
||||
const topItemIndex = Math.floor(this.scrollTop_ / props.itemHeight);
|
||||
@@ -67,35 +62,47 @@ class ItemList extends React.Component<Props, State> {
|
||||
return this.scrollTop_;
|
||||
}
|
||||
|
||||
public get container() {
|
||||
return this.listRef.current;
|
||||
}
|
||||
|
||||
public UNSAFE_componentWillMount() {
|
||||
this.updateStateItemIndexes();
|
||||
}
|
||||
|
||||
public UNSAFE_componentWillReceiveProps(newProps: Props) {
|
||||
public UNSAFE_componentWillReceiveProps(newProps: Props<ItemType>) {
|
||||
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;
|
||||
public onScroll: UIEventHandler<HTMLDivElement> = event => {
|
||||
this.scrollTop_ = (event.target as HTMLElement).scrollTop;
|
||||
this.updateStateItemIndexes();
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
public onKeyDown(event: any) {
|
||||
public onKeyDown: KeyboardEventHandler<HTMLElement> = event => {
|
||||
if (this.props.onKeyDown) this.props.onKeyDown(event);
|
||||
};
|
||||
|
||||
public onDrop: DragEventHandler<HTMLElement> = event => {
|
||||
if (this.props.onItemDrop) this.props.onItemDrop(event);
|
||||
};
|
||||
|
||||
public get firstVisibleIndex() {
|
||||
return Math.min(this.props.items.length - 1, this.state.topItemIndex);
|
||||
}
|
||||
|
||||
// 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);
|
||||
public get lastVisibleIndex() {
|
||||
return Math.max(0, this.state.bottomItemIndex);
|
||||
}
|
||||
|
||||
public isIndexVisible(itemIndex: number) {
|
||||
return itemIndex >= this.firstVisibleIndex && itemIndex <= this.lastVisibleIndex;
|
||||
}
|
||||
|
||||
public makeItemIndexVisible(itemIndex: number) {
|
||||
const top = Math.min(this.props.items.length - 1, this.state.topItemIndex);
|
||||
const bottom = Math.max(0, this.state.bottomItemIndex);
|
||||
if (this.isIndexVisible(itemIndex)) return;
|
||||
|
||||
if (itemIndex >= top && itemIndex <= bottom) return;
|
||||
const top = this.firstVisibleIndex;
|
||||
|
||||
let scrollTop = 0;
|
||||
if (itemIndex < top) {
|
||||
@@ -130,8 +137,11 @@ class ItemList extends React.Component<Props, State> {
|
||||
|
||||
public render() {
|
||||
const items = this.props.items;
|
||||
const style = { ...this.props.style, overflowX: 'hidden',
|
||||
overflowY: 'auto' };
|
||||
const style: React.CSSProperties = {
|
||||
...this.props.style,
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'auto',
|
||||
};
|
||||
|
||||
// if (this.props.disabled) style.opacity = 0.5;
|
||||
|
||||
|
@@ -1,3 +1,33 @@
|
||||
.inbox-email-value {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.alert-warn {
|
||||
background-color: var(--joplin-background-color);
|
||||
width: fit-content;
|
||||
|
||||
p {
|
||||
padding: calc(var(--joplin-font-size) * 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.joplin-cloud-account-information {
|
||||
margin-bottom: var(--joplin-margin);
|
||||
|
||||
table {
|
||||
margin-bottom: var(--joplin-margin);
|
||||
border: none;
|
||||
|
||||
td {
|
||||
border: none;
|
||||
border-bottom: 1px solid var(--joplin-border-color4);
|
||||
padding: var(--joplin-font-size);
|
||||
}
|
||||
|
||||
tr:last-child {
|
||||
td {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,9 +3,15 @@ import { AppState } from '../app.reducer';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
import { clipboard } from 'electron';
|
||||
import Button from './Button/Button';
|
||||
import { Fragment } from 'react';
|
||||
import { accountTypeToString } from '@joplin/lib/utils/joplinCloud/types';
|
||||
import bridge from '../services/bridge';
|
||||
|
||||
type JoplinCloudConfigScreenProps = {
|
||||
inboxEmail: string;
|
||||
joplinCloudAccountType: number;
|
||||
userEmail: string;
|
||||
joplinCloudWebsite: string;
|
||||
};
|
||||
|
||||
const JoplinCloudConfigScreen = (props: JoplinCloudConfigScreenProps) => {
|
||||
@@ -13,12 +19,42 @@ const JoplinCloudConfigScreen = (props: JoplinCloudConfigScreenProps) => {
|
||||
clipboard.writeText(props.inboxEmail);
|
||||
};
|
||||
|
||||
const isEmailToNoteAvailableInAccount = props.joplinCloudAccountType !== 1;
|
||||
|
||||
const goToJoplinCloudProfile = async () => {
|
||||
await bridge().openExternal(`${props.joplinCloudWebsite}/users/me`);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="joplin-cloud-account-information">
|
||||
<h2>{_('Account information')}</h2>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>{_('Account type')}</strong></td>
|
||||
<td>{accountTypeToString(props.joplinCloudAccountType)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{_('Email')}</strong></td>
|
||||
<td>{props.userEmail}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<Button onClick={goToJoplinCloudProfile} title={_('Go to Joplin Cloud profile')}/>
|
||||
</div>
|
||||
|
||||
<h2>{_('Email to note')}</h2>
|
||||
<p>{_('Any email sent to this address will be converted into a note and added to your collection. The note will be saved into the Inbox notebook')}</p>
|
||||
<p className='inbox-email-value'>{props.inboxEmail}</p>
|
||||
<Button onClick={copyToClipboard} title={_('Copy to clipboard')} />
|
||||
{
|
||||
isEmailToNoteAvailableInAccount ? <Fragment>
|
||||
<p className='inbox-email-value'>{props.inboxEmail}</p>
|
||||
<Button onClick={copyToClipboard} title={_('Copy to clipboard')} />
|
||||
</Fragment>
|
||||
: <div className='alert-warn'>
|
||||
<p>{_('Your account doesn\'t have access to this feature')}</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -26,6 +62,9 @@ const JoplinCloudConfigScreen = (props: JoplinCloudConfigScreenProps) => {
|
||||
const mapStateToProps = (state: AppState) => {
|
||||
return {
|
||||
inboxEmail: state.settings['sync.10.inboxEmail'],
|
||||
joplinCloudAccountType: state.settings['sync.10.accountType'],
|
||||
userEmail: state.settings['sync.10.userEmail'],
|
||||
joplinCloudWebsite: state.settings['sync.10.website'],
|
||||
};
|
||||
};
|
||||
|
||||
|