1
0
mirror of https://github.com/laurent22/joplin.git synced 2026-01-20 00:46:28 +02:00

Compare commits

..

173 Commits

Author SHA1 Message Date
Laurent Cozic
d744f93e16 Merge branch 'dev' into publish_notes_e2ee 2022-09-06 17:23:13 +01:00
Laurent Cozic
25bd91bed1 Doc: Added news with link to interview 2022-09-06 16:23:33 +01:00
Laurent Cozic
7974df98ff Desktop: Display default notebook icons when at least one notebook has an icon 2022-09-05 17:26:22 +01:00
Laurent Cozic
e37d980453 Chore: Converted desktop Sidebar to React Hooks 2022-09-05 16:21:26 +01:00
Mayank Bondre
597569745c Doc: Add spec for default plugins (#6811) 2022-09-05 12:51:22 +01:00
Henry Heino
6e6275b1b7 Mobile: Resolves #6808: Convert empty bolded regions to bold-italic regions in beta editor (#6807) 2022-09-05 12:50:32 +01:00
Henry Heino
cfba73e938 Android: Fixes #6802: Double/triple-tap selection doesn't show context menu (#6803) 2022-09-05 12:47:25 +01:00
Henry Heino
7e1c34b769 Chore: Factor duplicate WebView code into ExtendedWebView.tsx (#6771) 2022-09-05 12:46:13 +01:00
Andrej Lifinzew
b5b281c276 CLI: Resolves #1728: Toggle short ids and mv notebooks (#6671) 2022-09-05 12:37:51 +01:00
Mayank Bondre
80906cbdb3 Desktop: Remove demo plugins folder and update pinned version of backup plugin (#6801) 2022-09-05 12:36:21 +01:00
asrient
1504cb71ae Desktop: Added PDF viewer options (#6800) 2022-09-05 12:35:38 +01:00
Self Not Found
eb7083d788 All: Fixes #6688: Fix resources sync when proxy is set (#6817) 2022-09-05 10:42:22 +01:00
Laurent Cozic
e40d733176 Android 2.9.2 2022-09-01 16:19:45 +01:00
Laurent Cozic
170c669e37 Desktop release v2.9.4 2022-09-01 16:19:44 +01:00
Mayank Bondre
3942029c90 Desktop: Bundle default plugins with desktop application (#6679) 2022-09-01 11:53:58 +01:00
Mayank Bondre
01f4bb0591 Desktop: Install default plugins on first app start (#6585) 2022-09-01 11:44:33 +01:00
Henry Heino
1069d7d6fb Chore: Update ESLint and TypeScript (#6774) 2022-08-31 12:57:28 +01:00
asrient
8d67aefcd5 Chore: Fix yarn install (#6790) 2022-08-31 12:56:58 +01:00
javad mnjd
ff90166b6e Android: Fixes #6791: Fixed handling of normal paths in filesystem sync (#6792) 2022-08-31 10:44:32 +01:00
Laurent Cozic
6beaaf75bb Chore: Fixed bug 2022-08-29 16:27:26 +01:00
Laurent Cozic
ebf9a9375c Desktop, Cli: Fixes #6704: Fixed names of imported duplicate notebooks 2022-08-29 16:22:13 +01:00
javad mnjd
de94c35c0b Android: Fixes #6779: Fixed android filesystem sync (resources) (#6789) 2022-08-29 15:29:28 +01:00
Laurent Cozic
6a4eb33093 Desktop: Fixes #6692: Fixed file and directory paths in plugin setting dialogs 2022-08-29 15:27:19 +01:00
Laurent Cozic
8b91427056 Chore: Added more messages for external editing 2022-08-29 15:09:30 +01:00
Henry Heino
b174fcf17b Mobile: Add Markdown toolbar (#6753) 2022-08-29 14:19:04 +01:00
Henry Heino
c6b91cdc5d Chore: Force syntax tree generation after creating editor in test units (#6783) 2022-08-29 12:40:19 +01:00
Ivan Piskun
e784e8c947 Update uk_UA.po (#6786) 2022-08-28 15:41:04 +01:00
asrient
6498f94c36 Desktop: Add zoom feature on PDF viewer (#6748) 2022-08-28 12:18:51 +01:00
Henry Heino
ae300de42f Mobile: Setting to disable spellcheck in beta editor (#6780) 2022-08-27 13:53:46 +01:00
Henry Heino
40e682faae Chore: Fix #6764: Switch from @babel/register to ts-node for mobile TypeScript build scripts (#6765) 2022-08-27 13:41:49 +01:00
Henry Heino
92c24c2129 Chore: Migrate mobile Dropdown, ScreenHeader to TypeScript (#6763) 2022-08-27 13:36:59 +01:00
asrient
3ec3a37603 Desktop: PDF scroll persistence (#6747) 2022-08-27 13:32:20 +01:00
Abu Sahal
ed2a328616 All: Translation: Update id_ID.po (#6782) 2022-08-27 08:12:16 -04:00
Retrove
58dc4feee7 Plugins: Add support for media links in plugin manifest.json (#6672) 2022-08-27 12:11:56 +01:00
Anton Tuchkov
0356cbbfab Desktop: Add support for multi-language spell check (#6617) 2022-08-27 12:05:44 +01:00
Tolulope Malomo
8b06cbf04e Mobile: Fix side menu width on wide screen devices (#6662) 2022-08-25 16:59:38 +01:00
Henry Heino
fd82758e74 Android: Enable spellcheck by default on beta editor (#6778) 2022-08-24 23:52:34 +01:00
Laurent Cozic
c705ec682c Website: Default to yearly subscription 2022-08-24 11:30:39 +01:00
Henry Heino
a5e6491cda Mobile: Add long-press tooltips (#6758) 2022-08-21 22:03:41 +01:00
Henry Heino
8ef9804cab iOS: Enable long-press menu (#6738) 2022-08-21 21:58:15 +01:00
Henry Heino
09ec77f904 Android: Fixes #6732: Don't reload the application on screen rotation (#6737) 2022-08-21 21:57:25 +01:00
SeptemberHX
36871d9cb0 Desktop: Fixes #6719: Avoid reloading loaded plugin scripts (#6742) 2022-08-21 21:53:36 +01:00
asrient
b4ece67092 Tools: Fix desktop build performance issue (#6762) 2022-08-19 19:10:39 +01:00
Laurent Cozic
7e8a6dfb54 Tools: Add react-hooks/exhaustive-deps eslint rule 2022-08-19 12:10:04 +01:00
Laurent Cozic
549095f0e5 Chore: clean up ignore files 2022-08-19 11:39:15 +01:00
Laurent Cozic
313c05732b Tools: Add eslint-interactive to more easily apply new eslint rules 2022-08-19 11:39:14 +01:00
Joplin Bot
641b0fa9a2 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-18 18:19:20 +00:00
Laurent Cozic
4b8745c875 Tools: Prevent CI from creating a release if "yarn install" failed 2022-08-18 16:28:17 +01:00
Henry Heino
78f72f33e6 Mobile: Fixes #6759: Fix default font in beta editor (#6760) 2022-08-18 11:43:54 +01:00
Laurent Cozic
b4aa418276 Chore: No need to warn about falling back to the default font 2022-08-18 11:42:48 +01:00
Laurent Cozic
8d66322c94 Desktop: Disable publishing recursive notes on Jpolin Cloud (not fully working yet) 2022-08-18 11:39:39 +01:00
Laurent Cozic
6969341745 Desktop release v2.9.3 2022-08-18 11:03:50 +01:00
Laurent Cozic
488f19e3c4 Merge branch 'dev' into release-2.9 2022-08-18 11:03:36 +01:00
Joplin Bot
79889facea Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-17 06:20:19 +00:00
Ji-Hyeon Gim
74f513b082 All: Translation: Update ko.po (#6751)
It updates Korean translation.

Signed-off-by: Ji-Hyeon Gim <potatogim@potatogim.net>

Signed-off-by: Ji-Hyeon Gim <potatogim@potatogim.net>
2022-08-14 19:24:31 -04:00
Kevin Hsu
ab540edacc All: Translation: Update zh_TW (#6727) 2022-08-14 13:51:23 -04:00
Ji-Hyeon Gim
9dedd88989 All: Translation: Update ko.po (#6734)
It updates Korean translation.

Signed-off-by: Ji-Hyeon Gim <potatogim@potatogim.net>

Signed-off-by: Ji-Hyeon Gim <potatogim@potatogim.net>
2022-08-14 13:50:17 -04:00
Joplin Bot
be8ebd9fc5 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-12 18:20:29 +00:00
Laurent Cozic
6d41814455 Android 2.9.1 2022-08-12 19:15:40 +02:00
Laurent Cozic
2807a32e64 Desktop release v2.9.2 2022-08-12 19:07:31 +02:00
Laurent Cozic
e6b0e20f08 Doc: Add sponsor 2022-08-12 18:37:59 +02:00
Laurent Cozic
0dc92c17f5 Doc: Mention Meetup on readme file 2022-08-11 19:34:46 +02:00
Joplin Bot
308c7b11c2 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-08 16:46:15 +00:00
Laurent Cozic
75be518d8a Doc: Fixed coding style doc 2022-08-08 18:32:09 +02:00
Laurent Cozic
9f97a2e910 Doc: Upload Meetup news 2022-08-08 18:32:08 +02:00
Henry Heino
03c3188a4a Mobile: Add keyboard-activatable markdown commands (e.g. bold, italicize) (#6707) 2022-08-08 16:00:14 +01:00
José Rebelo
bd5ce114a1 Desktop: Allow electron flag to disable smooth scrolling (#6712) 2022-08-06 11:01:59 +01:00
Joplin Bot
d326700d32 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-06 00:45:43 +00:00
Joplin Bot
5bf949fcb3 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-05 18:21:00 +00:00
Joplin Bot
9d6d2f770a Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-05 00:52:30 +00:00
Joplin Bot
3e12313f85 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-04 18:18:43 +00:00
Joplin Bot
358178f83d Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-04 12:24:45 +00:00
asrient
6ea40c9895 Desktop: New Embedded Pdf Viewer (#6681) 2022-08-04 10:12:22 +01:00
Laurent Cozic
0191de8bb4 Doc: update sponsors 2022-08-04 10:50:23 +02:00
Joplin Bot
a114e1b5f7 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-03 00:51:59 +00:00
Joplin Bot
cf22ec0c8b Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-02 18:17:50 +00:00
Joplin Bot
e074f099c4 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-01 18:17:40 +00:00
Joplin Bot
c5ad2975d6 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-08-01 12:23:51 +00:00
SFulpius
ab5313e37f Desktop: Fixes #6434: Play flac files (#6666) 2022-07-30 13:11:21 +01:00
Henry Heino
54cc7063ad Chore: Migrate from rollup to webpack to build mobile assets (#6705) 2022-07-30 13:07:38 +01:00
Henry Heino
12a510c464 Chore: Fix CI: Use strict equality (#6702) 2022-07-29 09:38:44 +01:00
Henry Heino
21d5800923 iOS: Fixes #6636: Fix occasional overscroll when opening the keyboard (#6700) 2022-07-28 17:05:41 +01:00
Peter Baumgartner
1d5e8e65d9 Doc: Update known problems (#6691) 2022-07-28 17:04:19 +01:00
Henry Heino
d2a6d24846 iOS: Resolves #6685: Respect system accessibility font size in rendered markdown (#6686) 2022-07-28 17:02:46 +01:00
Henry Heino
fb372723a4 Mobile: Improve syntax highlighting on mobile beta editor (#6684) 2022-07-28 17:01:34 +01:00
Henry Heino
b32a341700 Chore: Migrate EventDispatcher to TypeScript, add tests (#6673) 2022-07-28 16:46:52 +01:00
Henry Heino
caef5449dc Doc: Document coding style (#6657) 2022-07-28 16:36:39 +01:00
Joplin Bot
864a3a7efe Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-07-23 12:22:35 +00:00
Laurent Cozic
ce02d4c94f Chore: Finished applying eqeqeq rule 2022-07-23 11:33:12 +02:00
Laurent Cozic
052d9f03d6 Chore: Add eslint rule to enforce strict equality (eqeqeq) 2022-07-23 09:31:32 +02:00
Laurent Cozic
8a8def39f0 Doc: Mime type comment 2022-07-23 08:48:40 +02:00
Henry Heino
f0831f1d60 Chore: Fixes #6663: Fix watchInjectedJs and support multiple output bundles (#6664) 2022-07-22 18:51:12 +01:00
Henry Heino
0e532fbaf0 Chore: Set up repository for testing/preparation for mobile markdown toolbar PR (#6650) 2022-07-22 10:44:19 +01:00
Joplin Bot
11a1e1cb6b Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-07-20 18:17:06 +00:00
Joplin Bot
37b89b5644 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-07-18 06:19:10 +00:00
Laurent Cozic
520d9746c5 Mobile: Fixes #6515: Note links with HTML notation did not work 2022-07-12 11:52:20 +01:00
SFulpius
c3df191a95 Desktop: Fixes #6570: Fixed broken image links (#6590) 2022-07-12 11:34:56 +01:00
Laurent Cozic
06d5feaa63 All: Fixes #6645: Do not encrypt non-owned note if it was not shared encrypted 2022-07-12 11:28:48 +01:00
Laurent Cozic
0b3c4edb92 Chore: Clean up react-native-saf-x 2022-07-11 17:41:44 +01:00
Henry Heino
58045f87d8 Doc: Update outdated path reference in CONTRIBUTING (#6658) 2022-07-11 17:28:14 +01:00
Laurent Cozic
3d8354c403 v2 header 2022-07-11 16:11:58 +01:00
Laurent Cozic
e2fa57c48f v2 encryption header 2022-07-11 15:42:27 +01:00
Laurent Cozic
4162b3cbac refactor encryption header 2022-07-11 15:09:07 +01:00
Laurent Cozic
e2731ca01f Merge branch 'dev' into publish_notes_e2ee 2022-07-11 14:10:42 +01:00
Joplin Bot
28e66e2619 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-07-11 12:31:33 +00:00
Laurent Cozic
c3179a39a4 Desktop release v2.9.1 2022-07-11 10:17:37 +01:00
Laurent Cozic
eb71260674 Chore: Setup new release 2.9 2022-07-11 10:07:21 +01:00
Laurent Cozic
ed4a013cfc Tools: Fixed /setupNewRelease script 2022-07-11 10:06:15 +01:00
Laurent Cozic
5ffe90c4b0 Chore: Add debug message to try to debug scroll to top issue 2022-07-11 10:00:17 +01:00
Laurent Cozic
8a836ea4f9 Tools: Check licenses for one package 2022-07-11 10:00:16 +01:00
Joplin Bot
1f2930f037 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-07-11 06:20:21 +00:00
X3NO
ef3afb2a01 updated pl_PL.po (#6613)
updated polish translation
2022-07-10 18:05:25 +01:00
Kane
5d873a3264 Update Chinese Simplified (zh_CN) translation (#6634) 2022-07-10 18:05:07 +01:00
jd1378
effba83a0e Android: Fixes #5779: Fixed android filesystem sync (#6395) 2022-07-10 15:26:24 +01:00
Kenichi Kobayashi
55d98346ee Desktop: Fixes #6639: Re-ordering note list items causes unwanted height change (#6640) 2022-07-10 15:10:08 +01:00
Henry Heino
d848865b0d Chore: Fix injectedJavaScript not evaluating to true on mobile (#6609) 2022-07-10 15:00:21 +01:00
Tom
879702dadf Mobile: Removes whitespace above navigation component (#6597) 2022-07-10 14:59:33 +01:00
Jason Williams
8bb5b4a557 Desktop: Resolves #164: Add support for proxy (#6537) 2022-07-10 14:54:31 +01:00
Laurent Cozic
2c4cf9fbdb Server: Answer recurrent question 2022-07-05 15:16:33 +01:00
Laurent Cozic
3b35ab6581 Plugins: Added joplin.versionInfo method 2022-07-03 14:32:29 +01:00
Joplin Bot
6744dc3a8a Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-07-02 00:44:48 +00:00
Joplin Bot
97c6684154 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-07-01 18:17:01 +00:00
Laurent Cozic
e797ebb864 Desktop: Security: Fixes XSS in GotoAnything dialog 2022-06-30 18:25:38 +01:00
Laurent Cozic
d910de02d6 fixed tests 2022-06-28 18:31:18 +01:00
Laurent Cozic
9107f9a073 fix tests 2022-06-28 13:57:14 +01:00
Laurent Cozic
c7c0be5b21 Merge branch 'dev' into publish_notes_e2ee 2022-06-28 12:05:53 +01:00
Laurent Cozic
f99b8dfde8 Server: Process user deletions once an hour 2022-06-28 11:05:09 +01:00
Joplin Bot
c21b28e6e6 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-06-27 00:48:12 +00:00
Joplin Bot
c58e9fe346 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-06-26 18:15:45 +00:00
Henry Heino
c58ce8e2da Mobile: Add alt text/roles to some buttons to improve accessibility (#6616) 2022-06-26 18:23:41 +01:00
Daeraxa
f64d046c62 Docs: Add section to FAQ about appimages not starting (#6614) 2022-06-26 18:22:18 +01:00
Henry Heino
c7e3245008 Mobile: Fixes #5949: Scroll selection into view in beta editor when window resizes (#6610) 2022-06-26 18:21:38 +01:00
Eduardo Esparza
8f3fd0bf8b Cli: Resolves #6478: Added note count indicator per notebook (#6526) 2022-06-26 17:55:49 +01:00
Laurent Cozic
d293474402 Doc: Disable a-b test 2022-06-24 13:43:04 +01:00
Henry Heino
aaa610d5f4 Mobile: Ctrl+F search support in beta editor (#6587) 2022-06-24 10:56:59 +01:00
Joplin Bot
20a7cd2323 Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-06-24 00:42:18 +00:00
Laurent Cozic
d7af060564 Revert "Mobile: Fixes #3564: "Move Note" dropdown menu can be very narrow (#6306)"
This reverts commit cffea3ea1e.

https://github.com/laurent22/joplin/pull/6306#issuecomment-1161575676
2022-06-21 11:50:10 +01:00
Laurent Cozic
d7663212cf Revert "Chore: Fixed mobile dropbown regression"
This reverts commit 671077e1bb.

https://github.com/laurent22/joplin/pull/6306#issuecomment-1161575676
2022-06-21 11:49:38 +01:00
Laurent Cozic
429a49b07e Chore: Fixed database type generation script 2022-06-21 11:48:55 +01:00
Laurent Cozic
124ce342d8 Chore: Fixed database type generation script 2022-06-21 11:48:53 +01:00
Jonatan
19f4139470 Update Swedish translation (#6589) 2022-06-20 14:33:28 +01:00
Henry Heino
21b6564301 Mobile: Fixes #6576: Fix checklist continuation in beta editor (#6577) 2022-06-20 14:31:30 +01:00
SFulpius
c8b6122a65 Desktop: Resolves #6172: Checkbox don't function while checkbox format button hidden from toolbar (#6567) 2022-06-20 14:29:32 +01:00
asrient
c0bc4c38c3 Clipper: Resolves #6247: Clipper unable to pull and store PDFs (#6384) 2022-06-20 13:56:54 +01:00
Joplin Bot
0c50a5ab9b Doc: Auto-update documentation
Auto-updated using release-website.sh
2022-06-18 06:18:17 +00:00
Laurent Cozic
ce6797d842 Server: Fixed recursively sharing note 2022-06-14 18:48:15 +01:00
Laurent Cozic
29a1cc022c Server: Add support for recursively publishing a note 2022-06-14 18:47:43 +01:00
Laurent Cozic
af665f247c Server: Fixes #6370: Published note must be scrollable when it contains a large table 2022-06-14 15:39:04 +01:00
Laurent Cozic
8ea32201e7 Server: Fixes #6491: Could not manually start task 2022-06-14 15:30:13 +01:00
Laurent Cozic
4c88376449 Desktop: Fixes #6514: Search field focus is stolen on layout change 2022-06-14 15:25:23 +01:00
Laurent Cozic
0618e9ec90 Server: Fixes #6531: Fixed Unsupported File Type error when sharing certain notes 2022-06-14 14:58:52 +01:00
Laurent Cozic
176c9e0bcf Desktop: Fixes #6557: Search field would not clear as expected 2022-06-14 14:24:51 +01:00
Laurent Cozic
6bd809b347 Merge branch 'dev' into publish_notes_e2ee 2022-06-14 00:42:59 +01:00
Laurent Cozic
e8a3149d39 Merge branch 'dev' into publish_notes_e2ee 2022-06-07 18:30:50 +01:00
Laurent Cozic
f8a947fedd tests 2022-05-28 17:57:33 +01:00
Laurent Cozic
f9afe040fb Merge branch 'dev' into publish_notes_e2ee 2022-05-27 12:03:16 +01:00
Laurent Cozic
16b60bd910 Merge branch 'dev' into publish_notes_e2ee 2022-05-26 18:20:09 +01:00
Laurent Cozic
6a2a52ec78 password handling 2022-05-26 18:14:10 +01:00
Laurent Cozic
d5a0d7b4a7 update 2022-05-26 17:46:02 +01:00
Laurent Cozic
810ae1f763 fix hljs config 2022-05-26 16:49:06 +01:00
Laurent Cozic
985a988734 optimize bundle 2022-05-26 16:29:43 +01:00
Laurent Cozic
65436e6007 perf 2022-05-26 16:16:32 +01:00
Laurent Cozic
f60e1d498f Merge branch 'dev' into publish_notes_e2ee 2022-05-26 16:00:11 +01:00
Laurent Cozic
07ed4b4d62 getResourceUrl 2022-05-26 15:14:07 +01:00
Laurent Cozic
b9adcc80ac fix 2022-05-26 14:53:24 +01:00
Laurent Cozic
e251e09120 tests 2022-05-26 13:52:15 +01:00
Laurent Cozic
3011da7f53 Add type to extractResourceUrls call 2022-05-25 16:24:58 +01:00
Laurent Cozic
1661cf85de Provide detail info on extractFileUrls call 2022-05-24 18:04:38 +01:00
Laurent Cozic
04c286216e Provide detail info on extractFileUrls call 2022-05-24 17:35:29 +01:00
Laurent Cozic
4f201eb926 tests 2022-05-23 14:48:18 +01:00
Laurent Cozic
e1b1a78768 e2ee 2022-05-23 14:38:06 +01:00
Laurent Cozic
98ed58cc6e basic setup 2022-05-18 16:09:31 +01:00
Laurent Cozic
3f0943873e load encrypted note 2022-05-18 14:45:09 +01:00
392 changed files with 21352 additions and 4935 deletions

View File

@@ -6,6 +6,7 @@ _releases/
*.min.js
**/commands/index.ts
**/node_modules/
packages/generator-joplin/generators/app/templates/api/
Assets/
docs/
highlight.pack.js
@@ -46,7 +47,7 @@ packages/app-desktop/packageInfo.js
packages/app-desktop/services/electron-context-menu.js
packages/app-desktop/vendor/lib/
packages/app-mobile/android
packages/app-mobile/components/NoteEditor/CodeMirror.bundle.js
packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.bundle.js
packages/app-mobile/ios
packages/app-mobile/lib/rnInjectedJs/
packages/app-mobile/locales
@@ -69,6 +70,7 @@ packages/tools/node_modules
packages/tools/PortableAppsLauncher
packages/turndown-plugin-gfm/
packages/turndown/
packages/pdf-viewer/dist
plugin_types/
readme/
@@ -115,6 +117,9 @@ packages/app-cli/tests/services/plugins/api/JoplinViewMenuItem.js.map
packages/app-cli/tests/services/plugins/api/JoplinWorkspace.d.ts
packages/app-cli/tests/services/plugins/api/JoplinWorkspace.js
packages/app-cli/tests/services/plugins/api/JoplinWorkspace.js.map
packages/app-cli/tests/services/plugins/defaultPluginsUtils.d.ts
packages/app-cli/tests/services/plugins/defaultPluginsUtils.js
packages/app-cli/tests/services/plugins/defaultPluginsUtils.js.map
packages/app-cli/tests/services/plugins/sandboxProxy.d.ts
packages/app-cli/tests/services/plugins/sandboxProxy.js
packages/app-cli/tests/services/plugins/sandboxProxy.js.map
@@ -421,9 +426,6 @@ packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/styles/index.js.map
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/index.d.ts
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/index.js
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/index.js.map
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/tables.d.ts
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/tables.js
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/tables.js.map
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/types.d.ts
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/types.js
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/types.js.map
@@ -691,9 +693,6 @@ packages/app-desktop/gui/StyleSheets/StyleSheetContainer.js.map
packages/app-desktop/gui/SyncWizard/Dialog.d.ts
packages/app-desktop/gui/SyncWizard/Dialog.js
packages/app-desktop/gui/SyncWizard/Dialog.js.map
packages/app-desktop/gui/TableEditorDialog/Dialog.d.ts
packages/app-desktop/gui/TableEditorDialog/Dialog.js
packages/app-desktop/gui/TableEditorDialog/Dialog.js.map
packages/app-desktop/gui/TagList.d.ts
packages/app-desktop/gui/TagList.js
packages/app-desktop/gui/TagList.js.map
@@ -847,6 +846,15 @@ packages/app-mobile/components/BackButtonDialogBox.js.map
packages/app-mobile/components/CameraView.d.ts
packages/app-mobile/components/CameraView.js
packages/app-mobile/components/CameraView.js.map
packages/app-mobile/components/CustomButton.d.ts
packages/app-mobile/components/CustomButton.js
packages/app-mobile/components/CustomButton.js.map
packages/app-mobile/components/Dropdown.d.ts
packages/app-mobile/components/Dropdown.js
packages/app-mobile/components/Dropdown.js.map
packages/app-mobile/components/ExtendedWebView.d.ts
packages/app-mobile/components/ExtendedWebView.js
packages/app-mobile/components/ExtendedWebView.js.map
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.d.ts
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.js
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.js.map
@@ -859,15 +867,99 @@ packages/app-mobile/components/NoteBodyViewer/hooks/useOnResourceLongPress.js.ma
packages/app-mobile/components/NoteBodyViewer/hooks/useSource.d.ts
packages/app-mobile/components/NoteBodyViewer/hooks/useSource.js
packages/app-mobile/components/NoteBodyViewer/hooks/useSource.js.map
packages/app-mobile/components/NoteEditor/CodeMirror.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror.js
packages/app-mobile/components/NoteEditor/CodeMirror.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.js
packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/createEditor.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/createEditor.js
packages/app-mobile/components/NoteEditor/CodeMirror/createEditor.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/decoratorExtension.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/decoratorExtension.js
packages/app-mobile/components/NoteEditor/CodeMirror/decoratorExtension.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/syntaxHighlightingLanguages.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/syntaxHighlightingLanguages.js
packages/app-mobile/components/NoteEditor/CodeMirror/syntaxHighlightingLanguages.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/theme.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/theme.js
packages/app-mobile/components/NoteEditor/CodeMirror/theme.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/types.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/types.js
packages/app-mobile/components/NoteEditor/CodeMirror/types.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/webviewLogger.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/webviewLogger.js
packages/app-mobile/components/NoteEditor/CodeMirror/webviewLogger.js.map
packages/app-mobile/components/NoteEditor/EditLinkDialog.d.ts
packages/app-mobile/components/NoteEditor/EditLinkDialog.js
packages/app-mobile/components/NoteEditor/EditLinkDialog.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/MarkdownToolbar.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/MarkdownToolbar.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/MarkdownToolbar.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToggleOverflowButton.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToggleOverflowButton.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToggleOverflowButton.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/Toolbar.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/Toolbar.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/Toolbar.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarButton.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarButton.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarButton.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarOverflowRows.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarOverflowRows.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarOverflowRows.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/types.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/types.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/types.js.map
packages/app-mobile/components/NoteEditor/NoteEditor.d.ts
packages/app-mobile/components/NoteEditor/NoteEditor.js
packages/app-mobile/components/NoteEditor/NoteEditor.js.map
packages/app-mobile/components/NoteEditor/SearchPanel.d.ts
packages/app-mobile/components/NoteEditor/SearchPanel.js
packages/app-mobile/components/NoteEditor/SearchPanel.js.map
packages/app-mobile/components/NoteEditor/SelectionFormatting.d.ts
packages/app-mobile/components/NoteEditor/SelectionFormatting.js
packages/app-mobile/components/NoteEditor/SelectionFormatting.js.map
packages/app-mobile/components/NoteEditor/types.d.ts
packages/app-mobile/components/NoteEditor/types.js
packages/app-mobile/components/NoteEditor/types.js.map
packages/app-mobile/components/ScreenHeader.d.ts
packages/app-mobile/components/ScreenHeader.js
packages/app-mobile/components/ScreenHeader.js.map
packages/app-mobile/components/SelectDateTimeDialog.d.ts
packages/app-mobile/components/SelectDateTimeDialog.js
packages/app-mobile/components/SelectDateTimeDialog.js.map
packages/app-mobile/components/SideMenu.d.ts
packages/app-mobile/components/SideMenu.js
packages/app-mobile/components/SideMenu.js.map
packages/app-mobile/components/getResponsiveValue.d.ts
packages/app-mobile/components/getResponsiveValue.js
packages/app-mobile/components/getResponsiveValue.js.map
packages/app-mobile/components/getResponsiveValue.test.d.ts
packages/app-mobile/components/getResponsiveValue.test.js
packages/app-mobile/components/getResponsiveValue.test.js.map
packages/app-mobile/components/screens/ConfigScreen.d.ts
packages/app-mobile/components/screens/ConfigScreen.js
packages/app-mobile/components/screens/ConfigScreen.js.map
@@ -880,6 +972,9 @@ packages/app-mobile/components/screens/UpgradeSyncTargetScreen.js.map
packages/app-mobile/components/screens/encryption-config.d.ts
packages/app-mobile/components/screens/encryption-config.js
packages/app-mobile/components/screens/encryption-config.js.map
packages/app-mobile/gulpfile.d.ts
packages/app-mobile/gulpfile.js
packages/app-mobile/gulpfile.js.map
packages/app-mobile/root.d.ts
packages/app-mobile/root.js
packages/app-mobile/root.js.map
@@ -895,6 +990,9 @@ packages/app-mobile/services/e2ee/RSA.react-native.js.map
packages/app-mobile/setupQuickActions.d.ts
packages/app-mobile/setupQuickActions.js
packages/app-mobile/setupQuickActions.js.map
packages/app-mobile/tools/buildInjectedJs.d.ts
packages/app-mobile/tools/buildInjectedJs.js
packages/app-mobile/tools/buildInjectedJs.js.map
packages/app-mobile/utils/ShareExtension.d.ts
packages/app-mobile/utils/ShareExtension.js
packages/app-mobile/utils/ShareExtension.js.map
@@ -994,6 +1092,12 @@ packages/lib/ClipperServer.js.map
packages/lib/CssUtils.d.ts
packages/lib/CssUtils.js
packages/lib/CssUtils.js.map
packages/lib/EventDispatcher.d.ts
packages/lib/EventDispatcher.js
packages/lib/EventDispatcher.js.map
packages/lib/EventDispatcher.test.d.ts
packages/lib/EventDispatcher.test.js
packages/lib/EventDispatcher.test.js.map
packages/lib/HtmlToMd.d.ts
packages/lib/HtmlToMd.js
packages/lib/HtmlToMd.js.map
@@ -1474,6 +1578,9 @@ packages/lib/services/interop/InteropService_Importer_Md_frontmatter.test.js.map
packages/lib/services/interop/InteropService_Importer_Raw.d.ts
packages/lib/services/interop/InteropService_Importer_Raw.js
packages/lib/services/interop/InteropService_Importer_Raw.js.map
packages/lib/services/interop/InteropService_Importer_Raw.test.d.ts
packages/lib/services/interop/InteropService_Importer_Raw.test.js
packages/lib/services/interop/InteropService_Importer_Raw.test.js.map
packages/lib/services/interop/types.d.ts
packages/lib/services/interop/types.js
packages/lib/services/interop/types.js.map
@@ -1495,6 +1602,9 @@ packages/lib/services/keychain/KeychainServiceDriver.node.js.map
packages/lib/services/keychain/KeychainServiceDriverBase.d.ts
packages/lib/services/keychain/KeychainServiceDriverBase.js
packages/lib/services/keychain/KeychainServiceDriverBase.js.map
packages/lib/services/plugins/BasePlatformImplementation.d.ts
packages/lib/services/plugins/BasePlatformImplementation.js
packages/lib/services/plugins/BasePlatformImplementation.js.map
packages/lib/services/plugins/BasePluginRunner.d.ts
packages/lib/services/plugins/BasePluginRunner.js
packages/lib/services/plugins/BasePluginRunner.js.map
@@ -1579,6 +1689,12 @@ packages/lib/services/plugins/api/JoplinWorkspace.js.map
packages/lib/services/plugins/api/types.d.ts
packages/lib/services/plugins/api/types.js
packages/lib/services/plugins/api/types.js.map
packages/lib/services/plugins/defaultPlugins/defaultPluginsUtils.d.ts
packages/lib/services/plugins/defaultPlugins/defaultPluginsUtils.js
packages/lib/services/plugins/defaultPlugins/defaultPluginsUtils.js.map
packages/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo.d.ts
packages/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo.js
packages/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo.js.map
packages/lib/services/plugins/reducer.d.ts
packages/lib/services/plugins/reducer.js
packages/lib/services/plugins/reducer.js.map
@@ -1885,6 +2001,48 @@ packages/lib/uuid.js.map
packages/lib/versionInfo.d.ts
packages/lib/versionInfo.js
packages/lib/versionInfo.js.map
packages/pdf-viewer/Page.d.ts
packages/pdf-viewer/Page.js
packages/pdf-viewer/Page.js.map
packages/pdf-viewer/PdfDocument.d.ts
packages/pdf-viewer/PdfDocument.js
packages/pdf-viewer/PdfDocument.js.map
packages/pdf-viewer/VerticalPages.d.ts
packages/pdf-viewer/VerticalPages.js
packages/pdf-viewer/VerticalPages.js.map
packages/pdf-viewer/hooks/useIsFocused.d.ts
packages/pdf-viewer/hooks/useIsFocused.js
packages/pdf-viewer/hooks/useIsFocused.js.map
packages/pdf-viewer/hooks/useIsVisible.d.ts
packages/pdf-viewer/hooks/useIsVisible.js
packages/pdf-viewer/hooks/useIsVisible.js.map
packages/pdf-viewer/hooks/usePdfDocument.d.ts
packages/pdf-viewer/hooks/usePdfDocument.js
packages/pdf-viewer/hooks/usePdfDocument.js.map
packages/pdf-viewer/hooks/useScaledSize.d.ts
packages/pdf-viewer/hooks/useScaledSize.js
packages/pdf-viewer/hooks/useScaledSize.js.map
packages/pdf-viewer/hooks/useScrollSaver.d.ts
packages/pdf-viewer/hooks/useScrollSaver.js
packages/pdf-viewer/hooks/useScrollSaver.js.map
packages/pdf-viewer/main.d.ts
packages/pdf-viewer/main.js
packages/pdf-viewer/main.js.map
packages/pdf-viewer/miniViewer.d.ts
packages/pdf-viewer/miniViewer.js
packages/pdf-viewer/miniViewer.js.map
packages/pdf-viewer/pdfSource.test.d.ts
packages/pdf-viewer/pdfSource.test.js
packages/pdf-viewer/pdfSource.test.js.map
packages/pdf-viewer/types.d.ts
packages/pdf-viewer/types.js
packages/pdf-viewer/types.js.map
packages/pdf-viewer/ui/IconButtons.d.ts
packages/pdf-viewer/ui/IconButtons.js
packages/pdf-viewer/ui/IconButtons.js.map
packages/pdf-viewer/ui/ZoomControls.d.ts
packages/pdf-viewer/ui/ZoomControls.js
packages/pdf-viewer/ui/ZoomControls.js.map
packages/plugin-repo-cli/commands/updateRelease.d.ts
packages/plugin-repo-cli/commands/updateRelease.js
packages/plugin-repo-cli/commands/updateRelease.js.map
@@ -1936,6 +2094,9 @@ packages/plugins/ToggleSidebars/api/types.js.map
packages/plugins/ToggleSidebars/src/index.d.ts
packages/plugins/ToggleSidebars/src/index.js
packages/plugins/ToggleSidebars/src/index.js.map
packages/react-native-saf-x/src/index.d.ts
packages/react-native-saf-x/src/index.js
packages/react-native-saf-x/src/index.js.map
packages/renderer/HtmlToHtml.d.ts
packages/renderer/HtmlToHtml.js
packages/renderer/HtmlToHtml.js.map
@@ -2032,6 +2193,12 @@ packages/tools/buildServerDocker.js.map
packages/tools/buildServerDocker.test.d.ts
packages/tools/buildServerDocker.test.js
packages/tools/buildServerDocker.test.js.map
packages/tools/bundleDefaultPlugins.d.ts
packages/tools/bundleDefaultPlugins.js
packages/tools/bundleDefaultPlugins.js.map
packages/tools/bundleDefaultPlugins.test.d.ts
packages/tools/bundleDefaultPlugins.test.js
packages/tools/bundleDefaultPlugins.test.js.map
packages/tools/checkLibPaths.d.ts
packages/tools/checkLibPaths.js
packages/tools/checkLibPaths.js.map

View File

@@ -76,13 +76,16 @@ module.exports = {
'no-array-constructor': ['error'],
'radix': ['error'],
'eqeqeq': ['error', 'always'],
// Warn only for now because fixing everything would take too much
// refactoring, but new code should try to stick to it.
// 'complexity': ['warn', { max: 10 }],
// Checks rules of Hooks
'react-hooks/rules-of-hooks': 'error',
'@seiyab/react-hooks/rules-of-hooks': 'error',
'@seiyab/react-hooks/exhaustive-deps': ['error', { 'ignoreThisDependency': 'props' }],
// Checks effect dependencies
// Disable because of this: https://github.com/facebook/react/issues/16265
// "react-hooks/exhaustive-deps": "warn",
@@ -133,7 +136,10 @@ module.exports = {
'plugins': [
'react',
'@typescript-eslint',
'react-hooks',
// Need to use a fork of the official rules of hooks because of this bug:
// https://github.com/facebook/react/issues/16265
'@seiyab/eslint-plugin-react-hooks',
// 'react-hooks',
'import',
],
'overrides': [

View File

@@ -57,6 +57,11 @@ echo "Yarn $( yarn -v )"
cd "$ROOT_DIR"
yarn install
testResult=$?
if [ $testResult -ne 0 ]; then
echo "Yarn installation failed. Search for 'exit code 1' in the log for more information."
exit $testResult
fi
# =============================================================================
# Run test units. Only do it for pull requests and dev branch because we don't
@@ -170,6 +175,9 @@ cd "$ROOT_DIR/packages/app-desktop"
if [[ $GIT_TAG_NAME = v* ]]; then
echo "Step: Building and publishing desktop application..."
cd "$ROOT_DIR/packages/tools"
node bundleDefaultPlugins.js
cd "$ROOT_DIR/packages/app-desktop"
USE_HARD_LINKS=false yarn run dist
elif [[ $IS_LINUX = 1 ]] && [[ $GIT_TAG_NAME = $SERVER_TAG_PREFIX-* ]]; then
echo "Step: Building Docker Image..."

186
.gitignore vendored
View File

@@ -105,6 +105,9 @@ packages/app-cli/tests/services/plugins/api/JoplinViewMenuItem.js.map
packages/app-cli/tests/services/plugins/api/JoplinWorkspace.d.ts
packages/app-cli/tests/services/plugins/api/JoplinWorkspace.js
packages/app-cli/tests/services/plugins/api/JoplinWorkspace.js.map
packages/app-cli/tests/services/plugins/defaultPluginsUtils.d.ts
packages/app-cli/tests/services/plugins/defaultPluginsUtils.js
packages/app-cli/tests/services/plugins/defaultPluginsUtils.js.map
packages/app-cli/tests/services/plugins/sandboxProxy.d.ts
packages/app-cli/tests/services/plugins/sandboxProxy.js
packages/app-cli/tests/services/plugins/sandboxProxy.js.map
@@ -411,9 +414,6 @@ packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/styles/index.js.map
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/index.d.ts
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/index.js
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/index.js.map
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/tables.d.ts
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/tables.js
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/tables.js.map
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/types.d.ts
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/types.js
packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/types.js.map
@@ -681,9 +681,6 @@ packages/app-desktop/gui/StyleSheets/StyleSheetContainer.js.map
packages/app-desktop/gui/SyncWizard/Dialog.d.ts
packages/app-desktop/gui/SyncWizard/Dialog.js
packages/app-desktop/gui/SyncWizard/Dialog.js.map
packages/app-desktop/gui/TableEditorDialog/Dialog.d.ts
packages/app-desktop/gui/TableEditorDialog/Dialog.js
packages/app-desktop/gui/TableEditorDialog/Dialog.js.map
packages/app-desktop/gui/TagList.d.ts
packages/app-desktop/gui/TagList.js
packages/app-desktop/gui/TagList.js.map
@@ -837,6 +834,15 @@ packages/app-mobile/components/BackButtonDialogBox.js.map
packages/app-mobile/components/CameraView.d.ts
packages/app-mobile/components/CameraView.js
packages/app-mobile/components/CameraView.js.map
packages/app-mobile/components/CustomButton.d.ts
packages/app-mobile/components/CustomButton.js
packages/app-mobile/components/CustomButton.js.map
packages/app-mobile/components/Dropdown.d.ts
packages/app-mobile/components/Dropdown.js
packages/app-mobile/components/Dropdown.js.map
packages/app-mobile/components/ExtendedWebView.d.ts
packages/app-mobile/components/ExtendedWebView.js
packages/app-mobile/components/ExtendedWebView.js.map
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.d.ts
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.js
packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.js.map
@@ -849,15 +855,99 @@ packages/app-mobile/components/NoteBodyViewer/hooks/useOnResourceLongPress.js.ma
packages/app-mobile/components/NoteBodyViewer/hooks/useSource.d.ts
packages/app-mobile/components/NoteBodyViewer/hooks/useSource.js
packages/app-mobile/components/NoteBodyViewer/hooks/useSource.js.map
packages/app-mobile/components/NoteEditor/CodeMirror.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror.js
packages/app-mobile/components/NoteEditor/CodeMirror.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.js
packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/createEditor.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/createEditor.js
packages/app-mobile/components/NoteEditor/CodeMirror/createEditor.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/decoratorExtension.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/decoratorExtension.js
packages/app-mobile/components/NoteEditor/CodeMirror/decoratorExtension.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.test.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.test.js
packages/app-mobile/components/NoteEditor/CodeMirror/markdownReformatter.test.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/syntaxHighlightingLanguages.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/syntaxHighlightingLanguages.js
packages/app-mobile/components/NoteEditor/CodeMirror/syntaxHighlightingLanguages.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/theme.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/theme.js
packages/app-mobile/components/NoteEditor/CodeMirror/theme.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/types.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/types.js
packages/app-mobile/components/NoteEditor/CodeMirror/types.js.map
packages/app-mobile/components/NoteEditor/CodeMirror/webviewLogger.d.ts
packages/app-mobile/components/NoteEditor/CodeMirror/webviewLogger.js
packages/app-mobile/components/NoteEditor/CodeMirror/webviewLogger.js.map
packages/app-mobile/components/NoteEditor/EditLinkDialog.d.ts
packages/app-mobile/components/NoteEditor/EditLinkDialog.js
packages/app-mobile/components/NoteEditor/EditLinkDialog.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/MarkdownToolbar.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/MarkdownToolbar.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/MarkdownToolbar.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToggleOverflowButton.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToggleOverflowButton.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToggleOverflowButton.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/Toolbar.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/Toolbar.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/Toolbar.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarButton.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarButton.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarButton.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarOverflowRows.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarOverflowRows.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/ToolbarOverflowRows.js.map
packages/app-mobile/components/NoteEditor/MarkdownToolbar/types.d.ts
packages/app-mobile/components/NoteEditor/MarkdownToolbar/types.js
packages/app-mobile/components/NoteEditor/MarkdownToolbar/types.js.map
packages/app-mobile/components/NoteEditor/NoteEditor.d.ts
packages/app-mobile/components/NoteEditor/NoteEditor.js
packages/app-mobile/components/NoteEditor/NoteEditor.js.map
packages/app-mobile/components/NoteEditor/SearchPanel.d.ts
packages/app-mobile/components/NoteEditor/SearchPanel.js
packages/app-mobile/components/NoteEditor/SearchPanel.js.map
packages/app-mobile/components/NoteEditor/SelectionFormatting.d.ts
packages/app-mobile/components/NoteEditor/SelectionFormatting.js
packages/app-mobile/components/NoteEditor/SelectionFormatting.js.map
packages/app-mobile/components/NoteEditor/types.d.ts
packages/app-mobile/components/NoteEditor/types.js
packages/app-mobile/components/NoteEditor/types.js.map
packages/app-mobile/components/ScreenHeader.d.ts
packages/app-mobile/components/ScreenHeader.js
packages/app-mobile/components/ScreenHeader.js.map
packages/app-mobile/components/SelectDateTimeDialog.d.ts
packages/app-mobile/components/SelectDateTimeDialog.js
packages/app-mobile/components/SelectDateTimeDialog.js.map
packages/app-mobile/components/SideMenu.d.ts
packages/app-mobile/components/SideMenu.js
packages/app-mobile/components/SideMenu.js.map
packages/app-mobile/components/getResponsiveValue.d.ts
packages/app-mobile/components/getResponsiveValue.js
packages/app-mobile/components/getResponsiveValue.js.map
packages/app-mobile/components/getResponsiveValue.test.d.ts
packages/app-mobile/components/getResponsiveValue.test.js
packages/app-mobile/components/getResponsiveValue.test.js.map
packages/app-mobile/components/screens/ConfigScreen.d.ts
packages/app-mobile/components/screens/ConfigScreen.js
packages/app-mobile/components/screens/ConfigScreen.js.map
@@ -870,6 +960,9 @@ packages/app-mobile/components/screens/UpgradeSyncTargetScreen.js.map
packages/app-mobile/components/screens/encryption-config.d.ts
packages/app-mobile/components/screens/encryption-config.js
packages/app-mobile/components/screens/encryption-config.js.map
packages/app-mobile/gulpfile.d.ts
packages/app-mobile/gulpfile.js
packages/app-mobile/gulpfile.js.map
packages/app-mobile/root.d.ts
packages/app-mobile/root.js
packages/app-mobile/root.js.map
@@ -885,6 +978,9 @@ packages/app-mobile/services/e2ee/RSA.react-native.js.map
packages/app-mobile/setupQuickActions.d.ts
packages/app-mobile/setupQuickActions.js
packages/app-mobile/setupQuickActions.js.map
packages/app-mobile/tools/buildInjectedJs.d.ts
packages/app-mobile/tools/buildInjectedJs.js
packages/app-mobile/tools/buildInjectedJs.js.map
packages/app-mobile/utils/ShareExtension.d.ts
packages/app-mobile/utils/ShareExtension.js
packages/app-mobile/utils/ShareExtension.js.map
@@ -984,6 +1080,12 @@ packages/lib/ClipperServer.js.map
packages/lib/CssUtils.d.ts
packages/lib/CssUtils.js
packages/lib/CssUtils.js.map
packages/lib/EventDispatcher.d.ts
packages/lib/EventDispatcher.js
packages/lib/EventDispatcher.js.map
packages/lib/EventDispatcher.test.d.ts
packages/lib/EventDispatcher.test.js
packages/lib/EventDispatcher.test.js.map
packages/lib/HtmlToMd.d.ts
packages/lib/HtmlToMd.js
packages/lib/HtmlToMd.js.map
@@ -1464,6 +1566,9 @@ packages/lib/services/interop/InteropService_Importer_Md_frontmatter.test.js.map
packages/lib/services/interop/InteropService_Importer_Raw.d.ts
packages/lib/services/interop/InteropService_Importer_Raw.js
packages/lib/services/interop/InteropService_Importer_Raw.js.map
packages/lib/services/interop/InteropService_Importer_Raw.test.d.ts
packages/lib/services/interop/InteropService_Importer_Raw.test.js
packages/lib/services/interop/InteropService_Importer_Raw.test.js.map
packages/lib/services/interop/types.d.ts
packages/lib/services/interop/types.js
packages/lib/services/interop/types.js.map
@@ -1485,6 +1590,9 @@ packages/lib/services/keychain/KeychainServiceDriver.node.js.map
packages/lib/services/keychain/KeychainServiceDriverBase.d.ts
packages/lib/services/keychain/KeychainServiceDriverBase.js
packages/lib/services/keychain/KeychainServiceDriverBase.js.map
packages/lib/services/plugins/BasePlatformImplementation.d.ts
packages/lib/services/plugins/BasePlatformImplementation.js
packages/lib/services/plugins/BasePlatformImplementation.js.map
packages/lib/services/plugins/BasePluginRunner.d.ts
packages/lib/services/plugins/BasePluginRunner.js
packages/lib/services/plugins/BasePluginRunner.js.map
@@ -1569,6 +1677,12 @@ packages/lib/services/plugins/api/JoplinWorkspace.js.map
packages/lib/services/plugins/api/types.d.ts
packages/lib/services/plugins/api/types.js
packages/lib/services/plugins/api/types.js.map
packages/lib/services/plugins/defaultPlugins/defaultPluginsUtils.d.ts
packages/lib/services/plugins/defaultPlugins/defaultPluginsUtils.js
packages/lib/services/plugins/defaultPlugins/defaultPluginsUtils.js.map
packages/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo.d.ts
packages/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo.js
packages/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo.js.map
packages/lib/services/plugins/reducer.d.ts
packages/lib/services/plugins/reducer.js
packages/lib/services/plugins/reducer.js.map
@@ -1875,6 +1989,48 @@ packages/lib/uuid.js.map
packages/lib/versionInfo.d.ts
packages/lib/versionInfo.js
packages/lib/versionInfo.js.map
packages/pdf-viewer/Page.d.ts
packages/pdf-viewer/Page.js
packages/pdf-viewer/Page.js.map
packages/pdf-viewer/PdfDocument.d.ts
packages/pdf-viewer/PdfDocument.js
packages/pdf-viewer/PdfDocument.js.map
packages/pdf-viewer/VerticalPages.d.ts
packages/pdf-viewer/VerticalPages.js
packages/pdf-viewer/VerticalPages.js.map
packages/pdf-viewer/hooks/useIsFocused.d.ts
packages/pdf-viewer/hooks/useIsFocused.js
packages/pdf-viewer/hooks/useIsFocused.js.map
packages/pdf-viewer/hooks/useIsVisible.d.ts
packages/pdf-viewer/hooks/useIsVisible.js
packages/pdf-viewer/hooks/useIsVisible.js.map
packages/pdf-viewer/hooks/usePdfDocument.d.ts
packages/pdf-viewer/hooks/usePdfDocument.js
packages/pdf-viewer/hooks/usePdfDocument.js.map
packages/pdf-viewer/hooks/useScaledSize.d.ts
packages/pdf-viewer/hooks/useScaledSize.js
packages/pdf-viewer/hooks/useScaledSize.js.map
packages/pdf-viewer/hooks/useScrollSaver.d.ts
packages/pdf-viewer/hooks/useScrollSaver.js
packages/pdf-viewer/hooks/useScrollSaver.js.map
packages/pdf-viewer/main.d.ts
packages/pdf-viewer/main.js
packages/pdf-viewer/main.js.map
packages/pdf-viewer/miniViewer.d.ts
packages/pdf-viewer/miniViewer.js
packages/pdf-viewer/miniViewer.js.map
packages/pdf-viewer/pdfSource.test.d.ts
packages/pdf-viewer/pdfSource.test.js
packages/pdf-viewer/pdfSource.test.js.map
packages/pdf-viewer/types.d.ts
packages/pdf-viewer/types.js
packages/pdf-viewer/types.js.map
packages/pdf-viewer/ui/IconButtons.d.ts
packages/pdf-viewer/ui/IconButtons.js
packages/pdf-viewer/ui/IconButtons.js.map
packages/pdf-viewer/ui/ZoomControls.d.ts
packages/pdf-viewer/ui/ZoomControls.js
packages/pdf-viewer/ui/ZoomControls.js.map
packages/plugin-repo-cli/commands/updateRelease.d.ts
packages/plugin-repo-cli/commands/updateRelease.js
packages/plugin-repo-cli/commands/updateRelease.js.map
@@ -1926,6 +2082,9 @@ packages/plugins/ToggleSidebars/api/types.js.map
packages/plugins/ToggleSidebars/src/index.d.ts
packages/plugins/ToggleSidebars/src/index.js
packages/plugins/ToggleSidebars/src/index.js.map
packages/react-native-saf-x/src/index.d.ts
packages/react-native-saf-x/src/index.js
packages/react-native-saf-x/src/index.js.map
packages/renderer/HtmlToHtml.d.ts
packages/renderer/HtmlToHtml.js
packages/renderer/HtmlToHtml.js.map
@@ -2022,6 +2181,12 @@ packages/tools/buildServerDocker.js.map
packages/tools/buildServerDocker.test.d.ts
packages/tools/buildServerDocker.test.js
packages/tools/buildServerDocker.test.js.map
packages/tools/bundleDefaultPlugins.d.ts
packages/tools/bundleDefaultPlugins.js
packages/tools/bundleDefaultPlugins.js.map
packages/tools/bundleDefaultPlugins.test.d.ts
packages/tools/bundleDefaultPlugins.test.js
packages/tools/bundleDefaultPlugins.test.js.map
packages/tools/checkLibPaths.d.ts
packages/tools/checkLibPaths.js
packages/tools/checkLibPaths.js.map
@@ -2116,3 +2281,6 @@ packages/tools/website/utils/types.d.ts
packages/tools/website/utils/types.js
packages/tools/website/utils/types.js.map
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
packages/app-mobile/components/get-responsive-value.test.js
packages/app-mobile/components/get-responsive-value.test.js
packages/app-mobile/components/get-responsive-value.test.js

View File

@@ -9,11 +9,13 @@ import PluginManager from 'tinymce/core/api/PluginManager';
import * as Api from './api/Api';
import * as Commands from './api/Commands';
import * as Keyboard from './core/Keyboard';
import * as Mouse from './core/Mouse'
import * as Buttons from './ui/Buttons';
export default function () {
PluginManager.add('joplinLists', function (editor) {
Keyboard.setup(editor);
Mouse.setup(editor);
Buttons.register(editor);
Commands.register(editor);

View File

@@ -0,0 +1,26 @@
import { isJoplinChecklistItem } from '../listModel/JoplinListUtil';
const setup = function (editor) {
const editorClickHandler = (event) => {
if (!isJoplinChecklistItem(event.target)) return;
// We only process the click if it's within the checkbox itself (and not the label).
// That checkbox, based on
// the current styling is in the negative margin, so offsetX is negative when clicking
// on the checkbox itself, and positive when clicking on the label. This is strongly
// dependent on how the checkbox is styled, so if the style is changed, this might need
// to be updated too.
// For the styling, see:
// packages/renderer/MdToHtml/rules/checkbox.ts
//
// The previous solution was to use "pointer-event: none", which mostly work, however
// it means that links are no longer clickable when they are within the checkbox label.
if (event.offsetX >= 0) return;
editor.execCommand('ToggleJoplinChecklistItem', false, { element: event.target });
}
editor.on('click', editorClickHandler);
};
export { setup };

View File

@@ -10,7 +10,7 @@ import * as Settings from '../api/Settings';
import * as NodeType from '../core/NodeType';
import Editor from 'tinymce/core/api/Editor';
import { isCustomList } from '../core/Util';
import { findContainerListTypeFromEvent, isJoplinChecklistItem } from '../listModel/JoplinListUtil';
import { findContainerListTypeFromEvent } from '../listModel/JoplinListUtil';
const findIndex = function (list, predicate) {
for (let index = 0; index < list.length; index++) {
@@ -38,37 +38,11 @@ const listState = function (editor: Editor, listName, options:any = {}) {
buttonApi.setActive(listType === options.listType && lists.length > 0 && lists[0].nodeName === listName && !isCustomList(lists[0]));
};
const editorClickHandler = (event) => {
if (!isJoplinChecklistItem(event.target)) return;
// We only process the click if it's within the checkbox itself (and not the label).
// That checkbox, based on
// the current styling is in the negative margin, so offsetX is negative when clicking
// on the checkbox itself, and positive when clicking on the label. This is strongly
// dependent on how the checkbox is styled, so if the style is changed, this might need
// to be updated too.
// For the styling, see:
// packages/renderer/MdToHtml/rules/checkbox.ts
//
// The previous solution was to use "pointer-event: none", which mostly work, however
// it means that links are no longer clickable when they are within the checkbox label.
if (event.offsetX >= 0) return;
editor.execCommand('ToggleJoplinChecklistItem', false, { element: event.target });
}
if (options.listType === 'joplinChecklist') {
editor.on('click', editorClickHandler);
}
editor.on('NodeChange', nodeChangeHandler);
return () => {
if (options.listType === 'joplinChecklist') {
editor.off('click', editorClickHandler);
}
editor.off('NodeChange', nodeChangeHandler);
}
}
};
};

View File

@@ -1,4 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Joplin]]></title><description><![CDATA[Joplin, the open source note-taking application]]></description><link>https://joplinapp.org</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jun 2022 00:00:00 GMT</lastBuildDate><atom:link href="https://joplinapp.org/rss.xml" rel="self" type="application/rss+xml"/><pubDate>Mon, 06 Jun 2022 00:00:00 GMT</pubDate><item><title><![CDATA[Joplin 2.8 is available!]]></title><description><![CDATA[<p>As always a lot of changes and new features in this new version available on both desktop and mobile.</p>
<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Joplin]]></title><description><![CDATA[Joplin, the open source note-taking application]]></description><link>https://joplinapp.org</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Aug 2022 00:00:00 GMT</lastBuildDate><atom:link href="https://joplinapp.org/rss.xml" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Aug 2022 00:00:00 GMT</pubDate><item><title><![CDATA[Joplin first meetup on 30 August!]]></title><description><![CDATA[<p>We are glad to announce <a href="https://www.meetup.com/joplin/events/287611873/">the first Joplin Meetup</a> that will take place on 30 August 2022 in London!</p>
<p>This is an opportunity to meet other Joplin users as well as some of the main contributors, to discuss the apps, or to ask questions and exchange tips and tricks on how to use the app, develop plugins or contribute to the application. Everybody, technical or not, is welcome!</p>
<p>We will meet at the Old Thameside Inn next to London Bridge. If the weather allows we will be on the terrace outside, if not inside.</p>
<p>More information on the official Meetup page:</p>
<p><a href="https://www.meetup.com/joplin/events/287611873/">https://www.meetup.com/joplin/events/287611873/</a></p>
]]></description><link>https://joplinapp.org/news/20220808-first-meetup/</link><guid isPermaLink="false">20220808-first-meetup</guid><pubDate>Mon, 08 Aug 2022 00:00:00 GMT</pubDate><twitter-text>Joplin will have its first Meetup on 30 August! Come and join us at the Old Thameside Inn next to London Bridge! https://www.meetup.com/joplin/events/287611873/</twitter-text></item><item><title><![CDATA[Joplin 2.8 is available!]]></title><description><![CDATA[<p>As always a lot of changes and new features in this new version available on both desktop and mobile.</p>
<h1>Multiple profile support<a name="multiple-profile-support" href="#multiple-profile-support" class="heading-anchor">🔗</a></h1>
<p>Perhaps the most visible change in this version is the support for multiple profiles. You can now create as many application profile as you wish, each with their own settings, and easily switch from one to another. The main use case is to support for example a &quot;work&quot; profile and a &quot;personal&quot; profile, to allow you to keep things independent, and each profile can sync with a different sync target.</p>
<p>To create a new profile, open <strong>File &gt; Switch profile</strong> and select <strong>Create new profile</strong>, enter the profile name and press OK. The app will automatically switch to this new profile, which you can now configure.</p>
@@ -256,6 +261,4 @@
]]></description><link>https://joplinapp.org/news/20210706-140228/</link><guid isPermaLink="false">20210706-140228</guid><pubDate>Tue, 06 Jul 2021 14:02:28 GMT</pubDate><twitter-text></twitter-text></item><item><title><![CDATA[Any ideas for a Joplin tagline?]]></title><description><![CDATA[<p>I'm going to update the website front page to better showcase the application. I have most of the sections right, but the part I'm still not sure about is the top tagline, so I'm wondering if anyone had any suggestion about it?</p>
<p>From what I can see on Google Keep or Evernote for example it should be something like &quot;Use our app to get X or Y benefit&quot;, it should be a sentence that directly speaks to the user essentially.</p>
<p>So far I have &quot;Your notes, anywhere you are&quot; but I'm not certain that's particularly inspiring. Any other idea about what tagline could be used?</p>
]]></description><link>https://joplinapp.org/news/20210705-094247/</link><guid isPermaLink="false">20210705-094247</guid><pubDate>Mon, 05 Jul 2021 09:42:47 GMT</pubDate><twitter-text></twitter-text></item><item><title><![CDATA[Poll: What's the size of your note collection?]]></title><description><![CDATA[<p>Poll is on the forum:</p>
<p><a href="https://discourse.joplinapp.org/t/poll-whats-the-size-of-your-note-collection/18191">https://discourse.joplinapp.org/t/poll-whats-the-size-of-your-note-collection/18191</a></p>
]]></description><link>https://joplinapp.org/news/20210624-171844/</link><guid isPermaLink="false">20210624-171844</guid><pubDate>Thu, 24 Jun 2021 17:18:44 GMT</pubDate><twitter-text></twitter-text></item></channel></rss>
]]></description><link>https://joplinapp.org/news/20210705-094247/</link><guid isPermaLink="false">20210705-094247</guid><pubDate>Mon, 05 Jul 2021 09:42:47 GMT</pubDate><twitter-text></twitter-text></item></channel></rss>

View File

@@ -1,5 +1,7 @@
<!-- Monthly/Yearly plan A/B testing -->
<!--
<script src="https://www.googleoptimize.com/optimize.js?id=OPT-PW3ZPK3"></script>
-->
<!-- Donate button A/B testing -->
<!--

View File

@@ -116,16 +116,21 @@
});
};
const applyPeriod = (period) => {
subscriptionPeriod = period;
$('.plan-group').removeClass(period === 'monthly' ? 'plan-prices-yearly' : 'plan-prices-monthly');
$('.plan-group').addClass('plan-prices-' + period);
$("#pay-" + period + '-radio').prop('checked', true);
}
$(() => {
$("input[name='pay-radio']").change(function() {
const period = $("input[type='radio'][name='pay-radio']:checked").val();
subscriptionPeriod = period;
$('.plan-group').removeClass(period === 'monthly' ? 'plan-prices-yearly' : 'plan-prices-monthly');
$('.plan-group').addClass('plan-prices-' + period);
applyPeriod(period);
});
setupBetaHandling(urlQuery);
applyPeriod('yearly');
});
</script>
</div>

View File

@@ -45,11 +45,11 @@ Building the apps is relatively easy - please [see the build instructions](https
## Coding style
Coding style is enforced by a pre-commit hook that runs eslint. This hook is installed whenever running `yarn install` on any of the application directory. If for some reason the pre-commit hook didn't get installed, you can manually install it by running `yarn install` at the root of the repository.
Please see [readme/coding_style.md](readme/coding_style.md).
For new React components, please use [React Hooks](https://reactjs.org/docs/hooks-intro.html). For new code in general, please use TypeScript. Even if you are modifying a file that was originally in JavaScript you should ideally convert it first to TypeScript before modifying it. Doing so is relatively easy and it helps maintain code quality.
## GUI style
For changes made to the Desktop client that affect the user interface, refer to `packages/app-desktop/theme.ts` for all styling information. The goal is to create a consistent user interface to allow for easy navigation of Joplin's various features and improve the overall user experience.
For changes made to the Desktop and mobile clients that affect the user interface, refer to `packages/lib/theme.ts` for all styling information. The goal is to create a consistent user interface to allow for easy navigation of Joplin's various features and improve the overall user experience.
## Automated tests

View File

@@ -4,6 +4,10 @@
* * *
Joplin will have [its first Meetup on 30 August 2022](https://discourse.joplinapp.org/t/joplin-first-meetup-on-30-august/26808)! Come and join us at the Old Thameside Inn next to London Bridge!
* * *
🌞 Joplin participates in **Google Summer of Code 2022**! More info on [the announcement post](https://github.com/laurent22/joplin/blob/dev/readme/news/20220308-gsoc2022-start.md). 🌞
* * *
@@ -83,8 +87,9 @@ A community maintained list of these distributions can be found here: [Unofficia
| <img width="50" src="https://avatars2.githubusercontent.com/u/1439535?s=96&v=4"/></br>[fbloise](https://github.com/fbloise) | <img width="50" src="https://avatars2.githubusercontent.com/u/49439044?s=96&v=4"/></br>[fourstepper](https://github.com/fourstepper) | <img width="50" src="https://avatars2.githubusercontent.com/u/38898566?s=96&v=4"/></br>[h4sh5](https://github.com/h4sh5) | <img width="50" src="https://avatars2.githubusercontent.com/u/3266447?s=96&v=4"/></br>[iamwillbar](https://github.com/iamwillbar) |
| <img width="50" src="https://avatars2.githubusercontent.com/u/37297218?s=96&v=4"/></br>[Jesssullivan](https://github.com/Jesssullivan) | <img width="50" src="https://avatars2.githubusercontent.com/u/1248504?s=96&v=4"/></br>[joesfer](https://github.com/joesfer) | <img width="50" src="https://avatars2.githubusercontent.com/u/5588131?s=96&v=4"/></br>[kianenigma](https://github.com/kianenigma) | <img width="50" src="https://avatars2.githubusercontent.com/u/24908652?s=96&v=4"/></br>[konishi-t](https://github.com/konishi-t) |
| <img width="50" src="https://avatars2.githubusercontent.com/u/42319182?s=96&v=4"/></br>[marcdw1289](https://github.com/marcdw1289) | <img width="50" src="https://avatars2.githubusercontent.com/u/1788010?s=96&v=4"/></br>[maxtruxa](https://github.com/maxtruxa) | <img width="50" src="https://avatars2.githubusercontent.com/u/29300939?s=96&v=4"/></br>[mcejp](https://github.com/mcejp) | <img width="50" src="https://avatars2.githubusercontent.com/u/1168659?s=96&v=4"/></br>[nicholashead](https://github.com/nicholashead) |
| <img width="50" src="https://avatars2.githubusercontent.com/u/5782817?s=96&v=4"/></br>[piccobit](https://github.com/piccobit) | <img width="50" src="https://avatars2.githubusercontent.com/u/77214738?s=96&v=4"/></br>[Polymathic-Company](https://github.com/Polymathic-Company) | <img width="50" src="https://avatars2.githubusercontent.com/u/47742?s=96&v=4"/></br>[ravenscroftj](https://github.com/ravenscroftj) | <img width="50" src="https://avatars2.githubusercontent.com/u/765564?s=96&v=4"/></br>[taskcruncher](https://github.com/taskcruncher) |
| <img width="50" src="https://avatars2.githubusercontent.com/u/73081837?s=96&v=4"/></br>[thismarty](https://github.com/thismarty) | <img width="50" src="https://avatars2.githubusercontent.com/u/15859362?s=96&v=4"/></br>[thomasbroussard](https://github.com/thomasbroussard) | | |
| <img width="50" src="https://avatars2.githubusercontent.com/u/5782817?s=96&v=4"/></br>[piccobit](https://github.com/piccobit) | <img width="50" src="https://avatars2.githubusercontent.com/u/77214738?s=96&v=4"/></br>[Polymathic-Company](https://github.com/Polymathic-Company) | <img width="50" src="https://avatars2.githubusercontent.com/u/47742?s=96&v=4"/></br>[ravenscroftj](https://github.com/ravenscroftj) | <img width="50" src="https://avatars2.githubusercontent.com/u/327998?s=96&v=4"/></br>[sif](https://github.com/sif) |
| <img width="50" src="https://avatars2.githubusercontent.com/u/54626606?s=96&v=4"/></br>[skyrunner15](https://github.com/skyrunner15) | <img width="50" src="https://avatars2.githubusercontent.com/u/765564?s=96&v=4"/></br>[taskcruncher](https://github.com/taskcruncher) | <img width="50" src="https://avatars2.githubusercontent.com/u/73081837?s=96&v=4"/></br>[thismarty](https://github.com/thismarty) | <img width="50" src="https://avatars2.githubusercontent.com/u/15859362?s=96&v=4"/></br>[thomasbroussard](https://github.com/thomasbroussard) |
| | | | |
<!-- SPONSORS-GITHUB -->
<!-- TOC -->

View File

@@ -325,6 +325,7 @@
"homenote",
"hotfolder",
"Howver",
"hpagent",
"Hrvatska",
"htmlentities",
"htmlfile",
@@ -950,4 +951,4 @@
"မြန်မာ",
"កម្ពុជា"
]
}
}

View File

@@ -12,8 +12,8 @@
"node": ">=16"
},
"scripts": {
"buildParallel": "yarn workspaces foreach --verbose --interlaced --parallel --jobs 2 run build && yarn run tsc",
"buildSequential": "yarn workspaces foreach --verbose --interlaced run build && yarn run tsc",
"buildParallel": "yarn workspaces foreach --verbose --interlaced --parallel --jobs 2 --topological run build && yarn run tsc",
"buildSequential": "yarn workspaces foreach --verbose --interlaced --topological run build && yarn run tsc",
"buildApiDoc": "yarn workspace joplin start apidoc ../../readme/api/references/rest_api.md",
"buildCommandIndex": "gulp buildCommandIndex",
"buildPluginDoc": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme './Assets/PluginDocTheme/' --readme './Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out ../joplin-website/docs/api/references/plugin_api packages/lib/services/plugins/api/",
@@ -31,6 +31,7 @@
"linter-ci": "eslint --resolve-plugins-relative-to . --quiet --ext .js --ext .jsx --ext .ts --ext .tsx",
"linter-precommit": "eslint --resolve-plugins-relative-to . --fix --ext .js --ext .jsx --ext .ts --ext .tsx",
"linter": "eslint --resolve-plugins-relative-to . --fix --quiet --ext .js --ext .jsx --ext .ts --ext .tsx",
"linter-interactive": "eslint-interactive --resolve-plugins-relative-to . --fix --quiet --ext .js --ext .jsx --ext .ts --ext .tsx",
"postinstall": "gulp build",
"publishAll": "git pull && yarn run 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",
@@ -47,8 +48,8 @@
"tagServerLatest": "node packages/tools/tagServerLatest.js",
"buildServerDocker": "node packages/tools/buildServerDocker.js",
"setupNewRelease": "node ./packages/tools/setupNewRelease",
"test-ci": "yarn workspaces foreach --parallel --verbose --interlaced --jobs 2 run test-ci",
"test": "yarn workspaces foreach --parallel --verbose --interlaced --jobs 2 run test",
"test-ci": "BROWSERSLIST_IGNORE_OLD_DATA=1 yarn workspaces foreach --parallel --verbose --interlaced --jobs 2 run test-ci",
"test": "BROWSERSLIST_IGNORE_OLD_DATA=1 yarn workspaces foreach --parallel --verbose --interlaced --jobs 2 run test",
"tsc": "yarn workspaces foreach --parallel --verbose --interlaced run tsc",
"updateIgnored": "gulp updateIgnoredTypeScriptBuild",
"updatePluginTypes": "./packages/generator-joplin/updateTypes.sh",
@@ -61,13 +62,14 @@
}
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"@seiyab/eslint-plugin-react-hooks": "^4.5.1-alpha.5",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"cspell": "^5.20.0",
"eslint": "^7.6.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-react": "^7.18.0",
"eslint-plugin-react-hooks": "^2.4.0",
"eslint": "^8.22.0",
"eslint-interactive": "^10.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-react": "^7.30.1",
"fs-extra": "^8.1.0",
"glob": "^7.1.6",
"gulp": "^4.0.2",
@@ -76,9 +78,10 @@
"lint-staged": "^9.2.1",
"madge": "^4.0.2",
"typedoc": "^0.17.8",
"typescript": "4.0.5"
"typescript": "4.7.4"
},
"dependencies": {
"@types/fs-extra": "^9.0.13",
"http-server": "^0.12.3",
"node-gyp": "^8.4.1",
"nodemon": "^2.0.9"

View File

@@ -375,6 +375,11 @@ class AppGui {
this.showNoteMetadata(!this.widget('noteMetadata').shown);
}
toggleFolderIds() {
this.widget('folderList').toggleShowIds();
this.widget('noteList').toggleShowIds();
}
widget(name) {
if (name === 'root') return this.rootWidget_;
return this.rootWidget_.childByName(name);
@@ -412,7 +417,7 @@ class AppGui {
const widget = this.widget('mainWindow').focusedWidget;
if (!widget) return null;
if (widget.name == 'noteList' || widget.name == 'folderList') {
if (widget.name === 'noteList' || widget.name === 'folderList') {
return widget.currentItem;
}
@@ -498,6 +503,8 @@ class AppGui {
}
} else if (cmd === 'toggle_metadata') {
this.toggleNoteMetadata();
} else if (cmd === 'toggle_ids') {
this.toggleFolderIds();
} else if (cmd === 'enter_command_line_mode') {
const cmd = await this.widget('statusBar').prompt();
if (!cmd) return;
@@ -521,11 +528,11 @@ class AppGui {
const args = splitCommandString(cmd);
for (let i = 0; i < args.length; i++) {
if (args[i] == '$n') {
if (args[i] === '$n') {
args[i] = note ? note.id : '';
} else if (args[i] == '$b') {
} else if (args[i] === '$b') {
args[i] = folder ? folder.id : '';
} else if (args[i] == '$c') {
} else if (args[i] === '$c') {
const item = this.activeListItem();
args[i] = item ? item.id : '';
}

View File

@@ -81,21 +81,21 @@ class Application extends BaseApplication {
pattern = pattern ? pattern.toString() : '';
if (type == BaseModel.TYPE_FOLDER && (pattern == Folder.conflictFolderTitle() || pattern == Folder.conflictFolderId())) return [Folder.conflictFolder()];
if (type === BaseModel.TYPE_FOLDER && (pattern === Folder.conflictFolderTitle() || pattern === Folder.conflictFolderId())) return [Folder.conflictFolder()];
if (!options) options = {};
const parent = options.parent ? options.parent : app().currentFolder();
const ItemClass = BaseItem.itemClass(type);
if (type == BaseModel.TYPE_NOTE && pattern.indexOf('*') >= 0) {
if (type === BaseModel.TYPE_NOTE && pattern.indexOf('*') >= 0) {
// Handle it as pattern
if (!parent) throw new Error(_('No notebook selected.'));
return await Note.previews(parent.id, { titlePattern: pattern });
} else {
// Single item
let item = null;
if (type == BaseModel.TYPE_NOTE) {
if (type === BaseModel.TYPE_NOTE) {
if (!parent) throw new Error(_('No notebook has been specified.'));
item = await ItemClass.loadFolderNoteByField(parent.id, 'title', pattern);
} else {
@@ -137,7 +137,7 @@ class Application extends BaseApplication {
if (!options.booleanAnswerDefault) options.booleanAnswerDefault = 'y';
if (!options.answers) options.answers = options.booleanAnswerDefault === 'y' ? [_('Y'), _('n')] : [_('N'), _('y')];
if (options.type == 'boolean') {
if (options.type === 'boolean') {
message += ` (${options.answers.join('/')})`;
}
@@ -146,7 +146,7 @@ class Application extends BaseApplication {
if (options.type === 'boolean') {
if (answer === null) return false; // Pressed ESCAPE
if (!answer) answer = options.answers[0];
const positiveIndex = options.booleanAnswerDefault == 'y' ? 0 : 1;
const positiveIndex = options.booleanAnswerDefault === 'y' ? 0 : 1;
return answer.toLowerCase() === options.answers[positiveIndex].toLowerCase();
} else {
return answer;
@@ -181,7 +181,7 @@ class Application extends BaseApplication {
fs.readdirSync(__dirname).forEach(path => {
if (path.indexOf('command-') !== 0) return;
const ext = fileExtension(path);
if (ext != 'js') return;
if (ext !== 'js') return;
const CommandClass = require(`./${path}`);
let cmd = new CommandClass();
@@ -332,6 +332,7 @@ class Application extends BaseApplication {
{ keys: [' '], command: 'todo toggle $n' },
{ keys: ['tc'], type: 'function', command: 'toggle_console' },
{ keys: ['tm'], type: 'function', command: 'toggle_metadata' },
{ keys: ['ti'], type: 'function', command: 'toggle_ids' },
{ keys: ['/'], type: 'prompt', command: 'search ""', cursorPosition: -2 },
{ keys: ['mn'], type: 'prompt', command: 'mknote ""', cursorPosition: -2 },
{ keys: ['mt'], type: 'prompt', command: 'mktodo ""', cursorPosition: -2 },

View File

@@ -12,7 +12,7 @@ async function handleAutocompletionPromise(line) {
const words = getArguments(line);
// If there is only one word and it is not already a command name then you
// should look for commands it could be
if (words.length == 1) {
if (words.length === 1) {
if (names.indexOf(words[0]) === -1) {
const x = names.filter(n => n.indexOf(words[0]) === 0);
if (x.length === 1) {
@@ -78,38 +78,38 @@ async function handleAutocompletionPromise(line) {
const currentFolder = app().currentFolder();
if (argName == 'note' || argName == 'note-pattern') {
if (argName === 'note' || argName === 'note-pattern') {
const notes = currentFolder ? await Note.previews(currentFolder.id, { titlePattern: `${next}*` }) : [];
l.push(...notes.map(n => n.title));
}
if (argName == 'notebook') {
if (argName === 'notebook') {
const folders = await Folder.search({ titlePattern: `${next}*` });
l.push(...folders.map(n => n.title));
}
if (argName == 'item') {
if (argName === 'item') {
const notes = currentFolder ? await Note.previews(currentFolder.id, { titlePattern: `${next}*` }) : [];
const folders = await Folder.search({ titlePattern: `${next}*` });
l.push(...notes.map(n => n.title), folders.map(n => n.title));
}
if (argName == 'tag') {
if (argName === 'tag') {
const tags = await Tag.search({ titlePattern: `${next}*` });
l.push(...tags.map(n => n.title));
}
if (argName == 'file') {
if (argName === 'file') {
const files = await fs.readdir('.');
l.push(...files);
}
if (argName == 'tag-command') {
if (argName === 'tag-command') {
const c = filterList(['add', 'remove', 'list', 'notetags'], next);
l.push(...c);
}
if (argName == 'todo-command') {
if (argName === 'todo-command') {
const c = filterList(['toggle', 'clear'], next);
l.push(...c);
}

View File

@@ -52,7 +52,7 @@ function getCommands() {
fs.readdirSync(__dirname).forEach(path => {
if (path.indexOf('command-') !== 0) return;
const ext = fileExtension(path);
if (ext != 'js') return;
if (ext !== 'js') return;
const CommandClass = require(`./${path}`);
const cmd = new CommandClass();

View File

@@ -222,7 +222,7 @@ async function main() {
for (const n in testUnits) {
if (!testUnits.hasOwnProperty(n)) continue;
if (onlyThisTest && n != onlyThisTest) continue;
if (onlyThisTest && n !== onlyThisTest) continue;
await clearDatabase();
const testName = n.substr(4).toLowerCase();

View File

@@ -21,7 +21,7 @@ cliUtils.printArray = function(logFunction, rows) {
for (let j = 0; j < row.length; j++) {
const item = row[j];
const width = item ? item.toString().length : 0;
const align = typeof item == 'number' ? ALIGN_RIGHT : ALIGN_LEFT;
const align = typeof item === 'number' ? ALIGN_RIGHT : ALIGN_LEFT;
if (!colWidths[j] || colWidths[j] < width) colWidths[j] = width;
if (colAligns.length <= j) colAligns[j] = align;
}
@@ -32,7 +32,7 @@ cliUtils.printArray = function(logFunction, rows) {
for (let col = 0; col < colWidths.length; col++) {
const item = rows[row][col];
const width = colWidths[col];
const dir = colAligns[col] == ALIGN_LEFT ? stringPadding.RIGHT : stringPadding.LEFT;
const dir = colAligns[col] === ALIGN_LEFT ? stringPadding.RIGHT : stringPadding.LEFT;
line.push(stringPadding(item, width, ' ', dir));
}
logFunction(line.join(' '));
@@ -45,13 +45,13 @@ cliUtils.parseFlags = function(flags) {
for (let i = 0; i < flags.length; i++) {
let f = flags[i].trim();
if (f.substr(0, 2) == '--') {
if (f.substr(0, 2) === '--') {
f = f.split(' ');
output.long = f[0].substr(2).trim();
if (f.length == 2) {
if (f.length === 2) {
output.arg = cliUtils.parseCommandArg(f[1].trim());
}
} else if (f.substr(0, 1) == '-') {
} else if (f.substr(0, 1) === '-') {
output.short = f.substr(1);
}
}
@@ -65,9 +65,9 @@ cliUtils.parseCommandArg = function(arg) {
const c2 = arg[arg.length - 1];
const name = arg.substr(1, arg.length - 2);
if (c1 == '<' && c2 == '>') {
if (c1 === '<' && c2 === '>') {
return { required: true, name: name };
} else if (c1 == '[' && c2 == ']') {
} else if (c1 === '[' && c2 === ']') {
return { required: false, name: name };
} else {
throw new Error(`Invalid command arg: ${arg}`);
@@ -83,7 +83,7 @@ cliUtils.makeCommandArgs = function(cmd, argv) {
const booleanFlags = [];
const aliases = {};
for (let i = 0; i < options.length; i++) {
if (options[i].length != 2) throw new Error(`Invalid options: ${options[i]}`);
if (options[i].length !== 2) throw new Error(`Invalid options: ${options[i]}`);
let flags = options[i][0];
flags = cliUtils.parseFlags(flags);
@@ -117,7 +117,7 @@ cliUtils.makeCommandArgs = function(cmd, argv) {
const argOptions = {};
for (const key in args) {
if (!args.hasOwnProperty(key)) continue;
if (key == '_') continue;
if (key === '_') continue;
argOptions[key] = args[key];
}
@@ -170,7 +170,7 @@ cliUtils.promptConfirm = function(message, answers = null) {
return new Promise((resolve) => {
rl.question(`${message} `, answer => {
const ok = !answer || answer.toLowerCase() == answers[0].toLowerCase();
const ok = !answer || answer.toLowerCase() === answers[0].toLowerCase();
rl.close();
resolve(ok);
});

View File

@@ -122,7 +122,7 @@ class Command extends BaseCommand {
}
if (args.name == 'locale') {
if (args.name === 'locale') {
setLocale(Setting.value('locale'));
}

View File

@@ -44,7 +44,7 @@ class Command extends BaseCommand {
queryOptions.orderBy = options.sort;
queryOptions.orderByDir = 'ASC';
}
if (options.reverse === true) queryOptions.orderByDir = queryOptions.orderByDir == 'ASC' ? 'DESC' : 'ASC';
if (options.reverse === true) queryOptions.orderByDir = queryOptions.orderByDir === 'ASC' ? 'DESC' : 'ASC';
queryOptions.caseInsensitive = true;
if (options.type) {
queryOptions.itemTypes = [];
@@ -55,7 +55,7 @@ class Command extends BaseCommand {
queryOptions.uncompletedTodosOnTop = Setting.value('uncompletedTodosOnTop');
let modelType = null;
if (pattern == '/' || !app().currentFolder()) {
if (pattern === '/' || !app().currentFolder()) {
queryOptions.includeConflictFolder = true;
items = await Folder.all(queryOptions);
modelType = Folder.modelType();
@@ -65,7 +65,7 @@ class Command extends BaseCommand {
modelType = Note.modelType();
}
if (options.format && options.format == 'json') {
if (options.format && options.format === 'json') {
this.stdout(JSON.stringify(items));
} else {
let hasTodos = false;
@@ -88,7 +88,7 @@ class Command extends BaseCommand {
row.push(BaseModel.shortId(item.id));
shortIdShown = true;
if (modelType == Folder.modelType()) {
if (modelType === Folder.modelType()) {
row.push(await Folder.noteCount(item.id));
}

View File

@@ -7,25 +7,45 @@ const Note = require('@joplin/lib/models/Note').default;
class Command extends BaseCommand {
usage() {
return 'mv <note> [notebook]';
return 'mv <item> [notebook]';
}
description() {
return _('Moves the notes matching <note> to [notebook].');
return _('Moves the given <item> (notes matching pattern in current notebook or one notebook) to [notebook]. If <item> is subnotebook and [notebook] is "root", will make <item> parent notebook');
}
async action(args) {
const pattern = args['note'];
const pattern = args['item'];
const destination = args['notebook'];
let folder = null;
const folder = await Folder.loadByField('title', destination);
if (!folder) throw new Error(_('Cannot find "%s".', destination));
if (destination !== 'root') {
folder = await app().loadItem(BaseModel.TYPE_FOLDER, destination);
if (!folder) throw new Error(_('Cannot find "%s".', destination));
}
const notes = await app().loadItems(BaseModel.TYPE_NOTE, pattern);
if (!notes.length) throw new Error(_('Cannot find "%s".', pattern));
const destinationDuplicates = await Folder.search({ titlePattern: destination, limit: 2 });
if (destinationDuplicates.length > 1) {
throw new Error(_('Ambiguous notebook "%s". Please use short notebook id instead - press "ti" to see the short notebook id' , destination));
}
for (let i = 0; i < notes.length; i++) {
await Note.moveToFolder(notes[i].id, folder.id);
const itemFolder = await app().loadItem(BaseModel.TYPE_FOLDER, pattern);
if (itemFolder) {
const sourceDuplicates = await Folder.search({ titlePattern: pattern, limit: 2 });
if (sourceDuplicates.length > 1) {
throw new Error(_('Ambiguous notebook "%s". Please use notebook id instead - press "ti" to see the short notebook id or use $b for current selected notebook', pattern));
}
if (destination === 'root') {
await Folder.moveToFolder(itemFolder.id, '');
} else {
await Folder.moveToFolder(itemFolder.id, folder.id);
}
} else {
const notes = await app().loadItems(BaseModel.TYPE_NOTE, pattern);
if (notes.length === 0) throw new Error(_('Cannot find "%s".', pattern));
for (let i = 0; i < notes.length; i++) {
await Note.moveToFolder(notes[i].id, folder.id);
}
}
}
}

View File

@@ -133,7 +133,7 @@ class Command extends BaseCommand {
this.releaseLockFn_ = await Command.lockFile(lockFilePath);
} catch (error) {
if (error.code == 'ELOCKED') {
if (error.code === 'ELOCKED') {
const msg = _('Lock file is already being hold. If you know that no synchronisation is taking place, you may delete the lock file at "%s" and resume the operation.', error.file);
this.stdout(msg);
return;
@@ -222,7 +222,7 @@ class Command extends BaseCommand {
const newContext = await sync.start(options);
Setting.setValue(contextKey, JSON.stringify(newContext));
} catch (error) {
if (error.code == 'alreadyStarted') {
if (error.code === 'alreadyStarted') {
this.stdout(error.message);
} else {
throw error;

View File

@@ -30,21 +30,21 @@ class Command extends BaseCommand {
const command = args['tag-command'];
if (command == 'remove' && !tag) throw new Error(_('Cannot find "%s".', args.tag));
if (command === 'remove' && !tag) throw new Error(_('Cannot find "%s".', args.tag));
if (command == 'add') {
if (command === 'add') {
if (!notes.length) throw new Error(_('Cannot find "%s".', args.note));
if (!tag) tag = await Tag.save({ title: args.tag }, { userSideValidation: true });
for (let i = 0; i < notes.length; i++) {
await Tag.addNote(tag.id, notes[i].id);
}
} else if (command == 'remove') {
} else if (command === 'remove') {
if (!tag) throw new Error(_('Cannot find "%s".', args.tag));
if (!notes.length) throw new Error(_('Cannot find "%s".', args.note));
for (let i = 0; i < notes.length; i++) {
await Tag.removeNote(tag.id, notes[i].id);
}
} else if (command == 'list') {
} else if (command === 'list') {
if (tag) {
const notes = await Tag.notes(tag.id);
notes.map(note => {
@@ -75,7 +75,7 @@ class Command extends BaseCommand {
this.stdout(tag.title);
});
}
} else if (command == 'notetags') {
} else if (command === 'notetags') {
if (args.tag) {
const note = await app().loadItem(BaseModel.TYPE_NOTE, args.tag);
if (!note) throw new Error(_('Cannot find "%s".', args.tag));

View File

@@ -29,13 +29,13 @@ class Command extends BaseCommand {
id: note.id,
};
if (action == 'toggle') {
if (action === 'toggle') {
if (!note.is_todo) {
toSave = Note.toggleIsTodo(note);
} else {
toSave.todo_completed = note.todo_completed ? 0 : time.unixMs();
}
} else if (action == 'clear') {
} else if (action === 'clear') {
toSave.is_todo = 0;
}

View File

@@ -2071,7 +2071,7 @@ function execCommand(client, command, options = {}) {
return new Promise((resolve, reject) => {
const childProcess = exec(cmd, (error, stdout, stderr) => {
if (error) {
if (error.signal == 'SIGTERM') {
if (error.signal === 'SIGTERM') {
resolve('Process was killed');
} else {
logger.error(stderr);
@@ -2103,7 +2103,7 @@ async function clientItems(client) {
function randomTag(items) {
const tags = [];
for (let i = 0; i < items.length; i++) {
if (items[i].type_ != 5) continue;
if (items[i].type_ !== 5) continue;
tags.push(items[i]);
}
@@ -2113,7 +2113,7 @@ function randomTag(items) {
function randomNote(items) {
const notes = [];
for (let i = 0; i < items.length; i++) {
if (items[i].type_ != 1) continue;
if (items[i].type_ !== 1) continue;
notes.push(items[i]);
}
@@ -2131,11 +2131,11 @@ async function execRandomCommand(client) {
const item = randomElement(items);
if (!item) return;
if (item.type_ == 1) {
if (item.type_ === 1) {
return execCommand(client, `rm -f ${item.id}`);
} else if (item.type_ == 2) {
} else if (item.type_ === 2) {
return execCommand(client, `rm -r -f ${item.id}`);
} else if (item.type_ == 5) {
} else if (item.type_ === 5) {
// tag
} else {
throw new Error(`Unknown type: ${item.type_}`);
@@ -2213,7 +2213,7 @@ function randomNextCheckTime() {
function findItem(items, itemId) {
for (let i = 0; i < items.length; i++) {
if (items[i].id == itemId) return items[i];
if (items[i].id === itemId) return items[i];
}
return null;
}
@@ -2225,7 +2225,7 @@ function compareItems(item1, item2) {
const p1 = item1[n];
const p2 = item2[n];
if (n == 'notes_') {
if (n === 'notes_') {
p1.sort();
p2.sort();
if (JSON.stringify(p1) !== JSON.stringify(p2)) {
@@ -2246,7 +2246,7 @@ function findMissingItems_(items1, items2) {
let found = false;
for (let j = 0; j < items2.length; j++) {
const item2 = items2[j];
if (item1.id == item2.id) {
if (item1.id === item2.id) {
found = true;
break;
}
@@ -2340,9 +2340,9 @@ async function main() {
let state = 'commands';
setInterval(async () => {
if (state == 'waitForSyncCheck') return;
if (state === 'waitForSyncCheck') return;
if (state == 'syncCheck') {
if (state === 'syncCheck') {
state = 'waitForSyncCheck';
const clientItems = [];
// Up to 3 sync operations must be performed by each clients in order for them
@@ -2371,7 +2371,7 @@ async function main() {
return;
}
if (state == 'waitForClients') {
if (state === 'waitForClients') {
for (let i = 0; i < clients.length; i++) {
if (clients[i].activeCommandCount > 0) return;
}
@@ -2380,7 +2380,7 @@ async function main() {
return;
}
if (state == 'commands') {
if (state === 'commands') {
if (nextSyncCheckTime <= time.unixMs()) {
state = 'waitForClients';
return;

View File

@@ -2,6 +2,7 @@ const Folder = require('@joplin/lib/models/Folder').default;
const Tag = require('@joplin/lib/models/Tag').default;
const BaseModel = require('@joplin/lib/BaseModel').default;
const ListWidget = require('tkwidgets/ListWidget.js');
const Setting = require('@joplin/lib/models/Setting').default;
const _ = require('@joplin/lib/locale')._;
class FolderListWidget extends ListWidget {
@@ -18,13 +19,32 @@ class FolderListWidget extends ListWidget {
this.updateIndexFromSelectedFolderId_ = false;
this.updateItems_ = false;
this.trimItemTitle = false;
this.showIds = false;
this.itemRenderer = item => {
const output = [];
if (item === '-') {
output.push('-'.repeat(this.innerWidth));
} else if (item.type_ === Folder.modelType()) {
output.push(' '.repeat(this.folderDepth(this.folders, item.id)) + Folder.displayTitle(item));
output.push(' '.repeat(this.folderDepth(this.folders, item.id)));
if (this.showIds) {
output.push(Folder.shortId(item.id));
}
output.push(Folder.displayTitle(item));
if (Setting.value('showNoteCounts')) {
let noteCount = item.note_count;
// Subtract children note_count from parent folder.
if (this.folderHasChildren_(this.folders,item.id)) {
for (let i = 0; i < this.folders.length; i++) {
if (this.folders[i].parent_id === item.id) {
noteCount -= this.folders[i].note_count;
}
}
}
output.push(noteCount);
}
} else if (item.type_ === Tag.modelType()) {
output.push(`[${Folder.displayTitle(item)}]`);
} else if (item.type_ === BaseModel.TYPE_SEARCH) {
@@ -119,6 +139,11 @@ class FolderListWidget extends ListWidget {
this.invalidate();
}
toggleShowIds() {
this.showIds = !this.showIds;
this.invalidate();
}
folderHasChildren_(folders, folderId) {
for (let i = 0; i < folders.length; i++) {
const folder = folders[i];

View File

@@ -5,11 +5,15 @@ class NoteListWidget extends ListWidget {
constructor() {
super();
this.selectedNoteId_ = 0;
this.showIds = false;
this.updateIndexFromSelectedNoteId_ = false;
this.itemRenderer = note => {
let label = Note.displayTitle(note); // + ' ' + note.id;
let label = Note.displayTitle(note);
if (this.showIds) {
label = `${Note.shortId(note.id)} ${Note.displayTitle(note)}`;
}
if (note.is_todo) {
label = `[${note.todo_completed ? 'X' : ' '}] ${label}`;
}
@@ -22,6 +26,11 @@ class NoteListWidget extends ListWidget {
this.selectedNoteId_ = v;
}
toggleShowIds() {
this.showIds = !this.showIds;
this.invalidate();
}
render() {
if (this.updateIndexFromSelectedNoteId_) {
const index = this.itemIndexByKey('id', this.selectedNoteId_);

View File

@@ -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.js');
const { FileApiDriverLocal } = require('@joplin/lib/file-api-driver-local');
const EncryptionService = require('@joplin/lib/services/e2ee/EncryptionService').default;
const envFromArgs = require('@joplin/lib/envFromArgs');
const nodeSqlite = require('sqlite3');
@@ -82,13 +82,13 @@ if (process.platform === 'win32') {
process.stdout.on('error', function(err) {
// https://stackoverflow.com/questions/12329816/error-write-epipe-when-piping-node-output-to-head#15884508
if (err.code == 'EPIPE') {
if (err.code === 'EPIPE') {
process.exit(0);
}
});
application.start(process.argv).catch(error => {
if (error.code == 'flagError') {
if (error.code === 'flagError') {
console.error(error.message);
console.error(_('Type `joplin help` for usage information.'));
} else {

View File

@@ -33,14 +33,14 @@
],
"owner": "Laurent Cozic"
},
"version": "2.8.1",
"version": "2.9.0",
"bin": "./main.js",
"engines": {
"node": ">=10.0.0"
},
"dependencies": {
"@joplin/lib": "~2.8",
"@joplin/renderer": "~2.8",
"@joplin/lib": "~2.9",
"@joplin/renderer": "~2.9",
"aws-sdk": "^2.588.0",
"chalk": "^4.1.0",
"compare-version": "^0.1.2",
@@ -67,7 +67,7 @@
"yargs-parser": "^7.0.0"
},
"devDependencies": {
"@joplin/tools": "~2.8",
"@joplin/tools": "~2.9",
"@types/fs-extra": "^9.0.6",
"@types/jest": "^26.0.15",
"@types/node": "^14.14.6",

View File

@@ -30,7 +30,7 @@ describe('feature_NoteHistory', function() {
});
afterEach(async (done) => {
if (testApp !== null) await testApp.destroy();
if (testApp) await testApp.destroy();
testApp = null;
done();
});

View File

@@ -0,0 +1,216 @@
import { installDefaultPlugins, getDefaultPluginsInstallState, setSettingsForDefaultPlugins, checkPreInstalledDefaultPlugins } from '@joplin/lib/services/plugins/defaultPlugins/defaultPluginsUtils';
import PluginRunner from '../../../app/services/plugins/PluginRunner';
import { pathExists } from 'fs-extra';
import { setupDatabaseAndSynchronizer, supportDir, switchClient } from '@joplin/lib/testing/test-utils';
import PluginService, { defaultPluginSetting, DefaultPluginsInfo, PluginSettings } from '@joplin/lib/services/plugins/PluginService';
import Setting from '@joplin/lib/models/Setting';
const testPluginDir = `${supportDir}/plugins`;
function newPluginService(appVersion: string = '1.4') {
const runner = new PluginRunner();
const service = new PluginService();
service.initialize(
appVersion,
{
joplin: {},
},
runner,
{
dispatch: () => {},
getState: () => {},
}
);
return service;
}
describe('defaultPluginsUtils', function() {
const pluginsId = ['joplin.plugin.ambrt.backlinksToNote', 'org.joplinapp.plugins.ToggleSidebars'];
beforeEach(async (done) => {
await setupDatabaseAndSynchronizer(1);
await switchClient(1);
done();
});
it('should install default plugins with no previous default plugins installed', (async () => {
const testPluginDir = `${supportDir}/pluginRepo/plugins`;
Setting.setValue('installedDefaultPlugins', []);
const service = newPluginService('2.1');
const pluginSettings = service.unserializePluginSettings(Setting.value('plugins.states'));
const newPluginsSettings = await installDefaultPlugins(service, testPluginDir, pluginsId, pluginSettings);
const installedPluginPath1 = `${Setting.value('pluginDir')}/${pluginsId[0]}.jpl`;
const installedPluginPath2 = `${Setting.value('pluginDir')}/${pluginsId[1]}.jpl`;
expect(await pathExists(installedPluginPath1)).toBe(true);
expect(await pathExists(installedPluginPath2)).toBe(true);
expect(newPluginsSettings[pluginsId[0]]).toMatchObject(defaultPluginSetting());
expect(newPluginsSettings[pluginsId[1]]).toMatchObject(defaultPluginSetting());
}));
it('should install default plugins with previous default plugins installed', (async () => {
const testPluginDir = `${supportDir}/pluginRepo/plugins`;
Setting.setValue('installedDefaultPlugins', ['org.joplinapp.plugins.ToggleSidebars']);
const service = newPluginService('2.1');
const pluginSettings = service.unserializePluginSettings(Setting.value('plugins.states'));
const newPluginsSettings = await installDefaultPlugins(service, testPluginDir, pluginsId, pluginSettings);
const installedPluginPath1 = `${Setting.value('pluginDir')}/${pluginsId[0]}.jpl`;
const installedPluginPath2 = `${Setting.value('pluginDir')}/${pluginsId[1]}.jpl`;
expect(await pathExists(installedPluginPath1)).toBe(true);
expect(await pathExists(installedPluginPath2)).toBe(false);
expect(newPluginsSettings[pluginsId[0]]).toMatchObject(defaultPluginSetting());
expect(newPluginsSettings[pluginsId[1]]).toBeUndefined();
}));
it('should get default plugins install state', (async () => {
const testCases = [
{
'installedDefaultPlugins': [''],
'loadingPlugins': [`${testPluginDir}/simple`, `${testPluginDir}/jpl_test/org.joplinapp.FirstJplPlugin.jpl`],
'plugin1DefaultState': defaultPluginSetting(),
'plugin2DefaultState': defaultPluginSetting(),
'installedDefaultPlugins1': true,
'installedDefaultPlugins2': true,
},
{
'installedDefaultPlugins': [''],
'loadingPlugins': [`${testPluginDir}/simple`],
'plugin1DefaultState': defaultPluginSetting(),
'plugin2DefaultState': undefined,
'installedDefaultPlugins1': true,
'installedDefaultPlugins2': false,
},
{
'installedDefaultPlugins': ['org.joplinapp.plugins.Simple'],
'loadingPlugins': [`${testPluginDir}/simple`, `${testPluginDir}/jpl_test/org.joplinapp.FirstJplPlugin.jpl`],
'plugin1DefaultState': undefined,
'plugin2DefaultState': defaultPluginSetting(),
'installedDefaultPlugins1': true,
'installedDefaultPlugins2': true,
},
{
'installedDefaultPlugins': ['org.joplinapp.plugins.Simple'],
'loadingPlugins': [`${testPluginDir}/simple`],
'plugin1DefaultState': undefined,
'plugin2DefaultState': undefined,
'installedDefaultPlugins1': true,
'installedDefaultPlugins2': false,
},
];
for (const testCase of testCases) {
const service = newPluginService();
const pluginsId = ['org.joplinapp.plugins.Simple', 'org.joplinapp.FirstJplPlugin'];
Setting.setValue('installedDefaultPlugins', testCase.installedDefaultPlugins);
await service.loadAndRunPlugins(testCase.loadingPlugins, {});
// setting installedDefaultPlugins state
const defaultInstallStates: PluginSettings = getDefaultPluginsInstallState(service, pluginsId);
expect(defaultInstallStates[pluginsId[0]]).toStrictEqual(testCase.plugin1DefaultState);
expect(defaultInstallStates[pluginsId[1]]).toStrictEqual(testCase.plugin2DefaultState);
const installedDefaultPlugins = Setting.value('installedDefaultPlugins');
expect(installedDefaultPlugins.includes(pluginsId[0])).toBe(testCase.installedDefaultPlugins1);
expect(installedDefaultPlugins.includes(pluginsId[1])).toBe(testCase.installedDefaultPlugins2);
}
}));
it('should check pre-installed default plugins', (async () => {
// with previous pre-installed default plugins
Setting.setValue('installedDefaultPlugins', ['']);
let pluginSettings, installedDefaultPlugins;
pluginSettings = { [pluginsId[0]]: defaultPluginSetting() };
checkPreInstalledDefaultPlugins(pluginsId, pluginSettings);
installedDefaultPlugins = Setting.value('installedDefaultPlugins');
expect(installedDefaultPlugins.includes(pluginsId[0])).toBe(true);
expect(installedDefaultPlugins.includes(pluginsId[1])).toBe(false);
// with no previous pre-installed default plugins
Setting.setValue('installedDefaultPlugins', ['not-a-default-plugin']);
pluginSettings = {};
checkPreInstalledDefaultPlugins(pluginsId, pluginSettings);
installedDefaultPlugins = Setting.value('installedDefaultPlugins');
expect(installedDefaultPlugins.includes(pluginsId[0])).toBe(false);
expect(installedDefaultPlugins.includes(pluginsId[1])).toBe(false);
}));
it('should set initial settings for default plugins', async () => {
const service = newPluginService();
const pluginScript = `
/* joplin-manifest:
{
"id": "io.github.jackgruber.backup",
"manifest_version": 1,
"app_min_version": "1.4",
"name": "JS Bundle test",
"version": "1.0.0"
}
*/
joplin.plugins.register({
onStart: async function() {
await joplin.settings.registerSettings({
path: {
value: "initial-path",
type: 2,
section: "backupSection",
public: true,
label: "Backup path",
},
})
},
});`;
const plugin = await service.loadPluginFromJsBundle('', pluginScript);
await service.runPlugin(plugin);
const defaultPluginsInfo: DefaultPluginsInfo = {
'io.github.jackgruber.backup': {
version: '1.0.2',
settings: {
'path': `${Setting.value('profileDir')}`,
},
},
'plugin.calebjohn.rich-markdown': {
version: '0.8.3',
},
};
// with pre-installed default plugin
Setting.setValue('installedDefaultPlugins', ['io.github.jackgruber.backup']);
setSettingsForDefaultPlugins(defaultPluginsInfo);
expect(Setting.value('plugin-io.github.jackgruber.backup.path')).toBe('initial-path');
await service.destroy();
// with no pre-installed default plugin
Setting.setValue('installedDefaultPlugins', ['']);
setSettingsForDefaultPlugins(defaultPluginsInfo);
expect(Setting.value('plugin-io.github.jackgruber.backup.path')).toBe(`${Setting.value('profileDir')}`);
await service.destroy();
});
});

View File

@@ -32,6 +32,15 @@
}
}
function escapeHtml(s) {
return s
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
}
function pageTitle() {
const titleElements = document.getElementsByTagName('title');
if (titleElements.length) return titleElements[0].text.trim();
@@ -204,6 +213,16 @@
}
}
if (nodeName === 'embed') {
const src = absoluteUrl(node.src);
node.setAttribute('src', src);
}
if (nodeName === 'object') {
const data = absoluteUrl(node.data);
node.setAttribute('data', data);
}
cleanUpElement(convertToMarkup, node, imageSizes, imageIndexes);
}
}
@@ -317,6 +336,9 @@
}
function readabilityProcess() {
if (isPagePdf()) throw new Error('Could not parse PDF document with Readability');
// eslint-disable-next-line no-undef
const readability = new Readability(documentForReadability());
const article = readability.parse();
@@ -329,6 +351,14 @@
};
}
function isPagePdf() {
return document.contentType === 'application/pdf';
}
function embedPageUrl() {
return `<embed src="${escapeHtml(window.location.href)}" type="${escapeHtml(document.contentType)}" />`;
}
async function prepareCommandResponse(command) {
console.info(`Got command: ${command.name}`);
const shouldSendToJoplin = !!command.shouldSendToJoplin;
@@ -375,6 +405,10 @@
} else if (command.name === 'completePageHtml') {
if (isPagePdf()) {
return clippedContentResponse(pageTitle(), embedPageUrl(), getImageSizes(document), getAnchorNames(document));
}
hardcodePreStyles(document);
addSvgClass(document);
preProcessDocument(document);

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Joplin Web Clipper [DEV]",
"version": "2.8.1",
"version": "2.9.0",
"description": "Capture and save web pages and screenshots from your browser to Joplin.",
"homepage_url": "https://joplinapp.org",
"content_security_policy": "script-src 'self'; object-src 'self'",

View File

@@ -16,6 +16,8 @@ function getAdditionalModulePaths(options = {}) {
// We need to explicitly check for null and undefined (and not a falsy value) because
// TypeScript treats an empty string as `.`.
//
// eslint-disable-next-line eqeqeq
if (baseUrl == null) {
// If there's no baseUrl set we respect NODE_PATH
// Note that NODE_PATH is deprecated and will be removed

View File

@@ -20253,6 +20253,19 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"node_modules/typescript": {
"version": "3.9.10",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/unicode-canonical-property-names-ecmascript": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
@@ -37995,6 +38008,12 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"typescript": {
"version": "3.9.10",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
"peer": true
},
"unicode-canonical-property-names-ecmascript": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",

View File

@@ -67,7 +67,7 @@ checkBrowsers(paths.appPath, isInteractive)
return choosePort(HOST, DEFAULT_PORT);
})
.then(port => {
if (port == null) {
if (!port) {
// We have not found a port.
return;
}

View File

@@ -43,6 +43,7 @@ import sidebarCommands from './gui/Sidebar/commands/index';
import appCommands from './commands/index';
import libCommands from '@joplin/lib/commands/index';
import { homedir } from 'os';
import getDefaultPluginsInfo from '@joplin/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo';
const electronContextMenu = require('./services/electron-context-menu');
// import populateDatabase from '@joplin/lib/services/debug/populateDatabase';
@@ -63,6 +64,8 @@ import checkForUpdates from './checkForUpdates';
import { AppState } from './app.reducer';
import syncDebugLog from '@joplin/lib/services/synchronizer/syncDebugLog';
import eventManager from '@joplin/lib/eventManager';
import path = require('path');
import { checkPreInstalledDefaultPlugins, installDefaultPlugins, setSettingsForDefaultPlugins } from '@joplin/lib/services/plugins/defaultPlugins/defaultPluginsUtils';
// import { runIntegrationTests } from '@joplin/lib/services/e2ee/ppkTestUtils';
const pluginClasses = [
@@ -104,22 +107,22 @@ class Application extends BaseApplication {
}
protected async generalMiddleware(store: any, next: any, action: any) {
if (action.type == 'SETTING_UPDATE_ONE' && action.key == 'locale' || action.type == 'SETTING_UPDATE_ALL') {
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'locale' || action.type === 'SETTING_UPDATE_ALL') {
setLocale(Setting.value('locale'));
// The bridge runs within the main process, with its own instance of locale.js
// so it needs to be set too here.
bridge().setLocale(Setting.value('locale'));
}
if (action.type == 'SETTING_UPDATE_ONE' && action.key == 'showTrayIcon' || action.type == 'SETTING_UPDATE_ALL') {
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'showTrayIcon' || action.type === 'SETTING_UPDATE_ALL') {
this.updateTray();
}
if (action.type == 'SETTING_UPDATE_ONE' && action.key == 'style.editor.fontFamily' || action.type == 'SETTING_UPDATE_ALL') {
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'style.editor.fontFamily' || action.type === 'SETTING_UPDATE_ALL') {
this.updateEditorFont();
}
if (action.type == 'SETTING_UPDATE_ONE' && action.key == 'windowContentZoomFactor' || action.type == 'SETTING_UPDATE_ALL') {
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'windowContentZoomFactor' || action.type === 'SETTING_UPDATE_ALL') {
webFrame.setZoomFactor(Setting.value('windowContentZoomFactor') / 100);
}
@@ -142,7 +145,7 @@ class Application extends BaseApplication {
await Folder.expandTree(newState.folders, action.folderId);
}
if (this.hasGui() && ((action.type == 'SETTING_UPDATE_ONE' && ['themeAutoDetect', 'theme', 'preferredLightTheme', 'preferredDarkTheme'].includes(action.key)) || action.type == 'SETTING_UPDATE_ALL')) {
if (this.hasGui() && ((action.type === 'SETTING_UPDATE_ONE' && ['themeAutoDetect', 'theme', 'preferredLightTheme', 'preferredDarkTheme'].includes(action.key)) || action.type === 'SETTING_UPDATE_ALL')) {
this.handleThemeAutoDetect();
}
@@ -260,9 +263,9 @@ class Application extends BaseApplication {
const pluginRunner = new PluginRunner();
service.initialize(packageInfo.version, PlatformImplementation.instance(), pluginRunner, this.store());
service.isSafeMode = Setting.value('isSafeMode');
const defaultPluginsId = Object.keys(getDefaultPluginsInfo());
const pluginSettings = service.unserializePluginSettings(Setting.value('plugins.states'));
let pluginSettings = service.unserializePluginSettings(Setting.value('plugins.states'));
{
// Users can add and remove plugins from the config screen at any
// time, however we only effectively uninstall the plugin the next
@@ -272,7 +275,11 @@ class Application extends BaseApplication {
Setting.setValue('plugins.states', newSettings);
}
checkPreInstalledDefaultPlugins(defaultPluginsId, pluginSettings);
try {
const pluginsDir = path.join(bridge().buildDir(), 'defaultPlugins');
pluginSettings = await installDefaultPlugins(service, pluginsDir, defaultPluginsId, pluginSettings);
if (await shim.fsDriver().exists(Setting.value('pluginDir'))) {
await service.loadAndRunPlugins(Setting.value('pluginDir'), pluginSettings);
}
@@ -320,6 +327,7 @@ class Application extends BaseApplication {
type: 'STARTUP_PLUGINS_LOADED',
value: true,
});
setSettingsForDefaultPlugins(getDefaultPluginsInfo());
}
}, 500);
}
@@ -387,7 +395,7 @@ class Application extends BaseApplication {
PerFolderSortOrderService.initialize();
CommandService.instance().initialize(this.store(), Setting.value('env') == 'dev', stateToWhenClauseContext);
CommandService.instance().initialize(this.store(), Setting.value('env') === 'dev', stateToWhenClauseContext);
for (const command of commands) {
CommandService.instance().registerDeclaration(command.declaration);

View File

@@ -86,7 +86,7 @@ async function fetchLatestRelease(options: CheckForUpdateOptions) {
const ext = fileExtension(asset.name);
if (platform === 'win32' && ext === 'exe') {
if (shim.isPortable()) {
found = asset.name == 'JoplinPortable.exe';
found = asset.name === 'JoplinPortable.exe';
} else {
found = !!asset.name.match(/^Joplin-Setup-[\d.]+\.exe$/);
}

View File

@@ -4,7 +4,7 @@ const os = require('os');
const sha512 = require('js-sha512');
const generateChecksumFile = () => {
if (os.platform() != 'linux') {
if (os.platform() !== 'linux') {
return []; // SHA-512 is only for AppImage
}
const distDirName = 'dist';
@@ -18,7 +18,7 @@ const generateChecksumFile = () => {
break;
}
}
if (appImageName == '') {
if (appImageName === '') {
throw 'AppImage not found!';
}
const appImagePath = path.join(distPath, appImageName);

View File

@@ -15,6 +15,9 @@ import SyncTargetRegistry from '@joplin/lib/SyncTargetRegistry';
const shared = require('@joplin/lib/components/shared/config-shared.js');
import ClipperConfigScreen from '../ClipperConfigScreen';
import restart from '../../services/restart';
import PluginService from '@joplin/lib/services/plugins/PluginService';
import { getDefaultPluginsInstallState, updateDefaultPluginsInstallState } from '@joplin/lib/services/plugins/defaultPlugins/defaultPluginsUtils';
import getDefaultPluginsInfo from '@joplin/lib/services/plugins/defaultPlugins/desktopDefaultPluginsInfo';
const { KeymapConfigScreen } = require('../KeymapConfig/KeymapConfigScreen');
const settingKeyToControl: any = {
@@ -66,6 +69,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
this.switchSection(this.props.defaultSection);
});
}
updateDefaultPluginsInstallState(getDefaultPluginsInstallState(PluginService.instance(), Object.keys(getDefaultPluginsInfo())), this);
}
private async handleSettingButton(key: string) {
@@ -484,13 +488,19 @@ class ConfigScreenComponent extends React.Component<any, any> {
} else {
const paths = await bridge().showOpenDialog();
if (!paths || !paths.length) return;
const cmd = splitCmd(this.state.settings[key]);
cmd[0] = paths[0];
updateSettingValue(key, joinCmd(cmd));
if (md.subType === 'file_path') {
updateSettingValue(key, paths[0]);
} else {
const cmd = splitCmd(this.state.settings[key]);
cmd[0] = paths[0];
updateSettingValue(key, joinCmd(cmd));
}
}
};
const cmd = splitCmd(this.state.settings[key]);
const path = md.subType === 'file_path_and_args' ? cmd[0] : this.state.settings[key];
const argComp = md.subType !== 'file_path_and_args' ? null : (
<div style={{ ...rowStyle, marginBottom: 5 }}>
@@ -526,7 +536,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
onChange={(event: any) => {
onPathChange(event);
}}
value={cmd[0]}
value={path}
spellCheck={false}
/>
<Button

View File

@@ -101,6 +101,7 @@ export default function(props: Props) {
const pluginSettings = useMemo(() => {
return pluginService.unserializePluginSettings(props.value);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.value]);
const pluginItems = usePluginItems(pluginService.plugins, pluginSettings);
@@ -167,6 +168,7 @@ export default function(props: Props) {
});
props.onChange({ value: pluginService.serializePluginSettings(newSettings) });
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [pluginSettings, props.onChange]);
const onToggle = useCallback((event: ItemEvent) => {
@@ -178,6 +180,7 @@ export default function(props: Props) {
});
props.onChange({ value: pluginService.serializePluginSettings(newSettings) });
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [pluginSettings, props.onChange]);
const onInstall = useCallback(async () => {
@@ -195,6 +198,7 @@ export default function(props: Props) {
});
props.onChange({ value: pluginService.serializePluginSettings(newSettings) });
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [pluginSettings, props.onChange]);
const onBrowsePlugins = useCallback(() => {
@@ -203,6 +207,7 @@ export default function(props: Props) {
const onPluginSettingsChange = useCallback((event: OnPluginSettingChangeEvent) => {
props.onChange({ value: pluginService.serializePluginSettings(event.value) });
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
const onUpdate = useOnInstallHandler(setUpdatingPluginIds, pluginSettings, repoApi, onPluginSettingsChange, true);
@@ -229,6 +234,7 @@ export default function(props: Props) {
const onSearchPluginSettingsChange = useCallback((event: any) => {
props.onChange({ value: pluginService.serializePluginSettings(event.value) });
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.onChange]);
function renderCells(items: PluginItem[]) {

View File

@@ -60,6 +60,7 @@ export default function(props: Props) {
setSearchResultCount(r.length);
}
});
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.searchQuery]);
const onChange = useCallback((event: OnChangeEvent) => {
@@ -70,6 +71,7 @@ export default function(props: Props) {
const onSearchButtonClick = useCallback(() => {
setSearchStarted(false);
props.onSearchQueryChange({ value: '' });
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
function installState(pluginId: string): InstallState {

View File

@@ -57,5 +57,6 @@ export default function(setInstallingPluginIds: Function, pluginSettings: Plugin
});
if (installError) alert(_('Could not install plugin: %s', installError.message));
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [pluginSettings, onPluginSettingsChange]);
}

View File

@@ -16,8 +16,10 @@ export default (props: Props) => {
globalKeydownHandlersRef.current.push(elementId);
return () => {
const idx = globalKeydownHandlersRef.current.findIndex(e => e === elementId);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
globalKeydownHandlersRef.current.splice(idx, 1);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
const isTopDialog = () => {
@@ -49,6 +51,7 @@ export default (props: Props) => {
} else if (event.keyCode === 27) {
props.onCancelButtonClick();
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.onOkButtonClick, props.onCancelButtonClick]);
useEffect(() => {

View File

@@ -81,6 +81,7 @@ export default function(props: Props) {
return;
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [onClose, folderTitle, folderIcon, props.folderId, props.parentId]);
const onFolderTitleChange = useCallback((event: any) => {

View File

@@ -2,15 +2,19 @@ import { FolderIcon, FolderIconType } from '@joplin/lib/services/database/types'
interface Props {
folderIcon: FolderIcon;
opacity?: number;
}
export default function(props: Props) {
const folderIcon = props.folderIcon;
const opacity = 'opacity' in props ? props.opacity : 1;
if (folderIcon.type === FolderIconType.Emoji) {
return <span style={{ fontSize: 20 }}>{folderIcon.emoji}</span>;
return <span style={{ fontSize: 20, opacity }}>{folderIcon.emoji}</span>;
} else if (folderIcon.type === FolderIconType.DataUrl) {
return <img style={{ width: 20, height: 20 }} src={folderIcon.dataUrl} />;
return <img style={{ width: 20, height: 20, opacity }} src={folderIcon.dataUrl} />;
} else if (folderIcon.type === FolderIconType.FontAwesome) {
return <i style={{ fontSize: 18, width: 20, opacity }} className={folderIcon.name}></i>;
} else {
throw new Error(`Unsupported folder icon type: ${folderIcon.type}`);
}

View File

@@ -39,6 +39,7 @@ export const ShortcutRecorder = ({ onSave, onReset, onCancel, onError, initialAc
onError({ recorderError });
setSaveAllowed(false);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [accelerator]);
const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {

View File

@@ -14,21 +14,24 @@ export const declaration: CommandDeclaration = {
export const runtime = (): CommandRuntime => {
return {
execute: async (context: CommandContext, selectedLanguage: string = null, useSpellChecker: boolean = null) => {
selectedLanguage = selectedLanguage === null ? context.state.settings['spellChecker.language'] : selectedLanguage;
execute: async (context: CommandContext, selectedLanguages: string[] = null, useSpellChecker: boolean = null) => {
selectedLanguages = selectedLanguages === null ? context.state.settings['spellChecker.languages'] : selectedLanguages;
useSpellChecker = useSpellChecker === null ? context.state.settings['spellChecker.enabled'] : useSpellChecker;
const menuItems = SpellCheckerService.instance().spellCheckerConfigMenuItems(selectedLanguage, useSpellChecker);
const menuItems = SpellCheckerService.instance().spellCheckerConfigMenuItems(selectedLanguages, useSpellChecker);
const menu = Menu.buildFromTemplate(menuItems as any);
menu.popup(bridge().window());
},
mapStateToTitle(state: AppState): string {
if (!state.settings['spellChecker.enabled']) return null;
const language = state.settings['spellChecker.language'];
if (!language) return null;
const s = language.split('-');
return s[0];
const languages = state.settings['spellChecker.languages'];
if (languages.length === 0) return null;
const s: string[] = [];
languages.forEach((language: string) => {
s.push(language.split('-')[0]);
});
return s.join(', ');
},
};
};

View File

@@ -38,6 +38,7 @@ export default function(props: Props) {
if ([MasterPasswordStatus.NotSet, MasterPasswordStatus.Invalid].includes(status)) return false;
if (mode === Mode.Reset) return false;
return true;
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [status]);
const onClose = useCallback(() => {
@@ -84,6 +85,7 @@ export default function(props: Props) {
}
return;
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [currentPassword, password1, onClose, mode]);
const needToRepeatPassword = useMemo(() => {

View File

@@ -122,7 +122,7 @@ interface Props {
pluginMenuItems: any[];
pluginMenus: any[];
['spellChecker.enabled']: boolean;
['spellChecker.language']: string;
['spellChecker.languages']: string[];
plugins: PluginStates;
customCss: string;
locale: string;
@@ -174,7 +174,7 @@ function useMenuStates(menu: any, props: Props) {
menuItemSetChecked(`sort:${type}:${field}`, (props as any)[`${type}.sortOrder.field`] === field);
}
const id = type == 'notes' ? 'toggleNotesSortOrderReverse' : `sort:${type}:reverse`;
const id = type === 'notes' ? 'toggleNotesSortOrderReverse' : `sort:${type}:reverse`;
menuItemSetChecked(id, (props as any)[`${type}.sortOrder.reverse`]);
}
@@ -192,12 +192,17 @@ function useMenuStates(menu: any, props: Props) {
clearTimeout(timeoutId);
timeoutId = null;
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [
props.menuItemProps,
props.layoutButtonSequence,
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
props['notes.sortOrder.field'],
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
props['folders.sortOrder.field'],
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
props['notes.sortOrder.reverse'],
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
props['folders.sortOrder.reverse'],
props.showNoteCounts,
props.uncompletedTodosOnTop,
@@ -276,6 +281,7 @@ function useMenu(props: Props) {
}
void CommandService.instance().execute('hideModalMessage');
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.selectedFolderId]);
const onMenuItemClickRef = useRef(null);
@@ -292,6 +298,7 @@ function useMenu(props: Props) {
(commandName: string) => onMenuItemClickRef.current(commandName),
props.locale
);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [commandNames, pluginCommandNames, props.locale]);
const switchProfileMenuItems: any[] = useSwitchProfileMenuItems(props.profileConfig, menuItemDic);
@@ -332,7 +339,7 @@ function useMenu(props: Props) {
sortItems.push({ type: 'separator' });
if (type == 'notes') {
if (type === 'notes') {
sortItems.push(
{ ...menuItemDic.toggleNotesSortOrderReverse, type: 'checkbox' },
{ ...menuItemDic.toggleNotesSortOrderField, visible: false }
@@ -471,7 +478,7 @@ function useMenu(props: Props) {
}
toolsItems = toolsItems.concat(toolsItemsAll);
toolsItems.push(SpellCheckerService.instance().spellCheckerConfigMenuItem(props['spellChecker.language'], props['spellChecker.enabled']));
toolsItems.push(SpellCheckerService.instance().spellCheckerConfigMenuItem(props['spellChecker.languages'], props['spellChecker.enabled']));
function _checkForUpdates() {
void checkForUpdates(false, bridge().window(), { includePreReleases: Setting.value('autoUpdate.includePreReleases') });
@@ -905,13 +912,16 @@ function useMenu(props: Props) {
clearTimeout(timeoutId);
timeoutId = null;
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [
props.routeName,
props.pluginMenuItems,
props.pluginMenus,
keymapLastChangeTime,
modulesLastChangeTime,
props['spellChecker.language'],
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
props['spellChecker.languages'],
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
props['spellChecker.enabled'],
props.customCss,
props.locale,
@@ -973,7 +983,7 @@ const mapStateToProps = (state: AppState) => {
showCompletedTodos: state.settings.showCompletedTodos,
pluginMenuItems: stateUtils.selectArrayShallow({ array: pluginUtils.viewsByType(state.pluginService.plugins, 'menuItem') }, 'menuBar.pluginMenuItems'),
pluginMenus: stateUtils.selectArrayShallow({ array: pluginUtils.viewsByType(state.pluginService.plugins, 'menu') }, 'menuBar.pluginMenus'),
['spellChecker.language']: state.settings['spellChecker.language'],
['spellChecker.languages']: state.settings['spellChecker.languages'],
['spellChecker.enabled']: state.settings['spellChecker.enabled'],
plugins: state.pluginService.plugins,
customCss: state.customCss,

View File

@@ -70,6 +70,7 @@ export default function NoteContentPropertiesDialog(props: NoteContentProperties
useEffect(() => {
const strippedText: string = markupToHtml().stripMarkup(props.markupLanguage, props.text);
countElements(strippedText, setStrippedWords, setStrippedCharacters, setStrippedCharactersNoSpace, setStrippedLines);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.text]);
useEffect(() => {

View File

@@ -38,7 +38,6 @@ import ErrorBoundary from '../../../ErrorBoundary';
import { MarkupToHtmlOptions } from '../../utils/useMarkupToHtml';
import eventManager from '@joplin/lib/eventManager';
import { EditContextMenuFilterObject } from '@joplin/lib/services/plugins/api/JoplinWorkspace';
import { checkTableIsUnderCursor, readTableAroundCursor } from './utils/tables';
const menuUtils = new MenuUtils(CommandService.instance());
@@ -260,6 +259,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
return commandOutput;
},
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.content, props.visiblePanes, addListItem, wrapSelectionWithStrings, setEditorPercentScroll, setViewerPercentScroll, resetScroll]);
const onEditorPaste = useCallback(async (event: any = null) => {
@@ -566,6 +566,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
return () => {
document.head.removeChild(element);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.themeId, props.contentMaxWidth]);
const webview_domReady = useCallback(() => {
@@ -593,6 +594,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
} else {
props.onMessage(event);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.onMessage, props.content, setEditorPercentScroll]);
useEffect(() => {
@@ -615,6 +617,10 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
resourceInfos: props.resourceInfos,
contentMaxWidth: props.contentMaxWidth,
mapsToLine: true,
// Always using useCustomPdfViewer for now, we can add a new setting for it in future if we need to.
useCustomPdfViewer: true,
noteId: props.noteId,
vendorDir: bridge().vendorDir(),
}));
if (cancelled) return;
@@ -634,6 +640,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
cancelled = true;
shim.clearTimeout(timeoutId);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.content, props.contentKey, renderedBodyContentKey, props.contentMarkupLanguage, props.visiblePanes, props.resourceInfos, props.markupToHtml]);
useEffect(() => {
@@ -659,6 +666,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
} else {
console.error('Trying to set HTML on an undefined webview ref');
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [renderedBody, webviewReady]);
useEffect(() => {
@@ -682,6 +690,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
props.setLocalSearchResultCount(matches);
}
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.searchMarkers, previousSearchMarkers, props.setLocalSearchResultCount, props.content, previousContent, renderedBody, previousRenderedBody, renderedBody]);
const cellEditorStyle = useMemo(() => {
@@ -707,6 +716,8 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
return output;
}, [styles.cellViewer, props.visiblePanes]);
const editorPaneVisible = props.visiblePanes.indexOf('editor') >= 0;
useEffect(() => {
if (!editorRef.current) return;
@@ -714,10 +725,10 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
// we should focus the editor
// The intuition is that a panel toggle (with editor in view) is the equivalent of
// an editor interaction so users should expect the editor to be focused
if (props.visiblePanes.indexOf('editor') >= 0) {
if (editorPaneVisible) {
editorRef.current.focus();
}
}, [props.visiblePanes]);
}, [editorPaneVisible]);
useEffect(() => {
if (!editorRef.current) return;
@@ -754,14 +765,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
const menu = new Menu();
const cm = editorRef.current;
const hasSelectedText = cm && !!cm.getSelection() ;
const tableIsUnderCursor = checkTableIsUnderCursor(cm);
let tableUnderCursor: string = null;
if (tableIsUnderCursor) tableUnderCursor = readTableAroundCursor(cm);
const hasSelectedText = editorRef.current && !!editorRef.current.getSelection() ;
menu.append(
new MenuItem({
@@ -793,27 +797,6 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
})
);
if (tableUnderCursor) {
menu.append(
new MenuItem({ type: 'separator' })
);
menu.append(
new MenuItem({
label: _('Edit table...'),
click: async () => {
props.dispatch({
type: 'DIALOG_OPEN',
name: 'tableEditor',
props: {
markdownTable: tableUnderCursor,
},
});
},
})
);
}
const spellCheckerMenuItems = SpellCheckerService.instance().contextMenuItems(params.misspelledWord, params.dictionarySuggestions);
for (const item of spellCheckerMenuItems) {
@@ -860,6 +843,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
return () => {
bridge().window().webContents.off('context-menu', onContextMenu);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.plugins]);
function renderEditor() {

View File

@@ -219,9 +219,11 @@ function Editor(props: EditorProps, ref: any) {
cm.off('dragover', editor_drag);
cm.off('refresh', editor_resize);
cm.off('update', editor_update);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
editorParent.current.removeChild(cm.getWrapperElement());
setEditor(null);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
useEffect(() => {
@@ -234,36 +236,42 @@ function Editor(props: EditorProps, ref: any) {
}
editor.setOption('screenReaderLabel', props.value);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.value]);
useEffect(() => {
if (editor) {
editor.setOption('theme', props.codeMirrorTheme);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.codeMirrorTheme]);
useEffect(() => {
if (editor) {
editor.setOption('mode', props.mode);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.mode]);
useEffect(() => {
if (editor) {
editor.setOption('readOnly', props.readOnly);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.readOnly]);
useEffect(() => {
if (editor) {
editor.setOption('autoCloseBrackets', props.autoMatchBraces);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.autoMatchBraces]);
useEffect(() => {
if (editor) {
editor.setOption('keyMap', props.keyMap ? props.keyMap : 'default');
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.keyMap]);
useEffect(() => {

View File

@@ -1,48 +0,0 @@
function findElementWithClass(element: any, className: string): any {
if (element.classList && element.classList.contains(className)) return element;
for (const child of element.childNodes) {
const hasClass = findElementWithClass(child, className);
if (hasClass) return hasClass;
}
return null;
}
export const checkTableIsUnderCursor = (cm: any) => {
if (!cm) return false;
const coords = cm.cursorCoords(cm.getCursor());
const element = document.elementFromPoint(coords.left, coords.top);
if (!element) return false;
return !!findElementWithClass(element, 'cm-jn-table-item');
};
export const readTableAroundCursor = (cm: any) => {
const idxAtCursor = cm.doc.getCursor().line;
const lineCount = cm.lineCount();
const lines: string[] = [];
for (let i = idxAtCursor - 1; i >= 0; i--) {
const line: string = cm.doc.getLine(i);
if (line.startsWith('|')) {
lines.splice(0, 0, line);
} else {
break;
}
}
lines.push(cm.doc.getLine(idxAtCursor));
for (let i = idxAtCursor + 1; i < lineCount; i++) {
const line: string = cm.doc.getLine(i);
if (line.startsWith('|')) {
lines.push(line);
} else {
break;
}
}
return lines.join('\n');
};

View File

@@ -37,7 +37,7 @@ export default function useEditorSearch(CodeMirror: any) {
return { token: function(stream: any) {
query.lastIndex = stream.pos;
const match = query.exec(stream.string);
if (match && match.index == stream.pos) {
if (match && match.index === stream.pos) {
stream.pos += match[0].length || 1;
return 'search-marker';
} else if (match) {
@@ -126,7 +126,7 @@ export default function useEditorSearch(CodeMirror: any) {
// SEARCHOVERLAY
// We only want to highlight all matches when there is only 1 search term
if (keywords.length !== 1 || keywords[0].value == '') {
if (keywords.length !== 1 || keywords[0].value === '') {
clearOverlay(this);
const prev = keywords.length > 1 ? keywords[0].value : '';
setPreviousKeywordValue(prev);

View File

@@ -7,6 +7,8 @@ import uuid from '@joplin/lib/uuid';
import { reg } from '@joplin/lib/registry';
const loadedPluginIdSet = new Set<string>();
export default function useExternalPlugins(CodeMirror: any, plugins: PluginStates) {
const [options, setOptions] = useState({});
@@ -17,6 +19,10 @@ export default function useExternalPlugins(CodeMirror: any, plugins: PluginState
for (const contentScript of contentScripts) {
try {
if (loadedPluginIdSet.has(contentScript.id)) {
continue;
}
const mod = contentScript.module;
if (mod.codeMirrorResources) {
@@ -64,11 +70,14 @@ export default function useExternalPlugins(CodeMirror: any, plugins: PluginState
if (mod.plugin) {
mod.plugin(CodeMirror);
}
loadedPluginIdSet.add(contentScript.id);
} catch (error) {
reg.logger().error(error.toString());
}
}
setOptions(newOptions);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [plugins]);
function addInlineCss(cssStrings: string[], id: string) {

View File

@@ -165,7 +165,6 @@ export default function useJoplinMode(CodeMirror: any) {
}
if (isMonospace) { token = `${token} jn-monospace`; }
if (state.inTable) { token = `${token} jn-table-item`; }
// //////// End Monospace //////////
return token;

View File

@@ -184,5 +184,6 @@ export default function useKeymap(CodeMirror: any) {
setupEmacs();
setupVim();
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
}

View File

@@ -94,6 +94,7 @@ export default function useScrollHandler(editorRef: any, webviewRef: any, onScro
if (editorRef.current) {
scheduleOnScroll({ percent });
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [scheduleOnScroll]);
const setViewerPercentScroll = useCallback((percent: number) => {
@@ -101,6 +102,7 @@ export default function useScrollHandler(editorRef: any, webviewRef: any, onScro
webviewRef.current.wrappedInstance.send('setPercentScroll', percent);
scheduleOnScroll({ percent });
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [scheduleOnScroll]);
const editor_scroll = useCallback(() => {
@@ -126,6 +128,7 @@ export default function useScrollHandler(editorRef: any, webviewRef: any, onScro
lastResizeHeight_.current = NaN;
lastLinesHeight_.current = NaN;
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [setViewerPercentScroll]);
const resetScroll = useCallback(() => {
@@ -134,6 +137,7 @@ export default function useScrollHandler(editorRef: any, webviewRef: any, onScro
editorRef.current.setScrollPercent(0);
scrollTopIsUncertain_.current = false;
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
const editor_resize = useCallback((cm) => {
@@ -152,6 +156,7 @@ export default function useScrollHandler(editorRef: any, webviewRef: any, onScro
lastResizeHeight_.current = NaN;
lastLinesHeight_.current = NaN;
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
// When heights of lines are updated in CodeMirror, 'update' events are raised.
@@ -173,6 +178,7 @@ export default function useScrollHandler(editorRef: any, webviewRef: any, onScro
lastResizeHeight_.current = NaN;
lastLinesHeight_.current = NaN;
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
const getLineScrollPercent = useCallback(() => {
@@ -183,6 +189,7 @@ export default function useScrollHandler(editorRef: any, webviewRef: any, onScro
} else {
return scrollPercent_.current;
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
return {

View File

@@ -280,6 +280,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
return true;
},
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [editor, props.contentMarkupLanguage, props.contentOriginalCss]);
// -----------------------------------------------------------------------------------------
@@ -512,6 +513,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
// style and re-applying it on editorReady gives our styles precedence and prevents any flashing
//
// tl;dr: editorReady is used here because the css needs to be re-applied after TinyMCE init
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [editorReady, props.themeId]);
// -----------------------------------------------------------------------------------------
@@ -680,6 +682,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
};
void loadEditor();
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [scriptLoaded]);
// -----------------------------------------------------------------------------------------
@@ -829,6 +832,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
return () => {
cancelled = true;
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [editor, props.markupToHtml, props.allAssets, props.content, props.resourceInfos, props.contentKey]);
useEffect(() => {
@@ -909,6 +913,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
return () => {
void execOnChangeEvent();
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
const onChangeHandlerTimeoutRef = useRef<any>(null);
@@ -1091,6 +1096,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
console.warn('Error removing events', error);
}
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.onWillChange, props.onChange, props.contentMarkupLanguage, props.contentOriginalCss, editor]);
// -----------------------------------------------------------------------------------------

View File

@@ -2078,6 +2078,17 @@
setup(editor);
};
var setup$2 = function (editor) {
var editorClickHandler = function (event) {
if (!isJoplinChecklistItem(event.target))
return;
if (event.offsetX >= 0)
return;
editor.execCommand('ToggleJoplinChecklistItem', false, { element: event.target });
};
editor.on('click', editorClickHandler);
};
var findIndex = function (list, predicate) {
for (var index = 0; index < list.length; index++) {
var element = list[index];
@@ -2100,21 +2111,8 @@
var listType = findContainerListTypeFromEvent(e);
buttonApi.setActive(listType === options.listType && lists.length > 0 && lists[0].nodeName === listName && !isCustomList(lists[0]));
};
var editorClickHandler = function (event) {
if (!isJoplinChecklistItem(event.target))
return;
if (event.offsetX >= 0)
return;
editor.execCommand('ToggleJoplinChecklistItem', false, { element: event.target });
};
if (options.listType === 'joplinChecklist') {
editor.on('click', editorClickHandler);
}
editor.on('NodeChange', nodeChangeHandler);
return function () {
if (options.listType === 'joplinChecklist') {
editor.off('click', editorClickHandler);
}
editor.off('NodeChange', nodeChangeHandler);
};
};
@@ -2158,6 +2156,7 @@
function Plugin () {
PluginManager.add('joplinLists', function (editor) {
setup$1(editor);
setup$2(editor);
register$1(editor);
register(editor);
return get(editor);

View File

@@ -59,6 +59,7 @@ function NoteEditor(props: NoteEditorProps) {
const formNote_beforeLoad = useCallback(async (event: OnLoadEvent) => {
await saveNoteIfWillChange(event.formNote);
setShowRevisions(false);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
const formNote_afterLoad = useCallback(async () => {
@@ -177,6 +178,7 @@ function NoteEditor(props: NoteEditorProps) {
id: formNote.id,
});
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.isProvisional, formNote.id]);
const previousNoteId = usePrevious(formNote.id);
@@ -194,6 +196,7 @@ function NoteEditor(props: NoteEditorProps) {
});
void ResourceEditWatcher.instance().stopWatchingAll();
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [formNote.id, previousNoteId]);
const onFieldChange = useCallback((field: string, value: any, changeId = 0) => {
@@ -238,6 +241,7 @@ function NoteEditor(props: NoteEditorProps) {
setFormNote(newNote);
scheduleSaveNote(newNote);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [handleProvisionalFlag, formNote, isNewNote, titleHasBeenManuallyChanged]);
useWindowCommandHandler({
@@ -288,6 +292,7 @@ function NoteEditor(props: NoteEditorProps) {
id: formNote.id,
status: 'saving',
});
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [formNote, handleProvisionalFlag]);
const onMessage = useMessageHandler(scrollWhenReady, setScrollWhenReady, editorRef, setLocalSearchResultCount, props.dispatch, formNote);
@@ -302,6 +307,7 @@ function NoteEditor(props: NoteEditorProps) {
setFormNote(newFormNote);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [formNote]);
const onNotePropertyChange = useCallback((event) => {
@@ -317,6 +323,7 @@ function NoteEditor(props: NoteEditorProps) {
return newFormNote;
});
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
useEffect(() => {
@@ -350,6 +357,7 @@ function NoteEditor(props: NoteEditorProps) {
noteId: formNoteRef.current.id,
percent: event.percent,
});
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.dispatch, formNote]);
function renderNoNotes(rootStyle: any) {
@@ -413,6 +421,9 @@ function NoteEditor(props: NoteEditorProps) {
fontSize: Setting.value('style.editor.fontSize'),
contentMaxWidth: props.contentMaxWidth,
isSafeMode: props.isSafeMode,
// We need it to identify the context for which media is rendered.
// It is currently used to remember pdf scroll position for each attacments of each note uniquely.
noteId: props.noteId,
};
let editor = null;

View File

@@ -100,7 +100,7 @@ export function menuItems(dispatch: Function): ContextMenuItems {
label: _('Save as %s', 'PNG'),
onAction: async (options: ContextMenuOptions) => {
// First convert it to png then save
if (options.mime != 'image/svg+xml') {
if (options.mime !== 'image/svg+xml') {
throw new Error(`Unsupported image type: ${options.mime}`);
}
if (!options.filename) {
@@ -151,14 +151,14 @@ export function menuItems(dispatch: Function): ContextMenuItems {
handleCopyToClipboard(options);
options.insertContent('');
},
isActive: (itemType: ContextMenuItemType, options: ContextMenuOptions) => itemType != ContextMenuItemType.Image && (!options.isReadOnly && (!!options.textToCopy || !!options.htmlToCopy)),
isActive: (itemType: ContextMenuItemType, options: ContextMenuOptions) => itemType !== ContextMenuItemType.Image && (!options.isReadOnly && (!!options.textToCopy || !!options.htmlToCopy)),
},
copy: {
label: _('Copy'),
onAction: async (options: ContextMenuOptions) => {
handleCopyToClipboard(options);
},
isActive: (itemType: ContextMenuItemType, options: ContextMenuOptions) => itemType != ContextMenuItemType.Image && (!!options.textToCopy || !!options.htmlToCopy),
isActive: (itemType: ContextMenuItemType, options: ContextMenuOptions) => itemType !== ContextMenuItemType.Image && (!!options.textToCopy || !!options.htmlToCopy),
},
paste: {
label: _('Paste'),

View File

@@ -75,6 +75,7 @@ export interface NoteBodyEditorProps {
fontSize: number;
contentMaxWidth: number;
isSafeMode: boolean;
noteId: string;
}
export interface FormNote {

View File

@@ -51,5 +51,6 @@ export default function useDropHandler(dependencies: HookDependencies) {
},
});
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
}

View File

@@ -114,7 +114,7 @@ export default function useFormNote(dependencies: HookDependencies) {
if (syncStarted) return () => {};
if (formNote.hasChanged) return () => {};
reg.logger().debug('Sync has finished and note has never been changed - reloading it');
reg.logger().info('Sync has finished and note has never been changed - reloading it');
let cancelled = false;
@@ -138,6 +138,7 @@ export default function useFormNote(dependencies: HookDependencies) {
return () => {
cancelled = true;
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [prevSyncStarted, syncStarted, formNote]);
useEffect(() => {
@@ -188,6 +189,7 @@ export default function useFormNote(dependencies: HookDependencies) {
return () => {
cancelled = true;
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [noteId, isProvisional, formNote]);
const onResourceChange = useCallback(async function(event: any = null) {

View File

@@ -20,6 +20,9 @@ export interface MarkupToHtmlOptions {
plugins?: Record<string, any>;
bodyOnly?: boolean;
mapsToLine?: boolean;
useCustomPdfViewer?: boolean;
noteId?: string;
vendorDir?: string;
}
export default function useMarkupToHtml(deps: HookDependencies) {
@@ -30,6 +33,7 @@ export default function useMarkupToHtml(deps: HookDependencies) {
resourceBaseUrl: `file://${Setting.value('resourceDir')}/`,
customCss: customCss || '',
});
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [plugins, customCss]);
return useCallback(async (markupLanguage: number, md: string, options: MarkupToHtmlOptions = null): Promise<any> => {
@@ -61,5 +65,6 @@ export default function useMarkupToHtml(deps: HookDependencies) {
}, options));
return result;
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [themeId, customCss, markupToHtml]);
}

View File

@@ -56,5 +56,6 @@ export default function useMessageHandler(scrollWhenReady: any, setScrollWhenRea
await CommandService.instance().execute('openItem', msg);
// bridge().showErrorMessageBox(_('Unsupported link or message: %s', msg));
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [dispatch, setLocalSearchResultCount, scrollWhenReady, formNote]);
}

View File

@@ -8,5 +8,6 @@ export default function usePluginServiceRegistration(ref: any) {
return () => {
PlatformImplementation.instance().unregisterComponent('textEditor');
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
}

View File

@@ -32,5 +32,6 @@ export default function useSearchMarkers(showLocalSearch: boolean, localSearchMa
output.keywords = highlightedWords;
return output;
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [highlightedWords, showLocalSearch, localSearchMarkerOptions, searches, selectedSearchId]);
}

View File

@@ -96,5 +96,6 @@ export default function useWindowCommandHandler(dependencies: HookDependencies)
CommandService.instance().unregisterRuntime(command.declaration.name);
}
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [editorRef, setShowLocalSearch, noteSearchBarRef, titleInputRef]);
}

View File

@@ -273,6 +273,7 @@ const NoteListComponent = (props: Props) => {
onTitleClick={noteItem_titleClick}
onContextMenu={itemContextMenu}
/>;
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [style, props.themeId, width, itemHeight, dragOverTargetNoteIndex, props.provisionalNoteIds, props.selectedNoteIds, props.watchedNoteFiles,
props.notes,
props.notesParentType,
@@ -305,6 +306,7 @@ const NoteListComponent = (props: Props) => {
if (previousVisible !== props.visible) {
updateSizeState();
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [previousSelectedNoteIds,previousNotes, previousVisible, props.selectedNoteIds, props.notes]);
const scrollNoteIndex_ = (keyCode: any, ctrlKey: any, metaKey: any, noteIndex: any) => {
@@ -342,7 +344,7 @@ const NoteListComponent = (props: Props) => {
const keyCode = event.keyCode;
const noteIds = props.selectedNoteIds;
if (noteIds.length > 0 && (keyCode === 40 || keyCode === 38 || keyCode === 33 || keyCode === 34 || keyCode === 35 || keyCode == 36)) {
if (noteIds.length > 0 && (keyCode === 40 || keyCode === 38 || keyCode === 33 || keyCode === 34 || keyCode === 35 || keyCode === 36)) {
// DOWN / UP / PAGEDOWN / PAGEUP / END / HOME
const noteId = noteIds[0];
let noteIndex = BaseModel.modelIndexById(props.notes, noteId);
@@ -439,6 +441,7 @@ const NoteListComponent = (props: Props) => {
return () => {
props.resizableLayoutEventEmitter.off('resize', resizableLayout_resize);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.resizableLayoutEventEmitter]);
useEffect(() => {
@@ -453,9 +456,15 @@ const NoteListComponent = (props: Props) => {
};
}, []);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
useEffect(() => {
// When a note list item is styled by userchrome.css, its height is reflected.
// Ref. https://github.com/laurent22/joplin/pull/6542
if (dragOverTargetNoteIndex !== null) {
// When dragged, its height should not be considered.
// Ref. https://github.com/laurent22/joplin/issues/6639
return;
}
const noteItem = Object.values<any>(itemAnchorRefs_.current)[0]?.current;
const actualItemHeight = noteItem?.getHeight() ?? 0;
if (actualItemHeight >= 8) { // To avoid generating too many narrow items

View File

@@ -41,7 +41,7 @@ class NotePropertiesDialog extends React.Component {
}
componentDidUpdate() {
if (this.state.editedKey == null) {
if (this.state.editedKey === null) {
this.okButton.current.focus();
}
}
@@ -59,7 +59,7 @@ class NotePropertiesDialog extends React.Component {
latLongFromLocation(location) {
const o = {};
const l = location.split(',');
if (l.length == 2) {
if (l.length === 2) {
o.latitude = l[0].trim();
o.longitude = l[1].trim();
} else {

View File

@@ -13,5 +13,6 @@ export default function useWindowResizeEvent(eventEmitter: any) {
window_resize.clear();
window.removeEventListener('resize', window_resize);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
}

View File

@@ -22,7 +22,6 @@ import Dialog from './Dialog';
import SyncWizardDialog from './SyncWizard/Dialog';
import MasterPasswordDialog from './MasterPasswordDialog/Dialog';
import EditFolderDialog from './EditFolderDialog/Dialog';
import TableEditorDialog from './TableEditorDialog/Dialog';
import StyleSheetContainer from './StyleSheets/StyleSheetContainer';
const { ImportScreen } = require('./ImportScreen.min.js');
const { ResourceScreen } = require('./ResourceScreen.js');
@@ -39,7 +38,6 @@ interface Props {
zoomFactor: number;
needApiAuth: boolean;
dialogs: AppStateDialog[];
dialogContentMaxSize: Size;
}
interface ModalDialogProps {
@@ -53,7 +51,6 @@ interface RegisteredDialogProps {
themeId: number;
key: string;
dispatch: Function;
dialogContentMaxSize: Size;
}
interface RegisteredDialog {
@@ -63,25 +60,19 @@ interface RegisteredDialog {
const registeredDialogs: Record<string, RegisteredDialog> = {
syncWizard: {
render: (props: RegisteredDialogProps, customProps: any) => {
return <SyncWizardDialog key={props.key} dispatch={props.dispatch} dialogContentMaxSize={props.dialogContentMaxSize} themeId={props.themeId} {...customProps}/>;
return <SyncWizardDialog key={props.key} dispatch={props.dispatch} themeId={props.themeId} {...customProps}/>;
},
},
masterPassword: {
render: (props: RegisteredDialogProps, customProps: any) => {
return <MasterPasswordDialog key={props.key} dispatch={props.dispatch} dialogContentMaxSize={props.dialogContentMaxSize} themeId={props.themeId} {...customProps}/>;
return <MasterPasswordDialog key={props.key} dispatch={props.dispatch} themeId={props.themeId} {...customProps}/>;
},
},
editFolder: {
render: (props: RegisteredDialogProps, customProps: any) => {
return <EditFolderDialog key={props.key} dispatch={props.dispatch} dialogContentMaxSize={props.dialogContentMaxSize} themeId={props.themeId} {...customProps}/>;
},
},
tableEditor: {
render: (props: RegisteredDialogProps, customProps: any) => {
return <TableEditorDialog key={props.key} dispatch={props.dispatch} dialogContentMaxSize={props.dialogContentMaxSize} themeId={props.themeId} {...customProps}/>;
return <EditFolderDialog key={props.key} dispatch={props.dispatch} themeId={props.themeId} {...customProps}/>;
},
},
};
@@ -130,7 +121,7 @@ async function initialize() {
class RootComponent extends React.Component<Props, any> {
public async componentDidMount() {
if (this.props.appState == 'starting') {
if (this.props.appState === 'starting') {
this.props.dispatch({
type: 'APP_STATE_SET',
state: 'initializing',
@@ -204,12 +195,10 @@ class RootComponent extends React.Component<Props, any> {
for (const dialog of props.dialogs) {
const md = registeredDialogs[dialog.name];
if (!md) throw new Error(`Unknown dialog: ${dialog.name}`);
output.push(md.render({
key: dialog.name,
themeId: props.themeId,
dispatch: props.dispatch,
dialogContentMaxSize: props.dialogContentMaxSize,
}, dialog.props));
}
return output;
@@ -256,11 +245,6 @@ const mapStateToProps = (state: AppState) => {
themeId: state.settings.theme,
needApiAuth: state.needApiAuth,
dialogs: state.dialogs,
dialogContentMaxSize: {
// Minus padding, margins and dialog header and button bar.
width: state.windowContentSize.width - 36 * 2,
height: state.windowContentSize.height - 36 * 2 - 28 - 30 - 20,
},
profileConfigCurrentProfileId: state.profileConfig.currentProfileId,
};
};

View File

@@ -66,6 +66,7 @@ function useRestartOnDone(upgradeResult: SyncTargetUpgradeResult) {
if (upgradeResult.done && !upgradeResult.error) {
void restart();
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [upgradeResult.done]);
}

View File

@@ -55,6 +55,7 @@ function SearchBar(props: Props) {
return () => {
debouncedSearch.clear();
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [query, searchStarted]);
const onExitSearch = useCallback(async (navigateAway = true) => {
@@ -80,6 +81,7 @@ function SearchBar(props: Props) {
}
}
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.selectedNoteId]);
function onChange(event: any) {
@@ -119,9 +121,7 @@ function SearchBar(props: Props) {
}, [onExitSearch]);
const onSearchButtonClick = useCallback(() => {
console.info('isFocused', props.isFocused);
if (props.isFocused) {
if (props.isFocused || searchStarted) {
void onExitSearch();
} else {
setSearchStarted(true);
@@ -131,7 +131,8 @@ function SearchBar(props: Props) {
field: 'globalSearch',
});
}
}, [onExitSearch, props.isFocused]);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [onExitSearch, props.isFocused, searchStarted]);
useEffect(() => {
if (props.notesParentType !== 'Search') {
@@ -152,6 +153,7 @@ function SearchBar(props: Props) {
}
void onExitSearch(true);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
return (

View File

@@ -140,6 +140,7 @@ function ShareFolderDialog(props: Props) {
useEffect(() => {
const s = props.shares.find(s => s.folder_id === props.folderId);
setShare(s);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [props.shares]);
useEffect(() => {

View File

@@ -1,4 +1,5 @@
import * as React from 'react';
import { useEffect, useRef, useCallback, useMemo } from 'react';
import { StyledRoot, StyledAddButton, StyledShareIcon, StyledHeader, StyledHeaderIcon, StyledAllNotesIcon, StyledHeaderLabel, StyledListItem, StyledListItemAnchor, StyledExpandLink, StyledNoteCount, StyledSyncReportText, StyledSyncReport, StyledSynchronizeButton } from './styles';
import { ButtonLevel } from '../Button/Button';
import CommandService from '@joplin/lib/services/CommandService';
@@ -17,12 +18,14 @@ import Folder from '@joplin/lib/models/Folder';
import Note from '@joplin/lib/models/Note';
import Tag from '@joplin/lib/models/Tag';
import Logger from '@joplin/lib/Logger';
import { FolderEntity, FolderIcon } from '@joplin/lib/services/database/types';
import { FolderEntity, FolderIcon, FolderIconType } from '@joplin/lib/services/database/types';
import stateToWhenClauseContext from '../../services/commands/stateToWhenClauseContext';
import { store } from '@joplin/lib/reducer';
import PerFolderSortOrderService from '../../services/sortOrder/PerFolderSortOrderService';
import { getFolderCallbackUrl, getTagCallbackUrl } from '@joplin/lib/callbackUrlUtils';
import FolderIconBox from '../FolderIconBox';
import { Theme } from '@joplin/lib/themes/type';
import { RuntimeProps } from './commands/focusElementSideBar';
const { connect } = require('react-redux');
const shared = require('@joplin/lib/components/shared/side-menu-shared.js');
const { themeStyle } = require('@joplin/lib/theme');
@@ -50,11 +53,8 @@ interface Props {
tags: any[];
syncStarted: boolean;
plugins: PluginStates;
}
interface State {
tagHeaderIsExpanded: boolean;
folderHeaderIsExpanded: boolean;
tagHeaderIsExpanded: boolean;
}
const commands = [
@@ -79,13 +79,21 @@ function ExpandLink(props: any) {
}
const renderFolderIcon = (folderIcon: FolderIcon) => {
if (!folderIcon) return null;
if (!folderIcon) {
const defaultFolderIcon: FolderIcon = {
dataUrl: '',
emoji: '',
name: 'far fa-folder',
type: FolderIconType.FontAwesome,
};
return <div style={{ marginRight: 5, display: 'flex' }}><FolderIconBox opacity={0.7} folderIcon={defaultFolderIcon}/></div>;
}
return <div style={{ marginRight: 5, display: 'flex' }}><FolderIconBox folderIcon={folderIcon}/></div>;
};
function FolderItem(props: any) {
const { hasChildren, isExpanded, parentId, depth, selected, folderId, folderTitle, folderIcon, anchorRef, noteCount, onFolderDragStart_, onFolderDragOver_, onFolderDrop_, itemContextMenu, folderItem_click, onFolderToggleClick_, shareId } = props;
const { hasChildren, showFolderIcon, isExpanded, parentId, depth, selected, folderId, folderTitle, folderIcon, anchorRef, noteCount, onFolderDragStart_, onFolderDragOver_, onFolderDrop_, itemContextMenu, folderItem_click, onFolderToggleClick_, shareId } = props;
const noteCountComp = noteCount ? <StyledNoteCount className="note-count-label">{noteCount}</StyledNoteCount> : null;
@@ -110,7 +118,7 @@ function FolderItem(props: any) {
}}
onDoubleClick={onFolderToggleClick_}
>
{renderFolderIcon(folderIcon)}<span className="title" style={{ lineHeight: 0 }}>{folderTitle}</span>
{showFolderIcon ? renderFolderIcon(folderIcon) : null}<span className="title" style={{ lineHeight: 0 }}>{folderTitle}</span>
{shareIcon} {noteCountComp}
</StyledListItemAnchor>
</StyledListItem>
@@ -119,56 +127,88 @@ function FolderItem(props: any) {
const menuUtils = new MenuUtils(CommandService.instance());
class SidebarComponent extends React.Component<Props, State> {
const SidebarComponent = (props: Props) => {
private folderItemsOrder_: any[] = [];
private tagItemsOrder_: any[] = [];
private rootRef: any = null;
private anchorItemRefs: any = {};
private pluginsRef: any;
const folderItemsOrder_ = useRef<any[]>();
folderItemsOrder_.current = [];
const tagItemsOrder_ = useRef<any[]>();
tagItemsOrder_.current = [];
constructor(props: any) {
super(props);
const rootRef = useRef(null);
const anchorItemRefs = useRef<Record<string, any>>(null);
anchorItemRefs.current = {};
CommandService.instance().componentRegisterCommands(this, commands);
// This whole component is a bit of a mess and rather than passing
// a plugins prop around, not knowing how it's going to affect
// re-rendering, we just keep a ref to it. Currently that's enough
// as plugins are only accessed from context menus. However if want
// to do more complex things with plugins in the sidebar, it will
// probably have to be refactored using React Hooks first.
const pluginsRef = useRef<PluginStates>(null);
pluginsRef.current = props.plugins;
this.state = {
tagHeaderIsExpanded: Setting.value('tagHeaderIsExpanded'),
folderHeaderIsExpanded: Setting.value('folderHeaderIsExpanded'),
// If at least one of the folder has an icon, then we display icons for all
// folders (those without one will get the default icon). This is so that
// visual alignment is correct for all folders, otherwise the folder tree
// looks messy.
const showFolderIcons = useMemo(() => {
return !!props.folders.find((f: FolderEntity) => !!f.icon);
}, [props.folders]);
const getSelectedItem = useCallback(() => {
if (props.notesParentType === 'Folder' && props.selectedFolderId) {
return { type: 'folder', id: props.selectedFolderId };
} else if (props.notesParentType === 'Tag' && props.selectedTagId) {
return { type: 'tag', id: props.selectedTagId };
}
return null;
}, [props.notesParentType, props.selectedFolderId, props.selectedTagId]);
const getFirstAnchorItemRef = useCallback((type: string) => {
const refs = anchorItemRefs.current[type];
if (!refs) return null;
const p = type === 'folder' ? props.folders : props.tags;
const item = p && p.length ? p[0] : null;
if (!item) return null;
return refs[item.id];
}, [anchorItemRefs, props.folders, props.tags]);
useEffect(() => {
const runtimeProps: RuntimeProps = {
getSelectedItem,
anchorItemRefs,
getFirstAnchorItemRef,
};
// This whole component is a bit of a mess and rather than passing
// a plugins prop around, not knowing how it's going to affect
// re-rendering, we just keep a ref to it. Currently that's enough
// as plugins are only accessed from context menus. However if want
// to do more complex things with plugins in the sidebar, it will
// probably have to be refactored using React Hooks first.
this.pluginsRef = React.createRef();
CommandService.instance().componentRegisterCommands(runtimeProps, commands);
this.onFolderToggleClick_ = this.onFolderToggleClick_.bind(this);
this.onKeyDown = this.onKeyDown.bind(this);
this.onAllNotesClick_ = this.onAllNotesClick_.bind(this);
this.header_contextMenu = this.header_contextMenu.bind(this);
this.onAddFolderButtonClick = this.onAddFolderButtonClick.bind(this);
this.folderItem_click = this.folderItem_click.bind(this);
this.itemContextMenu = this.itemContextMenu.bind(this);
}
return () => {
CommandService.instance().componentUnregisterCommands(commands);
};
}, [
getSelectedItem,
anchorItemRefs,
getFirstAnchorItemRef,
]);
onFolderDragStart_(event: any) {
const onFolderDragStart_ = useCallback((event: any) => {
const folderId = event.currentTarget.getAttribute('data-folder-id');
if (!folderId) return;
event.dataTransfer.setDragImage(new Image(), 1, 1);
event.dataTransfer.clearData();
event.dataTransfer.setData('text/x-jop-folder-ids', JSON.stringify([folderId]));
}
}, []);
onFolderDragOver_(event: any) {
const onFolderDragOver_ = useCallback((event: any) => {
if (event.dataTransfer.types.indexOf('text/x-jop-note-ids') >= 0) event.preventDefault();
if (event.dataTransfer.types.indexOf('text/x-jop-folder-ids') >= 0) event.preventDefault();
}
}, []);
async onFolderDrop_(event: any) {
const onFolderDrop_ = useCallback(async (event: any) => {
const folderId = event.currentTarget.getAttribute('data-folder-id');
const dt = event.dataTransfer;
if (!dt) return;
@@ -199,9 +239,9 @@ class SidebarComponent extends React.Component<Props, State> {
logger.error(error);
alert(error.message);
}
}
}, []);
async onTagDrop_(event: any) {
const onTagDrop_ = useCallback(async (event: any) => {
const tagId = event.currentTarget.getAttribute('data-tag-id');
const dt = event.dataTransfer;
if (!dt) return;
@@ -214,22 +254,18 @@ class SidebarComponent extends React.Component<Props, State> {
await Tag.addNote(tagId, noteIds[i]);
}
}
}
}, []);
async onFolderToggleClick_(event: any) {
const onFolderToggleClick_ = useCallback((event: any) => {
const folderId = event.currentTarget.getAttribute('data-folder-id');
this.props.dispatch({
props.dispatch({
type: 'FOLDER_TOGGLE',
id: folderId,
});
}
}, [props.dispatch]);
componentWillUnmount() {
CommandService.instance().componentUnregisterCommands(commands);
}
async header_contextMenu() {
const header_contextMenu = useCallback(async () => {
const menu = new Menu();
menu.append(
@@ -237,9 +273,9 @@ class SidebarComponent extends React.Component<Props, State> {
);
menu.popup(bridge().window());
}
}, []);
async itemContextMenu(event: any) {
const itemContextMenu = useCallback(async (event: any) => {
const itemId = event.currentTarget.getAttribute('data-id');
if (itemId === Folder.conflictFolderId()) return;
@@ -265,7 +301,7 @@ class SidebarComponent extends React.Component<Props, State> {
let item = null;
if (itemType === BaseModel.TYPE_FOLDER) {
item = BaseModel.byId(this.props.folders, itemId);
item = BaseModel.byId(props.folders, itemId);
}
if (itemType === BaseModel.TYPE_FOLDER && !item.encryption_applied) {
@@ -289,7 +325,7 @@ class SidebarComponent extends React.Component<Props, State> {
} else if (itemType === BaseModel.TYPE_TAG) {
await Tag.untagAll(itemId);
} else if (itemType === BaseModel.TYPE_SEARCH) {
this.props.dispatch({
props.dispatch({
type: 'SEARCH_DELETE',
id: itemId,
});
@@ -314,7 +350,7 @@ class SidebarComponent extends React.Component<Props, State> {
new MenuItem({
label: module.fullLabel(),
click: async () => {
await InteropServiceHelper.export(this.props.dispatch.bind(this), module, { sourceFolderIds: [itemId], plugins: this.pluginsRef.current });
await InteropServiceHelper.export(props.dispatch, module, { sourceFolderIds: [itemId], plugins: pluginsRef.current });
},
})
);
@@ -374,7 +410,7 @@ class SidebarComponent extends React.Component<Props, State> {
);
}
const pluginViews = pluginUtils.viewsByType(this.pluginsRef.current, 'menuItem');
const pluginViews = pluginUtils.viewsByType(pluginsRef.current, 'menuItem');
for (const view of pluginViews) {
const location = view.location;
@@ -389,80 +425,79 @@ class SidebarComponent extends React.Component<Props, State> {
}
menu.popup(bridge().window());
}
}, [props.folders, props.dispatch, pluginsRef]);
folderItem_click(folderId: string) {
this.props.dispatch({
const folderItem_click = useCallback((folderId: string) => {
props.dispatch({
type: 'FOLDER_SELECT',
id: folderId ? folderId : null,
});
}
}, [props.dispatch]);
tagItem_click(tag: any) {
this.props.dispatch({
const tagItem_click = useCallback((tag: any) => {
props.dispatch({
type: 'TAG_SELECT',
id: tag ? tag.id : null,
});
}
}, [props.dispatch]);
anchorItemRef(type: string, id: string) {
if (!this.anchorItemRefs[type]) this.anchorItemRefs[type] = {};
if (this.anchorItemRefs[type][id]) return this.anchorItemRefs[type][id];
this.anchorItemRefs[type][id] = React.createRef();
return this.anchorItemRefs[type][id];
}
const onHeaderClick_ = useCallback((key: string) => {
const isExpanded = key === 'tag' ? props.tagHeaderIsExpanded : props.folderHeaderIsExpanded;
Setting.setValue(key === 'tag' ? 'tagHeaderIsExpanded' : 'folderHeaderIsExpanded', !isExpanded);
}, [props.folderHeaderIsExpanded, props.tagHeaderIsExpanded]);
firstAnchorItemRef(type: string) {
const refs = this.anchorItemRefs[type];
if (!refs) return null;
const onAllNotesClick_ = () => {
props.dispatch({
type: 'SMART_FILTER_SELECT',
id: ALL_NOTES_FILTER_ID,
});
};
const n = `${type}s`;
const p = this.props as any;
const item = p[n] && p[n].length ? p[n][0] : null;
if (!item) return null;
const anchorItemRef = (type: string, id: string) => {
if (!anchorItemRefs.current[type]) anchorItemRefs.current[type] = {};
if (anchorItemRefs.current[type][id]) return anchorItemRefs.current[type][id];
anchorItemRefs.current[type][id] = React.createRef();
return anchorItemRefs.current[type][id];
};
return refs[item.id];
}
renderNoteCount(count: number) {
const renderNoteCount = (count: number) => {
return count ? <StyledNoteCount className="note-count-label">{count}</StyledNoteCount> : null;
}
};
renderExpandIcon(isExpanded: boolean, isVisible: boolean = true) {
const theme = themeStyle(this.props.themeId);
const renderExpandIcon = (theme: any, isExpanded: boolean, isVisible: boolean) => {
const style: any = { width: 16, maxWidth: 16, opacity: 0.5, fontSize: Math.round(theme.toolbarIconSize * 0.8), display: 'flex', justifyContent: 'center' };
if (!isVisible) style.visibility = 'hidden';
return <i className={isExpanded ? 'fas fa-caret-down' : 'fas fa-caret-right'} style={style}></i>;
}
};
renderAllNotesItem(selected: boolean) {
const renderAllNotesItem = (theme: Theme, selected: boolean) => {
return (
<StyledListItem key="allNotesHeader" selected={selected} className={'list-item-container list-item-depth-0 all-notes'} isSpecialItem={true}>
<StyledExpandLink>{this.renderExpandIcon(false, false)}</StyledExpandLink>
<StyledExpandLink>{renderExpandIcon(theme, false, false)}</StyledExpandLink>
<StyledAllNotesIcon className="icon-notes"/>
<StyledListItemAnchor
className="list-item"
isSpecialItem={true}
href="#"
selected={selected}
onClick={this.onAllNotesClick_}
onClick={onAllNotesClick_}
>
{_('All notes')}
</StyledListItemAnchor>
</StyledListItem>
);
}
};
renderFolderItem(folder: FolderEntity, selected: boolean, hasChildren: boolean, depth: number) {
const anchorRef = this.anchorItemRef('folder', folder.id);
const isExpanded = this.props.collapsedFolderIds.indexOf(folder.id) < 0;
const renderFolderItem = (folder: FolderEntity, selected: boolean, hasChildren: boolean, depth: number) =>{
const anchorRef = anchorItemRef('folder', folder.id);
const isExpanded = props.collapsedFolderIds.indexOf(folder.id) < 0;
let noteCount = (folder as any).note_count;
// Thunderbird count: Subtract children note_count from parent folder if it expanded.
if (isExpanded) {
for (let i = 0; i < this.props.folders.length; i++) {
if (this.props.folders[i].parent_id === folder.id) {
noteCount -= this.props.folders[i].note_count;
for (let i = 0; i < props.folders.length; i++) {
if (props.folders[i].parent_id === folder.id) {
noteCount -= props.folders[i].note_count;
}
}
}
@@ -472,40 +507,41 @@ class SidebarComponent extends React.Component<Props, State> {
folderId={folder.id}
folderTitle={Folder.displayTitle(folder)}
folderIcon={Folder.unserializeIcon(folder.icon)}
themeId={this.props.themeId}
themeId={props.themeId}
depth={depth}
selected={selected}
isExpanded={isExpanded}
hasChildren={hasChildren}
anchorRef={anchorRef}
noteCount={noteCount}
onFolderDragStart_={this.onFolderDragStart_}
onFolderDragOver_={this.onFolderDragOver_}
onFolderDrop_={this.onFolderDrop_}
itemContextMenu={this.itemContextMenu}
folderItem_click={this.folderItem_click}
onFolderToggleClick_={this.onFolderToggleClick_}
onFolderDragStart_={onFolderDragStart_}
onFolderDragOver_={onFolderDragOver_}
onFolderDrop_={onFolderDrop_}
itemContextMenu={itemContextMenu}
folderItem_click={folderItem_click}
onFolderToggleClick_={onFolderToggleClick_}
shareId={folder.share_id}
parentId={folder.parent_id}
showFolderIcon={showFolderIcons}
/>;
}
};
renderTag(tag: any, selected: boolean) {
const anchorRef = this.anchorItemRef('tag', tag.id);
const renderTag = (tag: any, selected: boolean) => {
const anchorRef = anchorItemRef('tag', tag.id);
let noteCount = null;
if (Setting.value('showNoteCounts')) {
if (Setting.value('showCompletedTodos')) noteCount = this.renderNoteCount(tag.note_count);
else noteCount = this.renderNoteCount(tag.note_count - tag.todo_completed_count);
if (Setting.value('showCompletedTodos')) noteCount = renderNoteCount(tag.note_count);
else noteCount = renderNoteCount(tag.note_count - tag.todo_completed_count);
}
return (
<StyledListItem selected={selected}
className={`list-item-container ${selected ? 'selected' : ''}`}
key={tag.id}
onDrop={this.onTagDrop_}
onDrop={onTagDrop_}
data-tag-id={tag.id}
>
<StyledExpandLink>{this.renderExpandIcon(false, false)}</StyledExpandLink>
<StyledExpandLink>{renderExpandIcon(theme, false, false)}</StyledExpandLink>
<StyledListItemAnchor
ref={anchorRef}
className="list-item"
@@ -513,9 +549,9 @@ class SidebarComponent extends React.Component<Props, State> {
selected={selected}
data-id={tag.id}
data-type={BaseModel.TYPE_TAG}
onContextMenu={this.itemContextMenu}
onContextMenu={itemContextMenu}
onClick={() => {
this.tagItem_click(tag);
tagItem_click(tag);
}}
>
<span className="tag-label">{Tag.displayTitle(tag)}</span>
@@ -523,16 +559,12 @@ class SidebarComponent extends React.Component<Props, State> {
</StyledListItemAnchor>
</StyledListItem>
);
}
};
makeDivider(key: string) {
return <div style={{ height: 2, backgroundColor: 'blue' }} key={key} />;
}
renderHeader(key: string, label: string, iconName: string, contextMenuHandler: Function = null, onPlusButtonClick: Function = null, extraProps: any = {}) {
const renderHeader = (key: string, label: string, iconName: string, contextMenuHandler: Function = null, onPlusButtonClick: Function = null, extraProps: any = {}) => {
const headerClick = extraProps.onClick || null;
delete extraProps.onClick;
const ref = this.anchorItemRef('headers', key);
const ref = anchorItemRef('headers', key);
return (
<div key={key} style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
@@ -545,7 +577,7 @@ class SidebarComponent extends React.Component<Props, State> {
if (headerClick) {
headerClick(key, event);
}
this.onHeaderClick_(key);
onHeaderClick_(key);
}}
>
<StyledHeaderIcon className={iconName}/>
@@ -554,21 +586,11 @@ class SidebarComponent extends React.Component<Props, State> {
{ onPlusButtonClick && <StyledAddButton onClick={onPlusButtonClick} iconName="fas fa-plus" level={ButtonLevel.SidebarSecondary}/> }
</div>
);
}
};
selectedItem() {
if (this.props.notesParentType === 'Folder' && this.props.selectedFolderId) {
return { type: 'folder', id: this.props.selectedFolderId };
} else if (this.props.notesParentType === 'Tag' && this.props.selectedTagId) {
return { type: 'tag', id: this.props.selectedTagId };
}
return null;
}
onKeyDown(event: any) {
const onKeyDown = useCallback((event: any) => {
const keyCode = event.keyCode;
const selectedItem = this.selectedItem();
const selectedItem = getSelectedItem();
if (keyCode === 40 || keyCode === 38) {
// DOWN / UP
@@ -576,14 +598,14 @@ class SidebarComponent extends React.Component<Props, State> {
const focusItems = [];
for (let i = 0; i < this.folderItemsOrder_.length; i++) {
const id = this.folderItemsOrder_[i];
focusItems.push({ id: id, ref: this.anchorItemRefs['folder'][id], type: 'folder' });
for (let i = 0; i < folderItemsOrder_.current.length; i++) {
const id = folderItemsOrder_.current[i];
focusItems.push({ id: id, ref: anchorItemRefs.current['folder'][id], type: 'folder' });
}
for (let i = 0; i < this.tagItemsOrder_.length; i++) {
const id = this.tagItemsOrder_[i];
focusItems.push({ id: id, ref: this.anchorItemRefs['tag'][id], type: 'tag' });
for (let i = 0; i < tagItemsOrder_.current.length; i++) {
const id = tagItemsOrder_.current[i];
focusItems.push({ id: id, ref: anchorItemRefs.current['tag'][id], type: 'tag' });
}
let currentIndex = 0;
@@ -604,7 +626,7 @@ class SidebarComponent extends React.Component<Props, State> {
const actionName = `${focusItem.type.toUpperCase()}_SELECT`;
this.props.dispatch({
props.dispatch({
type: actionName,
id: focusItem.id,
});
@@ -627,7 +649,7 @@ class SidebarComponent extends React.Component<Props, State> {
// SPACE
event.preventDefault();
this.props.dispatch({
props.dispatch({
type: 'FOLDER_TOGGLE',
id: selectedItem.id,
});
@@ -637,24 +659,9 @@ class SidebarComponent extends React.Component<Props, State> {
// Ctrl+A key
event.preventDefault();
}
}
}, [getSelectedItem, props.dispatch]);
onHeaderClick_(key: string) {
const toggleKey = `${key}IsExpanded`;
const isExpanded = (this.state as any)[toggleKey];
const newState: any = { [toggleKey]: !isExpanded };
this.setState(newState);
Setting.setValue(toggleKey, !isExpanded);
}
onAllNotesClick_() {
this.props.dispatch({
type: 'SMART_FILTER_SELECT',
id: ALL_NOTES_FILTER_ID,
});
}
renderSynchronizeButton(type: string) {
const renderSynchronizeButton = (type: string) => {
const label = type === 'sync' ? _('Synchronise') : _('Cancel');
const iconAnimation = type !== 'sync' ? 'icon-infinite-rotation 1s linear infinite' : '';
@@ -670,116 +677,98 @@ class SidebarComponent extends React.Component<Props, State> {
}}
/>
);
}
};
onAddFolderButtonClick() {
const onAddFolderButtonClick = useCallback(() => {
void CommandService.instance().execute('newFolder');
}, []);
const theme = themeStyle(props.themeId);
const items = [];
items.push(
renderHeader('folderHeader', _('Notebooks'), 'icon-notebooks', header_contextMenu, onAddFolderButtonClick, {
onDrop: onFolderDrop_,
['data-folder-id']: '',
toggleblock: 1,
})
);
if (props.folders.length) {
const allNotesSelected = props.notesParentType === 'SmartFilter' && props.selectedSmartFilterId === ALL_NOTES_FILTER_ID;
const result = shared.renderFolders(props, renderFolderItem);
const folderItems = [renderAllNotesItem(theme, allNotesSelected)].concat(result.items);
folderItemsOrder_.current = result.order;
items.push(
<div
className={`folders ${props.folderHeaderIsExpanded ? 'expanded' : ''}`}
key="folder_items"
style={{ display: props.folderHeaderIsExpanded ? 'block' : 'none', paddingBottom: 10 }}
>
{folderItems}
</div>
);
}
// componentDidUpdate(prevProps:any, prevState:any) {
// for (const n in prevProps) {
// if (prevProps[n] !== (this.props as any)[n]) {
// console.info('CHANGED PROPS', n);
// }
// }
items.push(
renderHeader('tagHeader', _('Tags'), 'icon-tags', null, null, {
toggleblock: 1,
})
);
// for (const n in prevState) {
// if (prevState[n] !== (this.state as any)[n]) {
// console.info('CHANGED STATE', n);
// }
// }
// }
render() {
this.pluginsRef.current = this.props.plugins;
const theme = themeStyle(this.props.themeId);
const items = [];
if (props.tags.length) {
const result = shared.renderTags(props, renderTag);
const tagItems = result.items;
tagItemsOrder_.current = result.order;
items.push(
this.renderHeader('folderHeader', _('Notebooks'), 'icon-notebooks', this.header_contextMenu, this.onAddFolderButtonClick, {
onDrop: this.onFolderDrop_,
['data-folder-id']: '',
toggleblock: 1,
})
);
if (this.props.folders.length) {
const allNotesSelected = this.props.notesParentType === 'SmartFilter' && this.props.selectedSmartFilterId === ALL_NOTES_FILTER_ID;
const result = shared.renderFolders(this.props, this.renderFolderItem.bind(this));
const folderItems = [this.renderAllNotesItem(allNotesSelected)].concat(result.items);
this.folderItemsOrder_ = result.order;
items.push(
<div
className={`folders ${this.state.folderHeaderIsExpanded ? 'expanded' : ''}`}
key="folder_items"
style={{ display: this.state.folderHeaderIsExpanded ? 'block' : 'none', paddingBottom: 10 }}
>
{folderItems}
</div>
);
}
items.push(
this.renderHeader('tagHeader', _('Tags'), 'icon-tags', null, null, {
toggleblock: 1,
})
);
if (this.props.tags.length) {
const result = shared.renderTags(this.props, this.renderTag.bind(this));
const tagItems = result.items;
this.tagItemsOrder_ = result.order;
items.push(
<div className="tags" key="tag_items" style={{ display: this.state.tagHeaderIsExpanded ? 'block' : 'none' }}>
{tagItems}
</div>
);
}
let decryptionReportText = '';
if (this.props.decryptionWorker && this.props.decryptionWorker.state !== 'idle' && this.props.decryptionWorker.itemCount) {
decryptionReportText = _('Decrypting items: %d/%d', this.props.decryptionWorker.itemIndex + 1, this.props.decryptionWorker.itemCount);
}
let resourceFetcherText = '';
if (this.props.resourceFetcher && this.props.resourceFetcher.toFetchCount) {
resourceFetcherText = _('Fetching resources: %d/%d', this.props.resourceFetcher.fetchingCount, this.props.resourceFetcher.toFetchCount);
}
const lines = Synchronizer.reportToLines(this.props.syncReport);
if (resourceFetcherText) lines.push(resourceFetcherText);
if (decryptionReportText) lines.push(decryptionReportText);
const syncReportText = [];
for (let i = 0; i < lines.length; i++) {
syncReportText.push(
<StyledSyncReportText key={i}>
{lines[i]}
</StyledSyncReportText>
);
}
const syncButton = this.renderSynchronizeButton(this.props.syncStarted ? 'cancel' : 'sync');
const syncReportComp = !syncReportText.length ? null : (
<StyledSyncReport key="sync_report">
{syncReportText}
</StyledSyncReport>
);
return (
<StyledRoot ref={this.rootRef} onKeyDown={this.onKeyDown} className="sidebar">
<div style={{ flex: 1, overflowX: 'hidden', overflowY: 'auto' }}>{items}</div>
<div style={{ flex: 0, padding: theme.mainPadding }}>
{syncReportComp}
{syncButton}
</div>
</StyledRoot>
<div className="tags" key="tag_items" style={{ display: props.tagHeaderIsExpanded ? 'block' : 'none' }}>
{tagItems}
</div>
);
}
}
let decryptionReportText = '';
if (props.decryptionWorker && props.decryptionWorker.state !== 'idle' && props.decryptionWorker.itemCount) {
decryptionReportText = _('Decrypting items: %d/%d', props.decryptionWorker.itemIndex + 1, props.decryptionWorker.itemCount);
}
let resourceFetcherText = '';
if (props.resourceFetcher && props.resourceFetcher.toFetchCount) {
resourceFetcherText = _('Fetching resources: %d/%d', props.resourceFetcher.fetchingCount, props.resourceFetcher.toFetchCount);
}
const lines = Synchronizer.reportToLines(props.syncReport);
if (resourceFetcherText) lines.push(resourceFetcherText);
if (decryptionReportText) lines.push(decryptionReportText);
const syncReportText = [];
for (let i = 0; i < lines.length; i++) {
syncReportText.push(
<StyledSyncReportText key={i}>
{lines[i]}
</StyledSyncReportText>
);
}
const syncButton = renderSynchronizeButton(props.syncStarted ? 'cancel' : 'sync');
const syncReportComp = !syncReportText.length ? null : (
<StyledSyncReport key="sync_report">
{syncReportText}
</StyledSyncReport>
);
return (
<StyledRoot ref={rootRef} onKeyDown={onKeyDown} className="sidebar">
<div style={{ flex: 1, overflowX: 'hidden', overflowY: 'auto' }}>{items}</div>
<div style={{ flex: 0, padding: theme.mainPadding }}>
{syncReportComp}
{syncButton}
</div>
</StyledRoot>
);
};
const mapStateToProps = (state: AppState) => {
return {
@@ -799,6 +788,8 @@ const mapStateToProps = (state: AppState) => {
decryptionWorker: state.decryptionWorker,
resourceFetcher: state.resourceFetcher,
plugins: state.pluginService.plugins,
tagHeaderIsExpanded: state.settings.tagHeaderIsExpanded,
folderHeaderIsExpanded: state.settings.folderHeaderIsExpanded,
};
};

View File

@@ -9,18 +9,24 @@ export const declaration: CommandDeclaration = {
parentLabel: () => _('Focus'),
};
export const runtime = (comp: any): CommandRuntime => {
export interface RuntimeProps {
getSelectedItem(): any;
getFirstAnchorItemRef(type: string): any;
anchorItemRefs: any;
}
export const runtime = (props: RuntimeProps): CommandRuntime => {
return {
execute: async (context: CommandContext) => {
const sidebarVisible = layoutItemProp((context.state as AppState).mainLayout, 'sideBar', 'visible');
if (sidebarVisible) {
const item = comp.selectedItem();
const item = props.getSelectedItem();
if (item) {
const anchorRef = comp.anchorItemRefs[item.type][item.id];
const anchorRef = props.anchorItemRefs.current[item.type][item.id];
if (anchorRef) anchorRef.current.focus();
} else {
const anchorRef = comp.firstAnchorItemRef('folder');
const anchorRef = props.getFirstAnchorItemRef('folder');
if (anchorRef) anchorRef.current.focus();
}
}

View File

@@ -1,101 +0,0 @@
import * as React from 'react';
import { useCallback, useEffect } from 'react';
import { _ } from '@joplin/lib/locale';
import DialogButtonRow, { ClickEvent } from '../DialogButtonRow';
import Dialog from '../Dialog';
import DialogTitle from '../DialogTitle';
import { parseMarkdownTable } from '../../../lib/markdownUtils';
import { Size } from '../ResizableLayout/utils/types';
interface Props {
themeId: number;
dispatch: Function;
markdownTable: string;
dialogContentMaxSize: Size;
}
const markdownTableToObject = (markdownTable: string): any => {
const table = parseMarkdownTable(markdownTable);
return {
columns: table.headers.map(h => {
return {
title: h.label,
field: h.name,
hozAlign: h.justify,
editor: 'input',
};
}),
data: table.rows.map(row => {
return {
...row,
};
}),
};
};
export default function(props: Props) {
const elementId = `tabulator_${Math.floor(Math.random() * 1000000)}`;
const onClose = useCallback(() => {
props.dispatch({
type: 'DIALOG_CLOSE',
name: 'tableEditor',
});
}, [props.dispatch]);
const onButtonRowClick = useCallback(async (event: ClickEvent) => {
if (event.buttonName === 'cancel') {
onClose();
return;
}
if (event.buttonName === 'ok') {
return;
}
}, [onClose]);
useEffect(() => {
const table = markdownTableToObject(props.markdownTable);
const Tabulator = (window as any).Tabulator;
// TODO: probably doesn't need to be called every time
// TODO: Load CSS/JS dynamically?
// TODO: Clean up on exit
Tabulator.extendModule('edit', 'editors', {});
new Tabulator(`#${elementId}`, {
...table,
height: props.dialogContentMaxSize.height,
});
}, []);
function renderContent() {
return (
<div className="dialog-content">
<div id={elementId}></div>
</div>
);
}
function renderDialogWrapper() {
return (
<div className="dialog-root">
<DialogTitle title={_('Edit table')}/>
{renderContent()}
<DialogButtonRow
themeId={props.themeId}
onClick={onButtonRowClick}
okButtonLabel={_('Save')}
/>
</div>
);
}
return (
<Dialog onClose={onClose} renderContent={renderDialogWrapper}/>
);
}

View File

@@ -23,5 +23,6 @@ export default function useEffectDebugger(effectHook: any, dependencies: any, de
console.log('[use-effet-debugger] ', changedDeps);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
useEffect(effectHook, dependencies);
}

View File

@@ -23,5 +23,6 @@ export default function useImperativeHandleDebugger(ref: any, effectHook: any, d
console.log('[use-imperativeHandler-debugger] ', changedDeps);
}
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
useImperativeHandle(ref, effectHook, dependencies);
}

View File

@@ -653,6 +653,17 @@
e.preventDefault();
}));
document.addEventListener('click', webviewLib.logEnabledEventHandler(e => {
document.querySelectorAll('.media-pdf').forEach(element => {
if(!!element.contentWindow){
element.contentWindow.postMessage({
type: 'blur'
}, '*');
}
}
);
}));
let lastClientWidth_ = NaN, lastClientHeight_ = NaN, lastScrollTop_ = NaN;
window.addEventListener('resize', webviewLib.logEnabledEventHandler(() => {

View File

@@ -40,7 +40,7 @@ scrollmap.get_ = () => {
// embedded into elements by the renderer.
// See also renderer/MdToHtml/rules/source_map.ts.
const elems = document.getElementsByClassName('maps-to-line');
if (elems.length == 0) return null;
if (elems.length === 0) return null;
const map = { line: [0], percent: [0], viewHeight: height, lineCount: 0 };
// Each map entry is total-ordered.
let last = 0;

View File

@@ -7,10 +7,6 @@
uses 'eval'.
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval'">
-->
<!--
To add files below, then need to be in the "vendor" directory. To make this happen, use copyApplicationAssets.js
-->
<title>Joplin</title>
<link rel="stylesheet" href="style.min.css">
<link rel="stylesheet" href="style/icons/style.css">
@@ -19,9 +15,6 @@
<link rel="stylesheet" href="vendor/lib/smalltalk/css/smalltalk.css">
<link rel="stylesheet" href="vendor/lib/roboto-fontface/css/roboto/roboto-fontface.css">
<link rel="stylesheet" href="vendor/lib/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="vendor/lib/tabulator-tables/dist/css/tabulator.min.css">
<script type="text/javascript" src="vendor/lib/tabulator-tables/dist/js/tabulator.min.js"></script>
<style>
.smalltalk {

View File

@@ -26,7 +26,7 @@ const shim = require('@joplin/lib/shim').default;
const { shimInit } = require('@joplin/lib/shim-init-node.js');
const bridge = require('@electron/remote').require('./bridge').default;
const EncryptionService = require('@joplin/lib/services/e2ee/EncryptionService').default;
const { FileApiDriverLocal } = require('@joplin/lib/file-api-driver-local.js');
const { FileApiDriverLocal } = require('@joplin/lib/file-api-driver-local');
const React = require('react');
const nodeSqlite = require('sqlite3');
@@ -131,7 +131,7 @@ app().start(bridge().processArgv()).then((result) => {
}).catch((error) => {
const env = bridge().env();
if (error.code == 'flagError') {
if (error.code === 'flagError') {
bridge().showErrorMessageBox(error.message);
} else {
// If something goes wrong at this stage we don't have a console or a log file

View File

@@ -1,6 +1,6 @@
{
"name": "@joplin/app-desktop",
"version": "2.8.8",
"version": "2.9.4",
"description": "Joplin for Desktop",
"main": "main.js",
"private": true,
@@ -31,7 +31,8 @@
"afterSign": "./tools/notarizeMacApp.js",
"extraResources": [
"build/icons/**",
"build/images/**"
"build/images/**",
"build/defaultPlugins/**"
],
"afterAllArtifactBuild": "./generateSha512.js",
"asar": true,
@@ -105,7 +106,7 @@
},
"homepage": "https://github.com/laurent22/joplin#readme",
"devDependencies": {
"@joplin/tools": "~2.8",
"@joplin/tools": "~2.9",
"@testing-library/react-hooks": "^3.4.2",
"@types/jest": "^26.0.15",
"@types/node": "^14.14.6",
@@ -137,8 +138,9 @@
"@electron/remote": "^2.0.1",
"@fortawesome/fontawesome-free": "^5.13.0",
"@joeattardi/emoji-button": "^4.6.0",
"@joplin/lib": "~2.8",
"@joplin/renderer": "~2.8",
"@joplin/lib": "~2.9",
"@joplin/pdf-viewer": "~2.9",
"@joplin/renderer": "~2.9",
"async-mutex": "^0.1.3",
"codemirror": "^5.56.0",
"color": "^3.1.2",
@@ -174,7 +176,6 @@
"styled-components": "5.1.1",
"styled-system": "5.1.5",
"taboverride": "^4.0.3",
"tabulator-tables": "^5.1.4",
"tinymce": "^5.2.0"
}
}

View File

@@ -214,7 +214,7 @@ class Dialog extends React.PureComponent<Props, State> {
}
modalLayer_onClick(event: any) {
if (event.currentTarget == event.target) {
if (event.currentTarget === event.target) {
this.props.dispatch({
pluginName: PLUGIN_NAME,
type: 'PLUGINLEGACY_DIALOG_SET',

View File

@@ -1,19 +1,12 @@
import bridge from '../bridge';
import { Implementation as WindowImplementation } from '@joplin/lib/services/plugins/api/JoplinWindow';
import { injectCustomStyles } from '@joplin/lib/CssUtils';
import { VersionInfo } from '@joplin/lib/services/plugins/api/types';
import Setting from '@joplin/lib/models/Setting';
import { reg } from '@joplin/lib/registry';
import BasePlatformImplementation, { Joplin } from '@joplin/lib/services/plugins/BasePlatformImplementation';
const { clipboard, nativeImage } = require('electron');
interface JoplinViewsDialogs {
showMessageBox(message: string): Promise<number>;
}
interface JoplinViews {
dialogs: JoplinViewsDialogs;
}
interface Joplin {
views: JoplinViews;
}
const packageInfo = require('../../packageInfo');
interface Components {
[key: string]: any;
@@ -22,7 +15,7 @@ interface Components {
// PlatformImplementation provides access to platform specific dependencies,
// such as the clipboard, message dialog, etc. It allows having the same plugin
// API for all platforms, but with different implementations.
export default class PlatformImplementation {
export default class PlatformImplementation extends BasePlatformImplementation {
private static instance_: PlatformImplementation;
private joplin_: Joplin;
@@ -33,6 +26,14 @@ export default class PlatformImplementation {
return this.instance_;
}
public get versionInfo(): VersionInfo {
return {
version: packageInfo.version,
syncVersion: Setting.value('syncVersion'),
profileVersion: reg.db().version(),
};
}
public get clipboard() {
return clipboard;
}
@@ -48,6 +49,8 @@ export default class PlatformImplementation {
}
public constructor() {
super();
this.components_ = {};
this.joplin_ = {

View File

@@ -69,6 +69,7 @@ function UserWebview(props: Props, ref: any) {
useEffect(() => {
if (isReady && props.onReady) props.onReady();
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [isReady]);
function frameWindow() {

View File

@@ -33,6 +33,7 @@ export default function(frameWindow: any, htmlHash: string, minWidth: number, mi
useEffect(() => {
updateContentSize(htmlHash);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [htmlHash]);
useEffect(() => {
@@ -55,6 +56,7 @@ export default function(frameWindow: any, htmlHash: string, minWidth: number, mi
return () => {
clearInterval(updateFrameSizeIID);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [fitToContent, isReady, minWidth, minHeight, htmlHash]);
return contentSize;

View File

@@ -45,6 +45,7 @@ export default function(frameWindow: any, isReady: boolean, postMessage: Functio
hash: htmlHash,
html: html,
});
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [html, htmlHash, isReady]);
return loadedHtmlHash;

View File

@@ -4,10 +4,12 @@ export default function(postMessage: Function, isReady: boolean, scripts: string
useEffect(() => {
if (!isReady) return;
postMessage('setScripts', { scripts: scripts });
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [scripts, isReady]);
useEffect(() => {
if (!isReady || !cssFilePath) return;
postMessage('setScript', { script: cssFilePath, key: 'themeCss' });
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [isReady, cssFilePath]);
}

View File

@@ -19,7 +19,7 @@ export default function(frameWindow: any, onSubmit: Function, onDismiss: Functio
// Disable enter key from submitting when a text area is in focus!
// https://github.com/laurent22/joplin/issues/4766
//
if (frameWindow.document.activeElement.tagName != 'TEXTAREA') {
if (frameWindow.document.activeElement.tagName !== 'TEXTAREA') {
if (onSubmit) onSubmit();
}
}

View File

@@ -43,8 +43,10 @@ export default function useViewIsReady(viewRef: any) {
return () => {
viewRef.current.removeEventListener('dom-ready', onIFrameReady);
viewRef.current.removeEventListener('load', onIFrameReady);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
viewRef.current.contentWindow.removeEventListener('message', onMessage);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
return iframeReady && iframeContentReady;

View File

@@ -10,6 +10,7 @@ export default function(frameWindow: any, isReady: boolean, pluginId: string, vi
return () => {
PostMessageService.instance().unregisterResponder(ResponderComponentType.UserWebview, viewId);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [viewId]);
useEffect(() => {
@@ -39,5 +40,6 @@ export default function(frameWindow: any, isReady: boolean, pluginId: string, vi
return () => {
frameWindow.removeEventListener('message', onMessage_);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, [frameWindow, isReady, pluginId, viewId]);
}

Some files were not shown because too many files have changed in this diff Show More