Compare commits

...

1646 Commits

Author SHA1 Message Date
ammarahm-ed
9ef9180894 web: refactor theme builder 2023-07-31 11:20:54 +05:00
ammarahm-ed
d1a2ec580d theme: use validateTheme in theme builder 2023-07-31 11:20:54 +05:00
ammarahm-ed
0a057e2b32 theme: update 2023-07-31 11:20:54 +05:00
ammarahm-ed
29611ffdef theme: add theme builder to web app 2023-07-31 11:20:54 +05:00
ammarahm-ed
85fa49f53e mobile: update theme 2023-07-31 11:14:25 +05:00
ammarahm-ed
703853bd8a mobile: fix floating button color 2023-07-31 10:14:13 +05:00
Abdullah Atta
9b046c6b6f web: improve button hover interaction 2023-07-31 10:04:56 +05:00
Abdullah Atta
d10e08a158 web: add support for loading theme from file 2023-07-29 16:04:45 +05:00
Abdullah Atta
ad67947ad7 theme: refactor theme-engine 2023-07-29 15:34:04 +05:00
Abdullah Atta
1574ae7a28 theme: add sourceURL property 2023-07-29 15:33:32 +05:00
ammarahm-ed
56201cb408 mobile: rename state 2023-07-29 11:44:05 +05:00
ammarahm-ed
b3fc476352 mobile: fix share extension crash 2023-07-29 11:36:22 +05:00
ammarahm-ed
fdd24a90d5 mobile: load theme from file 2023-07-28 18:41:22 +05:00
ammarahm-ed
5140fd7108 theme: fix theme validation 2023-07-28 18:11:31 +05:00
ammarahm-ed
becd852165 theme: add getPreviewColors & validateTheme 2023-07-28 16:40:16 +05:00
Abdullah Atta
700f5e4205 web: fix Loader errors on build 2023-07-27 12:52:53 +05:00
ammarahm-ed
4245ac1451 mobile: fix ui issues 2023-07-27 12:44:39 +05:00
ammarahm-ed
26e44798ec mobile: fix warning 2023-07-27 11:19:20 +05:00
Abdullah Atta
9648913a02 web: add loading indicator for themes loading 2023-07-26 22:15:48 +05:00
Abdullah Atta
7091f64de8 web: fix settings sidebar is not scrollable 2023-07-26 20:29:51 +05:00
Abdullah Atta
e5ec15fd9c editor: fix toolbar group padding everywhere 2023-07-26 20:20:45 +05:00
ammarahm-ed
c067c73b33 mobile: refactor 2023-07-26 20:10:43 +05:00
Abdullah Atta
d304f708c7 editor: adjust theming and styling of editor toolbar 2023-07-26 19:11:55 +05:00
ammarahm-ed
71cf9955cd misc: remove ThemeProvider usage 2023-07-26 18:43:07 +05:00
ammarahm-ed
c5fcfd6654 mobile: fix webpack build 2023-07-26 18:20:23 +05:00
Abdullah Atta
67a1c55420 web: fix login/signup theming 2023-07-26 17:19:55 +05:00
Abdullah Atta
6c54f28c0f theme: use zustand to manage theme engine state 2023-07-26 17:00:12 +05:00
Abdullah Atta
c576671302 editor: bring back icons in table menus 2023-07-26 15:56:33 +05:00
ammarahm-ed
6e663bf913 theme: remove caching 2023-07-26 13:55:35 +05:00
ammarahm-ed
0f999947ee mobile: fix color usage in message card 2023-07-25 12:21:37 +05:00
ammarahm-ed
ab458486a2 theme: use scope name to get current scope 2023-07-25 12:21:15 +05:00
ammarahm-ed
5e627b567f editor: set theme provider at app level 2023-07-25 12:19:43 +05:00
ammarahm-ed
2ef7baab0a editor: fix toolbar group alignments 2023-07-25 12:17:46 +05:00
ammarahm-ed
56ede7654a mobile: update theme 2023-07-24 14:52:22 +05:00
Abdullah Atta
18ccbc0ba3 web: fix navigation item hover & other colors 2023-07-24 13:38:40 +05:00
Abdullah Atta
73f50a34f9 web: fix only 1 theme showing in theme selector 2023-07-24 13:38:23 +05:00
Abdullah Atta
c0805b1915 theme: export button variant creation fn 2023-07-24 13:37:59 +05:00
Abdullah Atta
3c9a62b8ed config: add ui scope for commits 2023-07-24 12:39:06 +05:00
Abdullah Atta
b61c094a5d ui: use unique id for all menu items 2023-07-24 12:38:50 +05:00
Abdullah Atta
7f7390810f web: apply selected variant where appropriate 2023-07-24 12:31:26 +05:00
Abdullah Atta
09ea2f577b web: fix sort & group options not having submenus 2023-07-24 12:29:32 +05:00
Abdullah Atta
cbcd7a9e5a global: use single typescript version across the projects 2023-07-24 11:18:08 +05:00
Abdullah Atta
bca774dfd0 theme: add selected variant 2023-07-24 10:16:30 +05:00
Abdullah Atta
0b56bdb0c4 web: fix colors in places 2023-07-24 10:13:01 +05:00
Abdullah Atta
cdf481d581 web: bring back dark/light mode option in settings 2023-07-24 10:12:37 +05:00
Abdullah Atta
c644f606f3 web: add support for endless scrolling in themes 2023-07-24 10:12:17 +05:00
Abdullah Atta
c45e029780 mobile: remove react-native-blob-util 2023-07-22 06:58:16 +05:00
Abdullah Atta
59422d3e9c web: update lockfile 2023-07-22 06:56:04 +05:00
Abdullah Atta
f0df45bd82 Merge branch 'master' into theme-engine 2023-07-22 06:53:31 +05:00
Abdullah Atta
c5ce153c00 web: update lockfile 2023-07-22 06:49:43 +05:00
Abdullah Atta
3e7d68f524 web: add production server url 2023-07-22 06:46:15 +05:00
Abdullah Atta
e4eea50319 setup: add scope for themes server in bootstrap script 2023-07-22 06:25:24 +05:00
Abdullah Atta
d12e14ab34 ci: add workflow for publishing help 2023-07-22 06:05:17 +05:00
ammarahm-ed
c0a444d0c6 editor: use contentCopy icon for copy tool 2023-07-21 17:00:12 +05:00
ammarahm-ed
e16a5524b8 editor: use accent color for link 2023-07-21 17:00:12 +05:00
ammarahm-ed
c386e92831 desktop: add buttons in context menu for copy link
& copy link text
2023-07-21 17:00:12 +05:00
ammarahm-ed
ed277a95fb editor: add copy link tool 2023-07-21 17:00:12 +05:00
Abdullah Atta
c14b09ee1d docs: improve importing documentation 2023-07-21 15:58:19 +05:00
Abdullah Atta
47e0c54ab0 web: add theme details dialog 2023-07-19 13:11:06 +05:00
Ammar Ahmed
52fecc27ce editor: fix color picker height with bottom toolbar on desktop (#2976) 2023-07-19 13:10:20 +05:00
ammarahm-ed
056b24e936 mobile: fix landscape tablet mode 2023-07-19 07:45:02 +05:00
ammarahm-ed
e34607f244 mobile: fix sorting favorites 2023-07-19 07:37:26 +05:00
ammarahm-ed
7ba7bf64f0 editor: fix copy button is disabled in readonly mode 2023-07-19 06:12:31 +05:00
ammarahm-ed
6f51a98477 web: fix entering password closes publish dialog 2023-07-19 06:12:11 +05:00
Abdullah Atta
1ff1319e8a global: update lockfiles 2023-07-18 15:31:40 +05:00
Abdullah Atta
16c46d3fc7 theme: add isomorphic-fetch package 2023-07-18 15:27:59 +05:00
Abdullah Atta
cd7e0f5380 setup: parallelize bootstrap depending on device cpu cores 2023-07-18 15:14:40 +05:00
ammarahm-ed
8362c39277 mobile: update theme if new verison available 2023-07-18 12:57:00 +05:00
ammarahm-ed
eedf347708 mobile: update theme selector 2023-07-18 12:48:42 +05:00
Abdullah Atta
d95aba8cdd setup: add support for offline bootstrapping 2023-07-18 00:09:28 +05:00
Abdullah Atta
922fce7bcc ci: download build to apps/web 2023-07-17 23:34:07 +05:00
Abdullah Atta
9e3646ebc5 web: bump version to 2.5.8 2023-07-17 23:18:37 +05:00
Abdullah Atta
cdf3ea9dab web: disable native crypto due to stream encryption issues 2023-07-17 23:17:19 +05:00
Abdullah Atta
403b2809b7 web: add support for auto updating themes 2023-07-17 17:46:30 +05:00
Abdullah Atta
6c551eef0a theme: use vite-plugin-react to start theme server 2023-07-17 13:51:41 +05:00
ammarahm-ed
d34b354420 mobile: fix error 2023-07-17 09:55:46 +05:00
Abdullah Atta
38a4652c29 global: update lockfiles 2023-07-17 09:44:48 +05:00
Abdullah Atta
e38ac19a58 setup: fix bootstrap script for non-existent packages 2023-07-17 09:40:47 +05:00
Abdullah Atta
228c1a4d3a web: add support for theme search and theme switching 2023-07-14 22:54:47 +05:00
Abdullah Atta
7bca693c44 global: a huge set of changes
1. get rid of ThemeVariant. All variants can now be accessed anywhere.
2. remove unnecessary button variants
3. make buttons more responsive
4. implement themes server
2023-07-14 22:18:03 +05:00
absolutez3
9d3f309fc3 web: fix mastodon link in Settings (#2943)
Fix desktop Mastodon link

Signed-off-by: absolutez3 <43919538+absolutez3@users.noreply.github.com>
2023-07-13 22:04:44 +05:00
ammarahm-ed
6b7eb9a1f2 mobile: release v2.5.6 2023-07-13 15:39:43 +05:00
ammarahm-ed
d2165c99f1 editor: fix cursor position on return 2023-07-13 13:35:45 +05:00
ammarahm-ed
8b538b833b mobile: fix trash cleanup interval text 2023-07-13 11:18:43 +05:00
ammarahm-ed
2977fb39e4 mobile: prevent action if already processing 2023-07-13 10:38:36 +05:00
ammarahm-ed
01cb43ba2e core: do not download media for text exports 2023-07-13 10:38:36 +05:00
Abdullah Atta
583fa3da49 global: fix @trpc/* versions 2023-07-13 10:11:07 +05:00
ammarahm-ed
4b68a083c5 mobile: fix file and image upload 2023-07-13 09:57:58 +05:00
Abdullah Atta
5854a3eef5 web: fix service worker to allow Notesnook to behave as a PWA again (#2905)
* web: make service worker work again

* web: only enable sourcemap during dev
2023-07-12 06:51:14 +05:00
ammarahm-ed
df5cbacc8a mobile: search tags with db.lookup 2023-07-11 19:03:18 +05:00
Ammar Ahmed
05fa30a039 mobile: fix setting Monographs as default home causes crash (#2919)
* mobile: navigation params can be undefined

* mobile: fix setting Monographs as default home causes crash
2023-07-11 18:58:25 +05:00
Abdullah Atta
2ff73e241d web: fix imports 2023-07-11 15:54:47 +05:00
Abdullah Atta
fe2c753068 editor: update katex patch 2023-07-11 15:38:34 +05:00
Abdullah Atta
19201186c5 global: fix @emotion/react version to 11.11.1 2023-07-11 15:36:26 +05:00
ammarahm-ed
b2dd6b750d editor: fix build 2023-07-11 15:30:02 +05:00
Abdullah Atta
25380ec052 web: finalize new theme engine on web 2023-07-11 15:11:52 +05:00
ammarahm-ed
81cc687e1e server: theme updates 2023-07-11 10:08:42 +05:00
ammarahm-ed
1dab6be32d server: show ip & port on start server 2023-07-10 18:22:55 +05:00
ammarahm-ed
b9bfeee126 server: fix types 2023-07-10 18:15:21 +05:00
ammarahm-ed
a06fa9f00e server: reset cache on sync repo 2023-07-10 15:59:55 +05:00
ammarahm-ed
b147afbefe mobile: add client from theme server 2023-07-10 15:58:54 +05:00
ammarahm-ed
7646f35e58 server: support themes query pagination 2023-07-10 15:58:28 +05:00
ammarahm-ed
beb782b9ad theme: add previewColors 2023-07-10 13:29:11 +05:00
ammarahm-ed
6e3f706b3a server: add theme server 2023-07-10 10:40:39 +05:00
ammarahm-ed
f01d415415 mobile: fix bottom padding 2023-07-08 13:25:18 +05:00
ammarahm-ed
b6417d0016 mobile: fix theme colors 2023-07-08 12:45:10 +05:00
ammarahm-ed
f1ab8e92bd misc: fix colors 2023-07-08 11:58:46 +05:00
ammarahm-ed
80ffbc511d mobile: fix build 2023-07-08 11:50:26 +05:00
ammarahm-ed
745bf65641 misc: fix build 2023-07-08 11:13:55 +05:00
Abdullah Atta
adabf488ee web: change output hash size to 12 chars 2023-07-08 11:13:48 +05:00
ammarahm-ed
a0015af169 Merge branch 'master' into theme-engine 2023-07-08 11:00:21 +05:00
Abdullah Atta
e86b7c68e6 web: remove CSP 2023-07-06 15:35:53 +05:00
Abdullah Atta
c5b974e055 web: add worker-src to CSP 2023-07-06 15:18:04 +05:00
ammarahm-ed
b3695d4a93 misc: update lock files 2023-07-06 11:51:10 +05:00
ammarahm-ed
b5e5450452 mobile: bump version to v2.5.5 2023-07-06 11:30:20 +05:00
ammarahm-ed
d19cddccea editor: use 16px as default font size if font
value is string
2023-07-06 11:30:20 +05:00
ammarahm-ed
c61649f7fa editor: fix clipboard on mobile 2023-07-06 11:30:20 +05:00
Abdullah Atta
13b8580b2f desktop: add support for automatic updates 2023-07-06 11:15:44 +05:00
Abdullah Atta
aba2b0ea19 web: update last synced time on sync complete 2023-07-06 11:14:04 +05:00
Abdullah Atta
0894637b61 desktop: add @types/yargs 2023-07-06 11:14:04 +05:00
Abdullah Atta
5970aabb0d misc: remove mention of Lerna 2023-07-06 11:14:04 +05:00
Abdullah Atta
72a25dcf34 global: get rid of lerna 2023-07-06 11:14:04 +05:00
Ammar Ahmed
6fff30bd89 mobile: hide new update sheet (#2893) 2023-07-06 09:29:35 +05:00
Abdullah Atta
a9a71834b8 config: fix eslint on vscode 2023-07-06 08:34:07 +05:00
Abdullah Atta
8ec4865e23 desktop: fix tray icons not loading 2023-07-05 22:41:31 +05:00
Abdullah Atta
111c7ef954 core: fix Cannot read properties of undefined (reading 'length') error 2023-07-05 22:19:43 +05:00
Abdullah Atta
35a37458e4 web: make sure vault settings all have unique key 2023-07-05 22:03:33 +05:00
Abdullah Atta
92bafbafa7 web: bump version to 2.5.7 2023-07-05 17:22:43 +05:00
Abdullah Atta
2705caf6bd web: do not show update available dialog 2023-07-05 17:18:01 +05:00
Abdullah Atta
8380c7d994 web: rename reminder to notice for in-app notices 2023-07-05 17:00:23 +05:00
Ammar Ahmed
550c0f3854 mobile: fix topic sheet hidden on tablet (#2886) 2023-07-05 16:36:04 +05:00
Abdullah Atta
04cd135295 web: nav menu should be narrow on tablet 2023-07-05 15:46:47 +05:00
Abdullah Atta
e212a080c2 web: hide duplicate buttons on tablet 2023-07-05 15:46:30 +05:00
Abdullah Atta
533abb58db web: various fixes to settings 2023-07-05 15:46:10 +05:00
Abdullah Atta
941a542cc6 desktop: fix start command 2023-07-05 15:44:24 +05:00
ammarahm-ed
5bcda2cd3a editor: fix error Cannot find name 'Writeable' 2023-07-05 13:52:08 +05:00
Abdullah Atta
869d8ba8f9 config: set git.rebaseWhenSync to true 2023-07-05 13:41:06 +05:00
Abdullah Atta
984e8f8780 global: use node scripts directly everywhere 2023-07-05 13:40:09 +05:00
ammarahm-ed
750b61fb75 mobile: fix size scaling on tablets 2023-07-05 13:29:08 +05:00
Abdullah Atta
4a2defa300 web: allow changing primary 2fa method 2023-07-05 13:24:09 +05:00
Felipe Muñoz Mazur
5c9f7a8bcb editor: add clipboard button to the codeblock (#2710)
Signed-off-by: Felipe Muñoz Mazur <felipe.munoz.mazur@protonmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-07-05 13:09:12 +05:00
Abdullah Atta
b66caa9848 web: fix sync test 2023-07-05 12:14:58 +05:00
Ammar Ahmed
81cac1e54f mobile: fix saving note from share extension (#2874) 2023-07-05 12:07:48 +05:00
Abdullah Atta
36a99cd64f web: add missing change password logic 2023-07-05 11:56:41 +05:00
Abdullah Atta
8c494642e4 editor: do not cache images without hash 2023-07-05 11:56:00 +05:00
Ammar Ahmed
7ab4088331 mobile: optimize screens for very small displays (#2885) 2023-07-05 11:52:13 +05:00
Abdullah Atta
580af33caf Merge branch 'master' of https://github.com/streetwriters/notesnook 2023-07-05 11:49:08 +05:00
Abdullah Atta
bbeeacc480 desktop: use node directly for dev server instead of turbowatch 2023-07-05 11:45:13 +05:00
Ammar Ahmed
51efef5005 mobile: fix tablet mode (#2884) 2023-07-05 09:51:32 +05:00
Abdullah Atta
ee030c8f61 web: fix @trpc/client version 2023-07-05 01:07:44 +05:00
Abdullah Atta
20835e1fb3 web: migrate views to typescript 2023-07-04 22:52:23 +05:00
Abdullah Atta
b542680e7a web: convert home view to typescript (rename to all-notes) 2023-07-04 22:48:14 +05:00
Abdullah Atta
fb32aedd69 web: convert more code to typescript 2023-07-04 22:44:55 +05:00
Abdullah Atta
56f6d34995 web: fix @trpc/{client,server} versions 2023-07-04 22:44:38 +05:00
Abdullah Atta
c68e380a0f web: remove unnecessary code 2023-07-04 22:05:15 +05:00
Abdullah Atta
fc5507bdd3 web: ignore Could not connect to the Sync server error 2023-07-04 18:06:17 +05:00
Abdullah Atta
3f0a656a36 web: force update token if email is already confirmed (#2879) 2023-07-04 16:50:52 +05:00
Abdullah Atta
60667149d4 web: check for internet reachability before sync 2023-07-04 16:43:40 +05:00
Abdullah Atta
cdb3ede207 config: update vscode settings 2023-07-04 16:33:52 +05:00
Abdullah Atta
445494ce95 web: set status as completed whenever sync completes 2023-07-04 16:33:31 +05:00
Abdullah Atta
972f52fd01 core: key should always be present in old attachment 2023-07-04 15:14:40 +05:00
ammarahm-ed
f5e86d668f mobile: set hosts before db setup 2023-07-04 12:19:18 +05:00
Abdullah Atta
0e817236a1 Merge branch 'master' of https://github.com/streetwriters/notesnook 2023-07-04 11:12:31 +05:00
Abdullah Atta
0ea3b3ac2a web: set hosts before database setup 2023-07-04 11:12:24 +05:00
Abdullah Atta
7bfaef82d8 web: debounce page visibility events 2023-07-04 11:11:55 +05:00
ammarahm-ed
f51220c9a8 mobile: remove db.notes.init 2023-07-04 11:02:19 +05:00
Abdullah Atta
88e9ca721a desktop: further improve window creation time 2023-07-04 09:43:17 +05:00
Abdullah Atta
c1ab444646 clipper: update lockfile 2023-07-04 09:43:17 +05:00
Abdullah Atta
b497b53ef2 desktop: fix run command on all platforms 2023-07-04 09:43:17 +05:00
Abdullah Atta
80decaae8a desktop: use app icon path from asset manager 2023-07-04 09:43:17 +05:00
Abdullah Atta
41197cb52c desktop: do not use asar for faster startup 2023-07-04 09:43:17 +05:00
Abdullah Atta
d14abcbba7 desktop: restructure window creation for faster loading 2023-07-04 09:43:17 +05:00
Abdullah Atta
cd36fc8d4a desktop: remove unneeded stat call when loading files 2023-07-04 09:43:17 +05:00
Abdullah Atta
e872487724 desktop: use vitejs for loading the correct bridge 2023-07-04 09:43:17 +05:00
Abdullah Atta
5e7e91caf0 desktop: stop unnecessary animations 2023-07-04 09:43:17 +05:00
Abdullah Atta
a971a29ff2 desktop: load db before app render 2023-07-04 09:43:17 +05:00
Abdullah Atta
a967482c4f core: init notes with database 2023-07-04 09:43:17 +05:00
Abdullah Atta
f91ada3c48 web: use own kvstore instead of localforage
localforage is unmaintained and also has a huge footprint not to mention
the performance issues.
2023-07-04 09:43:17 +05:00
Abdullah Atta
44782d552d web: make compression async 2023-07-04 09:43:17 +05:00
Ammar Ahmed
a51dfb4033 editor: fix toolbar buttons alignment (#2876) 2023-07-03 23:01:35 +05:00
Ammar Ahmed
ccb18e9335 mobile: fix changing font family causes editor crash (#2875) 2023-07-03 21:54:24 +05:00
Abdullah Atta
194556a0a1 clipper: remove comlink-extension package 2023-06-30 20:14:25 +05:00
Abdullah Atta
8f828bca80 web: bump version to 2.5.6 2023-06-30 19:07:17 +05:00
Abdullah Atta
a967234ddb web: fix subscription plan not changing from monthly 2023-06-30 19:05:52 +05:00
Abdullah Atta
bbcf7d1206 desktop: fix backups not saving 2023-06-28 16:15:15 +05:00
ammarahm-ed
6904045c7f mobile: disable updates check in fdroid release 2023-06-27 16:17:44 +05:00
ammarahm-ed
59c4052765 mobile: update project.pbxproj 2023-06-27 10:04:41 +05:00
ammarahm-ed
d3c47d3321 mobile: release 2.5.4 2023-06-27 09:11:54 +05:00
Abdullah Atta
221767ed4d misc: make generate-sources script independent of zx 2023-06-27 05:57:59 +05:00
Ammar Ahmed
4843d1c39e mobile: update mobile app to react-native 0.72.0 (#2814)
* mobile: upgrade to react-native 0.71

* mobile: update to react-native 0.72.0

* mobile: fix release build on android

* mobile: fix editor stuck in loading state

* mobile: fix bootsplash logo in dark mode

* mobile: update patch files

* mobile: cleanup

* mobile: increase delay

* mobile: add logs on upload

* mobile: ensure editor is ready before note loading

* mobile: fix ui

* mobile: fix

* ci: update workflow

* ci: undo workflow changes

---------

Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2023-06-26 21:50:20 +05:00
Abdullah Atta
ebc28bca62 crypto: update vitest to 0.32.2 2023-06-26 17:51:53 +05:00
Abdullah Atta
52dcf868b4 misc: add script for generating flatpak sources 2023-06-26 15:07:59 +05:00
Abdullah Atta
e7bcad29f7 web: bump version to 2.5.5 2023-06-26 14:53:44 +05:00
ammarahm-ed
33c939f5ca web: fix account deletion not working 2023-06-26 13:45:39 +05:00
Abdullah Atta
e6b9219d75 crypto: set length when converting uint8array to buffer 2023-06-26 13:44:51 +05:00
Abdullah Atta
5774daf3a9 web: update fflate to v0.8.0 2023-06-26 13:44:39 +05:00
Abdullah Atta
b8181c4a1b web: remove leading "/" in zip filenames 2023-06-26 13:44:39 +05:00
Abdullah Atta
408cd5a9f3 global: run prettier & eslint on all files 2023-06-26 13:43:57 +05:00
Abdullah Atta
42a76c6b03 Merge branch 'master' of https://github.com/streetwriters/notesnook 2023-06-26 13:25:54 +05:00
Abdullah Atta
7fa88ff8fb desktop: make it possible to run dev server on Windows 2023-06-26 13:25:46 +05:00
Abdullah Atta
cafd854b8c web: add support for exporting locked notes 2023-06-26 13:14:28 +05:00
Abdullah Atta
8c58c512ed core: only rewrite html if images are found 2023-06-26 13:14:28 +05:00
Abdullah Atta
3ab104e000 core: do not send download event if notify is false 2023-06-26 13:14:28 +05:00
Abdullah Atta
55f8a226c8 web: use async zip for faster zipping 2023-06-26 13:14:28 +05:00
Abdullah Atta
0cca9e1ff8 core: fix crash when exporting note with task list 2023-06-26 13:14:28 +05:00
Abdullah Atta
1fb43b7dfe core: export with empty content if no content found 2023-06-26 13:14:28 +05:00
Abdullah Atta
e138aef6a9 config: force unix style line endings 2023-06-26 13:14:28 +05:00
Abdullah Atta
8d7b444664 core: autofix issue where locked note is not encrypted 2023-06-26 13:14:28 +05:00
Abdullah Atta
4a5c5fd3bf config: set default eol sequence to LF 2023-06-26 13:14:28 +05:00
Abdullah Atta
8fb0071cf0 ci: only bootstrap the required projects when building desktop app 2023-06-23 19:12:41 +05:00
Abdullah Atta
bb1cb8dc33 web: consider canceled Pro subscription as Pro 2023-06-23 19:05:53 +05:00
Abdullah Atta
533884e534 desktop: make window.os a function 2023-06-23 19:04:34 +05:00
Abdullah Atta
f5c2962951 web: bump version to 2.5.4 2023-06-23 14:23:27 +05:00
Abdullah Atta
8d285c93d9 editor: insert image/attachment after selected node 2023-06-23 14:23:03 +05:00
ammarahm-ed
fc10e957fb editor: fix search-replace regex 2023-06-23 14:21:12 +05:00
Abdullah Atta
eb35d41321 desktop: fix "object has been destoryed" error 2023-06-23 11:51:01 +05:00
Abdullah Atta
99808293a7 web: pin pdfjs-dist version 2023-06-23 11:42:10 +05:00
Abdullah Atta
10fafa885a crypto: convert to buffer before using input length 2023-06-23 11:40:20 +05:00
Abdullah Atta
9096e7711d web: do not bundle pwa assets for desktop build 2023-06-23 11:40:03 +05:00
Abdullah Atta
25cbdbd409 desktop: fix crash due to undici fetch 2023-06-23 11:40:03 +05:00
Abdullah Atta
0216867fa9 web: reset importer on pressing "Start over" 2023-06-23 11:39:51 +05:00
Abdullah Atta
f832aba1a4 web: fix issues with desktop integration settings 2023-06-23 11:39:51 +05:00
Abdullah Atta
8df9c49fa1 desktop: zod considers false as undefined and throws error 2023-06-23 11:39:51 +05:00
Abdullah Atta
b733eb3c44 web: fix settings dialog going blank on clicking a checkbox 2023-06-23 11:39:51 +05:00
Abdullah Atta
addbd53d7a web: consider canceled pro users as Pro 2023-06-23 11:39:51 +05:00
Abdullah Atta
5f42f11fb1 web: simplify settings dialog markup 2023-06-23 11:39:51 +05:00
Abdullah Atta
30072576ce web: preload settings dialog for faster loading 2023-06-23 11:39:51 +05:00
Abdullah Atta
48371b6364 web: add toolbar settings in new settings dialog 2023-06-23 11:39:51 +05:00
Abdullah Atta
90ef877942 editor: only collapse/expand outline list with LMB 2023-06-23 11:39:27 +05:00
Abdullah Atta
c91bc819be web: enable CSS autoprefixing on build 2023-06-23 11:39:27 +05:00
Abdullah Atta
6c25a70a51 docs: change edit_root to master branch 2023-06-22 11:06:20 +05:00
Abdullah Atta
9e2b9fa6f1 docs: minor fixes & improvements to editor help 2023-06-22 11:06:20 +05:00
Abdullah Atta
5663c507e9 docs: fix broken navigation link 2023-06-22 11:06:20 +05:00
Abdullah Atta
d6fce5ad18 docs: add more markdown shortcuts 2023-06-22 11:06:20 +05:00
ammarahm-ed
9125e41e9a docs: add meta descriptions 2023-06-22 11:06:20 +05:00
ammarahm-ed
0498604848 docs: add clear vault & delete vault docs 2023-06-22 11:06:20 +05:00
ammarahm-ed
26902cb969 docs: add meta descriptions 2023-06-22 11:06:20 +05:00
ammarahm-ed
915f21d59a docs: adjust markdown shortcuts table 2023-06-22 11:06:20 +05:00
ammarahm-ed
e7f4ba8b57 docs: fix slug 2023-06-22 11:06:20 +05:00
ammarahm-ed
0bdcfff561 docs: update slugs 2023-06-22 11:06:20 +05:00
ammarahm-ed
b330445531 docs: update slug 2023-06-22 11:06:20 +05:00
ammarahm-ed
053ad1927b docs: optimize docs 2023-06-22 11:06:20 +05:00
ammarahm-ed
31ff047a34 docs: add table & task lists docs 2023-06-22 11:06:20 +05:00
ammarahm-ed
7f9c24e061 docs: add help for editor & toolbar 2023-06-22 11:06:20 +05:00
ammarahm-ed
9d8689bbce docs: add pages for editor help 2023-06-22 11:06:20 +05:00
Abdullah Atta
5dabd07f38 docs: add page about deleting your account 2023-06-22 11:06:20 +05:00
ammarahm-ed
41f0a4e101 docs: fix ui & typos 2023-06-22 11:06:20 +05:00
Abdullah Atta
ce1bc83e38 docs: add analytics 2023-06-22 11:06:20 +05:00
Abdullah Atta
0ef53f17cb docs: add 404 page for not found errors 2023-06-22 11:06:20 +05:00
Abdullah Atta
574d638c94 docs: change base_url to help.notesnook.com 2023-06-22 11:06:20 +05:00
Abdullah Atta
78a543dad4 docs: organization -> organizing-notes 2023-06-22 11:06:20 +05:00
Abdullah Atta
8c857e58b7 docs: add robots.txt 2023-06-22 11:06:20 +05:00
Abdullah Atta
61c96e7b58 docs: add meta title & favicon 2023-06-22 11:06:20 +05:00
Abdullah Atta
ea02552634 docs: finalize slugs & other minor fixes 2023-06-22 11:06:20 +05:00
Abdullah Atta
4438d96d9c docs: minor fixes to mobile integration docs 2023-06-22 11:06:20 +05:00
ammarahm-ed
5c4fee8f98 docs: update mobile integration docs 2023-06-22 11:06:20 +05:00
ammarahm-ed
0179a81d52 docs: add share extension help guide 2023-06-22 11:06:20 +05:00
Abdullah Atta
0d5cd2e554 docs: improve contrast of foreground colors 2023-06-22 11:06:20 +05:00
Abdullah Atta
47006b8648 docs: add docs for account recovery 2023-06-22 11:06:20 +05:00
Abdullah Atta
1a701d2a64 docs: add base_url to enable sitemap generation 2023-06-22 11:06:20 +05:00
Abdullah Atta
adae78d2df docs: add docs for desktop integration 2023-06-22 11:06:20 +05:00
Abdullah Atta
c6fe3ea91d docs: add docs for spell checker 2023-06-22 11:06:20 +05:00
Abdullah Atta
69c152948e docs: add privacy mode docs 2023-06-22 11:06:20 +05:00
Abdullah Atta
fb9a1af93c docs: improve docs theme 2023-06-22 11:06:20 +05:00
Abdullah Atta
dfe7e7d459 docs: use custom fonts 2023-06-22 11:06:20 +05:00
Abdullah Atta
2e807cdd0b docs: add docs for web clipper 2023-06-22 11:06:20 +05:00
ammarahm-ed
6f80d2e7b2 docs: minor fixes to Monographs help 2023-06-22 11:06:20 +05:00
ammarahm-ed
e49c2e8ccc docs: improve help for notes exporting 2023-06-22 11:06:20 +05:00
ammarahm-ed
3fec04466e docs: improve help for backup & restore 2023-06-22 11:06:20 +05:00
Abdullah Atta
93c2115f4b docs: add edit root to get Edit this page link at bottom 2023-06-22 11:06:20 +05:00
Abdullah Atta
8716d3076a docs: change theme colors to notesnook defaults 2023-06-22 11:06:20 +05:00
Abdullah Atta
5ec5517778 docs: reorder docs using the index frontmatter property 2023-06-22 11:06:20 +05:00
ammarahm-ed
8cb0644cd0 docs: add help on how to organize your notes 2023-06-22 11:06:20 +05:00
Abdullah Atta
56947d942d docs: fix headings hierarchy 2023-06-22 11:06:20 +05:00
Abdullah Atta
3ea810a059 docs: migrate to new callout syntax 2023-06-22 11:06:20 +05:00
ammarahm-ed
723bb67a6f docs: add help for backup/restore, vault, organization & monographs 2023-06-22 11:06:20 +05:00
ammarahm-ed
f0e68afdf8 docs: remove unused images 2023-06-22 11:06:20 +05:00
ammarahm-ed
7c0d8c25d3 docs: add importer docs 2023-06-22 11:06:20 +05:00
ammarahm-ed
641d78fdb2 docs: init and add first articles 2023-06-22 11:06:20 +05:00
Abdullah Atta
1c43da0eb0 desktop: regenerate package-lock.json 2023-06-21 15:46:25 +05:00
Abdullah Atta
87de351170 misc: move essential deps from devDependencies 2023-06-21 15:45:55 +05:00
Abdullah Atta
31726f6d86 ci: use npx electron-builder directly 2023-06-20 20:31:32 +05:00
Abdullah Atta
548eda9a26 desktop: do not load native crypto on ARM windows app 2023-06-20 20:24:10 +05:00
Abdullah Atta
dc6fa89c9c desktop: fix build script 2023-06-20 20:21:14 +05:00
Abdullah Atta
cdda26f32f Merge branch 'master' of https://github.com/streetwriters/notesnook 2023-06-20 20:17:07 +05:00
Abdullah Atta
a8470c9fea desktop: make builds work on windows 2023-06-20 20:16:48 +05:00
Abdullah Atta
4fa2bc6bb6 desktop: set cwd as data path for portable binaries 2023-06-20 20:15:58 +05:00
Abdullah Atta
8aacf49f07 ci: minor changes to desktop publish workflow 2023-06-20 18:41:00 +05:00
Abdullah Atta
d14c712b79 web: only run top-level-await transform in prod builds 2023-06-20 17:50:23 +05:00
Abdullah Atta
fb90ef3137 web: support top-level-await transform in desktop builds 2023-06-20 17:49:23 +05:00
Abdullah Atta
f733e6e95b core: convert object-id to es2015 class 2023-06-20 17:48:48 +05:00
Abdullah Atta
3ae3465e84 web: bump version to 2.5.3 2023-06-20 16:00:45 +05:00
Abdullah Atta
9abe85f1c9 web: minor UI fixes 2023-06-20 16:00:45 +05:00
ammarahm-ed
6194367c1e mobile: release 2.5.3 2023-06-20 14:43:48 +05:00
Abdullah Atta
4e793317ca desktop: set NO_COLOR=true when running scripts 2023-06-20 14:43:29 +05:00
Abdullah Atta
eb6927cbce web: add image source cache for caching blobs 2023-06-20 14:42:20 +05:00
Abdullah Atta
b7762ceaae crypto: make base64 enc compatible on node & browser 2023-06-20 13:18:11 +05:00
ammarahm-ed
53b545f84c mobile: enable encrypted backups on login 2023-06-20 12:43:37 +05:00
Abdullah Atta
4195150005 web: enable encrypted backups for all logged in users 2023-06-20 12:43:37 +05:00
Abdullah Atta
0a8c045f6f web: disable auto backups by default 2023-06-20 12:43:37 +05:00
ammarahm-ed
f4fe2c6a65 mobile: enable encrypted backups by default 2023-06-20 12:43:37 +05:00
ammarahm-ed
11e109740b core: allow encrypted backups for all users 2023-06-20 12:43:37 +05:00
ammarahm-ed
d882c7cf9f mobile: disable default auto-backup on 2023-06-20 12:43:37 +05:00
Abdullah Atta
eb8b58a559 web: migrate navigation to typescript 2023-06-20 12:36:21 +05:00
ammarahm-ed
2b94212552 mobile: fix module resolution 2023-06-20 12:04:38 +05:00
Ammar Ahmed
04d122c47c mobile: fix input hides behind keyboard on focus (#2767) 2023-06-20 11:33:48 +05:00
Ammar Ahmed
6c9c99681e mobile: fix scroll into view on keyboard shown (#2762) 2023-06-19 19:04:53 +05:00
ammarahm-ed
f0a4a61e1d mobile: add email support button in settings 2023-06-19 16:15:55 +05:00
Abdullah Atta
f88c610495 editor: make web clips selectable in readonly mode 2023-06-19 13:16:39 +05:00
Abdullah Atta
f9cb9fa3cc web: add option to contact us via email in settings 2023-06-19 12:54:34 +05:00
Abdullah Atta
3c6622ccf0 web: create vault should be under pro 2023-06-19 12:35:43 +05:00
ammarahm-ed
df82e84c83 web: add default dropdown value text 2023-06-19 12:19:56 +05:00
ammarahm-ed
abd136c7c2 web: disable import button when no files selected 2023-06-19 12:19:56 +05:00
Abdullah Atta
c61082cdee web: add manage attachments button in settings 2023-06-19 12:19:42 +05:00
ammarahm-ed
b9b21a760a mobile: limit input value between min/max 2023-06-19 11:58:50 +05:00
ammarahm-ed
acc852e23b web: limit input value between mix/max 2023-06-19 11:58:50 +05:00
ammarahm-ed
36ae9383ba web: fix onChange not fired on input 2023-06-19 11:42:39 +05:00
ammarahm-ed
c04df4b4c8 mobile: fix failing tests 2023-06-19 07:49:40 +05:00
Abdullah Atta
5c849c39b4 web: update sync status on auto sync completion 2023-06-17 19:13:54 +05:00
Abdullah Atta
9bae058d16 crypto: force convert IV to urlsafe base64 variant 2023-06-17 19:13:30 +05:00
Abdullah Atta
db2d48a083 web: fix navigation on small screens & mobiles 2023-06-17 18:20:13 +05:00
Abdullah Atta
628d3bd9ff core: do not include trashed notes in total notebook notes 2023-06-17 18:20:04 +05:00
Abdullah Atta
cdbca8ac22 web: fix crash on viewing a merge conflict 2023-06-17 18:19:58 +05:00
Abdullah Atta
8d2c0762db web: allow focusing editor by clicking at the bottom 2023-06-17 18:19:52 +05:00
Abdullah Atta
992f4fc697 web: fix pane sizes getting reset randomly on startup 2023-06-17 18:19:39 +05:00
Abdullah Atta
cb1d09904b web: remove settings test from navigation tests 2023-06-17 13:36:01 +05:00
Abdullah Atta
2441a4505e web: remove react-toggle 2023-06-17 13:36:01 +05:00
Abdullah Atta
79aae86906 web: fix broken build 2023-06-17 13:36:01 +05:00
Abdullah Atta
cd792625ac web: use named imports for icons 2023-06-17 13:36:01 +05:00
Abdullah Atta
605e045ff7 web: fix type in SearchViewModel 2023-06-17 13:36:01 +05:00
Abdullah Atta
8c17233e67 web: move dialogs out to top-most level 2023-06-17 13:36:01 +05:00
Abdullah Atta
08480188fa web: remove progress-bar component 2023-06-17 13:36:01 +05:00
Abdullah Atta
87402251a5 web: add types for svgr 2023-06-17 13:36:01 +05:00
Abdullah Atta
e3a818378d core: userId is not mandatory when sending bug report 2023-06-17 13:36:01 +05:00
Abdullah Atta
6d82b0a5ba common: use fixed react version at 17.0.2 2023-06-17 13:36:01 +05:00
Abdullah Atta
e3f0d0ada7 web: load polyfills before everything else 2023-06-17 13:36:01 +05:00
Abdullah Atta
9e2f54fd0b web: use utils from @notesnook/common 2023-06-17 13:36:01 +05:00
Abdullah Atta
19eb512198 common: add utils for debounce, random & string 2023-06-17 13:36:01 +05:00
ammarahm-ed
86a7fd9b93 mobile: refactor 2023-06-17 13:36:01 +05:00
ammarahm-ed
fa7900aef6 core: fix tests 2023-06-17 13:36:01 +05:00
ammarahm-ed
561d7a8bbc common: add @notesnook/core dep 2023-06-17 13:36:01 +05:00
ammarahm-ed
fb616a246e mobile: refactor 2023-06-17 13:36:01 +05:00
ammarahm-ed
c881e74aae web: call database.setup() before db init 2023-06-17 13:36:01 +05:00
ammarahm-ed
0f2acb2801 core: Init DB instance without platform APIs 2023-06-17 13:36:01 +05:00
Abdullah Atta
9b5e2c108b editor: persist text alignment & direction on heading creation 2023-06-16 19:11:22 +05:00
ammarahm-ed
ba900b3a0f web: fix trial expired notice shows to new users 2023-06-16 19:10:46 +05:00
ammarahm-ed
49df1bcd9e mobile: fix trial expired notice shows to new users 2023-06-16 19:10:46 +05:00
Abdullah Atta
5d1ba7fa0a web: new dialog based settings (#2745) 2023-06-16 19:10:02 +05:00
ammarahm-ed
a6d5a618b0 mobile: picker follow time format set in settings 2023-06-16 18:57:29 +05:00
Abdullah Atta
8f4bd20253 web: fix delete all notes in topic test 2023-06-16 16:54:04 +05:00
ammarahm-ed
8b4270f7df web: add null checks 2023-06-16 16:54:04 +05:00
ammarahm-ed
9a4877bdbd mobile: include topic notes in notebook search 2023-06-16 16:54:04 +05:00
ammarahm-ed
0a45e963a6 web: lookup topic notes at notebook level 2023-06-16 16:54:04 +05:00
ammarahm-ed
fb7b306bc5 web: fix search in topic returns no results 2023-06-16 16:54:04 +05:00
Abdullah Atta
4035751264 clipper(web): bump version to 0.2.2 2023-06-16 15:38:51 +05:00
Ammar Ahmed
07bb35395c clipper: fix duplicate notes created on save (#2722)
* clipper: fix duplicate notes created on save

* clipper(web): move singleton checks inside the fn

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-06-16 15:15:14 +05:00
ammarahm-ed
09cd19d3b7 core: fix incorrect snooze time format 2023-06-16 10:23:46 +05:00
ammarahm-ed
a3988fd309 mobile: fix image replaces content if note is locked
& app lock is also enabled
2023-06-16 10:06:06 +05:00
ammarahm-ed
574c4cc8a9 mobile: fix appending link to empty note stuck 2023-06-15 16:43:54 +05:00
Abdullah Atta
5041e47902 core: fix require is not defined 2023-06-12 13:02:56 +05:00
Abdullah Atta
f3a03dc813 crypto: eagerly init sodium in dev mode 2023-06-12 12:57:39 +05:00
Abdullah Atta
942c9556f6 web: fix editor theme not changing with app theme 2023-06-12 12:00:47 +05:00
Abdullah Atta
5374f2b56c web: migrate to vitejs from webpack (#2715) 2023-06-12 11:49:37 +05:00
Abdullah Atta
3f128da55d docs: update readme 2023-06-10 16:03:09 +05:00
Abdullah Atta
0aa689ca03 desktop: add readme & other docs 2023-06-10 15:54:17 +05:00
Abdullah Atta
93e1ae5830 ci: set extraMetadata in package.json 2023-06-10 15:54:17 +05:00
Abdullah Atta
ef5aebdb3b ci: fix electron-builder command 2023-06-10 15:54:17 +05:00
Abdullah Atta
c152796767 ci: use yarn electron-builder on windows 2023-06-10 15:54:17 +05:00
Abdullah Atta
b75382f8b6 ci: change entrypoint before build 2023-06-10 15:54:17 +05:00
Abdullah Atta
80893a5011 ci: use electron-builder directly from ./node_modules/.bin directory 2023-06-10 15:54:17 +05:00
Abdullah Atta
0f9ac0e068 desktop: add dmg-license as optional dependency 2023-06-10 15:54:17 +05:00
Abdullah Atta
46e4ac127c ci: do not bootstrap after adding dmg-license 2023-06-10 15:54:17 +05:00
Abdullah Atta
3da4ced75b desktop: add build script & use nx to run build commands 2023-06-10 15:54:17 +05:00
Abdullah Atta
3f79ae6403 desktop: rename build script to release 2023-06-10 15:54:17 +05:00
Abdullah Atta
2d78b05e8d desktop: remove electron-builder install-app-deps from post-install 2023-06-10 15:54:17 +05:00
Abdullah Atta
c7c4ae4615 desktop: fix post-install command 2023-06-10 15:54:17 +05:00
Abdullah Atta
ee2cbea0c4 ci: add ./ before local action path 2023-06-10 15:54:17 +05:00
Abdullah Atta
782fc575a9 ci: improve node cache by using a common action 2023-06-10 15:54:17 +05:00
Abdullah Atta
151a527444 desktop: improve build scripts 2023-06-10 15:54:17 +05:00
Abdullah Atta
6ab0911970 desktop: finalize new desktop core 2023-06-10 15:54:17 +05:00
Abdullah Atta
28927e705b desktop: overhaul desktop core and migrate to typescript 2023-06-10 15:54:17 +05:00
ammarahm-ed
2a31f70b4a mobile: fix compactMode indicators show always 2023-06-10 12:25:48 +05:00
Abdullah Atta
0596bd9e84 desktop: update electron to v25.1.0 2023-06-08 18:20:47 +05:00
ammarahm-ed
3e95960b45 mobile: release v2.5.2 2023-06-08 16:21:50 +05:00
ammarahm-ed
131ecfee89 mobile: improved compactness of notebook compact mode 2023-06-08 16:21:50 +05:00
Abdullah Atta
dfccd640b0 web: bump version to 2.5.2 2023-06-08 16:03:33 +05:00
Abdullah Atta
14d27bb277 editor: remove duplicate ordered-list methods 2023-06-08 15:59:48 +05:00
Abdullah Atta
dd470297c3 editor: do not prevent all clicks 2023-06-08 15:59:48 +05:00
Abdullah Atta
1e690664f1 editor: remove selection persistence 2023-06-08 15:59:48 +05:00
ammarahm-ed
d68eaa7a41 mobile: increase compactness of compact mode 2023-06-08 15:55:06 +05:00
ammarahm-ed
791119fcbc mobile: add notes for $timestamp$ template 2023-06-08 15:22:53 +05:00
Abdullah Atta
87b82865b2 web: list $timestamp$ in supported title templates 2023-06-08 15:16:24 +05:00
Abdullah Atta
ad145c3499 core: remove YYYY-DD-MM date format 2023-06-08 15:16:24 +05:00
ammarahm-ed
5a228ce5fe mobile: allow changin primary 2fa 2023-06-08 15:06:22 +05:00
Abdullah Atta
8cb3cb6b19 web: allow changing primary 2fa method 2023-06-08 15:06:22 +05:00
Abdullah Atta
94cc3a6853 web: make 2fa recovery codes more readable 2023-06-08 12:02:14 +05:00
Abdullah Atta
163dfac5d7 core: add tests for title formatting 2023-06-08 11:57:21 +05:00
Abdullah Atta
efd0d6c2c3 core: add more date formats 2023-06-08 11:57:10 +05:00
Abdullah Atta
742dc56f3c core: add support for $timestamp$ in title 2023-06-08 11:56:59 +05:00
ammarahm-ed
19f2d8b0a7 mobile: do not resize auth modal on ios on kbd open 2023-06-07 21:00:53 +05:00
ammarahm-ed
8c9d98ab88 mobile: fix pass validation 2023-06-07 21:00:13 +05:00
ammarahm-ed
75ae5d9603 mobile: hide note headline in share ext 2023-06-06 18:20:34 +05:00
Ammar Ahmed
8a2453429d Merge pull request #2669 from streetwriters/fix/tag-name-manage-tags
mobile: fix aliased tag name not showing in manage
2023-06-06 18:20:12 +05:00
ammarahm-ed
b54ca08fc8 mobile: fix aliased tag name not showing in manage
tags sheet
2023-06-06 18:12:32 +05:00
ammarahm-ed
2be801ba3b mobile: fix oboarding ui on iphone 2023-06-06 12:35:49 +05:00
Abdullah Atta
f37cd3fe63 core: add new date formats 2023-06-06 11:58:59 +05:00
ammarahm-ed
1224e48bc8 core: fix comma added in default title 2023-06-06 10:42:26 +05:00
Abdullah Atta
780bebe141 web: fix crash on webkit (safari) 2023-06-05 20:55:41 +05:00
ammarahm-ed
f707b43efb mobile: release v2.5.1 2023-06-05 20:40:34 +05:00
Abdullah Atta
92e9cd740f web: fix crash on opening notebook context menu 2023-06-05 19:06:53 +05:00
Abdullah Atta
20bef5e70c web: fix crash when opening notebook context menu 2023-06-05 19:05:39 +05:00
ammarahm-ed
c9b45875a0 mobile: remove patch 2023-06-05 18:54:36 +05:00
Abdullah Atta
f180b79a3e web: bump version to 2.5.1 2023-06-05 18:40:56 +05:00
ammarahm-ed
438a3c2686 mobile: update deps 2023-06-05 18:33:52 +05:00
ammarahm-ed
64d23d3de0 mobile: show loading when updating marketing consent 2023-06-05 18:27:51 +05:00
ammarahm-ed
e251c6f71c mobile: add marketing consent settings 2023-06-05 18:21:07 +05:00
Abdullah Atta
40cb6ae8bf web: allow opting out of marketing emails 2023-06-05 18:21:07 +05:00
Abdullah Atta
06aaa7e2c2 web: clarify marketing consent on sign up screen 2023-06-05 18:21:07 +05:00
Abdullah Atta
ab29a01649 core: allow changing marketing emails consent settings 2023-06-05 18:21:07 +05:00
Abdullah Atta
49e7bdf202 editor: allow starting lists with arbitrary number 2023-06-05 18:04:13 +05:00
ammarahm-ed
2e0f9d8524 mobile: do not move login dialog on keyboard change 2023-06-05 16:40:33 +05:00
Ammar Ahmed
092b26be57 mobile: add support for image & file sharing (#2652)
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2023-06-05 16:26:39 +05:00
Abdullah Atta
3525feffcf web: fix color not setting on icons 2023-06-05 16:21:40 +05:00
Abdullah Atta
6cb5a5e473 web: fix incorrect loading state of icons 2023-06-05 16:20:40 +05:00
Abdullah Atta
0992d4eeab editor: make image selectable in readonly mode 2023-06-05 16:02:50 +05:00
Abdullah Atta
828cd6be35 editor: disable selection persist in readonly mode 2023-06-05 16:02:50 +05:00
Abdullah Atta
1b1a962ec2 editor: minor refactor 2023-06-05 16:02:50 +05:00
Abdullah Atta
0a88502e59 editor: hide replace button in readonly mode 2023-06-05 16:02:50 +05:00
Muhammad Ali
50ff39845a editor: changed absolute to relative 2023-06-05 16:02:50 +05:00
Muhammad Ali
1cb34d0783 editor: added image-tools for readonly-mode 2023-06-05 16:02:50 +05:00
Abdullah Atta
bbb43bc8b4 web: replace date-time in test snapshot with xxx 2023-06-05 15:29:10 +05:00
ammarahm-ed
1521a7d120 mobile: formatted dates in editor 2023-06-05 15:29:10 +05:00
Abdullah Atta
3b6a2cb9de web: use editor date/time format from settings 2023-06-05 15:29:10 +05:00
Abdullah Atta
0deaed4ccd editor: make date-time format configurable 2023-06-05 15:29:10 +05:00
Abdullah Atta
8ebb58b70c core: fix reminder date time formatting 2023-06-05 15:29:10 +05:00
ammarahm-ed
f691d113d2 mobile: update wording 2023-06-05 15:29:10 +05:00
ammarahm-ed
a57eaf9be6 mobile: sync with core changes 2023-06-05 15:29:10 +05:00
ammarahm-ed
c5a264270c core: use only first 10 words of headline in title 2023-06-05 15:29:10 +05:00
Abdullah Atta
e75c62e6e1 core: use 2 digits for 12 hour time format 2023-06-05 15:29:10 +05:00
Abdullah Atta
6c3583c9e5 web: add support for setting default notebook/topic 2023-06-05 15:29:10 +05:00
Abdullah Atta
58ba453f57 web: use default note title from settings 2023-06-05 15:29:10 +05:00
Abdullah Atta
7f5d5fcb82 core: simplify default notebook object 2023-06-05 15:29:10 +05:00
Abdullah Atta
e218194402 web: add settings for default date, time & title formats 2023-06-05 15:29:10 +05:00
Abdullah Atta
c36f532bbb web: use date & time formats from settings 2023-06-05 15:29:10 +05:00
ammarahm-ed
b3b7bd44ef core: fix note count incorrect 2023-06-05 15:29:10 +05:00
ammarahm-ed
c85242a610 core: format time correctly 2023-06-05 15:29:10 +05:00
ammarahm-ed
58f7a206d9 mobile: add settings 2023-06-05 15:29:10 +05:00
Ammar Ahmed
25bf4fee82 mobile: redesign onboarding (#2633) 2023-06-05 15:13:19 +05:00
Abdullah Atta
c2ab5ded47 desktop: fix start as minimized on windows 2023-06-05 12:14:33 +05:00
Ammar Ahmed
ad6a0ebfab mobie: enable search in readonly mode (#2659) 2023-06-05 11:16:18 +05:00
ammarahm-ed
cb9e6578c1 mobile: downgrade react-native-bootsplash version 2023-06-01 21:16:17 +05:00
Abdullah Atta
17a1475ded editor: do not create 2 toolbar groups for static tools on mobile 2023-06-01 21:15:17 +05:00
Abdullah Atta
2cee5a4d89 editor: set preview attachment icon to eye 2023-06-01 21:15:17 +05:00
Abdullah Atta
337f88c373 editor: fix link popup font family 2023-06-01 21:15:17 +05:00
Abdullah Atta
53d5073690 editor: double click to preview image 2023-06-01 21:15:17 +05:00
Ramiro Pruis
9cc9660b48 editor: allow download & preview of attachments in readonly mode (#2621)
Signed-off-by: Ramiro Pruis<ramapruis@gmail.com>
2023-06-01 20:39:10 +05:00
ammarahm-ed
e6162b2580 mobile: fix crash on download all attachement 2023-05-31 11:31:51 +05:00
ammarahm-ed
abc14d2d1f mobile: set fdroid build to false 2023-05-30 00:17:39 +05:00
ammarahm-ed
fa11b5fabb mobile: update packages 2023-05-29 23:52:43 +05:00
ammarahm-ed
d904916863 mobile: release v2.5.0 2023-05-29 23:01:53 +05:00
Abdullah Atta
0cfc2e1609 web: bump version to 2.5.0 2023-05-29 19:14:53 +05:00
Abdullah Atta
3742e923c9 editor: fix crash due to attachment.mime being undefined 2023-05-29 13:12:28 +05:00
Abdullah Atta
792a254513 web: fix split pane sash styling 2023-05-29 12:09:50 +05:00
Abdullah Atta
17928ba182 web: disable loading announcements during tests 2023-05-27 16:50:24 +05:00
Abdullah Atta
2da0f164c6 web: fix list crash on shift+click when there's no selection 2023-05-27 16:47:54 +05:00
Abdullah Atta
4eabe79e7e web: fix attachment caching issues 2023-05-27 16:14:12 +05:00
Abdullah Atta
89dd8f5b6c web: minor ui fixes for pdf attachment preview 2023-05-27 16:14:12 +05:00
Abdullah Atta
b4d3662897 web: never delete image & pdf attachments 2023-05-27 16:14:12 +05:00
ammarahm-ed
675e1e2c6f mobile: do not cleanup documents from cache after download 2023-05-27 16:14:12 +05:00
ammarahm-ed
0f7f3bae7e mobile: save pdf snapshot 2023-05-27 16:14:12 +05:00
Abdullah Atta
c917d95a7b web: remove unnecessary css import 2023-05-27 16:14:12 +05:00
Abdullah Atta
3ae9001504 mobile: remove rn-fetch-blob patch 2023-05-27 16:14:12 +05:00
Abdullah Atta
cc97b8beed global: update package-lock.json 2023-05-27 16:14:12 +05:00
Abdullah Atta
954bdebcef web: remove @react-pdf-viewer/default-layout 2023-05-27 16:14:12 +05:00
Abdullah Atta
04b62f4e53 misc: update package-lock.json 2023-05-27 16:14:12 +05:00
Abdullah Atta
a2dcb67b36 web: add support for previewing pdf attachments 2023-05-27 16:14:12 +05:00
Abdullah Atta
cc9141c981 editor: enable preview attachment button on desktop 2023-05-27 16:14:12 +05:00
Abdullah Atta
85484b1762 fs: add support for getting actual file size 2023-05-27 16:14:12 +05:00
Abdullah Atta
1a0c94896a config: add new "fs" scope for commits 2023-05-27 16:14:12 +05:00
ammarahm-ed
068a99463d mobile: fix loading 2023-05-27 16:14:12 +05:00
ammarahm-ed
b413315777 mobile: add pdf attachment previews 2023-05-27 16:14:12 +05:00
ammarahm-ed
7227513783 editor: enable attachment previews for files 2023-05-27 16:14:12 +05:00
Abdullah Atta
083e4e1150 web: add basic support for attachment previews 2023-05-27 16:14:12 +05:00
Abdullah Atta
09098410a5 editor: enable previewing attachments on desktop/web 2023-05-27 16:14:12 +05:00
Abdullah Atta
2c9f5df530 web: fix font family in unlock note view 2023-05-25 16:15:01 +05:00
Abdullah Atta
3ad346362b web: fix notebooks in move note dialog not getting checked sometimes 2023-05-25 16:15:01 +05:00
ammarahm-ed
e176b1bf76 mobile: reset premium status 2023-05-25 15:55:14 +05:00
ammarahm-ed
b368232598 mobile: fix app hangs on adding >3 notebooks on iOS 2023-05-25 15:54:54 +05:00
Abdullah Atta
bcd27e10c1 web: add support for search inside notebook 2023-05-25 15:52:58 +05:00
Abdullah Atta
af9b9b7083 web: fix notebook item date font family 2023-05-25 15:44:09 +05:00
ammarahm-ed
ea1565048a mobile: tag multiple notes from manage tags sheet 2023-05-25 15:41:43 +05:00
Muhammad Ali
59b081704b web: add support for setting tags in bulk (#2328)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-05-25 14:10:32 +05:00
Muhammad Ali
2761222b36 web: add support for printing notes (#2551)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-05-25 12:19:21 +05:00
Muhammad Ali
571f15b556 web: close deleted note on sync (#2580)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-05-25 12:14:49 +05:00
Muhammad Ali
283efa6e41 editor: prevent table column size reset in readonly mode (#2586) 2023-05-25 12:11:57 +05:00
Abdullah Atta
b3b1b7470e web: do not show save file dialog if download is canceled 2023-05-25 12:02:50 +05:00
Abdullah Atta
a9e59b17dc web: use fixed size columns in attachment manager 2023-05-25 12:02:50 +05:00
Abdullah Atta
22d946b677 web: fix app lag when downloading attachment 2023-05-25 12:02:50 +05:00
ammarahm-ed
6a748c3f98 mobile: fix download all attachments progress 2023-05-25 10:18:21 +05:00
Abdullah Atta
520296106a editor: bump version to 1.5.0 2023-05-25 09:48:22 +05:00
Abdullah Atta
3b727e6f64 editor: update tiptap packages to v2.0.3 2023-05-25 09:47:20 +05:00
ammarahm-ed
b77711a53d mobile: use isImage check from core 2023-05-23 12:52:50 +05:00
ammarahm-ed
aebb2d414b mobile: allow attaching images from file manager 2023-05-23 12:52:50 +05:00
ammarahm-ed
e0e505371c mobile: update download attachments 2023-05-23 12:52:50 +05:00
ammarahm-ed
b9040a9358 mobile: show error on file check failed 2023-05-23 12:52:50 +05:00
ammarahm-ed
68f10ce308 core: add isAudio function 2023-05-23 12:52:50 +05:00
Abdullah Atta
8a475f654f web: improve attachments manager ui/ux 2023-05-23 12:52:50 +05:00
ammarahm-ed
1043b7df55 mobile: improved attachments manager 2023-05-23 12:52:50 +05:00
ammarahm-ed
8383e09243 mobile: show currently downloading file 2023-05-23 12:52:50 +05:00
ammarahm-ed
df58a6cfc4 mobile: fix recheck attachments 2023-05-23 12:52:50 +05:00
ammarahm-ed
a9df577478 mobile: update deps 2023-05-23 12:52:50 +05:00
ammarahm-ed
e021d93893 mobile: download mutliple attachments 2023-05-23 12:52:50 +05:00
Abdullah Atta
24e13f488e web: fully move to using web streams everywhere 2023-05-23 12:52:50 +05:00
Muhammad Ali
6f88b70937 web: add support for downloading all attachments as zip 2023-05-23 12:52:50 +05:00
ammarahm-ed
a90f957aa4 mobile: always check editor is ready on enter foreground 2023-05-23 08:08:10 +05:00
ammarahm-ed
748953b3eb mobile: don't lock app on showing app review 2023-05-23 08:07:27 +05:00
Muhammad Ali
874c892986 editor: make cell properties work with header cells (#2506) 2023-05-23 07:17:29 +05:00
Muhammad Ali
ab678fa3a9 core: fix duplication of notes that are directly inside a notebook (#2552)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-05-23 06:40:07 +05:00
Muhammad Ali
c2351ab2d3 editor: add support for link markdown syntax (#2576) 2023-05-23 06:36:34 +05:00
Muhammad Ali
3fd3e02256 web: fix wrong date font in notebook item (#2560)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-05-23 06:20:12 +05:00
Muhammad Ali
d2fd26abd5 editor: fix position of outline list bullet/arrow (#2555) 2023-05-20 08:03:39 +05:00
ammarahm-ed
e6e775dbeb mobile: fix statusbar color on switch from bg 2023-05-19 20:31:56 +05:00
ammarahm-ed
dd84b9ca2f mobile: add fdroid changelog 2023-05-18 20:06:37 +05:00
Abdullah Atta
269f083dce clipper: bump version to 0.2.1 2023-05-18 15:14:25 +05:00
Abdullah Atta
e18867d3f1 clipper: request scripting permission 2023-05-18 15:13:44 +05:00
Abdullah Atta
e221882f8e clipper: change version to 0.2.0 2023-05-17 11:35:52 +05:00
Abdullah Atta
153ee4bce3 clipper: load content scripts on demand to reduce host permissions 2023-05-17 11:35:52 +05:00
ammarahm-ed
a2ecdab61c mobile: release 2.4.17 2023-05-17 11:24:29 +05:00
Ammar Ahmed
eb089e6211 Merge pull request #2543 from streetwriters/feat/in-app-review
mobile: add in-app-review flow
2023-05-17 11:18:22 +05:00
ammarahm-ed
1981c3a2f8 mobile: add in-app-review flow 2023-05-17 11:14:49 +05:00
Abdullah Atta
68b3ebe318 clipper: get rid of <all_urls> permission 2023-05-17 10:11:47 +05:00
ammarahm-ed
8a0b6264d2 mobile: fix pro features locked for pro users 2023-05-17 10:09:37 +05:00
Abdullah Atta
239174c3e7 web: bump version to 2.4.11 2023-05-17 09:29:16 +05:00
Abdullah Atta
db1503d828 clipper: remove contextMenus permission 2023-05-16 18:05:20 +05:00
Abdullah Atta
7b1cbba9e7 clipper: bump version to 0.2 2023-05-16 17:39:21 +05:00
Abdullah Atta
2c3c193629 clipper: default to simplified mode if user is no longer pro 2023-05-16 17:35:59 +05:00
Abdullah Atta
899e56e9cd clipper(core): escape % & ' during css stringify 2023-05-16 17:35:59 +05:00
Abdullah Atta
9c9582ae12 clipper: improve error messages 2023-05-16 17:35:59 +05:00
Abdullah Atta
b918667b63 clipper: adjust icon size in inline tag 2023-05-16 17:35:59 +05:00
Abdullah Atta
878c901e06 clipper: add support for assigning multiple notebooks 2023-05-16 17:35:59 +05:00
Muhammad Ali
fdd3897a60 web: close tag dropdown on tab press (#2508) 2023-05-16 17:32:00 +05:00
ammarahm-ed
c958657b01 mobile: release 2.4.16 2023-05-16 12:11:43 +05:00
Abdullah Atta
e7175f48a0 clipper: do not exclude localhost tabs in production mode 2023-05-13 17:51:10 +05:00
Abdullah Atta
4e1862d653 clipper: improve connection reliability
this adds support for working with multiple Notesnook tabs
even though it is not currently recommended that you
open multiple Notesnook tabs
2023-05-13 17:51:10 +05:00
Abdullah Atta
1d5ac37222 clipper: always clip tab from current active window 2023-05-13 17:50:53 +05:00
Abdullah Atta
32d027fff6 clipper(core): don't clip images in simplified mode 2023-05-13 17:50:41 +05:00
ammarahm-ed
9434993373 mobile: remove usesCleartextTraffic in release builds 2023-05-08 18:30:36 +05:00
Abdullah Atta
2bd0f1a304 web: allow users to view their billing history 2023-05-08 15:25:20 +05:00
Abdullah Atta
7f873f240e web: allow requesting refunds from settings 2023-05-08 15:25:20 +05:00
Abdullah Atta
a0229729b7 web: use sandbox checkout during development 2023-05-08 15:25:20 +05:00
Abdullah Atta
dd368a4170 web: show success on checkout completion 2023-05-08 15:25:20 +05:00
Abdullah Atta
e082007a49 clipper: add support for the new theme engine 2023-05-08 14:42:29 +05:00
ammarahm-ed
6d3e985c9d mobile: fix failing build 2023-05-08 09:27:55 +05:00
ammarahm-ed
15858db21b mobile: sync quick notes only when online 2023-05-08 08:19:17 +05:00
Ammar Ahmed
b69a94a96f mobile: fix premium toast is not shown when using premium features on mobile (#2504) 2023-05-08 08:18:38 +05:00
ammarahm-ed
deced99339 mobile: fix editor theme provider 2023-05-08 08:13:13 +05:00
ammarahm-ed
b0acce7b4f mobile: migrate share ext to theme engine 2023-05-08 08:12:42 +05:00
Muhammad Ali
73b965eb7c web: close properties pane when note is switched (#2486) 2023-05-06 16:16:01 +05:00
Abdullah Atta
e081e7ea09 web: adjust hover & focus colors on list item 2023-05-06 15:29:10 +05:00
Abdullah Atta
35db89aa11 editor: add support for theme enging 2023-05-06 15:29:10 +05:00
Abdullah Atta
679a912e2b web: move emotion theme provider to @notesnook/theme 2023-05-06 15:28:33 +05:00
Abdullah Atta
5738f48360 core: expire session if key is not found 2023-05-06 15:27:58 +05:00
ammarahm-ed
627259e129 mobile: fix dark color scheme 2023-05-06 13:17:44 +05:00
ammarahm-ed
70c8201355 mobile: fix status bar color incorrect on entering foreground 2023-05-06 11:24:09 +05:00
ammarahm-ed
064059278a mobile: cleanup 2023-05-06 11:10:17 +05:00
ammarahm-ed
959e7466a6 mobile: fix colors 2023-05-06 10:27:43 +05:00
ammarahm-ed
69bd277d87 mobile: fix colors 2023-05-06 10:09:49 +05:00
ammarahm-ed
5833832123 mobile: fix theme-engine usage in editor & app 2023-05-05 16:11:13 +05:00
Abdullah Atta
37187403d4 global: sync with master branch and make everything work again 2023-05-04 15:16:05 +05:00
ammarahm-ed
b24d52bbbd theme: add dialog & sheet scopes 2023-05-04 14:48:19 +05:00
Abdullah Atta
82142d11aa web: add partial support for custom themes
only context menus & popups are left.
2023-05-04 14:48:19 +05:00
ammarahm-ed
19b4d84c40 mobile: fix theme definition 2023-05-04 13:26:36 +05:00
ammarahm-ed
fd98b89900 mobile: fix typings 2023-05-04 13:26:36 +05:00
ammarahm-ed
1870406b5e mobile: fix button width on applock screen 2023-05-04 13:26:36 +05:00
ammarahm-ed
64e5f63f70 mobile: commit 2023-05-04 13:26:36 +05:00
ammarahm-ed
02f75ac1cd mobile: add theme scopes 2023-05-04 13:26:36 +05:00
ammarahm-ed
52849a5bf3 mobile: manage theme state via theme-engine 2023-05-04 13:25:35 +05:00
ammarahm-ed
f64c91faec theme: add default pitch-black theme 2023-05-04 13:24:40 +05:00
ammarahm-ed
c7ae14f239 mobile: const colors -> `const {colors} 2023-05-04 13:24:40 +05:00
Abdullah Atta
9ab084d793 theme: add backdrop color 2023-05-04 13:23:04 +05:00
Abdullah Atta
6514b98ce8 theme: use explicit return type for useThemeColors 2023-05-04 13:23:04 +05:00
Abdullah Atta
5a5cacee4f theme: ColorsType -> Variants 2023-05-04 13:23:04 +05:00
ammarahm-ed
04451eee5d mobile: store theme info in store 2023-05-04 13:23:04 +05:00
ammarahm-ed
6e7558b364 mobile: fix colors 2023-05-04 13:22:28 +05:00
ammarahm-ed
9c02fed3af mobile: fixed some colors 2023-05-04 13:22:28 +05:00
ammarahm-ed
5d7195fb41 mobile: migrate app colors to new theme engine 2023-05-04 13:21:56 +05:00
ammarahm-ed
6cd1178347 theme: add theme engine 2023-05-04 12:52:38 +05:00
ammarahm-ed
b7b4a18624 mobile: theme 2023-05-04 12:52:38 +05:00
Muhammad Ali
de74b8c2cd editor: position search box correctly in readonly mode (#2478) 2023-05-03 13:22:25 +05:00
Muhammad Ali
2d07d79057 web: fix issue where notes directly in a notebook could not be unlinked (#2466)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-05-02 12:49:24 +05:00
ammarahm-ed
5f6a38c8b1 mobile: release 2.4.15 2023-04-29 09:07:46 +05:00
Muhammad Ali
3496e6bfa9 editor: increased hit Area 2023-04-29 08:33:20 +05:00
ammarahm-ed
fc5b62ba61 mobile: remove editor flicker on app launch 2023-04-29 08:29:48 +05:00
ammarahm-ed
9d0a206240 mobile: fix editor not rendered when enter foreground 2023-04-29 08:29:48 +05:00
ammarahm-ed
ee6bbca18c mobile: only call verify biometrics once on focus 2023-04-29 05:47:05 +05:00
ammarahm-ed
e6d5472514 mobile: fix rerender crash 2023-04-29 05:46:06 +05:00
Abdullah Atta
1e5f13087b web: try to reconnect sync on window focus 2023-04-28 10:39:59 +05:00
Abdullah Atta
abb89ecbc3 web: bump version to 2.4.10 2023-04-27 15:15:46 +05:00
Abdullah Atta
aa168bec5e desktop: revert "desktop: remove custom protocol interception for https requests" 2023-04-27 15:14:30 +05:00
Abdullah Atta
f9116b22db web: bump version to 2.4.9 2023-04-27 13:16:01 +05:00
Abdullah Atta
5b957f5f0d web: fix Can't resolve './network.worker' error 2023-04-27 13:08:13 +05:00
Abdullah Atta
a578aae3dc web: wait for internet before running sync on device wake 2023-04-27 13:08:13 +05:00
Abdullah Atta
43e5d2fa2d editor: fix table properties tooltip text 2023-04-27 13:08:03 +05:00
Abdullah Atta
b58d034716 theme: use outline instead of boxShadow for input border 2023-04-27 12:59:26 +05:00
Abdullah Atta
3b77d79997 web: prevent pro users from resubscribing 2023-04-27 12:59:26 +05:00
Abdullah Atta
ef4c9af7dc web: rename setters from onXYZ to xyz 2023-04-27 12:59:26 +05:00
ammarahm-ed
8ba3cf172e mobile: release v2.4.14 2023-04-27 12:49:02 +05:00
ammarahm-ed
3e446ce9dd mobile: fix crash on get search items 2023-04-27 11:27:48 +05:00
ammarahm-ed
394aa98713 mobile: remove usage of lazy imports 2023-04-27 10:59:04 +05:00
Muhammad Ali
a2ac882a05 desktop: remove custom protocol interception for https requests (#2426) 2023-04-27 10:13:37 +05:00
ammarahm-ed
cae36487f9 mobile: fix notebook not updated on note 2023-04-27 09:38:44 +05:00
ammarahm-ed
fade5eddbf mobile: replace newline with paragraph in generated html 2023-04-27 08:32:09 +05:00
ammarahm-ed
66b2ffce31 mobile: fix webpack config 2023-04-27 08:32:09 +05:00
ammarahm-ed
13cd2d4daa mobile: refactor 2023-04-27 08:18:25 +05:00
ammarahm-ed
8442faeeb1 mobile: close editor on navigate to topic 2023-04-26 20:06:40 +05:00
Ammar Ahmed
6d18383b22 mobile: sync notes created from quick note/notification notes (#2428)
* mobile: sync quick notes

* Update apps/mobile/app/services/notifications.ts

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>

* mobile: ensure full db init when sync is required

---------

Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-04-26 15:15:08 +05:00
ammarahm-ed
f9bcfe2f7a mobile: obfuscate short emails 2023-04-26 15:02:56 +05:00
ammarahm-ed
3621f95dbc web: obfuscate short emails 2023-04-26 15:02:56 +05:00
ammarahm-ed
536dead44d mobile: always load notes on init 2023-04-26 14:59:05 +05:00
ammarahm-ed
39d74e80a9 mobile: ensure that overlay gets hidden when entering foreground 2023-04-26 14:59:05 +05:00
ammarahm-ed
46e03dd248 mobile: only show app lock for main activity 2023-04-26 14:59:05 +05:00
ammarahm-ed
152fee2c29 mobile: reload editor if rendered view lost 2023-04-26 14:59:05 +05:00
ammarahm-ed
492a4d16b2 mobile: fix note options ui 2023-04-26 14:58:37 +05:00
ammarahm-ed
3d7c1fa1e7 mobile: fix configure toolbar sheet close with swipe 2023-04-26 14:58:21 +05:00
ammarahm-ed
69bb0e3656 editor: fix toolbar dropdown buttons size on mobile 2023-04-26 14:54:30 +05:00
ammarahm-ed
4875cfa108 core: duplicate note without content 2023-04-26 14:47:52 +05:00
ammarahm-ed
a28beb62c6 core: deep clone note when duplicating 2023-04-26 14:46:24 +05:00
Abdullah Atta
21c8960146 web: fix "Unauthorized" error on subscription cancel 2023-04-26 11:39:48 +05:00
Abdullah Atta
2ba638b123 web: fix font family on input field labels 2023-04-25 14:47:29 +05:00
ammarahm-ed
8548940cb9 mobile: refactor 2023-04-25 10:18:20 +05:00
Elmin Didic
909bdfa0cf docs: fix grammar & other typos in CONTRIBUTING.md (#2384)
Signed-off-by: Elmin Didic <35606145+ElminD@users.noreply.github.com>
Co-authored-by: Abdullah Atta <thecodrr@protonmail.com>
2023-04-25 10:13:56 +05:00
ammarahm-ed
bfb3c56abe mobile: remove unused patch file 2023-04-18 02:10:16 +05:00
ammarahm-ed
e06836f701 mobile: fix icon color in dark mode 2023-04-18 02:04:55 +05:00
ammarahm-ed
bc16cb79f2 mobile: fix failing tests 2023-04-18 01:54:51 +05:00
ammarahm-ed
176c46e3f2 mobile: update word count on exit 2023-04-18 01:05:14 +05:00
Abdullah Atta
af65055ce9 web: bump version to 2.4.8 2023-04-18 00:55:37 +05:00
ammarahm-ed
ad23ff19de mobile: update release notes 2023-04-18 00:55:24 +05:00
ammarahm-ed
cf65fc4f57 editor: make drag handle size dynamic 2023-04-18 00:50:41 +05:00
ammarahm-ed
9ab83e7fbb editor: reduce size of task list header 2023-04-18 00:50:20 +05:00
ammarahm-ed
1acf2aadba editor: remove top level font family on headings 2023-04-18 00:32:17 +05:00
Abdullah Atta
06833bcac9 editor: make sure editor font settings apply to all nodes 2023-04-18 00:30:40 +05:00
Ammar Ahmed
3bf6b5293a feat: Change default font size & font family in editor 2023-04-17 23:45:28 +05:00
ammarahm-ed
c40d33df37 mobile: ensure editor reloads properly 2023-04-17 23:32:28 +05:00
ammarahm-ed
fe609f8275 mobile: release v2.4.13 2023-04-17 23:08:29 +05:00
Abdullah Atta
3566f47f2d editor: all toolbars should scroll if buttons overflow 2023-04-17 22:48:43 +05:00
ammarahm-ed
4b5526dffd mobile: fix text exports 2023-04-17 22:43:56 +05:00
ammarahm-ed
4977390394 mobile: return if some days are already selected 2023-04-17 22:41:12 +05:00
ammarahm-ed
87804de452 mobile: auto select current day when repeat mode is selected 2023-04-17 22:41:12 +05:00
Ammar Ahmed
bc55d2b476 mobile: Fix toast shown forever sometimes (#2362) 2023-04-17 22:40:43 +05:00
Abdullah Atta
3ff34a5c82 core: use official html-to-text lib instead of fork 2023-04-17 18:09:29 +05:00
Abdullah Atta
7e01e90e22 core: do not clean relations on removing reminders 2023-04-17 17:25:03 +05:00
Abdullah Atta
d568be6536 editor: fix crash while editing links on mobile 2023-04-17 17:04:24 +05:00
ammarahm-ed
734e79604f mobile: use getFontById from editor 2023-04-16 01:51:49 +05:00
Abdullah Atta
227a962042 core: fix rename tag/color test 2023-04-16 01:04:02 +05:00
Abdullah Atta
a1640175e5 editor: remove unnecessary props from ToolProps 2023-04-16 01:01:01 +05:00
Abdullah Atta
7cf61570ef web: remove default-font component 2023-04-16 00:59:16 +05:00
Abdullah Atta
83762c668e web: refactor default font settings 2023-04-16 00:57:44 +05:00
Abdullah Atta
ecd4a08b1c editor: encapsulate font family utility 2023-04-16 00:57:30 +05:00
ammarahm-ed
7b66462300 mobile: fix crash when tap on notification and
reminder does not exist.
2023-04-15 23:50:24 +05:00
ammarahm-ed
41639fd325 editor: improve editor performance on mobile 2023-04-15 23:25:45 +05:00
ammarahm-ed
2fe82841ef editor: remove useIsKeyboardOpen 2023-04-15 23:25:45 +05:00
Ammar Ahmed
9b7af87611 mobile: fix db initialization in background (#2322)
* core: init collections separately

* mobile: fix db init in background

* mobile: don't call db.init on logout

* mobile: improve db init in app/share extension

* mobile: cleanup

Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2023-04-15 23:23:04 +05:00
Muhammad Ali
d99ccbc243 editor: fix jumping text/bg color popup (#2306)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-04-15 17:53:01 +05:00
Abdulrehman-Jafer
0f191eba5c editor: fix code block highlighting not updating in some cases (#2267)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
Co-authored-by: Abdullah Atta <thecodrr@protonmail.com>
2023-04-15 17:50:03 +05:00
Ammar Ahmed
26657c7ee3 mobile: fix app font sizes (#2355) 2023-04-15 17:01:49 +05:00
Abdulrehman-Jafer
a12749eb82 core: disable input sanitization on color/tag rename (#2274)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-04-15 16:42:25 +05:00
Abdulrehman-Jafer
1a56d38116 web: migrate use-database.js to TypeScript (#2287)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
Co-authored-by: Abdullah Atta <thecodrr@protonmail.com>
2023-04-15 16:41:14 +05:00
Ammar Ahmed
0b9025af11 mobile: redesign reminder/notebook sheets (#2321) 2023-04-15 16:40:36 +05:00
Muhammad Ali
6f5a44cd11 web: do not show success toast if notebook failed to create (#2307)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-04-15 16:37:32 +05:00
Abdulrehman-Jafer
5e1cc307b1 web: migrate use-media-query.js to Typescript (#2326)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-04-15 16:35:03 +05:00
Ammar Ahmed
2197f1ec5e mobile: fix tag suggestions in share widget (#2354) 2023-04-15 16:31:59 +05:00
NedimHodzic
1da5fd3661 docs: fix grammar issues in mobile/web READMEs (#2345)
Signed-off-by: Nedim Hodzic hodzicnedim11@gmail.com
2023-04-15 05:22:18 +05:00
ammarahm-ed
49e79b52b2 core: add remote note if local note does not exist 2023-04-15 02:17:56 +05:00
ammarahm-ed
c9a657298c mobile: fix crash when data is null in list 2023-04-15 02:03:36 +05:00
Nick Thomas
cfd7caf16c Updated grammar readme
docs: Updated grammar readme
Signed-off-by: Nick Thomas nick02@iastate.edu

Signed-off-by: Nick Thomas <73144044+NickThomas20@users.noreply.github.com>
2023-04-14 06:42:57 +05:00
ammarahm-ed
9744679550 mobile: add support for setting default font-size & font-family 2023-04-08 01:53:46 +05:00
ammarahm-ed
9cdc502ce5 web: fix font family not applied when set on editor 2023-04-08 01:14:33 +05:00
Ammar Ahmed
300a104949 Merge branch 'master' into change-default-font
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2023-04-07 23:17:23 +05:00
ammarahm-ed
efad6520a2 mobile: release 2.4.12 2023-04-07 22:46:56 +05:00
ammarahm-ed
cc58351731 core: fix notes marked as local only get deleted
on sync
2023-04-07 22:40:10 +05:00
ammarahm-ed
cf2f4c4bbb mobile: fix tag not updated on list item on rename 2023-04-07 14:46:28 +05:00
Abdulrehman-Jafer
cc161b844c web: migrate use-is-user-premium to ts (#2297)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-04-07 14:10:52 +05:00
ammarahm-ed
45ebf0670f mobile: show error when note is locked 2023-04-07 02:22:49 +05:00
ammarahm-ed
9cfaa90232 mobile: use text exporter from core 2023-04-07 02:22:49 +05:00
ammarahm-ed
edf4a248ed web: remove unnecessary param passed to export 2023-04-07 02:22:49 +05:00
ammarahm-ed
14d7ec6b4e core: allow exports with custom content 2023-04-07 02:22:49 +05:00
Ammar Ahmed
cd2ca94c3d mobile: Fix crash when leaving note after search (#2289) 2023-04-07 01:10:52 +05:00
Abdullah Atta
f1609aaa46 editor: do not convert \n characters to paragraphs 2023-04-06 01:40:55 +05:00
ammarahm-ed
851364c0bf mobile: release 2.4.11 2023-04-05 02:45:02 +05:00
ammarahm-ed
913a1743b5 mobile: update deps 2023-04-05 02:13:49 +05:00
ammarahm-ed
dc5572d4b9 editor: enable passing custom sessionId 2023-04-05 02:13:49 +05:00
ammarahm-ed
554560903c mobile: improve share extension search 2023-04-05 02:13:49 +05:00
ammarahm-ed
885e4a325c mobile: fix snap points for sheet on android 2023-04-05 02:13:49 +05:00
ammarahm-ed
156ce7e711 mobile: ensure note is saved when change note 2023-04-05 02:13:49 +05:00
Abdullah Atta
71ecc05bd6 web: bump version to v2.4.7 2023-04-05 01:54:51 +05:00
Abdullah Atta
98b93d42c1 theme: publish 2023-04-05 01:53:29 +05:00
Abdullah Atta
2e7935cacc editor: publish 2023-04-05 01:53:16 +05:00
Abdullah Atta
50d64af7f6 web: update export html test snapshots 2023-04-04 23:35:35 +05:00
Abdullah Atta
e452fd3d2f core: update export tests snapshots 2023-04-04 23:16:04 +05:00
Abdullah Atta
64dd481402 web: fix cannot read property id of undefined 2023-04-04 22:04:46 +05:00
Abdullah Atta
28f647fa06 web: fix a couple of state mgmt issues with move note dialog 2023-04-04 22:04:14 +05:00
ammarahm-ed
9eb1061cd1 mobile: refactor 2023-04-04 22:04:14 +05:00
ammarahm-ed
3cab264213 mobile: increase the timeout 2023-04-04 22:04:14 +05:00
ammarahm-ed
fb56e7c866 mobile: exit current topic if it is deleted. 2023-04-04 22:04:14 +05:00
ammarahm-ed
234e368c4d mobile: cleanup 2023-04-04 22:04:14 +05:00
ammarahm-ed
4de4693505 mobile: fix topic sheet snaps to top in topics screen 2023-04-04 22:04:14 +05:00
ammarahm-ed
5563c7d5f8 mobile: remove floating button on topic screen 2023-04-04 22:04:14 +05:00
ammarahm-ed
93225e5a30 mobile: fix topic sheet related state issues 2023-04-04 22:04:14 +05:00
ammarahm-ed
0ab9846732 mobile: fix edit notebook sheet does not close after saving edits 2023-04-04 22:04:14 +05:00
ammarahm-ed
f6f1cf0ae7 mobile: fix edit notebook button not working 2023-04-04 22:04:14 +05:00
ammarahm-ed
69615d54db mobile: remember last position of sheet in notebook 2023-04-04 22:04:14 +05:00
ammarahm-ed
a990d0f404 mobile: fix move note sheet not opening 2023-04-04 22:04:14 +05:00
ammarahm-ed
4aeff48e74 mobile: cleanup 2023-04-04 22:04:14 +05:00
ammarahm-ed
78c1a75ec9 mobile: improve opening sheet 2023-04-04 22:04:14 +05:00
ammarahm-ed
9e6664a80e mobile: improve topics-sheet ux 2023-04-04 22:04:14 +05:00
ammarahm-ed
b306a09747 editor: refresh editor on line spacing changed 2023-04-04 17:23:27 +05:00
ammarahm-ed
fab52012ad mobile: fix loading indicator color 2023-04-04 16:26:07 +05:00
ammarahm-ed
fc39c714b6 mobile: update project pods 2023-04-04 16:26:07 +05:00
ammarahm-ed
5fff4bbb0e mobile: fix font sizes 2023-04-04 16:26:07 +05:00
ammarahm-ed
0a29571ad8 mobile: upgrade share extension to support organization 2023-04-04 16:26:07 +05:00
ammarahm-ed
275fa1b3ca mobile: fix loading editor screen on app launch 2023-04-04 16:25:07 +05:00
ammarahm-ed
79889665e5 mobile: cleanup deps 2023-04-04 16:25:07 +05:00
ammarahm-ed
9888ad327c mobile: fix editor hidden when changing orientation
from landscape to
portrait
2023-04-04 16:25:07 +05:00
ammarahm-ed
77ab2d7740 mobile: skip showing loading overlay for relatively smaller
notes
2023-04-04 16:25:07 +05:00
ammarahm-ed
509dc4b541 editor: scroll to top on note change 2023-04-04 16:25:07 +05:00
ammarahm-ed
ff84ee2d42 mobile: improve note saving reliability &
performance
2023-04-04 16:25:07 +05:00
ammarahm-ed
d838c2e8ad editor: update word count immediately after note is loaded
Previously when opening note, the word count on mobile would
be 0, then update to actual word count. This has been fixed so
correct word count shows when opening not without any
delay.
2023-04-04 16:25:07 +05:00
ammarahm-ed
28d718acf6 mobile: show no loading for relatively smaller notes
Previously if a note had smaller content, loading would still take
quite a bit long which seemed unnecessary. Now loading will show
only  if note takes long enough to load which should make the app
feel much more snappier than before when opening notes.
2023-04-04 16:25:07 +05:00
Muhammad Ali
adf546f29c web: disable deleting locked notes (#2244) 2023-04-04 16:24:28 +05:00
Abdulrehman-Jafer
b18cf277f6 core: fix code block overflow in PDF export (#2245)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-04-04 16:19:02 +05:00
ammarahm-ed
8ab26eb852 mobile: fix crash where notebook is not present 2023-03-31 12:56:20 +05:00
ammarahm-ed
aac43274a0 mobile: release 2.4.10 2023-03-30 17:22:00 +05:00
Muhammad Ali
2fb2c4247a web: do not add "none" tool in Configure Toolbar dialog (#2193)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-03-30 17:10:43 +05:00
Abdulrehman-Jafer
cb1d32d177 core: fix txt, pdf & html export line spacing (#2215)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
Co-authored-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
Co-authored-by: Abdullah Atta <thecodrr@protonmail.com>
2023-03-30 17:09:00 +05:00
ammarahm-ed
75e1985a6f mobile: save value on change 2023-03-30 16:48:55 +05:00
ammarahm-ed
0093b39f64 mobile: fix nav bar does not follow app theme 2023-03-30 16:07:58 +05:00
ammarahm-ed
d19c2ef735 mobile: add mastodon social link 2023-03-30 15:30:55 +05:00
ammarahm-ed
db527cfbf3 mobile: fix splashscreen logo quality 2023-03-30 15:04:08 +05:00
ammarahm-ed
7da8ddb24f mobile: topic title should to single line 2023-03-30 15:02:01 +05:00
ammarahm-ed
5d401ac9ac mobile: use diff sheet size on each platform 2023-03-30 13:54:21 +05:00
ammarahm-ed
9605eafa00 mobile: add support for sorting topics in sheet 2023-03-30 13:54:21 +05:00
Ammar Ahmed
783460c685 Merge pull request #2218 from streetwriters/fix-reminder-date-set
mobile: fix reminder date picker not going in past
2023-03-29 16:54:24 +05:00
ammarahm-ed
af906d8ace mobile: add some null checks 2023-03-29 16:54:04 +05:00
ammarahm-ed
fca26a8793 mobile: fix reminder date picker not going in past 2023-03-29 16:29:40 +05:00
Muhammad Ali
27863def9c web: fix RTL support for outline lists (#2175)
Co-authored-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-03-24 12:51:00 +05:00
Abdullah Atta
f1d4fd1d5d editor: fix crash when theme.colors is undefined 2023-03-24 12:49:26 +05:00
Abdullah Atta
61b7e43d08 web: do not interrupt importer if notebook is undefined 2023-03-24 11:43:37 +05:00
Abdullah Atta
87ebe1918c web: use debounce instead of inlineDebounce for selection updates in editor 2023-03-24 11:41:03 +05:00
ammarahm-ed
4c5253c267 mobile: release v2.4.9 2023-03-24 02:54:36 +05:00
Abdulrehman-Jafer
f5be8a0c86 web: migrate keyboard.js to typescript (#2160)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-24 00:57:55 +05:00
Abdullah Atta
5392582819 web: fix crash on opening an empty notebook 2023-03-24 00:35:29 +05:00
Abdullah Atta
651ae4cdaa web: bump version to 2.4.6 2023-03-24 00:28:19 +05:00
Abdullah Atta
d87b5c5386 desktop: don't show tray menu icons on flatpak builds 2023-03-24 00:28:19 +05:00
ammarahm-ed
d5331b1997 mobile: release v2.4.8 2023-03-24 00:18:12 +05:00
ammarahm-ed
0a6f8fa18e mobile: improve publish note sheet ui 2023-03-24 00:12:18 +05:00
Abdullah Atta
c1ba16eb80 web: group top level notebook notes 2023-03-23 23:58:17 +05:00
Ammar Ahmed
0cd01b25bd Merge pull request #2187 from streetwriters/fix/publish-note-mobile
Fix publish note with password on mobile
2023-03-23 23:52:50 +05:00
Abdullah Atta
f0c1300ec8 web: hyper optimize move note dialog 2023-03-23 23:48:49 +05:00
ammarahm-ed
70eee2a224 mobile: cleanup logs 2023-03-23 23:48:49 +05:00
ammarahm-ed
42470d1d67 mobile: fix add button color in dark mode 2023-03-23 23:48:49 +05:00
ammarahm-ed
7fc58a3fa5 mobile: make bottom padding optional in sheet 2023-03-23 23:48:49 +05:00
ammarahm-ed
e186037c03 mobile: fix bottom padding on sheet 2023-03-23 23:48:49 +05:00
ammarahm-ed
732a0ffea4 mobile: fix duplicate key warning 2023-03-23 23:48:49 +05:00
ammarahm-ed
89f2e9fde1 mobile: show selected indicator on notebook 2023-03-23 23:48:49 +05:00
Abdullah Atta
c369541a7f web: indicate which notebooks have selected topics 2023-03-23 23:48:49 +05:00
Abdullah Atta
0b7a157ab1 web: enable multiselect mode if note is in > 1 nb/topic 2023-03-23 23:48:49 +05:00
ammarahm-ed
9b86c6ebb7 mobile: fix multiselection bugs 2023-03-23 23:48:49 +05:00
ammarahm-ed
22cd07e414 mobile: improve selection performance 2023-03-23 23:48:49 +05:00
ammarahm-ed
47f919cb61 mobile: fix reset select does not reset selected topics 2023-03-23 23:48:49 +05:00
Abdulrehman-Jafer
5b3c889b7c web: migrate css.js to typescript (#2165)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-23 17:03:23 +05:00
Abdullah Atta
77ac53215c web: remove document as any in page-visibility 2023-03-23 13:55:52 +05:00
Abdulrehman-Jafer
167c7125d2 web: migrate page-visibility.js to typescript (#2166)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-23 13:48:57 +05:00
Abdullah Atta
ba56fd0279 web: don't reset reminders before getting the user 2023-03-23 13:46:54 +05:00
Abdullah Atta
8e795b729a web: read trash cleanup interval from db on startup 2023-03-23 13:46:54 +05:00
Abdullah Atta
a4eb597f35 web: improve notebook vertical pane resizing 2023-03-23 13:46:44 +05:00
Abdullah Atta
0aeade69da web: fix topic search 2023-03-23 13:43:45 +05:00
Abdullah Atta
90a3bd3307 web: fix crash on creating a topic 2023-03-23 13:43:45 +05:00
ammarahm-ed
7a61e3558e mobile: ui cleanup 2023-03-23 13:39:14 +05:00
Abdulrehman-Jafer
dd9c555bff web: migrate parse.js to typescript (#2162)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-23 13:36:31 +05:00
ammarahm-ed
50f84780bb mobile: fix publish note with password not working 2023-03-23 13:23:04 +05:00
Abdulrehman-Jafer
e12372364d web: add support for realtime search (#2171)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-23 12:45:33 +05:00
ammarahm-ed
969611c9e6 mobile: release v2.4.7 2023-03-22 15:05:24 +05:00
ammarahm-ed
06399fe3bd mobile: fix title hidden on navigate sometimes 2023-03-22 15:02:55 +05:00
Abdullah Atta
35c5a90b4e web: update version highlights 2023-03-22 13:47:41 +05:00
Abdullah Atta
3c70cccd14 web: topic is rendered incomplete when opened directly 2023-03-22 13:42:36 +05:00
Abdullah Atta
a3c24bc666 editor: fix image resizing 2023-03-22 13:28:25 +05:00
ammarahm-ed
16b00d21a6 mobile: cleanup 2023-03-22 13:28:25 +05:00
Abdullah Atta
88f90c6240 editor: add padding to placeholder 2023-03-22 13:28:25 +05:00
Abdullah Atta
a5c44dcb3b editor: add src to image on copy 2023-03-22 13:28:25 +05:00
Abdullah Atta
c0a2dd139a web: only load new media attachments on realtime sync 2023-03-22 13:28:25 +05:00
Abdullah Atta
b354a26f0a core: allow selectively downloading media attachments 2023-03-22 13:28:25 +05:00
ammarahm-ed
b3de1205d9 mobile: cleanup 2023-03-22 13:28:25 +05:00
ammarahm-ed
f18e8ae421 mobile: properly handle loading images in editor 2023-03-22 13:28:25 +05:00
ammarahm-ed
a46b863802 core: return only attachment meta if
attachment already exists
2023-03-22 13:28:25 +05:00
ammarahm-ed
2befa03cd2 mobile: conform to new image loading api 2023-03-22 13:28:25 +05:00
Abdullah Atta
763a108abb editor: always use relative height for resizer 2023-03-22 13:28:25 +05:00
Abdullah Atta
30a069c845 editor: always use black icons on image overlay 2023-03-22 13:28:25 +05:00
Abdullah Atta
ffbf5cdc88 editor: fade-in on image load 2023-03-22 13:28:25 +05:00
Abdullah Atta
4318a65a99 editor: use dataurl attr for inserting an image 2023-03-22 13:28:25 +05:00
Abdullah Atta
bc433c56ae core: don't return invalid dataurl if image doesn't exist 2023-03-22 13:28:25 +05:00
Abdullah Atta
e43740c6bc editor: add comments for why we use UTITypes 2023-03-22 13:28:25 +05:00
Abdullah Atta
6123bccf4b editor: only save image height on load 2023-03-22 13:28:25 +05:00
Abdullah Atta
08106c20e8 editor: use dataurl instead of src attr for loading images 2023-03-22 13:28:25 +05:00
Abdullah Atta
eaaecbd5e5 core: hash base64 before saving it as attachment to prevent dups 2023-03-22 13:28:25 +05:00
Abdullah Atta
29608099db web: writeEncrypted -> writeEncryptedBase64 2023-03-22 13:28:25 +05:00
Abdullah Atta
7a773937c2 core: writeEncrypted now accepts only base64 input 2023-03-22 13:28:25 +05:00
Abdullah Atta
fa4a298bfa web: use NodeJS.Platform instead of process.platform 2023-03-22 10:45:03 +05:00
Abdulrehman-Jafer
966bedbb49 web: migrate platform.js to typescript (#2163)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-22 10:42:49 +05:00
Abdulrehman-Jafer
159b6f3ca6 web: migrate dimensions.js to typescript (#2153)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-22 09:21:48 +05:00
Abdulrehman-Jafer
de1b0fc466 web: migrate filename.js to typescript (#2156)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-22 09:07:52 +05:00
Abdulrehman-Jafer
b6a3394dee web: migrate object.js to typescript (#2161)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-22 09:00:29 +05:00
Abdulrehman-Jafer
f5ac51db13 web: migrate random.js to typescript (#2164)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-22 08:59:07 +05:00
Muhammad Ali
df94f31998 web: added state base to default font-family and size 2023-03-22 08:38:21 +05:00
Abdullah Atta
1ec0b65fe8 web: extract attachment extension from mime-type 2023-03-21 09:59:45 +05:00
Abdullah Atta
d9a77ff658 core: migrate filename.ts to javascript 2023-03-21 09:59:45 +05:00
ammarahm-ed
c45118515c editor: add react-scripts patch 2023-03-21 09:59:45 +05:00
ammarahm-ed
f9b8865351 editor: export blob as b64 with correct content type 2023-03-21 09:59:45 +05:00
ammarahm-ed
1e92b3fc92 mobile: resolve attachment hash from src if hash not avail 2023-03-21 09:59:45 +05:00
ammarahm-ed
f34fb858ec mobile: add filename extension before download 2023-03-21 09:59:45 +05:00
ammarahm-ed
1fdede5518 core: add getFileNameWithExtension utility 2023-03-21 09:59:45 +05:00
Abdulrehman-Jafer
a454ec4944 web: migrate color.js to typescript (#2151)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-21 09:37:56 +05:00
Abdullah Atta
5afbf103ac ci: disable arm64 builds for snap 2023-03-21 09:25:15 +05:00
Abdullah Atta
2ef1b76bfb ci: disable deb/rpm builds 2023-03-21 09:03:15 +05:00
Abdullah Atta
f7d06d3b82 desktop: enable arm64 builds 2023-03-21 08:40:03 +05:00
Abdullah Atta
e405468471 web: bump version to 2.4.5 2023-03-21 08:07:11 +05:00
Abdullah Atta
9d2bacdc5f web: replace fixed 7 days with trash cleanup interval 2023-03-21 08:06:34 +05:00
Abdullah Atta
b44d4702be web: update @notesnook-importer/core to v1.7.1 2023-03-20 18:52:05 +05:00
Abdullah Atta
03803dbc23 editor: fix task-list tests 2023-03-20 18:05:27 +05:00
Abdullah Atta
9ea675ded1 editor: fix sub checklists not sorting 2023-03-20 18:05:27 +05:00
Abdullah Atta
c85d623e1c web: update tab/window title for locked & conflicted notes 2023-03-20 18:05:27 +05:00
ammarahm-ed
e6f1320b1d mobile: optimize sheets 2023-03-20 17:08:06 +05:00
Abdullah Atta
80f49e22e5 web: reset tab/window title on new note 2023-03-20 17:05:18 +05:00
Abdullah Atta
4884c27a9a editor: update patches 2023-03-20 16:40:58 +05:00
Ammar Ahmed
4976a4dab4 Merge pull request #2143 from streetwriters/fix-ipad-orientation
mobile: fix ipad orientation window sizing
2023-03-20 16:36:02 +05:00
Ammar Ahmed
5eb0b5faa7 Merge pull request #2145 from streetwriters/fix-gallery-not-shown-reupload
Fix gallery not shown when reupload image
2023-03-20 16:35:49 +05:00
Ammar Ahmed
5e33cb93c6 editor: fix focus last node on tap bottom area on mobile (#2148) 2023-03-20 16:35:23 +05:00
ammarahm-ed
b4220d349f editor: fix loading copied image on ios 2023-03-20 16:34:46 +05:00
Abdullah Atta
d4752685d0 editor: keep marks when creating new list items
we shouldn't reset the user's selected styles like bold/italic when they
create a new list item.
2023-03-20 16:33:14 +05:00
ammarahm-ed
0b06d2a4bd mobile: fix attachment dialog ui 2023-03-20 15:09:52 +05:00
ammarahm-ed
a37d9a193f mobile: fix gallery not shown on reupload image 2023-03-20 15:09:23 +05:00
Abdulrehman-Jafer
b1d465e8bf web: fix monographs and reminders search (#2142)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-20 14:40:51 +05:00
Abdullah Atta
31e17c305f web: show correct sync status when sync is disabled 2023-03-20 14:01:20 +05:00
Abdullah Atta
72db8724ec editor: improve gradient overlay on image 2023-03-20 14:00:50 +05:00
ammarahm-ed
b64cb22186 mobile: fix ipad orientation window sizing 2023-03-20 13:51:16 +05:00
Abdullah Atta
f5ca1220de web: add confirm & progress for subscription cancelling 2023-03-20 12:53:20 +05:00
Abdullah Atta
fb54125ee6 web: simplify subscription cancellation 2023-03-20 12:53:20 +05:00
Abdullah Atta
be957d058f core: add basic subscription handling 2023-03-20 12:53:20 +05:00
Abdullah Atta
54a3e3c927 mobile: remove react-native-actions-sheet patch 2023-03-20 12:47:23 +05:00
ammarahm-ed
aabbf7c1c1 mobile: fix tags not properly shown in sheet 2023-03-20 11:32:49 +05:00
ammarahm-ed
7773ba0804 mobile: finalize topic sheet ui 2023-03-20 11:28:53 +05:00
ammarahm-ed
9f812772fe mobile: fix tag text position 2023-03-20 11:28:53 +05:00
ammarahm-ed
75191afc3e mobile: fix image upload broken on ios 2023-03-20 11:28:53 +05:00
Abdulrehman-Jafer
1c25baccea web: set tab/window title to note title (#2127)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-19 12:24:55 +05:00
Abdullah Atta
b1d4ccc27e editor: fix dropdown needing 2 clicks to open 2023-03-18 12:28:08 +05:00
Abdulrehman-Jafer
0d714847f3 web: copy version on clicking the version item in settings (#2131)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
Co-authored-by: Abdullah Atta <thecodrr@protonmail.com>
2023-03-18 12:25:20 +05:00
Abdullah Atta
760d4abbd0 web: groups shouldn't be ignored in reminders list 2023-03-18 11:58:30 +05:00
Abdullah Atta
7c1bb33ea9 mobile: update package-lock.json 2023-03-18 11:58:30 +05:00
ammarahm-ed
5ba8ce549e mobile: disable update check during tests 2023-03-18 11:58:30 +05:00
ammarahm-ed
a449c614ee mobile: make all tests pass 2023-03-18 11:58:30 +05:00
Abdullah Atta
12e6688f48 web: nuke Remove from topic menu item 2023-03-18 11:58:30 +05:00
Abdullah Atta
da47ef159b web: fix multiselect for notebook actions on note 2023-03-18 11:58:30 +05:00
Abdullah Atta
efc678d3cd core: removeFromAllNotebooks should unlink notebook relations too 2023-03-18 11:58:30 +05:00
ammarahm-ed
d7a126ab85 mobile: add test ids 2023-03-18 11:58:30 +05:00
ammarahm-ed
bc9c976c95 mobile: fix header title size in topic 2023-03-18 11:58:30 +05:00
ammarahm-ed
26af23771d mobile: fix refresh control colors 2023-03-18 11:58:30 +05:00
ammarahm-ed
590f2d80d3 mobile: add remove from notebook with multi-select 2023-03-18 11:58:30 +05:00
ammarahm-ed
fdeb34ff0a mobile: improve wording of delete notebook dialog 2023-03-18 11:58:30 +05:00
Abdullah Atta
ec76be776c web: make topics optional in importer 2023-03-18 11:58:30 +05:00
Abdullah Atta
4de5691428 web: clarify notebook/topic delete dialog wording 2023-03-18 11:58:30 +05:00
ammarahm-ed
ae5b339251 mobile: change color of sort direction button 2023-03-18 11:58:30 +05:00
ammarahm-ed
a6021943e1 mobile: top level notes 2023-03-18 11:58:30 +05:00
Abdullah Atta
765fcafc38 web: fix all tests & improve notebook/topic deletion 2023-03-18 11:58:30 +05:00
Abdullah Atta
7a53881eb3 web: remove unnecessary console.log 2023-03-18 11:58:30 +05:00
Abdullah Atta
854f22f373 web: improve how reminder bar looks when pane is resized 2023-03-18 11:58:30 +05:00
Abdullah Atta
0566f98323 web: disable horizontal scroll in list container 2023-03-18 11:58:30 +05:00
Abdullah Atta
435a358c4c web: switch to compact ui for tag items 2023-03-18 11:58:30 +05:00
Abdullah Atta
3f55422d45 web: add support for top-level notes in notebooks 2023-03-18 11:58:30 +05:00
Abdullah Atta
9804c1fbb1 core: include notebook notes in total notes count 2023-03-18 11:58:30 +05:00
Abdullah Atta
c3b8c4b630 mobile: update help tips 2023-03-18 11:58:30 +05:00
Abdullah Atta
8c4d8622d8 web: replace svg placeholders with helpful tips 2023-03-18 11:58:30 +05:00
Abdullah Atta
86770b32bb core: add support for linking notes with notebooks
this basically allows notes to exist at the top-level in a notebook
2023-03-18 11:58:30 +05:00
Abdullah Atta
74c86c1e5f editor: table options not visible on old tables 2023-03-17 22:44:29 +05:00
ammarahm-ed
1538b74c63 mobile: make never option premium in trash interval 2023-03-17 22:07:19 +05:00
Abdullah Atta
5934c518e6 web: refactor OptionItem to take objects instead of strings 2023-03-17 22:07:19 +05:00
alihamuh
71dfd0cf9a web: changed config to db for trashClean up interval 2023-03-17 22:07:19 +05:00
ammarahm-ed
984bf1f15f core: remove trash duration fn 2023-03-17 22:07:19 +05:00
ammarahm-ed
a14949b75a mobile: remove pro check 2023-03-17 22:07:19 +05:00
ammarahm-ed
7bbe138d91 mobile: cleanup 2023-03-17 22:07:19 +05:00
ammarahm-ed
65dea70ae5 mobile: add trash interval settings 2023-03-17 22:07:19 +05:00
ammarahm-ed
a07c8b9e11 core: add trash cleanup duration settings 2023-03-17 22:07:19 +05:00
Abdullah Atta
69b82c61f8 web: change wording of trash settings 2023-03-17 22:07:19 +05:00
alihamuh
fb8df74242 web: added trash setting to control delete time 2023-03-17 22:07:19 +05:00
Abdullah Atta
3674594832 core: do a healthcheck before logging out user on session revoke 2023-03-17 17:03:00 +05:00
Ammar Ahmed
1ee24cde07 editor: add support for attachment previews (#2123)
This adds support for basic attachment preview support. Currently only image previews are supported on mobile.

    Fixed image downloading not working on mobile
    Added image preview support on mobile with support for loading full quality images in full screen.
    Added Attachment preview logic in editor, so in future we can support preview for other files such as audio & video
2023-03-17 14:43:53 +05:00
Abdullah Atta
93baed35f4 editor: fix code-block tests to use our own getChangedNodes fn
(cherry picked from commit ff246fb9092ea002b76738f3f7082b5c5f10ea6c)
2023-03-13 12:41:29 +05:00
Abdullah Atta
3e1420d496 editor: get rid of @remirror/core-utils
(cherry picked from commit c74f15c86b2f25c9f572ea74f47243e1b52f9c1f)
2023-03-13 12:41:02 +05:00
Abdullah Atta
ebc4324ef1 web: upgrade @notesnook-importer/core to v1.6.0 2023-03-10 18:24:59 +05:00
Abdullah Atta
6ba04f4731 editor: move cell properties button outside of table settings
this fixes #1410
2023-03-06 16:44:09 +05:00
Abdulrehman-Jafer
7359e23b65 web: fix autocomplete caret color in all inputs (#2073)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-06 15:25:14 +05:00
Abdullah Atta
01387bae94 editor: update code-block test snapshost 2023-03-06 15:15:52 +05:00
Abdullah Atta
df1d61ecdf ci: build editor before running tests 2023-03-06 15:15:52 +05:00
Abdullah Atta
cb644dbea6 editor: disable wrapping for all lines in codeblocks 2023-03-06 15:15:52 +05:00
Abdullah Atta
fc5ea0ad51 editor: add tests for codeblock 2023-03-06 15:15:52 +05:00
Abdullah Atta
8108dbae8a editor: move codeblock language loading into highlighter plugin 2023-03-06 15:15:52 +05:00
Abdullah Atta
b14a9d6eca editor: improve code block detection when pasting 2023-03-06 15:15:52 +05:00
Abdullah Atta
2f4a7f5410 editor: migrate tests to vitest 2023-03-06 15:15:52 +05:00
Abdulrehman-Jafer
dfa718f8ea web: fix autocomplete text color for all inputs (#2057)
Signed-off-by: Abdulrehman-Jafer <abdulrehmanjaferwork01233@gmail.com>
2023-03-06 14:53:35 +05:00
Abdullah Atta
f842700192 web: upgrade @notesnook/importer to v1.5.4 2023-03-03 20:37:33 +05:00
ammarahm-ed
953d0295dc mobile: update release notes 2023-03-02 13:42:25 +05:00
Ammar Ahmed
836f607aa0 mobile: fix reminders not working on android (#2038) 2023-03-02 13:38:58 +05:00
ammarahm-ed
2c6f205ea9 mobile: exclude deps with "android"
keyword on ios
2023-02-28 16:56:16 +05:00
ammarahm-ed
8154dd1830 mobile: release v2.4.5 2023-02-28 16:41:37 +05:00
ammarahm-ed
686674c855 mobile: fix fdroid build check 2023-02-28 16:32:45 +05:00
Abdullah Atta
8e5d931be1 web: bump version to 2.4.4 2023-02-28 16:18:48 +05:00
Abdullah Atta
46509a04b0 editor: all lists should have the same spacing 2023-02-28 16:18:48 +05:00
Ammar Ahmed
d6e189134c fix ci build (#2027) 2023-02-28 15:21:48 +05:00
ammarahm-ed
0a05780e4d mobile: do not apped date to file name
in bulk exports
2023-02-28 15:18:06 +05:00
Abdullah Atta
1671c99614 web: hide backup reminder on download backup 2023-02-28 14:47:52 +05:00
ammarahm-ed
b5c8afe8f7 mobile: handle same filename 2023-02-28 14:09:09 +05:00
Abdullah Atta
7e4ab8e14b web: sanitize filename for single note export 2023-02-28 14:09:09 +05:00
Abdullah Atta
35210ad02b web: remove unnecessary console.log stmt 2023-02-28 14:09:09 +05:00
Abdullah Atta
9f853f0b36 web: uniquify dup filenames when creating zip 2023-02-28 14:09:09 +05:00
Abdullah Atta
559698c946 web: don't replace non-ascii chars in filename sanitizer 2023-02-28 14:09:09 +05:00
ammarahm-ed
50c05efb48 mobile: fix platform check 2023-02-28 14:07:00 +05:00
Abdullah Atta
94b9d3590d web: add resistence to submenu closing
this takes care of accidentally closing sub menus when moving the mouse
over to it.
2023-02-28 13:45:06 +05:00
Abdullah Atta
092016f942 editor: do not build test files 2023-02-28 12:44:11 +05:00
Abdullah Atta
24c899e709 web: ensure that images get downloaded on realtime sync 2023-02-28 12:11:13 +05:00
Abdullah Atta
e53cc648f0 core: do not unsub all once events on publish
this was a stupid bug where publishing any type of event would
unsubscribe all events that had once set to true.
2023-02-28 12:11:13 +05:00
ammarahm-ed
4c541f3995 mobile: load compressed images in editor 2023-02-28 12:11:13 +05:00
ammarahm-ed
f56cbfc142 mobile: fix loading images in realtime sync 2023-02-28 12:11:13 +05:00
Ammar Ahmed
c21c4f1117 mobile: fix color-scheme not change on toggle (#2024)
system theme
2023-02-28 11:47:04 +05:00
Abdullah Atta
abf1f5c61c editor: add tests for backspace handling 2023-02-28 11:17:05 +05:00
Abdullah Atta
1d5b0793d0 editor: move list node types to a separate file to prevent require loop 2023-02-28 11:17:05 +05:00
Abdullah Atta
5ba72fdbd4 editor: adjust sub list indentation 2023-02-28 11:17:05 +05:00
alihamuh
c7d26d2444 editor: improve backspace handling with lists 2023-02-28 11:17:05 +05:00
Muhammad Ali
22c146e350 web: fix context menu crash due to incorrect topic references (#2016) 2023-02-28 10:19:26 +05:00
Ammar Ahmed
1cb0ebd4f8 mobile: fix scroll into view on ios (#2017) 2023-02-27 16:06:06 +05:00
Ammar Ahmed
eff2e475ff mobile: add oss licenses (#2018) 2023-02-27 16:05:47 +05:00
Abdullah Atta
aef475d8fc ci: fix workflow step name 2023-02-27 11:07:06 +05:00
Abdullah Atta
1ed2e55867 ci: add workflow for editor tests 2023-02-27 11:07:06 +05:00
Abdullah Atta
16ffec1f1e editor: set up integration tests 2023-02-27 11:07:06 +05:00
Abdullah Atta
912e97dc3c editor: add button to sort task list 2023-02-27 11:07:06 +05:00
Abdullah Atta
ca2f924417 ci: add config for DCO PR check 2023-02-27 11:05:06 +05:00
Muhammad Ali
468fba8fcf web: hide status bar in tablet mode (#2001) 2023-02-25 11:58:32 +05:00
Abdullah Atta
b948dcee22 editor: optimize clear all completed tasks action 2023-02-25 11:55:46 +05:00
Abdullah Atta
a633f4a3fe editor: task list should update when its items are toggled 2023-02-25 11:53:57 +05:00
Abdullah Atta
acb384c901 editor: fix Enter key not working on some keyboards in Android 2023-02-24 11:47:10 +05:00
Abdullah Atta
043228fe47 editor: fix link popup not opening on link focus 2023-02-24 09:20:35 +05:00
Muhammad Ali
f29e7936d1 editor: fix link colors in link hover popup (#1991)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-02-23 17:19:13 +05:00
Ammar Ahmed
d4a7b8d9c9 editor: add borders/scrolling to tagbar on mobile (#1997) 2023-02-23 17:07:44 +05:00
Muhammad Ali
fbabfe468a editor: adjust horizontal rule's vertical spacing (#1985) 2023-02-23 17:00:13 +05:00
Muhammad Ali
87c7eccee4 editor: preserve all whitespaces while setting content (#1978)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-02-23 16:34:46 +05:00
Ammar Ahmed
648eac5555 mobile: fix login 2fa sheet (#1996)
* mobile: fix login 2fa sheet not open inside modal

* mobile: disable buttons in loading state
2023-02-23 16:15:09 +05:00
ammarahm-ed
fe8ba8ca90 mobile: show error if mfa info not recieved 2023-02-23 15:49:53 +05:00
ammarahm-ed
8fa4b5017c mobile: hide keyboard on ios on app lock screen 2023-02-23 15:49:53 +05:00
Abdullah Atta
d2f39df3bf web: make tests more reliable 2023-02-23 15:14:49 +05:00
Abdullah Atta
2ada289e74 editor: update patch for @tiptap/extension-link 2023-02-23 13:13:27 +05:00
Abdullah Atta
1edf416461 editor: update patch for @tiptap/core 2023-02-23 13:13:27 +05:00
Abdullah Atta
6fae73b612 editor: increase force update debounce timeout to 200ms 2023-02-23 13:13:27 +05:00
Abdullah Atta
ec898748b1 editor: preserve font family in persisted selection 2023-02-23 13:13:27 +05:00
Abdullah Atta
5be67823ce editor: optimize selection updates in codeblock 2023-02-23 13:13:27 +05:00
Abdullah Atta
fd868aec95 web: debounce selection updates in editor 2023-02-23 13:13:27 +05:00
Abdullah Atta
33bf5e26ff editor: only show table toolbars when table is selected 2023-02-23 13:13:27 +05:00
Abdullah Atta
08363f95e0 editor: update tiptap packages 2023-02-23 13:13:27 +05:00
Abdullah Atta
dc62291fba editor: only update node views if attributes change 2023-02-23 13:13:27 +05:00
Abdullah Atta
43034cf3a3 editor: show gradient overlay on image for better contrast 2023-02-23 13:13:27 +05:00
Abdullah Atta
88f047c312 editor: reduce no. of nested nodes in task list for perf 2023-02-23 13:13:27 +05:00
Abdullah Atta
46a635d4f4 editor: migrate to vanilla js outline list 2023-02-23 13:13:27 +05:00
Ammar Ahmed
882217be63 web: Fix sync settings toggles on/off text (#1995)
* web: fix sync toggles text
2023-02-23 13:11:19 +05:00
Ammar Ahmed
87a2650480 mobile: fix background events (#1994) 2023-02-23 13:05:15 +05:00
ammarahm-ed
c41806bd70 editor: fix build errors 2023-02-23 11:02:10 +05:00
ammarahm-ed
ae7a6ba88c mobile: fix fdroid app version code 2023-02-23 09:50:11 +05:00
Abdullah Atta
df78b31527 web: fix invalid submenu position due to element id conflict (#1977) 2023-02-21 09:41:21 +05:00
Abdullah Atta
4040c62dda editor: focus search input on pressing ctrl+f 2023-02-20 17:37:25 +05:00
Abdullah Atta
34bf9d5b45 web: close publish popup on focus lost 2023-02-20 17:26:09 +05:00
Abdullah Atta
80cd37fe4f web: fix sub menus position 2023-02-20 16:48:08 +05:00
Abdullah Atta
21a7dbad53 web: show no menu title when menu opened on 1 item 2023-02-20 16:45:03 +05:00
Abdullah Atta
c2b010d057 web: fix spacing around input in search view
Closes #1961
2023-02-20 16:38:15 +05:00
Abdullah Atta
82b01851c7 web: fix blank email input on session expiry screen 2023-02-20 16:29:06 +05:00
Muhammad Ali
0a81f0a09a editor: fix vertical spacing between nested lists (#1928)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-02-20 16:03:00 +05:00
Muhammad Ali
e06cbb39b0 editor: make link uneditable in readonly mode (#1968) 2023-02-20 15:25:01 +05:00
Abdullah Atta
b52cc0c590 web: do not allow non-string ETag header in attachments upload 2023-02-20 15:23:53 +05:00
Abdullah Atta
82376c8c47 web: make app loading animation smoother 2023-02-20 15:23:53 +05:00
Abdullah Atta
e0b191b9a0 web: get rid of editor-placeholder (always show editor by default) 2023-02-20 15:23:53 +05:00
Abdullah Atta
6ef6259629 web: improve ui of note unlock screen 2023-02-20 15:23:53 +05:00
Abdullah Atta
52d08f9392 web: fix multi-selection in manage attachments dialog 2023-02-20 15:23:53 +05:00
Abdullah Atta
6812d3552a web: fix svg logo in splashscreen 2023-02-20 15:23:52 +05:00
Abdullah Atta
68ebb132cd global: update packages to ensure we bundle only 1 version of @mdi/js 2023-02-20 15:23:52 +05:00
ammarahm-ed
203aa4824d mobile: do not use process.env 2023-02-20 14:54:44 +05:00
ammarahm-ed
047707dd35 mobile: build notifee from source 2023-02-20 12:35:03 +05:00
ammarahm-ed
7c7645c0c6 ci: fix release workflow 2023-02-15 14:02:14 +05:00
ammarahm-ed
2d4ca15e10 mobile: release v2.4.4 2023-02-15 13:57:07 +05:00
Abdullah Atta
9ca831713c docs: update contributing guidelines 2023-02-15 10:18:35 +05:00
Ammar Ahmed
56008c15c5 mobile: remove recovery code input maxLength (#1922) 2023-02-15 10:18:30 +05:00
Ammar Ahmed
2a2811ec54 mobile: fix cannot read property of title (#1921) 2023-02-15 10:17:55 +05:00
Abdullah Atta
bb0c48f26a web: bump version to 2.4.3 2023-02-14 12:45:17 +05:00
Abdullah Atta
2f815fcec3 web: use word counter from editor 2023-02-14 12:36:59 +05:00
ammarahm-ed
cc446f99ee mobile: use word-counter from editor 2023-02-14 12:36:59 +05:00
ammarahm-ed
9e83e67a0b editor: add word-counter 2023-02-14 12:36:59 +05:00
ammarahm-ed
bf589da7b8 mobile: bump version to 2.4.3 2023-02-14 12:15:15 +05:00
ammarahm-ed
21b278d42e desktop: fix app not quitting when closeToSystemTray
enabled
2023-02-14 12:12:58 +05:00
ammarahm-ed
2cd6a397dc desktop: fix tray icon size on macos 2023-02-14 12:12:26 +05:00
Abdullah Atta
b3aa56736e desktop: make tray icon bigger on linux & macos 2023-02-14 11:58:39 +05:00
Abdullah Atta
e52b72b0c6 desktop: show sys tray icon only if close/minimize to sys tray is on 2023-02-14 11:58:39 +05:00
Abdullah Atta
6fa82bbe2e desktop: show Open in browser menu item when a link is selected 2023-02-14 11:58:39 +05:00
Abdullah Atta
6b3c628e6b desktop: do not show native menu if its empty 2023-02-14 11:58:39 +05:00
Abdullah Atta
39e14d059e desktop: only show Copy menu item if there's a selection 2023-02-14 11:58:39 +05:00
Abdullah Atta
494d6633b5 desktop: make quit from dock menu work again on macOS 2023-02-14 11:58:39 +05:00
Abdullah Atta
690d405103 desktop: exit the app if window is closed when its fullscreen on macOS 2023-02-14 11:58:39 +05:00
Abdullah Atta
6a05048aed desktop: make fullscreen work again on macOS 2023-02-14 11:58:39 +05:00
Abdullah Atta
f75c010ecb desktop: save window state eagerly as soon as its updated 2023-02-14 11:58:39 +05:00
ammarahm-ed
f2c0c34c10 mobile: small ui fixes 2023-02-14 11:51:46 +05:00
ammarahm-ed
512517cc64 mobile: patch react-native-actions-sheet 2023-02-14 11:26:21 +05:00
Abdullah Atta
74f1d3cb74 desktop: fix start minimized on windows 2023-02-14 10:41:19 +05:00
Abdullah Atta
f99cbd011a desktop: fix styling of language selector dialog 2023-02-14 10:41:19 +05:00
ammarahm-ed
18d80cde42 mobile: fix wrong recovery code length 2023-02-14 10:26:17 +05:00
Abdullah Atta
6f2127abb8 desktop: prevent setting privacy mode on linux 2023-02-14 10:00:52 +05:00
GitStart
cb1c023815 web: clicking on Settings doesn't toggle the settings pane on/off (#1882)
Signed-off-by: Gitstart <gitstart@gitstart.com>
Co-authored-by: gitstart <gitstart@users.noreply.github.com>
2023-02-14 09:25:22 +05:00
Abdullah Atta
a9a6a00f87 web: fix export html test 2023-02-13 18:13:54 +05:00
Abdullah Atta
060952697a web: bring back title in context menu 2023-02-13 18:13:54 +05:00
Abdullah Atta
a0579278c9 web: fix all e2e tests 2023-02-13 18:13:54 +05:00
ammarahm-ed
678684e24b mobile: update e2e tests for notebook 2023-02-13 18:13:54 +05:00
ammarahm-ed
27e3d18987 mobile: improve move-to sheet ux 2023-02-13 18:13:54 +05:00
Abdullah Atta
7ffe7f1a0c web: make link to notebook much more ux friendly 2023-02-13 18:13:54 +05:00
Abdullah Atta
03c037da97 web: show linked notebooks in note's context menu 2023-02-13 18:13:54 +05:00
Abdullah Atta
b7f035b78e core: simplify total notes counting in notebooks 2023-02-13 18:13:54 +05:00
Abdullah Atta
66fe109eb9 core: add fn to remove all notebooks from a note 2023-02-13 18:13:54 +05:00
Abdullah Atta
f62cd63fbb web: add separators in context menus & reorganize menu items 2023-02-13 18:13:54 +05:00
Abdullah Atta
e1e980cbb2 web: improve ui of context menus to match app ui 2023-02-13 18:13:54 +05:00
Abdullah Atta
ca5543d6ea web: fix separators in context menu 2023-02-13 18:13:54 +05:00
Abdullah Atta
05cec14c9b web: migrate base dialog to typescript 2023-02-13 18:13:54 +05:00
Abdullah Atta
1123fe0383 web: fix 'doNotTrack' is not exported from '../utils/telemetry' error 2023-02-13 18:01:02 +05:00
Abdullah Atta
5855fe34ee web: remove unnecessary import 2023-02-13 17:48:24 +05:00
Abdullah Atta
030e57d0a9 web: remove tracking event when signup is skipped 2023-02-13 17:48:24 +05:00
Abdullah Atta
b6f922eb92 web: make telemetry opt-in by default 2023-02-13 17:48:24 +05:00
ammarahm-ed
2ab756a847 mobile: make telemetry opt-in 2023-02-13 17:48:24 +05:00
Abdullah Atta
3611bba1d4 Merge pull request #1889 from streetwriters/feature/ux
Minor UX improvements
2023-02-13 16:40:18 +05:00
ammarahm-ed
e07f32fb98 mobile: remove some buttons from editor header 2023-02-13 13:12:41 +05:00
ammarahm-ed
5ba065c8f1 mobile: fix share extension not launching on ios 2023-02-13 09:48:44 +05:00
Abdullah Atta
1fb7541d14 config: improve integration with vscode
this adds recommended extensions, a vscode workspace config, workspace
settings & launch configs for mobile & web apps.
2023-02-13 09:18:01 +05:00
Ammar Ahmed
0dc0ba21f9 Merge branch 'master' into feature/ux
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2023-02-09 16:09:52 +05:00
ammarahm-ed
e34f1f0b45 mobile: redesign properties sheet 2023-02-09 15:34:29 +05:00
ammarahm-ed
604d98f772 mobile: increase raduis of sheet border corners 2023-02-09 15:34:07 +05:00
ammarahm-ed
40eb2d083d mobile: add vertical margins to selection header 2023-02-09 15:33:49 +05:00
ammarahm-ed
3bca1ca795 mobile: remove action strip 2023-02-09 15:33:15 +05:00
Abdullah Atta
ae4afd5154 core: remove dir="ltr" from snapshots 2023-02-09 13:50:03 +05:00
Abdullah Atta
27e732665a web: remove dir="ltr" from html snapshots 2023-02-09 13:50:03 +05:00
Abdullah Atta
6415e89df9 web: allow newlines in item body 2023-02-09 13:47:33 +05:00
Abdullah Atta
4ef8785489 web: allow multi-line text in reminder description 2023-02-09 13:47:33 +05:00
Abdullah Atta
b7af3d92c9 web: set note title as default reminder title 2023-02-09 13:47:33 +05:00
ammarahm-ed
82a80269d3 mobile: prompt user to enable notifications if
notifications are explicitly disabled.
2023-02-09 13:47:33 +05:00
ammarahm-ed
6112eedcc4 mobile: remove no of lines limit from properties 2023-02-09 13:47:33 +05:00
ammarahm-ed
001bdc1dc9 mobile: fix padding of message card 2023-02-09 13:47:33 +05:00
ammarahm-ed
fb2de4245d mobile: fix sizing on indicators on reminder item 2023-02-09 13:47:33 +05:00
ammarahm-ed
9164d8f138 mobile: fix reminder item text wrapping 2023-02-09 13:47:33 +05:00
ammarahm-ed
fbcfbfc12c mobile: reminder improvements
1. Set default title/description
2. Multiline reminder description input
2023-02-09 13:47:33 +05:00
Abdullah Atta
fb8e3a2364 core: update showdown to 3.0.1.alpha.2 2023-02-09 13:24:18 +05:00
Abdullah Atta
375ef1c06d web: improve hover color contrast on dark theme 2023-02-09 11:11:41 +05:00
Abdullah Atta
a064254bcf web: improve item ui when it is focused 2023-02-09 10:08:15 +05:00
Abdullah Atta
95cf31703a web: change bg of all menus to gray-ish 2023-02-09 10:07:44 +05:00
Abdullah Atta
ff995c8d60 web: make editor properties opening/closing faster 2023-02-09 10:06:02 +05:00
Abdullah Atta
1f7b8ce1ed web: refactor note menu items definition 2023-02-09 10:05:43 +05:00
Abdullah Atta
f2608a1a8d web: add readonly menu item in context menu 2023-02-09 10:05:21 +05:00
Abdullah Atta
4e858f3230 web: scroll element into view when navigating using keyboard 2023-02-09 10:02:29 +05:00
Abdullah Atta
ba7daf9766 web: do not animate opening/closing of context menus 2023-02-09 10:01:42 +05:00
ammarahm-ed
d2fcd61541 mobile: reorganize actions in properties 2023-02-08 13:47:33 +05:00
Abdullah Atta
417be8dbf0 web: fetch announcements once on app startup 2023-02-06 13:25:15 +05:00
Abdullah Atta
9b145d15af editor: limit link width in popup to prevent overflow 2023-02-06 13:23:21 +05:00
Abdullah Atta
6b9596d0d1 editor: auto open link popup when link is selected 2023-02-06 13:23:21 +05:00
Abdullah Atta
fa1ad69be7 editor: add support for auto opening more tools popup 2023-02-06 13:23:21 +05:00
Abdullah Atta
1f29273561 editor: only auto close a popup if it is fully opened 2023-02-06 13:23:21 +05:00
Abdullah Atta
4c21d781c4 web: remove unnecessary console.log 2023-02-06 12:27:28 +05:00
Abdullah Atta
746fc2963e web: do not enforce telemetry setting causing it to reset 2023-02-06 10:51:16 +05:00
Muhammad Ali
289ef2a324 web: always give preference to text over files when pasting (#1869)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-02-06 10:41:32 +05:00
Abdullah Atta
91eaf1c71e editor: add rtl support in images 2023-02-06 10:10:30 +05:00
Abdullah Atta
c22bedbfcf editor: use css for propagating text direction to child nodes 2023-02-06 10:10:30 +05:00
Abdullah Atta
ef104e4126 editor: add rtl support in task lists 2023-02-06 10:10:30 +05:00
Abdullah Atta
0d884aa161 editor: add rtl support in tables 2023-02-06 10:10:30 +05:00
Abdullah Atta
192fa8fc24 editor: add rtl support in outline list 2023-02-06 10:10:30 +05:00
Abdullah Atta
0ae24d12d8 editor: add rtl support in embed 2023-02-06 10:10:30 +05:00
Abdullah Atta
6ecf2c8ac3 editor: get text direction from selected or parent node 2023-02-06 10:10:30 +05:00
Abdullah Atta
da7267de43 editor: add text direction attr in more nodes 2023-02-06 10:10:30 +05:00
alihamuh
f134184a43 editor: improve text direction support in lists 2023-02-06 10:10:30 +05:00
ammarahm-ed
650a34ca73 mobile: fix width of items in app lock sheet 2023-02-04 15:05:59 +05:00
Muhammad Ali
009afcd6aa web: add support for CJK characters in word counter (#1840)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-02-04 12:22:58 +05:00
Ammar Ahmed
05f71f39a1 mobile: improved multi-select (#1867)
- Fixed multi-selection header position on iOS
- Added support for select all on mobile
2023-02-04 11:35:26 +05:00
Muhammad Ali
d3a3dc9200 web: confirm before deleting a reminder (#1843)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-02-04 11:30:04 +05:00
Abdullah Atta
9df44b1f3d ci: update desktop workflow 2023-01-30 19:34:29 +05:00
ammarahm-ed
964180a183 mobile: fix glitch on app launch ios 2023-01-30 19:30:08 +05:00
Abdullah Atta
4ef51f4d8f web: bump version to v2.4.2 2023-01-30 19:14:38 +05:00
Abdullah Atta
ee39d940be web: only show spellchecker settings on desktop 2023-01-30 19:11:36 +05:00
Abdullah Atta
db60299c54 desktop: fix resources path for macos 2023-01-30 19:10:24 +05:00
Abdullah Atta
7d3c31efc1 desktop: fix invalid versions of some packages 2023-01-30 18:23:23 +05:00
Abdullah Atta
9e68ccb5a8 desktop: regenerate package-lock.json file 2023-01-30 16:06:50 +05:00
Abdullah Atta
f05fc861d5 web: recovery code input should accept text 2023-01-30 15:10:10 +05:00
Abdullah Atta
085408e5a3 web: revert accidental version increments in package-lock.json 2023-01-30 15:03:26 +05:00
Abdullah Atta
6442a08d6f web: reset watchpack version to 2.4.0 2023-01-30 14:57:21 +05:00
Abdullah Atta
f58239e102 desktop: use custom download url for spell checker dicts 2023-01-30 14:41:19 +05:00
Abdullah Atta
f4952aa770 web: bump version to 2.4.1 2023-01-30 13:44:29 +05:00
Abdullah Atta
5747253400 web: reorder & invert sync toggles in settings 2023-01-30 13:17:33 +05:00
Abdullah Atta
57c45a049f web: week starts from 0, month starts from 1
Previously we were starting both from 0. This caused issues where
selecting 16 would actually select 15.
2023-01-30 13:10:32 +05:00
Abdullah Atta
b3516310b0 web: reset selected days on switching recurring mode 2023-01-30 13:10:32 +05:00
Abdullah Atta
9438c3ed46 web: show more days in one row 2023-01-30 13:10:32 +05:00
Abdullah Atta
35d36d3ec6 web: add tests for editing a recurring reminder 2023-01-30 12:59:24 +05:00
Abdullah Atta
d852b5c9db web: do not reset recurring mode on reminder edit 2023-01-30 12:59:24 +05:00
Abdullah Atta
bbb40a2842 web: use fixed 5px gap in reminder list item footer 2023-01-30 12:01:24 +05:00
Abdullah Atta
e46963512e editor: fix crash when closing search in a different note 2023-01-28 13:51:33 +05:00
Abdullah Atta
1ca5511e78 web: refresh search on note switch 2023-01-28 13:51:19 +05:00
Abdullah Atta
b6e368d730 editor: remove old decorations before applying new ones 2023-01-28 13:51:05 +05:00
Abdullah Atta
94dfee53bc editor: handle backspace correctly inside a multiline list item 2023-01-28 11:55:34 +05:00
Abdullah Atta
8996708164 web: don't create new p tag at editor end if there is selection 2023-01-28 11:21:00 +05:00
Abdullah Atta
b1f79e338f editor: store image size on first load 2023-01-28 11:13:29 +05:00
Abdullah Atta
40387ca082 editor: use cors when downloading pasted images 2023-01-28 11:13:29 +05:00
Abdullah Atta
b02941d5aa editor: don't show download button for dataurl images 2023-01-28 11:13:29 +05:00
Abdullah Atta
fad31fbeb3 desktop: make tray icon bigger 2023-01-28 09:32:57 +05:00
Abdullah Atta
ca08fc0e9d desktop: do not set icons in dock menu 2023-01-28 09:32:57 +05:00
Abdullah Atta
7df64837fe desktop: use special icon for tray 2023-01-28 09:32:57 +05:00
Abdullah Atta
fa70df366c desktop: migrate theme config to typescript 2023-01-28 09:32:57 +05:00
Abdullah Atta
70d4e99dc1 desktop: style tray icons based on actual system theme 2023-01-28 09:32:57 +05:00
Abdullah Atta
49272212bc desktop: don't emit event when user changes theme 2023-01-28 09:32:57 +05:00
ammarahm-ed
736b2a17e9 desktop: fix desktop integration on mac os 2023-01-28 09:32:57 +05:00
Abdullah Atta
ade420cf87 config: add apps/web/desktop to lerna workspaces 2023-01-28 09:32:57 +05:00
Abdullah Atta
96ed46bd4a web: update package-lock.json 2023-01-28 09:32:57 +05:00
Abdullah Atta
e334698e3b desktop: add dock menu on macos 2023-01-28 09:32:57 +05:00
Abdullah Atta
82d97f019d desktop: patch electron-builder to support desktop actions on linux 2023-01-28 09:32:57 +05:00
Abdullah Atta
fb56206537 desktop: fix resources directory path in release build 2023-01-28 09:32:57 +05:00
Abdullah Atta
22fff296b5 desktop: resize app icon in tray menu to 16px 2023-01-28 09:32:57 +05:00
Abdullah Atta
954cb1da0d desktop: iconIndex is required for icons in jumplist 2023-01-28 09:32:57 +05:00
Abdullah Atta
8c25de2aaf desktop: extract png icon from ico file 2023-01-28 09:32:57 +05:00
Abdullah Atta
b362dca795 desktop: use ico icons on windows 2023-01-28 09:32:57 +05:00
Abdullah Atta
45c6daabe7 desktop: add icons for tray items & jumplist 2023-01-28 09:32:57 +05:00
Abdullah Atta
43c5c67bfa desktop: refactor to clean up desktop integration logic 2023-01-28 09:32:57 +05:00
Abdullah Atta
dde276f77e desktop: migrate window state to typescript 2023-01-28 09:32:57 +05:00
Abdullah Atta
60ba6ba6cf web: update package-lock.json 2023-01-28 09:32:57 +05:00
Abdullah Atta
f7a0938c38 desktop: improve integration with operating system 2023-01-28 09:32:57 +05:00
Abdullah Atta
4805e54ef3 desktop: global.win -> globalThis.window 2023-01-24 16:58:18 +05:00
Abdullah Atta
a67599ce83 desktop: add setting to choose spell checker languages 2023-01-24 16:58:18 +05:00
Abdullah Atta
cd9867273f desktop: add setting to toggle the spell checker 2023-01-24 16:58:18 +05:00
Abdullah Atta
a0898d9223 desktop: handle case when property is a boolean false when reading config 2023-01-24 16:58:18 +05:00
Abdullah Atta
11514051b6 desktop: refactor global.win -> globalThis.window 2023-01-24 16:58:18 +05:00
ammarahm-ed
0a1059e0a4 ci: add workflow for internal testing on android 2023-01-24 14:39:50 +05:00
ammarahm-ed
95ee494612 mobile: add release notes 2023-01-23 12:44:54 +05:00
ammarahm-ed
5c8c6f83b9 mobile: add logs when user gets logged out 2023-01-23 12:38:06 +05:00
ammarahm-ed
f1a7cd63a8 mobile: bump version to 2.4.2 2023-01-23 12:32:01 +05:00
ammarahm-ed
8b524319df mobile: disable background sync 2023-01-23 12:27:02 +05:00
Abdullah Atta
06aff69adb desktop: hide window thumbnail on Windows in privacy mode 2023-01-19 10:58:34 +05:00
Abdullah Atta
cc39fac590 desktop: use native electron notifications on desktop 2023-01-19 10:58:12 +05:00
Abdullah Atta
8385bd41ea core: do not connect sse or run sync if user is logged out 2023-01-19 10:57:27 +05:00
Abdullah Atta
77a3b771c0 desktop: auto hide menu bar (shows when Alt is pressed) 2023-01-19 10:57:27 +05:00
alihamuh
aec1d601a3 web: added change default fontstyle feature in the settings 2023-01-18 13:23:39 +05:00
ammarahm-ed
7f69c5b268 mobile: reset badge count when entering from bg to fg 2023-01-18 10:06:28 +05:00
ammarahm-ed
215a692139 misc: fix changelog 2023-01-17 18:39:47 +05:00
Abdullah Atta
f1b986cef9 desktop: show app name on notifications in windows 2023-01-17 17:39:05 +05:00
ammarahm-ed
da0f86c006 mobile: release 2.4.1 2023-01-17 17:23:53 +05:00
ammarahm-ed
0a4e84b376 mobile: add background fetch ios 2023-01-17 17:12:08 +05:00
ammarahm-ed
f1f8a35ea5 mobile: add background sync 2023-01-17 17:12:08 +05:00
Ammar Ahmed
1ffb6b3c57 mobile: fix incorrect note loaded when (#1704)
note is very large
2023-01-17 17:08:59 +05:00
Abdullah Atta
0d3504dca0 web: default telemetry state should follow DNT header 2023-01-17 16:51:29 +05:00
Abdullah Atta
0f8f53d811 web: only enable telemetry in prod 2023-01-17 16:49:00 +05:00
Abdullah Atta
85aae88300 web: fix inverse telemetry checks 2023-01-17 16:49:00 +05:00
Abdullah Atta
fc69b5ffd0 web: allow overriding DNT header 2023-01-17 16:49:00 +05:00
Abdullah Atta
a7369bf869 web: do not disable telemetry toggle if DNT=true 2023-01-17 16:49:00 +05:00
Abdullah Atta
2da32e27ff web: use new umami events api for tracking 2023-01-17 16:49:00 +05:00
Ammar Ahmed
3e71ad0b0b mobile: fix new version popup (#1702) 2023-01-17 15:14:03 +05:00
Abdullah Atta
a62ca2aada core: add checks when accessing a note using this._db.notes.note 2023-01-17 12:25:23 +05:00
Abdullah Atta
ffacb8818c web: add more tests for reminders 2023-01-17 11:45:04 +05:00
Abdullah Atta
7be867c7ca web: do not check for reminder time for recurring reminders 2023-01-17 11:45:04 +05:00
Abdullah Atta
29f3dafc4f web: add beta tag on reminders 2023-01-17 11:45:04 +05:00
Abdullah Atta
cfa35bbccd web: add toggle to disable/enable editor margins 2023-01-17 10:00:50 +05:00
Abdullah Atta
0a6cc165dc refactor: fix eslint fixable errors/warnings 2023-01-16 13:51:20 +05:00
Abdullah Atta
c5489e3c4a core: fix double refresh token requests on page refresh 2023-01-16 13:49:05 +05:00
Abdullah Atta
0ea5bd297c editor: add missing license header 2023-01-16 13:48:28 +05:00
Abdullah Atta
9116a24392 global: update license year to 2023 2023-01-16 13:48:28 +05:00
ammarahm-ed
86fc16a8d0 mobile: fix share extension ui on ios 2023-01-14 18:39:36 +05:00
ammarahm-ed
62d3ead9a8 mobile: update podfile to fix xcode 14 issue 2023-01-14 18:23:17 +05:00
ammarahm-ed
525828d6e0 mobile: hide sound settings on ios 2023-01-14 18:23:17 +05:00
Abdullah Atta
6b71509b74 web: expose descriptionText again 2023-01-14 16:00:22 +05:00
ammarahm-ed
9e382b1d04 mobile: rename changelog version 2023-01-14 13:57:45 +05:00
ammarahm-ed
744d3c2312 mobile: update pods 2023-01-14 13:47:12 +05:00
Abdullah Atta
e426d9d160 web: bump version to v2.4.0 2023-01-14 13:17:06 +05:00
ammarahm-ed
ba9b671f33 mobile: bump version to 2.4.0 2023-01-14 13:07:40 +05:00
ammarahm-ed
90cdd5f253 mobile: move custom toolbar preset to pro 2023-01-14 13:07:40 +05:00
ammarahm-ed
24b0f322c6 mobile: add new features to pro sheet 2023-01-14 13:07:40 +05:00
Abdullah Atta
a8a031a161 web: add all new features to pro dialog 2023-01-14 13:04:32 +05:00
Abdullah Atta
b66741910f web: move custom toolbar preset to pro features 2023-01-14 12:55:16 +05:00
Abdullah Atta
6ffa192f08 web: fix failing reminder tests due to malformed time format 2023-01-14 12:01:40 +05:00
ammarahm-ed
c80def5d95 mobile: do not show error toast on sync abort 2023-01-14 12:00:23 +05:00
Abdullah Atta
63cf160cea web: do not show sync abort errors to user 2023-01-14 11:52:56 +05:00
Abdullah Atta
7a40db9a36 web: remove data-test-id attr in production 2023-01-14 11:51:22 +05:00
ammarahm-ed
edd7431de1 mobile: fix failing tests 2023-01-14 11:42:30 +05:00
ammarahm-ed
eb7c0cc049 mobile: load notifee with babel loader 2023-01-14 11:42:30 +05:00
ammarahm-ed
51d130e3c3 mobile: update react-native-actions-shortcuts
patch
2023-01-14 11:42:30 +05:00
ammarahm-ed
241c914800 mobile: fix sort by options not showing 2023-01-14 11:42:30 +05:00
Abdullah Atta
f254fc5c58 web: fix all other failing tests 2023-01-14 11:22:33 +05:00
Abdullah Atta
a74b910478 web: add tests for reminders 2023-01-14 11:22:33 +05:00
ammarahm-ed
7f30fe6ff9 core: fix topic with notes not deleting 2023-01-14 10:51:25 +05:00
ammarahm-ed
c6efa3ba6c mobile: improved share menu ui 2023-01-13 19:38:00 +05:00
Abdullah Atta
020e41b3db web: extend tests timeout to 60 seconds 2023-01-13 19:25:09 +05:00
Abdullah Atta
7e9dc0e55c web: wait for route header to be visible before running tests 2023-01-13 19:02:33 +05:00
Abdullah Atta
d1072059c5 web: improve wording of notes deletion confirm dialog when deleting notebook/topic 2023-01-13 17:51:40 +05:00
ammarahm-ed
388570ca8e mobile: optionally delete notes with notebook/topic 2023-01-13 17:51:40 +05:00
Abdullah Atta
1fa0203651 web: test notes deletion when deleting notebook/topic 2023-01-13 17:51:40 +05:00
alihamuh
4dbd49d612 web: allow deleting contained notes during notebook/topic deletion 2023-01-13 17:51:40 +05:00
Muhammad Ali
59a25610e3 editor: increase y-offset of table column properties menu so its visible in all cases (#1648) 2023-01-13 17:38:36 +05:00
Ammar Ahmed
a84611d5ee mobile: fix share extension crash ios (#1651)
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2023-01-13 17:36:21 +05:00
Abdullah Atta
44827a1f1a web: auto focus password input during login 2023-01-13 17:24:07 +05:00
Abdullah Atta
66203afc92 web: fix cannot read property "type" of undefined error 2023-01-13 17:23:45 +05:00
Abdullah Atta
127c4cd537 web: improve sync status updating & display
this adds new sync status to give more visibility into the current state
of the sync:

- `disabled` - when sync has been disabled by the user
- `offline` - when user is disconnected from the Internet
2023-01-13 17:23:22 +05:00
Abdullah Atta
15ed1b498a core: use 15s timeout for remote sync 2023-01-13 17:18:44 +05:00
Abdullah Atta
d5793e9e4e core: gracefully handle case where syncing device gets disconnected 2023-01-13 15:57:33 +05:00
ammarahm-ed
e34114a3c4 mobile: improve sync status UX
1. Show offline when device is offline or internet is unreachable
2. Show "Sync failed" in side menu
until a successful sync occurs
2023-01-13 15:45:03 +05:00
Abdullah Atta
961b953f5a web: refresh app on sync merge conflict 2023-01-13 14:45:45 +05:00
Abdullah Atta
e9a5f752a4 web: only auto-reset sync status on sync complete 2023-01-13 14:40:19 +05:00
Abdullah Atta
370ba5420a web: do not auto reset sync status after 3 seconds 2023-01-13 14:34:53 +05:00
Abdullah Atta
b3c4dbb910 core: send sync aborted event on out-of-stack sync errors 2023-01-13 14:34:29 +05:00
Abdullah Atta
4ed378bc9c core: fix unintended merge conflicts 2023-01-13 14:32:13 +05:00
Abdullah Atta
39c234c698 web: save last used reminder priority 2023-01-12 22:16:25 +05:00
ammarahm-ed
00837a6790 mobile: show in app notification sounds on sdk < 26 2023-01-12 18:47:39 +05:00
ammarahm-ed
f3f735392b mobile: add notification sound settings 2023-01-12 17:59:06 +05:00
ammarahm-ed
b7dc9646f6 mobile: save last set notification mode 2023-01-12 15:52:33 +05:00
ammarahm-ed
30a5882b9c mobile: use notifee without gms libs 2023-01-12 15:52:33 +05:00
Muhammad Ali
7449181d86 editor: close list selection popup after selecting a list (#1636)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-12 15:52:19 +05:00
Abdullah Atta
68196b2d99 web: use fallback testId for locationFormSubmitButton 2023-01-12 14:40:10 +05:00
Abdullah Atta
53116a6b2f web: improve sync settings wording 2023-01-12 12:59:38 +05:00
Abdullah Atta
31479943bb web: add toggle to enable/disable realtime sync 2023-01-12 12:58:44 +05:00
ammarahm-ed
7b2de009a7 mobile: add disable realtime sync option in settings 2023-01-12 12:58:44 +05:00
Abdullah Atta
3746ebd0be web: remove navigation hash on dialog close 2023-01-12 12:38:20 +05:00
Abdullah Atta
2db03ed2d7 web: simplify references shown in note properties 2023-01-12 12:38:20 +05:00
Abdullah Atta
0f5786d7d7 web: remove "Notebook" & "Topic" indication from notebook & topic 2023-01-12 12:38:20 +05:00
Abdullah Atta
2097e5777b web: highlight reminder time if it'll activate today 2023-01-12 12:38:20 +05:00
Abdullah Atta
1c0b8e9115 web: show referenced notes in reminder preview 2023-01-12 12:38:20 +05:00
Abdullah Atta
117303c471 web: control item compactness from list container 2023-01-12 12:38:20 +05:00
Abdullah Atta
b536e62533 web: add option to attach reminder to a note 2023-01-12 12:38:19 +05:00
Abdullah Atta
9353b7b39d web: show attached reminder on note 2023-01-12 12:38:19 +05:00
Abdullah Atta
1799404c01 core: add a way to check if reminder will activate today 2023-01-12 12:38:19 +05:00
ammarahm-ed
144e992eca mobile: remove notebook/topic tag
on notebooks & topics
2023-01-12 12:37:33 +05:00
ammarahm-ed
373fa02280 mobile: subscribe syncCheckStatus events from core 2023-01-12 12:11:01 +05:00
ammarahm-ed
1c66266f2d mobile: add beta tag on Reminders screen 2023-01-12 12:09:44 +05:00
ammarahm-ed
ce3e1cdd36 mobile: add beta tag to reminder in sidemenu 2023-01-12 10:35:28 +05:00
ammarahm-ed
4ee9593bac core: fix upcoming reminder time for "once"
reminders
2023-01-12 09:55:17 +05:00
ammarahm-ed
5409ac666e mobile: improve reminder time design 2023-01-11 17:15:07 +05:00
Abdullah Atta
18da6cfc43 core: add short format for showing reminder time 2023-01-11 16:40:08 +05:00
Abdullah Atta
c75f750215 web: update tests 2023-01-11 14:37:13 +05:00
Abdullah Atta
e2f2f0866d web: fix checkout tests
Paddle changed their submit button test id
2023-01-11 14:12:17 +05:00
Abdullah Atta
6583ea6a47 web: improve wording of the privacy mode setting 2023-01-11 13:11:55 +05:00
Muhammad Ali
25ae32028b editor: do not lift first list item on backspace (#1630)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-11 13:10:20 +05:00
Abdullah Atta
e08a6db184 web: fix unexpected token error 2023-01-11 12:44:18 +05:00
Muhammad Ali
95e1daf7f7 desktop: add privacy mode for desktop on win & mac (#1620)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-11 12:42:54 +05:00
Abdullah Atta
165862db06 editor: make build scripts compatible with windows 2023-01-11 12:31:33 +05:00
ammarahm-ed
b7bce0d8cd ci: add metadata for fdroid 2023-01-11 12:27:43 +05:00
Abdullah Atta
4daca499d6 editor: remove prosemirror-utils lib as it's incompatible with windows 2023-01-11 12:11:23 +05:00
Abdullah Atta
21bd6ffbd9 web: replace localforage-getitems git package with @notesnook/localforage-getitems 2023-01-11 10:20:44 +05:00
ammarahm-ed
80f5ecb276 mobile: fix notification triggers on ios 2023-01-10 16:44:49 +05:00
ammarahm-ed
39cc58480c mobile: improve error handle in reminder sheet 2023-01-10 16:44:49 +05:00
ammarahm-ed
3be7a53668 mobile: always close sheet if closed via component 2023-01-10 16:44:49 +05:00
ammarahm-ed
54d65beae3 mobile: fix ios monthly reminder patch 2023-01-10 16:44:49 +05:00
Muhammad Ali
8e6bbb9227 web: do not ignore line breaks when counting words (#1625)
Signed-off-by: Abdullah Atta <thecodrr@protonmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-10 16:06:20 +05:00
Abdullah Atta
a1440fd64c ci: fix web tests (#1624) 2023-01-10 16:01:55 +05:00
Muhammad Ali
b0417387b4 web: fix issue where searched topics cannot be opened (#1593)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-10 15:04:31 +05:00
Abdullah Atta
cc3618cb02 web: add realtime progress during account recovery 2023-01-10 14:37:55 +05:00
Abdullah Atta
9f832ce25d core: re-enable legacy login flow 2023-01-09 18:58:30 +05:00
ammarahm-ed
343da60428 mobile: fix daily reminder unset if date in past 2023-01-09 16:33:57 +05:00
ammarahm-ed
5f3c89a93a mobile: add change email settings 2023-01-09 16:20:26 +05:00
Abdullah Atta
9fb24748c9 web: improve account email changing UX 2023-01-09 16:20:26 +05:00
Abdullah Atta
6ff2f5c423 web: add dialog to help change account email 2023-01-09 16:20:26 +05:00
Abdullah Atta
b439571e17 core: add support for changing account email 2023-01-09 16:20:26 +05:00
ammarahm-ed
1b471a2fda mobile: add cors proxy settings 2023-01-09 15:06:20 +05:00
Abdullah Atta
2ce30b71c7 web: add setting to specify custom CORS proxy 2023-01-09 15:06:20 +05:00
Abdullah Atta
91ae351129 editor: add support for bypassing cors when downloading images 2023-01-09 15:06:20 +05:00
ammarahm-ed
2966962016 mobile: unpin permanent reminders 2023-01-09 13:19:15 +05:00
ammarahm-ed
3c38c61437 mobile: hide note references on reminder 2023-01-09 13:19:15 +05:00
ammarahm-ed
8edd1af18c mobile: hide reminder on note if disabled 2023-01-09 13:19:15 +05:00
ammarahm-ed
4b65c546f2 mobile: add wheel date/time picker 2023-01-09 13:19:15 +05:00
ammarahm-ed
defc640293 mobile: add date picker styles 2023-01-09 13:19:15 +05:00
Abdullah Atta
7e3d889632 core: fix reminders tests 2023-01-09 13:07:17 +05:00
Abdullah Atta
fa24565e25 web: update @notesnook-importer/core to v1.5.2 2023-01-09 12:49:18 +05:00
Abdullah Atta
966130dc52 web: use mimetype when saving base64 data attachments
This allows the caching layer to correctly cache images.
2023-01-07 22:24:40 +05:00
Abdullah Atta
6ba3732327 core: send mimetype when saving base64 attachment 2023-01-07 22:24:40 +05:00
ammarahm-ed
c0bc786669 core: format permanent reminder 2023-01-07 16:56:36 +05:00
ammarahm-ed
646dbfef6e mobile: fix state not updated on reminder change 2023-01-07 16:06:15 +05:00
ammarahm-ed
3ea0faa7df mobile: check date only for one-time reminders 2023-01-07 16:06:15 +05:00
ammarahm-ed
e9fbf17b40 mobile: refactor delete function 2023-01-07 16:06:15 +05:00
ammarahm-ed
5c7e776dce mobile: setup reminders on init 2023-01-07 16:06:15 +05:00
ammarahm-ed
0db0070aeb core: cleanup references after deleting reminder 2023-01-07 16:06:15 +05:00
ammarahm-ed
774cc6f953 mobile: fix recurring reminders 2023-01-07 16:06:15 +05:00
Muhammad Ali
abe1598910 editor: fix issue where right clicking on a link opened it (#1571)
* editor: link right click opens link bug solved

* editor: added headers

* editor: create patch for @tiptap/extension-link

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-07 13:17:56 +05:00
Abdullah Atta
4fe2f91175 core: throw error if refresh token is not found 2023-01-07 12:48:34 +05:00
Abdullah Atta
eb526063c3 web: update package-lock.json & add otplib 2023-01-07 12:30:00 +05:00
Muhammad Ali
08e5c285e0 web: removed isNarrow state from app.js (#1596)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-07 10:34:31 +05:00
Ammar Ahmed
05cd7e5002 core: add proper styling to pdf & html exports (#1579)
* mobile: fix exported pdf styling

* core: move html template styles to core

* core: inline prism-dracula styles

Signed-off-by: Abdullah Atta <abdullahatta@streetwriters.co>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-06 17:58:33 +05:00
Abdullah Atta
a0ad4403cb web: fix checkout tests 2023-01-06 17:44:07 +05:00
Abdullah Atta
d0ddaeba73 core: don't save empty token response 2023-01-06 17:44:07 +05:00
Abdullah Atta
06ad68975f core: fix Cannot read properties of undefined (reading 'slice') 2023-01-06 17:44:07 +05:00
Abdullah Atta
c37aec07bb global: update package lock files 2023-01-06 17:44:07 +05:00
Abdullah Atta
1fc0fd5694 web: use correct env variables for login tests 2023-01-06 17:44:07 +05:00
Abdullah Atta
9aad63a623 core: use correct env variables for login tests 2023-01-06 17:44:07 +05:00
Abdullah Atta
22871d8baf core: use the new login flow in all tests 2023-01-06 17:44:07 +05:00
ammarahm-ed
65cae7888e mobile: reset login state on token expiry 2023-01-06 17:44:07 +05:00
Abdullah Atta
6718be881b web: fix session expiry login flow 2023-01-06 17:44:07 +05:00
Abdullah Atta
d10c1eb8b7 web: handle invalid_grant error during login 2023-01-06 17:44:07 +05:00
Abdullah Atta
3ef8e1bab1 web: remove 2fa code limits 2023-01-06 17:44:07 +05:00
ammarahm-ed
ec699e8ef4 mobile: add session expired login flow 2023-01-06 17:44:07 +05:00
Abdullah Atta
206b72a5f8 web: click on submit button on password entry in login test 2023-01-06 17:44:07 +05:00
ammarahm-ed
dd2a27337f mobile: update auth tests 2023-01-06 17:44:07 +05:00
Abdullah Atta
e43ee80fdb web: update login tests 2023-01-06 17:44:07 +05:00
Abdullah Atta
04fe4a7217 theme: improve input focus border on non-chrome browsers
We were using box-shadow previously to draw a fake border. While this worked
on Chrome-based browsers, it failed on Firefox & WebKit. This change uses
the outline property.
2023-01-06 17:44:07 +05:00
Abdullah Atta
a46857974c web: use the new response-based login flow 2023-01-06 17:44:07 +05:00
ammarahm-ed
4a826cfaea mobile: new auth flow 2023-01-06 17:44:07 +05:00
Abdullah Atta
8c87d00102 core: use access_token from response instead of via errors
This is more in line with how auth works:

1. You send a request with credentials
2. The server responds with an access_token

The only difference in this approach is that the client
cannot decide which scopes it wants.
2023-01-06 17:44:07 +05:00
Abdullah Atta
3fd1898422 web: migrate to new 3-step login flow 2023-01-06 17:44:07 +05:00
Abdullah Atta
12d1b3fcc9 core: impl new 3-step authentication flow (& deprecate old one) 2023-01-06 17:44:07 +05:00
Muhammad Ali
e3f35ac567 web: show pointer cursor on properties close button (#1580) 2023-01-05 22:11:21 +05:00
Muhammad Ali
47feaeeac1 editor: fix scroll into view for selected search result (#1578) 2023-01-05 22:10:41 +05:00
ammarahm-ed
377bd6e510 mobile: update settings 2023-01-05 22:01:01 +05:00
Abdullah Atta
c150006ba2 web: change reminder notification setting text 2023-01-05 22:01:01 +05:00
Abdullah Atta
9b747d1d2b web: add setting to control reminder notifications 2023-01-05 22:01:01 +05:00
Abdullah Atta
fbfcfe1bcb web: reset snoozeUntil & disabled state on edit 2023-01-05 22:01:01 +05:00
Abdullah Atta
360b94353a core: fix upcoming reminder time if next reminder is on the same exact time as current time 2023-01-05 22:01:01 +05:00
ammarahm-ed
19227cf51b mobile: remove snooze setting icon 2023-01-05 22:01:01 +05:00
ammarahm-ed
c6297227bf mobile: patch notifee to support monthly
recurring reminders.
2023-01-05 22:01:01 +05:00
ammarahm-ed
99d3b7300c mobile: fix typo 2023-01-05 22:01:01 +05:00
ammarahm-ed
b77254a045 mobile: configurable snooze time 2023-01-05 22:01:01 +05:00
ammarahm-ed
1ef4dcb52c mobile: update store on reminder change from notification 2023-01-05 22:01:01 +05:00
ammarahm-ed
e4ba2acd99 mobile: handle disabled reminders 2023-01-05 22:01:01 +05:00
ammarahm-ed
fcc39034c4 mobile: make recurring reminders pro 2023-01-05 22:01:01 +05:00
Abdullah Atta
352639da24 web: make disabled status of reminders more apparent 2023-01-05 22:01:01 +05:00
Abdullah Atta
b65a372192 web: hide sort options button for reminders 2023-01-05 22:01:01 +05:00
Abdullah Atta
631142f852 core: group reminders by active/inactive 2023-01-05 22:01:01 +05:00
Abdullah Atta
19f0ee97f2 web: add repeating reminders to pro features 2023-01-05 22:01:01 +05:00
ammarahm-ed
c8601c88a7 mobile: add reminder actions 2023-01-05 22:01:01 +05:00
ammarahm-ed
a8f0724b0f mobile: show snooze time 2023-01-05 22:01:01 +05:00
ammarahm-ed
6a7d11c331 core: format snooze time 2023-01-05 22:01:01 +05:00
ammarahm-ed
e2263701d3 mobile: disable console logs in logger 2023-01-05 22:01:01 +05:00
ammarahm-ed
d88fe47c55 mobile: show error if title empty/date in past 2023-01-05 22:01:01 +05:00
ammarahm-ed
f78d0cda1d mobile: update relations on sync complete 2023-01-05 22:01:01 +05:00
ammarahm-ed
7bde09c5d7 core: allow disabling console logs in logger 2023-01-05 22:01:01 +05:00
ammarahm-ed
0fe0a4dc0b core: fix upcoming reminder sorting 2023-01-05 22:01:01 +05:00
Abdullah Atta
6e1db2ea33 web: prevent setting reminder time before current time 2023-01-05 22:01:01 +05:00
Abdullah Atta
d0991ae96b web: fix check for disabling save button 2023-01-05 22:01:01 +05:00
Abdullah Atta
40e28f3ed4 web: don't show "moved to trash" when deleting reminders 2023-01-05 22:01:01 +05:00
Abdullah Atta
87ba9ae027 core: fix exists is readonly error 2023-01-05 22:01:01 +05:00
Abdullah Atta
8c8be28363 core: fix shortcut is not defined 2023-01-05 22:01:01 +05:00
ammarahm-ed
d4ec67ee21 mobile: fix state update 2023-01-05 22:01:01 +05:00
ammarahm-ed
26ec8551f9 mobile: add disable/snooze function 2023-01-05 22:01:01 +05:00
Abdullah Atta
484bc02a28 web: change reminder edit icon 2023-01-05 22:01:01 +05:00
Abdullah Atta
07ebbf622d core: add mockdate package 2023-01-05 22:01:01 +05:00
Abdullah Atta
2467b57a2e web: preview reminders on notification click 2023-01-05 22:01:01 +05:00
Abdullah Atta
7375ce55b9 web: add/edit reminders 2023-01-05 22:01:01 +05:00
Abdullah Atta
de9566dc75 web: add reminders view 2023-01-05 22:01:01 +05:00
Abdullah Atta
b9a833cc8d web: migrate icon-tag component to typescript 2023-01-05 22:01:01 +05:00
Abdullah Atta
febf742ea2 core: show correct upcoming/past tag for reminders on today 2023-01-05 22:01:01 +05:00
Abdullah Atta
b7ebbfda1d core: impl reminder time formatting 2023-01-05 22:01:01 +05:00
ammarahm-ed
6bd67d2599 setup: update project 2023-01-05 22:01:01 +05:00
ammarahm-ed
32467c36af mobile: minor improvements 2023-01-05 22:01:01 +05:00
ammarahm-ed
7ac8b478ed core: make resolve function sync 2023-01-05 22:01:01 +05:00
ammarahm-ed
0398e99cdf core: fix note relations not returned 2023-01-05 22:01:01 +05:00
ammarahm-ed
79be55ab44 mobile: add reminders on a note 2023-01-05 22:01:01 +05:00
ammarahm-ed
23fbf5ae15 mobile: fix notifications not set 2023-01-05 22:01:01 +05:00
ammarahm-ed
225a671cab core: fix empty array returned from relation query 2023-01-05 22:01:01 +05:00
ammarahm-ed
8e53e61db6 mobile: make permanent reminders local only 2023-01-05 22:01:01 +05:00
ammarahm-ed
99ac6ec58f core: add localOnly property to reminders 2023-01-05 22:01:01 +05:00
ammarahm-ed
08ad464310 mobile: add disable reminder notifications button
in settings.
2023-01-05 22:01:01 +05:00
ammarahm-ed
28a115ab04 mobile: add setupReminders function 2023-01-05 22:01:01 +05:00
ammarahm-ed
a2c875acca mobile: action strip functions for reminders 2023-01-05 22:01:01 +05:00
ammarahm-ed
c06f3ed351 mobile: added reminder list item 2023-01-05 22:01:01 +05:00
ammarahm-ed
26cbf6a522 mobile: add timeago dep 2023-01-05 22:01:01 +05:00
ammarahm-ed
54f9e27ef3 mobile: add reminder time utils 2023-01-05 22:01:01 +05:00
Abdullah Atta
38a34857db core: generate deterministic ids for relations to avoid duplicates 2023-01-05 22:01:01 +05:00
ammarahm-ed
3702bb0186 mobile: add Reminders screen to nav 2023-01-05 22:01:01 +05:00
ammarahm-ed
0dec8b5af4 core: add reminders to GroupKeys 2023-01-05 22:01:01 +05:00
ammarahm-ed
946fd3fc1d core: add reminders lookup 2023-01-05 22:01:01 +05:00
Abdullah Atta
baa06ebd6e core: add collection to hold all item<->item references 2023-01-05 22:01:01 +05:00
Abdullah Atta
a8f1fbf6a1 core: add collection for reminders 2023-01-05 22:01:01 +05:00
ammarahm-ed
657fe05464 mobile: add reminder notes 2023-01-05 22:01:01 +05:00
ammarahm-ed
e7d0c956bc mobile: remove react-native-push-notifications dep 2023-01-05 22:01:01 +05:00
ammarahm-ed
30cad32e26 mobile: add reminder sheet 2023-01-05 22:01:01 +05:00
Ammar Ahmed
ab9538c81e editor: task list ui improvements (#1570) 2023-01-05 14:00:56 +05:00
Muhammad Ali
fc634f15bb editor: add download button on images (#1563)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2023-01-04 15:27:10 +05:00
Abdullah Atta
e07a2c4984 chore: add Muhammad Ali to AUTHORS list
Signed-off-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-04 15:26:18 +05:00
Abdullah Atta
4374af79bc ci: increase tests shards to 4 2023-01-04 12:43:28 +05:00
Abdullah Atta
5a540362c0 web: fix backup tests 2023-01-04 12:42:52 +05:00
Muhammad Ali
2beccd6918 web: add tests for backups (#1542)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-04 12:34:15 +05:00
Muhammad Ali
d4a3b53c1b editor: remove collapsed property from task list (#1561)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2023-01-04 11:50:40 +05:00
Ammar Ahmed
947b2099a1 mobile: fix note history scrolling (#1553) 2023-01-03 22:13:43 +05:00
Ammar Ahmed
c0212c64bc mobile: fix crash when checking no of notes (#1554) 2023-01-03 22:13:29 +05:00
Ammar Ahmed
d291a536a6 mobile: fix keep awake (#1557) 2023-01-03 22:13:11 +05:00
Abdullah Atta
cf918ba459 web: increase sort tests timeout to 2 minutes 2023-01-03 22:08:40 +05:00
Abdullah Atta
c3aa2dd62b web: move topic tests from notebook test suite 2023-01-03 22:07:14 +05:00
Abdullah Atta
5c8cf1beb5 editor: allow multiple popups at one time on mobile 2023-01-03 22:05:08 +05:00
Ammar Ahmed
2f92bf0de8 mobile: fix typo
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2023-01-03 21:46:11 +05:00
Abdullah Atta
088235a46d web: add support for disabling sync & auto sync 2023-01-03 21:46:11 +05:00
ammarahm-ed
2845cb19d6 mobile: add sync controls 2023-01-03 21:46:11 +05:00
Abdullah Atta
db4126fe16 web: silently ignore non-applicable sort options in test 2023-01-03 21:37:19 +05:00
Muhammad Ali
4eed06c91f web: add ctrl+click selection tests (#1510)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-03 21:16:25 +05:00
Muhammad Ali
00da012b3f web: add sorting tests for notes, notebooks, tags & topics (#1490)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-03 15:07:11 +05:00
Abdullah Atta
db2041a15d editor: fix Unexpected token error 2023-01-03 10:15:04 +05:00
Abdullah Atta
5971253728 web: show proper error on attachment upload failure 2023-01-03 10:13:33 +05:00
Muhammad Ali
19a5e78495 editor: hide clear completed tasks button in readonly editor (#1498)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-01-03 10:10:31 +05:00
Abdullah Atta
919e46aea8 web: migrate loading dialog to typescript 2022-12-28 10:39:40 +05:00
Abdullah Atta
7b7fd62047 clipper(core): make fetch options optional everywhere 2022-12-06 12:10:56 +05:00
Abdullah Atta
e71447c19d clipper(web): add settings to configure cors proxy 2022-12-06 12:06:39 +05:00
Abdullah Atta
c28ef94cf1 web: run all tests 2022-12-06 11:03:13 +05:00
Abdullah Atta
4ac9bb2d9b web: bump version to v2.3.0 2022-12-06 10:55:59 +05:00
ammarahm-ed
433749d3fa mobile: bump version to 2.3.0 2022-12-06 09:59:14 +05:00
ammarahm-ed
92b1ebe744 mobile: bump react-native-sodium 2022-12-06 09:15:48 +05:00
ammarahm-ed
3be4705be3 mobile: update Podfile 2022-12-05 22:16:12 +05:00
ammarahm-ed
f83d6c2d37 mobile: fix device mode selection 2022-12-05 22:16:12 +05:00
ammarahm-ed
2c8d6d115c mobile: use content from merged item
to update editor
2022-12-05 22:16:12 +05:00
Abdullah Atta
29b9c897c4 web: improve real-time sync reliability
This takes care of edge cases:

1. Ignores changes if user is previewing history session
2. Ignores changes if current changes are newer than synced changes
2022-12-05 21:17:13 +05:00
ammarahm-ed
85ada72054 mobile: fix editor opens on app launch always 2022-12-05 17:55:53 +05:00
ammarahm-ed
64bf627462 mobile: use editor state to check whether
content update is needed on item sync
2022-12-05 17:55:53 +05:00
Abdullah Atta
eaace54154 mobile: remove react-native-sodium patch 2022-12-05 17:01:56 +05:00
Abdullah Atta
003178ba20 web: fix all tests 2022-12-05 16:52:44 +05:00
Abdullah Atta
56837208d1 web: downloadImages -> downloadMedia 2022-12-05 15:37:08 +05:00
Abdullah Atta
f6493692e4 mobile: update package-lock.json 2022-12-05 15:34:24 +05:00
Abdullah Atta
6269a8415b Merge branch 'web-extension' 2022-12-05 15:23:03 +05:00
ammarahm-ed
3d065f2278 mobile: bump react-native-sodium version 2022-12-05 15:20:54 +05:00
ammarahm-ed
64e8f8b9a9 mobile: fix webclip failed to load 2022-12-05 15:20:54 +05:00
ammarahm-ed
9af102451d editor: add webclipSettings to tool definitons 2022-12-05 15:20:54 +05:00
ammarahm-ed
31d0164ba8 mobile: load webclips in editor on demand 2022-12-05 15:20:54 +05:00
Abdullah Atta
1a40c8ec77 clipper(core): change cors host to cors.notesnook.com 2022-12-05 15:20:54 +05:00
Abdullah Atta
c1674b6f05 clipper(web): save height/width with clipped data 2022-12-05 15:20:54 +05:00
Abdullah Atta
c5faf62398 web: lazily load web clips just like images 2022-12-05 15:20:54 +05:00
ammarahm-ed
58a17f620b mobile: add readAttachment function 2022-12-05 15:20:54 +05:00
Abdullah Atta
47dcbba522 clipper(web): make ready for publishing 2022-12-05 15:20:54 +05:00
Abdullah Atta
7cd6a6e9ee clipper(web): fix all eslint warnings 2022-12-05 15:20:54 +05:00
Abdullah Atta
e17bd79004 editor: decrease embed extension priority 2022-12-05 15:20:54 +05:00
Abdullah Atta
2fdbc9cb1d web: connect with web clipper & save web clips 2022-12-05 15:20:54 +05:00
Abdullah Atta
f7cc2d61b6 clipper(web): add web clipper browser extension 2022-12-05 15:17:38 +05:00
Abdullah Atta
ad91da9f2d clipper: minor refactors and cleanup 2022-12-05 15:17:38 +05:00
Abdullah Atta
3037cf8cfb web: read & load web clip from attachments 2022-12-05 15:17:38 +05:00
Abdullah Atta
aa0bf3b3dc editor: add extension for embedding web clips 2022-12-05 15:17:38 +05:00
Abdullah Atta
96a3d8edac clipper: implement web clipper core library 2022-12-05 15:16:51 +05:00
Abdullah Atta
611c229ece editor: use noto serif as a serif font 2022-12-05 15:13:35 +05:00
Abdullah Atta
4b6880303c web: remove legacy fonts (svg, eot etc.) 2022-12-05 15:13:35 +05:00
alihamuh
44a081fa54 web: replaced open-sans fonts for glyphs and diacritics
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-12-05 15:13:35 +05:00
Ammar Ahmed
7bf01535c8 mobile: fix pdf export on android (#1445) 2022-12-05 14:49:11 +05:00
Ammar Ahmed
b7b6f604eb mobile: hide biometrics unavailable toast (#1425) 2022-12-05 14:48:57 +05:00
Ammar Ahmed
6b601afe0f mobile: fix multi window mode on iPads (#1424) 2022-12-05 14:48:42 +05:00
Abdullah Atta
b65761f9da config: enable bracket spacing in prettier config 2022-12-05 12:25:47 +05:00
Muhammad Ali
fcfe9ff23b editor: add button to delete a task item in a task list (#1423)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-12-05 12:22:58 +05:00
Muhammad Ali
a19fa2212a web: allow deselecting items using ctrl+click (#1433)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-12-05 11:08:32 +05:00
Ammar Ahmed
5445ee0335 core: handle crash when sorting if item doesn't have a title (#1447) 2022-12-05 10:54:55 +05:00
Muhammad Ali
d2f65c435d editor: do not add line break at the start of copied text (#1443)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-12-05 10:52:54 +05:00
Muhammad Ali
bbe21eb7db editor: fix clear completed tasks button hidden by progress bar (#1444)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-12-05 10:42:13 +05:00
Muhammad Ali
d39426a57a editor: fix persistent editor dropdown toolbar when changing notes (#1413)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-12-05 10:40:13 +05:00
Muhammad Ali
f43715cd24 web: fix overlapping text on default home page buttons in settings (#1406)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-12-05 10:37:47 +05:00
Muhammad Ali
503b5922e9 web: use custom bottom scrollbar in mobile mode (#1389)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-12-05 10:31:57 +05:00
Abdullah Atta
58319c27f5 misc: install patch-package package 2022-12-02 11:25:59 +05:00
Abdullah Atta
f1a2afd9d6 core: do not sync vault key alone
this caused a sync loop because vault key is always synced regardless of
whether it has changed or not.
2022-12-02 11:24:56 +05:00
Abdullah Atta
8bc58b7869 editor: enable embed specific tools on mobile 2022-11-28 15:25:28 +05:00
ammarahm-ed
dd0b0f4243 mobile: update ios provisioning profiles 2022-11-28 09:38:02 +05:00
Abdullah Atta
1f61742786 core: fix cannot read properties of undefined (reading '_note') 2022-11-24 16:12:57 +05:00
ammarahm-ed
95dd84695b mobile: fix patches 2022-11-23 19:31:09 +05:00
Abdullah Atta
1500d50ba9 web: cleanup imports 2022-11-23 19:16:42 +05:00
Abdullah Atta
c206377198 web: show mobile UI for tablet users 2022-11-23 19:16:29 +05:00
ammarahm-ed
7b5923ebc5 mobile: use getItemType in list 2022-11-23 18:47:10 +05:00
Abdullah Atta
064b6fb9dc web: fix regression with duplicate notes being created when typing fast 2022-11-23 18:45:21 +05:00
ammarahm-ed
b101f42ff0 mobile: fix android iap 2022-11-23 18:34:46 +05:00
ammarahm-ed
1b13e055d1 mobile: fix Config checks 2022-11-23 18:34:46 +05:00
Abdullah Atta
3c378809d0 web: bump version to 2.2.4 2022-11-23 17:23:03 +05:00
Abdullah Atta
c5fcc7e962 web: make real-time sync test more reliable 2022-11-23 16:22:04 +05:00
Abdullah Atta
77c9db0faa web: only check for encryption-key length 2022-11-23 16:22:04 +05:00
Abdullah Atta
ea07672a2d web: update test snapshots 2022-11-23 16:22:04 +05:00
Abdullah Atta
222fc00bd7 core: update export templates 2022-11-23 16:22:04 +05:00
Abdullah Atta
ae8c220119 web: add patch to support cjs modules 2022-11-23 16:22:04 +05:00
Abdullah Atta
0e96769e93 web: get rid of webpack deprecation notice due to usage of [hash] 2022-11-23 16:22:04 +05:00
ammarahm-ed
77c0f63dfd mobile: release notes 2022-11-23 16:00:01 +05:00
ammarahm-ed
3f4021ea44 mobile: hide dateModified for sort sheet
in screens other than
tags.
2022-11-23 15:59:32 +05:00
ammarahm-ed
c52d5ad176 mobile: fix inversed check resulting in requests
to google servers on app launch
in github release.
2022-11-23 15:38:53 +05:00
ammarahm-ed
fbb8652946 mobile: fix file viewer not opened 2022-11-23 15:37:56 +05:00
ammarahm-ed
4f8c2fa37a mobile: bump version to 2.2.6 2022-11-23 15:13:01 +05:00
Ammar Ahmed
ea405393fd mobile: fix orientation & app screen size measurement (#1382) 2022-11-23 15:10:53 +05:00
Abdullah Atta
5e6caa7273 core: use upstream htmlparser2 instead of in-house
This is mostly because I am not 100% certain about how stable our own
optimized version is. While it does perform a lot better, there is
significant risk that things might break in production. To avoid
that, I am replacing it with the upstream version which is much more
heavily tested.
2022-11-23 14:58:34 +05:00
Abdullah Atta
b1f5ffc2ec core: add dateModified comparator 2022-11-23 12:33:35 +05:00
Abdullah Atta
8af8b69cbf web: add streaming support for importing huge zips 2022-11-23 12:19:32 +05:00
Abdullah Atta
0c0dff3b28 core: fix "Cannot send data if connection is not in "Connected" state" 2022-11-23 12:19:12 +05:00
Abdullah Atta
3ab6c4646c core: use mutex to establish only 1 connection at a time 2022-11-23 12:19:12 +05:00
ammarahm-ed
98dfe30099 mobile: do not request setting backup directory when
moving app from background to foreground.
2022-11-23 11:12:26 +05:00
ammarahm-ed
b0438bf71e mobile: use flashlist 2022-11-23 11:12:26 +05:00
ammarahm-ed
2130c8a806 mobile: fix file viewer not working in android 11+ 2022-11-23 11:12:26 +05:00
ammarahm-ed
7c626aca18 mobile: download attachments in realtime sync 2022-11-23 10:32:33 +05:00
Abdullah Atta
30662f147a web: download attachments on real-time sync 2022-11-23 10:32:33 +05:00
Muhammad Ali
846adea92e web: multiple notes selected when right clicking on 1 note (#1342)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-11-23 10:31:52 +05:00
Muhammad Ali
f5a7beef17 editor: add button to clear completed tasks (#1336)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-11-23 10:24:45 +05:00
Muhammad Ali
82b584b3d1 core: include tags in exported note (#1345)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-11-23 09:19:07 +05:00
Muhammad Ali
68c79bcdd5 web: disabled toolbar items are not removed from the toolbar (#1357)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-11-23 09:13:39 +05:00
Ammar Ahmed
fe4a16f182 mobile: iap upgrade (#1361)
* mobile: upgrade iap to v7

* mobile: update build.gradle
2022-11-22 11:46:50 +05:00
Muhammad Ali
a70961b662 core: respect numbers when sorting items (#1337)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-11-17 19:38:05 +05:00
Abdullah Atta
d14be59204 Merge pull request #1314 from streetwriters/new-html-parser
Improve HTML parsing performance
2022-11-16 11:21:59 +05:00
Abdullah Atta
c3965a3b0e Merge pull request #1312 from streetwriters/custom-colors-in-pallete
Add support for saving custom colors in editor color picker
2022-11-12 16:39:00 +05:00
Abdullah Atta
808270d2ef editor: saving a color now updates the color list 2022-11-12 16:38:19 +05:00
alihamuh
a8a8080835 editor: implement saving custom colors in color picker
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-11-12 16:38:02 +05:00
Muhammad Ali
3906de0715 desktop: always show backup storage location button (#1321)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-11-11 19:52:18 +05:00
ammarahm-ed
0691e71227 mobile: add react-native-gzip dep 2022-11-11 19:08:04 +05:00
Abdullah Atta
d372c2daf9 core: fix do not eagerly parse HTML 2022-11-11 18:42:23 +05:00
Abdullah Atta
b11387b385 web: install @aws-sdk/util-base64-browser for base64 encode/decode 2022-11-11 17:05:57 +05:00
Abdullah Atta
8f5ebe315e core: use client given compression module 2022-11-11 17:01:01 +05:00
Abdullah Atta
8ae4ad6126 web: implement native compression 2022-11-11 16:57:55 +05:00
Abdullah Atta
1823a4f4ba core: fix convert is not defined error 2022-11-11 16:57:05 +05:00
Abdullah Atta
fa6e88a0b0 Merge branch 'master' into new-html-parser 2022-11-10 17:02:32 +05:00
Abdullah Atta
eacbbe2ad8 core: use html-to-text library for better text conversion 2022-11-10 17:00:11 +05:00
ammarahm-ed
b2b64a172f mobile: impl preview for trashed notes 2022-11-10 15:44:50 +05:00
Abdullah Atta
84a687d69d web: only open trash item if it is a note 2022-11-10 15:44:50 +05:00
Abdullah Atta
860e97c97d web: hide toolbar buttons when viewing trash notes 2022-11-10 15:44:50 +05:00
alihamuh
4c6c42c794 web: impl preview for trashed notes
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

web: done suggested changes
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

Update apps/web/src/stores/editor-store.js

Signed-off-by: Abdullah Atta <thecodrr@protonmail.com>

Update apps/web/src/stores/editor-store.js

Signed-off-by: Abdullah Atta <thecodrr@protonmail.com>
2022-11-10 15:44:50 +05:00
Abdullah Atta
205373dca3 core: use htmlparser2 for html rewriting
This replaces DOMParser with htmlparser2 which is much, much faster.
How much faster? 80%. This new implementation can parse at 50mb/s
which is insane! The old one could only do 5-10mb/s

We still haven't gotten rid of the DOMParser though since HTML-to-MD
conversion still needs it. This will be done soon though by using `dr-sax`.

This uses a custom implementation of htmlparser2 instead of the default
one which is 50% faster.
2022-11-10 15:16:13 +05:00
Abdullah Atta
349cd27650 core: refactor collector to do everything in 1 step
This will speed up the sync slightly since we aren't iterating over all
items twice. It also simplifies the code a bit.
2022-11-10 14:38:32 +05:00
ammarahm-ed
fedfab094c mobile: bump react-native to 0.69.7 2022-11-10 13:15:59 +05:00
Muhammad Ali
f62c045350 core: fix v5.8 backups not restoring due to changed item ids (#1303)
* core: back restore repaired due to version change
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-11-09 12:26:33 +05:00
Muhammad Ali
a973a5cdf0 editor: fix incorrect paragraph formatting in copied text (#1299)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-11-08 16:57:48 +05:00
Abdullah Atta
545c78361b editor: set proper checks when scrolling result into view 2022-11-07 13:05:06 +05:00
Muhammad Ali
d7a80c631b editor: jump to search result using arrow keys not working (#1289)
* editor: search occurence scroll into view corrected
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* Update packages/editor/src/extensions/search-replace/search-replace.ts

Signed-off-by: Abdullah Atta <thecodrr@protonmail.com>

Signed-off-by: Abdullah Atta <thecodrr@protonmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2022-11-05 15:50:42 +05:00
Muhammad Ali
a650b8c2d9 editor: force update syntax highlights on 1st render (#1265)
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2022-11-01 14:45:27 +05:00
ammarahm-ed
59e8de0f29 mobile: update release notes 2022-10-26 16:08:25 +05:00
ammarahm-ed
0d58a9288d mobile: show auto backup message after delay 2022-10-26 16:05:36 +05:00
ammarahm-ed
a6b8db0466 mobile: bump version to 2.2.5 2022-10-26 15:37:24 +05:00
Abdullah Atta
b7d51a6144 web: bump version to v2.2.3 2022-10-26 15:31:29 +05:00
Abdullah Atta
62b93fa5b3 core: fix Cannot read property 'hash' of undefined 2022-10-26 15:16:25 +05:00
Abdullah Atta
9489d73221 web: remove background color from images 2022-10-26 15:11:29 +05:00
Ammar Ahmed
8f2f0b1db1 Merge pull request #1245 from streetwriters/fix-backups
Fix backups
2022-10-26 14:46:40 +05:00
Ammar Ahmed
316b2948b1 Merge branch 'master' into fix-backups
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2022-10-26 14:45:57 +05:00
Ammar Ahmed
65aa53abdf Merge pull request #1244 from streetwriters/remove-play-request
Remove play request
2022-10-26 14:44:57 +05:00
Abdullah Atta
a575705f57 Merge pull request #1243 from streetwriters/backup-scheduling
Schedule automatic backups
2022-10-26 14:43:48 +05:00
Abdullah Atta
cded505ec6 web: schedule automatic backups
This will increase backup reliability since before backups happened either
at app startup or after successful sync. This could create the issue where
backups would not be created regularly. This new scheduler based
implementation fixes this by scheduling automatic backups
according to user's settings.
2022-10-26 14:43:16 +05:00
Abdullah Atta
12202f74a7 web: fix backup settings not showing for logged in users 2022-10-26 14:40:47 +05:00
ammarahm-ed
79e9ab2827 mobile: check github app version on launch 2022-10-26 14:05:29 +05:00
ammarahm-ed
7605c4fcb1 mobile: check backup required on state change 2022-10-26 12:59:16 +05:00
ammarahm-ed
c9450ea141 mobile: fix-backups-bug 2022-10-26 12:19:28 +05:00
Abdullah Atta
38fed25e30 desktop: quit the application when all windows are closed
Our app was rejected by App Store review because:

"The user interface of your app is not consistent with the macOS Human
Interface Guidelines.

Specifically, we found that when the user closes the main application
window there is no menu item to re-open it."

A suggested option for a single-window app is to "save data and quit the
app when the main window is closed," and that's what we are doing.
2022-10-26 10:55:10 +05:00
Abdullah Atta
082b9755db core: re-insert only migrated items
Previously, we were re-inserting all items regardless of whether they
were changed or not. This raised a lot of issues, not to mention
unnecessary load on our servers because after each migration
all the data is re-synced. Since migration takes place independently on
each device, this multiplies exponentially.
Hopefully after this update, this will only happen much more granually.
2022-10-26 10:52:33 +05:00
ammarahm-ed
e37b57b64b mobile: do not check for subscriptions in
github release
2022-10-26 10:34:18 +05:00
ammarahm-ed
9f25d623bb mobile: hide svg in dark mode 2022-10-26 10:28:27 +05:00
ammarahm-ed
a85518d497 mobile: do not send request to play.google.com
in github release
2022-10-26 10:28:15 +05:00
ammarahm-ed
54bf4f2855 mobile: hide svg in dark mode 2022-10-26 10:25:35 +05:00
Abdullah Atta
a275f52917 web: do not show google play logo on mac app store version 2022-10-26 09:51:21 +05:00
Abdullah Atta
c916e2e09d web: fix login loop on session expiry 2022-10-26 09:24:23 +05:00
Abdullah Atta
f4f33fc852 core: fix null is not an object error
This fixes #1231#1230 #1235 #1224
2022-10-26 08:51:37 +05:00
Abdullah Atta
7b458a56b2 core: revert "make sync hub connection more reliable" 2022-10-26 08:51:18 +05:00
ammarahm-ed
c2852ab021 mobile: bump version code 2022-10-24 13:11:56 +05:00
Dylan
57658beb1c editor: multiple tables in 1 note should not freeze the editor (#1228)
* editor: prevent tables from freezing the editor

Signed-off-by: Dylan Hackworth <dylhack@gmail.com>

* editor(#1228): use STD console instead

Signed-off-by: Dylan Hackworth <dylhack@gmail.com>

* editor(#1228): revert try catch replace with Node abstraction

Signed-off-by: Dylan Hackworth <dylhack@gmail.com>

* editor(#1228): utilize current node or parentNode

Signed-off-by: Dylan Hackworth <dylhack@gmail.com>

Signed-off-by: Dylan Hackworth <dylhack@gmail.com>
2022-10-22 09:48:16 +05:00
Abdullah Atta
0b9e868e77 config: add /languages subdir to build outputs for editor 2022-10-20 16:16:42 +05:00
Abdullah Atta
ae1e84a1ba editor: remove webpackPrefetch & webpackPreload directives 2022-10-20 15:30:50 +05:00
Abdullah Atta
be65594e54 web: update pwa metadata 2022-10-20 15:29:29 +05:00
Abdullah Atta
a45a6466e7 web: exclude code language chunks from service worker prefetch 2022-10-20 15:11:02 +05:00
Abdullah Atta
a1e5b572fe editor: allow generating languages in CI 2022-10-20 14:17:36 +05:00
Abdullah Atta
729192f836 web: remove Permissions-Policy from headers 2022-10-20 14:15:50 +05:00
Abdullah Atta
236fc77a63 editor: update katex stylesheet 2022-10-20 14:08:41 +05:00
Abdullah Atta
0bd3310f23 editor: load prism lang grammars from local files 2022-10-20 14:08:41 +05:00
Abdullah Atta
7dbcea2663 editor: generate code languages in build step 2022-10-20 14:08:41 +05:00
Abdullah Atta
9ee13df74e web: don't show login button for logged in users 2022-10-20 14:08:41 +05:00
Abdullah Atta
d92357cf82 web: add web app security headers for cloudflare pages 2022-10-20 14:08:41 +05:00
Abdullah Atta
d907d4f0ea web: improve content loader animation colors 2022-10-20 14:08:41 +05:00
Abdullah Atta
18a463219d web: limit editor width to 850px 2022-10-20 14:08:41 +05:00
ammarahm-ed
228adb0375 mobile: show loading after welcome page 2022-10-19 15:56:45 +05:00
Abdullah Atta
71b2034195 desktop: bump bundle version to 222 2022-10-19 15:33:29 +05:00
Abdullah Atta
555442aa57 web: bump version to 2.2.2 2022-10-19 15:32:42 +05:00
Abdullah Atta
5d94db7b6c desktop: convert all files to use es imports 2022-10-19 15:27:21 +05:00
Abdullah Atta
2e0c630ccd desktop: update electron to v21 & cleanup deps 2022-10-19 15:26:11 +05:00
Abdullah Atta
27f26065f6 desktop: disable requestSingleInstanceLock for mac app store build 2022-10-19 13:12:08 +05:00
Abdullah Atta
e25d4a3039 global: update qclone to 1.2.0 2022-10-19 12:10:31 +05:00
ammarahm-ed
0c84bfdbca mobile: remove react-native-securerandom patch 2022-10-19 12:02:17 +05:00
Abdullah Atta
82f800e530 editor: install new patch for katex@0.16.2 2022-10-19 11:44:49 +05:00
ammarahm-ed
34953ab614 mobile: update webpack.config.js 2022-10-19 11:40:51 +05:00
Abdullah Atta
b63ba7c842 core: install @streetwriters/showdown from npm 2022-10-19 11:39:07 +05:00
Abdullah Atta
1d6f7b3e3e global: remove all .npmrc files 2022-10-19 11:29:39 +05:00
Abdullah Atta
8049b02451 web: improve pane resizing 2022-10-19 11:23:23 +05:00
Abdullah Atta
4b4cb1e826 editor: upgrade katex to 0.16.2 2022-10-19 11:18:20 +05:00
Abdullah Atta
dc7e00e087 web: fix qclone error 2022-10-19 11:18:20 +05:00
ammarahm-ed
f2672d8335 mobile: patch react-native-image-picker 2022-10-19 11:10:50 +05:00
Ammar Ahmed
e67d63373b Merge pull request #1219 from streetwriters/remove-sort-option
mobile: remove dateEdited from sort options in Tags
2022-10-18 18:27:04 +05:00
Ammar Ahmed
b0a1b84a3b Merge pull request #1218 from streetwriters/fix-total-notes-bug
mobile: fix total notes not updated on notebook
2022-10-18 18:26:51 +05:00
Ammar Ahmed
3d10837e31 Merge pull request #1217 from streetwriters/fix-export-sheeet-closable
Fix export sheeet closable
2022-10-18 18:26:37 +05:00
ammarahm-ed
be372e711c mobile: fix export sheet closable during export 2022-10-18 17:59:07 +05:00
ammarahm-ed
604d2c4ee9 mobile: remove dateEdited from sort options in Tags
screen
2022-10-18 17:46:06 +05:00
Abdullah Atta
d42f617d0f core: fix md export for notes with codeblocks 2022-10-18 17:31:31 +05:00
ammarahm-ed
4899d32099 mobile: fix total notes not updated on notebook
and topics.
2022-10-18 17:26:50 +05:00
Ammar Ahmed
f6b095ffb8 Merge pull request #1216 from streetwriters/fix-exporter-errors
mobile: fix exporter errors
2022-10-18 16:46:34 +05:00
ammarahm-ed
eb0bc2bcfc mobile: fix exporter errors 2022-10-18 16:45:03 +05:00
ammarahm-ed
1b79333e32 mobile: bump version 2022-10-18 15:03:58 +05:00
Abdullah Atta
2974d554ad web: fix blank notes screen on screen resize 2022-10-18 13:52:20 +05:00
ammarahm-ed
918557dfcc mobile: update migration sheet wording 2022-10-18 13:10:56 +05:00
ammarahm-ed
ef34cba2c6 mobile: fix empty notebook stuck in loading state 2022-10-18 11:54:28 +05:00
Abdullah Atta
7f68c5e57c web: update test snapshots 2022-10-18 10:56:38 +05:00
Abdullah Atta
ea6a706c25 core: fix failing note-history test 2022-10-18 10:34:59 +05:00
Abdullah Atta
c3badf4846 editor: generate new patch for @tiptap/core 2022-10-18 10:23:47 +05:00
Abdullah Atta
a22be4093d mobile: seemlessly -> seamlessly 2022-10-18 10:14:50 +05:00
Abdullah Atta
50cdf8d5d5 web: seemlessly -> seamlessly 2022-10-18 10:14:40 +05:00
Abdullah Atta
0c4698ef14 web: show loading dialog on permanent logout on session expire 2022-10-18 10:14:23 +05:00
Abdullah Atta
c49ad313c9 web: fix login loop when session expires & 2fa is required 2022-10-18 10:14:01 +05:00
Abdullah Atta
a9dbe13112 editor: prevent Shift + Tab from moving focus from editor
This fixes #1213
2022-10-17 23:32:13 +05:00
Abdullah Atta
3ac3b1bcdb global: update package-lock files 2022-10-17 23:08:39 +05:00
Abdullah Atta
5b213edae8 editor: skip Tab key handling inside tables 2022-10-17 23:04:48 +05:00
Abdullah Atta
0b971bda38 core: minor refactors 2022-10-17 22:46:43 +05:00
Abdullah Atta
73b09847b8 core: make sync hub connection more reliable 2022-10-17 22:46:31 +05:00
Abdullah Atta
b94af68265 web: cache editor content before saving 2022-10-17 22:45:27 +05:00
Abdullah Atta
2cddbabee1 core: remove reindexing before backup import 2022-10-17 22:43:55 +05:00
Abdullah Atta
112497b1b6 core: add progress during migration & backup restore 2022-10-17 22:43:26 +05:00
Abdullah Atta
dc79c274df web: auto save backup on desktop 2022-10-17 22:42:09 +05:00
Abdullah Atta
d35d355fb3 web: move backup time forward when it is skipped 2022-10-17 22:39:54 +05:00
Abdullah Atta
6bf14512f9 core: fix cannot read property title of undefined 2022-10-17 22:38:50 +05:00
Abdullah Atta
0d20013071 core: do not check premium status during tag addition 2022-10-17 22:37:48 +05:00
Abdullah Atta
cf8ed91102 core: use migrations to dedup shortcuts 2022-10-17 22:37:23 +05:00
Abdullah Atta
577d50b512 core: move index migrations to main database migrations
this is better design wise as we won't have to keep checking if the
indices have been migrated or not. We'll just check the database version
and do the appropriate migrations based on that.
2022-10-17 22:36:53 +05:00
Abdullah Atta
1a589b0955 core: refactor migrations to use items instead of types 2022-10-17 20:00:00 +05:00
Abdullah Atta
fdcb8f107f web: minor ui fixes 2022-10-17 19:54:20 +05:00
Abdullah Atta
bb0341ee74 web: fix custom scrollbars on firefox & other browsers 2022-10-17 10:39:22 +05:00
Ammar Ahmed
7f3803a771 Merge pull request #1208 from streetwriters/fix-android-13-notifications
fix android 13 notifications
2022-10-17 08:29:26 +05:00
Ammar Ahmed
a0506ccc80 Merge pull request #1206 from streetwriters/fix-toast-tap
fix toast not hiding on tap on mobile
2022-10-17 08:29:14 +05:00
Ammar Ahmed
e8be040b48 Merge pull request #1204 from streetwriters/automate-migration
Automate migration when possible
2022-10-17 08:29:00 +05:00
ammarahm-ed
16f8172d42 mobile: fix android 13 notifications 2022-10-15 13:22:59 +05:00
ammarahm-ed
16915494d8 mobile: fix toast not hiding on tap 2022-10-14 18:50:50 +05:00
ammarahm-ed
bf4e317561 mobile: automate migration 2022-10-14 18:35:12 +05:00
Abdullah Atta
a255766cda web: improve move note to notebook UX 2022-10-14 18:12:08 +05:00
Abdullah Atta
088c143f59 web: auto disable encrypted backups if user is not pro 2022-10-14 17:54:25 +05:00
Abdullah Atta
e9a63fcf79 editor: don't create a new task list on drop at end
This overrides the default task item drop behavior to make dropping
items at the very end of the task list more reliable.
Currently, dropping the item at the end of the list creates a
new list which is often not what you want. We look for such
behavior and instead moves the item to the very end.
2022-10-14 17:49:53 +05:00
ammarahm-ed
68d4a5e56d mobile: multi-select export notes 2022-10-14 17:49:38 +05:00
ammarahm-ed
25bffe2053 mobile: bulk export all notes 2022-10-14 17:49:38 +05:00
Abdullah Atta
36f3701b4f web: allow exporting all notes as html, md or txt 2022-10-14 17:49:38 +05:00
Abdullah Atta
5886c47d92 editor: update packages 2022-10-14 12:23:40 +05:00
Abdullah Atta
516bc75317 editor: allow indenting list items on tab press 2022-10-14 12:23:30 +05:00
Abdullah Atta
bc7b3535e6 web: minor ui fixes 2022-10-14 10:21:00 +05:00
Abdullah Atta
6e64756725 web: fix Failed to execute 'decode' on 'TextDecoder' error 2022-10-14 10:20:24 +05:00
Abdullah Atta
fc19335a26 core: publish appRefreshRequested event globally 2022-10-13 19:35:32 +05:00
Abdullah Atta
11a3092bac web: make editor title font-size relative to title length 2022-10-13 19:23:48 +05:00
Abdullah Atta
5db1a7b345 editor: allow tabbing inside editor 2022-10-13 19:23:26 +05:00
Abdullah Atta
6116daf9ba editor: disable conversion of 2 single spaced lines into 1 double spaced line 2022-10-13 19:23:05 +05:00
Abdullah Atta
a47c98509d editor: allow converting double spaced lines to single spaced 2022-10-13 19:23:05 +05:00
Abdullah Atta
e1fc116994 core: improve content conflict detection using proper HTML diffing (#1183)
Since HTML is a tree-like language it is futile to compare it character
for character. `html1 === html2` is almost always false. This commit
introduces a simple diffing algorithm that only checks the text inside
the html + a few other attributes to decide whether the 2 HTMLs are
actually different or not. This is obviously not foolproof and it will
ignore everything aesthetic (b, em, strong tags etc.). This is actually
desireable because in our case only the text difference should
warrant a conflict. Everything else can easily be brought back.
Similarly, this also ignores whitespace differences surrouding the
tags.

All in all it'll provide a more reliable alternative to MD5 hashing the
2 HTMLs.
2022-10-13 19:22:32 +05:00
Abdullah Atta
f3fa7fe744 core: update core version to 5.8 2022-10-13 19:18:52 +05:00
Abdullah Atta
0a94ee7c60 core: item should only have a single shortcut
this changes the shortcut ids & deduplicates the old ones so that
there is always only 1 shortcut of a given item (notebook, topic or tag).
2022-10-13 19:18:52 +05:00
Abdullah Atta
0e6150a0f5 core: change db keys to include collection name
This should not affect the items or their server representation.
This change is necessary to allow multiple items with same id
that live in different collections.
For example, shortcuts have the same id as the inner reference they
point to. This was not possible before and would cause an overwrite
of the original value.
2022-10-13 19:18:52 +05:00
Abdullah Atta
c09715d053 core: make item migration fall through all db versions
this was not exactly a bug but it can cause a lot of unintended
behaviour. Previously, you'd have to manually specify which version the
item migration should jump to. This was buggy and poorly designed.
This change makes the item iterate over all the db migrations one by one
automatically.

For example:

An item at version 5.2 will go through:
- 5.3
- 5.4
- and so on
2022-10-13 19:18:52 +05:00
Abdullah Atta
9701a3d660 web: make table row toolbar vertical for compactness 2022-10-13 19:18:33 +05:00
Abdullah Atta
73ed73b2b3 web: improve tag auto suggest 2022-10-12 20:16:26 +05:00
Abdullah Atta
c6201532f2 core: lookup by tag alias 2022-10-12 20:16:26 +05:00
Abdullah Atta
b5ab8e5d3e core: allow free users to assign same 5 tags without limits 2022-10-12 20:16:26 +05:00
Abdullah Atta
74bcd1b27d web: clicking under table should create a new paragraph 2022-10-12 15:16:42 +05:00
Abdullah Atta
d2d269e4ca editor: toggle only the clicked item if it's not selected 2022-10-12 15:16:29 +05:00
ammarahm-ed
595994a495 mobile: add skip signup button on welcome 2022-10-12 14:41:46 +05:00
Abdullah Atta
ee0fb3680a desktop: reduce minimum required macOS version to 10.12.0
This fixes #1180
2022-10-12 14:35:07 +05:00
ammarahm-ed
9d7c2bbe15 mobile: use fixed numColumns value 2022-10-12 13:26:07 +05:00
ammarahm-ed
b975c9c8ca mobile: prevent saving if note content is empty 2022-10-12 13:04:59 +05:00
ammarahm-ed
bc8a336254 mobile: wait before saving note in widget 2022-10-12 13:04:06 +05:00
ammarahm-ed
9934417d07 mobile: disable encrypted backups account downgrade 2022-10-12 10:35:22 +05:00
ammarahm-ed
05f3709a5c mobile: fix app freeze on adding > 3 notebooks 2022-10-12 10:30:43 +05:00
1737 changed files with 181211 additions and 206005 deletions

View File

@@ -19,14 +19,20 @@ const SCOPES = [
"editor",
"logger",
"theme",
"server",
"core",
"fs",
"ui",
"clipper",
"config",
"ci",
"setup",
"docs",
"refactor",
"misc",
"global"
"common",
"global",
"docs"
];
module.exports = {

View File

@@ -18,6 +18,10 @@ apps/web/public/an.js
# editor
packages/editor/styles/
packages/editor/languages/
# editor mobile
packages/editor-mobile/build.bundle
packages/editor-mobile/build.bundle
# snapshots
tap-snapshots

View File

@@ -2,7 +2,7 @@ const LICENSE = [
"",
"This file is part of the Notesnook project (https://notesnook.com/)",
"",
"Copyright (C) 2022 Streetwriters (Private) Limited",
"Copyright (C) 2023 Streetwriters (Private) Limited",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* text=auto eol=lf

View File

@@ -0,0 +1,27 @@
name: "Setup node with cache action"
description: "Setups node with cache"
runs:
using: "composite"
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: |
package-lock.json
apps/mobile/package-lock.json
apps/desktop/package-lock.json
apps/web/package-lock.json
extensions/web-clipper/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/sodium/package-lock.json
packages/clipper/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json

View File

@@ -0,0 +1,53 @@
name: Publish @notesnook/android-internal
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Use specific Java version for the builds
uses: joschi/setup-jdk@v2
with:
java-version: "11"
architecture: "x64"
- name: Install node modules
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=mobile
- name: Make Gradlew Executable
run: cd apps/mobile/native/android && chmod +x ./gradlew
- name: Build unsigned app bundle
run: yarn release:android:bundle
- name: Sign app bundle for Playstore release
id: sign_app
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: apps/mobile/native/android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Publish to Playstore
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.streetwriters.notesnook
releaseFile: ${{steps.sign_app.outputs.signedReleaseFile}}
track: internal
status: completed
whatsNewDirectory: apps/mobile/native/android/releasenotes/

View File

@@ -11,31 +11,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@master
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Use specific Java version for the builds
uses: joschi/setup-jdk@v2
with:
java-version: '11'
architecture: 'x64'
java-version: "11"
architecture: "x64"
- name: Install node modules
run: |
npm ci
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=mobile
- name: Make Gradlew Executable
run: cd apps/mobile/native/android && chmod +x ./gradlew
@@ -50,7 +39,18 @@ jobs:
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Publish to Playstore
id: deploy
uses: r0adkll/upload-google-play@v1.1.1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.streetwriters.notesnook
releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}}
track: production
status: completed
whatsNewDirectory: apps/mobile/native/android/releasenotes/
- name: Build apks for Github release
run: yarn release:android
@@ -63,7 +63,7 @@ jobs:
signingKeyBase64: ${{ secrets.PUBLIC_SIGNING_KEY }}
alias: ${{ secrets.PUBLIC_ALIAS }}
keyStorePassword: ${{ secrets.PUBLIC_KEY_PASSWORD }}
keyPassword: ${{ secrets.PUBLIC_KEY_PASSWORD }}
keyPassword: ${{ secrets.PUBLIC_KEY_PASSWORD }}
- name: Rename apk files
run: |
@@ -92,14 +92,3 @@ jobs:
apps/mobile/native/android/app/build/outputs/apk/release/notesnook-armeabi-v7a.apk
apps/mobile/native/android/app/build/outputs/apk/release/notesnook-x86.apk
apps/mobile/native/android/app/build/outputs/apk/release/notesnook-x86_64.apk
- name: Publish to Playstore
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.streetwriters.notesnook
releaseFile: ${{steps.sign_app.outputs.signedReleaseFile}}
track: production
status: completed
whatsNewDirectory: apps/mobile/native/android/releasenotes/

View File

@@ -8,7 +8,7 @@ on:
paths:
- "packages/core/**"
# re-run workflow if workflow file changes
- ".github/workflows/core.tests.yml"
- ".github/workflows/core.tests.yml"
pull_request:
types:
- "ready_for_review"
@@ -24,30 +24,18 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
uses: ./.github/actions/setup-node-with-cache
- name: Prepare environment
run: |
npm ci --prefer-offline --no-audit
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=core
- name: Add environment variables
run: |
echo "EMAIL=${{ secrets.USER_EMAIL }}" >> $GITHUB_ENV
echo "PASSWORD='${{ secrets.USER_PASSWORD }}'" >> $GITHUB_ENV
echo "HASHED_PASSWORD=${{ secrets.USER_HASHED_PASSWORD }}" >> $GITHUB_ENV
echo "USER_EMAIL=${{ secrets.USER_EMAIL }}" >> $GITHUB_ENV
echo "USER_PASSWORD=${{ secrets.USER_PASSWORD }}" >> $GITHUB_ENV
echo "USER_TOTP_SECRET=${{ secrets.USER_TOTP_SECRET }}" >> $GITHUB_ENV
echo "USER_HASHED_PASSWORD=${{ secrets.USER_HASHED_PASSWORD }}" >> $GITHUB_ENV
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
- name: Run all @notesnook/core tests

View File

@@ -28,26 +28,12 @@ jobs:
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm i --ignore-scripts --prefer-offline --no-audit
npx lerna bootstrap --ignore=@notesnook/mobile -- --prefer-offline --no-audit
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=web
- name: Setup environment
run: |
@@ -64,7 +50,7 @@ jobs:
- name: Collect app metadata
id: app_metadata
working-directory: ./apps/web/desktop
working-directory: ./apps/desktop
run: |
echo ::set-output name=app_version::$(cat package.json | jq -r .version)
@@ -91,6 +77,9 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Setup notarization
run: |
mkdir -p ~/private_keys/
@@ -98,13 +87,13 @@ jobs:
- name: Collect app metadata
id: app_metadata
working-directory: ./apps/web/desktop
working-directory: ./apps/desktop
run: |
echo ::set-output name=apple_app_id::$(cat package.json | jq -r .appAppleId)
echo ::set-output name=app_bundle_id::$(cat package.json | jq -r .build.appId)
echo ::set-output name=app_version::$(cat package.json | jq -r .version)
echo ::set-output name=bundle_version::$(cat package.json | jq -r .build.mac.bundleVersion)
- name: Get App Store Version
id: appstore
uses: streetwriters/appstore-connect-app-version@develop
@@ -115,24 +104,20 @@ jobs:
private-key-raw: ${{ secrets.api_key }}
platform: "MAC_OS"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
path: ./apps/web/desktop/build
path: ./apps/web/build
- name: Install packages
run: npm i
working-directory: ./apps/web/desktop
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=desktop
- name: Install provisioning profile
run: echo "${{ secrets.MAC_PROVISIONING_PROFILE }}" | base64 --decode > embedded.provisionprofile
working-directory: ./apps/web/desktop
working-directory: ./apps/desktop
- name: Build app for Mac App Store
if: inputs.publish-apple && steps.appstore.outputs.app-version-latest != steps.app_metadata.outputs.app_version
@@ -140,9 +125,9 @@ jobs:
CSC_LINK: ${{ secrets.mac_certs }}
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
run: |
npm run build:mas
npx nx run release --project @notesnook/desktop -- --variant=mas
npx electron-builder --mac mas --universal -p never
working-directory: ./apps/web/desktop
working-directory: ./apps/desktop
- name: Build zip and dmg
env:
@@ -153,26 +138,26 @@ jobs:
APPLE_API_KEY_ID: ${{ secrets.api_key_id }}
APPLE_API_KEY_ISSUER: ${{ secrets.api_key_issuer_id }}
run: |
npm run build
npx nx run release --project @notesnook/desktop
if [ ${{ inputs.publish-github }} == true ]; then
npx electron-builder --mac zip dmg --arm64 --x64 -p always
else
npx electron-builder --mac zip dmg --arm64 --x64 -p never
fi
working-directory: ./apps/web/desktop
working-directory: ./apps/desktop
- name: Deploy to Testflight
if: inputs.publish-apple && steps.appstore.outputs.app-version-latest != steps.app_metadata.outputs.app_version
env:
API_KEY_ID: ${{ secrets.api_key_id }}
API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}
run: |
package=$(find ./dist/mas-universal/notesnook*.pkg)
run: |
package=$(find ./output/mas-universal/notesnook*.pkg)
echo "Uploading ${package} using altool..."
xcrun altool --upload-package $package -t osx --apiKey $API_KEY_ID --apiIssuer $API_KEY_ISSUER_ID --apple-id ${{ steps.app_metadata.outputs.apple_app_id }} --bundle-id ${{ steps.app_metadata.outputs.app_bundle_id }} --bundle-short-version-string ${{ steps.app_metadata.outputs.app_version }} --bundle-version ${{ steps.app_metadata.outputs.bundle_version }}
working-directory: ./apps/web/desktop
working-directory: ./apps/desktop
build-linux:
name: Build for Linux
@@ -183,6 +168,9 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Setup Snapcraft Auth
if: inputs.publish-snap
run: echo "SNAPCRAFT_STORE_CREDENTIALS=${{ secrets.snapcraft_token }}" >> $GITHUB_ENV
@@ -190,48 +178,44 @@ jobs:
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
if: inputs.publish-snap
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
path: ./apps/web/desktop/build
path: ./apps/web/build
- name: Install packages
run: npm i
working-directory: ./apps/web/desktop
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=desktop
- name: Build Electron wrapper
run: npm run build
working-directory: ./apps/web/desktop
run: npx nx run release --project @notesnook/desktop
working-directory: ./apps/desktop
- name: Build snap
if: inputs.publish-snap
run: |
npx electron-builder --linux snap -p never
working-directory: ./apps/web/desktop
npx electron-builder --linux snap:x64 -p never
working-directory: ./apps/desktop
- name: Build AppImage deb and rpm
- name: Build AppImage
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ ${{ inputs.publish-github }} == true ]; then
npx electron-builder --linux AppImage deb rpm -p always
npx electron-builder --linux AppImage:x64 AppImage:arm64 -p always
else
npx electron-builder --linux AppImage deb rpm -p never
npx electron-builder --linux AppImage:x64 AppImage:arm64 -p never
fi
working-directory: ./apps/web/desktop
working-directory: ./apps/desktop
- name: Publish on Snapcraft
if: inputs.publish-snap
run: |
snapcraft upload --release=stable ./dist/notesnook_linux_amd64.snap
working-directory: ./apps/web/desktop
snapcraft upload --release=stable ./output/notesnook_linux_amd64.snap
working-directory: ./apps/desktop
build-windows:
name: Build for Windows
@@ -243,31 +227,29 @@ jobs:
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
uses: ./.github/actions/setup-node-with-cache
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
path: ./apps/web/desktop/build
path: ./apps/web/build
- name: Install packages
run: npm i
working-directory: ./apps/web/desktop
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=desktop
- name: Build Electron wrapper
run: npm run build
working-directory: ./apps/web/desktop
- name: Build
run: npx nx run release --project @notesnook/desktop
- name: Build app
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ($${{ inputs.publish-github }} -eq $true) {
npx electron-builder --win --publish always
yarn electron-builder --win --publish always
} else {
npx electron-builder --win --publish never
yarn electron-builder --win --publish never
}
working-directory: ./apps/web/desktop
working-directory: ./apps/desktop

43
.github/workflows/editor.tests.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Test @notesnook/editor
on:
workflow_dispatch:
push:
branches:
- "master"
paths:
- "packages/editor/**"
# re-run workflow if workflow file changes
- ".github/workflows/editor.tests.yml"
pull_request:
types:
- "ready_for_review"
- "opened"
- "synchronize"
- "reopened"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=editor
- name: Setup environment
run: |
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
- name: Build editor
run: npx nx build @notesnook/editor
- name: Run all @notesnook/editor tests
run: npx nx test @notesnook/editor

35
.github/workflows/help.publish.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Publish Notesnook Help
on:
workflow_dispatch:
push:
branches:
- "master"
paths:
- "docs/help/**"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install docgen
run: cargo install --git https://github.com/thecodrr/docgen
- name: Build site
run: docgen build --release
working-directory: docs/help
- name: Setup environment
run: |
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
- name: Publish on Cloudflare Pages
run: npx --yes wrangler pages deploy --project-name notesnook-help ./docs/help/site/ --branch main

View File

@@ -11,4 +11,4 @@ jobs:
steps:
- name: Run ats-diagnostics
run: nscurl --ats-diagnostics https://payments.streetwriters.co
run: nscurl --ats-diagnostics https://payments.streetwriters.co

View File

@@ -11,26 +11,12 @@ jobs:
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm i --ignore-scripts --prefer-offline --no-audit
npx lerna bootstrap --ignore=@notesnook/mobile -- --prefer-offline --no-audit
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=web
- name: Setup environment
run: |

View File

@@ -25,26 +25,12 @@ jobs:
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm i --ignore-scripts --prefer-offline --no-audit
npx lerna bootstrap --ignore=@notesnook/mobile -- --prefer-offline --no-audit
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=web
- name: Setup environment
run: |
@@ -63,7 +49,7 @@ jobs:
name: 🧪 Test (${{ matrix.shard }}/${{ strategy.job-total }})
strategy:
matrix:
shard: [1, 2, 3]
shard: [1, 2, 3, 4]
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -76,26 +62,12 @@ jobs:
path: ./apps/web/build
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm i --ignore-scripts --prefer-offline --no-audit
npm install -D @playwright/test
npm ci --ignore-scripts --prefer-offline --no-audit
npm install -D @playwright/test otplib
- name: Validate build extraction
run: ls -ld ./apps/web/build/index.html
@@ -107,8 +79,9 @@ jobs:
- name: Add environment variables
run: |
echo "USER_EMAIL=${{ secrets.USER_EMAIL }}" >> $GITHUB_ENV
echo "CURRENT_USER_PASSWORD=${{ secrets.USER_PASSWORD }}" >> $GITHUB_ENV
echo "CURRENT_USER_KEY=${{ secrets.USER_KEY }}" >> $GITHUB_ENV
echo "USER_PASSWORD=${{ secrets.USER_PASSWORD }}" >> $GITHUB_ENV
echo "USER_TOTP_SECRET=${{ secrets.USER_TOTP_SECRET }}" >> $GITHUB_ENV
echo "USER_KEY=${{ secrets.USER_KEY }}" >> $GITHUB_ENV
- name: Run tests
run: npx playwright test --shard=${{ matrix.shard }}/${{ strategy.job-total }}

8
.gitignore vendored
View File

@@ -3,4 +3,10 @@ coverage
node_modules
dist
.DS_STORE
nx-cloud.env
nx-cloud.env
.idea
.eslintcache
.env.local
.nyc_output
site
node_modules.backup

View File

@@ -4,5 +4,7 @@ module.exports = {
semi: true,
printWidth: 80,
useTabs: false,
tabWidth: 2
tabWidth: 2,
bracketSpacing: true,
endOfLine: "lf"
};

11
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-playwright.playwright",
"firefox-devtools.vscode-firefox-debug",
"msjsdiag.vscode-react-native"
]
}

14
.vscode/settings.json vendored
View File

@@ -1,3 +1,15 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"eslint.run": "onSave",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.options": {
"cache": true,
"cacheStrategy": "content"
},
"git.rebaseWhenSync": true
}

View File

@@ -1,3 +1,4 @@
Notesnook is written & maintained by:
- Abdullah Atta <abdullahatta@streetwriters.co>
- Ammar Ahmed <ammarahmed6506@gmail.com>
- Muhammad Ali <alihamuh@gmail.com>

View File

@@ -8,9 +8,9 @@ Thank you so much for considering to contribute to Notesnook! If you have no ide
Ugh! Bugs!
> A bug is when software behaves in a way that you didn't expect, and the developer didn't intend.
> A bug is when software behaves in a way you didn't expect, which the developer didn't intend.
To help us understand what's going on, we first want to **make sure you're using the latest version of Notesnook**.
To help us understand what's happening, we first want to **make sure you're using the latest version of Notesnook**.
Once you've **confirmed that the bug still exists in the latest version**, you'll want to check to make sure it's not something we already know about in the [opened GitHub issues](https://github.com/streetwriters/notesnook/issues).
@@ -28,15 +28,9 @@ If you've thought of a way that Notesnook could be better, we want to hear about
Before you open a new feature request, please make sure it's not a duplicate. **Duplicate feature requests & bug reports are closed immediately.**
### Improving documentation
All app related documentation can be found in the `docs/` directory. All the files in this directory are simple markdown files which you can edit either directly on GitHub, or in your favorite text editor.
If you find a mistake in the documentation or would like to contribute something new to the documentation, feel free to open a pull request; creating an issue for this is not required.
### Helping out in the issue tracker
There are always new issues getting opened that need to be triaged, sorted & organized, so the developers can easily find the most critical and/or relevant bugs to fix. Any help in this regard is appreciated.
New issues are always opened that need to be triaged, sorted & organized, so the developers can easily find the most critical and/or relevant bugs to fix. Any help in this regard is appreciated.
In addition to this, you can help out in the following ways:
@@ -68,7 +62,7 @@ Once you are done, [open a new pull request](https://docs.github.com/en/pull-req
1. Fork [the repository](https://github.com/streetwriters/notesnook) and create your branch from `master` (you can name your branch anything).
2. Run `npm run bootstrap` in the repository root.
3. If youve fixed a bug or added code that should be tested, add tests!
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`npm run test`).
5. Format your code with prettier (`npm run prettier`).
6. Make sure your code lints (`npm run lint`). Tip: `npm run linc` to only check changed files.
@@ -91,7 +85,11 @@ The DCO is a declaration attached to every contribution made by every developer
Signed-off-by: Jane Smith <jane.smith@email.com>
```
You may type this line on your own when writing your commit messages. However, if your [user.name](http://user.name) and [user.email](http://user.email) are set in your git configs, you can use `-s` or `--signoff` to add the `Signed-off-by` line to the end of the commit message.
On VSCode, it looks like this:
![](resources/vscode-signed-off-commit.png)
You may type this line on your own when writing your commit messages. However, if your [user.name](http://user.name) and [user.email](http://user.email) are set in your git configs, you can use `-s` or `--signoff` to add the `Signed-off-by` line to the end of the commit message automatically.
#### Include `<scope>:` in your commit message
@@ -133,11 +131,11 @@ We use an automatic code formatter called [Prettier](https://prettier.io/). Run
Then, our linter will catch most issues that may exist in your code. You can check the status of your code styling by simply running `npm run lint`.
However, there are still some styles that the linter cannot pick up. If you are unsure about something, looking at [Airbnbs Style Guide](https://github.com/airbnb/javascript) will guide you in the right direction.
However, there are still some styles that the linter cannot pick up. If you are unsure about something, looking at [Airbnb's Style Guide](https://github.com/airbnb/javascript) will guide you in the right direction.
## Git Branch Organization
Submit all changes directly to the [`master branch`](https://github.com/streetwriters/notesnook). We dont use separate branches for development or for upcoming releases. This requires us to always keep the `master` branch in a deployable state which means:
Submit all changes directly to the [`master branch`](https://github.com/streetwriters/notesnook). We don't use separate branches for development or for upcoming releases. This requires us to always keep the `master` branch in a deployable state which means:
1. All tests must be passing at all times
2. There should be as few breaking changes as possible

View File

@@ -10,11 +10,11 @@
## Overview
Notesnook is a free (as in speech) & open source note taking app focused on user privacy & ease of use. To ensure zero knowledge principles, Notesnook encrypts everything on your device using `XChaCha20-Poly1305` & `Argon2`.
Notesnook is a free (as in speech) & open-source note-taking app focused on user privacy & ease of use. To ensure zero knowledge principles, Notesnook encrypts everything on your device using `XChaCha20-Poly1305` & `Argon2`.
Notesnook is our **proof** that privacy does _not_ (always) have to come at the cost of convenience. Our goal is to provide users peace of mind & 100% confidence that their notes are safe and secure. The decision to go fully open source is one of the most crucial steps towards that.
Notesnook is our **proof** that privacy does _not_ (always) have to come at the cost of convenience. We aim to provide users peace of mind & 100% confidence that their notes are safe and secure. The decision to go fully open source is one of the most crucial steps towards that.
This repository contains all the code required to build & use the Notesnook web, desktop & mobile clients. If you are looking for a full features list or screenshots, please check the [website](https://notesnook.com/).
This repository contains all the code required to build & use the Notesnook web, desktop & mobile clients. If you are looking for a full feature list or screenshots, please check the [website](https://notesnook.com/).
## Developer guide
@@ -25,25 +25,30 @@ Notesnook is built using the following technologies:
1. JavaScript/Typescript — this repo is in a hybrid state. A lot of the newer code is being written in Typescript & the old code is slowly being ported over.
2. React — the whole front-end across all platforms is built using React.
3. React Native — For mobile apps we are using React Native
4. NPM — listed here because we **don't** use Yarn or PNPM or XYZ across any of our projects.
5. Lerna & Nx — maintaining monorepos is hard but Nx makes it easier.
4. Electron — For desktop app
5. NPM — listed here because we **don't** use Yarn or PNPM or XYZ across any of our projects.
6. Nx — maintaining monorepos is hard but Nx makes it easier.
> **Note: Each project in the monorepo contains its own architecture details which you can refer to.**
### Monorepo structure
| Name | Path | Description |
| -------------------------- | -------------------------------------------------- | ----------------------------------------------------------------- |
| `@notesnook/web` | [/apps/web](/apps/web) | Web/Desktop clients |
| `@notesnook/mobile` | [/apps/mobile](/apps/mobile) | Android/iOS clients |
| `@notesnook/core` | [/packages/core](/packages/core) | Shared core between all platforms |
| `@notesnook/crypto` | [/packages/crypto](/packages/crypto) | Cryptography library wrapper around libsodium |
| `@notesnook/editor` | [/packages/editor](/packages/editor) | Notesnook editor + all extensions |
| `@notesnook/editor-mobile` | [/packages/editor-mobile](/packages/editor-mobile) | A very thin wrapper around `@notesnook/editor` for mobile clients |
| `@notesnook/logger` | [/packages/logger](/packages/logger) | Simple & pluggable logger |
| `@notesnook/crypto-worker` | [/packages/crypto-worker](/packages/crypto-worker) | Helpers to use `@notesnook/crypto` from a Worker |
| `@notesnook/streamable-fs` | [/packages/streamable-fs](/packages/streamable-fs) | Streaming interface around an IndexedDB based file system |
| `@notesnook/theme` | [/packages/theme](/packages/theme) | The core theme used in web & desktop clients |
| Name | Path | Description |
| -------------------------- | -------------------------------------------------- | -------------------------------------------------------------------- |
| `@notesnook/web` | [/apps/web](/apps/web) | Web client |
| `@notesnook/desktop` | [/apps/desktop](/apps/desktop) | Desktop client |
| `@notesnook/mobile` | [/apps/mobile](/apps/mobile) | Android/iOS clients |
| `@notesnook/web-clipper` | [/extensions/web-clipper](/extensions/web-clipper) | Web clipper |
| `@notesnook/core` | [/packages/core](/packages/core) | Shared core between all platforms |
| `@notesnook/crypto` | [/packages/crypto](/packages/crypto) | Cryptography library wrapper around libsodium |
| `@notesnook/clipper` | [/packages/clipper](/packages/clipper) | Web clipper core handling everything related to actual page clipping |
| `@notesnook/editor` | [/packages/editor](/packages/editor) | Notesnook editor + all extensions |
| `@notesnook/editor-mobile` | [/packages/editor-mobile](/packages/editor-mobile) | A very thin wrapper around `@notesnook/editor` for mobile clients |
| `@notesnook/logger` | [/packages/logger](/packages/logger) | Simple & pluggable logger |
| `@notesnook/sodium` | [/packages/sodium](/packages/sodium) | Wrapper around libsodium to support Node.js & Browser |
| `@notesnook/crypto-worker` | [/packages/crypto-worker](/packages/crypto-worker) | Helpers to use `@notesnook/crypto` from a Worker |
| `@notesnook/streamable-fs` | [/packages/streamable-fs](/packages/streamable-fs) | Streaming interface around an IndexedDB based file system |
| `@notesnook/theme` | [/packages/theme](/packages/theme) | The core theme used in web & desktop clients |
### Contributing guidelines

4
apps/desktop/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
node_modules
build
output
dist

58
apps/desktop/README.md Normal file
View File

@@ -0,0 +1,58 @@
<p align="center">
<img style="align:center;" src="/resources/screenshots/web.jpg" alt="Notesnook desktop screenshot" width="600" />
</p>
<h1 align="center">Notesnook Desktop</h1>
<h3 align="center">The desktop app is built using Electron & Typescript.</h3>
<p align="center">
<a href="https://notesnook.com/downloads">Downloads</a> | <a href="#developer-guide">Developer guide</a> | <a href="#build-instructions">How to build?</a>
</p>
## Getting started
## Build instructions
> **Before you start, it is recommended that you read [the contributing guidelines](/CONTRIBUTING.md).**
### Setting up the development environment
Requirements:
1. [Node.js](https://nodejs.org/en/download/)
2. [git](https://git-scm.com/downloads)
3. NPM (not yarn or pnpm)
Before you can do anything, you'll need to [install Node.js](https://nodejs.org/en/download/) v16 or later on your system.
Once you have completed the setup, the first step is to `clone` the monorepo:
```bash
git clone https://github.com/streetwriters/notesnook.git
# change directory
cd notesnook
```
Once you are inside the `./notesnook` directory, run the preparation step:
```bash
# this might take a while to complete
npm install
```
Now you can finally start the desktop app:
```bash
npm run start:desktop
```
## Developer guide
### The tech stack
We try to keep the stack as lean as possible:
1. Electron
2. tRPC: for cross-communication between the web & desktop parts
3. zod: for runtime typechecking
4. yargs: for CLI argument parsing

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 520 B

View File

Before

Width:  |  Height:  |  Size: 917 B

After

Width:  |  Height:  |  Size: 917 B

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 353 KiB

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,9 +16,12 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* eslint-disable no-var */
import { invokeCommand } from "./index";
import { BrowserWindow } from "electron";
export default function saveFile(filePath, data) {
invokeCommand("saveFile", { filePath, data });
declare global {
var window: BrowserWindow | null;
var RELEASE: boolean;
var MAC_APP_STORE: boolean;
}

5123
apps/desktop/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

211
apps/desktop/package.json Normal file
View File

@@ -0,0 +1,211 @@
{
"name": "@notesnook/desktop",
"productName": "Notesnook",
"description": "Your private note taking space",
"version": "2.5.8",
"appAppleId": "1544027013",
"private": true,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"homepage": "https://notesnook.com/",
"repository": "https://github.com/streetwriters/notesnook",
"license": "GPL-3.0-or-later",
"dependencies": {
"@notesnook/crypto": "file:../../packages/crypto",
"@trpc/client": "10.31.0",
"@trpc/server": "10.31.0",
"electron-trpc": "0.5.2",
"electron-updater": "6.1.1",
"icojs": "^0.17.1",
"typed-emitter": "^2.1.0",
"yargs": "^17.6.2",
"zod": "^3.21.4"
},
"devDependencies": {
"@types/node": "^18.15.0",
"@types/yargs": "^17.0.24",
"chokidar": "^3.5.3",
"electron": "24.5.1",
"electron-builder": "24.4.0",
"electron-builder-notarize": "^1.5.1",
"esbuild": "^0.17.19",
"node-fetch": "^3.3.1",
"tree-kill": "^1.2.2"
},
"optionalDependencies": {
"dmg-license": "^1.0.11"
},
"scripts": {
"start": "node scripts/dev.mjs",
"staging": "node scripts/build.mjs --run",
"release": "node scripts/build.mjs",
"build": "tsc",
"bundle": "esbuild electron=./src/main.ts ./src/preload.ts --external:electron --external:fsevents --minify --bundle --outdir=./build --platform=node --tsconfig=tsconfig.json --define:MAC_APP_STORE=false --define:RELEASE=true",
"bundle:mas": "esbuild electron=./src/main.ts ./src/preload.ts --minify --external:electron --external:fsevents --bundle --outdir=./build --platform=node --tsconfig=tsconfig.json --define:MAC_APP_STORE=true --define:RELEASE=true",
"postinstall": "patch-package"
},
"author": {
"name": "Streetwriters (Private) Limited",
"email": "support@streetwriters.co",
"url": "https://streetwriters.co"
},
"build": {
"appId": "org.streetwriters.notesnook",
"productName": "Notesnook",
"copyright": "Copyright © 2023 Streetwriters (Private) Limited",
"artifactName": "notesnook_${os}_${arch}.${ext}",
"npmRebuild": false,
"asar": false,
"files": [
"!*.chunk.js.map",
"!*.chunk.js.LICENSE.txt",
"build/",
"!build/screenshots${/*}",
"!build/banner.jpg",
"!build/*.ico",
"!build/*.png",
"!node_modules${/*}"
],
"afterSign": "electron-builder-notarize",
"afterPack": "./scripts/removeLocales.js",
"mac": {
"bundleVersion": "240",
"minimumSystemVersion": "10.12.0",
"target": [
{
"target": "dmg",
"arch": [
"arm64",
"x64"
]
},
{
"target": "zip",
"arch": [
"arm64",
"x64"
]
}
],
"category": "public.app-category.productivity",
"darkModeSupport": true,
"type": "distribution",
"hardenedRuntime": true,
"entitlements": "assets/entitlements.mac.plist",
"entitlementsInherit": "assets/entitlements.mac.plist",
"gatekeeperAssess": false,
"icon": "assets/icons/app.icns"
},
"dmg": {
"contents": [
{
"x": 130,
"y": 220
},
{
"x": 410,
"y": 220,
"type": "link",
"path": "/Applications"
}
],
"icon": "assets/icons/app.icns",
"title": "Install Notesnook"
},
"mas": {
"entitlements": "assets/entitlements.mas.plist",
"entitlementsInherit": "assets/entitlements.mas.inherit.plist",
"entitlementsLoginHelper": "assets/entitlements.mas.loginhelper.plist",
"hardenedRuntime": true
},
"win": {
"target": [
{
"target": "nsis",
"arch": [
"x64",
"arm64"
]
},
{
"target": "portable",
"arch": [
"x64",
"arm64"
]
}
],
"icon": "assets/icons/app.ico"
},
"portable": {
"artifactName": "notesnook_${os}_${arch}_portable.${ext}"
},
"nsis": {
"oneClick": true,
"createDesktopShortcut": "always"
},
"linux": {
"target": [
{
"target": "AppImage",
"arch": [
"x64",
"arm64"
]
},
{
"target": "snap",
"arch": [
"x64",
"arm64"
]
}
],
"category": "Office",
"icon": "assets/icons/app.icns",
"description": "Your private note taking space",
"executableName": "notesnook",
"desktop": {
"actions": [
{
"id": "new-note",
"name": "New note",
"args": "new note"
},
{
"id": "new-notebook",
"name": "New notebook",
"args": "new notebook"
},
{
"id": "new-reminder",
"name": "New reminder",
"args": "new reminder"
}
]
}
},
"snap": {
"autoStart": false,
"confinement": "strict",
"allowNativeWayland": true
},
"extraResources": [
"./assets/**"
],
"extraMetadata": {
"main": "./build/electron.js"
},
"directories": {
"buildResources": "assets",
"output": "./output/"
},
"publish": [
{
"provider": "github",
"repo": "notesnook",
"owner": "streetwriters"
}
]
}
}

View File

@@ -0,0 +1,36 @@
diff --git a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
index 3ba5d6a..cf8e147 100644
--- a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
+++ b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
@@ -105,6 +105,7 @@ class LinuxTargetHelper {
StartupWMClass: appInfo.productName,
...extra,
...targetSpecificOptions.desktop,
+ actions: undefined
};
const description = this.getDescription(targetSpecificOptions);
if (!(0, builder_util_1.isEmptyOrSpaces)(description)) {
@@ -148,6 +149,23 @@ class LinuxTargetHelper {
data += `\n${name}=${desktopMeta[name]}`;
}
data += "\n";
+
+ if (targetSpecificOptions.desktop.actions) {
+ let actionsData = "";
+ const validActions = [];
+ for (const action of targetSpecificOptions.desktop.actions) {
+ if (!action.id || !action.name || !action.args) continue;
+ actionsData += "\n";
+ actionsData += `[Desktop Action ${action.id}]
+Name=${action.name}
+Exec=${desktopMeta.Exec} ${action.args}`;
+ actionsData += "\n";
+
+ validActions.push(action.id);
+ }
+
+ data += `Actions=${validActions.join(";")};\n${actionsData}`
+ }
return Promise.resolve(data);
}
}

View File

@@ -0,0 +1,23 @@
diff --git a/node_modules/electron-trpc/dist/main.mjs b/node_modules/electron-trpc/dist/main.mjs
index 379cf3b..2644e5d 100644
--- a/node_modules/electron-trpc/dist/main.mjs
+++ b/node_modules/electron-trpc/dist/main.mjs
@@ -221,9 +221,16 @@ class G {
i(this, c).includes(r) || (i(this, c).push(r), I(this, T, W).call(this, r));
}
detachWindow(r) {
+
y(this, c, i(this, c).filter((n) => n !== r));
- for (const [n, t] of i(this, u).entries())
- n.startsWith(`${r.webContents.id}-`) && (t.unsubscribe(), i(this, u).delete(n));
+ for (const [n, t] of i(this, u).entries()) {
+ try {
+ n.startsWith(`${r.webContents.id}-`) && (t.unsubscribe(), i(this, u).delete(n));
+ } catch(e) {
+ console.error(e);
+ // ignore
+ }
+ }
}
}
c = new WeakMap(), u = new WeakMap(), T = new WeakSet(), W = function(r) {

View File

@@ -0,0 +1,117 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import path from "path";
import fs from "fs/promises";
import { existsSync } from "fs";
import yargs from "yargs-parser";
import os from "os";
import * as childProcess from "child_process";
import { fileURLToPath } from "url";
const args = yargs(process.argv);
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const sodiumNativePrebuildPath = (arch) =>
path.join(
`node_modules`,
`@notesnook`,
`crypto`,
`node_modules`,
`@notesnook`,
`sodium`,
`node_modules`,
`sodium-native`,
`prebuilds`,
`${os.platform()}-${arch}`
);
const webAppPath = path.resolve(path.join(__dirname, "..", "..", "web"));
await fs.rm("./build/", { force: true, recursive: true });
if (args.rebuild || !existsSync(path.join(webAppPath, "build"))) {
await exec(`cd ${webAppPath} && npm run build:desktop`);
}
await fs.cp(path.join(webAppPath, "build"), "build", {
recursive: true,
force: true
});
if (args.variant === "mas") {
await exec(`npm run bundle:mas`);
} else {
await exec(`npm run bundle`);
}
await exec(`npx tsc`);
if (existsSync(sodiumNativePrebuildPath("x64"))) {
console.log("copying sodium-native-x64");
await fs.cp(
sodiumNativePrebuildPath("x64"),
path.join("build", "prebuilds", `${process.platform}-x64`),
{
recursive: true,
force: true
}
);
}
if (existsSync(sodiumNativePrebuildPath("ia32"))) {
console.log("copying sodium-native-ia32");
await fs.cp(
sodiumNativePrebuildPath("ia32"),
path.join("build", "prebuilds", `${process.platform}-ia32`),
{
recursive: true,
force: true
}
);
}
if (existsSync(sodiumNativePrebuildPath("arm64"))) {
console.log("copying sodium-native-arm64");
await fs.cp(
sodiumNativePrebuildPath("arm64"),
path.join("build", "prebuilds", `${process.platform}-arm64`),
{
recursive: true,
force: true
}
);
}
if (args.run) {
await exec(`npx electron-builder --dir --x64`);
if (process.platform === "win32") {
await exec(`.\\output\\win-unpacked\\Notesnook.exe`);
} else if (process.platform === "darwin") {
await exec(`./output/darwin-unpacked/Notesnook`);
} else {
await exec(`./output/linux-unpacked/Notesnook`);
}
}
async function exec(cmd) {
return childProcess.execSync(cmd, {
env: process.env,
stdio: "inherit"
});
}

View File

@@ -0,0 +1,197 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import path from "path";
import fs from "fs/promises";
import chokidar from "chokidar";
import { execSync, spawn } from "child_process";
import { fileURLToPath } from "url";
import treekill from "tree-kill";
import crypto from "crypto";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const sodiumNativePrebuildPath = path.join(
`node_modules`,
`@notesnook`,
`crypto`,
`node_modules`,
`@notesnook`,
`sodium`,
`node_modules`,
`sodium-native`,
`prebuilds`
);
const RUNNING_PROCESSES = [];
const RESTARTABLE_PROCESSES = [];
let lastBundleHash = null;
await onChange(true);
console.log("Watching...");
const watcher = chokidar.watch("src/", { ignoreInitial: true });
watcher.on("all", () => {
onChange(false);
});
process.on("SIGINT", async (s) => {
await cleanup();
});
async function onChange(first) {
if (first) {
await fs.rm("./build/", { force: true, recursive: true });
}
await exec(`npm run bundle`);
execAsync(`npx`, [`tsc`]);
if (await isBundleSame()) {
console.log("Bundle is same. Doing nothing.");
return;
}
if (first) {
await fs.cp(sodiumNativePrebuildPath, "build/prebuilds", {
recursive: true,
force: true
});
}
if (first) {
await spawnAndWaitUntil(
["npx", "nx", "start:desktop", "@notesnook/web"],
path.join(__dirname, "..", "..", ".."),
(data) => data.includes("Network: use --host to expose")
);
}
if (!first) {
console.log("Restarting...", RESTARTABLE_PROCESSES.length);
await killProcesses(RESTARTABLE_PROCESSES);
}
execAsync(
"npx",
["electron", path.join("build", "electron.js")],
true,
cleanup
);
}
function spawnAndWaitUntil(cmd, cwd, predicate) {
return new Promise((resolve) => {
console.log(">", ...cmd);
const s = spawn(cmd[0], cmd.slice(1), {
cwd,
env: { ...process.env, NO_COLOR: "true" },
shell: false
});
RUNNING_PROCESSES.push(s);
s.stderr.pipe(process.stderr);
s.stdout.on("data", (data) => {
process.stdout.write(data);
if (predicate(data)) resolve(undefined); //
});
});
}
async function exec(cmd) {
try {
console.log(">", cmd);
return execSync(cmd, {
env: process.env,
stdio: "inherit",
shell: false
});
} catch {
//ignore
}
}
function execAsync(cmd, args, restartable, onExit) {
try {
console.log(">", cmd, ...args);
const proc = spawn(cmd, args, {
stdio: "inherit",
env: process.env,
shell: false
});
const array = restartable ? RESTARTABLE_PROCESSES : RUNNING_PROCESSES;
array.push(proc);
proc.on("exit", (code, signal) => {
console.log(cmd, ...args, "closed with code", code);
if (code === 0 && !signal) {
array.splice(array.indexOf(proc), 1);
onExit && onExit();
}
});
} catch {
//ignore
}
}
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function killProcesses(processes) {
for (const process of processes.slice()) {
processes.splice(processes.indexOf(process), 1);
await new Promise((resolve, reject) =>
treekill(process.pid, (err) => (err ? reject(err) : resolve()))
);
}
}
async function cleanup() {
console.log("Cleaning up");
await killProcesses(RESTARTABLE_PROCESSES);
await killProcesses(RUNNING_PROCESSES);
await sleep(1000);
await fs.rm("./build/", { force: true, recursive: true });
process.exit();
}
async function isBundleSame() {
const bundle = await fs.readFile(
path.join(__dirname, "..", "build", "electron.js")
);
const hashSum = crypto.createHash("sha256");
hashSum.update(bundle);
const hex = hashSum.digest("hex");
if (!lastBundleHash) {
lastBundleHash = hex;
return false;
}
if (hex === lastBundleHash) return true;
lastBundleHash = hex;
return false;
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -0,0 +1,58 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { initTRPC } from "@trpc/server";
import { observable } from "@trpc/server/observable";
import { EventEmitter } from "events";
import TypedEventEmitter from "typed-emitter";
export type AppEvents = {
onCreateItem(name: "note" | "notebook" | "reminder"): void;
};
const emitter = new EventEmitter();
const typedEmitter = emitter as TypedEventEmitter<AppEvents>;
const t = initTRPC.create();
export const bridgeRouter = t.router({
onCreateItem: createSubscription("onCreateItem")
});
export const bridge: AppEvents = new Proxy({} as AppEvents, {
get(_t, name) {
if (typeof name === "symbol") return;
return (...args: unknown[]) => {
emitter.emit(name, ...args);
};
}
});
function createSubscription<TName extends keyof AppEvents>(eventName: TName) {
return t.procedure.subscription(() => {
return observable<Parameters<AppEvents[TName]>[0]>((emit) => {
const listener: AppEvents[TName] = (...args: any[]) => {
emit.next(args[0]);
};
typedEmitter.addListener(eventName, listener);
return () => {
typedEmitter.removeListener(eventName, listener);
};
});
});
}

View File

@@ -0,0 +1,39 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import zlib from "node:zlib";
import utils from "node:util";
import { initTRPC } from "@trpc/server";
import { z } from "zod";
const t = initTRPC.create();
const gzipAsync = utils.promisify(zlib.gzip);
const gunzipAsync = utils.promisify(zlib.gunzip);
export const compressionRouter = t.router({
gzip: t.procedure
.input(z.object({ data: z.string(), level: z.number() }))
.query(async ({ input }) => {
const { data, level } = input;
return (await gzipAsync(data, { level })).toString("base64");
}),
gunzip: t.procedure.input(z.string()).query(async ({ input }) => {
return (await gunzipAsync(Buffer.from(input, "base64"))).toString("utf-8");
})
});

View File

@@ -0,0 +1,41 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { initTRPC } from "@trpc/server";
import { compressionRouter } from "./compression";
import { osIntegrationRouter } from "./os-integration";
import { spellCheckerRouter } from "./spell-checker";
import { updaterRouter } from "./updater";
import { bridgeRouter } from "./bridge";
const t = initTRPC.create();
export const router = t.router({
compress: compressionRouter,
integration: osIntegrationRouter,
spellChecker: spellCheckerRouter,
updater: updaterRouter,
bridge: bridgeRouter
});
export const api = router.createCaller({});
// Export type router type signature,
// NOT the router itself.
export type AppRouter = typeof router;

View File

@@ -0,0 +1,160 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { initTRPC } from "@trpc/server";
import { z } from "zod";
import { dialog, nativeTheme, Notification, shell } from "electron";
import { AutoLaunch } from "../utils/autolaunch";
import { config, DesktopIntegration } from "../utils/config";
import { bringToFront } from "../utils/bring-to-front";
import { getTheme, setTheme, Theme } from "../utils/theme";
import { mkdirSync, writeFileSync } from "fs";
import { dirname } from "path";
import { resolvePath } from "../utils/resolve-path";
import { observable } from "@trpc/server/observable";
import { AssetManager } from "../utils/asset-manager";
const t = initTRPC.create();
const NotificationOptions = z.object({
title: z.string().optional(),
body: z.string().optional(),
silent: z.boolean().optional(),
timeoutType: z.union([z.literal("default"), z.literal("never")]).optional(),
urgency: z
.union([z.literal("normal"), z.literal("critical"), z.literal("low")])
.optional(),
tag: z.string()
});
export const osIntegrationRouter = t.router({
zoomFactor: t.procedure.query(() => config.zoomFactor),
setZoomFactor: t.procedure.input(z.number()).mutation(({ input: factor }) => {
globalThis.window?.webContents.setZoomFactor(factor);
config.zoomFactor = factor;
}),
privacyMode: t.procedure.query(() => config.privacyMode),
setPrivacyMode: t.procedure
.input(z.boolean().optional())
.mutation(({ input: privacyMode }) => {
if (!globalThis.window || !["win32", "darwin"].includes(process.platform))
return;
globalThis.window.setContentProtection(!!privacyMode);
if (process.platform === "win32") {
globalThis.window.setThumbnailClip(
privacyMode
? { x: 0, y: 0, width: 1, height: 1 }
: { x: 0, y: 0, width: 0, height: 0 }
);
}
config.privacyMode = !!privacyMode;
}),
desktopIntegration: t.procedure.query(() => config.desktopSettings),
setDesktopIntegration: t.procedure
.input(DesktopIntegration)
.mutation(({ input: settings }) => {
if (settings.autoStart) {
AutoLaunch.enable(!!settings.startMinimized);
} else {
AutoLaunch.disable();
}
config.desktopSettings = settings;
}),
selectDirectory: t.procedure
.input(
z.object({
title: z.string().optional(),
buttonLabel: z.string().optional(),
defaultPath: z.string().optional()
})
)
.query(async ({ input }) => {
if (!globalThis.window) return undefined;
const { title, buttonLabel, defaultPath } = input;
const result = await dialog.showOpenDialog(globalThis.window, {
title,
buttonLabel,
properties: ["openDirectory"],
defaultPath: defaultPath && resolvePath(defaultPath)
});
if (result.canceled) return undefined;
return result.filePaths[0];
}),
saveFile: t.procedure
.input(z.object({ data: z.string(), filePath: z.string() }))
.query(({ input }) => {
const { data, filePath } = input;
if (!data || !filePath) return;
const resolvedPath = resolvePath(filePath);
mkdirSync(dirname(resolvedPath), { recursive: true });
writeFileSync(resolvedPath, data);
}),
showNotification: t.procedure
.input(NotificationOptions)
.query(({ input }) => {
const notification = new Notification({
...input,
icon: AssetManager.appIcon({
size: 64,
format: process.platform === "win32" ? "ico" : "png"
})
});
notification.show();
if (input.urgency === "critical") {
shell.beep();
}
return new Promise((resolve) => {
notification.once("close", () => resolve(undefined));
notification.once("click", () => resolve(input.tag));
});
}),
openPath: t.procedure
.input(z.object({ type: z.literal("path"), link: z.string() }))
.query(({ input }) => {
const { type, link } = input;
if (type === "path") return shell.openPath(resolvePath(link));
}),
bringToFront: t.procedure.query(() => bringToFront()),
changeTheme: t.procedure
.input(Theme)
.mutation(({ input }) => setTheme(input)),
onThemeChanged: t.procedure.subscription(() =>
observable<"dark" | "light">((emit) => {
nativeTheme.on("updated", () => {
if (getTheme() === "system") {
emit.next(nativeTheme.shouldUseDarkColors ? "dark" : "light");
}
});
})
)
});

View File

@@ -0,0 +1,122 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { initTRPC } from "@trpc/server";
import { z } from "zod";
import { config } from "../utils/config";
const t = initTRPC.create();
const LANGUAGES: Record<string, string> = {
af: "Afrikaans",
bg: "Bulgarian",
ca: "Catalan",
cs: "Czech",
cy: "Welsh",
da: "Danish",
de: "German",
"de-DE": "German (Germany)",
el: "Greek",
en: "English",
"en-AU": "English (Australia)",
"en-CA": "English (Canada)",
"en-GB": "English (UK)",
"en-GB-oxendict": "English (UK Oxford)",
"en-US": "English (US)",
es: "Spanish",
"es-419": "Spanish (Latin America)",
"es-AR": "Spanish (Argentina)",
"es-ES": "Spanish (Spain)",
"es-MX": "Spanish (Mexico)",
"es-US": "Spanish (US)",
et: "Estonian",
fa: "Persian",
fo: "Faroese",
fr: "French",
"fr-FR": "French (France)",
he: "Hebrew",
hi: "Hindi",
hr: "Croatian",
hu: "Hungarian",
hy: "Armenian",
id: "Indonesian",
it: "Italian",
"it-IT": "Italian (Italy)",
ko: "Korean",
lt: "Lithuanian",
lv: "Latvian",
nb: "Norwegian Bokmål",
nl: "Dutch",
pl: "Polish",
pt: "Portuguese",
"pt-BR": "Portuguese (Brazil)",
"pt-PT": "Portuguese (Portugal)",
ro: "Romanian",
ru: "Russian",
sh: "Serbo-Croatian",
sk: "Slovak",
sl: "Slovenian",
sq: "Albanian",
sr: "Serbian",
sv: "Swedish",
ta: "Tamil",
tg: "Tajik",
tr: "Turkish",
uk: "Ukrainian",
vi: "Vietnamese"
};
type Language = { code: string; name: string };
export const spellCheckerRouter = t.router({
isEnabled: t.procedure.query(() => config.isSpellCheckerEnabled),
languages: t.procedure.query(
() =>
<Language[]>(
globalThis.window?.webContents.session.availableSpellCheckerLanguages.map(
(code) => ({
code,
name: LANGUAGES[code]
})
)
)
),
enabledLanguages: t.procedure.query(
() =>
<Language[]>(
globalThis.window?.webContents.session
.getSpellCheckerLanguages()
.map((code) => ({
code,
name: LANGUAGES[code]
}))
)
),
setLanguages: t.procedure
.input(z.array(z.string()))
.mutation(({ input: languages }) =>
globalThis.window?.webContents.session.setSpellCheckerLanguages(languages)
),
toggle: t.procedure
.input(z.boolean().optional())
.mutation(({ input: enabled }) => {
globalThis.window?.webContents.session.setSpellCheckerEnabled(!!enabled);
config.isSpellCheckerEnabled = !!enabled;
})
});

View File

@@ -0,0 +1,81 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { initTRPC } from "@trpc/server";
import { observable } from "@trpc/server/observable";
import { CancellationToken, autoUpdater } from "electron-updater";
import type { AppUpdaterEvents } from "electron-updater/out/AppUpdater";
import { z } from "zod";
import { config } from "../utils/config";
type UpdateInfo = { version: string };
type Progress = { percent: number };
const t = initTRPC.create();
export const updaterRouter = t.router({
autoUpdates: t.procedure.query(() => config.automaticUpdates),
install: t.procedure.query(() => autoUpdater.quitAndInstall()),
download: t.procedure.query(async () => {
const cancellationToken = new CancellationToken();
await autoUpdater.downloadUpdate(cancellationToken);
}),
check: t.procedure.query(async () => {
await autoUpdater.checkForUpdates();
}),
toggleAutoUpdates: t.procedure
.input(z.boolean().optional())
.mutation(({ input }) => {
config.automaticUpdates =
input === undefined ? !config.automaticUpdates : input;
}),
onChecking: createSubscription("checking-for-update"),
onDownloaded: createSubscription<"update-downloaded", UpdateInfo>(
"update-downloaded"
),
onDownloadProgress: createSubscription<"download-progress", Progress>(
"download-progress"
),
onNotAvailable: createSubscription<"update-not-available", UpdateInfo>(
"update-not-available"
),
onAvailable: createSubscription<"update-available", UpdateInfo>(
"update-available"
),
onError: createSubscription("error")
});
function createSubscription<
TName extends keyof AppUpdaterEvents,
TReturnType = Parameters<AppUpdaterEvents[TName]>[0]
>(eventName: TName) {
return t.procedure.subscription(() => {
return observable<TReturnType>((emit) => {
const listener: AppUpdaterEvents[TName] = (...args: any[]) => {
emit.next(args[0]);
};
autoUpdater.addListener(eventName, listener);
return () => {
autoUpdater.removeListener(eventName, listener);
};
});
});
}

84
apps/desktop/src/cli.ts Normal file
View File

@@ -0,0 +1,84 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
export type CLIOptions = {
note: boolean | string;
notebook: boolean | string;
reminder: boolean | string;
hidden: boolean;
};
export async function parseArguments(): Promise<CLIOptions> {
const result: CLIOptions = {
note: false,
notebook: false,
reminder: false,
hidden: false
};
const { hidden } = await yargs(hideBin(process.argv))
.boolean("hidden")
.command("new", "Create a new item", (yargs) => {
return yargs
.command("note", "Create a new note", {}, () => {
result.note = true;
})
.command("notebook", "Create a new notebook", {}, () => {
result.notebook = true;
})
.command("reminder", "Add a new reminder", {}, () => {
result.reminder = true;
});
})
.command("open", "Open a specific item", (yargs) => {
return yargs
.command(
"note",
"Open a note",
{ id: { string: true, description: "Id of the note" } },
(args) => {
result.note = args.id || false;
}
)
.command(
"notebook",
"Open a notebook",
{ id: { string: true, description: "Id of the notebook" } },
(args) => {
result.notebook = args.id || false;
}
)
.command(
"topic",
"Open a topic",
{
id: { string: true, description: "Id of the topic" },
notebookId: { string: true, description: "Id of the notebook" }
},
(args) => {
result.notebook = `${args.notebookId}/${args.id}`;
}
);
})
.parse();
result.hidden = hidden || false;
return result;
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
module.exports.PATHS = {
export const PATHS = {
backupsDirectory: "documents/Notesnook/backups",
logsDirectory: "logs/"
};

22
apps/desktop/src/index.ts Normal file
View File

@@ -0,0 +1,22 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export * from "./constants";
export type { AppRouter } from "./api";
export { type UpdateInfo } from "builder-util-runtime";

205
apps/desktop/src/main.ts Normal file
View File

@@ -0,0 +1,205 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { app, BrowserWindow, nativeTheme, session, shell } from "electron";
import { isDevelopment } from "./utils";
import { registerProtocol, PROTOCOL_URL } from "./utils/protocol";
import { configureAutoUpdater } from "./utils/autoupdater";
import { getBackgroundColor, getTheme, setTheme } from "./utils/theme";
import { setupMenu } from "./utils/menu";
import { WindowState } from "./utils/window-state";
import { AutoLaunch } from "./utils/autolaunch";
import { setupJumplist } from "./utils/jumplist";
import { setupTray } from "./utils/tray";
import { CLIOptions, parseArguments } from "./cli";
import { AssetManager } from "./utils/asset-manager";
import { createIPCHandler } from "electron-trpc/main";
import { router, api } from "./api";
import { config } from "./utils/config";
import path from "path";
if (process.platform == "win32" && process.env.PORTABLE_EXECUTABLE_DIR) {
console.log("Portable app: true");
const root = path.join(process.env.PORTABLE_EXECUTABLE_DIR, "Notesnook");
app.setPath("appData", path.join(root, "AppData"));
app.setPath("documents", path.join(root, "Documents"));
app.setPath("userData", path.join(root, "UserData"));
}
// only run a single instance
if (!MAC_APP_STORE && !app.requestSingleInstanceLock()) {
app.exit();
}
if (process.platform === "win32") {
app.setAppUserModelId(app.name);
}
app.commandLine.appendSwitch("lang", "en-US");
async function createWindow() {
const cliOptions = await parseArguments();
setTheme(getTheme());
const mainWindowState = new WindowState({});
const mainWindow = new BrowserWindow({
show: !cliOptions.hidden,
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
darkTheme: getTheme() === "dark",
backgroundColor: getBackgroundColor(),
opacity: 0,
autoHideMenuBar: true,
icon: AssetManager.appIcon({
size: 512,
format: process.platform === "win32" ? "ico" : "png"
}),
webPreferences: {
zoomFactor: config.zoomFactor,
nodeIntegration: true,
contextIsolation: false,
spellcheck: config.isSpellCheckerEnabled,
preload: __dirname + "/preload.js"
}
});
globalThis.window = mainWindow;
mainWindowState.manage(mainWindow);
if (cliOptions.hidden && !config.desktopSettings.minimizeToSystemTray)
mainWindow.minimize();
await mainWindow.webContents.loadURL(`${createURL(cliOptions, "/")}`);
mainWindow.setOpacity(1);
if (config.privacyMode) {
await api.integration.setPrivacyMode(config.privacyMode);
}
await AssetManager.loadIcons();
setupDesktopIntegration();
createIPCHandler({ router, windows: [mainWindow] });
mainWindow.webContents.session.setSpellCheckerDictionaryDownloadURL(
"http://dictionaries.notesnook.com/"
);
mainWindow.once("closed", () => {
globalThis.window = null;
});
setupMenu();
setupJumplist();
if (isDevelopment())
mainWindow.webContents.openDevTools({ mode: "right", activate: true });
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url);
return { action: "deny" };
});
nativeTheme.on("updated", () => {
setupTray();
setupJumplist();
});
}
app.once("ready", async () => {
console.info("App ready. Opening window.");
if (!isDevelopment()) registerProtocol();
await createWindow();
configureAutoUpdater();
});
app.once("window-all-closed", () => {
if (process.platform !== "darwin" || MAC_APP_STORE) {
app.quit();
}
});
app.on("activate", () => {
if (globalThis.window === null) {
createWindow();
}
});
function createURL(options: CLIOptions, path = "/") {
const url = new URL(isDevelopment() ? "http://localhost:3000" : PROTOCOL_URL);
url.pathname = path;
if (options.note === true) url.hash = "/notes/create/1";
else if (options.notebook === true) url.hash = "/notebooks/create";
else if (options.reminder === true) url.hash = "/reminders/create";
else if (typeof options.note === "string")
url.hash = `/notes/${options.note}/edit`;
else if (typeof options.notebook === "string")
url.hash = `/notebooks/${options.notebook}`;
return url;
}
function setupDesktopIntegration() {
const desktopIntegration = config.desktopSettings;
if (
desktopIntegration.closeToSystemTray ||
desktopIntegration.minimizeToSystemTray
) {
setupTray();
}
// when close to system tray is enabled, it becomes nigh impossible
// to "quit" the app. This is necessary in order to fix that.
if (desktopIntegration.closeToSystemTray) {
app.on("before-quit", () => app.exit(0));
}
globalThis.window?.once("close", (e) => {
if (config.desktopSettings.closeToSystemTray) {
e.preventDefault();
if (process.platform == "darwin") {
// on macOS window cannot be minimized/hidden if it is already fullscreen
// so we just close it.
if (globalThis.window?.isFullScreen()) app.exit(0);
else app.hide();
} else {
globalThis.window?.minimize();
globalThis.window?.hide();
}
}
});
globalThis.window?.on("minimize", () => {
if (config.desktopSettings.minimizeToSystemTray) {
if (process.platform == "darwin") {
app.hide();
} else {
globalThis.window?.hide();
}
}
});
if (desktopIntegration.autoStart) {
AutoLaunch.enable(!!desktopIntegration.startMinimized);
}
}

View File

@@ -0,0 +1,51 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* eslint-disable no-var */
import { ELECTRON_TRPC_CHANNEL } from "electron-trpc/main";
import { type RendererGlobalElectronTRPC } from "electron-trpc/src/types";
import type { NNCrypto } from "@notesnook/crypto";
import { ipcRenderer } from "electron";
import { platform } from "os";
declare global {
var os: () => "mas" | ReturnType<typeof platform>;
var electronTRPC: RendererGlobalElectronTRPC;
var NativeNNCrypto: (new () => NNCrypto) | undefined;
}
process.once("loaded", async () => {
console.log("HELLO!");
const electronTRPC: RendererGlobalElectronTRPC = {
sendMessage: (operation) =>
ipcRenderer.send(ELECTRON_TRPC_CHANNEL, operation),
onMessage: (callback) =>
ipcRenderer.on(ELECTRON_TRPC_CHANNEL, (_event, args) => callback(args))
};
globalThis.electronTRPC = electronTRPC;
});
globalThis.NativeNNCrypto =
process.platform === "win32" &&
process.arch !== "x64" &&
process.arch !== "ia32"
? undefined
: require("@notesnook/crypto").NNCrypto;
globalThis.os = () => (MAC_APP_STORE ? "mas" : platform());

View File

@@ -0,0 +1,117 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { NativeImage, nativeImage } from "electron";
import path from "path";
import { isDevelopment } from "./index";
import { parse, ParsedImage } from "icojs";
import { getSystemTheme } from "./theme";
import { readFile } from "fs/promises";
type Formats = "ico" | "png" | "icns";
type IconOptions<TFormat extends Formats> = {
size?: 16 | 22 | 24 | 32 | 48 | 64 | 128 | 256 | 512 | 1024;
format?: TFormat;
};
type IconNames = (typeof icons)[number];
type Prefixes = (typeof prefixes)[number];
type FlexibleIcon<TFormat extends Formats> = TFormat extends "ico"
? string
: NativeImage;
const RESOURCES_DIR = isDevelopment()
? process.cwd()
: process.platform === "darwin"
? path.normalize(path.join(path.dirname(process.execPath), "..", "Resources"))
: path.join(path.dirname(process.execPath), "resources");
const prefixes = ["", ".dark"];
const icons = [
"note-add",
"notebook-add",
"reminder-add",
"quit",
"tray-icon"
] as const;
const ALL_ICONS: {
id: IconNames;
prefix: Prefixes;
images: ParsedImage[];
}[] = [];
export class AssetManager {
static async loadIcons() {
if (ALL_ICONS.length) return;
for (const prefix of prefixes) {
for (const icon of icons) {
const icoPath = path.join(
RESOURCES_DIR,
"assets",
"icons",
`${icon}${prefix}.ico`
);
const icoBuffer = await readFile(icoPath);
const images = await parse(icoBuffer, "image/png");
ALL_ICONS.push({ id: icon, images, prefix });
}
}
}
static appIcon(options: IconOptions<Formats>) {
const { size = 32, format = "png" } = options;
if (format === "ico") return "assets\\icons\\app.ico";
if (format === "icns") return "assets/icons/app.icns";
return `assets/icons/${size}x${size}.png`;
}
static icon<TFormat extends Formats>(
name: IconNames,
options: IconOptions<TFormat>
): FlexibleIcon<TFormat> {
const { size = 16, format = "png" } = options;
const prefix: Prefixes = getSystemTheme() === "dark" ? ".dark" : "";
const icoPath = path.join(
RESOURCES_DIR,
"assets",
"icons",
`${name}${prefix}.ico`
);
if (format === "ico") return icoPath as FlexibleIcon<TFormat>;
const icon = ALL_ICONS.find((a) => a.id === name && a.prefix === prefix);
if (!icon)
return nativeImage.createFromPath(
AssetManager.appIcon(options)
) as FlexibleIcon<TFormat>;
return nativeImage.createFromBuffer(
Buffer.from(
(icon.images.find((i) => i.height === size) || icon.images[0]).buffer
)
) as FlexibleIcon<TFormat>;
}
}

View File

@@ -0,0 +1,70 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { app } from "electron";
import { existsSync, mkdirSync, rmSync, writeFileSync } from "fs";
import path from "path";
const LINUX_DESKTOP_ENTRY = (hidden: boolean) => `[Desktop Entry]
Type=Application
Version=${app.getVersion()}
Name=${app.getName()}
Comment=${app.getName()} startup script
Exec=${process.execPath}${hidden ? " --hidden" : ""}
StartupNotify=false
Terminal=false`;
const LINUX_AUTOSTART_DIRECTORY_PATH = path.join(
app.getPath("home"),
".config",
"autostart"
);
export class AutoLaunch {
static enable(hidden: boolean) {
if (process.platform === "linux") {
mkdirSync(LINUX_AUTOSTART_DIRECTORY_PATH, { recursive: true });
writeFileSync(
path.join(
LINUX_AUTOSTART_DIRECTORY_PATH,
`${app.getName().toLowerCase()}.desktop`
),
LINUX_DESKTOP_ENTRY(hidden)
);
} else {
app.setLoginItemSettings({
openAtLogin: true,
openAsHidden: hidden,
args: ["--hidden"]
});
}
}
static disable() {
if (process.platform === "linux") {
const desktopFilePath = path.join(
LINUX_AUTOSTART_DIRECTORY_PATH,
`${app.getName().toLowerCase()}.desktop`
);
if (!existsSync(desktopFilePath)) return;
rmSync(desktopFilePath);
} else {
app.setLoginItemSettings({ openAtLogin: false, openAsHidden: false });
}
}
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,20 +17,20 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import ThemeFactory from "./theme";
import { ThemeConfig } from "./theme/types";
import { injectCss } from "./css";
import { autoUpdater } from "electron-updater";
import { config } from "./config";
const factory = new ThemeFactory();
export function useTheme(config: ThemeConfig, inject = true) {
const { theme, accent } = config;
const themeProperties = factory.construct({
theme,
accent
async function configureAutoUpdater() {
autoUpdater.setFeedURL({
provider: "generic",
url: `https://notesnook.com/releases/${process.platform}/`,
useMultipleRangeRequest: false
});
if (inject) injectCss(factory.transform("css", themeProperties));
return themeProperties;
autoUpdater.autoDownload = config.automaticUpdates;
autoUpdater.allowDowngrade = false;
autoUpdater.allowPrerelease = false;
autoUpdater.autoInstallOnAppQuit = true;
}
export { configureAutoUpdater };

View File

@@ -0,0 +1,34 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { WindowState } from "./window-state";
export function bringToFront() {
if (!globalThis.window) return;
if (globalThis.window.isMinimized()) {
if (new WindowState({}).isMaximized) {
globalThis.window.maximize();
} else globalThis.window.restore();
}
globalThis.window.show();
globalThis.window.focus();
globalThis.window.moveTop();
globalThis.window.webContents.focus();
}

View File

@@ -0,0 +1,56 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { nativeTheme } from "electron";
import { JSONStorage } from "./json-storage";
import { z } from "zod";
export const DesktopIntegration = z.object({
autoStart: z.boolean().optional(),
startMinimized: z.boolean().optional(),
minimizeToSystemTray: z.boolean().optional(),
closeToSystemTray: z.boolean().optional()
});
export type DesktopIntegration = z.infer<typeof DesktopIntegration>;
export const config = {
desktopSettings: <DesktopIntegration>{
autoStart: false,
startMinimized: false,
minimizeToSystemTray: false,
closeToSystemTray: false
},
privacyMode: false,
isSpellCheckerEnabled: false,
zoomFactor: 0,
theme: nativeTheme.themeSource,
automaticUpdates: true
};
type ConfigKey = keyof typeof config;
for (const key in config) {
const defaultValue = config[<ConfigKey>key];
if (Object.hasOwn(config, key)) {
Object.defineProperty(config, key, {
get: () => JSONStorage.get(key, defaultValue),
set: (value) => JSONStorage.set(key, value)
});
}
}

View File

@@ -0,0 +1,31 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { app } from "electron";
import { existsSync } from "fs";
export function isDevelopment() {
return process.env.ELECTRON_IS_DEV
? Number.parseInt(process.env.ELECTRON_IS_DEV, 10) === 1
: !app.isPackaged;
}
export function isFlatpak() {
return existsSync("/.flatpak-info");
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,20 +17,20 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const fs = require("fs");
const { app } = require("electron");
const path = require("path");
import { readFileSync, writeFileSync } from "fs";
import { app } from "electron";
import { join } from "path";
const directory = app.getPath("userData");
const filename = "config.json";
const filePath = path.join(directory, filename);
const filePath = join(directory, filename);
class JSONStorage {
static get(key, def) {
static get<T>(key: string, def?: T): T {
const json = this.readJson();
return json[key] || def;
return json[key] === undefined ? def : json[key];
}
static set(key, value) {
static set(key: string, value: unknown) {
const json = this.readJson();
json[key] = value;
this.writeJson(json);
@@ -40,12 +40,9 @@ class JSONStorage {
this.writeJson({});
}
/**
* @private
*/
static readJson() {
private static readJson() {
try {
const json = fs.readFileSync(filePath, "utf-8");
const json = readFileSync(filePath, "utf-8");
return JSON.parse(json);
} catch (e) {
console.error(e);
@@ -53,15 +50,12 @@ class JSONStorage {
}
}
/**
* @private
*/
static writeJson(json) {
private static writeJson(json: Record<string, unknown>) {
try {
fs.writeFileSync(filePath, JSON.stringify(json));
writeFileSync(filePath, JSON.stringify(json));
} catch (e) {
console.error(e);
}
}
}
module.exports = JSONStorage;
export { JSONStorage };

View File

@@ -0,0 +1,99 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { app, Menu } from "electron";
import { AssetManager } from "./asset-manager";
import { bringToFront } from "./bring-to-front";
import { bridge } from "../api/bridge";
export function setupJumplist() {
if (process.platform === "win32") {
setJumplistOnWindows();
} else if (process.platform === "darwin") {
setDockMenuOnMacOs();
}
}
function setJumplistOnWindows() {
app.setJumpList([
{
type: "custom",
name: "Quick actions",
items: [
{
program: process.execPath,
iconIndex: 0,
iconPath: AssetManager.icon("note-add", { format: "ico" }),
args: "new note",
description: "Create a new note",
title: "New note",
type: "task"
},
{
program: process.execPath,
iconIndex: 0,
iconPath: AssetManager.icon("notebook-add", { format: "ico" }),
args: "new notebook",
description: "Create a new notebook",
title: "New notebook",
type: "task"
},
{
program: process.execPath,
iconIndex: 0,
iconPath: AssetManager.icon("reminder-add", { format: "ico" }),
args: "new reminder",
description: "Add a new reminder",
title: "New reminder",
type: "task"
}
]
}
]);
}
function setDockMenuOnMacOs() {
const contextMenu = Menu.buildFromTemplate([
{
label: "New note",
type: "normal",
click: () => {
bringToFront();
bridge.onCreateItem("note");
}
},
{
label: "New notebook",
type: "normal",
click: () => {
bringToFront();
bridge.onCreateItem("notebook");
}
},
{
label: "New reminder",
type: "normal",
click: () => {
bringToFront();
bridge.onCreateItem("reminder");
}
}
]);
app.dock.setMenu(contextMenu);
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,15 +17,54 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const { Menu, MenuItem, clipboard } = require("electron");
import { Menu, MenuItem, clipboard, shell } from "electron";
/**
*
* @param {import("@playwright/test").BrowserWindow} mainWindow
*/
function setupMenu(mainWindow) {
mainWindow.webContents.on("context-menu", (event, params) => {
function setupMenu() {
if (!globalThis.window) return;
globalThis.window.webContents.on("context-menu", (_event, params) => {
const menu = new Menu();
// Add each spelling suggestion
for (const suggestion of params.dictionarySuggestions) {
menu.append(
new MenuItem({
label: suggestion,
click: () =>
globalThis.window?.webContents.replaceMisspelling(suggestion)
})
);
}
// Allow users to add the misspelled word to the dictionary
if (params.misspelledWord) {
menu.append(
new MenuItem({
label: "Add to dictionary",
click: () =>
globalThis.window?.webContents.session.addWordToSpellCheckerDictionary(
params.misspelledWord
)
})
);
}
if (menu.items.length > 0)
menu.append(
new MenuItem({
type: "separator"
})
);
if (params.linkURL.length) {
menu.append(
new MenuItem({
label: "Open in browser",
click: () => shell.openExternal(params.linkURL)
})
);
}
if (params.isEditable) {
menu.append(
new MenuItem({
@@ -62,14 +101,35 @@ function setupMenu(mainWindow) {
})
);
menu.append(
new MenuItem({
label: "Copy",
role: "copy",
enabled: params.selectionText.length > 0,
accelerator: "CommandOrControl+C"
})
);
if (params.linkURL?.length) {
menu.append(
new MenuItem({
label: "Copy link",
click() {
clipboard.writeText(params.linkURL);
}
})
);
menu.append(
new MenuItem({
label: "Copy link text",
click() {
clipboard.writeText(params.linkText);
}
})
);
}
if (params.selectionText.length) {
menu.append(
new MenuItem({
label: "Copy",
role: "copy",
accelerator: "CommandOrControl+C"
})
);
}
if (params.isEditable)
menu.append(
@@ -81,29 +141,7 @@ function setupMenu(mainWindow) {
})
);
// Add each spelling suggestion
// for (const suggestion of params.dictionarySuggestions) {
// menu.append(
// new MenuItem({
// label: suggestion,
// click: () => mainWindow.webContents.replaceMisspelling(suggestion),
// })
// );
// }
// Allow users to add the misspelled word to the dictionary
// if (params.misspelledWord) {
// menu.append(
// new MenuItem({
// label: "Add to dictionary",
// click: () =>
// mainWindow.webContents.session.addWordToSpellCheckerDictionary(
// params.misspelledWord
// ),
// })
// );
// }
menu.popup();
if (menu.items.length > 0) menu.popup();
});
}
module.exports = { setupMenu };
export { setupMenu };

View File

@@ -0,0 +1,160 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { protocol, ProtocolRequest } from "electron";
import { isDevelopment } from "./index";
import { createReadStream } from "fs";
import { extname, normalize } from "path";
import { URL } from "url";
import fetch, { Response } from "node-fetch";
const BASE_PATH = isDevelopment() ? "../public" : "";
const HOSTNAME = `app.notesnook.com`;
const FILE_NOT_FOUND = -6;
const SCHEME = "https";
const extensionToMimeType: Record<string, string> = {
html: "text/html",
json: "application/json",
js: "application/javascript",
css: "text/css",
svg: "image/svg+xml",
png: "image/png"
};
function registerProtocol() {
const protocolInterceptionResult = protocol.interceptStreamProtocol(
SCHEME,
async (request, callback) => {
const url = new URL(request.url);
if (shouldInterceptRequest(url)) {
console.info("Intercepting request:", request.url);
const loadIndex = !extname(url.pathname);
const filePath = normalize(
`${__dirname}${
loadIndex
? `${BASE_PATH}/index.html`
: `${BASE_PATH}/${url.pathname}`
}`
);
if (!filePath) {
console.error("Local asset file not found at", filePath);
callback({ error: FILE_NOT_FOUND });
return;
}
const fileExtension = extname(filePath).replace(".", "");
const data = createReadStream(filePath);
callback({
data,
mimeType: extensionToMimeType[fileExtension]
});
} else {
let response: Response;
try {
const body = await getBody(request);
response = await fetch(request.url, {
...request,
body,
headers: {
...request.headers
// origin: `${PROTOCOL}://${HOSTNAME}/`
},
referrer: request.referrer,
redirect: "manual"
});
} catch (e) {
console.error(e);
console.error(`Error sending request to `, request.url, "Error: ", e);
callback({ statusCode: 400 });
return;
}
callback({
statusCode: response.status,
data: response.body || undefined,
headers: Object.fromEntries(response.headers.entries()),
mimeType: response.headers.get("Content-Type") || undefined
});
}
}
);
console.info(
`${SCHEME} protocol inteception ${
protocolInterceptionResult ? "successful" : "failed"
}.`
);
// protocol.handle(SCHEME, (request) => {
// const url = new URL(request.url);
// if (shouldInterceptRequest(url)) {
// console.info("Intercepting request:", request.url);
// const loadIndex = !extname(url.pathname);
// const absoluteFilePath = normalize(
// `${__dirname}${
// loadIndex ? `${BASE_PATH}/index.html` : `${BASE_PATH}/${url.pathname}`
// }`
// );
// const filePath = getPath(absoluteFilePath);
// if (!filePath) {
// console.error("Local asset file not found at", filePath);
// return new Response(undefined, {
// status: 404,
// statusText: "FILE_NOT_FOUND"
// });
// }
// const fileExtension = extname(filePath).replace(".", "");
// const data = createReadStream(filePath);
// return new Response(data, {
// headers: { "Content-Type": extensionToMimeType[fileExtension] }
// });
// } else {
// return net.fetch(request);
// }
// });
// console.info(`${SCHEME} protocol inteception "successful"`);
}
const bypassedRoutes: string[] = [];
function shouldInterceptRequest(url: URL) {
const shouldIntercept = url.hostname === HOSTNAME;
return shouldIntercept && !bypassedRoutes.includes(url.pathname);
}
const PROTOCOL_URL = `${SCHEME}://${HOSTNAME}/`;
export { registerProtocol, PROTOCOL_URL };
async function getBody(request: ProtocolRequest) {
const session = globalThis?.window?.webContents?.session;
const blobParts = [];
if (!request.uploadData || !request.uploadData.length) return null;
for (const data of request.uploadData) {
if (data.bytes) {
blobParts.push(new Uint8Array(data.bytes));
} else if (session && data.blobUUID) {
const buffer = await session.getBlobData(data.blobUUID);
if (!buffer) continue;
blobParts.push(new Uint8Array(buffer));
}
}
const blob = new Blob(blobParts);
return blob;
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,15 +17,21 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Placeholder from "./index";
import { app } from "electron";
import { isAbsolute, join } from "path";
function AttachmentsPlaceholder() {
return (
<Placeholder
id="attachments"
title="Your attachments"
text="You haven't attached any files yet."
/>
export function resolvePath(_path: string) {
if (isAbsolute(_path)) return _path;
return join(
..._path.split("/").map((segment) => {
let resolved = segment;
try {
resolved = app.getPath(resolved as any);
} catch (e) {
// ignore
}
return resolved;
})
);
}
export default AttachmentsPlaceholder;

View File

@@ -0,0 +1,75 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { nativeTheme } from "electron";
import { config } from "./config";
import { z } from "zod";
export const Theme = z.union([
z.literal("system"),
z.literal("light"),
z.literal("dark")
]);
export type Theme = z.infer<typeof Theme>;
function getTheme() {
return config.theme;
}
function setTheme(theme: Theme) {
changeTheme(theme);
if (globalThis.window)
globalThis.window.setBackgroundColor(getBackgroundColor());
config.theme = theme;
}
function getBackgroundColor() {
return nativeTheme.shouldUseDarkColors ? "#0f0f0f" : "#ffffff";
}
function getSystemTheme() {
const listeners = nativeTheme.rawListeners("updated");
nativeTheme.removeAllListeners("updated");
const oldThemeSource = nativeTheme.themeSource;
nativeTheme.themeSource = "system";
const currentTheme = nativeTheme.shouldUseDarkColors ? "dark" : "light";
nativeTheme.themeSource = oldThemeSource;
setTimeout(
() => listeners.forEach((a) => nativeTheme.addListener("updated", a)),
1000
);
return currentTheme;
}
export { getTheme, setTheme, getBackgroundColor, getSystemTheme };
function changeTheme(theme: Theme) {
const listeners = nativeTheme.rawListeners("updated");
nativeTheme.removeAllListeners("updated");
nativeTheme.themeSource = theme;
setTimeout(
() => listeners.forEach((a) => nativeTheme.addListener("updated", a)),
1000
);
}

View File

@@ -0,0 +1,91 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { app, Menu, Tray } from "electron";
import { AssetManager } from "./asset-manager";
import { isFlatpak } from "./index";
import { bringToFront } from "./bring-to-front";
import { bridge } from "../api/bridge";
let tray: Tray | undefined = undefined;
export function destroyTray() {
if (tray) tray.destroy();
}
export function setupTray() {
if (tray) tray.destroy();
const trayIconSize =
process.platform === "win32" || process.platform === "darwin" ? 16 : 32;
tray = new Tray(
AssetManager.icon("tray-icon", {
size: process.platform === "darwin" ? 22 : 32
})
);
const contextMenu = Menu.buildFromTemplate([
{
label: "Show app",
type: "normal",
icon: isFlatpak()
? undefined
: AssetManager.icon("tray-icon", { size: trayIconSize }),
click: bringToFront
},
{ type: "separator" },
{
label: "New note",
type: "normal",
icon: isFlatpak()
? undefined
: AssetManager.icon("note-add", { size: trayIconSize }),
click: () => {
bringToFront();
bridge.onCreateItem("note");
}
},
{
label: "New notebook",
type: "normal",
icon: isFlatpak()
? undefined
: AssetManager.icon("notebook-add", { size: trayIconSize }),
click: () => {
bringToFront();
bridge.onCreateItem("notebook");
}
},
{ type: "separator" },
{
label: "Quit",
icon: isFlatpak()
? undefined
: AssetManager.icon("quit", { size: trayIconSize }),
type: "normal",
click: () => {
app.exit(0);
}
}
]);
tray.on("double-click", bringToFront);
if (process.platform !== "darwin") tray.on("click", bringToFront);
tray.setToolTip("Notesnook");
tray.setContextMenu(contextMenu);
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,37 +17,64 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const JSONStorage = require("../jsonstorage");
const electron = require("electron");
const screen = electron.screen || electron.remote.screen;
import { JSONStorage } from "./json-storage";
import { screen as _screen, BrowserWindow } from "electron";
const screen = _screen;
class WindowState {
constructor(options) {
this.winRef = null;
type WindowStateOptions = {
storageKey: string;
maximize: boolean;
fullScreen: boolean;
defaultWidth: number;
defaultHeight: number;
};
type SerializableWindowState = {
x: number;
y: number;
width: number;
height: number;
displayBounds?: Electron.Rectangle;
isMaximized?: boolean;
isFullScreen?: boolean;
};
export class WindowState {
private readonly config: WindowStateOptions;
private state: SerializableWindowState;
private windowRef: BrowserWindow | undefined;
private readonly eventHandlingDelay = 1000;
private stateChangeTimer: NodeJS.Timeout | undefined;
constructor(options?: Partial<WindowStateOptions>) {
this.windowRef = undefined;
this.stateChangeTimer = undefined;
this.eventHandlingDelay = 100;
this.config = {
storageKey: "windowState",
maximize: true,
fullScreen: true,
defaultWidth: 1024,
defaultHeight: 700,
...options
};
// Load previous state
this.state = JSONStorage.get(this.config.storageKey, {});
const defaultState: SerializableWindowState = {
width: this.config.defaultWidth,
height: this.config.defaultHeight,
x: 0,
y: 0
};
this.state = JSONStorage.get<SerializableWindowState>(
this.config.storageKey,
defaultState
);
// Check state validity
this.validateState();
// Set state fallback values
this.state = {
width: this.config.defaultWidth || 800,
height: this.config.defaultHeight || 600,
...this.state
};
this.validateState(defaultState);
}
isNormal(win) {
isNormal(win: BrowserWindow) {
return !win.isMaximized() && !win.isMinimized() && !win.isFullScreen();
}
@@ -76,7 +103,9 @@ class WindowState {
};
}
windowWithinBounds(bounds) {
windowWithinBounds(bounds: Electron.Rectangle) {
if (!this.state) return false;
return (
this.state.x >= bounds.x &&
this.state.y >= bounds.y &&
@@ -97,12 +126,12 @@ class WindowState {
}
}
validateState() {
validateState(defaultState: SerializableWindowState) {
const isValid =
this.state &&
(this.hasBounds() || this.state.isMaximized || this.state.isFullScreen);
if (!isValid) {
this.state = null;
this.state = defaultState;
return;
}
@@ -111,8 +140,8 @@ class WindowState {
}
}
updateState(win) {
win = win || this.winRef;
updateState(win?: BrowserWindow) {
win = win || this.windowRef;
if (!win) {
return;
}
@@ -133,7 +162,7 @@ class WindowState {
}
}
saveState(win) {
saveState(win?: BrowserWindow) {
// Update window state only if it was provided
if (win) {
this.updateState(win);
@@ -145,9 +174,9 @@ class WindowState {
stateChangeHandler = () => {
// Handles both 'resize' and 'move'
clearTimeout(this.stateChangeTimer);
if (this.stateChangeTimer) clearTimeout(this.stateChangeTimer);
this.stateChangeTimer = setTimeout(
() => this.updateState(),
() => this.saveState(this.windowRef),
this.eventHandlingDelay
);
};
@@ -163,28 +192,28 @@ class WindowState {
this.saveState();
};
manage(win) {
manage(win: BrowserWindow) {
if (this.config.maximize && this.state.isMaximized) {
win.maximize();
}
if (this.config.fullScreen && this.state.isFullScreen) {
win.setFullScreen(true);
}
win.on("resize", this.stateChangeHandler);
win.on("move", this.stateChangeHandler);
win.on("resized", this.stateChangeHandler);
win.on("moved", this.stateChangeHandler);
win.on("close", this.closeHandler);
win.on("closed", this.closedHandler);
this.winRef = win;
this.windowRef = win;
}
unmanage() {
if (this.winRef) {
this.winRef.removeListener("resize", this.stateChangeHandler);
this.winRef.removeListener("move", this.stateChangeHandler);
clearTimeout(this.stateChangeTimer);
this.winRef.removeListener("close", this.closeHandler);
this.winRef.removeListener("closed", this.closedHandler);
this.winRef = null;
if (this.windowRef) {
this.windowRef.removeListener("resized", this.stateChangeHandler);
this.windowRef.removeListener("moved", this.stateChangeHandler);
if (this.stateChangeTimer) clearTimeout(this.stateChangeTimer);
this.windowRef.removeListener("close", this.closeHandler);
this.windowRef.removeListener("closed", this.closedHandler);
this.windowRef = undefined;
}
}
@@ -216,5 +245,3 @@ class WindowState {
return this.state.isFullScreen;
}
}
module.exports = WindowState;

View File

@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "./dist/",
"lib": ["ESNext"]
},
"include": ["src", "global.d.ts"]
}

View File

@@ -17,15 +17,6 @@ jobs:
with:
persist-credentials: false
- name: Setup npmrc
run: |
echo "registry=https://npm.pkg.github.com" > .npmrc
echo "@streetwriters:registry=https://npm.pkg.github.com" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{secrets.PACKAGES_TOKEN}}" >> .npmrc
- name: Setup yarnrc
run: echo "\"@streetwriters:registry\" \"https://npm.pkg.github.com\"" > .yarnrc
- uses: actions/setup-node@master
with:
node-version: "16"

View File

@@ -17,15 +17,6 @@ jobs:
with:
persist-credentials: false
- name: Setup npmrc
run: |
echo "registry=https://npm.pkg.github.com" > .npmrc
echo "@streetwriters:registry=https://npm.pkg.github.com" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{secrets.PACKAGES_TOKEN}}" >> .npmrc
- name: Setup yarnrc
run: echo "\"@streetwriters:registry\" \"https://npm.pkg.github.com\"" > .yarnrc
- uses: actions/setup-node@master
with:
node-version: "16"

View File

@@ -14,7 +14,9 @@ build_cache/
.yarnrc.yml
.yarn
*.log
.cxx/
*.keystore
!debug.keystore
# Xcode
#

View File

@@ -19,9 +19,9 @@
## Build instructions
> **Before you start it is recommended that you read [the contributing guidelines](/CONTRIBUTING.md).**
> **Before you start, it is recommended that you read [the contributing guidelines](/CONTRIBUTING.md).**
### Setting up development environment
### Setting up the development environment
Requirements:
@@ -57,7 +57,7 @@ npm install
### Running the app on Android
[Setup an Android emulator from Android Studio](https://developer.android.com/studio/run/managing-avds) if you haven't already and then run the following command to start the app in the Emulator:
[Setup an Android emulator from Android Studio](https://developer.android.com/studio/run/managing-avds) if you haven't already, and then run the following command to start the app in the Emulator:
```bash
npm run start:android
@@ -78,11 +78,11 @@ npm run start:ios
## Developer guide
> This project is in a transition state between Javascript & Typescript. We are gradually porting everything over to Typescript so if you can help with that, it'd be great!
> This project is in a transition state between Javascript & Typescript. We are gradually porting everything over to Typescript, so if you can help with that, it'd be great!
### The tech stack
We try to keep the stack as lean as possible
We try to keep the stack as lean as possible:
1. React Native
2. Typescript/Javascript
@@ -95,17 +95,17 @@ We try to keep the stack as lean as possible
The app codebase is distributed over two primary directories. `native/` and `app/`.
- `native/`: Includes `android/` and `ios/` folders and everything related to react native core functionality like bundling, development and packaging. Any react-native dependency that has native code i.e android & ios folders, is installed here.
- `native/`: Includes `android/` and `ios/` folders and everything related to react native core functionality like bundling, development, and packaging. Any react-native dependency with native code, i.e., android & ios folders, is installed here.
- `app/`: Includes all the app code other than the native part. All JS only dependencies are installed here.
- `components/`: Each component serves a specific purpose in the app UI, for example the `Paragraph` component is used to render paragraphs in the app and a `Header` component is used to render a `header` on all screens.
- `common/`: Features that have integral role in app functionality, for example, notesnook core is initialized here.
- `app/`: Includes all the app code other than the native part. All JS-only dependencies are installed here.
- `components/`: Each component serves a specific purpose in the app UI. For example, the `Paragraph` component is used to render paragraphs in the app, and a `Header` component is used to render a `header` on all screens.
- `common/`: Features that are integral to the app's functionality. For example, the notesnook core is initialized here.
- `hooks/`: Hooks for different app logic
- `navigation/`: Includes app navigation specific code. Here the app navigation, editor & side menu are rendered side by side in fluid tabs.
- `navigation/`: Includes app navigation-specific code. Here the app navigation, editor & side menu are rendered side by side in fluid tabs.
- `screens`: Navigator screens.
- `services`: Parts of code that do a specific function, for example, the `sync` service is responsibe for running Sync from anywhere in the app.
- `stores`: We use `zustand` for global state management in the app. There are multiple stores that provide the state for different parts of the app.
- `utils`: General purpose stuff such as constant values, utility functions etc.
- `services`: Parts of code that do a specific function. For example, the `sync` service runs Sync from anywhere in the app.
- `stores`: We use `zustand` for global state management in the app. Multiple stores provide the state for different parts of the app.
- `utils`: General purpose stuff such as constant values, utility functions, etc.
There are several other folders at the root:
@@ -115,11 +115,11 @@ There are several other folders at the root:
### Running the tests
When you are done making the required changes, you will need to run the tests to make sure you didn't break anything. We use Detox as the testing framework & the tests can be started as follows:
When you are done making the required changes, you must run the tests to ensure you didn't break anything. We use Detox as the testing framework & the tests can be started as follows:
### Android
To run the tests on android, you will need to create an emulator device on your system:
To run the tests on Android, you will need to create an emulator device on your system:
```
$ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_5_API_31 -d pixel --package "system-images;android-31;default;x86_64"
@@ -127,13 +127,13 @@ $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_5_API_31 -d pixel --packa
If you face problems, follow the detailed guide in [Detox documentation](https://wix.github.io/Detox/docs/introduction/android-dev-env). Keep the emulator name set to `Pixel_5_API_31`.
Once you have created an emulator device, build the android apks
Once you have created an emulator device, build the Android apks:
```
npm run build:android
```
Finally run the tests
Finally, run the tests:
```
npm run test:android
@@ -141,9 +141,9 @@ npm run test:android
### iOS
To run e2e tests on iOS simulator, you must be on a Mac with XCode installed.
To run e2e tests on the iOS simulator, you must be on a Mac with XCode installed.
First install [AppleSimulatorUtils](https://github.com/wix/AppleSimulatorUtils)
First, install [AppleSimulatorUtils](https://github.com/wix/AppleSimulatorUtils):
```
brew tap wix/brew
@@ -156,7 +156,7 @@ Now build the iOS app for testing:
npm run build:ios
```
Finally run the tests:
Finally, run the tests:
```
npm run test:ios

View File

@@ -3,6 +3,7 @@
*/
import "react-native";
import { it } from "@jest/globals";
// Note: test renderer must be required after react-native.
import renderer from "react-test-renderer";
import Heading from "../app/components/ui/typography/heading";

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,30 +16,37 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {
THEME_COMPATIBILITY_VERSION,
useThemeEngineStore
} from "@notesnook/theme";
import React, { useEffect } from "react";
import { View } from "react-native";
import "react-native-gesture-handler";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { SafeAreaProvider } from "react-native-safe-area-context";
import AppLockedOverlay from "./components/app-lock-overlay";
import { withErrorBoundry } from "./components/exception-handler";
import GlobalSafeAreaProvider from "./components/globalsafearea";
import Launcher from "./components/launcher";
import { useAppEvents } from "./hooks/use-app-events";
import { ApplicationHolder } from "./navigation";
import Notifications from "./services/notifications";
import SettingsService from "./services/settings";
import { TipManager } from "./services/tip-manager";
import { useThemeStore } from "./stores/use-theme-store";
import { useUserStore } from "./stores/use-user-store";
import { View } from "react-native";
import { themeTrpcClient } from "./screens/settings/theme-selector";
SettingsService.init();
SettingsService.checkOrientation();
const App = () => {
useAppEvents();
const init = useAppEvents();
useEffect(() => {
let { appLockMode } = SettingsService.get();
if (appLockMode && appLockMode !== "none") {
useUserStore.getState().setVerifyUser(true);
useUserStore.getState().lockApp(true);
}
init();
setTimeout(async () => {
SettingsService.onFirstLaunch();
await Notifications.get();
@@ -48,7 +55,10 @@ const App = () => {
}
TipManager.init();
}, 100);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
<View
style={{
@@ -77,10 +87,49 @@ const App = () => {
}}
>
<ApplicationHolder />
<Launcher />
</GestureHandlerRootView>
<AppLockedOverlay />
</View>
);
};
export default withErrorBoundry(App, "App");
export const withTheme = (Element) => {
return function AppWithThemeProvider() {
const [colorScheme, darkTheme, lightTheme] = useThemeStore((state) => [
state.colorScheme,
state.darkTheme,
state.lightTheme
]);
useEffect(() => {
const currentTheme = colorScheme === "dark" ? darkTheme : lightTheme;
if (!currentTheme) return;
themeTrpcClient.updateTheme
.query({
version: currentTheme.version,
compatibilityVersion: THEME_COMPATIBILITY_VERSION,
id: currentTheme.id
})
.then((theme) => {
if (theme) {
console.log(theme.version, "theme updated");
theme.colorScheme === "dark"
? useThemeStore.getState().setDarkTheme(theme)
: useThemeStore.getState().setLightTheme(theme);
}
})
.catch(console.log);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => {
useThemeEngineStore
.getState()
.setTheme(colorScheme === "dark" ? darkTheme : lightTheme);
}, [colorScheme, darkTheme, lightTheme]);
return <Element />;
};
};
export default withTheme(withErrorBoundry(App, "App"));

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,11 +21,18 @@ import { Platform } from "react-native";
import "react-native-get-random-values";
import * as Keychain from "react-native-keychain";
import { generateSecureRandom } from "react-native-securerandom";
import Sodium from "react-native-sodium";
import Sodium from "@ammarahmed/react-native-sodium";
import { MMKV } from "./mmkv";
const IOS_KEYCHAIN_ACCESS_GROUP = "group.org.streetwriters.notesnook";
const IOS_KEYCHAIN_SERVICE_NAME = "org.streetwriters.notesnook";
const IOS_KEYCHAIN_UPGRAGE_KEY = "keychain-ios:upgraded";
const KEYSTORE_CONFIG = Platform.select({
ios: {
accessible: Keychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY
accessible: Keychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
accessGroup: IOS_KEYCHAIN_ACCESS_GROUP,
service: IOS_KEYCHAIN_SERVICE_NAME
},
android: {}
});
@@ -39,12 +46,27 @@ export async function deriveCryptoKey(name, data) {
credentials.key,
KEYSTORE_CONFIG
);
MMKV.setBool(IOS_KEYCHAIN_UPGRAGE_KEY, true);
return credentials.key;
} catch (e) {
console.error(e);
}
}
async function upgradeIOSKeychain(username, password) {
if (Platform.OS !== "ios") return;
if (!MMKV.getBool(IOS_KEYCHAIN_UPGRAGE_KEY)) {
await Keychain.setInternetCredentials(
"notesnook",
username,
password,
KEYSTORE_CONFIG
);
console.log("IOS KEYCHAIN MIGRATION COMPLETED!");
MMKV.setBool(IOS_KEYCHAIN_UPGRAGE_KEY, true);
}
}
export async function getCryptoKey(_name) {
try {
if (await Keychain.hasInternetCredentials("notesnook")) {
@@ -52,6 +74,9 @@ export async function getCryptoKey(_name) {
"notesnook",
KEYSTORE_CONFIG
);
// upgrades ios keychain to use accessGroups
// so we have access to keychain in share extension.
await upgradeIOSKeychain(credentials.username, credentials.password);
return credentials.password;
} else {
return null;

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,8 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Database from "@notesnook/core/api/index";
import { database } from "@notesnook/common";
import { initalize, logger as dbLogger } from "@notesnook/core/logger";
import { Platform } from "react-native";
import { MMKVLoader } from "react-native-mmkv-storage";
@@ -25,51 +24,49 @@ import filesystem from "../filesystem";
import EventSource from "../../utils/sse/even-source-ios";
import AndroidEventSource from "../../utils/sse/event-source";
import Storage, { KV } from "./storage";
import * as Gzip from "react-native-gzip";
const LoggerStorage = new MMKVLoader()
.withInstanceID("notesnook_logs")
.initialize();
initalize(new KV(LoggerStorage));
database.host(
__DEV__
? {
API_HOST: "https://api.notesnook.com",
AUTH_HOST: "https://auth.streetwriters.co",
SSE_HOST: "https://events.streetwriters.co",
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
ISSUES_HOST: "https://issues.streetwriters.co"
// API_HOST: "http://192.168.8.101:5264",
// AUTH_HOST: "http://192.168.8.101:8264",
// SSE_HOST: "http://192.168.8.101:7264",
// SUBSCRIPTIONS_HOST: "http://192.168.8.101:9264",
// ISSUES_HOST: "http://192.168.8.101:2624"
}
: {
API_HOST: "https://api.notesnook.com",
AUTH_HOST: "https://auth.streetwriters.co",
SSE_HOST: "https://events.streetwriters.co",
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
ISSUES_HOST: "https://issues.streetwriters.co"
}
);
database.setup(
Storage,
Platform.OS === "ios" ? EventSource : AndroidEventSource,
filesystem,
{
compress: Gzip.deflate,
decompress: Gzip.inflate
}
);
initalize(new KV(LoggerStorage), true);
export const db = database;
export const DatabaseLogger = dbLogger;
/**
* @type {import("@notesnook/core/api/index").default}
*/
export var db = new Database(
Storage,
Platform.OS === "ios" ? EventSource : AndroidEventSource,
filesystem
);
db.host(
__DEV__
? {
API_HOST: "https://api.notesnook.com",
AUTH_HOST: "https://auth.streetwriters.co",
SSE_HOST: "https://events.streetwriters.co",
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
ISSUES_HOST: "https://issues.streetwriters.co"
// API_HOST: 'http://192.168.10.29:5264',
// AUTH_HOST: 'http://192.168.10.29:8264',
// SSE_HOST: 'http://192.168.10.29:7264',
// SUBSCRIPTIONS_HOST: 'http://192.168.10.29:9264',
// ISSUES_HOST: 'http://192.168.10.29:2624'
}
: {
API_HOST: "https://api.notesnook.com",
AUTH_HOST: "https://auth.streetwriters.co",
SSE_HOST: "https://events.streetwriters.co",
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
ISSUES_HOST: "https://issues.streetwriters.co"
}
);
export async function loadDatabase() {
// if (!DB) {
// let module = await import(/* webpackChunkName: "notes-core" */ 'notes-core/api/index');
// DB = module.default;
// }
// db = new DB(Storage, Platform.OS === 'ios' ? EventSource : AndroidEventSource, filesystem);
// if (DOMParser) {
// await DOMParser.prepare();
// }
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Platform } from "react-native";
import RNFetchBlob from "rn-fetch-blob";
import RNFetchBlob from "react-native-blob-util";
import {
decrypt,
deriveCryptoKey,

View File

@@ -0,0 +1,50 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Dimensions, Platform } from "react-native";
import ImageResizer from "@bam.tech/react-native-image-resizer";
import RNFetchBlob from "react-native-blob-util";
/**
* Scale down & compress images to screen width
* for loading in editor.
* @returns
*/
export async function compressToBase64(path, type) {
const { width, scale } = Dimensions.get("window");
const response = await ImageResizer.createResizedImage(
path,
width * scale,
9999,
type,
80,
0,
undefined,
true,
{
mode: "contain",
onlyScaleDown: true
}
);
const base64 = await RNFetchBlob.fs.readFile(
Platform.OS === "ios" ? response.uri?.replace("file://", "") : response.uri,
"base64"
);
RNFetchBlob.fs.unlink(path.replace("file://", "")).catch(console.log);
RNFetchBlob.fs.unlink(response.uri.replace("file://", "")).catch(console.log);
return base64;
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,19 +17,171 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Sodium from "@ammarahmed/react-native-sodium";
import {
getFileNameWithExtension,
isImage,
isDocument
} from "@notesnook/core/utils/filename";
import React from "react";
import { Platform } from "react-native";
import * as ScopedStorage from "react-native-scoped-storage";
import Sodium from "react-native-sodium";
import RNFetchBlob from "rn-fetch-blob";
import { subscribe, zip } from "react-native-zip-archive";
import RNFetchBlob from "react-native-blob-util";
import { ShareComponent } from "../../components/sheets/export-notes/share";
import { presentSheet, ToastEvent } from "../../services/event-manager";
import { ToastEvent, presentSheet } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { db } from "../database";
import Storage from "../database/storage";
import { cacheDir } from "./utils";
import { cacheDir, copyFileAsync, releasePermissions } from "./utils";
export default async function downloadAttachment(hash, global = true) {
export const FileDownloadStatus = {
Success: 1,
Fail: 0
};
/**
* Download all user's attachments
* @returns
*/
export function downloadAllAttachments() {
const attachments = db.attachments.all;
return downloadAttachments(attachments);
}
/**
* Downloads provided attachments to a .zip file
* on user's device.
* @param attachments
* @param onProgress
* @returns
*/
export async function downloadAttachments(
attachments,
onProgress,
canceled,
groupId
) {
if (!attachments || !attachments.length) return;
const result = new Map();
let outputFolder;
if (Platform.OS === "android") {
// Ask the user to select a directory to store the file
let file = await ScopedStorage.openDocumentTree(true);
outputFolder = file.uri;
if (!outputFolder) return;
} else {
outputFolder = await Storage.checkAndCreateDir("/downloads/");
}
// Create the folder to zip;
const zipSourceFolder = `${cacheDir}/notesnook-attachments`;
const zipOutputFile =
Platform.OS === "ios"
? `${outputFolder}/notesnook-attachments-${Date.now()}.zip`
: `${cacheDir}/notesnook-attachments.zip`;
if (await RNFetchBlob.fs.exists(zipSourceFolder))
await RNFetchBlob.fs.unlink(zipSourceFolder);
await RNFetchBlob.fs.mkdir(zipSourceFolder);
for (let i = 0; i < attachments.length; i++) {
let attachment = attachments[i];
const hash = attachment.metadata.hash;
try {
if (canceled.current) {
RNFetchBlob.fs.unlink(zipSourceFolder).catch(console.log);
return;
}
onProgress?.(
i + 1 / attachments.length,
`Downloading attachments (${i + 1}/${
attachments.length
})... Please wait`
);
// Download to cache
let uri = await downloadAttachment(hash, false, {
silent: true,
cache: true,
groupId: groupId
});
if (canceled.current) {
RNFetchBlob.fs.unlink(zipSourceFolder).catch(console.log);
return;
}
if (!uri) throw new Error("Failed to download file");
// Move file to the source folder we will zip eventually and rename the file to it's actual name.
const filePath = `${zipSourceFolder}/${attachment.metadata.filename}`;
await RNFetchBlob.fs.mv(`${cacheDir}/${uri}`, filePath);
result.set(hash, {
filename: attachment.metadata.filename,
status: FileDownloadStatus.Success
});
} catch (e) {
result.set(hash, {
filename: attachment.metadata.filename,
status: FileDownloadStatus.Fail,
reason: e
});
console.log("Error downloading attachment", e);
}
}
if (canceled.current) {
RNFetchBlob.fs.unlink(zipSourceFolder).catch(console.log);
return;
}
if (result?.size) {
let sub;
try {
onProgress?.(0, `Zipping... Please wait`);
// If all goes well, zip the notesnook-attachments folder in cache.
sub = subscribe(({ progress }) => {
onProgress(
progress,
`Saving zip file (${(progress * 100).toFixed(1)}%)... Please wait`
);
});
await zip(zipSourceFolder, zipOutputFile);
sub?.remove();
onProgress(1, `Saving zip file... Please wait`);
if (Platform.OS === "android") {
// Move the zip to user selected directory.
const file = await ScopedStorage.createFile(
outputFolder,
`notesnook-attachments-${Date.now()}.zip`,
"application/zip"
);
await copyFileAsync(`file://${zipOutputFile}`, file.uri);
}
onProgress?.(1, `Done`);
releasePermissions(outputFolder);
} catch (e) {
releasePermissions(outputFolder);
sub?.remove();
console.log("Error zipping attachments", e);
}
// Remove source & zip file from cache.
RNFetchBlob.fs.unlink(zipSourceFolder).catch(console.log);
if (Platform.OS === "android") {
RNFetchBlob.fs.unlink(zipOutputFile).catch(console.log);
}
}
return result;
}
export default async function downloadAttachment(
hash,
global = true,
options = {
silent: false,
cache: false,
throwError: false,
groupId: undefined
}
) {
let attachment = db.attachments.attachment(hash);
if (!attachment) {
console.log("attachment not found");
@@ -37,16 +189,23 @@ export default async function downloadAttachment(hash, global = true) {
}
let folder = {};
if (Platform.OS === "android") {
folder = await ScopedStorage.openDocumentTree();
if (!folder) return;
} else {
folder.uri = await Storage.checkAndCreateDir("/downloads/");
if (!options.cache) {
if (Platform.OS === "android") {
folder = await ScopedStorage.openDocumentTree();
if (!folder) return;
} else {
folder.uri = await Storage.checkAndCreateDir("/downloads/");
}
}
try {
await db.fs.downloadFile(
console.log(
"starting download attachment",
attachment.metadata.hash,
options.groupId
);
await db.fs.downloadFile(
options.groupId || attachment.metadata.hash,
attachment.metadata.hash
);
if (
@@ -54,6 +213,11 @@ export default async function downloadAttachment(hash, global = true) {
)
return;
let filename = getFileNameWithExtension(
attachment.metadata.filename,
attachment.metadata.type
);
let key = await db.attachments.decryptKey(attachment.key);
let info = {
iv: attachment.iv,
@@ -63,46 +227,51 @@ export default async function downloadAttachment(hash, global = true) {
hash: attachment.metadata.hash,
hashType: attachment.metadata.hashType,
mime: attachment.metadata.type,
fileName: attachment.metadata.filename,
uri: folder.uri,
fileName: options.cache ? undefined : filename,
uri: options.cache ? undefined : folder.uri,
chunkSize: attachment.chunkSize
};
let fileUri = await Sodium.decryptFile(key, info, false);
ToastEvent.show({
heading: "Download successful",
message: attachment.metadata.filename + " downloaded",
type: "success"
});
let fileUri = await Sodium.decryptFile(
key,
info,
options.cache ? "cache" : "file"
);
if (attachment.dateUploaded) {
if (!options.silent) {
ToastEvent.show({
heading: "Download successful",
message: filename + " downloaded",
type: "success"
});
}
if (
attachment.dateUploaded &&
!isImage(attachment.metadata?.type) &&
!isDocument(attachment.metadata?.type)
) {
RNFetchBlob.fs
.unlink(RNFetchBlob.fs.dirs.CacheDir + `/${attachment.metadata.hash}`)
.catch(console.log);
}
if (Platform.OS === "ios") {
fileUri = folder.uri + `/${attachment.metadata.filename}`;
if (Platform.OS === "ios" && !options.cache) {
fileUri = folder.uri + `/${filename}`;
}
if (!options.silent) {
presentSheet({
title: "File downloaded",
paragraph: `${filename} saved to ${
Platform.OS === "android"
? "selected path"
: "File Manager/Notesnook/downloads"
}`,
icon: "download",
context: global ? null : attachment.metadata.hash,
component: <ShareComponent uri={fileUri} name={filename} padding={12} />
});
}
console.log("saved file uri: ", fileUri);
presentSheet({
title: "File downloaded",
paragraph: `${attachment.metadata.filename} saved to ${
Platform.OS === "android"
? "selected path"
: "File Manager/Notesnook/downloads"
}`,
icon: "download",
context: global ? null : attachment.metadata.hash,
component: (
<ShareComponent
uri={fileUri}
name={attachment.metadata.filename}
padding={12}
/>
)
});
return fileUri;
} catch (e) {
console.log("download attachment error: ", e);
@@ -112,5 +281,8 @@ export default async function downloadAttachment(hash, global = true) {
.catch(console.log);
}
useAttachmentStore.getState().remove(attachment.metadata.hash);
if (options.throwError) {
throw e;
}
}
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import hosts from "@notesnook/core/utils/constants";
import NetInfo from "@react-native-community/netinfo";
import RNFetchBlob from "rn-fetch-blob";
import RNFetchBlob from "react-native-blob-util";
import { ToastEvent } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { db } from "../database";
@@ -46,6 +46,7 @@ export async function downloadFile(filename, data, cancelToken) {
if (!downloadUrl) throw new Error("Unable to resolve download url");
let totalSize = 0;
console.log("Download starting");
let request = RNFetchBlob.config({
path: path,
IOSBackgroundTask: true

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,23 +17,22 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {
checkAttachment, downloadFile,
getUploadedFileSize
} from "./download";
import { checkAttachment, downloadFile, getUploadedFileSize } from "./download";
import {
clearFileStorage,
deleteFile,
exists,
readEncrypted,
writeEncrypted
writeEncryptedBase64,
hashBase64
} from "./io";
import { uploadFile } from "./upload";
import { cancelable } from "./utils";
export default {
readEncrypted,
writeEncrypted,
writeEncryptedBase64,
hashBase64,
uploadFile: cancelable(uploadFile),
downloadFile: cancelable(downloadFile),
deleteFile,

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