1
0
mirror of https://github.com/laurent22/joplin.git synced 2026-01-23 07:35:03 +02:00

Compare commits

..

132 Commits

Author SHA1 Message Date
Laurent Cozic
ec69097cec update 2026-01-20 18:17:07 +00:00
Laurent Cozic
6b1f2c946e update 2026-01-20 15:50:33 +00:00
Laurent Cozic
c6c1a9a888 update 2026-01-20 15:32:06 +00:00
Laurent Cozic
e95e84edeb update 2026-01-20 15:13:40 +00:00
Laurent Cozic
4e5895e53f update 2026-01-20 14:26:49 +00:00
Laurent Cozic
0bf92c2cdd update 2026-01-20 13:49:37 +00:00
Laurent Cozic
2a9dfe7cf9 update 2026-01-20 13:19:46 +00:00
Laurent Cozic
66388acfbe update 2026-01-20 12:17:32 +00:00
Laurent Cozic
dd12f4df64 update 2026-01-20 11:14:41 +00:00
Laurent Cozic
7209948ded trying signing 2026-01-20 10:15:37 +00:00
Laurent Cozic
cdf104f650 update 2026-01-20 10:12:22 +00:00
Laurent Cozic
484d6a866d Doc: Remove "(Pre-release)" marker from Android changelog since all versions are pre-releases 2026-01-19 18:03:05 +00:00
Laurent Cozic
b45fd09e38 Merge branch 'release-3.5' into dev 2026-01-19 16:44:41 +00:00
Laurent Cozic
903a369c13 Android 3.5.9 2026-01-19 16:43:41 +00:00
Laurent Cozic
1fb79315e4 Chore: lock files 2026-01-19 16:13:04 +00:00
Henry Heino
4dc021b523 Android: Remove unnecessary READ_PHONE_STATE permission (#14157) 2026-01-19 16:04:56 +00:00
Joplin Bot
bbb4b46dd9 Doc: Auto-update documentation
Auto-updated using release-website.sh
2026-01-19 02:01:31 +00:00
renovate[bot]
063dc46f50 Update dependency dotenv to v17.2.3 (#14155)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-19 00:02:36 +00:00
renovate[bot]
aa400b52be Update dependency short-uuid to v5 (#14156)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-19 00:02:26 +00:00
renovate[bot]
be7de2f08a Update dependency dotenv to v17.2.2 (#14145)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-18 22:01:23 +00:00
renovate[bot]
f8a129e4dc Update dependency npm-package-json-lint to v9 (#14146)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-18 22:01:11 +00:00
Laurent Cozic
c5d9646908 Desktop release v3.6.2 2026-01-18 11:33:16 +00:00
Henry Heino
876ec80911 Desktop: Fixes #14084: .onepkg import: Fix Unicode issues, support Linux and MacOS (#14094)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-18 11:31:48 +00:00
mrjo118
4051f88ce7 Chore: Fix intermittent Synchronizer.revisions test failure (#14096)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-18 11:31:42 +00:00
Laurent Cozic
f194c111e4 All: Fixes #14144: Application crashes when profile database has been analyzed 2026-01-18 11:30:05 +00:00
Henry Heino
e386246bc9 Chore: Sync fuzzer: Improve error logging (#14108)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-18 11:29:32 +00:00
Henry Heino
292b269f1d Desktop: Resolves #14086: Accessibility: Include accessibility information in exported PDFs (#14111)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-18 11:29:25 +00:00
renovate[bot]
b2fc43da2b Update dependency short-uuid to v4.2.2 (#14114)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-18 11:29:17 +00:00
Henry Heino
4a23a1ed3e Desktop: Fixes #14092: Built-in plugins: Upgrade Freehand Drawing to v4.3.0 (#14123)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-18 11:29:07 +00:00
Henry Heino
c8878a18bf Desktop, Mobile: Editor: Inline rendering: Render inline HTML (colorized text, superscript, subscript, strikethrough) (#14133) 2026-01-18 11:28:15 +00:00
Henry Heino
340fba7af5 Server: Fixes #14107: Fix warning when unsharing folder (#14134) 2026-01-18 11:25:52 +00:00
Henry Heino
271c4f4a2a Server: Fixes #14131: Allow changing the password for the admin account when SAML is enabled (#14135) 2026-01-18 11:25:38 +00:00
Henry Heino
c9dba20f59 Chore: Sync fuzzer: Allow specifying a set of initial actions (#14136)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-18 11:25:07 +00:00
renovate[bot]
b474cc206a Update dependency dotenv to v17 (#14138)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-18 11:24:46 +00:00
Milo Ivir
9d4df8cc6e All: Translation: Update hr_HR.po (#14140) 2026-01-17 20:57:39 -05:00
Joplin Bot
a4ddfe1f58 Doc: Auto-update documentation
Auto-updated using release-website.sh
2026-01-17 18:38:35 +00:00
renovate[bot]
7d15215e66 Update dependency react-native-device-info to v14.1.1 (#14132)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-17 14:23:02 +00:00
Laurent Cozic
449555c8e9 Desktop release v3.5.12 2026-01-17 11:21:02 +00:00
Laurent Cozic
5b74e206ed Desktop release v3.6.1 2026-01-17 11:19:55 +00:00
Laurent Cozic
9873d02b0b Chore: Setup new release 3.6 2026-01-17 11:19:43 +00:00
Laurent Cozic
57b7d98d8a Merge branch 'release-3.5' into dev 2026-01-17 11:18:39 +00:00
Laurent Cozic
f075b561a2 All: Add more error information when the profile is corrupted 2026-01-17 11:17:43 +00:00
renovate[bot]
483d051de0 Update dependency rate-limiter-flexible to v7.3.2 (#14130)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 15:59:43 +00:00
renovate[bot]
106cd2778f Update dependency rate-limiter-flexible to v7.3.1 (#14128)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-16 13:57:49 +00:00
Eric Duarte
c3aea2db80 All: Translation: Update ca.po (#14129) 2026-01-16 08:10:45 -05:00
Liffindra Angga Zaaldian
3f067b0f77 All: Translation: Update id_ID.po (#14127)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-16 08:08:49 -05:00
Laurent Cozic
15cf025bc2 All: Resolves #14106: Improve Fountain notes exported as PDF (#14120) 2026-01-16 11:30:54 +00:00
Henry Heino
4677586e3b Desktop: Rich Text Editor: Fix cut, copy, paste, and select all menu items (#14125) 2026-01-16 11:30:39 +00:00
Laurent Cozic
b8c5b7a153 Doc: Added Contribution Scope Policy 2026-01-16 10:19:32 +00:00
renovate[bot]
e46e634c2e Update dependency style-to-js to v1.1.18 (#14118)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-16 09:44:18 +00:00
Henry Heino
b3cf4e5a35 Chore: Fix CI (#14124) 2026-01-16 09:43:30 +00:00
Laurent Cozic
8589e10d6e Chore: Trying to fix CI 2026-01-15 14:23:00 +00:00
renovate[bot]
18942f0d6a Update dependency babel-plugin-react-native-web to v0.21.2 (#14104)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 13:25:14 +00:00
Eric Duarte
3be354cdcb All: Translation: Update es_ES.po (#14117) 2026-01-15 08:22:26 -05:00
renovate[bot]
0575f1aa3e Update dependency react-native-web to v0.21.2 (#14113)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 05:12:54 +00:00
renovate[bot]
caa9baa460 Update dependency react-native-localize to v3.5.4 (#14112)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 02:04:45 +00:00
renovate[bot]
b5284804d8 Update dependency qrcode to v1.5.4 (#14109)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-15 00:07:22 +00:00
renovate[bot]
6053b4296c Update dependency esbuild to v0.25.11 (#14101)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-14 13:56:24 +00:00
renovate[bot]
615fec1d2c Update dependency @rollup/plugin-node-resolve to v16.0.3 (#14100)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-14 13:54:35 +00:00
Laurent Cozic
0bbcd9a59b All: Add support for external embeds, eg. YouTube videos (#14012) 2026-01-14 13:52:17 +00:00
renovate[bot]
6931b32f17 Update dependency @rollup/plugin-commonjs to v28.0.8 (#14099)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-14 12:09:18 +00:00
renovate[bot]
17ac501ddb Update dependency @types/serviceworker to v0.0.158 (#14060)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-14 09:32:41 +00:00
renovate[bot]
94161c5f93 Update dependency @types/react to v18.3.26 (#14050)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2026-01-14 09:32:34 +00:00
Jozef Gaal
196255e960 All: Translation: Update sk_SK.po (#14095) 2026-01-13 19:55:13 -05:00
Self Not Found
f936390ee4 All: Translation: Update zh_CN.po (#14091) 2026-01-13 16:48:20 -05:00
Laurent Cozic
5638c4b812 Chore: Fixed various typo and grammar mistakes 2026-01-13 16:28:24 +00:00
Linkosred
4222caa423 Docs : Add video tutorial link for several pages of the documentation (#14068) 2026-01-13 16:20:52 +00:00
Henry Heino
bc705acc5c Windows: Fixes #13430: Experimental auto-updater: Fix application crash on update failure (#14083) 2026-01-13 16:19:51 +00:00
Laurent Cozic
f1c968c19a Chore: Remove usage of watchman when running Jest tests (#14087) 2026-01-13 15:40:53 +00:00
Laurent Cozic
26c5a6181e Chore: Retry Apple Silicon test build when it fails (#14088) 2026-01-13 15:40:36 +00:00
Laurent Cozic
a3bf0cfdeb Server: Add support for MFA (#14081) 2026-01-13 14:14:46 +00:00
Joplin Bot
606b397326 Doc: Auto-update documentation
Auto-updated using release-website.sh
2026-01-13 01:53:11 +00:00
krevad
fbd157283d All: Translation: Update sv.po (#14082) 2026-01-12 19:38:43 -05:00
Laurent Cozic
2e879f65fc Chore: Fixed Markdown filename 2026-01-12 19:32:54 +00:00
Joplin Bot
c727156a46 Doc: Auto-update documentation
Auto-updated using release-website.sh
2026-01-12 18:43:05 +00:00
Laurent Cozic
4e31f1918d Doc: Added instructions on how to create a custom profile for deployments 2026-01-12 16:18:17 +00:00
Laurent Cozic
a1cdf67779 Chore: Also release pkg files for macOS 2026-01-12 16:08:56 +00:00
Laurent Cozic
5cb1db197f Doc: Add release notes 3.5 2026-01-12 15:12:18 +00:00
Joplin Bot
05c3065c72 Doc: Auto-update documentation
Auto-updated using release-website.sh
2026-01-10 12:49:51 +00:00
Laurent Cozic
25a5be09bf Merge branch 'release-3.5' into dev 2026-01-10 10:16:56 +00:00
Laurent Cozic
f0a3f73ddb iOS 13.5.3 2026-01-10 10:09:40 +00:00
Laurent Cozic
1bb5d9ade5 Android 3.5.8 2026-01-10 10:09:18 +00:00
Laurent Cozic
e75875c1b0 Desktop release v3.5.11 2026-01-10 10:01:41 +00:00
mrjo118
cce4b76e3f Mobile: Fixes #13544: Fixed keyboard input issue in note title (#14070) 2026-01-10 09:53:21 +00:00
Henry Heino
b310bfd0c2 iOS: Fixes #14063: Fix icon rendering (#14071) 2026-01-10 09:44:23 +00:00
Henry Heino
e19e1ac040 Desktop: OneNote importer: Simplify error report (#14074) 2026-01-10 09:44:09 +00:00
ERYpTION
3bba2f6b2a All: Translation: Update da_DK.po (#14073) 2026-01-09 17:22:08 -05:00
summoner
ca9addcda0 ALL: Translation: Update hu-HU.po (#14069) 2026-01-09 16:16:33 -05:00
Nick
c42a49c1cf All: Translation: Update sv.po (#14064) 2026-01-09 15:58:20 -05:00
Laurent Cozic
a1e056670d Chore: Ignore .watchman-cookie- files 2026-01-09 17:45:27 +00:00
Laurent Cozic
6d7a70c21a Chore: Update translations 2026-01-09 10:06:42 +00:00
Henry Heino
14fd3c66c1 Chore: Fix CI (#14061) 2026-01-09 09:26:17 +00:00
Joplin Bot
376f44a0ce Doc: Auto-update documentation
Auto-updated using release-website.sh
2026-01-09 01:56:03 +00:00
Laurent Cozic
4d81ee4c7f Chore: Exclude katex and mermaid from Renovate 2026-01-08 19:44:50 +00:00
Laurent Cozic
d9011800b2 iOS 13.5.2 2026-01-08 19:43:11 +00:00
Laurent Cozic
e64f141b28 Android 3.5.7 2026-01-08 19:42:31 +00:00
Laurent Cozic
8bba68d920 Chore: Katex build files 2026-01-08 19:42:23 +00:00
Laurent Cozic
e342f2d572 Desktop release v3.5.10 2026-01-08 19:21:20 +00:00
Henry Heino
5951a66fef Desktop, Mobile: Resolves #13753: Markdown editor: Make header styles more closely match the note viewer (#14053) 2026-01-08 09:24:00 +00:00
Henry Heino
04f9bda128 Desktop: OneNote import: Fix all imported notes have the language marked as "English" (#14054) 2026-01-08 09:23:35 +00:00
Henry Heino
7a8a94f557 Mobile: Rich Text Editor: Add shortcuts for inserting code blocks (#14055) 2026-01-08 09:22:19 +00:00
Henry Heino
ad000fb521 Desktop,Mobile: Fixes #14049: Fix ABC Sheet Music setting includes "Translation error" in description (#14058) 2026-01-08 09:21:55 +00:00
Henry Heino
435b896142 Desktop, Mobile: Accessibility: In-editor rendering: Fix rendered checkboxes are very small on mobile (#14056) 2026-01-08 09:19:56 +00:00
renovate[bot]
b12f31c802 Update dependency katex to v0.16.23 (#14018)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-07 16:43:31 +00:00
Laurent Cozic
ddb6d7a677 Desktop: Fixes #14040: Rich Text Editor: ABC sheet music options lost on edit 2026-01-07 12:14:54 +00:00
AlterWill
f0a1d05284 Chore: Fixes #13629: Fix focusHandler warning when navigating (#13973) 2026-01-07 11:56:45 +00:00
Alejandro Saucedo
27f7cb7ca6 Cli: Added keymap command to print existing keybinds in CLI and TUI (#13984)
Co-authored-by: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com>
2026-01-07 11:56:06 +00:00
Alejandro Saucedo
9e43ebcf43 Chore: Fixes #13983: Remove conflicting macos dependency for devbox (#13985) 2026-01-07 11:54:33 +00:00
Ahmed Idani
05cc0fa798 Desktop, Mobile: Fixes #13229: Insert time command not respecting locale settings (#13994) 2026-01-07 11:48:15 +00:00
Henry Heino
ee5b631d13 Desktop: Built-in plugins: Update Freehand Drawing to v4.2.0 (#14002) 2026-01-07 11:47:46 +00:00
Henry Heino
e4b6b34d37 Desktop: Built-in plugins: Update Backup to v1.5.1 (#14003) 2026-01-07 11:47:38 +00:00
Gerd Naschenweng
6f1280f0f5 Doc: Add Mailbox.org WebDAV to sync options (#14016) 2026-01-07 11:44:03 +00:00
bwat47
4c9015dab4 Desktop, Mobile: Fixes #13963: Images sometimes don't render until you click somewhere in the note (#14019) 2026-01-07 11:39:58 +00:00
Henry Heino
1adcafce9d Desktop, Mobile: Fixes #14030: Fix "Check synchronization configuration" button (#14031) 2026-01-07 11:37:35 +00:00
Henry Heino
cc9f55e115 Chore: Refactoring: Improve ObjectUtils types (#14032) 2026-01-07 11:36:43 +00:00
Henry Heino
e8b3b039df Desktop: Accessibility: Make sidebar "jump to next match" case insensitive (#14033) 2026-01-07 11:36:30 +00:00
Henry Heino
d9295a69d1 Chore: OneNote importer: Don't require IS_CONTINUOUS_INTEGRATION for a dev build (#14034) 2026-01-07 11:36:11 +00:00
Henry Heino
b92743b068 Desktop: Resolves #14004: OneNote import: Improve ID resolution (#14035) 2026-01-07 11:35:53 +00:00
Henry Heino
03f65a3fb1 Windows: Fixes #13549: Importing from OneNote: Fix badly encoded accents in notebook titles (#14037) 2026-01-07 11:35:42 +00:00
Henry Heino
32a22174f7 Desktop, Mobile: Resolves #13159: Markdown editor: Prevent layout shift when hiding/showing rendered checkboxes (#14044) 2026-01-07 11:34:51 +00:00
Henry Heino
d154ef4f5c Chore: Desktop: Fix "net::ERR_FILE_NOT_FOUND" logged to stdout when an invalid resource is requested from the note viewer (#14045) 2026-01-07 11:34:40 +00:00
Henry Heino
b8dd660c28 Desktop: OneNote import: Fix video embeds aren't imported: Import video embeds as links (#14046) 2026-01-07 11:34:31 +00:00
Henry Heino
2b20315bf5 Desktop: OneNote import: Simplify imported HTML (#14047) 2026-01-07 11:34:23 +00:00
nickprotop
93b9108832 All: Translation: Update el_GR.po (#14036) 2026-01-06 19:20:52 -05:00
renovate[bot]
0538bf0720 Update dependency @rollup/plugin-node-resolve to v16.0.2 (#14023)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-02 20:29:47 +00:00
renovate[bot]
54018c3a94 Update dependency @types/serviceworker to v0.0.157 (#14020)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-02 09:35:32 +00:00
renovate[bot]
0cb120c321 Update dependency @types/serviceworker to v0.0.156 (#14010)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-01 09:52:01 +00:00
Joplin Bot
0dab436420 Doc: Auto-update documentation
Auto-updated using release-website.sh
2026-01-01 02:03:48 +00:00
renovate[bot]
77331ca471 Update dependency @types/react to v18.3.25 (#13999)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-29 11:45:37 +00:00
krevad
d467205b91 All: Translation: Update sv.po (#13997) 2025-12-28 23:47:32 -05:00
renovate[bot]
7a2f686228 Update dependency @types/nodemailer to v6.4.20 (#13998)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-28 23:26:56 +00:00
Joplin Bot
fa37b87c98 Doc: Auto-update documentation
Auto-updated using release-website.sh
2025-12-28 02:03:41 +00:00
379 changed files with 45440 additions and 31239 deletions

View File

@@ -115,6 +115,7 @@ packages/app-cli/app/command-export.js
packages/app-cli/app/command-geoloc.js
packages/app-cli/app/command-help.js
packages/app-cli/app/command-import.js
packages/app-cli/app/command-keymap.js
packages/app-cli/app/command-ls.js
packages/app-cli/app/command-mkbook.test.js
packages/app-cli/app/command-mkbook.js
@@ -610,6 +611,7 @@ packages/app-desktop/tools/copy7Zip.js
packages/app-desktop/tools/generateLatestArm64Yml.js
packages/app-desktop/tools/githubReleasesUtils.js
packages/app-desktop/tools/modifyReleaseAssets.js
packages/app-desktop/tools/notarizeFile.js
packages/app-desktop/tools/notarizeMacApp.js
packages/app-desktop/tools/resolveSourceMap.js
packages/app-desktop/utils/7zip/getPathToExecutable7Zip.js
@@ -1060,6 +1062,8 @@ packages/editor/CodeMirror/extensions/rendering/replaceBulletLists.js
packages/editor/CodeMirror/extensions/rendering/replaceCheckboxes.js
packages/editor/CodeMirror/extensions/rendering/replaceDividers.js
packages/editor/CodeMirror/extensions/rendering/replaceFormatCharacters.js
packages/editor/CodeMirror/extensions/rendering/replaceInlineHtml.test.js
packages/editor/CodeMirror/extensions/rendering/replaceInlineHtml.js
packages/editor/CodeMirror/extensions/rendering/types.js
packages/editor/CodeMirror/extensions/rendering/utils/makeBlockReplaceExtension.js
packages/editor/CodeMirror/extensions/rendering/utils/makeInlineReplaceExtension.js
@@ -1100,6 +1104,7 @@ packages/editor/CodeMirror/utils/getSearchState.js
packages/editor/CodeMirror/utils/growSelectionToNode.js
packages/editor/CodeMirror/utils/handleLinkEditRequests.js
packages/editor/CodeMirror/utils/handlePasteEvent.js
packages/editor/CodeMirror/utils/htmlNodeInfo.js
packages/editor/CodeMirror/utils/isCursorAtBeginning.js
packages/editor/CodeMirror/utils/isInSyntaxNode.js
packages/editor/CodeMirror/utils/markdown/codeBlockLanguages/allLanguages.js
@@ -1227,6 +1232,7 @@ packages/lib/InMemoryCache.js
packages/lib/JoplinDatabase.js
packages/lib/JoplinError.js
packages/lib/JoplinServerApi.js
packages/lib/ObjectUtils.test.js
packages/lib/ObjectUtils.js
packages/lib/PerformanceLogger.test.js
packages/lib/PerformanceLogger.js
@@ -1803,6 +1809,7 @@ packages/renderer/MdToHtml/renderMedia.js
packages/renderer/MdToHtml/rules/abc.js
packages/renderer/MdToHtml/rules/checkbox.js
packages/renderer/MdToHtml/rules/code_inline.js
packages/renderer/MdToHtml/rules/externalEmbed.js
packages/renderer/MdToHtml/rules/fence.js
packages/renderer/MdToHtml/rules/fountain.js
packages/renderer/MdToHtml/rules/highlight_keywords.js
@@ -1838,17 +1845,19 @@ packages/tools/checkIgnoredFiles.js
packages/tools/checkLibPaths.test.js
packages/tools/checkLibPaths.js
packages/tools/convertThemesToCss.js
packages/tools/fuzzer/ActionRunner.js
packages/tools/fuzzer/ActionTracker.js
packages/tools/fuzzer/Client.js
packages/tools/fuzzer/ClientPool.js
packages/tools/fuzzer/Server.js
packages/tools/fuzzer/constants.js
packages/tools/fuzzer/doRandomAction.js
packages/tools/fuzzer/model/FolderRecord.js
packages/tools/fuzzer/sync-fuzzer.js
packages/tools/fuzzer/types.js
packages/tools/fuzzer/utils/ProgressBar.js
packages/tools/fuzzer/utils/SeededRandom.js
packages/tools/fuzzer/utils/diffSortedStringArrays.test.js
packages/tools/fuzzer/utils/diffSortedStringArrays.js
packages/tools/fuzzer/utils/getNumberProperty.js
packages/tools/fuzzer/utils/getProperty.js
packages/tools/fuzzer/utils/getStringProperty.js

View File

@@ -46,8 +46,11 @@ jobs:
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.APPLE_CSC_LINK }}
CSC_INSTALLER_KEY_PASSWORD: ${{ secrets.CSC_INSTALLER_KEY_PASSWORD }}
CSC_INSTALLER_LINK: ${{ secrets.CSC_INSTALLER_LINK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
IS_CONTINUOUS_INTEGRATION: 1
BUILD_SEQUENCIAL: 1
PUBLISH_ENABLED: ${{ env.PUBLISH_ENABLED }}
@@ -57,25 +60,71 @@ jobs:
yarn install
cd packages/app-desktop
npm pkg set 'build.mac.artifactName'='${productName}-${version}-${arch}.${ext}'
npm pkg delete 'build.mac.target'
npm pkg set 'build.mac.target[0].target'='dmg'
npm pkg set 'build.mac.target[0].arch[0]'='arm64'
npm pkg set 'build.mac.target[1].target'='zip'
npm pkg set 'build.mac.target[1].arch[0]'='arm64'
if [[ "$PUBLISH_ENABLED" == "true" ]]; then
echo "Building and publishing desktop application..."
PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64
# Only enable pkg build in the main repository CI. As of 01/15/2026, pkg
# build fails when running on external pull requests.
if [[ "$GITHUB_EVENT_NAME" != "pull_request" ]]; then
npm pkg set 'build.mac.target[2].target'='pkg'
npm pkg set 'build.mac.target[2].arch[0]'='arm64'
fi
yarn modifyReleaseAssets --repo="$GH_REPO" --tag="$GIT_TAG_NAME" --token="$GITHUB_TOKEN"
else
echo "Building but *not* publishing desktop application..."
# We also want to disable signing the app in this case, because
# it doesn't work and we don't need it.
# https://www.electron.build/code-signing#how-to-disable-code-signing-during-the-build-process-on-macos
export CSC_IDENTITY_AUTO_DISCOVERY=false
npm pkg set 'build.mac.identity'=null --json
PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64 --publish=never
fi
curl -L -o installer.p12 "$CSC_INSTALLER_LINK"
# Create an explicit keychain file path (avoid temp dirs / weird defaults)
KEYCHAIN="$RUNNER_TEMP/build.keychain-db"
KEYCHAIN_PW=""
security create-keychain -p "$KEYCHAIN_PW" "$KEYCHAIN"
security set-keychain-settings -lut 21600 "$KEYCHAIN"
security unlock-keychain -p "$KEYCHAIN_PW" "$KEYCHAIN"
# Make sure this keychain is the one security uses
security list-keychains -d user -s "$KEYCHAIN"
security default-keychain -d user -s "$KEYCHAIN"
# Import with -A to avoid access-control prompts in CI
security import installer.p12 \
-k "$KEYCHAIN" \
-P "$CSC_INSTALLER_KEY_PASSWORD" \
-A
# Sanity: confirm identity is now present
security find-identity -p codesigning -v "$KEYCHAIN"
build_dist() {
if [[ "$PUBLISH_ENABLED" == "true" ]]; then
echo "Building and publishing desktop application..."
PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64
yarn modifyReleaseAssets --repo="$GH_REPO" --tag="$GIT_TAG_NAME" --token="$GITHUB_TOKEN"
else
echo "Building but *not* publishing desktop application..."
# We also want to disable signing the app in this case, because
# it doesn't work and we don't need it.
# https://www.electron.build/code-signing#how-to-disable-code-signing-during-the-build-process-on-macos
export CSC_IDENTITY_AUTO_DISCOVERY=false
npm pkg set 'build.mac.identity'=null --json
PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64 --publish=never
fi
}
build_dist || build_dist

View File

@@ -75,6 +75,8 @@ jobs:
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.APPLE_CSC_LINK }}
CSC_INSTALLER_KEY_PASSWORD: ${{ secrets.CSC_INSTALLER_KEY_PASSWORD }}
CSC_INSTALLER_LINK: ${{ secrets.CSC_INSTALLER_LINK }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
IS_CONTINUOUS_INTEGRATION: 1
BUILD_SEQUENCIAL: 1

12
.gitignore vendored
View File

@@ -53,6 +53,7 @@ lerna-debug.log
docs/**/*.mustache
.idea
/readme/i18n
.watchman-cookie-*
# Yarn stuff
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
@@ -88,6 +89,7 @@ packages/app-cli/app/command-export.js
packages/app-cli/app/command-geoloc.js
packages/app-cli/app/command-help.js
packages/app-cli/app/command-import.js
packages/app-cli/app/command-keymap.js
packages/app-cli/app/command-ls.js
packages/app-cli/app/command-mkbook.test.js
packages/app-cli/app/command-mkbook.js
@@ -583,6 +585,7 @@ packages/app-desktop/tools/copy7Zip.js
packages/app-desktop/tools/generateLatestArm64Yml.js
packages/app-desktop/tools/githubReleasesUtils.js
packages/app-desktop/tools/modifyReleaseAssets.js
packages/app-desktop/tools/notarizeFile.js
packages/app-desktop/tools/notarizeMacApp.js
packages/app-desktop/tools/resolveSourceMap.js
packages/app-desktop/utils/7zip/getPathToExecutable7Zip.js
@@ -1033,6 +1036,8 @@ packages/editor/CodeMirror/extensions/rendering/replaceBulletLists.js
packages/editor/CodeMirror/extensions/rendering/replaceCheckboxes.js
packages/editor/CodeMirror/extensions/rendering/replaceDividers.js
packages/editor/CodeMirror/extensions/rendering/replaceFormatCharacters.js
packages/editor/CodeMirror/extensions/rendering/replaceInlineHtml.test.js
packages/editor/CodeMirror/extensions/rendering/replaceInlineHtml.js
packages/editor/CodeMirror/extensions/rendering/types.js
packages/editor/CodeMirror/extensions/rendering/utils/makeBlockReplaceExtension.js
packages/editor/CodeMirror/extensions/rendering/utils/makeInlineReplaceExtension.js
@@ -1073,6 +1078,7 @@ packages/editor/CodeMirror/utils/getSearchState.js
packages/editor/CodeMirror/utils/growSelectionToNode.js
packages/editor/CodeMirror/utils/handleLinkEditRequests.js
packages/editor/CodeMirror/utils/handlePasteEvent.js
packages/editor/CodeMirror/utils/htmlNodeInfo.js
packages/editor/CodeMirror/utils/isCursorAtBeginning.js
packages/editor/CodeMirror/utils/isInSyntaxNode.js
packages/editor/CodeMirror/utils/markdown/codeBlockLanguages/allLanguages.js
@@ -1200,6 +1206,7 @@ packages/lib/InMemoryCache.js
packages/lib/JoplinDatabase.js
packages/lib/JoplinError.js
packages/lib/JoplinServerApi.js
packages/lib/ObjectUtils.test.js
packages/lib/ObjectUtils.js
packages/lib/PerformanceLogger.test.js
packages/lib/PerformanceLogger.js
@@ -1776,6 +1783,7 @@ packages/renderer/MdToHtml/renderMedia.js
packages/renderer/MdToHtml/rules/abc.js
packages/renderer/MdToHtml/rules/checkbox.js
packages/renderer/MdToHtml/rules/code_inline.js
packages/renderer/MdToHtml/rules/externalEmbed.js
packages/renderer/MdToHtml/rules/fence.js
packages/renderer/MdToHtml/rules/fountain.js
packages/renderer/MdToHtml/rules/highlight_keywords.js
@@ -1811,17 +1819,19 @@ packages/tools/checkIgnoredFiles.js
packages/tools/checkLibPaths.test.js
packages/tools/checkLibPaths.js
packages/tools/convertThemesToCss.js
packages/tools/fuzzer/ActionRunner.js
packages/tools/fuzzer/ActionTracker.js
packages/tools/fuzzer/Client.js
packages/tools/fuzzer/ClientPool.js
packages/tools/fuzzer/Server.js
packages/tools/fuzzer/constants.js
packages/tools/fuzzer/doRandomAction.js
packages/tools/fuzzer/model/FolderRecord.js
packages/tools/fuzzer/sync-fuzzer.js
packages/tools/fuzzer/types.js
packages/tools/fuzzer/utils/ProgressBar.js
packages/tools/fuzzer/utils/SeededRandom.js
packages/tools/fuzzer/utils/diffSortedStringArrays.test.js
packages/tools/fuzzer/utils/diffSortedStringArrays.js
packages/tools/fuzzer/utils/getNumberProperty.js
packages/tools/fuzzer/utils/getProperty.js
packages/tools/fuzzer/utils/getStringProperty.js

View File

@@ -0,0 +1,21 @@
# Add a minSdkVersion to prevent the dangerous READ_PHONE_STATE
# permission from being added.
# See:
# - Upstream issue report: https://github.com/oblador/react-native-vector-icons/issues/1861
# - About the permission: https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE
# - StackOverflow post with discussion and alternate workarounds: https://stackoverflow.com/questions/39668549/why-has-the-read-phone-state-permission-been-added
diff --git a/android/build.gradle b/android/build.gradle
index a16b4ad6d1871cf5cf73ef7ebeaf8bd4d662b134..9871afb5fbf8e687370e08f54d884ecd7dde7e7c 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -37,6 +37,10 @@ android {
}
compileSdkVersion safeExtGet('compileSdkVersion', 31)
+
+ defaultConfig {
+ minSdkVersion safeExtGet('minSdkVersion', 24)
+ }
}
dependencies {

View File

@@ -0,0 +1,21 @@
# Add a minSdkVersion to prevent the dangerous READ_PHONE_STATE
# permission from being added.
# See:
# - Upstream issue report: https://github.com/oblador/react-native-vector-icons/issues/1861
# - About the permission: https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE
# - StackOverflow post with discussion and alternate workarounds: https://stackoverflow.com/questions/39668549/why-has-the-read-phone-state-permission-been-added
diff --git a/android/build.gradle b/android/build.gradle
index d42bd23123644cc324051e9c7ec4635de286315a..640996df60fe7769f69b30b35f771eb9cf0b75d4 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -37,6 +37,10 @@ android {
}
compileSdkVersion safeExtGet('compileSdkVersion', 31)
+
+ defaultConfig {
+ minSdkVersion safeExtGet('minSdkVersion', 24)
+ }
}
dependencies {

View File

@@ -0,0 +1,21 @@
# Add a minSdkVersion to prevent the dangerous READ_PHONE_STATE
# permission from being added.
# See:
# - Upstream issue report: https://github.com/oblador/react-native-vector-icons/issues/1861
# - About the permission: https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE
# - StackOverflow post with discussion and alternate workarounds: https://stackoverflow.com/questions/39668549/why-has-the-read-phone-state-permission-been-added
diff --git a/android/build.gradle b/android/build.gradle
index 170ec0ff9befe0f9155aaf5e1b84133cfd87be99..e6a0ab4a019ee67c5af7761ae8bb35f18b05c590 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -37,6 +37,10 @@ android {
}
compileSdkVersion safeExtGet('compileSdkVersion', 31)
+
+ defaultConfig {
+ minSdkVersion safeExtGet('minSdkVersion', 24)
+ }
}
dependencies {

View File

@@ -0,0 +1,21 @@
# Add a minSdkVersion to prevent the dangerous READ_PHONE_STATE
# permission from being added.
# See:
# - Upstream issue report: https://github.com/oblador/react-native-vector-icons/issues/1861
# - About the permission: https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE
# - StackOverflow post with discussion and alternate workarounds: https://stackoverflow.com/questions/39668549/why-has-the-read-phone-state-permission-been-added
diff --git a/android/build.gradle b/android/build.gradle
index 3b22f9de66795ee01dbaa29655727ee7ddba3cc8..325daa88d33f066b3826e5031ce281793710af2d 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -37,6 +37,10 @@ android {
}
compileSdkVersion safeExtGet('compileSdkVersion', 31)
+
+ defaultConfig {
+ minSdkVersion safeExtGet('minSdkVersion', 24)
+ }
}
dependencies {

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View File

@@ -1,4 +1,47 @@
<?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, 22 Sep 2025 00:00:00 GMT</lastBuildDate><atom:link href="https://joplinapp.org/rss.xml" rel="self" type="application/rss+xml"/><pubDate>Mon, 22 Sep 2025 00:00:00 GMT</pubDate><item><title><![CDATA[What's new in Joplin 3.4]]></title><description><![CDATA[<p>Joplin 3.4 includes many bug fixes and improvements, with a focus on the mobile app.</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>Sun, 11 Jan 2026 00:00:00 GMT</lastBuildDate><atom:link href="https://joplinapp.org/rss.xml" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Jan 2026 00:00:00 GMT</pubDate><item><title><![CDATA[What's new in Joplin 3.5]]></title><description><![CDATA[<h2>Improvements across desktop and mobile<a name="improvements-across-desktop-and-mobile" href="#improvements-across-desktop-and-mobile" class="heading-anchor">🔗</a></h2>
<h3>More stable and consistent Markdown editing<a name="more-stable-and-consistent-markdown-editing" href="#more-stable-and-consistent-markdown-editing" class="heading-anchor">🔗</a></h3>
<p>The Markdown editor has been refined to feel more stable and closer to the final rendered view. Headings in the editor now more closely match how they appear when viewing a note, reducing the visual jump between editing and reading. Layout issues have also been addressed so elements like rendered checkboxes and images no longer cause the editor to shift unexpectedly while typing.</p>
<p>The ABC music notation plugin appeared to be popular but had some limitations. With this new version, ABC is now part of the app, which means it can now work from published notes, and from the Rich Text editor!</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20260111-abc.png" alt="ABC music notation rendered directly in Joplin, showing a short musical phrase displayed from plain-text ABC syntax"></p>
<h3>Smoother switching between notes<a name="smoother-switching-between-notes" href="#smoother-switching-between-notes" class="heading-anchor">🔗</a></h3>
<p>Switching between notes is now less disruptive. Joplin restores cursor position and scroll location more reliably, making it easier to move back and forth between notes—especially when working with longer documents or comparing content—without losing your place.</p>
<h3>Case insensitive tags<a name="case-insensitive-tags" href="#case-insensitive-tags" class="heading-anchor">🔗</a></h3>
<p>Tags are now treated in a case-insensitive way, which helps prevent duplicate tags caused by differences in capitalisation, while still allowing mixed-case tag names. All this time we were hoping that @dpoulton <a href="https://discourse.joplinapp.org/t/tags-lower-case-only/4220/106">would just get used to lowercase tags</a>, but 5 years later it looks like it's not happening ;) So thank you @mrjo118 for implementing it!</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20260111-lowercase-tags.png" alt="Joplin tag list demonstrating case-insensitive tags, with mixed-case tag names merged into a single tag."></p>
<h3>More reliable syncing and sharing<a name="more-reliable-syncing-and-sharing" href="#more-reliable-syncing-and-sharing" class="heading-anchor">🔗</a></h3>
<p>Syncing and sharing have been made more robust in everyday use. Joplin now handles repeated syncs more efficiently, avoids unnecessary data usage, and is better at detecting and syncing all changes, particularly when using WebDAV and S3 sync targets.</p>
<p>Moreover filesystem synchronisation is now more reliable, in particular when used alongside tools like SyncThing on both mobile and desktop.</p>
<h3>Accessibility and readability improvements<a name="accessibility-and-readability-improvements" href="#accessibility-and-readability-improvements" class="heading-anchor">🔗</a></h3>
<p>Accessibility has seen further refinements in this release. Dark mode readability has been improved, common editor elements are clearer, and animations are reduced or disabled when system “reduce motion” settings are enabled, making the app more comfortable to use for a wider range of users. Keyboard navigation has also been improved on the desktop application.</p>
<h2>Desktop-specific improvements<a name="desktop-specific-improvements" href="#desktop-specific-improvements" class="heading-anchor">🔗</a></h2>
<h3>Easier profile management<a name="easier-profile-management" href="#easier-profile-management" class="heading-anchor">🔗</a></h3>
<p>Managing multiple profiles on desktop is now simpler thanks to a new, more user-friendly profile management interface. This removes the need to manually edit configuration files and makes switching between different setups easier and safer.</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20260111-profiles.png" alt="Desktop profile management screen in Joplin showing multiple profiles with options to rename or delete them."></p>
<h3>Significantly improved OneNote import<a name="significantly-improved-onenote-import" href="#significantly-improved-onenote-import" class="heading-anchor">🔗</a></h3>
<p>Importing content from OneNote is now more reliable and accurate. Support has been expanded to cover more OneNote file formats, and many edge cases have been addressed so imported notes more closely match their original structure and content. This makes migrating from OneNote to Joplin smoother and more trustworthy.</p>
<h3>Better tools for organising large note collections<a name="better-tools-for-organising-large-note-collections" href="#better-tools-for-organising-large-note-collections" class="heading-anchor">🔗</a></h3>
<p>Desktop users can now select multiple notebooks at once, making it easier to reorganise notebook structures, move groups of notes, or clean up larger collections without working notebook by notebook.</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20260111-multi-select.png" alt="Joplin desktop sidebar with several notebooks selected at the same time for bulk organisation."></p>
<h3>Polished editing experience on desktop<a name="polished-editing-experience-on-desktop" href="#polished-editing-experience-on-desktop" class="heading-anchor">🔗</a></h3>
<p>Both the Markdown and Rich Text editors have been further refined. Cursor behaviour is more predictable, visual consistency between editing and viewing has improved, and several layout and rendering issues have been fixed to reduce interruptions while writing.</p>
<h3>More reliable search and navigation<a name="more-reliable-search-and-navigation" href="#more-reliable-search-and-navigation" class="heading-anchor">🔗</a></h3>
<p>Search and navigation on desktop have been improved with fixes that ensure search results behave consistently and remain visible when moving between windows or views.</p>
<h3>Improved math support in WebClipper<a name="improved-math-support-in-webclipper" href="#improved-math-support-in-webclipper" class="heading-anchor">🔗</a></h3>
<p>The WebClipper is not forgotten in this release - clipping certain math formulas, in particular from Wikipedia but also other websites, has been improved. Additionally, certain scientific articles are now also better handled by the WebClipper.</p>
<h2>Mobile-specific improvements<a name="mobile-specific-improvements" href="#mobile-specific-improvements" class="heading-anchor">🔗</a></h2>
<h3>A more powerful Rich Text Editor on mobile<a name="a-more-powerful-rich-text-editor-on-mobile" href="#a-more-powerful-rich-text-editor-on-mobile" class="heading-anchor">🔗</a></h3>
<p>The mobile Rich Text Editor continues to improve, with new and expanded support for tables, code blocks, and other structured content. These changes make it easier to create and edit more complex notes directly on mobile devices.</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20260111-rte1.png" alt="Joplin mobile Rich Text Editor showing table editing controls and an embedded code block inside a note."></p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20260111-rte2.png" alt="Mobile code block editor in Joplin with a Python code snippet displayed in an editable dialog."></p>
<h3>Easier tag management on mobile<a name="easier-tag-management-on-mobile" href="#easier-tag-management-on-mobile" class="heading-anchor">🔗</a></h3>
<p>Managing tags on mobile is now more practical. You can rename and delete tags directly from the app, and searching through tags is easier, helping keep large tag lists organised over time.</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20260111-mobile-tags.png" alt="Joplin mobile tag management screen showing a tag options menu with rename and delete actions."></p>
<h3>Improved stability and usability on mobile devices<a name="improved-stability-and-usability-on-mobile-devices" href="#improved-stability-and-usability-on-mobile-devices" class="heading-anchor">🔗</a></h3>
<p>Several fixes improve overall stability and usability on mobile, particularly on smaller screens. Issues causing UI elements to appear off-screen have been addressed, and the app behaves more consistently in situations that previously caused hangs or visual glitches.</p>
<h2>Bug fixes and security fixes across platforms<a name="bug-fixes-and-security-fixes-across-platforms" href="#bug-fixes-and-security-fixes-across-platforms" class="heading-anchor">🔗</a></h2>
<h3>A large number of stability, correctness and security fixes<a name="a-large-number-of-stability-correctness-and-security-fixes" href="#a-large-number-of-stability-correctness-and-security-fixes" class="heading-anchor">🔗</a></h3>
<p>Joplin 3.5 includes about 114 bug fixes across desktop and mobile, addressing issues in editing, syncing, importing, rendering, and general stability. Many fixes target edge cases that could lead to crashes, inconsistent behaviour, or rare data loss scenarios. Moreover, this version includes several vulnerability fixes to make the applications more secure.</p>
]]></description><link>https://joplinapp.org/news/20260111-release-3-5</link><guid isPermaLink="false">20260111-release-3-5</guid><pubDate>Sun, 11 Jan 2026 00:00:00 GMT</pubDate><twitter-text></twitter-text></item><item><title><![CDATA[What's new in Joplin 3.4]]></title><description><![CDATA[<p>Joplin 3.4 includes many bug fixes and improvements, with a focus on the mobile app.</p>
<h2>Mobile<a name="mobile" href="#mobile" class="heading-anchor">🔗</a></h2>
<h3>Rich Text Editor<a name="rich-text-editor" href="#rich-text-editor" class="heading-anchor">🔗</a></h3>
<p>The mobile app now includes a beta <a href="https://joplinapp.org/help/apps/rich_text_editor">Rich Text Editor</a>! The new editor renders formatting/math/images within the editor:</p>
@@ -481,42 +524,4 @@ sys 0m38.013s</p>
<p>This is a bit of an extra constraint but it is hard to avoid. Contributor License Agreements are very common for GPL or AGPL projects. For example Apache, Canonical or Python all require their contributors to sign a CLA.</p>
<h2>Questions?<a name="questions" href="#questions" class="heading-anchor">🔗</a></h2>
<p>If you have any questions please let us know. Overall we believe this is a positive improvements for Joplin as it means any work derives from it will also benefit the project.</p>
]]></description><link>https://joplinapp.org/news/20221221-agpl</link><guid isPermaLink="false">20221221-agpl</guid><pubDate>Wed, 21 Dec 2022 00:00:00 GMT</pubDate><twitter-text>Joplin is switching to the GNU Affero General Public License v3 (AGPL-3.0)</twitter-text></item><item><title><![CDATA[What's new in Joplin 2.9]]></title><description><![CDATA[<h2>Proxy support<a name="proxy-support" href="#proxy-support" class="heading-anchor">🔗</a></h2>
<p>Both the desktop and mobile application now support proxies thanks to the work of Jason Williams. This will allow you to use the apps in particular when you are behind a company proxy.</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20221216-proxy-support.png" alt=""></p>
<h2>New PDF viewer<a name="new-pdf-viewer" href="#new-pdf-viewer" class="heading-anchor">🔗</a></h2>
<p>The desktop application now features a new PDF viewer thanks to the work of Asrient during GSoC.</p>
<p>The main advantage for now is that this viewer preserves the last PDF page that was read. In the next version, the viewer will also include a way to annotate PDF files.</p>
<h2>Multi-language spell checking<a name="multi-language-spell-checking" href="#multi-language-spell-checking" class="heading-anchor">🔗</a></h2>
<p>The desktop app include a multi-language spell checking features, which allows you, for example, to spell-check notes in your native language and in English.</p>
<h2>New mobile text editor<a name="new-mobile-text-editor" href="#new-mobile-text-editor" class="heading-anchor">🔗</a></h2>
<p>Writing formatted notes on mobile has always been cumbersome due to the need to enter special format characters like <code>*</code> or <code>[</code>, etc.</p>
<p>Thanks to the work of Henry Heino during GSoC, writing notes on the go is now easier thanks to an improved Markdown editor.</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20221216-mobile-beta-editor.png" alt=""></p>
<p>The most visible feature is the addition of a toolbar, which helps input those special characters, like on desktop.</p>
<p>Moreover Henry made a lot of subtle but useful improvements to the editor, for example to improve the note appearance, to improve list continuation, etc. Search within a note is now also supported as well as spell-checking.</p>
<p>At a more technical level, Henry also added many test units to ensure that the editor remains robust and reliable.</p>
<p>To enable the feature, go to the configuration screen and selected &quot;Opt-in to the editor beta&quot;. It is already very stable so we will probably promote it to be the main editor from the next version.</p>
<h2>Improved alignment of notebook icons<a name="improved-alignment-of-notebook-icons" href="#improved-alignment-of-notebook-icons" class="heading-anchor">🔗</a></h2>
<p>Previously, when you would assign an icon to a notebook, it would shift the title to the right, but notebook without an icon would not. It means that notebooks with and without an icon would not be vertically aligned.</p>
<p>To tidy things up, this new version adds a default icons to notebooks without an explicitly assigned icon. This result in the notebook titles being correctly vertically aligned.</p>
<p>Note that this feature is only enabled if you use custom icons - otherwise it will simply display the notebook titles without any default icons, as before.</p>
<p><img src="https://raw.githubusercontent.com/laurent22/joplin/dev/Assets/WebsiteAssets/images/news/20221216-notebook-icons.png" alt=""></p>
<h2>Improved handling of file attachments<a name="improved-handling-of-file-attachments" href="#improved-handling-of-file-attachments" class="heading-anchor">🔗</a></h2>
<p>Self Not Found made a number of small but useful improvements to attachment handling, including increasing the maximum size to 200MB, adding support for attaching multiple files, and fixing issues with synchronising attachments via proxy.</p>
<h2>Fixed filesystem sync on mobile<a name="fixed-filesystem-sync-on-mobile" href="#fixed-filesystem-sync-on-mobile" class="heading-anchor">🔗</a></h2>
<p>This was a long and complex change due to the need to support new Android APIs but hopefully that should now be working again, thanks to the work of jd1378.</p>
<p>So you can now sync again your notes with Syncthing and other file-based synchronisation systems.</p>
<h2>And more...<a name="and-more" href="#and-more" class="heading-anchor">🔗</a></h2>
<p>In total this new desktop version includes 36 improvements, bug fixes, and security fixes.</p>
<p>As always, a lot of work went into the Android and iOS app too, which include 37 improvements, bug fixes, and security fixes.</p>
<p>See here for the changelogs:</p>
<ul>
<li><a href="https://joplinapp.org/help/about/changelog/desktop">Desktop app changelog</a></li>
<li><a href="https://joplinapp.org/help/about/changelog/android/">Android app changelog</a></li>
</ul>
<h2>About the Android version<a name="about-the-android-version" href="#about-the-android-version" class="heading-anchor">🔗</a></h2>
<p>Unfortunately we cannot publish the Android version because it is based on a framework version that Google does not accept. To upgrade the app a lot of changes are needed and another round of pre-releases, and therefore there will not be a 2.9 version for Google Play. You may however download the official APK directly from there: <a href="https://github.com/laurent22/joplin-android/releases/tag/android-v2.9.8">Android 2.9 Official Release</a></p>
<p>This is the reality of app stores in general - small developers being imposed never ending new requirements by all-powerful companies, and by the time a version is finally ready we can't even publish it because yet more requirements are in place.</p>
<p>For the record the current 2.9 app works perfectly fine. It targets Android 11, which is only 2 years old and is still supported (and installed on millions of phones). Google requires us to target Android 12 which only came out last year.</p>
]]></description><link>https://joplinapp.org/news/20221216-release-2-9</link><guid isPermaLink="false">20221216-release-2-9</guid><pubDate>Fri, 16 Dec 2022 00:00:00 GMT</pubDate><twitter-text>What&apos;s new in Joplin 2.9</twitter-text></item></channel></rss>
]]></description><link>https://joplinapp.org/news/20221221-agpl</link><guid isPermaLink="false">20221221-agpl</guid><pubDate>Wed, 21 Dec 2022 00:00:00 GMT</pubDate><twitter-text>Joplin is switching to the GNU Affero General Public License v3 (AGPL-3.0)</twitter-text></item></channel></rss>

View File

@@ -11,11 +11,6 @@
},
"nodejs": "24.5.0",
"pkg-config": "latest",
"darwin.apple_sdk.frameworks.Foundation": { // satisfies missing CoreText/CoreText.h
// https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/darwin/apple-sdk/default.nix
"version": "",
"platforms": ["aarch64-darwin", "x86_64-darwin"],
},
"python": "3.13.3",
"bat": "latest",
"electron": {

6
jest.config.base.js Normal file
View File

@@ -0,0 +1,6 @@
// This is the base Jest configuration - all
// jest.config.js files should inherit from it.
module.exports = {
watchman: false,
};

View File

@@ -16,6 +16,7 @@
"./packages/app-cli/**/*.mo": true,
"./packages/app-cli/**/build/": true,
"./packages/app-cli/**/config.json": true,
"**/.watchman-cookie-*": true,
"./packages/app-cli/**/linkToLocal.sh": true,
"./packages/app-cli/**/node_modules/": true,
"./packages/app-cli/**/out.txt": true,

View File

@@ -88,7 +88,7 @@
"lerna": "3.22.1",
"lint-staged": "16.1.6",
"madge": "8.0.0",
"npm-package-json-lint": "8.0.0",
"npm-package-json-lint": "9.0.0",
"typescript": "5.8.3"
},
"dependencies": {

View File

@@ -0,0 +1,49 @@
import BaseCommand from './base-command';
import app from './app';
import { _ } from '@joplin/lib/locale';
const { cliUtils } = require('./cli-utils.js');
interface Args { }
class Command extends BaseCommand {
public override usage() {
return 'keymap';
}
public override description() {
return _('Displays the configured keyboard shortcuts.');
}
public override compatibleUis() {
return ['cli', 'gui'];
}
public override async action(_args: Args) {
const keymaps = await app().loadKeymaps();
this.stdout(_('Configured keyboard shortcuts:'));
this.stdout('\n');
const rows = [];
const padding = ' ';
rows.push([`${padding}${_('KEYS')}`, _('TYPE'), _('COMMAND')]);
rows.push([`${padding}----`, '----', '-------']);
for (const item of keymaps) {
const formattedKeys = item.keys
.map((k: string) => (k === ' ' ? `(${_('SPACE')})` : k))
.join(', ');
rows.push([padding + formattedKeys, item.type, item.command]);
}
cliUtils.printArray(this.stdout.bind(this), rows);
if (app().gui() && !app().gui().isDummy()) {
app().gui().showConsole();
app().gui().maximizeConsole();
}
}
}
module.exports = Command;

View File

@@ -24,7 +24,10 @@
// 4. Remove tests one by one to narrow it down to the one with the async
// call that's causing problem.
const baseConfig = require('../../jest.config.base.js');
module.exports = {
...baseConfig,
testMatch: [
'**/tests/HtmlToHtml.js',
'**/tests/HtmlToMd.js',

View File

@@ -35,15 +35,15 @@
],
"owner": "Laurent Cozic"
},
"version": "3.5.1",
"version": "3.6.0",
"bin": "./main.js",
"engines": {
"node": ">=10.0.0"
},
"dependencies": {
"@joplin/lib": "~3.5",
"@joplin/renderer": "~3.5",
"@joplin/utils": "~3.5",
"@joplin/lib": "~3.6",
"@joplin/renderer": "~3.6",
"@joplin/utils": "~3.6",
"aws-sdk": "2.1340.0",
"chalk": "4.1.2",
"compare-version": "0.1.2",
@@ -70,7 +70,7 @@
"yargs-parser": "21.1.1"
},
"devDependencies": {
"@joplin/tools": "~3.5",
"@joplin/tools": "~3.6",
"@types/fs-extra": "11.0.4",
"@types/jest": "29.5.14",
"@types/node": "18.19.130",

View File

@@ -0,0 +1,10 @@
<div class="joplin-editable joplin-abc-notation">
<pre class="joplin-source" data-abc-options="{&quot;responsive&quot;:&quot;resize&quot;}" data-joplin-language="abc" data-joplin-source-open="```abc&#10;" data-joplin-source-close="&#10;```&#10;">{responsive:'resize'}
---
K:F
!f!(fgag-g2c2)|</pre>
<pre class="joplin-rendered joplin-abc-notation-rendered">K:F
!f!(fgag-g2c2)|</pre>
</div>

View File

@@ -0,0 +1,6 @@
```abc
{ responsive: 'resize' }
---
K:F
!f!(fgag-g2c2)|
```

View File

@@ -0,0 +1,8 @@
<div class="joplin-editable">
<span class="joplin-source" data-joplin-source-open="" data-joplin-source-close="">https://www.youtube.com/watch?v=iJqe9pC-z-Y</span>
<div class="joplin-youtube-player-rendered">
<iframe src="https://www.youtube-nocookie.com/embed/iJqe9pC-z-Y" title="YouTube video player" frameborder="0" allowfullscreen></iframe>
</div>
</div>

View File

@@ -0,0 +1 @@
https://www.youtube.com/watch?v=iJqe9pC-z-Y

Binary file not shown.

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Joplin Web Clipper [DEV]",
"version": "3.5.0",
"version": "3.6.0",
"description": "Capture and save web pages and screenshots from your browser to Joplin.",
"homepage_url": "https://joplinapp.org",
"content_security_policy": {

View File

@@ -260,6 +260,15 @@ export default class ElectronAppWrapper {
require('@electron/remote/main').enable(this.win_.webContents);
// Add Referer header for YouTube embeds to fix Error 153
this.win_.webContents.session.webRequest.onBeforeSendHeaders(
{ urls: ['*://*.youtube.com/*', '*://*.youtube-nocookie.com/*'] },
(details, callback) => {
details.requestHeaders['Referer'] = 'https://joplinapp.org/';
callback({ requestHeaders: details.requestHeaders });
},
);
if (!screen.getDisplayMatching(this.win_.getBounds())) {
const { width: windowWidth, height: windowHeight } = this.win_.getBounds();
const { width: primaryDisplayWidth, height: primaryDisplayHeight } = screen.getPrimaryDisplay().workArea;

View File

@@ -95,6 +95,9 @@ export default class InteropServiceHelper {
// Allows users to override the CSS page size.
// See https://github.com/laurent22/joplin/issues/13096
preferCSSPageSize: true,
// Include accessibility information in the output:
generateTaggedPDF: true,
});
resolve(data);
} catch (error) {

View File

@@ -2,6 +2,7 @@ const fs = require('fs');
const path = require('path');
const os = require('os');
const sha512 = require('js-sha512');
const notarizeFile = require('./tools/notarizeFile').default;
const distDirName = 'dist';
const distPath = path.join(__dirname, distDirName);
@@ -31,7 +32,24 @@ const generateChecksumFile = () => {
return sha512FilePath;
};
const mainHook = () => {
const notarizePkg = async () => {
if (os.platform() !== 'darwin') {
return;
}
const files = fs.readdirSync(distPath);
for (const filename of files) {
if (filename.endsWith('.pkg')) {
const pkgPath = path.join(distPath, filename);
await notarizeFile(pkgPath);
return;
}
}
};
const mainHook = async () => {
await notarizePkg();
const sha512FilePath = generateChecksumFile();
const outputFiles = [sha512FilePath].filter(item => item);
return outputFiles;

View File

@@ -742,7 +742,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: Ref<NoteBodyEditorRef>) => {
'media-src \'self\' blob: data: *', // Audio and video players
// Disallow certain unused features
'child-src \'none\'', // Should not contain sub-frames
'child-src https://*.youtube.com https://*.youtube-nocookie.com', // Allow YouTube embeds
'object-src \'none\'', // Objects can be used for script injection
'form-action \'none\'', // No submitting forms

View File

@@ -22,4 +22,8 @@ export const joplinCommandToTinyMceCommands: JoplinCommandToTinyMceCommands = {
'search': { name: 'SearchReplace' },
'attachFile': { name: 'joplinAttach' },
'insertDateTime': true,
'textCopy': true,
'textCut': true,
'textPaste': true,
'textSelectAll': true,
};

View File

@@ -17,19 +17,19 @@ describe('editorCommandDeclarations', () => {
test.each([
[
{},
true,
{ textBold: true },
],
[
{
markdownEditorPaneVisible: false,
},
false,
{ textBold: false },
],
[
{
noteIsReadOnly: true,
},
false,
{ textBold: false },
],
[
// In the Markdown editor, but only the viewer is visible
@@ -37,7 +37,7 @@ describe('editorCommandDeclarations', () => {
markdownEditorPaneVisible: false,
richTextEditorVisible: false,
},
false,
{ textBold: false },
],
[
// In the Markdown editor, and the viewer is visible
@@ -45,7 +45,7 @@ describe('editorCommandDeclarations', () => {
markdownEditorPaneVisible: true,
richTextEditorVisible: false,
},
true,
{ textBold: true },
],
[
// In the RT editor
@@ -53,7 +53,7 @@ describe('editorCommandDeclarations', () => {
markdownEditorPaneVisible: false,
richTextEditorVisible: true,
},
true,
{ textBold: true },
],
[
// In the Markdown editor, and the command palette is visible
@@ -63,14 +63,57 @@ describe('editorCommandDeclarations', () => {
gotoAnythingVisible: true,
modalDialogVisible: true,
},
true,
{ textBold: true },
],
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
])('should create the enabledCondition', (context: Record<string, any>, expected: boolean) => {
const condition = enabledCondition('textBold');
const wc = new WhenClause(condition);
const actual = wc.evaluate({ ...baseContext, ...context });
expect(actual).toBe(expected);
[
// In the Markdown editor, and the command palette is visible
{
markdownEditorPaneVisible: true,
richTextEditorVisible: false,
gotoAnythingVisible: true,
modalDialogVisible: true,
},
{ textBold: true },
],
[
// Rich Text Editor, HTML note
{
markdownEditorPaneVisible: false,
richTextEditorVisible: true,
noteIsMarkdown: false,
},
{
textCopy: true,
textPaste: true,
textSelectAll: true,
},
],
[
// Rich Text Editor, read-only note
{
markdownEditorPaneVisible: false,
richTextEditorVisible: true,
noteIsReadOnly: true,
},
{
textBold: false,
textPaste: false,
// TODO: textCopy should be enabled in read-only notes:
// textCopy: false,
},
],
])('should correctly determine whether command is enabled (case %#)', (context, expectedStates) => {
const actualStates = [];
for (const commandName of Object.keys(expectedStates)) {
const condition = enabledCondition(commandName);
const wc = new WhenClause(condition);
const actual = wc.evaluate({ ...baseContext, ...context });
actualStates.push([commandName, actual]);
}
const expectedStatesArray = Object.entries(expectedStates);
expect(actualStates).toEqual(expectedStatesArray);
});
});

View File

@@ -4,6 +4,10 @@ import { joplinCommandToTinyMceCommands } from './NoteBody/TinyMCE/utils/joplinC
const workWithHtmlNotes = [
'attachFile',
'textCopy',
'textCut',
'textPaste',
'textSelectAll',
];
export const enabledCondition = (commandName: string) => {

View File

@@ -2,7 +2,7 @@ import { RefObject, Dispatch, SetStateAction, useEffect } from 'react';
import { WindowCommandDependencies, NoteBodyEditorRef, OnChangeEvent, ScrollOptionTypes } from './types';
import editorCommandDeclarations, { enabledCondition } from '../editorCommandDeclarations';
import CommandService, { CommandDeclaration, CommandRuntime, CommandContext, RegisteredRuntime } from '@joplin/lib/services/CommandService';
import time from '@joplin/lib/time';
import { formatMsToLocal } from '@joplin/utils/time';
import { reg } from '@joplin/lib/registry';
import getWindowCommandPriority from './getWindowCommandPriority';
@@ -50,7 +50,7 @@ function editorCommandRuntime(
if (declaration.name === 'insertDateTime') {
return editorRef.current.execCommand({
name: 'insertText',
value: time.formatMsToLocal(new Date().getTime()),
value: formatMsToLocal(Date.now()),
});
} else if (declaration.name === 'scrollToHash') {
return editorRef.current.scrollTo({

View File

@@ -51,9 +51,11 @@ const getParentOffset = (childIndex: number, listItems: ListItem[]): number|null
};
const findNextTypeAheadMatch = (selectedIndex: number, query: string, listItems: ListItem[]) => {
const normalize = (text: string) => text.trim().toLowerCase();
const matches = (item: ListItem) => {
return item.label.startsWith(query);
return normalize(item.label).startsWith(normalize(query));
};
const indexBefore = listItems.slice(0, selectedIndex).findIndex(matches);
// Search in all results **after** the current. This prevents the current item from
// always being identified as the next match, if the user repeatedly presses the

View File

@@ -123,8 +123,8 @@ const ToolbarBaseComponent: React.FC<Props> = props => {
};
const tabIndex = indexInFocusable === (selectedIndex % focusableItems.length) ? 0 : -1;
const setButtonRefCallback = (button: HTMLButtonElement) => {
if (tabIndex === 0 && containerHasFocus) {
const setButtonRefCallback = (button: HTMLButtonElement | null) => {
if (button && tabIndex === 0 && containerHasFocus) {
focus('ToolbarBase', button);
}
};

View File

@@ -124,8 +124,7 @@ export const runtime = (control: WindowControl): CommandRuntime => {
void CommandService.instance().execute('showModalMessage', `${modalMessage}\n\n${statusStrings.join('\n')}`);
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
onError: (error: any) => {
onError: (error: string|Error) => {
errors.push(error);
console.warn(error);
},

View File

@@ -8,7 +8,7 @@
default-src 'self' joplin-content://* ;
connect-src 'self' * http://* https://* joplin-content://* blob: ;
style-src 'unsafe-inline' 'self' blob: joplin-content://* https://* http://* ;
child-src 'self' joplin-content://* ;
child-src 'self' joplin-content://* https://*.youtube.com https://*.youtube-nocookie.com ;
script-src 'self' 'unsafe-inline' joplin-content://* ;
media-src 'self' * blob: data: https://* http://* joplin-content://* ;
img-src 'self' blob: data: http://* https://* joplin-content://* ;

View File

@@ -64,6 +64,10 @@ test.describe('sidebar', () => {
await expect(mainWindow.locator(':focus')).toHaveText('Folder b');
await mainWindow.keyboard.type('A');
await expect(mainWindow.locator(':focus')).toHaveText('All notes');
// Should be case-insensitive
await mainWindow.keyboard.type('f');
await expect(mainWindow.locator(':focus')).toHaveText('Folder b');
});
test('left/right arrow keys should expand/collapse notebooks', async ({ electronApp, mainWindow }) => {

View File

@@ -1,7 +1,10 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
const baseConfig = require('../../jest.config.base.js');
module.exports = {
...baseConfig,
// All imported modules in your tests should be mocked automatically
// automock: false,

View File

@@ -1,6 +1,6 @@
{
"name": "@joplin/app-desktop",
"version": "3.5.9",
"version": "3.6.2",
"description": "Joplin for Desktop",
"main": "main.bundle.js",
"private": true,
@@ -92,6 +92,12 @@
"x64"
]
},
{
"target": "pkg",
"arch": [
"x64"
]
},
{
"target": "zip",
"arch": [
@@ -139,19 +145,19 @@
"@electron/rebuild": "3.7.2",
"@fortawesome/fontawesome-free": "5.15.4",
"@joeattardi/emoji-button": "4.6.4",
"@joplin/default-plugins": "~3.5",
"@joplin/editor": "~3.5",
"@joplin/lib": "~3.5",
"@joplin/renderer": "~3.5",
"@joplin/tools": "~3.5",
"@joplin/utils": "~3.5",
"@joplin/default-plugins": "~3.6",
"@joplin/editor": "~3.6",
"@joplin/lib": "~3.6",
"@joplin/renderer": "~3.6",
"@joplin/tools": "~3.6",
"@joplin/utils": "~3.6",
"@playwright/test": "1.55.1",
"@sentry/electron": "4.24.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.5.14",
"@types/mustache": "4.2.6",
"@types/node": "18.19.130",
"@types/react": "18.3.23",
"@types/react": "18.3.26",
"@types/react-dom": "18.3.7",
"@types/react-redux": "7.1.33",
"@types/styled-components": "5.1.32",
@@ -208,7 +214,7 @@
},
"dependencies": {
"@electron/remote": "2.1.3",
"@joplin/onenote-converter": "~3.5",
"@joplin/onenote-converter": "~3.6",
"fs-extra": "11.3.2",
"keytar": "7.9.0",
"node-fetch": "2.6.7",

View File

@@ -140,7 +140,10 @@ export default class AutoUpdaterService implements AutoUpdaterServiceInterface {
// electron's autoUpdater appends automatically the platform's yml file to the link so we should remove it
assetUrl = assetUrl.substring(0, assetUrl.lastIndexOf('/'));
autoUpdater.setFeedURL({ provider: 'generic', url: assetUrl });
await autoUpdater.checkForUpdates();
const result = await autoUpdater.checkForUpdates();
// Wait for the installation to finish. By default, .checkForUpdates runs in the background
await result.downloadPromise;
} catch (error) {
this.logger_.error(`Update download url failed: ${error.message}`);
this.isUpdateInProgress = false;

View File

@@ -0,0 +1,109 @@
import { existsSync } from 'fs';
import { notarize } from '@electron/notarize';
const execCommand = require('./execCommand');
import { exec } from 'child_process';
import { promisify } from 'util';
const execAsync = promisify(exec);
// Same appId in electron-builder.
const appId = 'net.cozic.joplin-desktop';
function isDesktopAppTag(tagName: string) {
if (!tagName) return false;
return tagName[0] === 'v';
}
export default async function notarizeFile(filePath: string) {
if (process.platform !== 'darwin') return;
console.info(`Checking if notarization should be done on: ${filePath}`);
if (!process.env.IS_CONTINUOUS_INTEGRATION || !isDesktopAppTag(process.env.GIT_TAG_NAME)) {
console.info(`Either not running in CI or not processing a desktop app tag - skipping notarization. process.env.IS_CONTINUOUS_INTEGRATION = ${process.env.IS_CONTINUOUS_INTEGRATION}; process.env.GIT_TAG_NAME = ${process.env.GIT_TAG_NAME}`);
return;
}
if (!process.env.APPLE_ID || !process.env.APPLE_ID_PASSWORD) {
console.warn('Environment variables APPLE_ID and APPLE_ID_PASSWORD not found - notarization will NOT be done.');
return;
}
if (!existsSync(filePath)) {
throw new Error(`Cannot find file at: ${filePath}`);
}
// Every x seconds we print something to stdout, otherwise CI may timeout
// the task after 10 minutes, and Apple notarization can take more time.
const waitingIntervalId = setInterval(() => {
console.info('.');
}, 60000);
const isPkg = filePath.endsWith('.pkg');
console.info(`Notarizing ${filePath}`);
try {
if (isPkg) {
await execAsync(
`xcrun notarytool submit "${filePath}" ` +
`--apple-id "${process.env.APPLE_ID}" ` +
`--password "${process.env.APPLE_ID_PASSWORD}" ` +
`--team-id "${process.env.APPLE_ASC_PROVIDER}" ` +
'--wait',
{ maxBuffer: 1024 * 1024 },
);
} else {
await notarize({
appBundleId: appId,
appPath: filePath,
// Apple Developer email address
appleId: process.env.APPLE_ID,
// App-specific password: https://support.apple.com/en-us/HT204397
appleIdPassword: process.env.APPLE_ID_PASSWORD,
// When Apple ID is attached to multiple providers (eg if the
// account has been used to build multiple apps for different
// companies), in that case the provider "Team Short Name" (also
// known as "ProviderShortname") must be provided.
//
// Use this to get it:
//
// xcrun altool --list-providers -u APPLE_ID -p APPLE_ID_PASSWORD
// ascProvider: process.env.APPLE_ASC_PROVIDER,
// In our case, the team ID is the same as the legacy ASC_PROVIDER
teamId: process.env.APPLE_ASC_PROVIDER,
tool: 'notarytool',
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
} as any);
}
} catch (error) {
console.error(error);
process.exit(1);
}
clearInterval(waitingIntervalId);
// It appears that electron-notarize doesn't staple the app, but without
// this we were still getting the malware warning when launching the app.
// Stapling the app means attaching the notarization ticket to it, so that
// if the user is offline, macOS can still check if the app was notarized.
// So it seems to be more or less optional, but at least in our case it
// wasn't.
console.info('Stapling notarization ticket to the file...');
const staplerCmd = `xcrun stapler staple "${filePath}"`;
console.info(`> ${staplerCmd}`);
console.info(await execCommand(staplerCmd));
console.info(`Validating stapled file: ${filePath}`);
try {
await execAsync(`spctl -a -vv -t install "${filePath}"`);
} catch (error) {
console.error(`Failed validating stapled file: ${filePath}:`, error);
}
console.info(`Done notarizing ${filePath}`);
}

View File

@@ -1,12 +1,5 @@
import { existsSync } from 'fs';
import { join } from 'path';
import { notarize } from '@electron/notarize';
const execCommand = require('./execCommand');
function isDesktopAppTag(tagName: string) {
if (!tagName) return false;
return tagName[0] === 'v';
}
import notarizeFile from './notarizeFile';
interface Params {
appOutDir: string;
@@ -18,80 +11,6 @@ interface Params {
}
export default async (params: Params) => {
if (process.platform !== 'darwin') return;
console.info('Checking if notarization should be done...');
if (!process.env.IS_CONTINUOUS_INTEGRATION || !isDesktopAppTag(process.env.GIT_TAG_NAME)) {
console.info(`Either not running in CI or not processing a desktop app tag - skipping notarization. process.env.IS_CONTINUOUS_INTEGRATION = ${process.env.IS_CONTINUOUS_INTEGRATION}; process.env.GIT_TAG_NAME = ${process.env.GIT_TAG_NAME}`);
return;
}
if (!process.env.APPLE_ID || !process.env.APPLE_ID_PASSWORD) {
console.warn('Environment variables APPLE_ID and APPLE_ID_PASSWORD not found - notarization will NOT be done.');
return;
}
// Same appId in electron-builder.
const appId = 'net.cozic.joplin-desktop';
const appPath = join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
if (!existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}
console.log(`Notarizing ${appId} found at ${appPath}`);
// Every x seconds we print something to stdout, otherwise CI may timeout
// the task after 10 minutes, and Apple notarization can take more time.
const waitingIntervalId = setInterval(() => {
console.log('.');
}, 60000);
try {
await notarize({
appBundleId: appId,
appPath: appPath,
// Apple Developer email address
appleId: process.env.APPLE_ID,
// App-specific password: https://support.apple.com/en-us/HT204397
appleIdPassword: process.env.APPLE_ID_PASSWORD,
// When Apple ID is attached to multiple providers (eg if the
// account has been used to build multiple apps for different
// companies), in that case the provider "Team Short Name" (also
// known as "ProviderShortname") must be provided.
//
// Use this to get it:
//
// xcrun altool --list-providers -u APPLE_ID -p APPLE_ID_PASSWORD
// ascProvider: process.env.APPLE_ASC_PROVIDER,
// In our case, the team ID is the same as the legacy ASC_PROVIDER
teamId: process.env.APPLE_ASC_PROVIDER,
tool: 'notarytool',
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
} as any);
} catch (error) {
console.error(error);
process.exit(1);
}
clearInterval(waitingIntervalId);
// It appears that electron-notarize doesn't staple the app, but without
// this we were still getting the malware warning when launching the app.
// Stapling the app means attaching the notarization ticket to it, so that
// if the user is offline, macOS can still check if the app was notarized.
// So it seems to be more or less optional, but at least in our case it
// wasn't.
console.log('Staple notarization ticket to the app...');
const staplerCmd = `xcrun stapler staple "${appPath}"`;
console.log(`> ${staplerCmd}`);
console.log(await execCommand(staplerCmd));
console.log(`Done notarizing ${appId}`);
await notarizeFile(appPath);
};

View File

@@ -130,6 +130,12 @@ const makeAccessDeniedResponse = (message: string) => {
});
};
const makeNotFoundResponse = () => {
return new Response('not found', {
status: 404,
});
};
// Creating a custom protocol allows us to isolate iframes by giving them
// different domain names from the main Joplin app.
//
@@ -210,10 +216,24 @@ const handleCustomProtocols = (): CustomProtocolHandler => {
const rangeHeader = request.headers.get('Range');
let response;
if (!rangeHeader) {
response = await net.fetch(asFileUrl);
} else {
response = await handleRangeRequest(request, pathname);
try {
if (!rangeHeader) {
response = await net.fetch(asFileUrl);
} else {
response = await handleRangeRequest(request, pathname);
}
} catch (error) {
if (
// Errors from NodeJS fs methods (e.g. fs.stat()
error.code === 'ENOENT'
// Errors from Electron's net.fetch(). Use error.message since these errors don't
// seem to have a specific .code or .name.
|| error.message === 'net::ERR_FILE_NOT_FOUND'
) {
response = makeNotFoundResponse();
} else {
throw error;
}
}
if (mediaOnly) {

View File

@@ -89,8 +89,8 @@ android {
applicationId "net.cozic.joplin"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2097786
versionName "3.5.6"
versionCode 2097788
versionName "3.6.0"
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}

View File

@@ -1,7 +1,7 @@
import { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/services/CommandService';
import { _ } from '@joplin/lib/locale';
import { CommandRuntimeProps } from '../types';
import time from '@joplin/lib/time';
import { formatMsToLocal } from '@joplin/utils/time';
export const declaration: CommandDeclaration = {
name: 'insertDateTime',
@@ -12,7 +12,7 @@ export const declaration: CommandDeclaration = {
export const runtime = (props: CommandRuntimeProps): CommandRuntime => {
return {
execute: async (_context: CommandContext) => {
props.insertText(time.formatDateToLocal(new Date()));
props.insertText(formatMsToLocal(Date.now()));
},
enabledCondition: '!noteIsReadOnly',

View File

@@ -511,7 +511,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Joplin/Joplin.entitlements;
CURRENT_PROJECT_VERSION = 147;
CURRENT_PROJECT_VERSION = 149;
DEVELOPMENT_TEAM = A9BXAFS6CT;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Joplin/Info.plist;
@@ -520,7 +520,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 13.5.1;
MARKETING_VERSION = 13.6.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -546,7 +546,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Joplin/Joplin.entitlements;
CURRENT_PROJECT_VERSION = 147;
CURRENT_PROJECT_VERSION = 149;
DEVELOPMENT_TEAM = A9BXAFS6CT;
INFOPLIST_FILE = Joplin/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
@@ -554,7 +554,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 13.5.1;
MARKETING_VERSION = 13.6.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -747,7 +747,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 147;
CURRENT_PROJECT_VERSION = 149;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = A9BXAFS6CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -758,7 +758,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 13.5.1;
MARKETING_VERSION = 13.6.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = (
@@ -790,7 +790,7 @@
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 147;
CURRENT_PROJECT_VERSION = 149;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = A9BXAFS6CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -801,7 +801,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 13.5.1;
MARKETING_VERSION = 13.6.0;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = (
"$(inherited)",

View File

@@ -77,21 +77,14 @@
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>MaterialDesignIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
<string>Fontisto.ttf</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>

View File

@@ -1406,7 +1406,7 @@ PODS:
- React-jsiexecutor
- React-RCTFBReactNativeSpec
- ReactCommon/turbomodule/core
- react-native-alarm-notification (3.5.0):
- react-native-alarm-notification (3.6.0):
- React
- react-native-document-picker (10.1.7):
- DoubleConversion
@@ -1514,7 +1514,7 @@ PODS:
- Yoga
- react-native-rsa-native (2.0.5):
- React
- react-native-saf-x (3.5.1):
- react-native-saf-x (3.6.0):
- React-Core
- react-native-safe-area-context (5.6.1):
- React-Core
@@ -1904,7 +1904,7 @@ PODS:
- React-Core
- RNDateTimePicker (8.4.5):
- React-Core
- RNDeviceInfo (14.0.4):
- RNDeviceInfo (14.1.1):
- React-Core
- RNExitApp (2.0.0):
- React-Core
@@ -1912,7 +1912,7 @@ PODS:
- React-Core
- RNFS (2.20.0):
- React-Core
- RNLocalize (3.5.2):
- RNLocalize (3.5.4):
- React-Core
- RNQuickAction (0.3.13):
- React
@@ -2355,7 +2355,7 @@ SPEC CHECKSUMS:
React-logger: 8edfcedc100544791cd82692ca5a574240a16219
React-Mapbuffer: c3f4b608e4a59dd2f6a416ef4d47a14400194468
React-microtasksnativemodule: 054f34e9b82f02bd40f09cebd4083828b5b2beb6
react-native-alarm-notification: a4326a743df72a94d361a4c3a21515556f650341
react-native-alarm-notification: 846df1df72eca38e711409b9c064a5c635ff1c32
react-native-document-picker: b6419b766863408dacbdf5e97b2f3a694c611150
react-native-geolocation: ec15ffebc53790314885eb9e5f2132132fbc2600
react-native-get-random-values: d16467cf726c618e9c7a8c3c39c31faa2244bbba
@@ -2364,7 +2364,7 @@ SPEC CHECKSUMS:
react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187
react-native-quick-crypto: b475b71e7fa4dbf3446be55e8ad4ef2c58ac4f7f
react-native-rsa-native: a7931cdda1f73a8576a46d7f431378c5550f0c38
react-native-saf-x: 404f0f9a29cc6bf21d88582e054c45a11b28c22b
react-native-saf-x: 50d176763ed692b379c190bf55ae7293a3ee09bb
react-native-safe-area-context: 2243039f43d10cb1ea30ec5ac57fc6d1448413f4
react-native-sqlite-storage: 0c84826214baaa498796c7e46a5ccc9a82e114ed
react-native-vector-icons: a45ecc326ec090450f152dfc7076ce1173331ce5
@@ -2409,11 +2409,11 @@ SPEC CHECKSUMS:
RNCClipboard: f6679d470d0da2bce2a37b0af7b9e0bf369ecda5
RNCPushNotificationIOS: 6c4ca3388c7434e4a662b92e4dfeeee858e6f440
RNDateTimePicker: 8c12d12e8660697c2e176d2f98775764431c141f
RNDeviceInfo: d863506092aef7e7af3a1c350c913d867d795047
RNDeviceInfo: bcce8752b5043a623fe3c26789679b473f705d3c
RNExitApp: 4432b9b7cc5ccec9f91c94e507849891282befd4
RNFileViewer: 4b5d83358214347e4ab2d4ca8d5c1c90d869e251
RNFS: 89de7d7f4c0f6bafa05343c578f61118c8282ed8
RNLocalize: 3c4d0abd777a546fa77bdb6caef85a87fb9ea349
RNLocalize: d7859f87f1083349c73aa089e360af33ef89efc2
RNQuickAction: c2c8f379e614428be0babe4d53a575739667744d
RNSecureRandom: b64d263529492a6897e236a22a2c4249aa1b53dc
RNShare: 40ace3f87cd881869e8085aced9dc16b425c74aa

View File

@@ -1,4 +1,8 @@
const baseConfig = require('../../jest.config.base.js');
module.exports = {
...baseConfig,
preset: 'react-native',
'moduleFileExtensions': [

View File

@@ -2,7 +2,7 @@
"name": "@joplin/app-mobile",
"description": "Joplin for Mobile",
"license": "AGPL-3.0-or-later",
"version": "3.5.0",
"version": "3.6.0",
"private": true,
"scripts": {
"start": "BROWSERSLIST_IGNORE_OLD_DATA=true react-native start --reset-cache",
@@ -22,12 +22,12 @@
},
"dependencies": {
"@bam.tech/react-native-image-resizer": "3.0.11",
"@joplin/editor": "~3.5",
"@joplin/lib": "~3.5",
"@joplin/react-native-alarm-notification": "~3.5",
"@joplin/react-native-saf-x": "~3.5",
"@joplin/renderer": "~3.5",
"@joplin/utils": "~3.5",
"@joplin/editor": "~3.6",
"@joplin/lib": "~3.6",
"@joplin/react-native-alarm-notification": "~3.6",
"@joplin/react-native-saf-x": "~3.6",
"@joplin/renderer": "~3.6",
"@joplin/utils": "~3.6",
"@js-draw/material-icons": "1.33.0",
"@react-native-clipboard/clipboard": "1.16.3",
"@react-native-community/datetimepicker": "8.4.5",
@@ -35,11 +35,11 @@
"@react-native-community/netinfo": "11.4.1",
"@react-native-community/push-notification-ios": "1.11.0",
"@react-native-documents/picker": "10.1.7",
"@react-native-vector-icons/fontawesome5": "12.3.0",
"@react-native-vector-icons/fontawesome5": "patch:@react-native-vector-icons/fontawesome5@npm%3A12.3.0#~/.yarn/patches/@react-native-vector-icons-fontawesome5-npm-12.3.0-a1ca46610f.patch",
"@react-native-vector-icons/get-image": "12.3.0",
"@react-native-vector-icons/ionicons": "12.3.0",
"@react-native-vector-icons/material-design-icons": "12.4.0",
"@react-native-vector-icons/material-icons": "12.4.0",
"@react-native-vector-icons/ionicons": "patch:@react-native-vector-icons/ionicons@npm%3A12.3.0#~/.yarn/patches/@react-native-vector-icons-ionicons-npm-12.3.0-9bd4746f3f.patch",
"@react-native-vector-icons/material-design-icons": "patch:@react-native-vector-icons/material-design-icons@npm%3A12.4.0#~/.yarn/patches/@react-native-vector-icons-material-design-icons-npm-12.4.0-890f7f618b.patch",
"@react-native-vector-icons/material-icons": "patch:@react-native-vector-icons/material-icons@npm%3A12.4.0#~/.yarn/patches/@react-native-vector-icons-material-icons-npm-12.4.0-94138e627b.patch",
"assert-browserify": "2.0.0",
"buffer": "6.0.3",
"color": "3.2.1",
@@ -59,14 +59,14 @@
"punycode": "2.3.1",
"react": "19.0.0",
"react-native": "0.79.2",
"react-native-device-info": "14.0.4",
"react-native-device-info": "14.1.1",
"react-native-dropdownalert": "5.2.0",
"react-native-exit-app": "2.0.0",
"react-native-file-viewer": "2.1.5",
"react-native-fs": "2.20.0",
"react-native-get-random-values": "1.11.0",
"react-native-image-picker": "8.2.1",
"react-native-localize": "3.5.2",
"react-native-localize": "3.5.4",
"react-native-modal-datetime-picker": "18.0.0",
"react-native-paper": "5.14.5",
"react-native-popup-menu": "0.17.0",
@@ -97,7 +97,7 @@
"@babel/plugin-transform-export-namespace-from": "7.27.1",
"@babel/preset-env": "7.25.3",
"@babel/runtime": "7.25.0",
"@joplin/tools": "~3.5",
"@joplin/tools": "~3.6",
"@joplin/turndown": "~4.0.80",
"@joplin/turndown-plugin-gfm": "~1.0.62",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
@@ -114,13 +114,13 @@
"@types/node": "18.19.130",
"@types/react": "19.0.14",
"@types/react-redux": "7.1.33",
"@types/serviceworker": "0.0.154",
"@types/serviceworker": "0.0.158",
"@types/tar-stream": "3.1.4",
"babel-jest": "29.7.0",
"babel-loader": "9.1.3",
"babel-plugin-module-resolver": "4.1.0",
"babel-plugin-react-native-web": "0.21.1",
"esbuild": "0.25.10",
"babel-plugin-react-native-web": "0.21.2",
"esbuild": "0.25.11",
"fast-deep-equal": "3.1.3",
"fs-extra": "11.3.2",
"gulp": "4.0.2",
@@ -131,7 +131,7 @@
"nodemon": "3.1.10",
"punycode": "2.3.1",
"react-dom": "19.0.0",
"react-native-web": "0.21.1",
"react-native-web": "0.21.2",
"react-refresh": "0.17.0",
"react-test-renderer": "19.0.0",
"sharp": "0.34.4",

View File

@@ -1,5 +1,5 @@
module.exports = {
hash:"daebd8498ff273c64cf5905d4356e66a", files: {
hash:"88e5d809af57eac7b86c4deaf21b9345", files: {
'abc/abc_render.js': { data: require('./abc/abc_render.js.base64.js'), mime: 'application/javascript', encoding: 'base64' },
'abc/abcjs-basic-min.js': { data: require('./abc/abcjs-basic-min.js.base64.js'), mime: 'application/javascript', encoding: 'base64' },
'highlight.js/atom-one-dark-reasonable.css': { data: require('./highlight.js/atom-one-dark-reasonable.css.base64.js'), mime: 'text/css', encoding: 'base64' },

View File

@@ -1 +1 @@
module.exports = {"hash":"daebd8498ff273c64cf5905d4356e66a","files":["abc/abc_render.js","abc/abcjs-basic-min.js","highlight.js/atom-one-dark-reasonable.css","highlight.js/atom-one-light.css","katex/fonts/KaTeX_AMS-Regular.woff2","katex/fonts/KaTeX_Caligraphic-Bold.woff2","katex/fonts/KaTeX_Caligraphic-Regular.woff2","katex/fonts/KaTeX_Fraktur-Bold.woff2","katex/fonts/KaTeX_Fraktur-Regular.woff2","katex/fonts/KaTeX_Main-Bold.woff2","katex/fonts/KaTeX_Main-BoldItalic.woff2","katex/fonts/KaTeX_Main-Italic.woff2","katex/fonts/KaTeX_Main-Regular.woff2","katex/fonts/KaTeX_Math-BoldItalic.woff2","katex/fonts/KaTeX_Math-Italic.woff2","katex/fonts/KaTeX_SansSerif-Bold.woff2","katex/fonts/KaTeX_SansSerif-Italic.woff2","katex/fonts/KaTeX_SansSerif-Regular.woff2","katex/fonts/KaTeX_Script-Regular.woff2","katex/fonts/KaTeX_Size1-Regular.woff2","katex/fonts/KaTeX_Size2-Regular.woff2","katex/fonts/KaTeX_Size3-Regular.woff2","katex/fonts/KaTeX_Size4-Regular.woff2","katex/fonts/KaTeX_Typewriter-Regular.woff2","katex/katex.css","mermaid/mermaid.min.js","mermaid/mermaid_render.js"]}
module.exports = {"hash":"88e5d809af57eac7b86c4deaf21b9345","files":["abc/abc_render.js","abc/abcjs-basic-min.js","highlight.js/atom-one-dark-reasonable.css","highlight.js/atom-one-light.css","katex/fonts/KaTeX_AMS-Regular.woff2","katex/fonts/KaTeX_Caligraphic-Bold.woff2","katex/fonts/KaTeX_Caligraphic-Regular.woff2","katex/fonts/KaTeX_Fraktur-Bold.woff2","katex/fonts/KaTeX_Fraktur-Regular.woff2","katex/fonts/KaTeX_Main-Bold.woff2","katex/fonts/KaTeX_Main-BoldItalic.woff2","katex/fonts/KaTeX_Main-Italic.woff2","katex/fonts/KaTeX_Main-Regular.woff2","katex/fonts/KaTeX_Math-BoldItalic.woff2","katex/fonts/KaTeX_Math-Italic.woff2","katex/fonts/KaTeX_SansSerif-Bold.woff2","katex/fonts/KaTeX_SansSerif-Italic.woff2","katex/fonts/KaTeX_SansSerif-Regular.woff2","katex/fonts/KaTeX_Script-Regular.woff2","katex/fonts/KaTeX_Size1-Regular.woff2","katex/fonts/KaTeX_Size2-Regular.woff2","katex/fonts/KaTeX_Size3-Regular.woff2","katex/fonts/KaTeX_Size4-Regular.woff2","katex/fonts/KaTeX_Typewriter-Regular.woff2","katex/katex.css","mermaid/mermaid.min.js","mermaid/mermaid_render.js"]}

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@
default-src 'self' ;
connect-src 'self' * http://* https://* blob: ;
style-src 'unsafe-inline' 'self' blob: ;
child-src 'self' ;
child-src 'self' https://*.youtube.com https://*.youtube-nocookie.com ;
script-src 'self' 'unsafe-eval' 'unsafe-inline' ;
media-src 'self' blob: data: https://* http://* ;
img-src 'self' blob: data: http://* https://* ;

View File

@@ -7,115 +7,129 @@ import { tmpdir } from 'os';
import { chdir, cwd } from 'process';
import { execCommand } from '@joplin/utils';
import { glob } from 'glob';
import readRepositoryJson from './utils/readRepositoryJson';
import readRepositoryJson, { BuiltInPluginType, RepositoryData } from './utils/readRepositoryJson';
import getPathToPatchFileFor from './utils/getPathToPatchFileFor';
import getCurrentCommitHash from './utils/getCurrentCommitHash';
import { waitForCliInput } from '@joplin/utils/cli';
interface Options {
outputParentDir: string|null;
beforeInstall: (buildDir: string, pluginName: string)=> Promise<void>;
beforePatch: ()=> Promise<void>;
}
const buildDefaultPlugins = async (outputParentDir: string|null, options: Options) => {
const pluginSourcesDir = resolve(join(__dirname, 'plugin-sources'));
const buildDefaultPlugins = async (options: Options) => {
const pluginRepositoryData = await readRepositoryJson(join(__dirname, 'pluginRepositories.json'));
const originalDirectory = cwd();
const logStatus = (...message: string[]) => {
const blue = '\x1b[96m';
const reset = '\x1b[0m';
console.log(blue, ...message, reset);
};
for (const pluginId in pluginRepositoryData) {
const repositoryData = pluginRepositoryData[pluginId];
const outputPath = options.outputParentDir && join(options.outputParentDir, `${pluginId}.jpl`);
const buildDir = await mkdtemp(join(tmpdir(), 'default-plugin-build'));
try {
logStatus('Building plugin', pluginId, 'at', buildDir);
const pluginDir = resolve(join(pluginSourcesDir, pluginId));
// Clone the repository if not done yet
if (!(await exists(pluginDir)) || (await readdir(pluginDir)).length === 0) {
logStatus(`Cloning from repository ${repositoryData.cloneUrl}`);
await execCommand(['git', 'clone', '--', repositoryData.cloneUrl, pluginDir]);
chdir(pluginDir);
if (repositoryData.type === BuiltInPluginType.Built) {
await buildPlugin(pluginId, repositoryData, outputPath, options);
} else {
if (!outputPath) {
console.warn('Skipping NPM plugin,', pluginId, ': missing output path.');
continue;
}
chdir(pluginDir);
const expectedCommitHash = repositoryData.commit;
logStatus(`Switching to commit ${expectedCommitHash}`);
await execCommand(['git', 'switch', repositoryData.branch]);
try {
await execCommand(['git', 'checkout', expectedCommitHash]);
} catch (error) {
logStatus(`git checkout failed with error ${error}. Fetching...`);
await execCommand(['git', 'fetch']);
await execCommand(['git', 'checkout', expectedCommitHash]);
}
if (await getCurrentCommitHash() !== expectedCommitHash) {
throw new Error(`Unable to checkout commit ${expectedCommitHash}`);
}
logStatus('Copying repository files...');
await copy(pluginDir, buildDir, {
filter: fileName => {
return basename(fileName) !== '.git';
},
});
chdir(buildDir);
logStatus('Initializing repository.');
await execCommand('git init . -b main');
logStatus('Running before-patch hook.');
await options.beforePatch();
const patchFile = getPathToPatchFileFor(pluginId);
if (await exists(patchFile)) {
logStatus('Applying patch.');
await execCommand(['git', 'apply', patchFile]);
}
await options.beforeInstall(buildDir, pluginId);
logStatus('Installing dependencies.');
await execCommand('npm install');
const jplFiles = await glob('publish/*.jpl');
logStatus(`Found built .jpl files: ${JSON.stringify(jplFiles)}`);
if (jplFiles.length === 0) {
throw new Error(`No published files found in ${buildDir}/publish`);
}
if (outputParentDir !== null) {
logStatus(`Checking output directory in ${outputParentDir}`);
const outputPath = join(outputParentDir, `${pluginId}.jpl`);
const sourceFile = jplFiles[0];
logStatus(`Copying built file from ${sourceFile} to ${outputPath}`);
await copy(sourceFile, outputPath);
} else {
console.warn('No output directory specified. Not copying built .jpl files.');
}
} catch (error) {
console.error(error);
console.log('Build directory', buildDir);
await waitForCliInput();
throw error;
} finally {
chdir(originalDirectory);
await remove(buildDir);
logStatus('Removed build directory');
logStatus('Copying plugin', pluginId, 'JPL file to', outputPath);
await copy(join(__dirname, 'node_modules', repositoryData.package, 'publish', `${pluginId}.jpl`), outputPath);
logStatus('Copied.');
}
}
};
const logStatus = (...message: string[]) => {
const blue = '\x1b[96m';
const reset = '\x1b[0m';
console.log(blue, ...message, reset);
};
const buildPlugin = async (pluginId: string, repositoryData: RepositoryData, outputPath: string|null, options: Options) => {
const pluginSourcesDir = resolve(join(__dirname, 'plugin-sources'));
const originalDirectory = cwd();
const buildDir = await mkdtemp(join(tmpdir(), 'default-plugin-build'));
try {
logStatus('Building plugin', pluginId, 'at', buildDir);
const pluginDir = resolve(join(pluginSourcesDir, pluginId));
// Clone the repository if not done yet
if (!(await exists(pluginDir)) || (await readdir(pluginDir)).length === 0) {
logStatus(`Cloning from repository ${repositoryData.cloneUrl}`);
await execCommand(['git', 'clone', '--', repositoryData.cloneUrl, pluginDir]);
chdir(pluginDir);
}
chdir(pluginDir);
const expectedCommitHash = repositoryData.commit;
logStatus(`Switching to commit ${expectedCommitHash}`);
await execCommand(['git', 'switch', repositoryData.branch]);
try {
await execCommand(['git', 'checkout', expectedCommitHash]);
} catch (error) {
logStatus(`git checkout failed with error ${error}. Fetching...`);
await execCommand(['git', 'fetch']);
await execCommand(['git', 'checkout', expectedCommitHash]);
}
if (await getCurrentCommitHash() !== expectedCommitHash) {
throw new Error(`Unable to checkout commit ${expectedCommitHash}`);
}
logStatus('Copying repository files...');
await copy(pluginDir, buildDir, {
filter: fileName => {
return basename(fileName) !== '.git';
},
});
chdir(buildDir);
logStatus('Initializing repository.');
await execCommand('git init . -b main');
logStatus('Running before-patch hook.');
await options.beforePatch();
const patchFile = getPathToPatchFileFor(pluginId);
if (await exists(patchFile)) {
logStatus('Applying patch.');
await execCommand(['git', 'apply', patchFile]);
}
await options.beforeInstall(buildDir, pluginId);
logStatus('Installing dependencies.');
await execCommand('npm install');
const jplFiles = await glob('publish/*.jpl');
logStatus(`Found built .jpl files: ${JSON.stringify(jplFiles)}`);
if (jplFiles.length === 0) {
throw new Error(`No published files found in ${buildDir}/publish`);
}
if (outputPath !== null) {
const sourceFile = jplFiles[0];
logStatus(`Copying built file from ${sourceFile} to ${outputPath}`);
await copy(sourceFile, outputPath);
} else {
console.warn('No output directory specified. Not copying built .jpl files.');
}
} catch (error) {
console.error(error);
console.log('Build directory', buildDir);
await waitForCliInput();
throw error;
} finally {
chdir(originalDirectory);
await remove(buildDir);
logStatus('Removed build directory');
}
};
export default buildDefaultPlugins;

View File

@@ -1,7 +1,8 @@
import buildDefaultPlugins from '../buildDefaultPlugins';
const buildAll = (outputDirectory: string) => {
return buildDefaultPlugins(outputDirectory, {
return buildDefaultPlugins({
outputParentDir: outputDirectory,
beforeInstall: async () => { },
beforePatch: async () => { },
});

View File

@@ -8,7 +8,8 @@ import getPathToPatchFileFor from '../utils/getPathToPatchFileFor';
const editPatch = async (targetPluginId: string, outputParentDir: string|null) => {
let patchedPlugin = false;
await buildDefaultPlugins(outputParentDir, {
await buildDefaultPlugins({
outputParentDir: outputParentDir,
beforePatch: async () => {
// To make updating just the patch possible, a commit is created just before applying
// the patch.
@@ -34,7 +35,7 @@ const editPatch = async (targetPluginId: string, outputParentDir: string|null) =
});
if (!patchedPlugin) {
throw new Error(`No default plugin with ID ${targetPluginId} found!`);
throw new Error(`No patchable default plugin with ID ${targetPluginId} found! Make sure that the plugin has a "cloneUrl" and "branch" in pluginRepositories.json.`);
}
};

View File

@@ -1,6 +1,6 @@
{
"name": "@joplin/default-plugins",
"version": "3.5.0",
"version": "3.6.0",
"description": "Default plugins bundler",
"private": true,
"scripts": {
@@ -14,11 +14,12 @@
},
"devDependencies": {
"@types/yargs": "17.0.33",
"joplin-plugin-freehand-drawing": "4.3.0",
"ts-node": "10.9.2",
"typescript": "5.8.3"
},
"dependencies": {
"@joplin/utils": "~3.5",
"@joplin/utils": "~3.6",
"fs-extra": "11.3.2",
"yargs": "17.7.2"
}

View File

@@ -2,11 +2,10 @@
"io.github.jackgruber.backup": {
"cloneUrl": "https://github.com/JackGruber/joplin-plugin-backup.git",
"branch": "master",
"commit": "abb58175e2d2bf34899f1b32cb74137e5c788bf9"
"commit": "2c3da7056e7ac39c86c2051a4fdb99d9534dd0a1"
},
"io.github.personalizedrefrigerator.js-draw": {
"cloneUrl": "https://github.com/personalizedrefrigerator/joplin-plugin-freehand-drawing.git",
"branch": "main",
"commit": "63b6d3f185b5b3664632e498df7c7ad7824038d0"
"package": "joplin-plugin-freehand-drawing"
}
}

View File

@@ -1,13 +1,28 @@
import { readFile } from 'fs-extra';
export enum BuiltInPluginType {
// Plugins that need to be built when building Joplin (e.g. if the plugin
// needs to be patched)
Built,
// Plugins that can be fetched directly from NPM. Must also be marked as a
// dev dependency.
FromNpm,
}
export interface RepositoryData {
type: BuiltInPluginType.Built;
cloneUrl: string;
branch: string;
commit: string;
}
export interface NpmReference {
type: BuiltInPluginType.FromNpm;
package: string;
}
export interface AllRepositoryData {
[pluginId: string]: RepositoryData;
[pluginId: string]: RepositoryData|NpmReference;
}
const readRepositoryJson = async (repositoryDataFilepath: string): Promise<AllRepositoryData> => {
@@ -26,9 +41,17 @@ const readRepositoryJson = async (repositoryDataFilepath: string): Promise<AllRe
}
};
assertPropertyIsString('cloneUrl');
assertPropertyIsString('branch');
assertPropertyIsString('commit');
let type;
if ('branch' in parsedJson[pluginId]) {
assertPropertyIsString('cloneUrl');
assertPropertyIsString('branch');
assertPropertyIsString('commit');
type = BuiltInPluginType.Built;
} else {
assertPropertyIsString('package');
type = BuiltInPluginType.FromNpm;
}
parsedJson[pluginId] = { ...parsedJson[pluginId], type };
}
return parsedJson;

View File

@@ -50,7 +50,7 @@ describe('createEditor', () => {
const headerLine = document.body.querySelector('.cm-headerLine')!;
expect(headerLine.textContent).toBe(headerLineText);
expect(getComputedStyle(headerLine).fontSize).toBe('1.6em');
expect(getComputedStyle(headerLine).fontSize).toBe('1.5em');
// CodeMirror nests the tag that styles the header within .cm-headerLine:
// <div class='cm-headerLine'><span class='someclass'>Testing...</span></div>

View File

@@ -3,39 +3,17 @@ import { EditorSelection } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import uslug from '@joplin/fork-uslug/lib/uslug';
import { SyntaxNodeRef } from '@lezer/common';
import htmlNodeInfo from '../utils/htmlNodeInfo';
const jumpToHash = (view: EditorView, hash: string) => {
const state = view.state;
const timeout = 1_000; // Maximum time to spend parsing the syntax tree
let targetLocation: number|undefined = undefined;
const removeQuotes = (quoted: string) => quoted.replace(/^["'](.*)["']$/, '$1');
const makeEnterNode = (offset: number) => (node: SyntaxNodeRef) => {
const nodeToText = (node: SyntaxNodeRef) => {
return state.sliceDoc(node.from + offset, node.to + offset);
};
// Returns the attribute with the given name for [node]
const getHtmlNodeAttr = (node: SyntaxNodeRef, attrName: string) => {
if (node.from === node.to) return null; // Empty
const content = node.node.resolveInner(node.from + 1);
// Search for the "id" attribute
const attributes = content.getChildren('Attribute');
for (const attribute of attributes) {
const nameNode = attribute.getChild('AttributeName');
const valueNode = attribute.getChild('AttributeValue');
if (nameNode && valueNode) {
const name = nodeToText(nameNode).toLowerCase().replace(/^"(.*)"$/, '$1');
if (name === attrName) {
return removeQuotes(nodeToText(valueNode));
}
}
}
return null;
};
const found = targetLocation !== undefined;
if (found) return false; // Skip this node
@@ -46,13 +24,14 @@ const jumpToHash = (view: EditorView, hash: string) => {
.replace(/^#+\s/, '') // Leading #s in headers
.replace(/\n-+$/, ''); // Trailing --s in headers
matches = hash === uslug(nodeText);
} else if (node.name === 'HTMLTag' || node.name === 'HTMLBlock') {
} else if (node.name === 'HTMLBlock') {
// CodeMirror adds HTML information to Markdown documents using overlays attached
// to HTMLTag and HTMLBlock nodes.
// Use .enter to enter the overlay and visit the HTML nodes:
node.node.enter(node.from, 1).toTree().iterate({ enter: makeEnterNode(node.from) });
} else if (node.name === 'OpenTag') {
matches = getHtmlNodeAttr(node, 'id') === hash || getHtmlNodeAttr(node, 'name') === hash;
} else if (node.name === 'OpenTag' || node.name === 'HTMLTag') {
const htmlNodeDetails = htmlNodeInfo(node, state);
matches = htmlNodeDetails.getAttr('id') === hash || htmlNodeDetails.getAttr('name') === hash;
}
if (matches) {

View File

@@ -4,6 +4,7 @@ import replaceBulletLists from './replaceBulletLists';
import replaceCheckboxes from './replaceCheckboxes';
import replaceDividers from './replaceDividers';
import replaceFormatCharacters from './replaceFormatCharacters';
import replaceInlineHtml from './replaceInlineHtml';
export default () => {
return [
@@ -13,5 +14,6 @@ export default () => {
replaceBackslashEscapes,
replaceDividers,
addFormattingClasses,
replaceInlineHtml,
];
};

View File

@@ -3,20 +3,31 @@ import { SyntaxNodeRef } from '@lezer/common';
import makeReplaceExtension from './utils/makeInlineReplaceExtension';
import toggleCheckboxAt from '../../utils/markdown/toggleCheckboxAt';
const checkboxClassName = 'cm-ext-checkbox-toggle';
const checkboxContainerClassName = 'cm-ext-checkbox-toggle';
const checkboxClassName = 'cm-ext-checkbox';
class CheckboxWidget extends WidgetType {
public constructor(private checked: boolean, private depth: number, private label: string) {
public constructor(
private checked: boolean,
private depth: number,
private label: string,
private markup: string,
) {
super();
}
public eq(other: CheckboxWidget) {
return other.checked === this.checked && other.depth === this.depth && other.label === this.label;
return other.checked === this.checked
&& other.depth === this.depth
&& other.label === this.label
&& other.markup === this.markup;
}
private applyContainerClasses(container: HTMLElement) {
container.classList.add(checkboxClassName);
container.classList.add(checkboxContainerClassName);
// For sizing: Should have the same font/styles as non-rendered checkboxes:
container.classList.add('cm-taskMarker');
for (const className of [...container.classList]) {
if (className.startsWith('-depth-')) {
@@ -30,12 +41,22 @@ class CheckboxWidget extends WidgetType {
public toDOM(view: EditorView) {
const container = document.createElement('span');
const sizingNode = document.createElement('span');
sizingNode.classList.add('sizing');
sizingNode.textContent = this.markup;
container.appendChild(sizingNode);
const checkboxWrapper = document.createElement('span');
checkboxWrapper.classList.add('content');
container.appendChild(checkboxWrapper);
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.checked = this.checked;
checkbox.ariaLabel = this.label;
checkbox.title = this.label;
container.appendChild(checkbox);
checkbox.classList.add(checkboxClassName);
checkboxWrapper.appendChild(checkbox);
checkbox.oninput = () => {
toggleCheckboxAt(view.posAtDOM(container))(view);
@@ -66,16 +87,32 @@ const completedListItemDecoration = Decoration.line({ class: completedTaskClassN
const replaceCheckboxes = [
EditorView.theme({
[`& .${checkboxContainerClassName}`]: {
position: 'relative',
'& > .sizing': {
visibility: 'hidden',
},
'& > .content': {
position: 'absolute',
left: '0',
right: '0',
top: '0',
bottom: '0',
textAlign: 'center',
},
},
[`& .${checkboxClassName}`]: {
'& > input': {
width: '1.1em',
height: '1.1em',
margin: '4px',
verticalAlign: 'middle',
},
'&:not(.-depth-1) > input': {
marginInlineStart: 0,
},
verticalAlign: 'middle',
// Ensure that the checkbox grows as the font size increases:
width: '100%',
minHeight: '70%',
// Shift the checkbox slightly so that it's aligned with the list item bullet point
margin: '0',
marginBottom: '3px',
},
[`& .${completedTaskClassName}`]: {
opacity: 0.69,
@@ -84,7 +121,7 @@ const replaceCheckboxes = [
EditorView.domEventHandlers({
mousedown: (event) => {
const target = event.target as Element;
if (target.nodeName === 'INPUT' && target.parentElement?.classList?.contains(checkboxClassName)) {
if (target.nodeName === 'INPUT' && target.classList?.contains(checkboxClassName)) {
// Let the checkbox handle the event
return true;
}
@@ -101,8 +138,14 @@ const replaceCheckboxes = [
if (node.name === 'TaskMarker') {
const containerLine = state.doc.lineAt(node.from);
const labelText = state.doc.sliceString(node.to, containerLine.to);
const markerText = state.doc.sliceString(node.from, node.to);
return new CheckboxWidget(markerIsChecked(node), parentTags.get('ListItem') ?? 0, labelText);
return new CheckboxWidget(
markerIsChecked(node),
parentTags.get('ListItem') ?? 0,
labelText,
markerText,
);
} else if (node.name === 'Task') {
const marker = node.node.getChild('TaskMarker');
if (marker && markerIsChecked(marker)) {
@@ -119,7 +162,7 @@ const replaceCheckboxes = [
return null;
}
return [listMarker.from, node.to];
return [node.from, node.to];
} else if (node.name === 'Task') {
const taskLine = state.doc.lineAt(node.from);
return [taskLine.from];

View File

@@ -0,0 +1,27 @@
import { EditorSelection } from '@codemirror/state';
import createTestEditor from '../../testing/createTestEditor';
import replaceInlineHtml from './replaceInlineHtml';
const createEditor = async (initialMarkdown: string, expectedTags: string[] = ['HTMLTag']) => {
const editor = await createTestEditor(
initialMarkdown,
EditorSelection.cursor(0),
expectedTags,
[replaceInlineHtml],
);
return editor;
};
describe('replaceInlineHtml', () => {
test.each([
{ markdown: '<sup>Test</sup>', expectedTagsQuery: 'sup' },
{ markdown: '<strike>Test</strike>', expectedTagsQuery: 'strike' },
{ markdown: 'Test: <span style="color: red;">Test</span>', expectedTagsQuery: 'span[style]' },
{ markdown: 'Test: <span style="color: rgb(123, 0, 0);">Test</span>', expectedTagsQuery: 'span[style]' },
])('should render inline HTML (case %#)', async ({ markdown, expectedTagsQuery }) => {
// Add additional newlines: Ensure that the cursor isn't initially on the same line as the content to be rendered:
const editor = await createEditor(`\n\n${markdown}\n\n`);
expect(editor.contentDOM.querySelector(expectedTagsQuery)).toBeTruthy();
});
});

View File

@@ -0,0 +1,90 @@
import makeInlineReplaceExtension from './utils/makeInlineReplaceExtension';
import { Decoration } from '@codemirror/view';
import htmlNodeInfo, { HtmlNodeInfo } from '../../utils/htmlNodeInfo';
import { SyntaxNodeRef } from '@lezer/common';
import { EditorState } from '@codemirror/state';
const hideDecoration = Decoration.replace({});
type OnRenderTagContent = (openingTag: HtmlNodeInfo)=> Decoration;
const createHtmlReplacementExtension = (tagName: string, onRenderContent: OnRenderTagContent) => {
const isMatchingTag = (info: HtmlNodeInfo) => {
return info.tagName().toLowerCase() === tagName;
};
const isMatchingOpeningTag = (info: HtmlNodeInfo) => {
return isMatchingTag(info) && info.opening;
};
const isMatchingClosingTag = (info: HtmlNodeInfo) => {
return isMatchingTag(info) && info.closing;
};
const findClosingTag = (openingTag: SyntaxNodeRef, state: EditorState) => {
const openingTagInfo = htmlNodeInfo(openingTag, state);
// Self-closing?
if (openingTagInfo.closing) {
return openingTag;
}
let cursor = openingTag.node.nextSibling;
let nestedTagCounter = 1;
// Find the matching closing tag
for (; !!cursor && nestedTagCounter > 0; cursor = cursor.nextSibling) {
const info = htmlNodeInfo(cursor, state);
if (isMatchingOpeningTag(info)) {
nestedTagCounter ++;
} else if (isMatchingClosingTag(info)) {
nestedTagCounter --;
}
if (nestedTagCounter === 0) {
break;
}
}
return cursor;
};
const hideTags = makeInlineReplaceExtension({
createDecoration: (node, state) => {
const info = htmlNodeInfo(node, state);
return info && isMatchingTag(info) ? hideDecoration : null;
},
});
const styleContent = makeInlineReplaceExtension({
createDecoration: (node, state) => {
const info = htmlNodeInfo(node, state);
if (!info || !isMatchingOpeningTag(info)) return null;
return onRenderContent(info);
},
getDecorationRange(node, state) {
const closingTag = findClosingTag(node, state);
if (closingTag) {
return [node.to, closingTag.from];
} else {
return null;
}
},
});
return [hideTags, styleContent];
};
export default [
createHtmlReplacementExtension('sub', () => Decoration.mark({ tagName: 'sub' })),
createHtmlReplacementExtension('sup', () => Decoration.mark({ tagName: 'sup' })),
createHtmlReplacementExtension('strike', () => Decoration.mark({ tagName: 'strike' })),
createHtmlReplacementExtension('span', (info) => {
const styles = info.getAttr('style') ?? '';
const colorMatch = styles.match(/color:\s*(#?[a-z0-9A-Z]+|rgba?\([0-9, ]+\))(;|$)/);
return Decoration.mark({
attributes: {
style: colorMatch ? `color: ${colorMatch[1]};` : '',
},
});
}),
].flat();

View File

@@ -77,7 +77,9 @@ const makeBlockReplaceExtension = (extensionSpec: ReplacementExtension) => {
return extensionSpec.shouldFullReRender(transaction);
};
if (transaction.docChanged || selectionChanged || wasRerenderRequested()) {
const treeChanged = syntaxTree(transaction.state) !== syntaxTree(transaction.startState);
if (transaction.docChanged || selectionChanged || wasRerenderRequested() || treeChanged) {
decorations = updateDecorations(transaction.state, extensionSpec);
}

View File

@@ -86,6 +86,7 @@ const createTheme = (theme: EditorTheme): Extension[] => {
const baseHeadingStyle = {
fontWeight: 'bold',
fontFamily: theme.fontFamily,
paddingBottom: '0.2em',
};
const codeMirrorTheme = EditorView.theme({
@@ -210,7 +211,12 @@ const createTheme = (theme: EditorTheme): Extension[] => {
// small.
'& .cm-h1': {
...baseHeadingStyle,
fontSize: '1.6em',
fontSize: '1.5em',
},
// Only underline level 1 headings not in block quotes. The underline overlaps with the blockquote border.
'& .cm-h1:not(.cm-blockQuote)': {
borderBottom: `1px solid ${theme.dividerColor}`,
marginBottom: '0.1em',
},
'& .cm-h2': {
...baseHeadingStyle,

View File

@@ -0,0 +1,88 @@
import { EditorState } from '@codemirror/state';
import { SyntaxNodeRef } from '@lezer/common';
export interface HtmlNodeInfo {
node: SyntaxNodeRef;
opening: boolean;
closing: boolean;
from: number;
to: number;
tagName: ()=> string;
getAttr: (attributeName: string)=> string;
}
type OnGetNodeContent = (node: SyntaxNodeRef)=> string;
const removeQuotes = (quoted: string) => quoted.replace(/^["'](.*)["']$/, '$1');
const getHtmlNodeAttr = (node: SyntaxNodeRef, attrName: string, getText: OnGetNodeContent) => {
if (node.from === node.to) return null; // Empty
const content = node.node.resolveInner(node.from + 1);
// Search for the "id" attribute
const attributes = content.getChildren('Attribute');
for (const attribute of attributes) {
const nameNode = attribute.getChild('AttributeName');
const valueNode = attribute.getChild('AttributeValue');
if (nameNode && valueNode) {
const name = getText(nameNode).toLowerCase().replace(/^"(.*)"$/, '$1');
if (name === attrName) {
return removeQuotes(getText(valueNode));
}
}
}
return null;
};
// Utility function to access CodeMirror HTML node information, based on
// the corresponding Markdown node.
const htmlNodeInfo = (node: SyntaxNodeRef, state: EditorState, offset = 0): HtmlNodeInfo|null => {
// Already an HTML node?
if (node.name === 'OpenTag' || node.name === 'CloseTag' || node.name === 'SelfClosingTag') {
const getNodeText = (childNode: SyntaxNodeRef) => state.sliceDoc(childNode.from + offset, childNode.to + offset);
const selfClosing = node.name === 'SelfClosingTag';
return {
node,
opening: node.name === 'OpenTag' || selfClosing,
closing: node.name === 'CloseTag' || selfClosing,
from: node.from + offset,
to: node.to + offset,
tagName: () => {
const nodeText = getNodeText(node).trim();
const tagNameMatch = nodeText.match(/^<\/?([^>\s]+)/);
if (tagNameMatch) {
return tagNameMatch[1];
}
return null;
},
getAttr: (name: string) => {
return getHtmlNodeAttr(node, name, getNodeText);
},
};
}
// Convert Markdown HTML nodes to HTML nodes
if (node.name === 'HTMLTag' || node.name === 'HTMLBlock') {
const globalOffset = node.from + offset;
let resolved: HtmlNodeInfo|null = null;
// CodeMirror adds HTML information to Markdown documents using overlays attached
// to HTMLTag and HTMLBlock nodes.
// Use .enter to enter the overlay and visit the HTML nodes:
node.node.enter(node.from, 1).toTree().iterate({
enter: (subNode) => {
resolved ??= htmlNodeInfo(subNode, state, globalOffset);
return !resolved;
},
});
return resolved;
}
return null;
};
export default htmlNodeInfo;

View File

@@ -135,9 +135,12 @@ const commands: Record<EditorCommandType, ExtendedCommand|null> = {
if (view) {
const selectedText = getTextBetween(state.doc, state.selection.from, state.selection.to);
const content = selectedText || '...';
return showCreateEditablePrompt(
block ? `$$\n\t${content}\n$$` : `$${content}$`, !block,
)(state, dispatch, view);
const blockStart = block ? '$$\n\t' : '$';
return showCreateEditablePrompt({
source: block ? `${blockStart}${content}\n$$` : `${blockStart}${content}$`,
inline: !block,
cursor: blockStart.length,
})(state, dispatch, view);
}
return true;
}
@@ -180,10 +183,13 @@ const commands: Record<EditorCommandType, ExtendedCommand|null> = {
return true;
},
[EditorCommandType.InsertCodeBlock]: (state, dispatch, view) => {
const sourceBlockStart = '```\n';
const selectedText = getTextBetween(state.doc, state.selection.from, state.selection.to);
return showCreateEditablePrompt(
`\`\`\`\n${selectedText}\n\`\`\``, false,
)(state, dispatch, view);
return showCreateEditablePrompt({
source: `${sourceBlockStart}${selectedText}\n\`\`\``,
inline: false,
cursor: sourceBlockStart.length,
})(state, dispatch, view);
},
[EditorCommandType.ToggleSearch]: (state, dispatch, view) => {
const command = setSearchVisible(!getSearchVisible(state));

View File

@@ -4,19 +4,20 @@ import { MarkType, ResolvedPos } from 'prosemirror-model';
import { EditorState, Plugin, Transaction } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { closeHistory } from 'prosemirror-history';
import showCreateEditablePrompt from './joplinEditablePlugin/showCreateEditablePrompt';
interface InlineInputRule {
interface InputRuleData {
match: RegExp;
matchEndCharacter: string;
handler: (state: EditorState, match: RegExpMatchArray, start: number, end: number, commitCharacter: string)=> Transaction|null;
commitCharacter: string|null;
handler: (view: EditorView, match: RegExpMatchArray, start: number, end: number, commitCharacter: string)=> Transaction|null;
}
// A custom input rule extension for inline input replacements.
//
// Ref: https://github.com/ProseMirror/prosemirror-inputrules/blob/43ef04ce9c1512ef8f2289578309c40b431ed3c5/src/inputrules.ts#L82
// See https://discuss.prosemirror.net/t/trigger-inputrule-on-enter/1118 for why this approach is needed.
const inlineInputRules = (rules: InlineInputRule[], commitCharacterExpression: RegExp) => {
const inlineInputRules = (rules: InputRuleData[], commitCharacterExpression: RegExp) => {
const getContentBeforeCursor = (cursorInformation: ResolvedPos) => {
const parent = cursorInformation.parent;
const offsetInParent = cursorInformation.parentOffset;
@@ -25,9 +26,11 @@ const inlineInputRules = (rules: InlineInputRule[], commitCharacterExpression: R
};
const getApplicableRule = (state: EditorState, cursor: number, justTypedText: string) => {
if (!rules.some(rule => justTypedText.endsWith(rule.matchEndCharacter))) {
const candidateRules = rules.filter(rule => justTypedText.endsWith(rule.commitCharacter ?? ''));
if (!candidateRules.length) {
return false;
}
const cursorInformation = state.doc.resolve(cursor);
const inCode = cursorInformation.parent.type.spec.code;
if (inCode) {
@@ -35,7 +38,7 @@ const inlineInputRules = (rules: InlineInputRule[], commitCharacterExpression: R
}
const beforeCursor = getContentBeforeCursor(cursorInformation) + justTypedText;
for (const rule of rules) {
for (const rule of candidateRules) {
const match = beforeCursor.match(rule.match);
if (!match) continue;
@@ -44,7 +47,7 @@ const inlineInputRules = (rules: InlineInputRule[], commitCharacterExpression: R
return null;
};
type PluginState = { pendingRule: InlineInputRule };
type PluginState = { pendingRule: InputRuleData };
const run = (view: EditorView, cursor: number, commitData: string) => {
const commitCharacter = commitCharacterExpression.exec(commitData) ? commitData : '';
@@ -57,7 +60,7 @@ const inlineInputRules = (rules: InlineInputRule[], commitCharacterExpression: R
const beforeCursor = getContentBeforeCursor(view.state.doc.resolve(cursor));
const match = beforeCursor.match(availableRule.match);
if (match) {
const transaction = availableRule.handler(view.state, match, cursor - match[0].length, cursor, commitCharacter);
const transaction = availableRule.handler(view, match, cursor - match[0].length, cursor, commitCharacter);
if (transaction) {
// closeHistory: Move the markup completion to a separate history event so that it
// can be undone separately.
@@ -109,17 +112,25 @@ const inlineInputRules = (rules: InlineInputRule[], commitCharacterExpression: R
return plugin;
};
const makeMarkInputRule = (
regExpString: string, matchEndCharacter: string, replacement: (matches: RegExpMatchArray)=> string, mark: MarkType,
): InlineInputRule => {
type OnReplace = (matches: RegExpMatchArray, view: EditorView)=> string;
interface InputRuleOptions {
contentRegex: string|RegExp;
commitCharacter: string|null; // null => only "Enter"
onReplace: OnReplace;
marks: MarkType[];
}
const makeInputRule = ({
contentRegex, commitCharacter, onReplace, marks,
}: InputRuleOptions): InputRuleData => {
const commitCharacterExp = '[.?!,:;¡¿() \\n]';
const regex = new RegExp(`(^|${commitCharacterExp})${regExpString}$`);
const regex = typeof contentRegex === 'string' ? new RegExp(`(^|${commitCharacterExp})${contentRegex}$`) : contentRegex;
return {
match: regex,
matchEndCharacter,
handler: (state, match, start, end, endCommitCharacter) => {
commitCharacter,
handler: (view, match, start, end, endCommitCharacter) => {
const state = view.state;
let transaction = state.tr.delete(start, end);
const marks = [schema.mark(mark)];
const startCommitCharacter = match[1];
@@ -131,13 +142,12 @@ const makeMarkInputRule = (
];
matchesWithoutCommitCharacters.groups = match.groups;
const replacementText = replacement(matchesWithoutCommitCharacters);
const replacement = onReplace(matchesWithoutCommitCharacters, view);
transaction = transaction.insert(
transaction.mapping.map(start, -1),
[
!!startCommitCharacter && schema.text(startCommitCharacter),
!!replacementText && schema.text(replacementText, marks),
!!replacement && schema.text(replacement, marks.map(type => schema.mark(type))),
!!endCommitCharacter && schema.text(endCommitCharacter),
].filter(node => !!node),
);
@@ -149,33 +159,51 @@ const makeMarkInputRule = (
const baseInputRules = buildInputRules(schema);
const inlineContentExp = '\\S[^\\n]*\\S|\\S';
const noMatchRegex = /$^/;
const inputRulesExtension = [
baseInputRules,
inlineInputRules([
makeMarkInputRule(
`\\*\\*(${inlineContentExp})\\*\\*`,
'*',
(match) => match[1],
schema.marks.strong,
),
makeMarkInputRule(
`\\*(${inlineContentExp})\\*`,
'*',
(match) => match[1],
schema.marks.emphasis,
),
makeMarkInputRule(
`_(${inlineContentExp})_`,
'_',
(match) => match[1],
schema.marks.emphasis,
),
makeMarkInputRule(
`[\`](${inlineContentExp})[\`]`,
'`',
(match) => match[1],
schema.marks.code,
),
makeInputRule({
contentRegex: /(^|[\n])(```+)(\w*)$/,
commitCharacter: '',
onReplace: (match, view) => {
const blockStart = `${match[1]}${match[2]}\n`;
const block = `${blockStart}\n${match[1]}`;
showCreateEditablePrompt({
source: block,
inline: false,
cursor: blockStart.length,
})(view.state, view.dispatch, view);
return '';
},
marks: [],
}),
], noMatchRegex),
inlineInputRules([
makeInputRule({
contentRegex: `\\*\\*(${inlineContentExp})\\*\\*`,
commitCharacter: '*',
onReplace: (match) => match[1],
marks: [schema.marks.strong],
}),
makeInputRule({
contentRegex: `\\*(${inlineContentExp})\\*`,
commitCharacter: '*',
onReplace: (match) => match[1],
marks: [schema.marks.emphasis],
}),
makeInputRule({
contentRegex: `_(${inlineContentExp})_`,
commitCharacter: '_',
onReplace: (match) => match[1],
marks: [schema.marks.emphasis],
}),
makeInputRule({
contentRegex: `\`(${inlineContentExp})\``,
commitCharacter: '`',
onReplace: (match) => match[1],
marks: [schema.marks.code],
}),
], /[ .,?)!;]/),
];
export default inputRulesExtension;

View File

@@ -23,13 +23,15 @@ const createEditorDialogForNode = (nodePosition: number, view: EditorView, onHid
view.state.doc.nodeAt(nodePosition)
);
const openCharacters = getNode().attrs.openCharacters ?? '';
const { dismiss } = createEditorDialog({
editorApi: getEditorApi(view.state),
source: [
getNode().attrs.openCharacters,
openCharacters,
getNode().attrs.source,
getNode().attrs.closeCharacters,
getNode().attrs.closeCharacters ?? '',
].join(''),
cursor: openCharacters.length,
onSave: async (source) => {
view.dispatch(
view.state.tr.setNodeAttribute(

View File

@@ -38,7 +38,11 @@ describe('showCreateEditorPrompt', () => {
test('should allow creating a new code block', async () => {
const editor = createEditor('');
showCreateEditablePrompt('```\ntest\n```', false)(editor.state, editor.dispatch, editor);
showCreateEditablePrompt({
source: '```\ntest\n```',
inline: false,
cursor: 8,
})(editor.state, editor.dispatch, editor);
const dialog = findEditorDialog();
dialog.submitButton.click();
@@ -54,4 +58,16 @@ describe('showCreateEditorPrompt', () => {
}],
});
});
test('should position the cursor at the provided location', () => {
const editor = createEditor('');
showCreateEditablePrompt({
source: '```\n\n```',
inline: false,
cursor: 4,
})(editor.state, editor.dispatch, editor);
const dialog = findEditorDialog();
expect(dialog.editor.selectionStart).toBe(4);
});
});

View File

@@ -5,13 +5,20 @@ import postProcessRenderedHtml from './utils/postProcessRenderedHtml';
import schema from '../../schema';
import { JoplinEditableAttributes } from './joplinEditablePlugin';
const showCreateEditablePrompt = (source: string, inline: boolean): Command => (_state, dispatch, view) => {
interface EditablePromptOptions {
source: string;
inline: boolean;
cursor: number;
}
const showCreateEditablePrompt = ({ source, inline, cursor }: EditablePromptOptions): Command => (_state, dispatch, view) => {
if (!dispatch) return true;
if (!view) throw new Error('Missing required argument: view');
createEditorDialog({
editorApi: getEditorApi(view.state),
source,
cursor,
onSave: async (newSource) => {
source = newSource;
},

View File

@@ -1,15 +1,17 @@
import { EditorApi } from '../../joplinEditorApiPlugin';
import { EditorLanguageType } from '../../../../types';
import showModal from '../../../utils/dom/showModal';
import { focus } from '@joplin/lib/utils/focusHandler';
interface Options {
source: string;
cursor: number;
editorApi: EditorApi;
onSave: (newContent: string)=> void;
onDismiss: ()=> void;
}
const createEditorDialog = ({ editorApi, source, onSave, onDismiss }: Options) => {
const createEditorDialog = ({ editorApi, source, cursor, onSave, onDismiss }: Options) => {
const content = document.createElement('div');
content.classList.add('editor-dialog-content');
document.body.appendChild(content);
@@ -22,9 +24,10 @@ const createEditorDialog = ({ editorApi, source, onSave, onDismiss }: Options) =
},
);
editor.updateBody(source);
editor.select(cursor, cursor);
const _ = editorApi.localize;
return showModal({
const modal = showModal({
content,
doneLabel: _('Done'),
onDismiss: () => {
@@ -32,6 +35,10 @@ const createEditorDialog = ({ editorApi, source, onSave, onDismiss }: Options) =
editor.remove();
},
});
focus('createEditorDialog', editor);
return modal;
};
export default createEditorDialog;

View File

@@ -48,6 +48,9 @@ const joplinEditorApiPlugin = new Plugin<EditorApi>({
updateBody: (newValue) => {
editor.textArea.value = newValue;
},
select: (anchor, head) => {
editor.textArea.setSelectionRange(Math.min(anchor, head), Math.max(anchor, head));
},
};
},
}),

View File

@@ -18,6 +18,7 @@ export interface CodeEditorControl {
focus: ()=> void;
remove: ()=> void;
updateBody: (newValue: string)=> void;
select: (from: number, to: number)=> void;
}
export type OnCodeEditorChange = (newValue: string)=> void;

View File

@@ -1,4 +1,8 @@
const baseConfig = require('../../jest.config.base.js');
module.exports = {
...baseConfig,
'moduleFileExtensions': [
'ts',
'tsx',

View File

@@ -1,6 +1,6 @@
{
"name": "@joplin/editor",
"version": "3.5.0",
"version": "3.6.0",
"description": "Web-based markdown editor",
"private": true,
"scripts": {
@@ -14,12 +14,12 @@
"url": "git+https://github.com/laurent22/joplin.git"
},
"devDependencies": {
"@joplin/lib": "~3.5",
"@joplin/utils": "~3.5",
"@joplin/lib": "~3.6",
"@joplin/utils": "~3.6",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.5.14",
"@types/node": "18.19.130",
"@types/react": "18.3.23",
"@types/react": "18.3.26",
"@types/react-redux": "7.1.33",
"@types/styled-components": "5.1.32",
"jest": "29.7.0",

View File

@@ -1,4 +1,8 @@
const baseConfig = require('../../jest.config.base.js');
module.exports = {
...baseConfig,
testMatch: [
'**/*.test.js',
],

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"id": "<%= pluginId %>",
"app_min_version": "3.5",
"app_min_version": "3.6",
"version": "1.0.0",
"name": "<%= pluginName %>",
"description": "<%= pluginDescription %>",

View File

@@ -1,4 +1,8 @@
const baseConfig = require('../../jest.config.base.js');
module.exports = {
...baseConfig,
testMatch: [
'**/*.test.js',
],

View File

@@ -1,6 +1,6 @@
{
"name": "generator-joplin",
"version": "3.5.1",
"version": "3.6.0",
"description": "Scaffolds out a new Joplin plugin",
"homepage": "https://github.com/laurent22/joplin/tree/dev/packages/generator-joplin",
"author": {
@@ -30,8 +30,8 @@
"yosay": "2.0.2"
},
"devDependencies": {
"@joplin/lib": "~3.5",
"@joplin/tools": "~3.5",
"@joplin/lib": "~3.6",
"@joplin/tools": "~3.6",
"jest": "29.7.0",
"ts-node": "10.9.2"
},

View File

@@ -1,4 +1,8 @@
const baseConfig = require('../../jest.config.base.js');
module.exports = {
...baseConfig,
testMatch: ['**/*.test.js'],
testPathIgnorePatterns: ['<rootDir>/node_modules/'],
};

View File

@@ -1,6 +1,6 @@
{
"name": "@joplin/htmlpack",
"version": "3.5.1",
"version": "3.6.0",
"description": "Pack an HTML file and all its linked resources into a single HTML file",
"main": "dist/index.js",
"types": "index.ts",

View File

@@ -1,6 +1,6 @@
import Resource from './models/Resource';
import shim from './shim';
import Database from './database';
import Database, { Row } from './database';
import { SqlQuery } from './services/database/types';
import addMigrationFile from './services/database/addMigrationFile';
import sqlStringToLines from './services/database/sqlStringToLines';
@@ -314,34 +314,44 @@ export default class JoplinDatabase extends Database {
throw new Error(`\`notes_fts\` (${countFieldsNotesFts} fields) must have the same number of fields as \`items_fts\` (${countFieldsItemsFts} fields) for the search engine BM25 algorithm to work`);
}
const tableRows = await this.selectAll('SELECT name FROM sqlite_master WHERE type=\'table\'');
interface TableRow {
name: string;
}
const tableRows: TableRow[] = await this.selectAll('SELECT name FROM sqlite_master WHERE type=\'table\'');
for (let i = 0; i < tableRows.length; i++) {
let pragmas: Row[] = [];
const tableName = tableRows[i].name;
if (tableName === 'android_metadata') continue;
if (tableName === 'table_fields') continue;
if (tableName === 'sqlite_sequence') continue;
if (tableName.indexOf('notes_fts') === 0) continue;
if (tableName.indexOf('items_fts') === 0) continue;
if (tableName === 'notes_spellfix') continue;
if (tableName === 'search_aux') continue;
try {
if (tableName === 'android_metadata') continue;
if (tableName === 'table_fields') continue;
if (tableName.startsWith('sqlite_')) continue;
if (tableName.indexOf('notes_fts') === 0) continue;
if (tableName.indexOf('items_fts') === 0) continue;
if (tableName === 'notes_spellfix') continue;
if (tableName === 'search_aux') continue;
const pragmas = await this.selectAll(`PRAGMA table_info("${tableName}")`);
pragmas = await this.selectAll(`PRAGMA table_info("${tableName}")`);
for (let i = 0; i < pragmas.length; i++) {
const item = pragmas[i];
// In SQLite, if the default value is a string it has double quotes around it, so remove them here
let defaultValue = item.dflt_value;
if (typeof defaultValue === 'string' && defaultValue.length >= 2 && defaultValue[0] === '"' && defaultValue[defaultValue.length - 1] === '"') {
defaultValue = defaultValue.substr(1, defaultValue.length - 2);
for (let i = 0; i < pragmas.length; i++) {
const item = pragmas[i];
// In SQLite, if the default value is a string it has double quotes around it, so remove them here
let defaultValue = item.dflt_value;
if (typeof defaultValue === 'string' && defaultValue.length >= 2 && defaultValue[0] === '"' && defaultValue[defaultValue.length - 1] === '"') {
defaultValue = defaultValue.substr(1, defaultValue.length - 2);
}
const q = Database.insertQuery('table_fields', {
table_name: tableName,
field_name: item.name,
field_type: Database.enumId('fieldType', item.type),
field_default: defaultValue,
});
queries.push(q);
}
const q = Database.insertQuery('table_fields', {
table_name: tableName,
field_name: item.name,
field_type: Database.enumId('fieldType', item.type),
field_default: defaultValue,
});
queries.push(q);
} catch (error) {
error.message = `On table: ${tableName}: Pragma: ${JSON.stringify(pragmas)}: ${error.message}`;
throw error;
}
}

View File

@@ -0,0 +1,24 @@
import { convertValuesToFunctions, sortByValue } from './ObjectUtils';
describe('ObjectUtils', () => {
test('should convert object values to functions', () => {
const v = convertValuesToFunctions({ a: 6, b: ()=>7, c: 'test' });
expect(v.a()).toBe(6);
expect(v.b()).toBe(7);
expect(v.c()).toBe('test');
});
test('should sort an object\'s entries by value', () => {
expect(sortByValue({
a: 1,
b: 'test1',
c: 'test3',
d: 'test2',
})).toEqual({
b: 'test1',
d: 'test2',
c: 'test3',
a: 1,
});
});
});

View File

@@ -1,5 +1,9 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
export function sortByValue(object: any) {
type AnyObject = Record<string|symbol, unknown>;
type SortableValue = string|number;
type SortableObject = Record<string, SortableValue>;
export function sortByValue<T extends SortableObject>(object: T): T {
const temp = [];
for (const k in object) {
if (!object.hasOwnProperty(k)) continue;
@@ -10,8 +14,8 @@ export function sortByValue(object: any) {
}
temp.sort((a, b) => {
let v1 = a.value;
let v2 = b.value;
let v1: SortableValue = a.value;
let v2: SortableValue = b.value;
if (typeof v1 === 'string') v1 = v1.toLowerCase();
if (typeof v2 === 'string') v2 = v2.toLowerCase();
if (v1 === v2) return 0;
@@ -28,8 +32,7 @@ export function sortByValue(object: any) {
return output;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
export function fieldsEqual(o1: any, o2: any) {
export function fieldsEqual(o1: AnyObject, o2: AnyObject) {
if ((!o1 || !o2) && o1 !== o2) return false;
for (const k in o1) {
@@ -45,8 +48,11 @@ export function fieldsEqual(o1: any, o2: any) {
return true;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
export function convertValuesToFunctions(o: any) {
type ValuesToFunctions<T extends AnyObject> = {
[k in keyof T]: T[k] extends ()=> unknown ? T[k] : ()=> T[k]
};
export function convertValuesToFunctions<T extends AnyObject>(o: T): ValuesToFunctions<T> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
const output: any = {};
for (const n in o) {
@@ -58,8 +64,7 @@ export function convertValuesToFunctions(o: any) {
return output;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
export function isEmpty(o: any) {
export function isEmpty(o: AnyObject|null) {
if (!o) return true;
return Object.keys(o).length === 0 && o.constructor === Object;
}

View File

@@ -1,6 +1,5 @@
import Setting, { AppType, SettingMetadataSection, SettingSectionSource } from '../../../models/Setting';
import SyncTargetRegistry from '../../../SyncTargetRegistry';
const ObjectUtils = require('../../../ObjectUtils');
const { _ } = require('../../../locale');
import { createSelector } from 'reselect';
import Logger from '@joplin/utils/Logger';
@@ -8,6 +7,7 @@ import Logger from '@joplin/utils/Logger';
import { type ReactNode } from 'react';
import { type Registry } from '../../../registry';
import settingValidations from '../../../models/settings/settingValidations';
import { convertValuesToFunctions } from '../../../ObjectUtils';
const logger = Logger.create('config-shared');
@@ -75,11 +75,11 @@ export const checkSyncConfig = async (comp: ConfigScreenComponent, settings: any
const SyncTargetClass = SyncTargetRegistry.classById(syncTargetId);
const options = {
...Setting.subValues(`sync.${syncTargetId}`, settings),
...Setting.subValues('net', settings) };
...Setting.subValues(`sync.${syncTargetId}`, settings, { includeConstants: true }),
...Setting.subValues('net', settings, { includeConstants: true }) };
comp.setState({ checkSyncConfigResult: 'checking' });
const result = await SyncTargetClass.checkConfig(ObjectUtils.convertValuesToFunctions(options));
const result = await SyncTargetClass.checkConfig(convertValuesToFunctions(options));
comp.setState({ checkSyncConfigResult: result });
if (result.ok) {

View File

@@ -151,7 +151,7 @@ shared.saveNoteButton_press = async function(comp: BaseNoteScreenComponent, stat
const savedNote = 'fields' in saveOptions && !saveOptions.fields.length ? { ...note } : await Note.save(note, saveOptions);
const stateNote = state.note;
const stateNote = comp.state.note;
// Note was reloaded while being saved.
if (!recreatedNote && (!stateNote || stateNote.id !== savedNote.id)) return releaseMutex();

View File

@@ -26,11 +26,6 @@ export interface ArchiveExtractOptions {
extractTo: string;
}
export interface CabExtractOptions extends ArchiveExtractOptions {
// Only files matching the pattern will be extracted
fileNamePattern: string;
}
export interface ZipEntry {
entryName: string;
name: string;
@@ -276,8 +271,4 @@ export default class FsDriverBase {
public async zipExtract(_options: ArchiveExtractOptions): Promise<ZipEntry[]> {
throw new Error('Not implemented: zipExtract');
}
public async cabExtract(_options: CabExtractOptions) {
throw new Error('Not implemented: cabExtract.');
}
}

View File

@@ -1,8 +1,6 @@
import AdmZip = require('adm-zip');
import FsDriverBase, { Stat, ZipEntry, ArchiveExtractOptions, CabExtractOptions } from './fs-driver-base';
import FsDriverBase, { Stat, ZipEntry, ArchiveExtractOptions } from './fs-driver-base';
import time from './time';
import { execCommand } from '@joplin/utils';
import { extname } from 'path';
const md5File = require('md5-file');
const fs = require('fs-extra');
@@ -218,25 +216,4 @@ export default class FsDriverNode extends FsDriverBase {
zip.extractAllTo(options.extractTo, false);
return zip.getEntries();
}
public async cabExtract(options: CabExtractOptions) {
if (process.platform !== 'win32') {
throw new Error('Extracting CAB archives is only supported on Windows.');
}
const source = this.resolve(options.source);
const extractTo = this.resolve(options.extractTo);
if (extname(source).toLowerCase() !== '.cab') {
throw new Error(`Invalid file extension. Expected .CAB. Was ${extname(source)}`);
}
// See https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/expand
await execCommand([
'expand.exe',
source,
`-f:${options.fileNamePattern}`,
extractTo,
], { quiet: true });
}
}

View File

@@ -1,3 +1,4 @@
const baseConfig = require('../../jest.config.base.js');
const testPathIgnorePatterns = [
'<rootDir>/node_modules/',
@@ -11,6 +12,7 @@ if (!process.env.IS_CONTINUOUS_INTEGRATION) {
}
module.exports = {
...baseConfig,
testMatch: [
'**/*.test.js',
],

View File

@@ -140,6 +140,9 @@
"A5": [
"A5"
],
"ABC musical notation: Options": [
""
],
"About": [
""
],
@@ -371,6 +374,9 @@
"Beta": [
""
],
"Block code": [
""
],
"Bold": [
"غامق"
],
@@ -497,6 +503,9 @@
"Checking... Please wait.": [
"التحقق جارٍ... فضلاً انتظر."
],
"Chinese/Japanese/Korean characters": [
""
],
"Choose an option": [
"إختر خيار"
],
@@ -569,6 +578,9 @@
"Command": [
"أمر"
],
"COMMAND": [
""
],
"Command palette": [
"لوحة الأوامر"
],
@@ -859,6 +871,9 @@
"Delete selected notes": [
"حدف الملاحظات المحددة"
],
"Delete tag \"%s\"?\n\nAll notes associated with this tag will remain, but the tag will be removed from all notes.": [
""
],
"Delete the Inbox notebook?\n\nIf you delete the inbox notebook, any email that's recently been sent to it may be lost.": [
""
],
@@ -946,6 +961,9 @@
"Displays the complete information about note.": [
"يعرض المعلومات الكاملة عن الملاحظة."
],
"Displays the configured keyboard shortcuts.": [
""
],
"Displays the given note.": [
"يعرض الملاحظة المعطاة."
],
@@ -1695,6 +1713,9 @@
"Keychain Supported: %s": [
"سلسلة المفاتيح المدعومة: %s"
],
"KEYS": [
""
],
"Keys that need upgrading": [
"المفاتيح التي تحتاج إلى ترقية"
],
@@ -1808,6 +1829,9 @@
"Manage your plugins": [
"إدارة الإضافات الخاصة بك"
],
"Manage your profiles. You can rename or delete profiles. The active profile cannot be deleted.": [
""
],
"Manual": [
"يدوي"
],
@@ -1985,6 +2009,9 @@
"No text editor is defined. Please set it using `config editor <editor-path>`": [
"لم يعرَّف محرر نصوص. فضلاً اضبطه باستخدام `config editor <editor-path>`"
],
"No URL for SAML authentication set.": [
""
],
"Nord": [
"Nord"
],
@@ -2141,6 +2168,9 @@
"Open Sync Wizard...": [
"فتح معالج المزامنة..."
],
"Open-source licences": [
""
],
"Open...": [
"فتح..."
],
@@ -2153,6 +2183,9 @@
"Options": [
"خيارات"
],
"Options that should be used whenever rendering ABC code. It must be a JSON5 object. The full list of options is available at: %s": [
""
],
"Other": [
""
],
@@ -2573,6 +2606,9 @@
"Select one of the other supported sync targets.": [
""
],
"Select the type of file to be imported:": [
""
],
"Self-hosted": [
""
],
@@ -2711,6 +2747,9 @@
"Source: ": [
"المصدر: "
],
"SPACE": [
""
],
"Spacer": [
""
],
@@ -3188,6 +3227,9 @@
"Try again": [
"حاول ثانية"
],
"TYPE": [
""
],
"Type `help [command]` for more information about a command; or type `help all` for the complete usage information.": [
"أكتب `help [command]` للمزيد من المعلومات عن أمر ما ، أو `help all` لمعلومات الاستخدام الكاملة."
],

View File

@@ -128,6 +128,9 @@
"A5": [
""
],
"ABC musical notation: Options": [
""
],
"About": [
""
],
@@ -332,6 +335,9 @@
"Beta": [
""
],
"Block code": [
""
],
"Bold": [
"Удебелен"
],
@@ -437,6 +443,9 @@
"Checking... Please wait.": [
"Проверявам... Моля изчакайте."
],
"Chinese/Japanese/Korean characters": [
""
],
"Chrome Web Store": [
""
],
@@ -497,6 +506,9 @@
"Command": [
""
],
"COMMAND": [
""
],
"Command palette": [
""
],
@@ -521,6 +533,9 @@
"Configuration": [
"Настройки"
],
"Configured keyboard shortcuts:": [
""
],
"Configures the size of scrollbars used in the app.": [
""
],
@@ -683,6 +698,9 @@
"Delete local data and re-download from sync target": [
""
],
"Delete tag \"%s\"?\n\nAll notes associated with this tag will remain, but the tag will be removed from all notes.": [
""
],
"Delete the Inbox notebook?\n\nIf you delete the inbox notebook, any email that's recently been sent to it may be lost.": [
""
],
@@ -764,6 +782,9 @@
"Displays the complete information about note.": [
"Показва пълната информация за бележката."
],
"Displays the configured keyboard shortcuts.": [
""
],
"Displays the given note.": [
"Показва зададената бележка."
],
@@ -1379,6 +1400,9 @@
"Keychain Supported: %s": [
""
],
"KEYS": [
""
],
"Keys that need upgrading": [
""
],
@@ -1466,6 +1490,9 @@
"Manage your plugins": [
""
],
"Manage your profiles. You can rename or delete profiles. The active profile cannot be deleted.": [
""
],
"Manual": [
"Ръчен"
],
@@ -1619,6 +1646,9 @@
"No text editor is defined. Please set it using `config editor <editor-path>`": [
"Няма зададен текстови редактор. Моля задайте го с командата: `config editor <път-до-редактора>`"
],
"No URL for SAML authentication set.": [
""
],
"None": [
""
],
@@ -1742,6 +1772,9 @@
"Open Sync Wizard...": [
""
],
"Open-source licences": [
""
],
"Open...": [
"Отвори..."
],
@@ -1754,6 +1787,9 @@
"Options": [
"Конфигурация"
],
"Options that should be used whenever rendering ABC code. It must be a JSON5 object. The full list of options is available at: %s": [
""
],
"Other": [
""
],
@@ -2162,6 +2198,9 @@
"Select one of the other supported sync targets.": [
""
],
"Select the type of file to be imported:": [
""
],
"Self-hosted": [
""
],
@@ -2282,6 +2321,9 @@
"Source format: %s": [
"Формат на източника: %s"
],
"SPACE": [
""
],
"Spacer": [
""
],
@@ -2739,6 +2781,9 @@
"Try it now": [
""
],
"TYPE": [
""
],
"Type `help [command]` for more information about a command; or type `help all` for the complete usage information.": [
"Въведете `help [команда]` за повече информация относно командата, или въведете `help all` за пълната информация за ползването на командния ред."
],

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