Compare commits

...

1897 Commits

Author SHA1 Message Date
Muhammad Ali
3750dd38dc editor: fix some math glyps not rendering correctly (#6762) 2024-10-24 11:47:13 +05:00
Ammar Ahmed
1506cc257d intl: update locale 2024-10-19 14:05:18 +05:00
Ammar Ahmed
fe7c7889e8 mobile: fix file upload checks 2024-10-19 14:05:04 +05:00
Ammar Ahmed
3f54eee11d mobile: fix localization 2024-10-19 14:04:16 +05:00
Ammar Ahmed
11b5922c2c mobile: use pseudo-LOCALE in debug 2024-10-19 11:49:53 +05:00
Ammar Ahmed
71b85d2a4d intl: fix strings 2024-10-19 11:46:50 +05:00
Ammar Ahmed
289832d166 mobile: wrap script manager in try/catch 2024-10-19 11:08:53 +05:00
Ammar Ahmed
a88e612c35 editor: fix table popup ui on mobile 2024-10-17 13:44:16 +05:00
Ammar Ahmed
bda456362b mobile: fix cache dir does not exist error on bulkExist check 2024-10-17 12:02:00 +05:00
Abdullah Atta
f6f644c55d editor: fix queueMicrotask causing hang 2024-10-17 11:13:05 +05:00
Ammar Ahmed
08c92333d6 global: fix discord community url in github issue templates
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-10-17 11:11:01 +05:00
Muhammad Ali
4d72b77f29 web: fix right side panel of settings is not scrollable (#6716) 2024-10-17 11:08:46 +05:00
Ammar Ahmed
4f9d06737f mobile: fix repack not loading async chunks 2024-10-16 16:03:47 +05:00
Ammar Ahmed
bfc494a3d4 mobile: fix copy/share buttons get stuck sometimes with no error thrown (#6708)
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-10-16 16:03:08 +05:00
Muhammad Ali
e3b004d35f docs: add help for app lock (#6703) 2024-10-16 11:07:01 +05:00
Ammar Ahmed
bd05ad6548 mobile: fix single file export on ios 2024-10-14 12:59:45 +05:00
Ammar Ahmed
ffe068dbd5 global: fix localization 2024-10-14 12:55:08 +05:00
Abdullah Atta
b1f21c1abe desktop: fix type errors importing @notesnook/intl 2024-10-14 11:35:05 +05:00
Abdullah Atta
b494efb8ce web: fix cannot read property instance of undefined 2024-10-14 11:35:05 +05:00
Ammar Ahmed
99ec45ec2a web: fix google-keep importer link 2024-10-14 09:46:11 +05:00
Abdullah Atta
9cea027506 monograph: use top-level await to initialize svg2png-wasm 2024-10-11 09:54:12 +05:00
Abdullah Atta
8bfc158c51 monograph: fix Already initialized. The initialize function can be used only once. 2024-10-11 09:42:52 +05:00
Abdullah Atta
d6ed99282d monograph: only check for success if an object in kv 2024-10-10 23:27:02 +05:00
Abdullah Atta
ac92f3685f monograph: add /api/og endpoint redirection for old og links 2024-10-10 23:16:43 +05:00
Abdullah Atta
05fea49baf monograph: fix kv read not working 2024-10-10 22:55:30 +05:00
Abdullah Atta
ed16143a2c monograph: fix Use yyyy instead of YYYY`` 2024-10-10 16:00:11 +05:00
Abdullah Atta
6618a21a63 monograph: add more meta tags and social image 2024-10-10 15:54:27 +05:00
Abdullah Atta
5b472748a1 monograph: fix uncolored text on initial load 2024-10-10 14:25:11 +05:00
Abdullah Atta
a117aab558 monograph: add missing links in buttons on landing page 2024-10-10 14:14:33 +05:00
Abdullah Atta
ad2ab03be7 monograph: fix og image url on landing page 2024-10-10 14:08:56 +05:00
Abdullah Atta
514112c077 ci: use latest tag when publishing monograph 2024-10-10 13:10:07 +05:00
Abdullah Atta
6dd939af5b monograph: add health check endpoint 2024-10-10 13:09:53 +05:00
Abdullah Atta
82f9c907be ci: disable qemu for monograph build 2024-10-10 12:50:28 +05:00
Abdullah Atta
3cd6c6a371 intl: use pseudo locale in development 2024-10-10 12:35:58 +05:00
Abdullah Atta
8437394891 intl: add more strings 2024-10-10 12:35:58 +05:00
Abdullah Atta
29cb444746 web: fix ui for longer language strings 2024-10-10 12:35:58 +05:00
Abdullah Atta
41eb22b5ca desktop: use strings from @notesnook/intl 2024-10-10 12:35:58 +05:00
Abdullah Atta
8577c32c1f editor: use strings from @notesnook/intl 2024-10-10 12:35:58 +05:00
Abdullah Atta
3e55492318 web: use strings from @notesnook/intl in more places 2024-10-10 12:35:58 +05:00
Abdullah Atta
bb53b0167b mobile: fix typo 2024-10-10 12:35:58 +05:00
Abdullah Atta
ec07c402c9 intl: add new strings 2024-10-10 12:35:58 +05:00
Abdullah Atta
cb50bccbeb intl: use vite for building 2024-10-10 12:35:58 +05:00
Ammar Ahmed
bf7c7ebc82 mobile: fix build 2024-10-10 12:35:58 +05:00
Ammar Ahmed
1184c9f506 web: localize 2024-10-10 12:35:58 +05:00
Ammar Ahmed
f781aaa6f5 web: localize 2024-10-10 12:35:58 +05:00
Ammar Ahmed
e78b245eea web: localize 2024-10-10 12:35:58 +05:00
Ammar Ahmed
bb1ec22197 intl: update strings 2024-10-10 12:35:58 +05:00
Ammar Ahmed
1fff0f6a1c web: localize 2024-10-10 12:35:58 +05:00
Ammar Ahmed
d28d34fad1 mobile: add missing localizations 2024-10-10 12:35:58 +05:00
Ammar Ahmed
40ae83dcad mobile: localize 2024-10-10 12:35:58 +05:00
Ammar Ahmed
0a18f43d95 mobile: localize new strings 2024-10-10 12:35:58 +05:00
Ammar Ahmed
c639bfb227 mobile: fix localize errors 2024-10-10 12:35:58 +05:00
Ammar Ahmed
014866c330 mobile: localize 2024-10-10 12:35:58 +05:00
Ammar Ahmed
dfe7b2e4a6 mobile: localize 2024-10-10 12:35:58 +05:00
Ammar Ahmed
f371c05446 mobile: localize 2024-10-10 12:35:58 +05:00
Ammar Ahmed
d31f6688f8 mobile: migrate more strings 2024-10-10 12:35:58 +05:00
Ammar Ahmed
3e5b740ef0 mobile: migrate app to intl 2024-10-10 12:35:58 +05:00
Ammar Ahmed
f282265fbb intl: initial setup 2024-10-10 12:35:58 +05:00
Abdullah Atta
05df9b77ed ci: add monograph publishing workflow 2024-10-02 15:27:24 +05:00
Abdullah Atta
69ba20009c monograph: add support for self hosting 2024-10-02 15:27:24 +05:00
Abdullah Atta
9bf490bcb4 monograph: use public url 2024-10-02 15:27:24 +05:00
Abdullah Atta
5a40080347 monograph: publish source code 2024-10-02 15:27:24 +05:00
Abdullah Atta
f42155ca5d core: use math.random instead of crypto random in object-id 2024-10-01 16:17:36 +05:00
Abdullah Atta
3b06450113 editor: fix @emotion/react version 2024-10-01 16:16:43 +05:00
Abdullah Atta
2fb3c3a02b ui: get rid of @mdi/react 2024-10-01 16:15:53 +05:00
Abdullah Atta
c8648659c7 theme: add support for setting default theme via global variable 2024-10-01 16:13:35 +05:00
Abdullah Atta
83a663da2b editor: render react widgets inside queueMicrotask 2024-10-01 16:13:06 +05:00
Abdullah Atta
5f0d14f01c web: fix motion.create is not a function 2024-09-25 14:41:25 +05:00
Ammar Ahmed
069ec39de8 mobile: fix foreground service permission type 2024-09-25 14:20:02 +05:00
Ammar Ahmed
bef06a2a20 mobile: change foreground service type to dataSync 2024-09-25 12:44:17 +05:00
Ammar Ahmed
1a98fb8996 mobile: release v3.0.18 2024-09-25 11:02:09 +05:00
Abdullah Atta
dc15bf75c6 editor: fix framer-motion deprecation warning 2024-09-25 10:55:55 +05:00
Abdullah Atta
7357422053 web: bump version to 3.0.18 2024-09-25 10:53:58 +05:00
Abdullah Atta
7918c089d3 desktop: update packages and electron 2024-09-25 10:53:30 +05:00
Ammar Ahmed
ba50b75c54 mobile: fix download file overwrite error 2024-09-25 10:43:26 +05:00
Ammar Ahmed
0d7f32bdd0 mobile: fix attachment recheck ui 2024-09-25 10:39:51 +05:00
Ammar Ahmed
8251e9437b mobile: scope recheck state to current note 2024-09-25 10:39:51 +05:00
Ammar Ahmed
416d5aef90 mobile: progress for note attachments 2024-09-25 10:39:51 +05:00
Abdullah Atta
edb2e3a0ed web: add a couple more tests for basic plan 2024-09-25 10:00:37 +05:00
Abdullah Atta
64031a7814 web: handle errors during tag/color edit 2024-09-24 14:00:32 +05:00
Abdullah Atta
1bd3c3d0f4 web: change module resolution to Bundler 2024-09-24 13:44:44 +05:00
Abdullah Atta
21b6fc4982 editor: export tool definitions and other utils independently 2024-09-24 13:44:31 +05:00
Abdullah Atta
b881023e7b core: update @streetwriters/showdown 2024-09-24 13:25:37 +05:00
Abdullah Atta
6387156596 common: retain original error stack during export 2024-09-24 13:25:37 +05:00
Abdullah Atta
2b2cfe9d33 web: do not zip note without attachments on export 2024-09-24 13:25:37 +05:00
Ammar Ahmed
e81580024e mobile: fix build failing 2024-09-24 13:14:35 +05:00
Ammar Ahmed
8b207b47dd mobile: fix app state 2024-09-24 13:14:34 +05:00
Ammar Ahmed
15aab4ec29 mobile: fix attachments progress 2024-09-24 13:14:34 +05:00
Ammar Ahmed
bdb0474645 editor: fix paragraph not inserted at the end of some nodes 2024-09-24 13:14:34 +05:00
Abdullah Atta
8d25d03390 web: update note export test snapshots 2024-09-24 12:28:02 +05:00
Abdullah Atta
ea2c7d2ea9 web: make markdown rendered container a div instead of span 2024-09-24 12:26:28 +05:00
theProton
0ff38c7ca3 web: fix text rendering in bug report confirmation dialog (#6573)
Signed-off-by: parthiv-m <parthivmenon.dev@gmail.com>
Co-authored-by: Abdullah Atta <thecodrr@protonmail.com>
2024-09-24 12:25:23 +05:00
Abdullah Atta
595f2e9ba7 web: do not ask for confirmation when deleting a single tag 2024-09-24 12:19:39 +05:00
Abdullah Atta
b02bf3d4ad web: update failing tests snapshots 2024-09-24 12:19:25 +05:00
Abdullah Atta
1e295d8562 web: fix reminder cron expression validation 2024-09-24 12:19:12 +05:00
Abdullah Atta
27a0aeb170 web: fix found 0 byte sized chunk error on attaching files 2024-09-23 19:30:40 +05:00
Abdullah Atta
7e355c3ecb crypto: @notesnook/sodium no longer requires top-level await 2024-09-23 19:30:18 +05:00
Abdullah Atta
69468487c2 core: note title reset on updating a note 2024-09-23 17:26:50 +05:00
Abdullah Atta
0809b5b701 web: fix rotate direction of update check icon 2024-09-23 16:12:12 +05:00
Muhammad Ali
171f28f7c0 web: fix markdown shortcuts toggle reset on app restart (#6555) 2024-09-23 16:09:32 +05:00
Abdullah Atta
0a2af0ec7d global: publish packages 2024-09-23 15:47:09 +05:00
Abdullah Atta
c53354c368 editor: create languages directory if it doesn't exist 2024-09-23 15:46:22 +05:00
Abdullah Atta
be414f869c common: use local @notesnook/core package 2024-09-23 15:42:22 +05:00
Abdullah Atta
de40285e21 core: create languages directory if it doesn't exist 2024-09-23 15:37:58 +05:00
Abdullah Atta
a7fa0bde00 global: publish packages 2024-09-23 15:32:14 +05:00
Abdullah Atta
19c2d2007f core: fix imports in tests 2024-09-23 15:32:13 +05:00
Abdullah Atta
ecc9736b90 global: use tsup for bundling packages 2024-09-23 15:32:13 +05:00
Abdullah Atta
ffd022cfa6 mobile: fix imports 2024-09-23 15:32:13 +05:00
Abdullah Atta
89aba00aac web: fix imports 2024-09-23 15:32:13 +05:00
Abdullah Atta
bcc739aa57 setup: improve publish script 2024-09-23 15:32:13 +05:00
Abdullah Atta
fc1015b3fb setup: increase cleanup script concurrency 2024-09-23 15:32:13 +05:00
Abdullah Atta
f1fa32c7f5 ui: fix element type is invalid error when using icon 2024-09-23 15:32:13 +05:00
Abdullah Atta
a1e794c583 editor(mobile): fix imports and make build cross platform 2024-09-23 15:32:13 +05:00
Abdullah Atta
c787ef29d6 editor: include esm & cjs variants in build 2024-09-23 15:32:13 +05:00
Abdullah Atta
7c257cfbd2 editor: import & use language grammars from refractor directly 2024-09-23 15:32:13 +05:00
Abdullah Atta
99c77e6c5f editor: fix crash when inserting a code block 2024-09-23 15:32:12 +05:00
Abdullah Atta
f060c65bd5 editor: make imports esm compatible 2024-09-23 15:32:12 +05:00
Abdullah Atta
22559cdf42 common: include esm and cjs variants in build 2024-09-23 15:32:12 +05:00
Abdullah Atta
1fb86cb27b common: make imports esm compatible 2024-09-23 15:32:12 +05:00
Abdullah Atta
7f31066e8f core: include cjs and esm variants in build 2024-09-23 15:32:12 +05:00
Abdullah Atta
50e418dc53 core: use language grammars directly from refractor 2024-09-23 15:32:12 +05:00
Abdullah Atta
59739067b6 core: make imports compatible with esm 2024-09-23 15:32:12 +05:00
Abdullah Atta
f100e157d3 server(themes): upgrade @trpc/server 2024-09-23 15:32:11 +05:00
Abdullah Atta
870ce259f0 theme: include both esm and cjs variants in build 2024-09-23 15:32:11 +05:00
Abdullah Atta
95b50eb5ca theme: make imports esm compatible 2024-09-23 15:32:11 +05:00
Abdullah Atta
f243d13b81 ui: include both esm and cjs variants in build 2024-09-23 15:32:11 +05:00
Abdullah Atta
749a13efbc ui: make imports esm compatible 2024-09-23 15:32:11 +05:00
Abdullah Atta
275d5d7f04 fs: include both esm and cjs variants in build 2024-09-23 15:32:11 +05:00
Abdullah Atta
54de071e85 fs: make imports esm compatible 2024-09-23 15:32:11 +05:00
Abdullah Atta
9647e2513b crypto(sodium): include both esm and cjs variants in build 2024-09-23 15:32:11 +05:00
Abdullah Atta
239781eabd crypto: make imports esm compatible 2024-09-23 15:32:11 +05:00
Abdullah Atta
21573d6cc8 logger: include both esm and cjs variants in build 2024-09-23 15:32:11 +05:00
Abdullah Atta
9b091f0bb0 logger: make imports esm compatible 2024-09-23 15:32:11 +05:00
Abdullah Atta
e0beef745e crypto: include both esm & cjs variants in build 2024-09-23 15:32:11 +05:00
Abdullah Atta
2f2653d223 crypto: make imports esm compatible 2024-09-23 15:32:11 +05:00
Abdullah Atta
7458aa53ae clipper: make imports esm compatible 2024-09-23 15:32:11 +05:00
Ammar Ahmed
f7db306c26 mobile: fix showing toast at bottom always 2024-09-23 13:47:58 +05:00
Ammar Ahmed
7e8d6f2041 mobile: make sure toast moves with keyboard 2024-09-23 13:47:58 +05:00
Ammar Ahmed
d424a6c48f mobile: fix size of text in toast 2024-09-23 13:47:58 +05:00
Ammar Ahmed
7293224514 mobile: fix toast ui in diff cond 2024-09-23 13:47:58 +05:00
Ammar Ahmed
7706cfed9a mobile: new toast 2024-09-23 13:47:58 +05:00
Ammar Ahmed
bbfe0b237d editor: fix duplicate block-id when pasting content from note 2024-09-23 12:49:08 +05:00
Ammar Ahmed
2c7cddd853 mobile: do not zip note without attachments 2024-09-23 12:48:17 +05:00
Ammar Ahmed
37c1d39c41 mobile: fix statusbar flicker on launch app 2024-09-23 12:47:39 +05:00
Ammar Ahmed
5d4960a26f mobile: fix foregroundServiceType 2024-09-23 12:12:09 +05:00
Ammar Ahmed
78f07b23df mobile: fix boot service crash on boot 2024-09-23 12:12:09 +05:00
Ammar Ahmed
7aeb047b50 mobile: improve attachments manager 2024-09-23 12:11:26 +05:00
Abdullah Atta
0e3a661dd0 desktop: delete app data on uninstall (fixes #5209) 2024-09-16 14:25:50 +05:00
Abdullah Atta
fba350ed1e editor: refactor toggleCodeBlock 2024-09-16 12:34:25 +05:00
Sean-Wyn Ng
76bfbc7316 desktop: fix issues with codeblock toggling (#6435)
Signed-off-by: Sean-Wyn Ng <seanwynng@gmail.com>
Co-authored-by: seanwynwins <shidderwinsgit.hcma2@slmail.me>
2024-09-16 12:26:20 +05:00
Abdullah Atta
7683d8fa5b core: fix crash when searching 2024-09-16 11:49:49 +05:00
Abdullah Atta
3fe5352b56 core: resort date formats and add DD.MM.YYYY format (fixes #4744) 2024-09-13 15:39:09 +05:00
Abdullah Atta
a86d9a9c0c web: default notebook always assigned to note (fixes #5861) 2024-09-13 14:35:38 +05:00
Ammar Ahmed
a68f74bc1b core: fix locking notes with empty content (#6545)
* core: fix locking notes with empty content

* core: lock note and return if rawContent already locked

* core: update comment

* core: allow locking an empty note

* core: updates

* core: updates

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-09-13 12:18:55 +05:00
Muhammad Ali
18310698f6 editor: add ctrl+k to create link shortcut (#3501)
* editor: added link pop-up keyboard short-cut

* editor: Ctrl+K to create link

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-09-13 11:10:50 +05:00
Abdullah Atta
020244231f desktop: update electron to v30 (#6498) 2024-09-13 08:39:18 +05:00
Abdullah Atta
59085d7b19 editor: update packages 2024-09-13 08:37:03 +05:00
Muhammad Ali
c15410e168 editor: press enter in link popup to insert link (#4423)
* editor: added shortcut key for link-popup completion.

* editor: remove commented out code

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-09-12 15:46:26 +05:00
Muhammad Ali
2962f13457 editor: exit a link by pressing space (#3122)
* editor: added keyboard shortcut for handling space

* editor: simplify

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-09-12 15:06:13 +05:00
Muhammad Ali
bfc77fc9a4 web: add delete key shortcut for deleting items (#1655)
* web: added delete key short cut for trashing notes

* web: added del key shortcut for tags, topics,trash, reminders, attachments

* web: handle delete key in sub notebooks

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-09-12 14:55:04 +05:00
Abdullah Atta
7e88ec88ee core: search query should be AND by default instead of OR 2024-09-12 12:54:16 +05:00
Abdullah Atta
9ef07f22af core: ignore diacritics when searching (requires rebuilding search index) 2024-09-12 12:54:16 +05:00
Ammar Ahmed
268343be3e mobile: fix android crash when app removed from recents 2024-09-12 11:40:16 +05:00
Abdullah Atta
956e5373d1 web: ignore Error in input stream global error 2024-09-11 20:45:57 +05:00
Abdullah Atta
919fa9bdf1 web: fix invalid filename when saving recovery key (fixes #6436) 2024-09-11 15:04:31 +05:00
Abdullah Atta
e06192c5b4 core: update @streetwriters/showdown (fixes #4470) 2024-09-11 14:59:07 +05:00
Ammar Ahmed
b5be5e0b59 mobile: fix itemExists error 2024-09-11 14:12:56 +05:00
Abdullah Atta
05695cfcc8 web: add menu items to open, view & unpublish a monograph (fixes #4812) 2024-09-11 13:56:18 +05:00
Abdullah Atta
423e1c6816 web: update features list (fixes #6514) 2024-09-11 13:33:35 +05:00
Ammar Ahmed
6db1cf5cc1 clipper: add images only for pro users (#6528) 2024-09-11 13:26:57 +05:00
Ammar Ahmed
2e4a87abd9 core: fix export title has appended Notesnook to end (#6529) 2024-09-11 13:26:20 +05:00
Ammar Ahmed
c26988134f editor: fix heading and p gap (#6530)
* editor: fix heading and p gap

* Update packages/editor/styles/styles.css

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

---------

Signed-off-by: Abdullah Atta <thecodrr@protonmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-09-11 13:24:58 +05:00
Abdullah Atta
bcffdd0f91 editor: improve toolbar popup controls 2024-09-11 13:22:53 +05:00
Abdullah Atta
de1051d52d editor: remove unnecessary useMemo dependency 2024-09-11 13:22:53 +05:00
Abdullah Atta
b1a360e445 editor: add more neutral default colors for highlight 2024-09-11 13:22:53 +05:00
Abdullah Atta
49e85dfa87 editor: position color picker according to mouse position 2024-09-11 13:22:53 +05:00
Abdullah Atta
452ff12071 editor: use ref instead of document.getElementById 2024-09-11 13:22:53 +05:00
Muhammad Ali
1b6fc40633 editor: fix input is not editable in color picker 2024-09-11 13:22:53 +05:00
Ammar Ahmed
82b28f8263 mobile: fix pricingPhases undefined error 2024-09-10 14:02:41 +05:00
Abdullah Atta
6e47eae30a web: fix error when registering task with invalid time (fixes #4890) 2024-09-10 09:41:16 +05:00
Abdullah Atta
4040f2ecc4 common: fix notes with empty title exporting with empty filename (fixes #6088) 2024-09-10 09:36:55 +05:00
Abdullah Atta
2293866c61 core: fix note title can be set to empty 2024-09-10 09:27:38 +05:00
Ammar Ahmed
2cb4a10076 clipper: add safe querySelector method 2024-09-09 14:57:49 +05:00
Abdullah Atta
2f7b8d3377 web: add clear instructions on how to import from other apps 2024-09-09 13:14:17 +05:00
Abdullah Atta
983220b2f2 web: add support for importing nested notebooks 2024-09-09 13:13:46 +05:00
Ammar Ahmed
ca2848e491 mobile: release v3.0.17 2024-09-06 12:58:36 +05:00
Ammar Ahmed
48e5c4d908 mobile: fix crash in background on boot 2024-09-06 12:33:34 +05:00
Ammar Ahmed
5774dd8c60 mobile: fix crash on opening app from tile 2024-09-06 12:33:00 +05:00
Steve Divskinsy
9d65184f42 docs(help): Fix typo in is-there-an-eta.md
docs(help): Fix typo in is-there-an-eta.md - unnecessary was incorrectly spelled

Signed-off-by: Stephen Argent <stevesbrain@users.noreply.github.com>

Signed-off-by: Steve Divskinsy <stevesbrain@users.noreply.github.com>
2024-09-05 20:10:54 +05:00
Abdullah Atta
395b2750e8 web: increase table viewport by 300px 2024-09-05 09:45:58 +05:00
Abdullah Atta
3bfb1d57a5 web: fix attachment downloading stuck on error 2024-09-05 09:45:44 +05:00
Abdullah Atta
e59b432007 web: ensure file exists & is of the right size after encryption 2024-09-05 09:41:06 +05:00
Abdullah Atta
efbc566386 web: compare uploaded file size with actual file size after upload 2024-09-05 09:40:45 +05:00
Abdullah Atta
2576f1dd00 web: handle errors in attachment manager 2024-09-05 09:39:29 +05:00
Abdullah Atta
7d9388bd27 web: check select all checkbox when all attachments are selected 2024-09-05 09:38:57 +05:00
Abdullah Atta
1979cd2ea4 web: show progress when rechecking attachments in bulk 2024-09-05 09:38:29 +05:00
Abdullah Atta
7bd5dfb772 web: add support for configuring server urls from login screen 2024-09-04 11:07:23 +05:00
Abdullah Atta
ac7c88218b core: fix custom server urls not working in production 2024-09-04 11:06:38 +05:00
Abdullah Atta
fb642233c8 docs(help): add xkcd comic just for kicks and laughs 2024-09-04 09:36:22 +05:00
Abdullah Atta
6e2a19d7e0 docs(help): add "is there an eta for X feature" FAQ 2024-09-04 09:20:02 +05:00
Abdullah Atta
4d4993c570 docs(help): improve merge conflicts documentation 2024-09-04 09:10:35 +05:00
Abdullah Atta
916e097cb3 clipper(web): bump version to v0.3.4 2024-09-03 11:52:53 +05:00
Abdullah Atta
6def76e1bb web: bump version to 3.0.17 2024-09-03 10:39:09 +05:00
Ammar Ahmed
d93ec27c9e mobile: release v3.0.16 2024-09-02 16:29:13 +05:00
Abdullah Atta
15329597a5 core: fix notes search for queries less than 3 letters (#6489) 2024-09-02 15:29:18 +05:00
Abdullah Atta
49caf23436 web: show loader when loading next page in themes 2024-09-02 14:58:13 +05:00
Abdullah Atta
e6d8401c56 desktop: fix multiple updates running simultaneously 2024-09-02 14:21:13 +05:00
Abdullah Atta
11a5e8c180 core: delete all relations with fromId/toId set to null 2024-09-02 14:20:58 +05:00
Abdullah Atta
5bd7a081c1 core: do not allow invalid reference to be added in relations 2024-09-02 14:20:58 +05:00
Abdullah Atta
a740a5db81 clipper(web): fix tags not assigned to clip 2024-09-02 14:20:58 +05:00
Abdullah Atta
a61f2efacf web: fix type errors 2024-09-02 13:43:05 +05:00
Brogio
51a253f3e2 mobile: fix typo in settings (#6485)
Fix typo

Signed-off-by: Brogio <contact@brog.io>
2024-09-02 12:18:49 +05:00
Abdullah Atta
19ed753079 clipper(web): only clip images if user is premium 2024-08-29 12:56:10 +05:00
Abdullah Atta
4a85c49f5d desktop: remove sodium-native package for now 2024-08-28 15:08:52 +05:00
Abdullah Atta
16dd4b3359 web: bump version to 3.0.16 2024-08-28 14:45:31 +05:00
Abdullah Atta
9279c671ac desktop: fix ft.dirname is not a function for "good" 2024-08-28 14:44:40 +05:00
Abdullah Atta
225b21977e crypto: remove libsodium-sumo patch 2024-08-28 13:46:29 +05:00
Abdullah Atta
026b9212c4 web: bump version to v3.0.15 2024-08-28 13:33:56 +05:00
Abdullah Atta
5ce59c6125 desktop: fix ft.dirname is not a function error 2024-08-28 13:32:38 +05:00
Ammar Ahmed
b7c81a956c mobile: release v3.0.15 2024-08-28 12:50:12 +05:00
Abdullah Atta
873f976fd3 crypto: fix ft.dirname is not a function 2024-08-28 12:49:14 +05:00
Ammar Ahmed
7d8a16c463 mobile: make sure settings get reset properly on logout 2024-08-28 10:29:05 +05:00
Ammar Ahmed
f5841985fa mobile: hide select folder button on ios 2024-08-28 10:29:05 +05:00
Ammar Ahmed
da86cbbe32 mobile: fix password input not focused automatically on login 2024-08-28 10:29:05 +05:00
Ammar Ahmed
ed115d3f9e mobile: set encrypted backups on signup 2024-08-28 10:29:05 +05:00
Ammar Ahmed
e52e74523a mobile: fix boot task 2024-08-28 10:29:05 +05:00
Ammar Ahmed
7e43c3b373 mobile: fix background sync 2024-08-28 10:29:05 +05:00
Ammar Ahmed
e6db186b62 mobile: fix automatic backups 2024-08-28 10:29:05 +05:00
Ammar Ahmed
998e62ade7 mobile: fix file picker does not attach file when tabId=0 2024-08-28 10:29:05 +05:00
Abdullah Atta
ac16bc74fc web: fix cache file store 2024-08-27 18:07:42 +05:00
Abdullah Atta
2aee26b082 web: restore attachment files even if they are already uploaded 2024-08-27 18:07:27 +05:00
Abdullah Atta
a188920d96 web: show but disable automatic backup settings for basic users 2024-08-27 18:07:11 +05:00
Abdullah Atta
1f3defc28c web: bump version to 3.0.14 2024-08-27 16:20:12 +05:00
Ammar Ahmed
7aeeabfb3a mobile: run sync on startup 2024-08-27 16:06:11 +05:00
Abdullah Atta
6641d3e625 web: prevent multiple simultaneous syncs 2024-08-27 16:06:11 +05:00
Abdullah Atta
72031617eb web: run sync immediately on init 2024-08-27 16:06:11 +05:00
Abdullah Atta
78090b700b web: remove debouncer for page visibility and connection changes 2024-08-27 16:06:11 +05:00
Abdullah Atta
f2f8d81b98 core: do not run sync before connecting sse 2024-08-27 16:06:11 +05:00
Abdullah Atta
84d68ca67b core: add more tests 2024-08-27 16:04:51 +05:00
Abdullah Atta
6368e47712 clipper(web): bump version to 0.3.3 2024-08-27 13:23:37 +05:00
Abdullah Atta
0f17b01a74 desktop: disable native crypto 2024-08-27 13:07:09 +05:00
Abdullah Atta
025e23356a editor: fix crash on drag dropping an embed node 2024-08-27 13:03:20 +05:00
Muhammad Ali
ac85002dff editor: fix crash when adding tasklist using md in heading or other nodes (#5923)
* editor: fixed adding tasklist using md in heading

* editor: reset nodes before converting them to a task list

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-08-27 12:49:19 +05:00
ChampionBuffalo
3a23e4fbaf web: Fix isNarrow overriding user-preference of navpane
Signed-off-by: ChampionBuffalo <49675578+ChampionBuffalo1@users.noreply.github.com>
2024-08-27 12:36:48 +05:00
Muhammad Ali
3547663af8 docs: add merge-conflicts file to help (#6420)
* Update merge-conflicts.md

edited merge conflict file

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* Update merge-conflicts.md

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* Update merge-conflicts.md

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* Update merge-conflicts.md

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* Update merge-conflicts.md

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* Update merge-conflicts.md

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* Update merge-conflicts.md

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* Update merge-conflicts.md

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>

* docs(help): update merge conflicts

* docs: added merge-conflicts file

---------

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-08-23 16:43:41 +05:00
Abdullah Atta
c5dfc02085 web: minor refactors 2024-08-21 13:14:17 +05:00
Ammar Ahmed
bb9a6431bf mobile: remove telemetry 2024-08-20 15:08:41 +05:00
Abdullah Atta
624d3d7ce8 web: remove unused analytics import 2024-08-20 15:08:41 +05:00
Abdullah Atta
170b0aa49a web: get rid of all telemetry & analytics code 2024-08-20 15:08:41 +05:00
Muhammad Ali
07cfd74506 Delete docs/help/contents/merge-conflict.md
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2024-08-20 14:56:56 +05:00
Muhammad Ali
1d40054ac0 Create merge-conflict.md
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2024-08-20 14:56:09 +05:00
Muhammad Ali
5cd37f4b64 Create merge-conflicts.md
Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
2024-08-20 14:53:51 +05:00
Tai Lam
25675f71e8 help: Capitalize all instances of "URL" (#6402)
Capitalize all instances of "URL"

Signed-off-by: Tai Lam <47955724+taivlam@users.noreply.github.com>
2024-08-20 12:55:27 +05:00
Ammar Ahmed
202534fca9 mobile: correctly handle error on backup failed 2024-08-19 10:51:14 +05:00
Ammar Ahmed
a57558d8ab mobile: fix restoring backups 2024-08-19 10:50:44 +05:00
Ammar Ahmed
f1c201dca9 core: fix reset attachment failed status 2024-08-19 10:50:44 +05:00
Ammar Ahmed
a73bff83fa mobile: bump version 2024-08-17 17:59:44 +05:00
Abdullah Atta
e4428299bc web: fix trial expired reminder dialog shown again and again 2024-08-16 18:10:35 +05:00
Abdullah Atta
487567ffbc web: upgrade paddle checkout code 2024-08-16 18:06:07 +05:00
Abdullah Atta
efd83e6de3 web: add debug logging to checkout 2024-08-16 11:22:13 +05:00
Ammar Ahmed
a07230f707 mobile: remove old patches 2024-08-16 10:52:16 +05:00
Abdullah Atta
35a2e11afd web: improve toast shown to basic users on using pro features 2024-08-16 10:28:39 +05:00
Abdullah Atta
cf4a7a3d34 core: limit notebooks to 20 on basic plan 2024-08-16 10:28:39 +05:00
Abdullah Atta
86e661ccd6 core: do not allow creating colors in basic plan 2024-08-16 10:28:39 +05:00
Abdullah Atta
e7be9b35ed core: limit tags to 5 on basic plan 2024-08-16 10:28:39 +05:00
Muhammad Ali
53a367b0b2 clipper(web): fix web clipper not capturing images (#6348)
* clipper: added config settings for images

* clipper(web): enable image clipping

* clipper(web): fix clipper not respecting cors proxy setting

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-08-16 10:28:14 +05:00
Ammar Ahmed
b6206e2ca7 mobile: take backup before logout 2024-08-14 12:53:57 +05:00
Abdullah Atta
a910c819f2 web: fix error text ui 2024-08-14 12:53:57 +05:00
Abdullah Atta
6dd7a4960f web: show warning if there are unsynced changes on logout 2024-08-14 12:53:57 +05:00
Abdullah Atta
c4e15b8f90 web: ask to create backup before logout in all cases 2024-08-14 12:53:57 +05:00
Abdullah Atta
f458a4b86a web: check unsynced changes and ask for backup before logout 2024-08-14 12:53:57 +05:00
Abdullah Atta
8a44a7b99a core: add api for checking unsynced changes 2024-08-14 12:53:57 +05:00
Ammar Ahmed
25065c01a0 mobile: Fix apk size increase in v3.0.13 2024-08-14 12:19:42 +05:00
Abdullah Atta
87ae9e86e7 editor: remove 500ms debounce from image observer 2024-08-14 09:18:26 +05:00
Abdullah Atta
782c53b622 web: impl chunkSize method for faster file size calculation 2024-08-14 09:18:26 +05:00
Abdullah Atta
cb52b390ab fs: add chunkSize method for faster file size calculation 2024-08-14 09:18:26 +05:00
Abdullah Atta
5a49941003 core: cache attachment key for faster attachment reading 2024-08-14 09:18:26 +05:00
Ammar Ahmed
6797b9b621 mobile: prompt before restoring a backup 2024-08-13 15:47:10 +05:00
Ammar Ahmed
031a1b31b4 mobile: fix backup success toast 2024-08-13 15:40:10 +05:00
Ammar Ahmed
4e5762be45 mobile: check server compatible 2024-08-13 11:19:47 +05:00
Abdullah Atta
7a6ba5d1d1 web: check server version compatibility when testing connection 2024-08-13 11:19:47 +05:00
Abdullah Atta
cc3ccd041d core: add function for checking compability with server 2024-08-13 11:19:47 +05:00
Ammar Ahmed
31453dc098 mobile: server configuration settings 2024-08-13 11:19:47 +05:00
Abdullah Atta
2e84099c80 web: fix typo 2024-08-13 11:19:47 +05:00
Abdullah Atta
5bbc0cd452 web: add support for changing server urls 2024-08-13 11:19:47 +05:00
Abdullah Atta
22aae401ba web: improve checks before download & upload of attachment 2024-08-13 11:09:03 +05:00
Ammar Ahmed
97f135cd07 mobile: fix attachment downloading 2024-08-13 11:09:03 +05:00
Abdullah Atta
976f933233 web: check for s3 errors on downloading attachment 2024-08-13 11:09:03 +05:00
Ammar Ahmed
95fe1044d6 mobile: clean temp backup folders and files 2024-08-13 11:09:03 +05:00
Ammar Ahmed
677201e979 mobile: fix wording 2024-08-13 11:09:03 +05:00
Ammar Ahmed
6ec9370afb mobile: add support for attachments cache 2024-08-13 11:09:03 +05:00
Abdullah Atta
bea0f1ab0e core: fix conflicts being shown on non-conflicted notes 2024-08-13 11:09:03 +05:00
Abdullah Atta
5357be4741 web: cancel attachments caching on disabling offline mode 2024-08-13 11:09:03 +05:00
Abdullah Atta
02fdec74ce web: fix bulk exists check for files 2024-08-13 11:09:03 +05:00
Abdullah Atta
dbc907ceeb web: write downloading files to temporary location before moving 2024-08-13 11:09:03 +05:00
Abdullah Atta
7bb53a5e0c fs: add support for moving files 2024-08-13 11:09:03 +05:00
Abdullah Atta
69cb24149d core: fix progress when bulk downloading files 2024-08-13 11:09:03 +05:00
Abdullah Atta
438d412ae9 web: fix "too much recursion" error 2024-08-13 11:09:03 +05:00
Abdullah Atta
1b71edef45 web: change offline mode api 2024-08-13 11:09:03 +05:00
Abdullah Atta
a4c0e8412b fs: add support for listing all files 2024-08-13 11:09:03 +05:00
Abdullah Atta
fbcb8675ca core: optimize attachment caching in offline mode 2024-08-13 11:09:03 +05:00
Ammar Ahmed
fbf5c82d04 mobile: update wording 2024-08-13 11:09:03 +05:00
Ammar Ahmed
fa40c539ed mobile: fix restoring backup files 2024-08-13 11:09:03 +05:00
Ammar Ahmed
f3218fdc31 mobile: fix restoring backup 2024-08-13 11:09:03 +05:00
Ammar Ahmed
d12ed967e3 mobile: add support for offline mode, backup with attachments 2024-08-13 11:09:03 +05:00
Abdullah Atta
b6021dc76b web: fix backup tests for good 2024-08-13 11:09:03 +05:00
Abdullah Atta
f95442a828 web: fix backup tests 2024-08-13 11:09:03 +05:00
Abdullah Atta
846aae312e core: fix backup tests 2024-08-13 11:09:03 +05:00
Abdullah Atta
68fdbcb7fc web: better status reports when taking backups in background 2024-08-13 11:09:03 +05:00
Abdullah Atta
b938c58b67 web: take automatic backups in background 2024-08-13 11:09:03 +05:00
Abdullah Atta
759fba06ae web: add options to create backups with attachments 2024-08-13 11:09:03 +05:00
Abdullah Atta
10e24ae632 web: add support for backup/restore of attachments 2024-08-13 11:09:03 +05:00
Abdullah Atta
341032c884 core: add support for including attachments in backups 2024-08-13 11:09:03 +05:00
Abdullah Atta
aa1fa0ca81 crypto: throw error if chunk decryption fails 2024-08-13 11:09:03 +05:00
Abdullah Atta
398432efde web: add setting to toggle full offline mode 2024-08-13 11:09:03 +05:00
Abdullah Atta
57ddaafc16 core: download all attachments when full offline mode is on 2024-08-13 11:09:03 +05:00
Abdullah Atta
e4a755c69f web: optimize attachment uploading 2024-08-13 11:09:03 +05:00
Abdullah Atta
053f70cdb4 fs: get rid of chunks property in file metadata 2024-08-13 11:09:03 +05:00
Abdullah Atta
cdcdc43cad web: fix encryption progress when attaching files 2024-08-13 11:09:03 +05:00
Abdullah Atta
f1111191b1 clipper: ignore stylesheets that throw cors error 2024-08-13 11:07:20 +05:00
Abdullah Atta
529e2a4dfd clipper(web): move to react 18 2024-08-13 11:07:20 +05:00
Abdullah Atta
d88d07a2b0 core: fix Cannot read properties of null (reading 'length') in migration 2024-08-11 11:48:19 +05:00
Abdullah Atta
197ff36c20 web: only show sync status in placeholder on first sync 2024-08-11 11:19:15 +05:00
Ammar Ahmed
d94474de79 mobile: fix android crash api 34 2024-08-10 16:29:05 +05:00
Ammar Ahmed
fcf0e0c531 mobile: update Podfile.lock 2024-08-10 12:35:34 +05:00
Ammar Ahmed
24048ebfbe mobile: remove USE_FULL_SCREEN_INTENT 2024-08-10 11:57:57 +05:00
Ammar Ahmed
5ae8cdd5b9 mobile: fix build errors 2024-08-10 11:31:37 +05:00
Ammar Ahmed
74187b335f ci: set java 17
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-08-09 15:26:12 +05:00
Ammar Ahmed
16fc689299 mobile: release v3.0.13 2024-08-09 15:01:19 +05:00
Ammar Ahmed
578a9de680 mobile: fix ios build 2024-08-09 12:25:59 +05:00
Ammar Ahmed
62d475b2ef mobile: upgrade to react native 0.74.4 2024-08-09 12:25:59 +05:00
Ammar Ahmed
69c902c6c1 mobile: fix title input changes not detected 2024-08-09 12:25:14 +05:00
Abdullah Atta
c8c1028cbc core: fix least relevant results shown on top 2024-08-09 11:52:55 +05:00
Abdullah Atta
313807c384 web: remove Report an issue button from status bar 2024-08-09 11:47:56 +05:00
Abdullah Atta
5dc0e15094 web: fix last change in editor not getting saved 2024-08-09 10:35:53 +05:00
Ammar Ahmed
12c5b6d227 mobile: release v3.0.12 2024-07-29 10:06:21 +05:00
Ammar Ahmed
364ae51e36 mobile: fix backup share button not working 2024-07-29 09:53:20 +05:00
Ammar Ahmed
18947e0c93 mobile: fix missing fonts in share sheet 2024-07-29 09:43:37 +05:00
François Martin
3880db4339 global: clarify explanations for force push and force pull (#6255)
Signed-off-by: François Martin <f.martin@fastmail.com>
2024-07-29 09:38:30 +05:00
Ammar Ahmed
ae5b0b6fcc mobile: fix share sheet not loading on ios 2024-07-29 09:25:46 +05:00
Abdullah Atta
2c729f90cc global: update lockfiles 2024-07-27 13:30:25 +05:00
Ammar Ahmed
800514d769 mobile: fix position of password input 2024-07-27 12:49:57 +05:00
Ammar Ahmed
b03b9482dc mobile: app stuck after unlock 2024-07-27 12:49:57 +05:00
Abdullah Atta
9019490dbd web: bump version to v3.0.13 2024-07-27 11:16:42 +05:00
Abdullah Atta
4a3e23c288 web: fix reminder can't be set in january 2024-07-27 11:16:09 +05:00
Ammar Ahmed
1800ebea2d mobile: fix keyboard blocks continue button on applock 2024-07-27 11:12:09 +05:00
Ammar Ahmed
a708c9e9eb mobile: fix home shortcut not working 2024-07-27 10:56:09 +05:00
Abdullah Atta
2aeb875fec web: fix crash on moving temporary tab 2024-07-27 10:08:38 +05:00
Abdullah Atta
a8164e9f6c web: enter in title should focus editor 2024-07-27 09:46:37 +05:00
Abdullah Atta
0ee8e738e5 web: fix attachments ui in properties 2024-07-27 09:46:23 +05:00
Abdullah Atta
8fdef2ac7d web: fix attachments flicker in editor note properties 2024-07-27 09:46:23 +05:00
Abdullah Atta
920b1d91f3 web: bump version to 3.0.12 2024-07-22 15:42:18 +05:00
Abdullah Atta
0ad382aced web: fix incorrect attachment upload progress 2024-07-22 15:30:38 +05:00
Abdullah Atta
c8aa8e37cf web: add support for clearing attachments cache 2024-07-22 15:30:21 +05:00
Abdullah Atta
9a37f7c506 web: fix image picker dialog shown for non-image attachments 2024-07-22 13:08:49 +05:00
Abdullah Atta
717750d5d4 web: subscribe to user related events before fetching user 2024-07-22 13:08:36 +05:00
Abdullah Atta
1274ecc3b5 core: refresh token on user subscription change 2024-07-22 13:08:12 +05:00
Abdullah Atta
4c2ad4567c setup: use listr2 2024-07-20 10:34:40 +05:00
Abdullah Atta
ebc01af34a global: publish packages 2024-07-20 10:34:28 +05:00
Abdullah Atta
e66d8eee13 ui: add support for ss 2024-07-20 01:16:46 +05:00
Abdullah Atta
55e6a4b65a editor: do not throw during ssr 2024-07-20 00:42:54 +05:00
Abdullah Atta
0aa1db584d editor: do not keep last line in view for readonly editor 2024-07-19 23:50:20 +05:00
Abdullah Atta
a0e6266d28 ui: fix Cannot access 'mouseMoveListenerAttached' before initialization 2024-07-19 23:26:35 +05:00
Abdullah Atta
bd0aaed863 ui: add support for ssr 2024-07-19 23:22:47 +05:00
Abdullah Atta
9410c42f29 web: fix search icon overlapping route header text 2024-07-19 12:42:18 +05:00
Abdullah Atta
80186c1812 web: fix type errors 2024-07-19 11:11:51 +05:00
Abdullah Atta
37dfda5c54 desktop: set updaterCacheDirName in app-update.yml 2024-07-19 10:52:59 +05:00
Abdullah Atta
ec83517dc5 desktop: fix update check gives no feedback in ui 2024-07-19 10:51:10 +05:00
Abdullah Atta
2eb4911592 web: bump version to 3.0.11 2024-07-18 17:41:26 +05:00
Abdullah Atta
cd0a6a8fcb editor: fix editing link adds a new link right beside it 2024-07-18 17:38:18 +05:00
Abdullah Atta
b15f192244 desktop: update esbuild 2024-07-18 16:47:08 +05:00
Abdullah Atta
406cb663c9 editor: pasting list item with single spaced paragraphs shouldn't break formatting 2024-07-18 12:02:39 +05:00
Abdullah Atta
301a30a50a editor: copying a link from a list item shouldn't add spaces at the end 2024-07-18 12:02:39 +05:00
Abdullah Atta
81e3432143 editor: fix copying multiple lists only copied the first one 2024-07-18 12:02:39 +05:00
Abdullah Atta
c43c2936ac web: use resizeobserver to wait for scroll container to resize 2024-07-18 11:56:48 +05:00
Abdullah Atta
fdea1807d2 web: fix editor scroll bar hiding sometimes on startup 2024-07-18 11:56:48 +05:00
Abdullah Atta
5439578fcf server(theme): add health endpoint 2024-07-17 15:25:52 +05:00
Abdullah Atta
e05e52f870 web: fix crash on sync 2024-07-16 17:18:25 +05:00
Abdullah Atta
1c6243d12e web: fix error on resetting database on crash 2024-07-16 17:18:25 +05:00
Abdullah Atta
a51dfb5b6e web: remove all traces of immer 2024-07-16 17:18:25 +05:00
Abdullah Atta
c98bddd35b web: use sqlite for storing editor session data 2024-07-16 17:18:25 +05:00
Abdullah Atta
1eb80ccc88 web: get rid of dialog controller
dialog controller was redundant and created unnecessary overhead.
It also coupled all the dialogs together so you couldn't import a dialog
independently. This new change isolates each dialog to its own module
while keeping the behaviour mostly the same.
2024-07-16 17:18:25 +05:00
Abdullah Atta
5a346aa7de web: fix tags & colors not updating/loading on opening a note 2024-07-16 17:18:25 +05:00
Abdullah Atta
910095a769 web: replace immer with mutative for perf reasons 2024-07-16 17:18:25 +05:00
Abdullah Atta
119059befa core: update tag on rename instead of upserting 2024-07-16 17:18:25 +05:00
Abdullah Atta
a8f5dea315 core: fix type definition 2024-07-16 17:18:25 +05:00
Abdullah Atta
ca0a4cb02c core: add localStorage like ConfigStorage based on SQLite 2024-07-16 17:18:25 +05:00
Abdullah Atta
a04cd6b8dc core: send event when directly unlinking a relation 2024-07-16 17:18:25 +05:00
Abdullah Atta
3e4ab0f6df setup: update typescript to 5.5 2024-07-16 17:18:25 +05:00
Abdullah Atta
a7fe1aca44 global: update lockfiles 2024-07-16 17:18:25 +05:00
Abdullah Atta
ff0188f602 web: fix app lock verification always succeeds 2024-07-12 14:30:37 +05:00
Ammar Ahmed
c846f8abc8 mobile: release v3.0.11 2024-07-11 12:08:15 +05:00
Abdullah Atta
8d8acfb99d web: fix crash on browsers that doesn't have asyncIterator 2024-07-11 11:55:17 +05:00
Abdullah Atta
3a5b5772ad web: bump version to 3.0.10 2024-07-10 10:44:44 +05:00
Abdullah Atta
8046932e4e web: fix tags & other items lists glitching 2024-07-10 10:43:06 +05:00
Abdullah Atta
c45aa84739 editor: fix pro popup shown on every paste 2024-07-10 09:04:40 +05:00
Abdullah Atta
d98be849e3 web: refresh editor on changing editor options 2024-07-10 09:04:40 +05:00
Abdullah Atta
727ac6d907 web: allow multi tab access when using idb vfs 2024-07-10 09:04:23 +05:00
Abdullah Atta
8302f8ba4c web: update wa-sqlite 2024-07-10 09:04:23 +05:00
Abdullah Atta
4db8b0db01 desktop: update electron-builder 2024-07-08 14:22:24 +05:00
Ammar Ahmed
3f1614ab9a mobile: fix stacktrace formatting 2024-07-08 13:58:04 +05:00
Ammar Ahmed
909d8c35f8 mobile: fix issue reporting 2024-07-08 13:52:57 +05:00
Ammar Ahmed
a73780f0b0 mobile: bump version to v3.0.10 2024-07-08 13:32:45 +05:00
Ammar Ahmed
286fdbeec0 mobile: show toast error if upload file url not resolved 2024-07-08 13:32:30 +05:00
Abdullah Atta
59099552f8 web: bump version to 3.0.9 2024-07-08 12:47:45 +05:00
Ammar Ahmed
0b6013be58 mobile: fix color popup on mobile 2024-07-08 12:07:39 +05:00
Abdullah Atta
2d93a17f34 web: fix all failing tests 2024-07-08 11:22:14 +05:00
Abdullah Atta
5ef7e39e17 web: optimize ui for mobile & tablet form factor 2024-07-08 10:24:50 +05:00
Abdullah Atta
f7de4c9084 editor: fix keyboard shortcut for internal link not working 2024-07-08 10:23:30 +05:00
Abdullah Atta
0672c864f7 web: fix drag/drop with multiple items 2024-07-08 10:23:02 +05:00
Abdullah Atta
cb3706c150 editor: fix editor options not applied 2024-07-08 10:22:25 +05:00
Abdullah Atta
08c6a99336 web: fix note toc not loading on app restart 2024-07-08 10:21:46 +05:00
Abdullah Atta
adf961fa08 editor: fix search options not respected 2024-07-08 10:21:10 +05:00
Abdullah Atta
0eb9ae47e9 web: restrict tab drag/drop to horizontal axis 2024-07-08 10:15:04 +05:00
Abdullah Atta
aa706300a4 web: fix tab not closing on single click 2024-07-04 11:14:20 +05:00
Ammar Ahmed
fd183a0e1e mobile: fix error in editor with incorrect tools data 2024-07-01 11:48:52 +05:00
Ammar Ahmed
b27cd4be0f mobile: set initial lastContentChangeTime to 0 2024-07-01 11:16:52 +05:00
Abdullah Atta
9575561832 web: fix real time editor sync not updating content 2024-07-01 11:16:52 +05:00
Ammar Ahmed
02f96f8d14 mobile: fix cannot read property jsx of undefined 2024-07-01 11:14:43 +05:00
Ammar Ahmed
3cf46e7ad1 mobile: bump deps 2024-07-01 10:12:08 +05:00
Abdullah Atta
93551aa0b7 web: improve focus item in list behavior 2024-07-01 09:51:58 +05:00
Abdullah Atta
d00c35bdaf web: fix tab focus requires 2 clicks 2024-07-01 09:51:44 +05:00
Abdullah Atta
6e6b793568 web: fix web app on mobile browsers 2024-07-01 09:51:29 +05:00
Ammar Ahmed
9e064d88c6 mobile: fix privacy screen 2024-07-01 09:48:14 +05:00
Abdullah Atta
1658ad8d18 core: fix SSE not connecting 2024-06-25 08:31:07 +05:00
Abdullah Atta
c94da3bdf0 core: use single listener for receiving pushed items 2024-06-25 08:30:41 +05:00
Abdullah Atta
1f0fc83a7c editor: remove images on paste if user is not pro 2024-06-07 10:31:02 +05:00
Abdullah Atta
a6af92c330 web: handle errors when resolving upload urls 2024-06-07 10:30:36 +05:00
Abdullah Atta
ef93ecc481 web: handle errors during bootstrapping 2024-06-07 10:30:16 +05:00
Abdullah Atta
039709822c desktop: add instructions for creating packages 2024-06-05 10:38:54 +05:00
Abdullah Atta
25c861ce77 global: publish packages to npm 2024-06-05 10:28:28 +05:00
Abdullah Atta
670f1570b5 setup: add script for publishing packages 2024-06-05 10:28:13 +05:00
Abdullah Atta
c93d82d2d6 web: bump version to 3.0.8 2024-06-03 17:34:53 +05:00
Abdullah Atta
bced20031b web: fix Please unlock the key store to get values 2024-06-03 17:31:44 +05:00
Abdullah Atta
f8bd089b51 web: bump version to 3.0.7 2024-06-03 13:32:01 +05:00
Abdullah Atta
2a4d04a26f mobile: use clearer wording on logout confirmation 2024-06-03 13:27:51 +05:00
Abdullah Atta
a0c32191f9 web: use clearer wording on logout confirmation 2024-06-03 13:27:51 +05:00
Abdullah Atta
662d59f60a web: use clearer wording on database corruption errors 2024-06-03 13:27:51 +05:00
Abdullah Atta
13befe1947 web: handle crashes during export 2024-06-03 13:27:21 +05:00
Abdullah Atta
21f8b6d557 web: allow resetting side bar order & hidden items 2024-06-03 13:08:20 +05:00
Abdullah Atta
aef53cace9 web: disable non pro items in context menu 2024-06-03 13:00:36 +05:00
Abdullah Atta
382b5b0240 web: improve web app loading performance by 10x (#5845)
* web: improve web app loading performance by 10x

* web: update test snapshots
2024-06-03 11:07:44 +05:00
Ammar Ahmed
a45b66d449 mobile: release v3.0.9 2024-06-01 14:14:01 +05:00
Ammar Ahmed
dd67b1a803 mobile: fix login 2fa sheet gets blocked by keyboard 2024-06-01 13:45:28 +05:00
Ammar Ahmed
00568ae839 mobile: add back undo/redo buttons 2024-06-01 13:21:27 +05:00
Abdullah Atta
2b2ea5717c web: bring back undo/redo buttons 2024-06-01 13:21:27 +05:00
Abdullah Atta
5672de8565 desktop: allow using native titlebar on desktop app (#5826) 2024-06-01 13:21:05 +05:00
Ammar Ahmed
1c70ad8cec web: fix tags & colors not included in imported notes (#5801)
* web: include tags and colors in imports

* web: refactors

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-06-01 11:40:16 +05:00
Abdullah Atta
0c344a2146 core: fix sqlite hangs on restoring notebook 2024-06-01 11:28:40 +05:00
Yoonjae Choi
38f69b514c web: fix readonly locked notes opening as editable (#5731)
Signed-off-by: Yoonjae Choi <dbswo9795@email.com>
2024-06-01 11:27:59 +05:00
Abdullah Atta
b502f6a08f web: fix CVE-2024-4367 2024-06-01 11:26:43 +05:00
Abdullah Atta
d68c3269d3 editor: fix extra padding around image 2024-06-01 11:26:28 +05:00
Abdullah Atta
6d9af85e2a web: fix background color of count in nav item 2024-05-21 13:14:56 +05:00
Abdullah Atta
1d58cfea3c web: fix navigation bar in settings dialog not themed 2024-05-21 13:14:56 +05:00
Abdullah Atta
c1fa4d3400 web: fix wrong version saved on conflict resolve 2024-05-21 13:14:42 +05:00
Abdullah Atta
df179056d6 logger: fix logger in core not working 2024-05-21 12:19:39 +05:00
Abdullah Atta
26f9e08c23 web: fix sync not running on page focus 2024-05-21 10:47:25 +05:00
Abdullah Atta
f719bebe5a core: create triggers after resetting database 2024-05-21 09:59:20 +05:00
Abdullah Atta
9693c8ea54 desktop: run sqlite on another thread 2024-05-21 09:59:20 +05:00
Abdullah Atta
040a677895 core: add support for closing logger db 2024-05-21 09:59:20 +05:00
Ammar Ahmed
df2708147e mobile: release v3.0.8 2024-05-20 15:35:59 +05:00
Ammar Ahmed
faba5f6385 mobile: always recreate editor on changing note 2024-05-20 15:08:27 +05:00
Ammar Ahmed
eab5bccb99 mobile: use sqlite based logger 2024-05-20 15:05:18 +05:00
Abdullah Atta
ed399c0d0a web: use noop logger before initializing 2024-05-20 15:05:18 +05:00
Abdullah Atta
3c7e962fe0 logger: minor refactor 2024-05-20 15:05:18 +05:00
Abdullah Atta
56614ef19d core: use chunks and set date only once 2024-05-20 15:05:18 +05:00
Abdullah Atta
169318c549 core: remove attachments initialized log 2024-05-20 15:05:18 +05:00
Abdullah Atta
bd6a1b9bff web: add support for opening multiple sqlite databases 2024-05-20 15:05:18 +05:00
Abdullah Atta
443d6625f9 core: add support for deleting logs for a specific date 2024-05-20 15:05:18 +05:00
Abdullah Atta
b6f95ff7cd core: use sqlite for storing logs 2024-05-20 15:05:18 +05:00
Ammar Ahmed
1b13da54a1 mobile: fix image extension 2024-05-20 12:55:34 +05:00
Ammar Ahmed
adf0f132fd mobile: convert heic/heif images to jpeg 2024-05-20 12:55:34 +05:00
Ammar Ahmed
73ec04b42d mobile: fix error when writing user key 2024-05-20 10:45:02 +05:00
Abdullah Atta
54a68e4406 themebuilder: bump version to 1.2.0 2024-05-18 13:09:49 +05:00
Abdullah Atta
bd73ae9df4 theme: add titleBar to theme scopes 2024-05-18 13:09:49 +05:00
Abdullah Atta
fe41f7b687 themebuilder: make theme builder compile 2024-05-18 13:09:49 +05:00
Ammar Ahmed
c9adaa2442 mobile: release v3.0.7 2024-05-17 12:41:13 +05:00
Abdullah Atta
10be5771c6 web: bump version to 3.0.6 2024-05-17 12:31:22 +05:00
Abdullah Atta
43f4669360 core: fix notes with no conflict marked as conflicted 2024-05-17 12:29:58 +05:00
Ammar Ahmed
3b04925e54 mobile: update changelog 2024-05-17 09:58:43 +05:00
Ammar Ahmed
ba3959af9e mobile: release v3.0.6 2024-05-17 09:58:08 +05:00
Ammar Ahmed
552d86d9d2 mobile: fix android compilation on java 17 2024-05-17 09:56:51 +05:00
Ammar Ahmed
096602150e mobile: fix encryption key not found error on login 2024-05-17 09:56:51 +05:00
Abdullah Atta
e5795bcbb2 web: fix app asking password on auto backups with encryption off 2024-05-16 16:25:04 +05:00
Ammar Ahmed
9be52a69ad mobile: add changelog 2024-05-16 15:45:38 +05:00
Ammar Ahmed
5809384f62 mobile: release v3.0.5 2024-05-16 15:44:48 +05:00
Ammar Ahmed
fff70dce16 mobile: fix recovery key dialog ui 2024-05-16 15:14:14 +05:00
Ammar Ahmed
258140b1e0 mobile: fix share widget title issues
1. Do not change title of note when choosing append to note
2. Fix color of title in widget
2024-05-16 12:07:29 +05:00
Ammar Ahmed
0a00844e64 mobile: fix locked note title cannot be edited 2024-05-16 12:07:05 +05:00
Abdullah Atta
03cea85efc web: bump version to 3.0.5 2024-05-16 11:57:12 +05:00
Abdullah Atta
8a16ef9b85 web: fix unlock a note for editing test 2024-05-16 11:55:50 +05:00
Abdullah Atta
c82c30b530 editor: fix search replace 2024-05-16 11:34:10 +05:00
Abdullah Atta
46599f66da web: fix search not working in readonly editor 2024-05-16 11:33:53 +05:00
Abdullah Atta
d1b532a4ae editor: show (empty) toolbar in readonly mode 2024-05-16 11:33:53 +05:00
Abdullah Atta
0baf7afc25 web: allow locked note duplication without unlocking 2024-05-16 09:31:46 +05:00
Abdullah Atta
a0595a7d23 core: copy all note relations when duplicating 2024-05-16 09:31:46 +05:00
Abdullah Atta
1e6f6ab477 core: fix Cannot read properties of undefined (reading 'startsWith') error on export 2024-05-16 09:31:18 +05:00
Abdullah Atta
62d677f9ad web: fix web app not working on safari 2024-05-16 09:30:49 +05:00
Abdullah Atta
8de98d98ab core: fix merger tests 2024-05-16 09:30:28 +05:00
Ammar Ahmed
5b57614bfe mobile: fix app lock issues 2024-05-16 09:27:27 +05:00
Ammar Ahmed
ae7c538ad7 mobile: enable privacy screen with applock 2024-05-16 09:27:27 +05:00
Ammar Ahmed
c6394c9e37 mobile: allow removing app lock with account password 2024-05-16 09:27:27 +05:00
Ammar Ahmed
acf3740a68 mobile: fix pricing plans stuck at loading 2024-05-16 09:24:19 +05:00
Ammar Ahmed
8423543904 mobile: show diff in note history 2024-05-16 09:23:45 +05:00
Abdullah Atta
b90cb28637 web: handle corrupted+migrations: error 2024-05-16 08:40:03 +05:00
Abdullah Atta
780e1e9db0 web: reopen editor session if conflict is resolved/created 2024-05-15 12:37:50 +05:00
Abdullah Atta
ca6f8e5e4b web: fix real time sync ignored when resolved content is synced 2024-05-15 12:37:08 +05:00
Abdullah Atta
4c4cda1c39 core: create conflict if local item is unsynced
previously we were only creating a conflict when the local item was
edited after the remote item. This failed in cases where even though
the local item was edited before the remote item, it still contained
important information.

Now we only check if the local item is synced or not. If it isn't synced,
we most probably want to preserve the local changes, or at least want
to be notified.
2024-05-15 12:36:38 +05:00
Abdullah Atta
6fcbde772c core: fix notes marked as conflicted wrongly 2024-05-15 12:34:23 +05:00
Abdullah Atta
eac1750b1c core: add test for merge conflicts during sync 2024-05-14 15:21:00 +05:00
Abdullah Atta
5eea179a58 core: set conflicted property on notes after fetch is done 2024-05-14 15:21:00 +05:00
Abdullah Atta
fe1ea6dc27 core: do not update dateModified when updating content internally 2024-05-14 15:21:00 +05:00
Abdullah Atta
cf1b774255 core: filter out conflicted notes & content during sync 2024-05-14 15:21:00 +05:00
Abdullah Atta
198fa33fc0 core: do not update dateModified when setting synced=true 2024-05-14 15:21:00 +05:00
Abdullah Atta
e722866d62 web: better handling of database disk image is malformed error 2024-05-14 15:21:00 +05:00
Ammar Ahmed
58845e5508 mobile: release v3.0.4 2024-05-11 15:19:12 +05:00
Abdullah Atta
543c6f17ed web: enable sourcemaps for web app 2024-05-11 13:09:59 +05:00
Abdullah Atta
533f95fcff editor: fix editor crash due to TypeError: t.startsWith is not a function 2024-05-11 12:53:30 +05:00
Ammar Ahmed
c02f1cde16 mobile: disable template when pin note to notifications 2024-05-11 12:49:11 +05:00
Ammar Ahmed
043f55ead0 mobile: fix exporting note to text for share/copy 2024-05-11 12:49:11 +05:00
Ammar Ahmed
fcece06a1c mobile: fix update notification not showing on mobile app 2024-05-11 12:49:11 +05:00
Abdullah Atta
da7d79edc6 core: token without a scope is invalid 2024-05-11 12:36:23 +05:00
Ammar Ahmed
a2e7190a4a mobile: fix colors of error popup in editor 2024-05-11 11:26:15 +05:00
Ammar Ahmed
503f2b5876 mobile: fix cannot read property 'groupBy' of undefined 2024-05-11 11:22:59 +05:00
Abdullah Atta
68d57e2b27 web: bump version to 3.0.4 2024-05-11 10:48:48 +05:00
Abdullah Atta
400aa574cd core: fix 2fa codes not being sent 2024-05-11 10:29:02 +05:00
Abdullah Atta
5028bb1275 web: update snapshots 2024-05-10 15:30:35 +05:00
Abdullah Atta
27ae5bb5a2 desktop: use npx prebuildify instead of yarn 2024-05-10 15:24:39 +05:00
Abdullah Atta
83316fe299 web: update snapshots for linux 2024-05-10 15:20:57 +05:00
Ammar Ahmed
8869224de2 mobile: fix image preview not rendered on iOS 2024-05-10 15:04:28 +05:00
Ammar Ahmed
c4152f0fc0 mobile: set editor reset time to 10 minutes 2024-05-10 14:53:10 +05:00
Ammar Ahmed
d803005637 mobile: release v3.0.3 2024-05-10 14:47:27 +05:00
Ammar Ahmed
53d896be2b mobile: fix opening exported files after export 2024-05-10 14:44:12 +05:00
Abdullah Atta
8c37c6409a ci: use actions/upload-artifact@v4 2024-05-10 12:36:56 +05:00
Abdullah Atta
9195244890 web: fix tests 2024-05-10 12:31:55 +05:00
Ammar Ahmed
152794ccd0 mobile: fix image filename in picker 2024-05-10 12:24:40 +05:00
Ammar Ahmed
2e8b234b63 mobile: fix editor content update on realtime sync 2024-05-10 12:24:40 +05:00
Abdullah Atta
055c647698 web: add Audios tab in attachments dialog 2024-05-10 12:08:38 +05:00
Abdullah Atta
2b7bcfe7c6 web: bump version to 3.0.3 2024-05-10 12:00:06 +05:00
Abdullah Atta
3c8b8a7bc9 web: fix real time sync test 2024-05-10 11:58:56 +05:00
Abdullah Atta
fde45fb6de web: saving timeout notice shown every time 2024-05-10 11:58:44 +05:00
Abdullah Atta
4a616a3e67 web: fix tab not updating when note is locked/unlocked 2024-05-10 11:27:26 +05:00
Abdullah Atta
bd0a338dd6 core: fix dateEdited not updating on saving locked content 2024-05-10 10:46:11 +05:00
Abdullah Atta
5ab721e3e2 core: fix async iterator on sql collection only returning dateCreated & id 2024-05-10 10:22:03 +05:00
Ammar Ahmed
cb70bb9429 mobile: fix errors 2024-05-10 09:22:23 +05:00
Abdullah Atta
82cadd473c web: show error if saving takes more than 30 seconds 2024-05-10 09:22:23 +05:00
Ammar Ahmed
0e8ea3ddeb mobile: fix editor loading 2024-05-10 09:22:23 +05:00
Ammar Ahmed
511acc5fca mobile: handle editor not responding 2024-05-10 09:22:23 +05:00
Ammar Ahmed
001cf8ee92 mobile: add editor lock safety 2024-05-10 09:22:23 +05:00
Muhammad Ali
a965cd694b web: fix color not updating on note (#5573) 2024-05-10 09:16:59 +05:00
Ammar Ahmed
d3c1c1959b mobile: fix wording of push/pull sync 2024-05-09 17:39:35 +05:00
Abdullah Atta
9a866a552a web: replace force sync with force push/pull 2024-05-09 17:39:35 +05:00
Ammar Ahmed
837c296821 mobile: push/pull force sync 2024-05-09 17:39:35 +05:00
Abdullah Atta
9aed6faed8 common: fix locked notes not getting exported 2024-05-09 17:39:16 +05:00
Abdullah Atta
734f491e8d editor: fix crash due to undefined is not an object (evaluating 'a.nodeSize') (#5553) 2024-05-09 17:38:18 +05:00
Ammar Ahmed
0ea13024e9 mobile: fix editor crash due to position (#5519)
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-05-09 15:55:33 +05:00
Abdullah Atta
cb27039245 web: close shared service on window close 2024-05-09 10:30:46 +05:00
Abdullah Atta
714ac2deac core: do not use auth access tokens as normal access tokens 2024-05-09 10:30:25 +05:00
Abdullah Atta
d605bc29bf desktop: fix crash on toggling custom dns (#5538) 2024-05-09 10:15:14 +05:00
Abdullah Atta
080101bc45 core: fix database disk image malformed error (#5525) 2024-05-09 10:08:44 +05:00
Abdullah Atta
4819e17da3 core: rerun sync if there are unsynced changes after sync complete 2024-05-08 16:48:59 +05:00
Ammar Ahmed
69a5d5a1b6 global: update .gitignore 2024-05-08 10:43:35 +05:00
Ammar Ahmed
68a6d6c313 mobile: fix crash when taking camera picture 2024-05-08 09:48:28 +05:00
Ammar Ahmed
c51ef4d5f6 mobile: fix camera permission 2024-05-08 09:48:28 +05:00
Ammar Ahmed
d9c5c1f893 mobile: remove margin in editor 2024-05-08 09:47:56 +05:00
Ammar Ahmed
5a75ca73a9 mobile: fix editor scrolling on update 2024-05-08 09:47:56 +05:00
Abdullah Atta
626d393376 desktop: use yarn instead of npx for build scripts 2024-05-08 09:14:55 +05:00
Abdullah Atta
68d06ff3f8 core: fix legacy backup restoration 2024-05-07 15:57:22 +05:00
Abdullah Atta
79f20d100c core: fix File already exists error on duplicate downloads 2024-05-07 12:57:51 +05:00
Ammar Ahmed
9d5bec3bfb ci: upload sourcemaps 2024-05-07 11:49:58 +05:00
Abdullah Atta
ac96354b4c core: handle case when updating item while a push is ongoing 2024-05-06 22:04:04 +05:00
Abdullah Atta
63f44d6fbc core: set synced to false on removing content by note id 2024-05-06 15:45:45 +05:00
Abdullah Atta
f9bfa88c83 core: set synced to false on unlinking relations 2024-05-06 15:45:45 +05:00
Ammar Ahmed
ef192f3d22 mobile: release v3.0.2 2024-05-05 01:14:20 +05:00
Abdullah Atta
c9a8134265 core: fix notes & notebooks sorting 2024-05-05 00:00:49 +05:00
Ammar Ahmed
cd7a5d2ec0 mobile: fix error not rendered correctly 2024-05-04 23:52:47 +05:00
Abdullah Atta
b92bc03fa9 web: handle errors when saving attachment 2024-05-04 23:51:42 +05:00
Abdullah Atta
5f5e472800 web: bump version to 3.0.2 2024-05-04 23:35:49 +05:00
Ammar Ahmed
0951906cac mobile: do not check for .nnbackup file in zip 2024-05-04 23:29:59 +05:00
Abdullah Atta
6f0fe03760 core: do not throw if user not found during legacy backup 2024-05-04 23:28:37 +05:00
Muhammad Ali
159ce97e42 core: fix crash due to unsanitized sort options (#5324)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-05-04 23:26:58 +05:00
Ammar Ahmed
8a9848634c mobile: fix note not opening from notifications 2024-05-04 23:26:07 +05:00
Ammar Ahmed
282705a683 mobile: add logging 2024-05-04 23:11:30 +05:00
Ammar Ahmed
c91b706ed0 mobile: correctly show mime type 2024-05-04 23:11:30 +05:00
Ammar Ahmed
16afc07b2f mobile: fix all attachments show in audios 2024-05-04 23:11:30 +05:00
Ammar Ahmed
04f8be5a62 core: add missing audios attachments filter 2024-05-04 23:11:30 +05:00
Ammar Ahmed
0e8a5ca1fa editor: fix n.startsWith is not a function 2024-05-04 23:03:54 +05:00
Ammar Ahmed
1491bf771e Fix image and file uploads on mobile (#5304)
* mobile: fix image file formats support

* mobile: fix image and file uploads

---------

Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-05-04 23:02:07 +05:00
Abdullah Atta
0f5ce465c3 web: add logging related to attachments 2024-05-04 22:51:01 +05:00
Abdullah Atta
647ff7ae0e web: prevent overwriting uploaded attachments 2024-05-04 22:51:01 +05:00
Abdullah Atta
45a552adef web: handle errors during uploaded file size check 2024-05-04 22:51:01 +05:00
Abdullah Atta
8e207d787d web: delete file before reuploading 2024-05-04 22:51:01 +05:00
Abdullah Atta
00754593ac web: fix attachment not getting marked as failed on error 2024-05-04 22:51:01 +05:00
Abdullah Atta
b22770f1ae core: do not reset attachment dateUploaded when marking as failed 2024-05-04 22:51:01 +05:00
Abdullah Atta
523da4e91f core: only delete attachment file (not the metadata) on sync conflict 2024-05-04 22:51:01 +05:00
Abdullah Atta
de6c8154a3 web: fix password recovery not working 2024-05-04 22:50:44 +05:00
Abdullah Atta
9ef32e8081 web: do not hide attachment manager for logged out user 2024-05-01 20:14:20 +05:00
Abdullah Atta
5f53593a26 web: do not throw if backup doesn't contain .nnbackup file 2024-05-01 20:12:23 +05:00
Abdullah Atta
1f404944d9 web: re-enable service worker 2024-05-01 16:38:09 +05:00
Ammar Ahmed
23dca36475 mobile: release v3.0.1 2024-05-01 16:34:01 +05:00
Ammar Ahmed
3dd8e20e9a mobile: add logging when loading attachments 2024-05-01 16:29:37 +05:00
Abdullah Atta
8f412f9487 editor: fix padding of react node views on mobile 2024-05-01 16:29:12 +05:00
Abdullah Atta
bf790219db web: bump version to 3.0.1 2024-05-01 16:16:08 +05:00
Ammar Ahmed
c6af310b2d mobile: add notebook search 2024-05-01 16:10:26 +05:00
Abdullah Atta
8d89b5dca9 web: bring back notebook search in move note dialog 2024-05-01 16:10:26 +05:00
Abdullah Atta
fa35244607 editor: update test snapshosts 2024-05-01 16:09:06 +05:00
Abdullah Atta
d96815fa36 ci: remove beta publish workflows 2024-05-01 15:23:43 +05:00
Abdullah Atta
4a9f5b1d8b core: remove .only from trash tests 2024-05-01 15:19:57 +05:00
Ammar Ahmed
43fac79011 mobile: fix moving notebook on ios 2024-05-01 15:18:55 +05:00
Ammar Ahmed
f2c62c8d8b mobile: fix moving notebook on ios 2024-05-01 15:18:55 +05:00
Ammar Ahmed
70c9dd0083 mobile: reduce font size in notebook header 2024-05-01 15:15:37 +05:00
Ammar Ahmed
ae6d8c5f2b mobile: hide breadcrumbs in top level notebooks 2024-05-01 15:15:37 +05:00
Abdullah Atta
38e2250fd1 web: log attachment on failure 2024-05-01 14:55:49 +05:00
Ammar Ahmed
17e2c5a8a2 desktop: fix app icon size for macos 2024-05-01 14:53:32 +05:00
Ammar Ahmed
2e226f0f72 mobile: fix cannot read property 'sortDirection' of undefined 2024-05-01 13:34:48 +05:00
Ammar Ahmed
167c54578b mobile: fix scrolling broken in reminder -> repeat -> month 2024-05-01 13:34:37 +05:00
Abdullah Atta
fb656af5ca web: sort tags by title in editor header 2024-05-01 13:34:20 +05:00
Ammar Ahmed
ddfab272d2 common: sort tags by title in resolved items 2024-05-01 13:34:20 +05:00
Ammar Ahmed
28958311c1 mobile: fix share extention crash on sharing from some apps 2024-05-01 13:34:06 +05:00
Ammar Ahmed
f1b8275b4b mobile: add support for setting note title form quick note widget 2024-05-01 13:34:06 +05:00
Ammar Ahmed
c8c75d40dd mobile: fix theme search returns empty results 2024-05-01 13:33:50 +05:00
Ammar Ahmed
bace90808d mobile: fix footer size for notebook screen 2024-05-01 13:33:31 +05:00
Ammar Ahmed
fe7c7e8db4 mobile: fix notebook-sheet position 2024-05-01 13:32:02 +05:00
Ammar Ahmed
519a569366 mobile: fix notebook sheet flicker 2024-05-01 13:32:02 +05:00
Ammar Ahmed
89d602a40f mobile: do not lock app when requesting permission 2024-05-01 13:31:38 +05:00
Abdullah Atta
a8db65b5af editor: fix performance issues due to using portals for react node views 2024-05-01 13:29:55 +05:00
Ammar Ahmed
716239abfd mobile: fix selection header 2024-05-01 13:21:31 +05:00
Ammar Ahmed
62dd5a5416 mobile: fix vault unlock with biometrics 2024-05-01 13:19:00 +05:00
Ammar Ahmed
96558c5df5 mobile: fix search bar position on ios 2024-05-01 13:18:21 +05:00
Ammar Ahmed
45997dd2e4 editor: fix scroll into view should bring heading to top 2024-05-01 13:16:54 +05:00
Ammar Ahmed
bde190f01c mobile: render settings icon if no profile pic is set 2024-05-01 13:15:24 +05:00
Ammar Ahmed
042c97688f mobile: add quick theme switch button 2024-05-01 13:15:24 +05:00
Ammar Ahmed
95b5114070 mobile: fix confusing settings/sync button 2024-05-01 13:15:24 +05:00
Ammar Ahmed
20742e2a1c mobile: fix back navigation from editor (#4867)
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-05-01 13:13:44 +05:00
Ammar Ahmed
1e3149284e mobile: report error when migration fails due to backup error 2024-05-01 13:01:41 +05:00
Ammar Ahmed
d77c09f1fd mobile: fix opening internal link in readonly mode 2024-05-01 13:00:58 +05:00
Ammar Ahmed
aa602ea8e9 mobile: fix position of context menu 2024-05-01 12:59:50 +05:00
Ammar Ahmed
8ab6b6dc31 mobile: skip checking encrypted backup if user is logged out 2024-05-01 12:57:42 +05:00
Ammar Ahmed
404d136a73 mobile: fix sidebar order not loading on app launch 2024-05-01 12:50:13 +05:00
Abdullah Atta
cf9aeecd7e editor: fix placeholder showing always in first line of editor 2024-05-01 12:37:48 +05:00
Abdullah Atta
1adda96ce2 editor: fix many papercut ux issues in search replace 2024-05-01 12:36:00 +05:00
Abdullah Atta
6dd6d818c9 editor: add support for multi line search/replace 2024-05-01 12:36:00 +05:00
Abdullah Atta
c7e83961d4 web: show all notes if query is empty in note linking dialog 2024-05-01 12:35:38 +05:00
Abdullah Atta
03428e5848 core: allow full FTS5 search syntax 2024-05-01 12:35:38 +05:00
Abdullah Atta
d0fceed56d web: improve app performance by reducing react rerenders 2024-05-01 12:34:43 +05:00
Abdullah Atta
b8c68b5163 web: fix middle pane size increasing on exiting focus mode 2024-04-30 21:52:25 +05:00
Abdullah Atta
2496004896 web: fix position of image preview toolbar 2024-04-30 21:51:57 +05:00
Abdullah Atta
16ec35de25 web: do not change properties top on web app 2024-04-30 21:51:57 +05:00
Abdullah Atta
d248b8e2b8 web: properties & toc side bars must be below the titlebar 2024-04-30 21:51:57 +05:00
Abdullah Atta
641e7484e3 desktop: add custom dns toggle in settings 2024-04-30 21:51:35 +05:00
Abdullah Atta
a46409ff44 core: add more fts trigger tests 2024-04-30 21:51:17 +05:00
Abdullah Atta
5dbabc2706 core: fix database disk image is malformed error on updating deleted content 2024-04-30 21:51:17 +05:00
Abdullah Atta
2d4d656dd9 web: canceling backup on password change should abort 2024-04-30 21:50:48 +05:00
Abdullah Atta
ab51b22e4a web: do not ask for password when downloading backup during recovery 2024-04-30 21:50:32 +05:00
Abdullah Atta
781d09daca web: fix navigation menu resize issues 2024-04-30 21:50:21 +05:00
Abdullah Atta
f21533e5e4 core: fix sql collection only getting first batch on iteration 2024-04-30 21:50:00 +05:00
Abdullah Atta
2ea9b04863 web: fix toggles in properties not working 2024-04-30 21:49:37 +05:00
Abdullah Atta
675d517cbc web: reduce zoom factor step to 0.1 2024-04-30 21:49:13 +05:00
Abdullah Atta
c336c57bda web: disable pwa 2024-04-30 21:48:28 +05:00
Abdullah Atta
7b5fa09c71 web: fix all users are premium 2024-04-30 13:15:54 +05:00
Ammar Ahmed
d85974ed7a mobile: fix editor crash in v3 2024-04-30 12:09:15 +05:00
Ammar Ahmed
9598ea7542 mobile: fix wrong version in update sheet 2024-04-30 10:10:17 +05:00
Ammar Ahmed
42048ad53a mobile: fix multi-selection ux 2024-04-30 00:42:27 +05:00
Ammar Ahmed
1fbd2efb92 mobile: fix crash during backup 2024-04-30 00:17:25 +05:00
Ammar Ahmed
fe91ef79a0 global: update logo 2024-04-29 13:24:54 +05:00
Abdullah Atta
583d585b2f desktop: re-enable arm64 builds 2024-04-29 11:53:09 +05:00
Abdullah Atta
94b28f86ca desktop: remove channel when publishing 2024-04-29 11:38:31 +05:00
Abdullah Atta
f927f05f86 desktop: fix spawn EINVAL error on build 2024-04-29 11:15:43 +05:00
Abdullah Atta
bde8dea048 global: update package lockfiles 2024-04-29 11:15:21 +05:00
Abdullah Atta
511bea9b23 editor: update snapshots 2024-04-28 10:54:10 +05:00
Abdullah Atta
eda95530de desktop: set generateUpdatesFilesForAllChannels to false 2024-04-26 15:59:42 +05:00
Abdullah Atta
5173decaa5 crypto: upgrade sodium-native to 4.1.1 2024-04-26 15:48:42 +05:00
Abdullah Atta
00dcb55f6e ci: migrate to TrustedSigning from AzureCodeSigning 2024-04-26 15:44:29 +05:00
Abdullah Atta
6dbe1073cd ci: use AzureCodeSigning version 0.3.4 2024-04-26 15:30:53 +05:00
Abdullah Atta
9be3e4fcfa desktop: install node-gyp-build 2024-04-26 15:30:03 +05:00
Abdullah Atta
f9f0a866bd setup: fix infinite loop in postinstall 2024-04-26 15:18:49 +05:00
Abdullah Atta
daafeb2fa8 setup: retry postinstall commands 3 times 2024-04-26 15:17:49 +05:00
Abdullah Atta
a92b34b81c ci: back to node@20.x 2024-04-26 15:14:25 +05:00
Abdullah Atta
e29b6838b3 ci: use node@18.x 2024-04-26 14:53:23 +05:00
Ammar Ahmed
16ff7c92e4 mobile: update android version 2024-04-26 14:46:56 +05:00
Abdullah Atta
07e1ea6edf ci: use yarn instead of npx when executing electron-builder 2024-04-26 14:41:28 +05:00
Abdullah Atta
b26ede95fb desktop: use prebuilds on linux-arm 2024-04-26 14:01:32 +05:00
Abdullah Atta
971793a3ad desktop: use net.fetch for handling protocol requests 2024-04-26 14:01:32 +05:00
Abdullah Atta
6a2b5e1499 desktop: upgrade electron to 29 2024-04-26 14:01:32 +05:00
Abdullah Atta
d18b775d06 web: use same logic for uploading attachment on desktop & web 2024-04-26 14:01:32 +05:00
Abdullah Atta
d6cc899d95 web: close note after removing attachment permanently 2024-04-26 14:01:32 +05:00
Abdullah Atta
ea10058276 web: fix linked notes not showing in attachment context menu 2024-04-26 14:01:32 +05:00
Abdullah Atta
568c88be3e fs: fix out of bounds error when reading chunks 2024-04-26 14:01:32 +05:00
Abdullah Atta
f047552f18 core: fix attachment not getting detached from note's content 2024-04-26 14:01:32 +05:00
Ammar Ahmed
9a58430b5d mobile: release v3.0.0 2024-04-26 11:29:59 +05:00
Ammar Ahmed
205885edf5 mobile: disable app lock when picking file to restore backup 2024-04-26 11:29:59 +05:00
Abdullah Atta
8ffb49b700 desktop: fix Unexpected token 'with' on build 2024-04-26 10:30:44 +05:00
Abdullah Atta
25b18a2edd ci: pin node version to 20.2.0 2024-04-26 10:24:54 +05:00
Abdullah Atta
cfea85c8fb web: add v3 feature highlights 2024-04-26 09:35:06 +05:00
Abdullah Atta
82fc6d31c3 web: fix new notes not getting assigned to default notebook 2024-04-26 09:15:35 +05:00
Abdullah Atta
fb2de1753e web: fix full screen test 2024-04-26 09:06:00 +05:00
Ammar Ahmed
ceb5ce5cdd mobile: add quick settings tile on android 2024-04-26 08:49:38 +05:00
Ammar Ahmed
98d443001c mobile: fix no placeholder text on share widget 2024-04-26 08:49:38 +05:00
Abdullah Atta
5115dee069 core: fix crash when converting html to text 2024-04-26 08:28:32 +05:00
Abdullah Atta
0dc29c7026 core: refactor reminder upcoming time sql 2024-04-26 07:49:47 +05:00
Muhammad Ali
a5eb5e9df3 core: fix incorrect upcoming time in weekly/monthly reminders (#4464) 2024-04-25 16:22:34 +05:00
Ammar Ahmed
b680575328 mobile: fix padding of internal editors on mobile 2024-04-25 15:50:17 +05:00
Ammar Ahmed
c94ef616a5 mobile: improve ui of side menu user section 2024-04-25 15:31:10 +05:00
Ammar Ahmed
3ae40c09fc mobile: fix db init in background failing 2024-04-25 15:31:10 +05:00
Ammar Ahmed
5de4e00ce2 mobile: enable background sync by default 2024-04-25 15:31:10 +05:00
Ammar Ahmed
99e4e61a55 mobile: fix notebook sheet does not remember last position 2024-04-25 15:31:10 +05:00
Abdullah Atta
1ad7bfb82f web: fix settings dialog side bar transparent from bottom 2024-04-25 14:43:21 +05:00
Abdullah Atta
30ef679432 web: fix empty editor after unlocking app 2024-04-25 13:40:11 +05:00
Abdullah Atta
bb97f5e757 clipper(web): update app logo 2024-04-25 13:00:29 +05:00
Abdullah Atta
6cd5a04470 desktop: update app logo 2024-04-25 13:00:17 +05:00
Abdullah Atta
0c32ebf163 web: update app logo 2024-04-25 13:00:07 +05:00
Abdullah Atta
e150e08f29 editor: fix crash on dragging a react node 2024-04-25 10:38:40 +05:00
Ammar Ahmed
bbd603f10c docs: update logo 2024-04-25 10:23:05 +05:00
Ammar Ahmed
677944cba9 docs: remove mentions of topic 2024-04-25 10:23:05 +05:00
Ammar Ahmed
dd2cee53d3 mobile: update app logo 2024-04-25 10:23:05 +05:00
Ammar Ahmed
60c8d5ac89 mobile: fix notes in notifications not launch on app start 2024-04-25 10:23:05 +05:00
Ammar Ahmed
59276de406 mobile: fix background sync 2024-04-25 10:23:05 +05:00
Abdullah Atta
67981be516 desktop: clonableCryptoKey is always true on desktop 2024-04-25 10:17:37 +05:00
Abdullah Atta
77dfcec08c web: fix attachments ui in properties 2024-04-24 11:45:15 +05:00
Abdullah Atta
c4360ab95f common: fix exports 2024-04-24 11:45:00 +05:00
Abdullah Atta
17c4b72381 web: minor ui fix 2024-04-23 09:35:01 +05:00
Ammar Ahmed
e91cc2bdca mobile: support pinned editor tabs 2024-04-22 15:55:10 +05:00
Abdullah Atta
811f2305ec core: disable transactions for now 2024-04-22 12:23:43 +05:00
Abdullah Atta
98a707b5f5 setup: remove --prefer-offline 2024-04-22 09:52:26 +05:00
Abdullah Atta
aa9b24fa10 core: do not run auto sync on changes in notehistory & sessioncontent collections 2024-04-22 09:37:54 +05:00
Abdullah Atta
0b3060e4c0 web: improve error reporting if a query fails 2024-04-22 09:14:10 +05:00
Ammar Ahmed
d523db84cc mobile: fix back gesture handler broken in editor 2024-04-22 08:38:32 +05:00
Abdullah Atta
6a6a9ae6b3 ci: install @zip.js/zip.js before running web tests 2024-04-20 19:48:18 +05:00
Abdullah Atta
b1bc28e069 ci: install dayjs before running web tests 2024-04-20 19:41:47 +05:00
Abdullah Atta
f95c068bc1 web: fix all tests 2024-04-20 16:42:11 +05:00
Abdullah Atta
0e4cd087d4 core: add tests for virtualized grouping 2024-04-20 16:42:11 +05:00
Ammar Ahmed
f217b8cfec mobile: add borders to dialogs & sheet 2024-04-19 12:26:25 +05:00
Ammar Ahmed
d3787efbf0 web: fix wording of trash interval 2024-04-19 12:26:09 +05:00
Ammar Ahmed
e279878b12 mobile: improve move note sheet ux 2024-04-19 12:00:13 +05:00
Ammar Ahmed
154a227be0 mobile: fix placeholder item height in compact mode 2024-04-19 10:32:53 +05:00
Ammar Ahmed
756259c907 mobile: minor improvement in list 2024-04-19 10:23:12 +05:00
Ammar Ahmed
453ed4820a mobile: remove beta tag from reminders 2024-04-19 10:23:12 +05:00
Ammar Ahmed
10ab612366 mobile: fix section header title for rtl lang 2024-04-19 10:23:12 +05:00
Ammar Ahmed
8dc4f7ed3d mobile: remove v3 beta notice on login page 2024-04-19 10:23:12 +05:00
Ammar Ahmed
a73538bafc mobile: use border color for borders 2024-04-19 10:23:12 +05:00
Abdullah Atta
014887c7dc core: fix virtualized grouping showing duplicate groups 2024-04-19 10:14:22 +05:00
Abdullah Atta
246e49bd8c web: remove beta tag 2024-04-18 15:48:47 +05:00
Ammar Ahmed
146ac12935 mobile: fix search not update on changing item property 2024-04-18 14:48:37 +05:00
Abdullah Atta
4f5245adcf web: fix changing readonly doesn't update editor 2024-04-18 13:26:59 +05:00
Abdullah Atta
0bc0cc5729 Merge branch 'v3-beta' 2024-04-18 13:19:33 +05:00
Ammar Ahmed
1136072eff mobile: improve search experience 2024-04-18 13:11:43 +05:00
Ammar Ahmed
4cc8a538a4 mobile: make side bar order stateful 2024-04-18 13:11:43 +05:00
Abdullah Atta
271913ba20 core: fix migrate to sqlite progress reporting 2024-04-18 12:53:16 +05:00
Abdullah Atta
3efe541869 web: fix nav menu items order not respected 2024-04-18 12:17:31 +05:00
Abdullah Atta
b3bcdd4f9c web: fix status bar hidden 2024-04-18 12:06:01 +05:00
Abdullah Atta
13f739763c desktop: use secure dns by default 2024-04-18 11:26:22 +05:00
Abdullah Atta
bde2b26133 web: bring back publish button in top action bar 2024-04-18 11:26:01 +05:00
Abdullah Atta
6eef65952d editor: fix simple checklist not working in firefox 2024-04-18 10:23:23 +05:00
Abdullah Atta
3d85795216 common: add toolbar migration for addInternalLink tool 2024-04-18 10:00:55 +05:00
Ammar Ahmed
f1a1989990 misc: update deps 2024-04-18 09:49:56 +05:00
Ammar Ahmed
76ff5eddd0 mobile: fix tests 2024-04-18 09:49:56 +05:00
Ammar Ahmed
068ee8dc68 mobile: support drag & drop images on iOS 2024-04-18 09:49:56 +05:00
Ammar Ahmed
bbf0fb641b mobile: fix attachment upload from base64 2024-04-18 09:49:56 +05:00
Ammar Ahmed
3cae22faf1 core: fix upload attachment from content 2024-04-18 09:49:56 +05:00
Abdullah Atta
34a4a27ba0 web: reduce batch size to 100 2024-04-18 09:43:18 +05:00
Abdullah Atta
d96a78c741 web: middle click should close tab even if there is scroll 2024-04-18 09:40:41 +05:00
Abdullah Atta
c9e5ee9ddb core: use database logger instead of console.error 2024-04-18 09:37:21 +05:00
Abdullah Atta
f43c2a40f5 web: do not jump to focus the same item again 2024-04-18 08:52:12 +05:00
Abdullah Atta
b12a0e979c web: send contentId when saving a note's content 2024-04-17 16:14:20 +05:00
Abdullah Atta
d0372b82db core: add content noteId to sqlite index 2024-04-17 16:14:00 +05:00
Abdullah Atta
dac1441add web: fix various crashes 2024-04-17 14:53:05 +05:00
Abdullah Atta
a65ebec7ae web: replace allotment with react-resizable-panels 2024-04-17 14:23:19 +05:00
Abdullah Atta
d5cf65e568 web: fix potential crash when saving note 2024-04-16 23:36:38 +05:00
Ammar Ahmed
424073298e mobile: fix quick note widget not working 2024-04-16 23:24:50 +05:00
Abdullah Atta
580c83687e desktop: fix build on windows 2024-04-16 22:27:20 +05:00
Abdullah Atta
de226a8ab6 web: bump version to 3.0.14 2024-04-16 12:48:45 +05:00
Abdullah Atta
8b94b08066 web: handle error when scheduling a cron task 2024-04-16 12:08:22 +05:00
Abdullah Atta
18c460a8b2 web: fix padding at bottom on opening a nested notebook 2024-04-15 22:11:24 +05:00
Abdullah Atta
fbb3a56c0c core: fix too many SQL variables error on trash cleanup 2024-04-15 22:01:32 +05:00
Ammar Ahmed
48f602d4fe mobile: fix help links 2024-04-15 22:01:12 +05:00
Abdullah Atta
ad2b68c8ed editor: fix notes with task lists taking too long to load 2024-04-15 20:55:07 +05:00
Abdullah Atta
c2eafccf2a editor: fix note with task list saving on open 2024-04-15 20:35:50 +05:00
Ammar Ahmed
5ca74b6127 mobile: handle native error 2024-04-09 17:00:32 +05:00
Ammar Ahmed
143a38ade6 mobile: set privacy screen when app lock settings change 2024-04-09 16:36:30 +05:00
Ammar Ahmed
40cff39713 mobile: bump version 2024-04-09 16:28:52 +05:00
Ammar Ahmed
3efa1140b2 mobile: fix editor padding 2024-04-09 16:28:15 +05:00
Ammar Ahmed
64f28aedbf mobile: revert timer change 2024-04-09 16:03:27 +05:00
Ammar Ahmed
74e3a28e2a mobile: fix app state 2024-04-09 16:02:45 +05:00
Ammar Ahmed
58c324b2ac mobile: minor fixes 2024-04-09 15:35:17 +05:00
Abdullah Atta
25fa2dc406 clipper: publish v0.3.2 2024-04-09 14:59:07 +05:00
Abdullah Atta
3e76f3b8c6 clipper: allow web clipper to connect with v3 web app 2024-04-09 14:58:55 +05:00
Abdullah Atta
a12a3fbdc8 clipper: publish v0.3.1 2024-04-09 14:07:49 +05:00
Abdullah Atta
46c492c92a web: fix no column notes.id on opening web clipper 2024-04-09 13:58:29 +05:00
Abdullah Atta
dbace71754 web: bump version to 3.0.13 2024-04-09 13:41:31 +05:00
Abdullah Atta
ece5b56bdd web: add tracing to debug empty content on save issue 2024-04-09 13:37:58 +05:00
Abdullah Atta
c35dd826dc core: fix too many SQL variables error on bulk deletion 2024-04-09 13:17:12 +05:00
Abdullah Atta
675324f6af web: fix color check status not updating in properties 2024-04-09 12:33:27 +05:00
Abdullah Atta
8788a14229 web: send error as is instead of copying it in shared service 2024-04-09 12:19:23 +05:00
Abdullah Atta
c8f697c5b1 web: fix context menu not opening on attachments 2024-04-09 11:57:32 +05:00
Abdullah Atta
48a4d67c13 web: handle errors during attachments download 2024-04-09 11:50:16 +05:00
Abdullah Atta
e4289bb69e web: fix gradients not rendering in app logo 2024-04-09 03:12:53 +05:00
Abdullah Atta
7000c67535 core: fix no such column: dateEdited on sorting tags 2024-04-09 02:56:13 +05:00
Abdullah Atta
0eb61c80fa web: improve loading of really long notes 2024-04-09 02:46:27 +05:00
Abdullah Atta
4bbd43e54b editor: speed up note loading significantly 2024-04-09 01:37:30 +05:00
Abdullah Atta
ce949d94f2 editor: use css containment for editor 2024-04-09 01:37:30 +05:00
Abdullah Atta
bdbf205745 editor: simplify link node detection 2024-04-09 01:37:30 +05:00
Abdullah Atta
899ab2ddb1 editor: use schema from editor directly 2024-04-09 01:37:30 +05:00
Abdullah Atta
a302276af9 editor: speed up setting block id on edit 2024-04-09 01:37:30 +05:00
Abdullah Atta
ee14a292ab editor: use alfaaz for word counting 2024-04-09 01:37:30 +05:00
Ammar Ahmed
646949c96c mobile: bump version 2024-04-04 17:28:46 +05:00
Ammar Ahmed
ebfb5c29dd editor: minor fixes 2024-04-04 13:35:45 +05:00
Ammar Ahmed
3932ae62b0 mobile: minor fixes in editor 2024-04-04 13:00:40 +05:00
Ammar Ahmed
f671d2dec0 editor: fix position out of range error 2024-04-04 11:47:18 +05:00
Ammar Ahmed
6261f3f2c6 mobile: accept shared title in extension 2024-04-04 08:10:26 +05:00
Ammar Ahmed
1b9802b8e0 mobile: make add notebook button floating 2024-04-04 06:24:25 +05:00
Ammar Ahmed
ca95af7043 core: add missing settings keys 2024-04-04 06:23:53 +05:00
Abdullah Atta
0aac2eb1e0 web: set max editor session duration to 5 minutes 2024-04-04 00:40:40 +05:00
Abdullah Atta
c10d083dab web: fix flickering in footer during save indicator update 2024-04-04 00:19:09 +05:00
Abdullah Atta
27c6cdec47 editor: fix typo 2024-04-03 23:59:58 +05:00
Abdullah Atta
8fd0f97dfe core: fix search queries with 3 characters not allowed 2024-04-03 17:34:24 +05:00
Abdullah Atta
59d65a2cbb editor: fix crash if code block language contains space 2024-04-03 16:51:17 +05:00
Abdullah Atta
9bd978b8c6 web: fix notebook title not updating on edit 2024-04-03 16:44:43 +05:00
Abdullah Atta
d6e22f2e3e web: fix task list header overlapping toolbar 2024-04-03 16:34:47 +05:00
Abdullah Atta
a9a1290530 web: fix text not selectable from bottom of editor 2024-04-03 16:11:42 +05:00
Abdullah Atta
b8eab5bddc web: fix crash on showing announcement 2024-04-03 16:05:20 +05:00
Abdullah Atta
6836d6551f editor: fix image size resetting on opening new tab 2024-04-03 16:05:03 +05:00
Abdullah Atta
8e07ae8b26 web: press escape to exit search 2024-04-03 15:35:50 +05:00
Abdullah Atta
b013a1cfa7 editor: fix collapsed callouts not rendering correctly 2024-04-03 15:33:28 +05:00
Abdullah Atta
0650d00ca1 web: close tab on moving note to trash 2024-04-03 15:24:10 +05:00
Abdullah Atta
c048f789e7 desktop: fix toggles in properties not working 2024-04-03 15:01:58 +05:00
Abdullah Atta
9c158dfa53 setup: exclude better-sqlite3 & sodium-native from rebuild 2024-04-02 15:19:00 +05:00
Abdullah Atta
168be74277 global: update lockfiles 2024-04-02 14:38:22 +05:00
Abdullah Atta
016532ef42 ci: use brew to install setuptools 2024-04-02 12:33:11 +05:00
Abdullah Atta
7368796a72 ci: fix No module named 'distutils' 2024-04-02 12:14:40 +05:00
Abdullah Atta
b3e10de0a1 desktop: get rid of @elctron/rebuild 2024-04-02 12:13:06 +05:00
Abdullah Atta
dd674d38df desktop: ignore errors during update check 2024-04-02 11:58:33 +05:00
Abdullah Atta
a427e32796 web: bump version to 3.0.12 2024-04-02 11:52:27 +05:00
Abdullah Atta
b44d2e5c9b web: fix tests 2024-04-02 11:51:33 +05:00
Abdullah Atta
c42d046188 desktop: fix left margin in titlebar 2024-04-01 17:26:23 +05:00
Abdullah Atta
ae5f9f0f4a desktop: add @electron/rebuild 2024-04-01 17:20:41 +05:00
Abdullah Atta
1681a587b9 web: add margins before tabs in web app 2024-04-01 17:20:12 +05:00
Abdullah Atta
b43d51aa72 desktop: fix custom title bar on linux 2024-04-01 17:17:28 +05:00
Abdullah Atta
f99d4bc013 web: fix pressing Fix it resulted in database error 2024-04-01 12:50:11 +05:00
Abdullah Atta
430c2f51f6 web: fix create vault dialog cannot be closed 2024-04-01 11:54:14 +05:00
Abdullah Atta
b55b521def core: fix Cannot read property 'sortBy' of undefined 2024-04-01 11:43:51 +05:00
Abdullah Atta
c26e2d800d editor: add Shift+Mod+L shortcut for adding internal links 2024-04-01 11:38:59 +05:00
Ammar Ahmed
310de9f950 mobile: export notes 2024-04-01 11:27:10 +05:00
Abdullah Atta
9109c5180a editor: remove display: inline for floating images 2024-04-01 11:27:10 +05:00
Abdullah Atta
db57c125d6 web: use new export utility from @notesnook/common 2024-04-01 11:27:10 +05:00
Abdullah Atta
3ec177c631 web: expose streaming file decryption 2024-04-01 11:27:10 +05:00
Abdullah Atta
fa561df14f web: allow reading data from stream when writing zip 2024-04-01 11:27:10 +05:00
Abdullah Atta
b0abf56f20 common: add export notes utility
this utility resolves attachments & internal links
2024-04-01 11:27:09 +05:00
Abdullah Atta
a4ac051af0 core: minor changes 2024-04-01 11:27:09 +05:00
Abdullah Atta
7a2db59516 core: fix export of floating images 2024-04-01 11:27:09 +05:00
Abdullah Atta
76c33e3cbc core: add support for resolving attachments & internal links 2024-04-01 11:27:09 +05:00
Abdullah Atta
fd295b226a core: remove unused methods 2024-04-01 11:27:09 +05:00
Abdullah Atta
9bb82aebfe core: improve export performance 2024-04-01 11:27:09 +05:00
Abdullah Atta
38c6dd3953 web: integrate the tab bar like before 2024-04-01 11:23:56 +05:00
Abdullah Atta
0517f61164 web: enable custom title bar in the web app 2024-04-01 11:23:56 +05:00
Ammar Ahmed
17289f2df6 desktop: fix output binary path 2024-04-01 11:23:56 +05:00
Abdullah Atta
44a7f057ac desktop: fix titlebar alignment 2024-04-01 11:23:56 +05:00
Ammar Ahmed
be5d0820d5 desktop: fix title bar for macos 2024-04-01 11:23:56 +05:00
Abdullah Atta
23bd4a564f desktop: add custom titlebar 2024-04-01 11:23:56 +05:00
Ammar Ahmed
be41cf1252 mobile: show readonly icon on note item 2024-03-30 12:06:56 +05:00
Ammar Ahmed
cf643fe0b0 mobile: fix link notebooks sheet 2024-03-30 11:51:07 +05:00
Ammar Ahmed
988efa4577 mobile: show sync disabled icon on note 2024-03-30 11:50:24 +05:00
Ammar Ahmed
631160c2c9 mobile: fix colors on color page 2024-03-30 09:47:13 +05:00
Abdullah Atta
ebe3f2b771 web: make shared sqlite more robust 2024-03-29 15:49:25 +05:00
Abdullah Atta
3e300d98c4 web: handle more errors in error boundary 2024-03-29 15:49:08 +05:00
Abdullah Atta
1a1e673a6c web: fix double app refresh on logout 2024-03-29 15:48:41 +05:00
Abdullah Atta
6ce08b5aa3 web: do not destroy db on tab/window close 2024-03-29 15:48:26 +05:00
Abdullah Atta
2ef0d5b5cd web: fix profile settings not updating on logout 2024-03-29 15:39:00 +05:00
Abdullah Atta
a15978bf6a core: separate db setup & init 2024-03-29 15:38:36 +05:00
Abdullah Atta
8fb8c54157 core: do not close db connection on reset 2024-03-29 15:38:17 +05:00
Abdullah Atta
9f4647be47 core: add support for dropping triggers 2024-03-29 15:37:59 +05:00
Abdullah Atta
1a38da30f4 web: reduce provider port retry delay to 50ms 2024-03-28 10:00:27 +05:00
Abdullah Atta
c3d244b3b6 web: always keep one tab open 2024-03-28 09:56:23 +05:00
Abdullah Atta
751af3c2d1 web: add support for multiple browser tabs & windows 2024-03-28 09:50:37 +05:00
Abdullah Atta
ec00779062 core: only create triggers if they do not exist 2024-03-28 09:50:37 +05:00
Abdullah Atta
165ba064a9 core: add support for skipping database initialization 2024-03-28 09:50:37 +05:00
Ammar Ahmed
2763068e21 mobile: release v3.0.15 2024-03-27 12:39:59 +05:00
Ammar Ahmed
210bdeaed0 mobile: fix vault unlocking 2024-03-27 11:48:56 +05:00
Ammar Ahmed
3037a153dd mobile: fix app lock key decryption error 2024-03-27 11:48:56 +05:00
Abdullah Atta
474fb597c6 web: respect tag casing 2024-03-27 11:28:05 +05:00
Abdullah Atta
6c19968ef6 desktop: fix ENOENT error when saving backup 2024-03-27 11:26:35 +05:00
Abdullah Atta
38dedcbc3c web: change backup filename format 2024-03-27 11:26:35 +05:00
Abdullah Atta
0e066d5d63 desktop: handle error during update check 2024-03-27 11:26:35 +05:00
Ammar Ahmed
d45a65edea mobile: fix applock unlocks app on entering any pin 2024-03-27 09:40:45 +05:00
Abdullah Atta
98e3c2955b core: fix groups returning only 1 group 2024-03-26 12:29:41 +05:00
Abdullah Atta
9c0eca0891 web: bump version to 3.0.11 2024-03-26 11:53:15 +05:00
Abdullah Atta
32c377a0ea web: add v3 beta notice on login screen 2024-03-26 11:53:15 +05:00
Ammar Ahmed
02145ec17e mobile: release v3.0.14 2024-03-26 11:50:44 +05:00
Abdullah Atta
9e1a864f54 web: fix tests 2024-03-26 11:45:09 +05:00
Abdullah Atta
4989dc4301 web: focus item in list when switching tabs 2024-03-26 11:45:08 +05:00
Abdullah Atta
4f43e4eab5 web: fix reminder cannot be edited 2024-03-26 11:45:08 +05:00
Ammar Ahmed
d59219e62b mobile: fix applock toggles working without verification 2024-03-26 11:44:46 +05:00
Ammar Ahmed
5f5209af8c mobile: fix sidemenu ui 2024-03-26 11:40:11 +05:00
Ammar Ahmed
6a9e6065d1 mobile: fix typo 2024-03-26 11:36:32 +05:00
Ammar Ahmed
00119dbefe mobile: add notice on login page 2024-03-26 11:26:57 +05:00
Ammar Ahmed
c466af60a6 mobile: resize textarea after delay in title 2024-03-26 11:05:41 +05:00
Ammar Ahmed
e5512974d5 mobile: no need to check editor ready state 2024-03-26 11:05:23 +05:00
Ammar Ahmed
7861fa0b11 mobile: fix title of preview tab 2024-03-26 11:05:08 +05:00
Ammar Ahmed
c20dbf1158 mobile: fix recyclerlistview crash 2024-03-26 09:32:43 +05:00
Ammar Ahmed
9e7c302693 mobile: minor bug fixes 2024-03-26 08:57:23 +05:00
Abdullah Atta
e007f2592c core: add extensive grouping/sorting tests 2024-03-26 07:55:23 +05:00
Abdullah Atta
3a5ea3e8ef web: fix sidebar items are not reorderable 2024-03-25 15:11:03 +05:00
Abdullah Atta
0a0edd4814 web: middle click on note to open it in new tab 2024-03-25 13:37:26 +05:00
Abdullah Atta
62bbea01e6 web: middle click on tab to close it 2024-03-25 13:16:42 +05:00
Abdullah Atta
3730596030 editor: fix random crash Cannot read properties of null (reading 'domFromPos') 2024-03-25 13:06:06 +05:00
Abdullah Atta
7f176942ba editor: cancel image download on switching notes 2024-03-25 13:02:11 +05:00
Abdullah Atta
72a09f48e0 desktop: prevent downloading multiple updates 2024-03-25 12:38:30 +05:00
Abdullah Atta
632291e901 web: crash on assigning a tag from editor 2024-03-25 12:17:15 +05:00
Abdullah Atta
17352e783b web: navigate to root notebook or notebooks on deletion 2024-03-25 12:05:44 +05:00
Abdullah Atta
d8729f8171 core: ignore trash when checking notebook existence 2024-03-25 12:05:25 +05:00
Abdullah Atta
8ac8f8f56a desktop: fix crash on showing reminder notification with no description 2024-03-25 11:11:49 +05:00
Abdullah Atta
a2cfa8873f core: fix sync tests 2024-03-23 07:23:02 +05:00
Abdullah Atta
13a7f39d27 mobile: bump version to 3.0.13 2024-03-23 06:32:18 +05:00
Abdullah Atta
4e22a5605b web: bump version to 3.0.10 2024-03-23 06:29:24 +05:00
Abdullah Atta
0afcf8cbab core: fix The item must contain the id field. error on migration 2024-03-23 06:27:59 +05:00
Licaon_Kter
c54759e766 Remove gradle property unused in Java 17
Signed-off-by: Licaon_Kter <licaon-kter@users.noreply.github.com>
2024-03-22 23:17:45 +05:00
Ammar Ahmed
b1d13c125f mobile: bump version code on ios 2024-03-22 11:29:07 +05:00
Ammar Ahmed
85aab9506c mobile: release v3.0.12 2024-03-22 11:17:43 +05:00
Abdullah Atta
728b63b001 setup: revert "disable esbuild rebuild" 2024-03-22 11:13:31 +05:00
Abdullah Atta
b91567e2cf setup: disable esbuild rebuild 2024-03-22 11:09:22 +05:00
Abdullah Atta
c3179542a6 web: bump version to 3.0.9 2024-03-22 11:04:45 +05:00
Abdullah Atta
7ea575a1b8 web: fix locked note immediately getting locked on edit 2024-03-22 11:01:35 +05:00
Abdullah Atta
d2eeb93339 core: make tag title matching case sensitive 2024-03-22 10:51:56 +05:00
Abdullah Atta
ca59670b68 web: show errors during tag edit/create 2024-03-22 10:45:48 +05:00
Abdullah Atta
a1117d77f3 core: prevent tags with duplicate names 2024-03-22 10:45:48 +05:00
Ammar Ahmed
e7ee455ee3 mobile: throw error when renaming tag to existing tag title 2024-03-22 10:30:34 +05:00
Abdullah Atta
9ad9c0c633 core: fix duplicate tags created during migration 2024-03-22 10:16:00 +05:00
Abdullah Atta
ec2a6f26e6 core: add date created in tag/color during migration 2024-03-22 10:16:00 +05:00
Abdullah Atta
ead4f59ba7 web: use plain divs for rendering item skeleton 2024-03-22 10:15:59 +05:00
Abdullah Atta
c4f0cd18ad core: generate setting key ids once
this greatly improves performance because md5 id generation is slow
2024-03-22 10:15:59 +05:00
Ammar Ahmed
77d5bd71f9 mobile: minor ui fixes 2024-03-22 09:33:40 +05:00
Ammar Ahmed
eb0aff2fc3 mobile: fix tags not rendered in note properties 2024-03-22 09:24:14 +05:00
Ammar Ahmed
e4e1eb0ced mobile: fix tag delete in bulk 2024-03-22 09:24:14 +05:00
Ammar Ahmed
116a017938 mobile: add try/catch to check item loading issues 2024-03-22 09:24:14 +05:00
Ammar Ahmed
6dfbb27c33 core: fix user profile cleared on clearing an profile data 2024-03-22 09:24:14 +05:00
Ammar Ahmed
097c6915fb mobile: migrate user profile to settings 2024-03-22 09:24:14 +05:00
Abdullah Atta
97490a5e37 web: make app work in offline mode 2024-03-22 08:19:28 +05:00
Abdullah Atta
799678efca common: fix type error 2024-03-22 07:23:53 +05:00
Abdullah Atta
e3afb1d068 web: use user profile from settings 2024-03-21 13:17:03 +05:00
Abdullah Atta
d32db74ccc core: move user profile to settings collection 2024-03-21 13:16:21 +05:00
Abdullah Atta
e24452c386 editor: remove not an image error thrown when downloading images 2024-03-21 12:42:23 +05:00
Abdullah Atta
68e97f17d0 editor: fix clicking on internal link opens a new tab 2024-03-21 12:28:26 +05:00
Abdullah Atta
9040a4561d editor: fix Cannot read properties of null (reading 'posFromDOM') error 2024-03-21 12:28:07 +05:00
Abdullah Atta
1ed8205f45 web: show reload app button in error overlay 2024-03-21 12:07:25 +05:00
Abdullah Atta
feaa207f68 common: do not render undefined items 2024-03-21 12:06:56 +05:00
Abdullah Atta
76e766583c core: filter out ids that have no note against them on lookup 2024-03-21 12:04:07 +05:00
Ammar Ahmed
f15446b1d6 mobile: bump version code 2024-03-21 11:45:03 +05:00
Ammar Ahmed
18be9fda41 mobile: bump android version code to 3000 2024-03-21 11:22:49 +05:00
Abdullah Atta
9b3430b5d9 web: fix editor tags not updated when creating note in a tag 2024-03-21 11:22:49 +05:00
Abdullah Atta
5b79fbd7b5 web: highlight changes in diff viewer 2024-03-21 11:22:49 +05:00
Abdullah Atta
cc0be4565d editor: refactor diff highlighter extension 2024-03-21 11:22:49 +05:00
Abdullah Atta
41865fb286 web: bump version to 3.0.8 2024-03-21 11:22:49 +05:00
Ammar Ahmed
37507d4f0a mobile: release v3.0.11 2024-03-21 11:22:49 +05:00
Ammar Ahmed
755a8d45e9 mobile: update Pods 2024-03-21 11:22:49 +05:00
Abdullah Atta
357d872362 web: fix assigning a color removes that color from all other notes 2024-03-21 11:22:49 +05:00
Abdullah Atta
63be4088a5 web: fix changes in callout heading not causing toc update 2024-03-21 11:22:49 +05:00
Abdullah Atta
7e4d123a51 web: fix toc items not indented 2024-03-21 11:22:49 +05:00
Abdullah Atta
1a2ce6ba72 editor: add block-id on nodes inside callout 2024-03-21 11:22:49 +05:00
Abdullah Atta
adb3805ec7 editor: disable conflicting simple checklist input rule 2024-03-21 11:22:49 +05:00
Ammar Ahmed
328f324d9e mobile: fix tab title 2024-03-21 11:22:49 +05:00
Abdullah Atta
108c9e2944 web: fix image picker shown when there are 0 images 2024-03-21 11:22:49 +05:00
Abdullah Atta
f2a5ed6642 editor: add support for copy/pasting code blocks with highlighting 2024-03-21 11:22:49 +05:00
Abdullah Atta
e1339617b5 web: fix crash on copying from codeblock 2024-03-21 11:22:48 +05:00
Abdullah Atta
4f22010c56 web: only show content blocks with direct links in referenced in tab 2024-03-21 11:22:48 +05:00
Abdullah Atta
831b8497b2 core: fix extraction of blocks with links 2024-03-21 11:22:48 +05:00
Abdullah Atta
37dd691270 editor: fix hover popup appearing in wrong position 2024-03-21 11:22:48 +05:00
Abdullah Atta
4349445910 editor: fix outline list has no data-block-id attribute 2024-03-21 11:22:48 +05:00
Abdullah Atta
669849018a editor: fix DOMException when removing react node views 2024-03-21 11:22:48 +05:00
Abdullah Atta
71ad15b4b6 editor: minor refactors 2024-03-21 11:22:48 +05:00
Abdullah Atta
732185a69d editor: fix crash on select all + backspace with lists 2024-03-21 11:22:48 +05:00
Abdullah Atta
479dec6998 editor: fix crash on removing task list 2024-03-21 11:22:48 +05:00
Ammar Ahmed
ff6b65c55c editor: enable block id on checklist and callout 2024-03-21 11:22:48 +05:00
Abdullah Atta
6e5493f149 editor: fix react node views for react 18 2024-03-21 11:22:48 +05:00
Ammar Ahmed
b185338be2 editor: always show note internal link button in toolbar 2024-03-21 11:22:48 +05:00
Abdullah Atta
b4161644d0 editor: handle link open on click 2024-03-21 11:22:48 +05:00
Abdullah Atta
61e0fdea50 ui: fix weird zIndex animation on popups 2024-03-21 11:22:48 +05:00
Abdullah Atta
cb124c7445 editor: update tiptap & other packages 2024-03-21 11:22:48 +05:00
Abdullah Atta
fce0d50061 editor: fix newline added in callout on typing anything 2024-03-21 11:22:48 +05:00
Abdullah Atta
dac2a22824 editor: fix => turning into a callout 2024-03-21 11:22:48 +05:00
Abdullah Atta
655bdf3798 editor: fix image size resetting on resize 2024-03-21 11:22:48 +05:00
Abdullah Atta
907bfd04ed web: fix images not getting attached 2024-03-21 11:22:48 +05:00
Abdullah Atta
38ca451d7e web: fix attachment delete dialog not rendering any buttons 2024-03-21 11:22:48 +05:00
Abdullah Atta
52800b39e4 core: fix attachment deletion 2024-03-21 11:22:47 +05:00
Ammar Ahmed
9d700f6fd1 mobile: use contentBlocksWithLinks 2024-03-21 11:22:47 +05:00
Ammar Ahmed
0a5f0d407e core: fix duplicate backlinks shown on note 2024-03-21 11:22:47 +05:00
Ammar Ahmed
a84f3a4434 mobile: cleanup 2024-03-21 11:22:47 +05:00
Ammar Ahmed
1dbd2d8f5f mobile: show error if attachment download fails 2024-03-21 11:22:47 +05:00
Ammar Ahmed
ec1001067d core: support video,audio,document filter in attachments 2024-03-21 11:22:47 +05:00
Ammar Ahmed
0374aa17c4 mobile: fix all attachments showin in note attachments 2024-03-21 11:22:47 +05:00
Abdullah Atta
78cbce5ca0 editor: #dialogContainer > .dialogContainer 2024-03-21 11:22:47 +05:00
Abdullah Atta
65c988cf36 web: fix editor dom structure 2024-03-21 11:22:47 +05:00
Abdullah Atta
1487bf027a web: fix editor toolbar is not sticky 2024-03-21 11:22:47 +05:00
Ammar Ahmed
c5ec5f127d editor: fix collapsing a callout collapses all parent callouts 2024-03-21 11:22:47 +05:00
Ammar Ahmed
2627c83e79 mobile: fix webpack config 2024-03-21 11:22:47 +05:00
Ammar Ahmed
d54f2351f6 mobile: release v3.0.10 2024-03-21 11:22:47 +05:00
Ammar Ahmed
460c2b4662 mobile: open note in new tab 2024-03-21 11:22:47 +05:00
Ammar Ahmed
cf5fac7d41 mobile: fix incorrect tab content by default 2024-03-21 11:22:47 +05:00
Ammar Ahmed
8d4ae8e970 mobile: fix incorrect button type in dialog 2024-03-21 11:22:47 +05:00
Ammar Ahmed
f9db4d49b1 mobile: fix publish button hidden on tablet 2024-03-21 11:22:46 +05:00
Ammar Ahmed
728b22f337 mobile: cleanup 2024-03-21 11:22:46 +05:00
Ammar Ahmed
de42a895dd mobile: update deps 2024-03-21 11:22:46 +05:00
Ammar Ahmed
0b813b3fa1 mobile: fix app lock shows on session expired sheet 2024-03-21 11:22:46 +05:00
Ammar Ahmed
d13ff079a4 mobile: support showing diff of conflicted note 2024-03-21 11:22:46 +05:00
Ammar Ahmed
eca9f221ac editor: add highlight diff extension 2024-03-21 11:22:46 +05:00
Ammar Ahmed
48a3f11215 mobile: remove redundant code 2024-03-21 11:22:46 +05:00
Ammar Ahmed
dc7fcb67f0 mobile: render title after loaded 2024-03-21 11:22:46 +05:00
Ammar Ahmed
78e8f932c2 mobile: bump android version 2024-03-21 11:22:46 +05:00
Ammar Ahmed
65678a0995 mobile: fix button action 2024-03-21 11:22:46 +05:00
Ammar Ahmed
2b9381d40e mobile: check if editorController.current is undefined 2024-03-21 11:22:46 +05:00
Ammar Ahmed
0f795ff913 mobile: cleanup 2024-03-21 11:22:46 +05:00
Ammar Ahmed
43cb5d278c mobile: add readonly editor 2024-03-21 11:22:46 +05:00
Abdullah Atta
c7142e409b web: fix more tests 2024-03-21 11:22:11 +05:00
Abdullah Atta
3876cb5ec3 editor: fix some images not loading 2024-03-21 11:22:11 +05:00
Abdullah Atta
47862c3182 web: fix lock/unlock from properties not working 2024-03-21 11:22:11 +05:00
Abdullah Atta
533bef014d web: fix title of locked note not saving 2024-03-21 11:22:11 +05:00
Abdullah Atta
f5ac0b93f6 web: update url on switching between sessions 2024-03-21 11:22:11 +05:00
Abdullah Atta
d5a27b052c web: hide tags input in new session 2024-03-21 11:22:11 +05:00
Abdullah Atta
4a36606121 web: bring back edited date in footer 2024-03-21 11:22:11 +05:00
Abdullah Atta
b69933444c web: fix typing fast in title input caused some characters to miss 2024-03-21 11:22:11 +05:00
Ammar Ahmed
48866efa57 mobile: fix webpack config 2024-03-21 11:22:11 +05:00
Abdullah Atta
c56445f817 global: update lockfiles 2024-03-21 11:22:11 +05:00
Abdullah Atta
18afc0a49c editor: fix type errors 2024-03-21 11:22:11 +05:00
Ammar Ahmed
f38c4bbbac mobile: release v3.0.9 2024-03-21 11:22:11 +05:00
Abdullah Atta
de125a33d1 web: show error if backup import fails 2024-03-21 11:22:11 +05:00
Ammar Ahmed
81b7e34b0d mobile: readd editor overlay 2024-03-21 11:22:11 +05:00
Ammar Ahmed
5d2853d002 mobile: fix tab bugs 2024-03-21 11:22:11 +05:00
Abdullah Atta
ad41544403 web: bump version to 3.0.7 2024-03-21 11:22:10 +05:00
Abdullah Atta
c8bf1fc2cd editor: do not add data-block-id attribute if no blockid 2024-03-21 11:22:10 +05:00
Abdullah Atta
3d25a1d5c2 editor: highlight active block for 5 seconds 2024-03-21 11:22:10 +05:00
Abdullah Atta
a8896b847f core: fix imports 2024-03-21 11:22:10 +05:00
Abdullah Atta
a1b3327aa8 web: improve internal links ui 2024-03-21 11:22:10 +05:00
Abdullah Atta
e9431af138 core: do not wrap text in content blocks 2024-03-21 11:22:10 +05:00
Abdullah Atta
8b07508204 web: ignore realtime sync if it doesn't update content or note title 2024-03-21 11:22:10 +05:00
Abdullah Atta
3e0d9f92af web: fix behavior of editor action bar 2024-03-21 11:22:10 +05:00
Abdullah Atta
0e4a2c7593 web: always show note statistics of active editor 2024-03-21 11:22:10 +05:00
Abdullah Atta
a7a2dcf791 web: fix diff viewer not showing images 2024-03-21 11:22:10 +05:00
Abdullah Atta
47221dc81b web: fix concurrent opfs reads throwing errors 2024-03-21 11:22:10 +05:00
Abdullah Atta
6fb8f11d2f web: await promises 2024-03-21 11:21:08 +05:00
Abdullah Atta
0cfd607806 web: use database updated event to add editor reactivity 2024-03-21 11:21:08 +05:00
Abdullah Atta
a86565a8ec core: fix attachment not unlinked from notes on removal 2024-03-21 11:21:08 +05:00
Abdullah Atta
3ee231e459 core: publish database updated events on content remove/update 2024-03-21 11:21:08 +05:00
Abdullah Atta
335021090d core: refactor database update event logic 2024-03-21 11:21:08 +05:00
Abdullah Atta
b001107135 core: add method to rebuild trash cache 2024-03-21 11:21:08 +05:00
Abdullah Atta
dba1d8645d core: simplify remove from all notebooks logic 2024-03-21 11:21:08 +05:00
Abdullah Atta
9dff23bdd5 core: publish database updated event on relations unlink 2024-03-21 11:21:08 +05:00
Abdullah Atta
90e48cbc16 core: fix note not unlinked from vault on unlock 2024-03-21 11:21:08 +05:00
Abdullah Atta
4a1a912d0f core: rebuild trash cache on sync complete 2024-03-21 11:21:08 +05:00
Abdullah Atta
8a6328ef07 web: reopen notes after permanently deleting an attachment 2024-03-21 11:21:08 +05:00
Abdullah Atta
a66c72e099 web: fix content is not updated for new notes in realtime sync 2024-03-21 11:21:07 +05:00
Abdullah Atta
652cbcda52 web: update editor sessions in realtime 2024-03-21 11:21:07 +05:00
Abdullah Atta
199c5d3e64 web: do not show internal links, notebooks etc in properties for trash preview 2024-03-21 11:21:07 +05:00
Abdullah Atta
8b1b569fee web: fix editor title not changing on realtime sync 2024-03-21 11:21:07 +05:00
Abdullah Atta
d869a69477 web: special icons for readonly and trash preview tabs 2024-03-21 11:21:07 +05:00
Abdullah Atta
00995431f4 web: fix trash note preview is not readonly 2024-03-21 11:21:07 +05:00
Abdullah Atta
cec7c5f3b1 core: standarize database updated event 2024-03-21 11:21:07 +05:00
Abdullah Atta
47ae03ba8a global: upgrade typescript to 5.4.2 2024-03-21 11:21:07 +05:00
Abdullah Atta
3aa3858981 web: fix type errors 2024-03-21 11:21:06 +05:00
Abdullah Atta
67fa1d6bb4 core: sort & group reminders in sqlite 2024-03-21 11:21:06 +05:00
Ammar Ahmed
00ecb149df mobile: minor cleanup 2024-03-21 11:21:06 +05:00
Ammar Ahmed
d931d20006 mobile: fix search in share extension 2024-03-21 11:21:06 +05:00
Ammar Ahmed
b4a0e97e3f editor: do not focus editor on end search 2024-03-21 11:21:06 +05:00
Ammar Ahmed
8edcfcf2f1 mobile: fix editor tab bugs 2024-03-21 11:21:06 +05:00
Ammar Ahmed
6a8ccf9401 mobile: fix use-db-item hook not working 2024-03-21 11:21:06 +05:00
Ammar Ahmed
e2eab24574 mobile: fix attachment exists check when uploading file 2024-03-21 11:21:06 +05:00
Ammar Ahmed
6a4e31e972 mobile: fix attachment progress not working 2024-03-21 11:21:06 +05:00
Ammar Ahmed
04f54f79fa mobile: fix note with attachments not saved from share extension 2024-03-21 11:21:05 +05:00
Ammar Ahmed
c148c6b9cf mobile: fix share extension append to exisitng note not working 2024-03-21 11:21:05 +05:00
Ammar Ahmed
030cbefe3f common: up version when migrating toolbar 2024-03-21 11:21:05 +05:00
Abdullah Atta
85342e5f74 core: fix table x has no column y errors 2024-03-21 11:21:05 +05:00
Ammar Ahmed
46565aa45c mobile: blur editor on back 2024-03-21 11:21:05 +05:00
Abdullah Atta
8496423b50 web: use dnd-kit for smoother drag/drop in tabs 2024-03-21 11:21:05 +05:00
Abdullah Atta
e39be83f70 web: always sort pinned tabs first 2024-03-21 11:21:05 +05:00
Abdullah Atta
3a6d1e7a76 web: fix pinned tabs getting unpinned after app refresh 2024-03-21 11:21:05 +05:00
Ammar Ahmed
15fc1d0cca mobile: add useNoteLocked hook 2024-03-21 11:21:05 +05:00
Ammar Ahmed
685322f02a mobile: fix ui of linked blocks 2024-03-21 11:21:05 +05:00
Ammar Ahmed
b849861146 mobile: fix jump to block 2024-03-21 11:21:05 +05:00
Ammar Ahmed
91e041108c mobile: fix content block ui 2024-03-21 11:21:05 +05:00
Ammar Ahmed
76f2ac2c1d mobile: fix loading placeholder position 2024-03-21 11:21:05 +05:00
Ammar Ahmed
bc11999201 mobile: fix colors and size of icons in editor header 2024-03-21 11:21:05 +05:00
Ammar Ahmed
103b1b88f5 mobile: use flatlist for rendering tabs 2024-03-21 11:21:05 +05:00
Ammar Ahmed
5b703fe53a mobile: show keyboard when opening new tab or empty tab 2024-03-21 11:21:05 +05:00
Ammar Ahmed
ab33aa7ebd mobile: make tab active on focus 2024-03-21 11:21:04 +05:00
Ammar Ahmed
4db043b111 mobile: fix tabs 2024-03-21 11:21:04 +05:00
Ammar Ahmed
3efe977c49 mobile: fix minor bugs in tabs 2024-03-21 11:21:04 +05:00
Ammar Ahmed
08c03bc3a4 mobile: fix duplicate imports 2024-03-21 11:21:04 +05:00
Abdullah Atta
5cb373f730 web: bring back editor margins toggle in action bar 2024-03-21 11:21:04 +05:00
Abdullah Atta
123f1a2658 web: minor ui fixes 2024-03-21 11:21:04 +05:00
Abdullah Atta
72645ce0ad web: fix section subtitle horizontal margin 2024-03-21 11:21:04 +05:00
Abdullah Atta
3f375065fc web: add placeholder in table of contents 2024-03-21 11:21:04 +05:00
Abdullah Atta
3d816751f6 web: update diff content on tab switch 2024-03-21 11:21:04 +05:00
Abdullah Atta
f44c553749 web: minor refactor 2024-03-21 11:21:04 +05:00
Abdullah Atta
9c0ee7e63c web: fix properties section horizontal margin 2024-03-21 11:21:04 +05:00
Abdullah Atta
ae3a73c334 core: remove note from vault if its content is not locked 2024-03-21 11:21:04 +05:00
Abdullah Atta
fe0129e1a4 web: fix locked notes getting overwritten with unencrypted content 2024-03-21 11:21:04 +05:00
Abdullah Atta
274395d01b web: fix diff session not opening after app refresh 2024-03-21 11:21:04 +05:00
Abdullah Atta
5deb5253c1 editor: fix search decorations not cleared on search end 2024-03-21 11:21:04 +05:00
Abdullah Atta
55e3213e5c web: add all missing functionality in note linking dialog 2024-03-21 11:21:04 +05:00
Abdullah Atta
bc9b5c39ee web: remove custom search state logic & use editor commands 2024-03-21 11:21:04 +05:00
Abdullah Atta
7a48c7c1e3 editor: fix text on selected search result not visible 2024-03-21 11:21:03 +05:00
Abdullah Atta
324256a499 editor: use global search store for managing search state 2024-03-21 11:21:03 +05:00
Abdullah Atta
eaea7bdd2a editor: minor refactor 2024-03-21 11:21:03 +05:00
Abdullah Atta
5985e22777 web: remove locked session type guard (switch to simple boolean)
the type guard was incorrect
2024-03-21 11:21:03 +05:00
Abdullah Atta
5de7fc5bd7 web: add content to new session type 2024-03-21 11:21:03 +05:00
Abdullah Atta
b54457f522 web: fix editor title not updating on creating a note 2024-03-21 11:21:03 +05:00
Abdullah Atta
f94341facc web: remove preview session type 2024-03-21 11:21:03 +05:00
Abdullah Atta
90a19e7152 web: ${id}_editorScroll > editorScroll_${id} 2024-03-21 11:21:03 +05:00
Abdullah Atta
32998b9c8c web: set session content before saving 2024-03-21 11:21:03 +05:00
Abdullah Atta
88532ae13b web: add dialog container inside tab 2024-03-21 11:21:03 +05:00
Abdullah Atta
64a138fa80 web: handle locked notes properly in real time editor sync 2024-03-21 11:21:03 +05:00
Abdullah Atta
8fe2774d8f web: freeze unhydrated sessions 2024-03-21 11:21:03 +05:00
Abdullah Atta
8ef42dd605 web: remove unused & commented out code 2024-03-21 11:21:03 +05:00
Abdullah Atta
5b44206931 web: focus editor on switching tab and toggle active class 2024-03-21 11:21:03 +05:00
Abdullah Atta
29f92a0806 web: define editor & session once and pass it everywhere 2024-03-21 11:21:03 +05:00
Abdullah Atta
03f8332c67 web: remove unlocked session type 2024-03-21 11:21:03 +05:00
Abdullah Atta
144d362527 web: set session id on saving note 2024-03-21 11:21:03 +05:00
Abdullah Atta
7a6ccb932d core: add block ids before returning content 2024-03-21 11:21:03 +05:00
Abdullah Atta
94c1556a5c editor: fix range error crash 2024-03-21 11:21:03 +05:00
Abdullah Atta
5974ffc0d4 editor: do not add block id on list items
(because they already contain paragraphs and we don't want duplicates)
2024-03-21 11:21:03 +05:00
Abdullah Atta
6184281694 editor: do not touch editor when its view is destroyed 2024-03-21 11:21:02 +05:00
Abdullah Atta
c51406ca04 editor: fix selection/focus is lost when editor state is updated 2024-03-21 11:21:02 +05:00
Abdullah Atta
07db957f67 editor: fix list type thumbnails in toolbar 2024-03-21 11:21:02 +05:00
Abdullah Atta
d31194bb39 editor: hide hover popup on editor destroy 2024-03-21 11:21:02 +05:00
Abdullah Atta
44827d13fe editor: render interactive popups in popup instead of menu 2024-03-21 11:21:02 +05:00
Abdullah Atta
c847ca0817 editor: scroll blocks into view only for active editor 2024-03-21 11:21:02 +05:00
Abdullah Atta
bd102ea346 editor: query editor dom based on active editor class 2024-03-21 11:21:02 +05:00
Abdullah Atta
688dde9890 editor: render all popups in popup container 2024-03-21 11:21:02 +05:00
Abdullah Atta
adfef8faef editor: close all popups and dropdowns on switching tabs 2024-03-21 11:21:02 +05:00
Abdullah Atta
7785bcd5a8 editor: fix placeholder is not visible 2024-03-21 11:21:02 +05:00
Abdullah Atta
569f4537e7 ui: allow setting popup container 2024-03-21 11:21:02 +05:00
Abdullah Atta
43a03079a1 web: disable properties button in action bar when diff is open 2024-03-21 11:21:02 +05:00
Abdullah Atta
852802da4b web: allow session item size to grow 2024-03-21 11:21:02 +05:00
Abdullah Atta
ce4e0a1916 web: add support for /notes/:noteId/edit hash route 2024-03-21 11:21:02 +05:00
Abdullah Atta
ce53495b76 core: do not change date modified on items when bulk adding 2024-03-21 11:21:02 +05:00
Abdullah Atta
42571b0794 editor: make image size clamping responsive 2024-03-21 11:21:02 +05:00
Abdullah Atta
3a2eba3242 web: fix race condition where editor context would be destroyed and updated at the same time 2024-03-21 11:21:02 +05:00
Abdullah Atta
2d9f41e114 web: create error from ErrorEvent if none found 2024-03-21 11:21:02 +05:00
Abdullah Atta
8dada6d936 editor: fix crash on loading web clip 2024-03-21 11:21:02 +05:00
Abdullah Atta
2c4170bacc web: reenable tags refreshing in editor 2024-03-21 11:21:02 +05:00
Abdullah Atta
86ff1890f1 editor: fix position of loading placeholder for floating image 2024-03-21 11:21:01 +05:00
Abdullah Atta
2ef17b800c editor: fix react node views not rendering on editor load 2024-03-21 11:21:01 +05:00
Abdullah Atta
0c0d91f8fd web: fix crash on refreshing editor store 2024-03-21 11:21:01 +05:00
Ammar Ahmed
ba7b88f5d8 mobile: fix randId function duplicate 2024-03-21 11:21:01 +05:00
Abdullah Atta
47a396ffaf editor: fix crash when resizing window due to a memory leak 2024-03-21 11:21:01 +05:00
Abdullah Atta
f60fcefd1c web: fix temporary tabs cannot be made permanent 2024-03-21 11:21:01 +05:00
Abdullah Atta
57e1629b0c web: fix jumping tabs when pinning/unpinning tabs 2024-03-21 11:21:01 +05:00
Abdullah Atta
5988640d3f web: fix crashes when moving tabs 2024-03-21 11:21:01 +05:00
Abdullah Atta
6512ace33b web: fix new sessions can't be opened after app refresh 2024-03-21 11:21:01 +05:00
Abdullah Atta
0a36b5ba5b web: fix type errors 2024-03-21 11:21:01 +05:00
Ammar Ahmed
832652730a editor: remove editor.current usage 2024-03-21 11:21:01 +05:00
Ammar Ahmed
ae7908e000 mobile: fix editor loading multiple times 2024-03-21 11:21:01 +05:00
Abdullah Atta
b40fe805e7 web: use createInternalLink everywhere 2024-03-21 11:21:01 +05:00
Ammar Ahmed
09f37ae872 mobile: finalize note linking 2024-03-21 11:21:00 +05:00
Ammar Ahmed
ef6c4bb6fb core: parse internal link from href 2024-03-21 11:20:27 +05:00
Ammar Ahmed
4fc5ec00ae core: fix extracting internal links 2024-03-21 11:20:27 +05:00
Abdullah Atta
9267433d74 web: show references & linked notes in properties 2024-03-21 11:20:26 +05:00
Abdullah Atta
dbda1eff82 web: reset active block after scroll 2024-03-21 11:20:26 +05:00
Abdullah Atta
c8f9925973 core: add internal links extraction 2024-03-21 11:20:26 +05:00
Abdullah Atta
ff87bebe8f web: add full support for adding internal links 2024-03-21 11:20:26 +05:00
Abdullah Atta
54f1945a58 editor: add support for adding/removing internal links 2024-03-21 11:20:26 +05:00
Abdullah Atta
2a547c879b core: add support for processing internal links in note content 2024-03-21 11:20:26 +05:00
Ammar Ahmed
cfa98578ea mobile: note linking 2024-03-21 11:20:26 +05:00
Ammar Ahmed
270cb16d30 mobile: update deps 2024-03-21 11:20:26 +05:00
Abdullah Atta
06113db2ff web: fix type errors and broken imports 2024-03-21 11:20:26 +05:00
Abdullah Atta
3efb79308a editor: reset editor on options update 2024-03-21 11:20:26 +05:00
Abdullah Atta
b0b5bd235f web: add support for table of contents 2024-03-21 11:20:25 +05:00
Abdullah Atta
4a2fcf950e web: add support for tabs 2024-03-21 11:20:25 +05:00
Abdullah Atta
e166a634f2 common: add utility for formatting history session time 2024-03-21 11:20:00 +05:00
Abdullah Atta
b97ec3948b mobile: simplify unencrypted content check 2024-03-21 11:20:00 +05:00
Abdullah Atta
e14bb065dc core: simplify encryption content checks 2024-03-21 11:20:00 +05:00
Abdullah Atta
80a77871a0 core: restoring a history session should create a new version 2024-03-21 11:20:00 +05:00
Abdullah Atta
51963f799c editor: create editor only once 2024-03-21 11:20:00 +05:00
Ammar Ahmed
71d94853ba mobile: implement toc 2024-03-21 11:20:00 +05:00
Ammar Ahmed
c33c365b62 mobile: support vault notes in tabs 2024-03-21 11:20:00 +05:00
Ammar Ahmed
2ce31fc81c mobile: fix tab bugs 2024-03-21 11:19:59 +05:00
Ammar Ahmed
d9521b5058 mobile: add tab history 2024-03-21 11:19:59 +05:00
Ammar Ahmed
366948cd28 mobile: some more fixes 2024-03-21 11:19:59 +05:00
Ammar Ahmed
ad338aeefc mobile: fix numerous issues with tabs 2024-03-21 11:19:59 +05:00
Ammar Ahmed
6b6ee76c39 mobile: push changes 2024-03-21 11:19:59 +05:00
Ammar Ahmed
3f23507a74 mobile: add editor tabs 2024-03-21 11:19:59 +05:00
Abdullah Atta
815c9eb7de core: remove unnecessary notes collection init before migration 2024-03-21 11:19:59 +05:00
Abdullah Atta
aab2b0307e web: bump version to 3.0.6 2024-03-21 11:19:59 +05:00
Abdullah Atta
b9e7cbd608 setup: only disable esbuild rebuild on mobile 2024-03-21 11:19:59 +05:00
Abdullah Atta
0cf0b00c58 setup: ignore esbuild rebuild script 2024-03-21 11:19:58 +05:00
Abdullah Atta
29e07036b1 mobile: update package lockfile 2024-03-21 11:19:58 +05:00
Abdullah Atta
61b1aa919a editor: fix task items not showing correctly 2024-03-21 11:19:58 +05:00
Abdullah Atta
90b7b5f87b ui: fix menu is not scrollable on small screens 2024-03-21 11:19:58 +05:00
Abdullah Atta
7103167693 web: fix loading skeleton for compact items in list 2024-03-21 11:19:58 +05:00
Ammar Ahmed
77e0f5af17 mobile: bump version code 2024-03-21 11:19:58 +05:00
Ammar Ahmed
0618341cf8 mobile: release v3.0.8 2024-03-21 11:19:58 +05:00
Ammar Ahmed
42a4acb688 mobile: improve notebook sheet wording 2024-03-21 11:19:58 +05:00
Ammar Ahmed
131b1a0aa6 mobile: change sheet button positions 2024-03-21 11:19:58 +05:00
Ammar Ahmed
e327c92e1a mobile: cleanup 2024-03-21 11:19:58 +05:00
Ammar Ahmed
d22301ccf9 mobile: reminder notification shows even after removing reminders 2024-03-21 11:19:58 +05:00
Ammar Ahmed
5d2c615a30 mobile: simplify reminder sheet ui 2024-03-21 11:19:58 +05:00
Ammar Ahmed
4a2088ec1e mobile: remove usage of customStyle prop 2024-03-21 11:19:58 +05:00
Abdullah Atta
238510132f core: fix settings are not migrated 2024-03-21 11:19:58 +05:00
Ammar Ahmed
b7a8277749 mobile: update deps 2024-03-21 11:19:57 +05:00
Ammar Ahmed
0251363d65 mobile: fix tags not showing properly 2024-03-21 11:19:57 +05:00
Ammar Ahmed
a784f47430 mobile: cleanup 2024-03-21 11:19:57 +05:00
Ammar Ahmed
cf28b27da6 mobile: update Pods 2024-03-21 11:19:57 +05:00
Ammar Ahmed
1fa020c569 mobile: release v3.0.7 beta 2024-03-21 11:19:57 +05:00
Ammar Ahmed
ead87f7068 mobile: fix sorting attachments 2024-03-21 11:19:57 +05:00
Abdullah Atta
e35f3c5a96 web: fix height of attachments table 2024-03-21 11:19:57 +05:00
Abdullah Atta
c5282c9ddd core: do not include deleted attachments in filters 2024-03-21 11:19:57 +05:00
Abdullah Atta
fc21a8be97 web: bump version to 3.0.5 2024-03-21 11:19:57 +05:00
Ammar Ahmed
c3e315a2ae mobile: fix mobile sheet ui 2024-03-21 11:19:57 +05:00
Abdullah Atta
ca30433fd5 web: show error if there's no internet on updating profile 2024-03-21 11:19:57 +05:00
Abdullah Atta
03240345eb web: allow clearing database on database disk image is malformed 2024-03-21 11:19:56 +05:00
Abdullah Atta
156b844fd9 web: fix error due to changed file picker return 2024-03-21 11:19:56 +05:00
Abdullah Atta
f1a6662f01 web: fix attachFile- when saving web clip 2024-03-21 11:19:56 +05:00
Ammar Ahmed
4e5b5e6e3f mobile: enable auto sync 2024-03-21 11:19:56 +05:00
Ammar Ahmed
b80dd8c81e mobile: finalize image upload 2024-03-21 11:19:56 +05:00
Abdullah Atta
2cee5020dd web: add image compression 2024-03-21 11:19:56 +05:00
Abdullah Atta
1a00fc6e30 web: add support for multiselecting attachments 2024-03-21 11:19:56 +05:00
ammarahm-ed
64697a7771 mobile: handle uploading multiple files 2024-03-21 11:19:56 +05:00
ammarahm-ed
d97be2d4fb mobile: add optional image compression on upload 2024-03-21 11:19:56 +05:00
Abdullah Atta
6504beda78 web: fix sync icon spin direction 2024-03-21 11:19:56 +05:00
Abdullah Atta
3795c69a7b core: fix migration for db version > 6 2024-03-21 11:19:56 +05:00
Abdullah Atta
77b6ad5408 core: only get attachment id when processing content 2024-03-21 11:19:56 +05:00
Abdullah Atta
480b4398da web: enable auto sync 2024-03-21 11:19:56 +05:00
Abdullah Atta
7ed7d26d6f web: edit profile directly 2024-03-21 11:19:56 +05:00
Ammar Ahmed
2463ad2820 mobile: add user profile 2024-03-21 11:19:56 +05:00
Ammar Ahmed
85c50bf0fa core: fetch user profile before updating profile 2024-03-21 11:19:56 +05:00
Abdullah Atta
54ba654b97 web: add support for setting user profile 2024-03-21 11:19:55 +05:00
Abdullah Atta
e58fc38a6d core: add support for setting user profile 2024-03-21 11:19:33 +05:00
Ammar Ahmed
f0ef9e072e mobile: cleanup 2024-03-21 11:19:33 +05:00
Ammar Ahmed
cd62069b9b mobile: fix note assigned to multiple colors 2024-03-21 11:19:33 +05:00
Ammar Ahmed
8089f7e181 mobile: small ui fixes 2024-03-21 11:19:33 +05:00
Ammar Ahmed
c1ec580fdc mobile: ui bug fixes 2024-03-21 11:19:33 +05:00
Ammar Ahmed
ae43d58a38 mobile: user profile 2024-03-21 11:19:33 +05:00
Abdullah Atta
2713f26f90 core: fix migration errors & compact deleted items 2024-03-21 11:19:32 +05:00
Ammar Ahmed
783a97e340 mobile: release v3.0.6 2024-03-21 11:19:32 +05:00
Ammar Ahmed
dcea1544b9 mobile: fix toolbar migration 2024-03-21 11:19:32 +05:00
Ammar Ahmed
9e0286052f core: check for deleted attachments in pending attachments 2024-03-21 11:19:32 +05:00
Ammar Ahmed
a41b7d8fd8 mobile: fix backup sheet never closes on manual backups 2024-03-21 11:19:32 +05:00
Ammar Ahmed
9473c30426 mobile: allow sort by title in all groupings 2024-03-21 11:19:32 +05:00
Abdullah Atta
8bf7609d2f desktop: disable os encryption of keystore in portable app 2024-03-21 11:19:32 +05:00
Abdullah Atta
c63572abd5 web: migrate toolbar on first use 2024-03-21 11:19:32 +05:00
Abdullah Atta
a003e396b8 common: add toolbar migration 2024-03-21 11:19:32 +05:00
Abdullah Atta
c4323b7814 global: update lockfiles 2024-03-21 11:19:32 +05:00
Abdullah Atta
f27c7e9cf4 web: bump version to 3.0.4-beta 2024-03-21 11:19:03 +05:00
Abdullah Atta
613c1ca30f common: get note's locked status from its content 2024-03-21 11:19:03 +05:00
Abdullah Atta
b4542a532b core: always delete vault references on vault deletion 2024-03-21 11:19:03 +05:00
Abdullah Atta
6d8e5a1d1d web: fix note not selected after switching from locked note 2024-03-21 11:19:03 +05:00
Abdullah Atta
951f628351 core: fix sync tests 2024-03-21 11:19:03 +05:00
Abdullah Atta
3ff6b5afd1 core: fix database image is malformed error when deleting vault 2024-03-21 11:19:03 +05:00
Abdullah Atta
5aef851eb0 core: fix database image is malformed error on unlocking a note 2024-03-21 11:19:03 +05:00
Abdullah Atta
f14a72ec1c web: fix sync not running after login 2024-03-21 11:19:03 +05:00
Abdullah Atta
484fc4f5a4 web: refresh nav items on deleting a tag 2024-03-21 11:19:02 +05:00
Abdullah Atta
6b9567a0be core: fix database image is malformed error 2024-03-21 11:19:02 +05:00
Abdullah Atta
0f2a88124b core: speed up backup restore 2024-03-21 11:19:02 +05:00
Ammar Ahmed
740a7b4918 mobile: fix color of + button on hidden items
in side menu
2024-03-21 11:19:02 +05:00
Abdullah Atta
6fd3c77348 core: fix deleted items getting imported during backup restore 2024-03-21 11:19:02 +05:00
Abdullah Atta
70818c24cd core: fix duplicate colors created during backup restore 2024-03-21 11:19:02 +05:00
Ammar Ahmed
69c20045c2 mobile: fix readonly mode 2024-03-21 11:19:02 +05:00
Ammar Ahmed
c65a6e5e62 editor: fix keyboard opens on drag in editor 2024-03-21 11:19:02 +05:00
Ammar Ahmed
4a2da72fa3 mobile: clear selection after deleting items 2024-03-21 11:19:02 +05:00
Ammar Ahmed
2d83fde2c5 mobile: fix reminder ui in selection mode 2024-03-21 11:19:02 +05:00
Ammar Ahmed
3898cc7752 mobile: remove pass min limit on vault 2024-03-21 11:19:02 +05:00
Abdullah Atta
c633864073 web: clear editor if opened note is unlocked 2024-03-21 11:19:02 +05:00
Abdullah Atta
77ee56dd14 core: remove note's vault relation regardless of vault 2024-03-21 11:19:02 +05:00
Abdullah Atta
6c47a485f0 core: don't unlink vault notes on vault remove 2024-03-21 11:19:02 +05:00
Abdullah Atta
9f241959cf web: fix vault settings not updating on deleting vault 2024-03-21 11:19:02 +05:00
Abdullah Atta
da20e7977a core: fix sqlite crash on calling delete with empty array 2024-03-21 11:19:02 +05:00
Abdullah Atta
0931c0d5f2 web: fix unnecessary rerendering of notebook header 2024-03-21 11:19:02 +05:00
Abdullah Atta
cdebfdd7c0 web: disable auto sync 2024-03-21 11:19:02 +05:00
Abdullah Atta
ef6ff34ec6 core: enable sync push 2024-03-21 11:19:02 +05:00
Abdullah Atta
9a42273a50 web: add drag/drop tests 2024-03-21 11:19:02 +05:00
Abdullah Atta
75a358a4ce web: fix cannot navigate into nested notebook by hovering on it 2024-03-21 11:19:02 +05:00
Abdullah Atta
6c122c6498 editor: fix react error 409 2024-03-21 11:19:01 +05:00
Abdullah Atta
963f331290 web: expand parent when a child notebook is added 2024-03-21 11:19:01 +05:00
Muhammad Ali
9798ada335 web: add support for item drag/droping (#3230)
* web: basic drag drop function for single note

* web: added check for noteId

* web: add support for item drag drop

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-03-21 11:19:01 +05:00
Ammar Ahmed
2f17ad69a1 mobile: disable auto sync 2024-03-21 11:19:01 +05:00
Ammar Ahmed
505d71f1c7 editor: fix callout margins 2024-03-21 11:19:01 +05:00
Ammar Ahmed
4ed6bdd668 mobile: fix keyboard jump on tap in dropdown 2024-03-21 11:19:01 +05:00
Abdullah Atta
b87dce6a51 editor: fix rtl for outline list 2024-03-21 11:19:01 +05:00
Abdullah Atta
295eb8ffec editor: add callout component 2024-03-21 11:19:01 +05:00
Ammar Ahmed
c7b2046e46 mobile: release v3.0.5 beta 2024-03-21 11:19:01 +05:00
Ammar Ahmed
254c2acede mobile: update toolbar 2024-03-21 11:19:01 +05:00
Abdullah Atta
4ea4bbd782 editor: add support for simple checklists 2024-03-21 11:19:00 +05:00
Ammar Ahmed
e3f08668ed editor: implement simple checklists 2024-03-21 11:18:14 +05:00
Abdullah Atta
d6113f75ca web: show error if saving a note fails 2024-03-21 11:18:13 +05:00
Abdullah Atta
1dcd227014 core: fix database image is malformed error on updating locked note 2024-03-21 11:18:13 +05:00
Abdullah Atta
8af190e83d web: bump version to 3.0.3-beta 2024-03-21 11:18:13 +05:00
Abdullah Atta
dd06e5fd52 desktop: include preload script when comparing bundles 2024-03-21 11:18:13 +05:00
Abdullah Atta
cd55f443d9 core: add more lookup tests 2024-03-21 11:18:13 +05:00
Abdullah Atta
974221d938 core: allow testing with persisted database 2024-03-21 11:18:13 +05:00
Abdullah Atta
02c084ed6d core: return items in same order when using .records 2024-03-21 11:18:13 +05:00
Abdullah Atta
456927548a core: improve notes lookup performance 2024-03-21 11:18:13 +05:00
Abdullah Atta
53490cc28b core: refactor test setup & use better-sqlite-multiple-cipher 2024-03-21 11:18:13 +05:00
Abdullah Atta
15014d2d49 web: destroy sql database on app close 2024-03-21 11:18:13 +05:00
Abdullah Atta
3ee14b9463 core: fix database image is malformed error 2024-03-21 11:18:13 +05:00
Abdullah Atta
9e46f1ec06 core: fix note headling getting removed 2024-03-21 11:18:13 +05:00
Abdullah Atta
47c433b2c9 web: fix notebook indentation 2024-03-21 11:18:13 +05:00
Abdullah Atta
72d5072cac core: fix sorting of newly created notes 2024-03-21 11:18:13 +05:00
Abdullah Atta
6b14b29103 web: allow sorting by title everywhere 2024-03-21 11:18:13 +05:00
Abdullah Atta
e3ef25714a core: add support for sorting by title & date together 2024-03-21 11:18:13 +05:00
Abdullah Atta
ac1bf9e84e web: add child notebook under opened notebook 2024-03-21 11:18:13 +05:00
Abdullah Atta
54abea488f web: rerender subnotebooks on root notebook change 2024-03-21 11:18:13 +05:00
Abdullah Atta
9d1ff3231a web: hide sort button in notebook view 2024-03-21 11:18:13 +05:00
Abdullah Atta
eef8b98b62 web: await notes context refreshing 2024-03-21 11:18:12 +05:00
Abdullah Atta
a4e0fecfe9 web: clear keystore when clearing database 2024-03-21 11:18:12 +05:00
Abdullah Atta
370837278b web: allow clearing keystore 2024-03-21 11:18:12 +05:00
Abdullah Atta
c03d25ece6 web: fix empty root notebook indentation 2024-03-21 11:18:12 +05:00
Abdullah Atta
34be765ac5 web: fix monograph publish status not updating 2024-03-21 11:18:12 +05:00
Abdullah Atta
bf208921ad web: fix nested notebook navigation from shortcuts 2024-03-21 11:18:12 +05:00
Abdullah Atta
14b469d8b6 web: fix color cannot be renamed 2024-03-21 11:18:12 +05:00
Abdullah Atta
cc239d927c web: allow non-pro users to customize sidebar 2024-03-21 11:18:12 +05:00
Abdullah Atta
1c7e619b55 web: reimplement app lock & web key store 2024-03-21 11:18:12 +05:00
Ammar Ahmed
3205dae30c mobile: fix app lock on ios 2024-03-21 11:18:12 +05:00
Ammar Ahmed
57da24821f mobile: v3.0.4 2024-03-21 11:18:12 +05:00
Ammar Ahmed
16f4184e25 editor: fix color picker missing prop 2024-03-21 11:18:12 +05:00
Ammar Ahmed
4c51fbf816 mobile: improve verification flow before changing app lock 2024-03-21 11:18:12 +05:00
Ammar Ahmed
f7835f43f6 mobile: fix reordering in side menu 2024-03-21 11:18:12 +05:00
Ammar Ahmed
aeabd9929c editor: fix keyboard focus issues on mobile 2024-03-21 11:18:12 +05:00
Ammar Ahmed
94a0d841ac mobile: fix bugs 2024-03-21 11:18:12 +05:00
Ammar Ahmed
3172d5a552 mobile: fix sidemenu shortcuts 2024-03-21 11:18:11 +05:00
Abdullah Atta
a042f6d418 web: remove security key config on app lock disable 2024-03-21 11:18:11 +05:00
Abdullah Atta
d9ff5e0053 core: fix object id date parsing 2024-03-21 11:18:11 +05:00
Abdullah Atta
7ce9121f8e web: fix cr.isIndexedDBSupported is not a function 2024-03-21 11:18:11 +05:00
Ammar Ahmed
e0c1d6344d mobile: v3.0.3 beta 2024-03-21 11:18:11 +05:00
Ammar Ahmed
6c378a0122 mobile: fix backup failed on iOS 2024-03-21 11:18:11 +05:00
Ammar Ahmed
1371b14005 mobile: bump version 2024-03-21 11:18:11 +05:00
Ammar Ahmed
bf7f3eb86f mobile: fix issue reporting 2024-03-21 11:18:11 +05:00
Ammar Ahmed
c8716df6a6 mobile: fix rendering slow in list 2024-03-21 11:18:11 +05:00
Abdullah Atta
fd12d4bd00 ui: fix right clicking when menu is open doesn't close it 2024-03-21 11:18:11 +05:00
Abdullah Atta
29d0f40c1a ui: fix hover highlighting 2 items in menu 2024-03-21 11:18:11 +05:00
Abdullah Atta
63fd526db8 web: fix color renaming and add color remove support 2024-03-21 11:18:10 +05:00
Abdullah Atta
0fbfc709da web: add readonly indicator on notes 2024-03-21 11:18:10 +05:00
Abdullah Atta
19f0488745 web: fix compact view not affecting notes 2024-03-21 11:18:10 +05:00
Abdullah Atta
f81c30222a editor: fix Position -1 is outside of fragment error 2024-03-21 11:18:10 +05:00
Ammar Ahmed
26ae76d644 mobile: fix migration bugs 2024-03-21 11:18:10 +05:00
Abdullah Atta
f370118498 core: minor refactoring 2024-03-21 11:18:10 +05:00
Abdullah Atta
d3a32421ee core: migrate deleted items as well 2024-03-21 11:18:10 +05:00
Abdullah Atta
af9a83117b web: refresh app on sync completed 2024-03-21 11:18:10 +05:00
Abdullah Atta
ce418487ad core: fix continuous invalid_grant error if login fails 2024-03-21 11:18:10 +05:00
Abdullah Atta
9bd7dbc940 web: bump to v3.0.2-beta 2024-03-21 11:18:10 +05:00
Abdullah Atta
bc91a41bbe web: hide window/tab title on app lock 2024-03-21 11:18:10 +05:00
Abdullah Atta
7efbc666a0 core: add support for creating backups of legacy collections 2024-03-21 11:18:10 +05:00
Abdullah Atta
5ecd70e121 web: fix P.item is undefined error 2024-03-21 11:18:10 +05:00
Abdullah Atta
e4d165edb7 core: remove deleteReason property 2024-03-21 11:18:10 +05:00
Ammar Ahmed
d24f29e98f Update ios.publish.yml
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-03-21 11:18:09 +05:00
Ammar Ahmed
5559738654 mobile: cleanup gradle.properties 2024-03-21 11:18:09 +05:00
Ammar Ahmed
54a321cb4c mobile: fix share extension 2024-03-21 11:18:09 +05:00
Ammar Ahmed
b2f0e74ade mobile: beta release 2024-03-21 11:18:09 +05:00
Ammar Ahmed
a105c09841 mobile: fix notebook move to trash 2024-03-21 11:18:09 +05:00
Ammar Ahmed
6ad8d7ba1b mobile: cleanup 2024-03-21 11:18:09 +05:00
Abdullah Atta
c58bb57de0 desktop: disable downgrades 2024-03-21 11:18:09 +05:00
Ammar Ahmed
aec183bd78 mobile: stop app updates check in beta 2024-03-21 11:18:09 +05:00
Ammar Ahmed
75ed6de07f mobile: minor fixes 2024-03-21 11:18:09 +05:00
Abdullah Atta
8f56953915 web: improve database deletion 2024-03-21 11:18:09 +05:00
Abdullah Atta
7d98f93dd6 web: reload page on reset from error boundary 2024-03-21 11:18:09 +05:00
Abdullah Atta
e74123bc9c web: locked status not updating on note 2024-03-21 11:18:09 +05:00
Abdullah Atta
d21b4c021d web: only save note's content through vault 2024-03-21 11:18:09 +05:00
Abdullah Atta
ca05865021 core: fix adding note to vault should return its id 2024-03-21 11:18:09 +05:00
Abdullah Atta
b30ed83f78 core: fix database resetting 2024-03-21 11:18:09 +05:00
Abdullah Atta
a4d0b2d0dc theme: fix error input variant 2024-03-21 11:18:08 +05:00
Abdullah Atta
fa1c48be41 web: allow typing custom date when adding reminder 2024-03-21 11:18:08 +05:00
Abdullah Atta
ec29cc0801 common: use upcoming reminder when resolving reminders on note 2024-03-21 11:18:08 +05:00
Ammar Ahmed
44e9a69faa mobile: fix reminders 2024-03-21 11:18:08 +05:00
Ammar Ahmed
920598f943 mobile: fix notebooks & colors 2024-03-21 11:18:08 +05:00
Abdullah Atta
5afdd88eb7 core: set mode to "sync" for migrations during sync 2024-03-21 11:18:08 +05:00
Abdullah Atta
81ebc3906f desktop: patch better-sqlite3-multiple-ciphers to get prebuilt binaries 2024-03-21 11:18:08 +05:00
Abdullah Atta
ec7d581c3d web: bump to 3.0.1-beta 2024-03-21 11:18:08 +05:00
Abdullah Atta
60e1da412c core: enable sync during tests 2024-03-21 11:18:08 +05:00
Abdullah Atta
27cf0a3c6b core: improve backup importing 2024-03-21 11:18:08 +05:00
Abdullah Atta
e24beebd43 core: add support for nested transactions 2024-03-21 11:18:08 +05:00
Abdullah Atta
9bea47e358 web: use single transaction for importing a backup 2024-03-21 11:18:08 +05:00
Abdullah Atta
779f000f3e web: make sqlite slightly faster 2024-03-21 11:18:08 +05:00
Ammar Ahmed
37eeeb1d64 mobile: fix release build 2024-03-21 11:18:07 +05:00
Abdullah Atta
c231c07633 core: fix type errors 2024-03-21 11:18:07 +05:00
Ammar Ahmed
4ee82b4fd6 mobile: minor fixes 2024-03-21 11:18:07 +05:00
Ammar Ahmed
d0f0c32ffa core: fix migration bugs 2024-03-21 11:18:07 +05:00
Ammar Ahmed
2c931d72f9 mobile: fix saving user key 2024-03-21 11:18:07 +05:00
Abdullah Atta
1cf832f0fe web: fix monograph publishing popup 2024-03-21 11:18:07 +05:00
Abdullah Atta
1e49fd8145 web: ui fixes 2024-03-21 11:18:07 +05:00
Abdullah Atta
bd93048aaa web: fix app lock not getting disabled 2024-03-21 11:18:07 +05:00
Ammar Ahmed
1b5dc9eb14 mobile: minor fixes 2024-03-21 11:18:07 +05:00
Ammar Ahmed
e93490acfc mobile: locked notes 2024-03-21 11:18:07 +05:00
Abdullah Atta
487306b943 web: fix indexedDB not getting detected 2024-03-21 11:17:32 +05:00
Abdullah Atta
573a37f671 core: destroy kysely on error 2024-03-21 11:17:32 +05:00
Abdullah Atta
8bfee794c8 crypto: move libsodium & sodium-native to peer deps 2024-03-21 11:17:32 +05:00
Abdullah Atta
aea31102f6 global: pin node version to 20 2024-03-21 11:17:32 +05:00
Abdullah Atta
bfe9aa5330 web: various fixes 2024-03-21 11:17:32 +05:00
Abdullah Atta
a45c5db34e common: fix note resolution 2024-03-21 11:17:32 +05:00
Abdullah Atta
3e588e243c core: fix database migration 2024-03-21 11:17:31 +05:00
Abdullah Atta
03dba9f624 core: disable sync push 2024-03-21 11:17:31 +05:00
Abdullah Atta
b707690817 web: trigger error boundary on unhandled errors 2024-03-21 11:17:31 +05:00
Abdullah Atta
3b7660834d web: use safeStorage to encrypt secrets on desktop 2024-03-21 11:17:31 +05:00
Abdullah Atta
f4b14e37ae desktop: use better-sqlite3 on desktop for SQLite 2024-03-21 11:17:31 +05:00
Abdullah Atta
146223e2b6 desktop: fix autoupdater 2024-03-21 11:16:51 +05:00
Abdullah Atta
d6b037c178 desktop: add api to delete files 2024-03-21 11:16:51 +05:00
Abdullah Atta
3df8cc53e3 desktop: expose electron's safeStorage api via trpc 2024-03-21 11:16:51 +05:00
Abdullah Atta
63ab54cc42 desktop: enable native modules rebuild during build 2024-03-21 11:16:51 +05:00
Ammar Ahmed
569954b767 core: return decrypted content on unlock note 2024-03-21 11:16:51 +05:00
Ammar Ahmed
9722fab8f3 mobile: applock with pin and password 2024-03-21 11:16:51 +05:00
Ammar Ahmed
bad138d2fa mobile: minor fixes 2024-03-21 11:16:51 +05:00
Ammar Ahmed
a7e57354dd mobile: sqlite-multiple-ciphers patch 2024-03-21 11:16:51 +05:00
Ammar Ahmed
45fa486a6d mobile: refactor 2024-03-21 11:16:50 +05:00
Ammar Ahmed
a65d271cbd mobile: fix reorderable side menu 2024-03-21 11:16:50 +05:00
Ammar Ahmed
feba11626d mobile: yearly reminders 2024-03-21 11:16:50 +05:00
Abdullah Atta
a5afc47d82 web: add support for yearly reminders 2024-03-21 11:16:50 +05:00
Abdullah Atta
9edf6d165d core: add support for yearly reminders 2024-03-21 11:16:50 +05:00
Ammar Ahmed
12b8a9e487 mobile: stop bg fetch events when toggled off 2024-03-21 11:16:50 +05:00
Ammar Ahmed
9e8b5487b2 mobile: enable experimental background sync 2024-03-21 11:16:50 +05:00
Abdullah Atta
305a522a65 web: add support for hiding items from side bar 2024-03-21 11:16:49 +05:00
Abdullah Atta
2f77390a8e web: add support for reordering navigation menu items 2024-03-21 11:16:49 +05:00
Ammar Ahmed
0ab704b115 mobile: cleanup 2024-03-21 11:16:49 +05:00
Ammar Ahmed
c353f7a872 core: add sidebar order settings 2024-03-21 11:16:49 +05:00
Ammar Ahmed
9a242f63eb mobile: reorder sidebar items 2024-03-21 11:16:49 +05:00
Abdullah Atta
cc07cedd4a web: add support for custom colors 2024-03-21 11:16:49 +05:00
Ammar Ahmed
f1f4cd67f7 mobile: allow custom colors 2024-03-21 11:16:49 +05:00
Ammar Ahmed
ceb948bd1f mobile: migrate app lock 2024-03-21 11:16:49 +05:00
Abdullah Atta
90a0878600 web: remove cbor-x package 2024-03-21 11:16:49 +05:00
Abdullah Atta
26a63591bd web: add support for at rest encryption and app lock 2024-03-21 11:16:48 +05:00
Ammar Ahmed
87ee599da1 mobile: at rest encryption 2024-03-21 11:15:56 +05:00
Ammar Ahmed
7843a153a7 mobile: simplify tests 2024-03-21 11:15:56 +05:00
Abdullah Atta
72331faee7 core: remove dummy test files 2024-03-21 11:15:56 +05:00
Abdullah Atta
28470d60c6 core: migrate key value storage to sqlite 2024-03-21 11:15:56 +05:00
Ammar Ahmed
ab47c89ef7 mobile: update sheet component 2024-03-21 11:15:56 +05:00
Abdullah Atta
b086e652c3 core: fix moving nested notebooks to trash 2024-03-21 11:15:55 +05:00
Abdullah Atta
ef2d8bf5af global: move item resolution logic to @notesnook/common 2024-03-21 11:15:55 +05:00
Ammar Ahmed
d3221abd7e mobile: add theme switch animation 2024-03-21 11:15:55 +05:00
Abdullah Atta
448d19e9fd web: fix all type errors 2024-03-21 11:15:31 +05:00
Abdullah Atta
0a973cd83a web: fix duplicate imports 2024-03-21 11:15:31 +05:00
Abdullah Atta
4bff11bf12 core: fix type error 2024-03-21 11:15:31 +05:00
Abdullah Atta
f127203a5e core: add tests for sync merger 2024-03-21 11:15:31 +05:00
Abdullah Atta
dc3caa16d0 core: migrate vault to a database collection 2024-03-21 11:15:31 +05:00
Ammar Ahmed
1f33ea9db3 mobile: fix exporter and attachment download 2024-03-21 11:15:31 +05:00
Ammar Ahmed
4e157455c8 global: fix type errors during build 2024-03-21 11:15:30 +05:00
Abdullah Atta
2bb3652be2 web: use simple transform stream for export progress 2024-03-21 11:14:56 +05:00
Abdullah Atta
becc00d2ee web: fix exporting 2024-03-21 11:14:56 +05:00
Ammar Ahmed
e6186c0bbd mobile: add patches 2024-03-21 11:14:56 +05:00
Abdullah Atta
6538540f3b web: update export note snapshots for linux 2024-03-21 11:14:56 +05:00
Abdullah Atta
a437125730 web: fix reminder tests 2024-03-21 11:14:56 +05:00
Abdullah Atta
339e5965bb web: refresh notebooks after adding a new notebook 2024-03-21 11:14:56 +05:00
Abdullah Atta
e3eb3c8000 web: fix force redirect to home on navigating to a color 2024-03-21 11:14:56 +05:00
Abdullah Atta
2ef0f41612 web: fix crash when sorting tags 2024-03-21 11:14:56 +05:00
Abdullah Atta
0a38a734f5 web: fix crash when removing a notebook 2024-03-21 11:14:56 +05:00
Ammar Ahmed
c2d11cdc79 mobile: sync with latest core changes 2024-03-21 11:14:56 +05:00
Abdullah Atta
0fcab638a3 core: remove unnecessary console.log 2024-03-21 11:14:55 +05:00
Ammar Ahmed
b37853866f mobile: fix search to use filtered selector for notes 2024-03-21 11:14:55 +05:00
Abdullah Atta
e6642ac9ab core: prevent recursive sync after pushing items 2024-03-21 11:14:55 +05:00
Abdullah Atta
c294e80230 web: simplify sync status 2024-03-21 11:14:55 +05:00
Abdullah Atta
996f4d29be web: fix previewing trashed notes 2024-03-21 11:14:55 +05:00
Abdullah Atta
0c5a5c7438 core: fix trash 2024-03-21 11:14:55 +05:00
Abdullah Atta
9926c0b6da web: improve sync test reliability 2024-03-21 11:14:55 +05:00
Abdullah Atta
8e691769ae core: auto sync not triggered on note update 2024-03-21 11:14:55 +05:00
Abdullah Atta
add2d8af9b web: fix note history tests 2024-03-21 11:14:55 +05:00
Abdullah Atta
bc72c8b87c web: fix selection logic in list 2024-03-21 11:14:55 +05:00
Abdullah Atta
b73964afb9 web: set testId on auth input fields 2024-03-21 11:14:55 +05:00
Abdullah Atta
96b6115e7b core: fix note content is not saving 2024-03-21 11:14:55 +05:00
Abdullah Atta
ea46488d94 core: fix data is not iterable error on backup restore 2024-03-21 11:14:55 +05:00
Abdullah Atta
df0e8ed567 global: update lockfiles 2024-03-21 11:14:55 +05:00
Abdullah Atta
1e86b4d772 core: add retry if a test fails 2024-03-21 11:14:54 +05:00
Abdullah Atta
b1e1ed982a core: fix invalid object-id generation for some timestamps 2024-03-21 11:14:54 +05:00
Abdullah Atta
500388a634 core: fix sync & monographs tests 2024-03-21 11:14:54 +05:00
Abdullah Atta
7a60ac17ce core: fix auto sync starting even when auto sync is disabled 2024-03-21 11:14:54 +05:00
Abdullah Atta
a6a2f848d7 core: fix sync tests 2024-03-21 11:14:54 +05:00
Abdullah Atta
25e6350c04 core: remove unnecessary migration success log 2024-03-21 11:14:54 +05:00
Abdullah Atta
e0329c273f core: fix Crypto is not supported on this platform. error during tests 2024-03-21 11:14:54 +05:00
Abdullah Atta
fd7b33fe30 core: make all the core tests pass again 2024-03-21 11:14:54 +05:00
Abdullah Atta
6d70f8d2f9 web: fix crash when note has no title 2024-03-21 11:14:54 +05:00
Abdullah Atta
c6bb28c139 core: set default title if note has no title 2024-03-21 11:14:54 +05:00
Abdullah Atta
6796206099 web: update kysely patch 2024-03-21 11:14:54 +05:00
Abdullah Atta
ca40342978 web: run patch-package after npm i 2024-03-21 11:14:54 +05:00
Abdullah Atta
36150fb55b web: more fixes 2024-03-21 11:14:54 +05:00
Abdullah Atta
7b3f671159 web: fix many type errors 2024-03-21 11:14:53 +05:00
Abdullah Atta
0cd6191190 global: update lockfiles 2024-03-21 11:13:46 +05:00
Abdullah Atta
cbccb97d42 theme: fix tinycolor2 not found error 2024-03-21 11:13:46 +05:00
Abdullah Atta
2ce9386759 web: fix notes search in tags, favorites etc 2024-03-21 11:13:46 +05:00
Abdullah Atta
f5b85a82d0 web: update wa-sqlite 2024-03-21 11:13:46 +05:00
Abdullah Atta
0123da10f7 web: use memory tempStore for sqlite 2024-03-21 11:13:46 +05:00
Abdullah Atta
1228f1b6fa web: add support for exporting sql database 2024-03-21 11:13:46 +05:00
Abdullah Atta
3126c2d325 core: fix FTS5 SQLite search 2024-03-21 11:13:46 +05:00
Ammar Ahmed
a9c9ca29c8 mobile: cleanup 2024-03-21 11:13:46 +05:00
Ammar Ahmed
665f44bcee mobile: fix types 2024-03-21 11:13:45 +05:00
Ammar Ahmed
c444f7ddb8 mobile: refactor zustand stores 2024-03-21 11:13:45 +05:00
Ammar Ahmed
787c36c754 mobile: bug fixes 2024-03-21 11:13:45 +05:00
Ammar Ahmed
3502469c1d core: add fn to get cache item 2024-03-21 11:13:45 +05:00
Abdullah Atta
c58b16cba6 web: only auto align title & headline 2024-03-21 11:13:45 +05:00
Abdullah Atta
15ea57b692 web: getKey -> key 2024-03-21 11:13:45 +05:00
Abdullah Atta
655cf0617e web: fix resolved item data misaligned with items 2024-03-21 11:13:45 +05:00
Abdullah Atta
57311397e0 core: fix many issues with virtualized grouping 2024-03-21 11:13:45 +05:00
Ammar Ahmed
94db2387c8 core: early return when items are empty 2024-03-21 11:13:45 +05:00
Abdullah Atta
bd1cf0fadc web: fix random crashes when scrolling in list 2024-03-21 11:13:45 +05:00
Abdullah Atta
cfd53a8b2c web: replace react-virtual with react-virtuouso 2024-03-21 11:13:44 +05:00
Ammar Ahmed
baa2d1a389 mobile: fix build ang bugs 2024-03-21 11:13:15 +05:00
Abdullah Atta
8cd963a893 web: hide attachments access if user is logged out 2024-03-21 11:13:15 +05:00
Abdullah Atta
6e3ee9171b web: allow core to specify custom sql db name 2024-03-21 11:13:15 +05:00
Abdullah Atta
088ef2285f web: close idb connection on sqlite connection close 2024-03-21 11:13:15 +05:00
Abdullah Atta
e127b8f4ab core: clear database on logout 2024-03-21 11:13:15 +05:00
Ammar Ahmed
e218962c55 core: add tempStore option to DB 2024-03-21 11:13:15 +05:00
Abdullah Atta
fa080b5ce2 core: migrate items sequentially during sync 2024-03-21 11:13:15 +05:00
Abdullah Atta
d7d019f870 core: fix build error 2024-03-21 11:13:15 +05:00
Abdullah Atta
74b5c4d894 web: execute only 1 query at a time 2024-03-21 11:13:14 +05:00
Abdullah Atta
4ebc3af1e4 web: fix diff viewer crashing the app 2024-03-21 11:11:30 +05:00
Abdullah Atta
3188b33d19 core: do not stop sync if a conflict occurs 2024-03-21 11:11:29 +05:00
Abdullah Atta
c2c69c282e core: allow only 1 transaction at a time 2024-03-21 11:11:29 +05:00
Abdullah Atta
f57c7b5998 core: simplify item key derivation in virtualized grouping 2024-03-21 11:11:29 +05:00
Abdullah Atta
56faf3ed48 web: improve list item rendering performance 2024-03-21 11:11:29 +05:00
Abdullah Atta
2fe8c87caa core: always send realtime sync event 2024-03-21 11:11:29 +05:00
Abdullah Atta
b7ecb7b6fb core: fix content date edited not updating 2024-03-21 11:11:29 +05:00
Abdullah Atta
569b6c7939 core: put items in chunks of 200 2024-03-21 11:11:29 +05:00
Abdullah Atta
e2f9b9c58d web: set name prop on fields 2024-03-21 11:11:29 +05:00
Abdullah Atta
94150a92aa core: implement sync v2 2024-03-21 11:11:29 +05:00
Ammar Ahmed
f81814a426 mobile: use index based grouping 2024-03-21 11:11:29 +05:00
Abdullah Atta
443b6ad7e9 web: changes to use new grouping api 2024-03-21 11:11:29 +05:00
Abdullah Atta
2ceb68ec87 core: implement new high perf indexed based grouping 2024-03-21 11:11:28 +05:00
Ammar Ahmed
29f66d457d mobile: fix share extension in release 2024-03-21 11:11:02 +05:00
Abdullah Atta
304d69f8b5 web: fix router types 2024-03-21 11:11:02 +05:00
Abdullah Atta
900a5b69a5 web: enable vite hot reloading 2024-03-21 11:11:02 +05:00
Abdullah Atta
ebe1b641fd web: fix minor build issues 2024-03-21 11:11:01 +05:00
Abdullah Atta
f26ea526e8 web: migrate everything to react@18 2024-03-21 11:11:01 +05:00
Abdullah Atta
b36e6faac5 web: fix notebook tests 2024-03-21 11:09:05 +05:00
Ammar Ahmed
528fb3092b mobile: share extension cleanup 2024-03-21 11:09:05 +05:00
Ammar Ahmed
d5ee925c52 mobile: cleanup 2024-03-21 11:09:04 +05:00
Ammar Ahmed
208e32d7ea mobile: migrate share extension 2024-03-21 11:09:04 +05:00
Ammar Ahmed
5429161f91 mobile: fix navigation 2024-03-21 11:09:04 +05:00
Abdullah Atta
81cdfcf61a web: send noteId when decrypting real-time locked content 2024-03-21 11:09:04 +05:00
Abdullah Atta
6186e22006 web: fix tag tests 2024-03-21 11:09:04 +05:00
Ammar Ahmed
4ff051130b mobile: pass tests 2024-03-21 11:09:04 +05:00
Abdullah Atta
97ae36dcda web: fix html export snapshot 2024-03-21 11:09:04 +05:00
Abdullah Atta
800b5f9d9a core: fix md with frontmatter export 2024-03-21 11:09:04 +05:00
Ammar Ahmed
d4b1f32516 core: fix ts error 2024-03-21 11:09:04 +05:00
Ammar Ahmed
6626b856fb mobile: fix webpack build 2024-03-21 11:09:04 +05:00
Ammar Ahmed
44df437c4e mobile: push changes 2024-03-21 11:09:04 +05:00
Abdullah Atta
189a9da5b5 web: fix notes tests 2024-03-21 11:09:03 +05:00
Abdullah Atta
73def8a682 core: prevent duplicate colors based on color code 2024-03-21 11:09:03 +05:00
Abdullah Atta
7c97db74dc core: fix error on locking notes 2024-03-21 11:09:03 +05:00
Ammar Ahmed
ceb6e94d0c mobile: push changes 2024-03-21 11:09:03 +05:00
Abdullah Atta
1a61c4ee8f web: reset search results on navigation 2024-03-21 11:09:03 +05:00
Abdullah Atta
d4aa4fdb90 web: reset prepared sql stmt on error 2024-03-21 11:09:03 +05:00
Abdullah Atta
3e7db7051b web: reuse search query 2024-03-21 11:09:03 +05:00
Abdullah Atta
6b6e903322 core: use porter trigram tokenizer for fts 2024-03-21 11:09:03 +05:00
Abdullah Atta
2f62c72cfe core: properly escape fts query 2024-03-21 11:09:03 +05:00
Abdullah Atta
8951352f63 web: add support for assigning tags to notes 2024-03-21 11:09:03 +05:00
Abdullah Atta
6c9e265a11 core: fix "type" does not exist 2024-03-21 11:09:03 +05:00
Abdullah Atta
1a14d37c72 core: fix build error 2024-03-21 11:09:03 +05:00
Ammar Ahmed
5bfad0149b mobile: migrate to sqlite 2024-03-21 11:09:02 +05:00
Abdullah Atta
2168609577 web: fix note editor properties 2024-03-21 11:08:13 +05:00
Abdullah Atta
7e8e981145 common: type is now optional in getFormattedDate 2024-03-21 11:08:13 +05:00
Abdullah Atta
300e65f5c4 core: return FilteredSelector from attachments.ofNote 2024-03-21 11:08:13 +05:00
Abdullah Atta
69590f9547 web: show notebook & tag shortcuts when assigning notes 2024-03-21 11:08:13 +05:00
Abdullah Atta
ae023bdf5b web: implement virtualized search for all items 2024-03-21 11:08:13 +05:00
Abdullah Atta
4556e4d230 web: use lazy loading to load attachments 2024-03-21 11:08:12 +05:00
Abdullah Atta
a77c88bddd web: load tag & color title lazily 2024-03-21 11:07:18 +05:00
Abdullah Atta
8672f92942 web: show all nested notebooks as tree when moving notes 2024-03-21 11:07:18 +05:00
Abdullah Atta
a8e81a32bf web: add support for nested notebooks 2024-03-21 11:07:18 +05:00
Abdullah Atta
95b638a135 web: use new virtualized grouping for reminders 2024-03-21 11:07:18 +05:00
Abdullah Atta
4302cdf0ea web: use new virtualized grouping for trash 2024-03-21 11:07:18 +05:00
Abdullah Atta
36d097f86c web: use new virtualized grouping for monographs 2024-03-21 11:07:18 +05:00
Abdullah Atta
b364178fc0 core: add support for fetching trash as grouped 2024-03-21 11:07:18 +05:00
Abdullah Atta
2c7927bb08 web: install missing @hazae41/foras 2024-03-21 11:07:18 +05:00
Abdullah Atta
af6041128b core: fix attachment extraction for locked notes 2024-03-21 11:07:18 +05:00
Abdullah Atta
6ccee9f6eb global: update lockfiles 2024-03-21 11:07:17 +05:00
Abdullah Atta
404f2072a1 web: start initial migration to sqlite 2024-03-21 11:05:23 +05:00
Abdullah Atta
01e774bff5 ui: add support for lazily loading menu items 2024-03-21 11:04:44 +05:00
Abdullah Atta
df9fb59f40 common: remove total-notes utility 2024-03-21 11:04:44 +05:00
Abdullah Atta
9ac9e21645 core: changes according to client needs 2024-03-21 11:04:26 +05:00
Abdullah Atta
44846cc7b5 core: fix database migration 2024-03-21 11:04:26 +05:00
Abdullah Atta
96e36a6f73 core: add support for incremental grouping 2024-03-21 11:04:26 +05:00
Abdullah Atta
37ad3ea31a core: fix size of nanoid in benchmarks 2024-03-21 11:04:26 +05:00
Abdullah Atta
07d2a701c7 core: optimize bson objectid generation & add benchmarks 2024-03-21 11:04:26 +05:00
Abdullah Atta
94f7e8cd08 core: fix monographs 2024-03-21 11:04:26 +05:00
Abdullah Atta
51819e9d4a core: fix sync tests 2024-03-21 11:04:26 +05:00
Abdullah Atta
860ec7fea8 core: remove temporary sqlite db 2024-03-21 11:04:26 +05:00
Abdullah Atta
21b3866df4 core: migrate everything to sqlite 2024-03-21 11:04:25 +05:00
Abdullah Atta
a91717aca3 core: migrate all database writes to sqlite 2024-03-21 11:04:11 +05:00
Abdullah Atta
91a272ee3d global: update lockfiles 2024-03-21 11:03:43 +05:00
Abdullah Atta
d51079fc88 core: convert everything else to typescript 2024-03-21 11:03:14 +05:00
Abdullah Atta
37ae106713 core: remove unnecessary sync tests 2024-03-21 11:03:14 +05:00
Abdullah Atta
b93b5cc8d6 core: migrate monographs to typescript 2024-03-21 11:03:14 +05:00
Abdullah Atta
9d6733deff core: make migration tests less flaky 2024-03-21 11:03:14 +05:00
Abdullah Atta
86652230bc core: add tests for migrations 2024-03-21 11:03:14 +05:00
Abdullah Atta
588e37aa20 core: migrate settings to its own collection 2024-03-21 11:03:14 +05:00
Abdullah Atta
79b75c5ba7 core: get rid of topics; move to sub notebooks 2024-03-21 11:03:14 +05:00
Abdullah Atta
cc60558839 core: migrate attachments to use relations for linking to notes 2024-03-21 11:03:13 +05:00
Abdullah Atta
c7a6cd8964 core: minor updates and fixes 2024-03-21 11:02:47 +05:00
Abdullah Atta
5b537ab470 core: fix types & syncing issues 2024-03-21 11:02:47 +05:00
ammarahm-ed
48af6c460f mobile: pass all tests 2024-03-21 11:02:47 +05:00
ammarahm-ed
89c9c58631 mobile: fix filesystem not loaded 2024-03-21 11:02:47 +05:00
ammarahm-ed
c10f518e3a mobile: fix navigating to tags 2024-03-21 11:02:47 +05:00
ammarahm-ed
1f4cd6504a mobile: migrate to typescript 2024-03-21 11:02:46 +05:00
ammarahm-ed
9ef40c01ce common: fix ts errors 2024-03-21 11:00:00 +05:00
Abdullah Atta
843be2a62c mobile: use new types from core 2024-03-21 11:00:00 +05:00
Abdullah Atta
a881a6d51e web: use new types from core 2024-03-21 10:59:59 +05:00
Abdullah Atta
22221afb7a core: fix more typings 2024-03-21 10:58:39 +05:00
Abdullah Atta
21a7c64b0b core: fix typing errors 2024-03-21 10:58:39 +05:00
Abdullah Atta
41ea254301 core: convert almost everything to typescript 2024-03-21 10:58:39 +05:00
Ammar Ahmed
3b15717150 mobile: fix lint errors 2024-03-21 10:56:01 +05:00
Abdullah Atta
94f02cdb07 ci: update node version to 20 2024-03-21 10:56:00 +05:00
Abdullah Atta
061433d8cd config: update nx 2024-03-21 10:56:00 +05:00
Abdullah Atta
c8ba88bb99 desktop: set release channel to beta 2024-03-21 10:56:00 +05:00
Ammar Ahmed
3b181cd9b2 mobile: update ios version number 2024-03-21 10:56:00 +05:00
Ammar Ahmed
5384bed382 ci: update workflow name
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-03-21 10:55:49 +05:00
Ammar Ahmed
ac0d831f22 mobile: v3 beta release 2024-03-21 10:55:49 +05:00
Ammar Ahmed
8776058655 ci: update iOS workflow
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-03-21 10:55:15 +05:00
Ammar Ahmed
5c8c806228 Update android.publish.internal.yml
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-03-21 10:55:15 +05:00
Ammar Ahmed
aa2110b736 ci: android.publish.yml
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-03-21 10:55:15 +05:00
Abdullah Atta
cbfaf6ae18 desktop: do not set teamId for notarization 2024-03-21 10:55:15 +05:00
Abdullah Atta
d815608701 ci: APPLE_API_KEY_ISSUER > APPLE_API_ISSUER 2024-03-21 10:55:15 +05:00
Abdullah Atta
696c280eaf desktop: fix unknown property 'notarize' error 2024-03-21 10:55:15 +05:00
Abdullah Atta
b8c785fa3f desktop: use official electron builder notarization 2024-03-21 10:55:15 +05:00
Abdullah Atta
d80fdfbfc1 ci: update {upload,download}-artifact to v4 2024-03-21 10:55:15 +05:00
Abdullah Atta
f783dad211 ci: get rid of you may only define one of branches and branches-ignore for a single event 2024-03-21 10:55:15 +05:00
Abdullah Atta
c335d10167 ci: use m1 for building on mac 2024-03-21 10:55:15 +05:00
Abdullah Atta
bf7a02df5e ci: use wrangler directly to publish to cf 2024-03-21 10:55:15 +05:00
Abdullah Atta
bf12385099 desktop: use app version from autoUpdater 2024-03-21 10:55:15 +05:00
Abdullah Atta
f98b53e9b8 ci: update cloudflare action 2024-03-21 10:55:15 +05:00
Abdullah Atta
8f379d253e desktop: ready beta for deployment 2024-03-21 10:55:14 +05:00
Abdullah Atta
e1f07618d3 ci: deploy to correct cf pages project
Signed-off-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-03-21 10:54:56 +05:00
Abdullah Atta
9a0c129844 core: turn off sync push by default 2024-03-21 10:54:55 +05:00
Ammar Ahmed
aa2a8ab6f4 mobile: ignore beta updates on gh release 2024-03-21 10:17:34 +05:00
Ammar Ahmed
8e59ff1318 mobile: release v2.6.18 2024-03-21 10:11:37 +05:00
Abdullah Atta
ad99c87f72 web: bump version to 2.6.17 2024-03-21 10:07:11 +05:00
Abdullah Atta
ba776b5854 global: update lockfiles 2024-03-21 10:07:02 +05:00
Abdullah Atta
e526145e48 web: fix cannot read property integration of undefined 2024-03-21 10:02:08 +05:00
Abdullah Atta
45c5e65bf6 core: add more sanity checks 2024-03-21 09:42:38 +05:00
Abdullah Atta
87bec4e2ab core: add sanity checks to handle cannot read properties of undefined (reading 'hash') error 2024-03-21 09:37:18 +05:00
Abdullah Atta
433e67a6dc web: fix pull failed error on downloading attachments 2024-03-21 09:12:55 +05:00
Ammar Ahmed
6acba51b88 mobile: fix app lock shows on session expired dialog 2024-03-21 07:46:49 +05:00
Abdullah Atta
cf1322952d web: handle errors during attachment downloading 2024-03-15 09:25:10 +05:00
Abdullah Atta
b5ac9dd430 web: make opfs safer by allowing only 1 operation at a time 2024-03-15 09:01:35 +05:00
Abdullah Atta
a3b590bcb7 core: add more login tests 2024-03-12 07:19:59 +05:00
Ammar Ahmed
d4f7e3ef07 mobile: add changelog 2024-03-06 15:31:33 +05:00
Abdullah Atta
16119f6958 setup: optimize bootstrap script 2024-03-06 13:40:42 +05:00
Abdullah Atta
e39c2583a5 setup: only run npm rebuild if required 2024-03-06 13:40:41 +05:00
Abdullah Atta
eecff009dd setup: run npm rebuild after bootstrap 2024-03-06 13:40:41 +05:00
Abdullah Atta
d9ed61a7da setup: ignore scripts during bootstrap 2024-03-06 13:40:41 +05:00
Abdullah Atta
58db265702 setup: use 1 thread on CI 2024-03-06 13:40:41 +05:00
Abdullah Atta
bd39f0cbf8 core: fix e.metadata.hash is not defined 2024-03-06 13:29:59 +05:00
Abdullah Atta
255015108a core: update lockfile 2024-03-06 13:01:00 +05:00
Abdullah Atta
b80f366f8d core: run patch-package after install 2024-03-06 13:00:34 +05:00
Ammar Ahmed
c845c7fce6 mobile: release v2.6.17 2024-03-06 12:59:23 +05:00
Ammar Ahmed
6e7b7ce0e1 mobile: ask user to save recovery key after changing password 2024-03-06 12:33:38 +05:00
Abdullah Atta
9b728902d4 web: bump version to 2.6.16 2024-03-06 12:03:06 +05:00
Abdullah Atta
9a1f54c41a desktop: set proxy on startup 2024-03-06 11:43:50 +05:00
Abdullah Atta
b3251eb016 core: fix login gets stuck on error 2024-03-06 11:28:45 +05:00
Abdullah Atta
f4064b7939 core: patch signalr to exclude electron renderer process as node 2024-03-06 11:28:27 +05:00
Abdullah Atta
f014f08ff4 web: fix export to html test snapshot 2024-03-05 15:41:53 +05:00
Abdullah Atta
dee1cf4b5a web: fix locked note status not updating in list 2024-03-05 15:38:01 +05:00
Abdullah Atta
f35a3d8fa3 web: clear editor on unlocking the note 2024-03-05 15:37:45 +05:00
Abdullah Atta
ca9a8d14fa core: fix sync tests 2024-03-05 15:03:18 +05:00
Abdullah Atta
35c35fa9d7 core: update test snapshots 2024-03-05 14:51:41 +05:00
Abdullah Atta
09fff95d58 editor: fix marks.filter is not a function error on pressing Enter 2024-03-05 14:27:29 +05:00
Abdullah Atta
287307a1ba core: move to json protocol for signalr 2024-03-05 14:23:44 +05:00
Abdullah Atta
d628e62302 web: fix app hangs when downloading logs 2024-03-05 14:18:54 +05:00
Ammar Ahmed
a070bc46ad mobile: check backup was successful 2024-03-05 14:16:35 +05:00
Ammar Ahmed
9027c44511 mobile: request backup before changing password 2024-03-05 14:16:35 +05:00
Abdullah Atta
722aa7b9c6 mobile: update database sync api to use new sync options 2024-03-05 14:16:35 +05:00
Abdullah Atta
a4e777b24b web: update database sync api to use new sync options 2024-03-05 14:16:35 +05:00
Abdullah Atta
af7120e953 web: create backup before changing password 2024-03-05 14:16:35 +05:00
Abdullah Atta
d5adc3bbac web: refactor backup verification logic 2024-03-05 14:16:35 +05:00
Abdullah Atta
aa3d778ad1 core: reduce unnecessary syncing during password change 2024-03-05 14:16:35 +05:00
Abdullah Atta
3465a816c6 web: rename to markdown shortcuts 2024-03-05 13:42:39 +05:00
Ammar Ahmed
3d1726c5aa mobile: toggle markdown shortcuts 2024-03-05 13:42:39 +05:00
Muhammad Ali
488de2d583 web: add setting for toggling markdown in editor 2024-03-05 13:42:39 +05:00
Abdullah Atta
c415b114a6 web: template not disabling when copying as markdown 2024-03-05 13:32:54 +05:00
Abdullah Atta
da36784e9c core: fix content inside span not converting to markdown 2024-03-05 13:32:54 +05:00
Muhammad Ali
78fafdc272 editor: convert google docs checklists on paste 2024-03-05 13:32:54 +05:00
Muhammad Ali
7d57055f73 editor: fix new lines from google docs not being preserved on paste (#3988)
* editor: handle <br> directly under root element

* editor: fix pasting from google docs

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-03-05 12:14:19 +05:00
Ammar Ahmed
b84cc747cb mobile: restore backup with encryption key 2024-03-04 15:56:12 +05:00
Abdullah Atta
9a4f3ccbad web: allow using encryption key to restore backup 2024-03-04 15:56:12 +05:00
Abdullah Atta
68de3cc928 core: allow using encryption key to decrypt backup 2024-03-04 15:56:12 +05:00
Ammar Ahmed
6e135cdd36 mobile: sort reminders 2024-03-04 15:27:42 +05:00
Abdullah Atta
696116ac85 web: add support for sorting reminders 2024-03-04 15:27:42 +05:00
Abdullah Atta
08a13ff35a core: add support for group options for reminders 2024-03-04 15:27:42 +05:00
Abdullah Atta
af1cea81dc theme: use radio focus color from theme 2024-03-04 15:27:42 +05:00
Muhammad Ali
2c22a7ca90 core: add support for sorting reminders by due date 2024-03-04 15:27:42 +05:00
Muhammad Ali
6fd6bd0375 desktop: add proxy settings (#4196) 2024-03-04 15:16:59 +05:00
Muhammad Ali
1a96dc965a desktop: add support for viewing and removing custom dictionary words (#4362)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-03-04 13:47:24 +05:00
Muhammad Ali
9550350f25 desktop: add menu item to copy images in editor (#4373) 2024-03-04 13:27:46 +05:00
Muhammad Ali
0ed605a5b9 editor: fix column toolbar position when table is scrolled horizontally (#4366) 2024-03-04 13:25:46 +05:00
Abdullah Atta
18910d931c config: add .nx to .gitignore 2024-03-04 13:24:25 +05:00
Muhammad Ali
87648b7d8b editor: fix katex math not being rendered correctly (#4353)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-03-04 13:23:27 +05:00
Muhammad Ali
7e7a1aeecb editor: add support for toggling highlight/background color (#4330) 2024-03-04 13:22:25 +05:00
Muhammad Ali
cb353358b7 web: fix editor text not selectable from margins (#4292)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-03-04 13:20:40 +05:00
Muhammad Ali
ba1619711b desktop: fix app autostart in appimage (#4223) 2024-03-04 12:40:51 +05:00
Ammar Ahmed
b3cc9475ad mobile: fix attachment search 2024-03-01 08:22:14 +05:00
Abdullah Atta
ee5c4077fe docs: improve skiff pages import guide 2024-02-13 01:07:14 +05:00
Abdullah Atta
47bbfc618e docs: add guide for migrating from skiff pages 2024-02-12 10:49:40 +05:00
Abdullah Atta
b377329a8b core: fix attachment mime type on read 2024-02-02 16:02:20 +05:00
Abdullah Atta
ae8bcf3865 ci: fix you may only define one of branches and branches-ignore for a single event
Signed-off-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-01-31 12:46:32 +05:00
Abdullah Atta
2f67611829 ci: add workflows for v3 beta publishing 2024-01-31 12:41:08 +05:00
Ammar Ahmed
058c612f4f ci: update default build tools version android
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-01-30 11:41:20 +05:00
Ammar Ahmed
be8df90ccb iOS Publish Workflow (#4194)
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-01-30 11:32:48 +05:00
Abdullah Atta
aa730b5b93 web: fix title only txt exports 2024-01-30 00:29:46 +05:00
Abdullah Atta
34bbcf6387 web: add feature highlights for v2.6.15 2024-01-29 23:33:15 +05:00
Abdullah Atta
33c3c78e2f desktop: get rid of configuration.win.signingHashAlgorithms should be an array 2024-01-29 23:27:45 +05:00
Ammar Ahmed
bf144dcda4 mobile: add ExportOptions.plist 2024-01-29 23:23:48 +05:00
Ammar Ahmed
284ebdb86f ci: @notesnook/ios
Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2024-01-29 23:23:01 +05:00
Abdullah Atta
9dac4cf7f4 desktop: set signing has to sha256 2024-01-29 23:22:29 +05:00
Abdullah Atta
fb973a5514 ci: run build job no matter what 2024-01-29 23:22:29 +05:00
Abdullah Atta
f9226510f9 desktop: use full path for FilesCatalog 2024-01-29 23:22:29 +05:00
Abdullah Atta
5c0a964699 ci: add inputs to disable build for specific platforms 2024-01-29 23:22:29 +05:00
Abdullah Atta
41ffaab3dc ci: install azurecodesigning module 2024-01-29 23:22:29 +05:00
Abdullah Atta
764c721f1d desktop: add windows code signing 2024-01-29 23:22:29 +05:00
Ammar Ahmed
3d267f91ef mobile: bump version code 2024-01-29 19:55:41 +05:00
Ammar Ahmed
f10f28a7f8 mobile: release v2.6.15 2024-01-29 19:32:14 +05:00
Ammar Ahmed
8d04f89a18 mobile: remove progress bar 2024-01-29 19:06:01 +05:00
Ammar Ahmed
9d1374dcd4 editor: fix progress not showing in image on mobile 2024-01-29 19:05:49 +05:00
Abdullah Atta
094a65e514 editor: hide progress on image if 0 2024-01-29 18:26:44 +05:00
Ammar Ahmed
372da979e1 mobile: support ignoring edits 2024-01-29 18:26:44 +05:00
Abdullah Atta
d3371326f2 editor: add progress indicator to image 2024-01-29 18:26:44 +05:00
Abdullah Atta
57452bd0e6 core: allow setting custom date edited 2024-01-29 18:26:44 +05:00
Abdullah Atta
993b8460bf web: do not update dateEdited if ignoring edits 2024-01-29 18:26:44 +05:00
Abdullah Atta
081201aa42 editor: add support for ignoring edits 2024-01-29 18:26:44 +05:00
Abdullah Atta
270e6778d1 editor: optimize image loading when fast scrolling 2024-01-29 16:23:59 +05:00
Abdullah Atta
2074320583 editor: revoke blob urls on image unmount 2024-01-29 16:09:05 +05:00
Abdullah Atta
cd90030616 web: fix note title in toolbar not changing 2024-01-29 15:45:13 +05:00
Abdullah Atta
807bd683b7 web: do not show success prompt on unlock cancel 2024-01-29 15:36:01 +05:00
Abdullah Atta
35929026a4 web: monograph.notesnook.com > monogr.ph 2024-01-29 15:22:22 +05:00
Ammar Ahmed
41eb94ee47 mobile: fix exporting locked notes 2024-01-29 11:02:32 +05:00
Ammar Ahmed
ba51e110ad mobile: fix opening webclips 2024-01-29 11:02:32 +05:00
Ammar Ahmed
ecad06d249 mobile: disable rtl mode 2024-01-29 11:02:32 +05:00
Abdullah Atta
19a151f637 editor: fix image query matching all images in editor 2024-01-28 17:17:45 +05:00
Ammar Ahmed
7c4a6f1e17 global: update deps 2024-01-27 23:06:24 +05:00
Ammar Ahmed
bc88e953d1 mobile: make sure tools render in toolbar 2024-01-27 23:05:30 +05:00
Ammar Ahmed
7d89ec676a mobile: fix attachments not loading when added from share ext 2024-01-27 22:50:41 +05:00
Ammar Ahmed
c8f8bcca93 mobile: organize bulk exports 2024-01-27 21:23:29 +05:00
Abdullah Atta
9fa904e849 web: fix exporting of single note 2024-01-27 21:23:29 +05:00
Abdullah Atta
05cc947cb4 web: fix pdf exports 2024-01-27 21:23:29 +05:00
alihamuh
a20a683b17 web: code refactoring 2024-01-27 21:23:29 +05:00
alihamuh
5fc43c931e web: added directory paths for exports 2024-01-27 21:23:29 +05:00
Abdullah Atta
0879c3b4d6 core: fix formatting of single spaced paragarphs in markdown exports (#4186)
* core: update showdown library to support single spaced paragraphs

* core: add tests

* core: update showdown library
2024-01-27 18:59:35 +05:00
Abdullah Atta
2eded71de3 core: fix restored attachments not syncing 2024-01-27 16:06:04 +05:00
Abdullah Atta
9e30ee50b8 core: add logs 2024-01-27 16:06:04 +05:00
Abdullah Atta
08621a5873 core: try to preserve mime type on backup restore 2024-01-27 16:06:04 +05:00
Abdullah Atta
17f5bd28ba web: do not overwrite filename & mimetype on attachment reupload 2024-01-27 16:06:04 +05:00
Ammar Ahmed
4558c0b2eb mobile: fix downloading attachments from editor 2024-01-27 16:06:04 +05:00
Abdullah Atta
a442677e91 editor: fix loading of images that have wrong mime type 2024-01-27 16:06:04 +05:00
Abdullah Atta
95666bee36 editor: remove attachment progress once it reaches 100 2024-01-27 16:06:04 +05:00
Abdullah Atta
c4232ac95a web: do not send hash when updating attachment 2024-01-27 16:06:04 +05:00
Abdullah Atta
0283037289 mobile: changes related to download cancellation 2024-01-27 16:06:04 +05:00
Abdullah Atta
b6fd0df715 web: get rid of all attachment loading logic 2024-01-27 16:06:04 +05:00
Abdullah Atta
f53fb58024 editor: eagerly load image/webclip instead of waiting on client 2024-01-27 16:06:04 +05:00
Abdullah Atta
21d452308d core: simplify download cancellation 2024-01-27 16:06:04 +05:00
Ammar Ahmed
823608cca1 mobile: daily trash cleanup 2024-01-27 16:05:28 +05:00
alihamuh
f3a0b998e4 web: added daily trash interval option 2024-01-27 16:05:28 +05:00
theProton
a47a38b16b web: fix incorrect title on scrolling note (#4137)
Signed-off-by: Parthiv-M <parthivmenon.dev@gmail.com>
2024-01-27 11:44:58 +05:00
Ammar Ahmed
a184c53dd5 mobile: fix loading empty conent in editor on tablets 2024-01-26 23:02:06 +05:00
Abdullah Atta
a3464255ec core: always use attachment mime type from backup if possible 2024-01-26 19:21:55 +05:00
Abdullah Atta
088c6670a9 core: fix crash if note title only contains whitespace 2024-01-26 19:12:41 +05:00
Abdullah Atta
27840b9bd6 editor: fix link pasting (#4178) 2024-01-26 18:57:59 +05:00
Muhammad Ali
ae819504f0 editor: fix input rules not working at the end of note (#4130)
* web: added condition in getDeletedNodes

* editor: some corrections

* editor: merge if conditions

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-01-26 16:43:19 +05:00
Muhammad Ali
af792e394c web: add support for moving locked notes to trash (#4134)
* web: added support for single/multi trash notes

* web: show error when trying to preview a locked note in trash

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-01-26 16:37:54 +05:00
Muhammad Ali
76a4d5c2a5 editor: fix subtasks getting unchecked on drag/drop reorder (#4135)
* editor: add a condition to check nested item state

* editor: force coerce value to boolean

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2024-01-26 16:31:23 +05:00
Muhammad Ali
4e23acd608 web: fix realtime editor sync cannot be disabled (#4140) 2024-01-26 16:22:56 +05:00
Ammar Ahmed
3c65dcdd8b ci: bump android build tools version 2024-01-15 12:31:37 +05:00
Ammar Ahmed
efea6e3972 theme: add missing alpha colors 2024-01-15 12:31:11 +05:00
Ammar Ahmed
185cca7880 mobile: release v2.6.15 2024-01-12 20:10:58 +05:00
Abdullah Atta
fbded93405 global: update lockfiles 2024-01-05 22:10:05 +05:00
Abdullah Atta
674881b873 web: add zip64 support for backups, export & imports (#4079)
* web: use @zip.js/zip.js for reading zip files

* web: always use zip streams for writing zips

* core: fix types

* theme: update lockfile
2024-01-05 22:05:04 +05:00
Abdullah Atta
248fb6dd2d web: bump version to 2.6.14 2024-01-05 21:55:18 +05:00
Abdullah Atta
3211e7a149 global: update lockfiles 2024-01-05 21:54:06 +05:00
Abdullah Atta
08496c699e editor: fix font size changes back after exiting list (fixes #3602) 2024-01-05 21:48:00 +05:00
Abdullah Atta
060fa25814 core: support underline when exporting as md (fix #3990) 2024-01-05 20:53:14 +05:00
Abdullah Atta
a6b1effc77 core: remove relations auto cleanup 2024-01-05 16:24:02 +05:00
Abdullah Atta
5cf9c4808e web: show resubscribe button if subscription is canceled 2024-01-05 15:55:36 +05:00
Muhammad Ali
d5a44067fd web: fix editor header title input not becoming readonly (#4064) 2024-01-05 11:08:16 +05:00
Muhammad Ali
0de463526f editor: add support for +/- font-size using shortcut keys (#4029) 2024-01-05 10:40:29 +05:00
Muhammad Ali
5fd79875ef editor: fix math/formula block getting cut off on mobile (#4023) 2024-01-05 10:39:20 +05:00
Muhammad Ali
bdb19ad325 web: add license to settings (#4020) 2024-01-05 10:38:13 +05:00
Ammar Ahmed
7a12efc823 mobile: release v2.6.14 2023-12-22 11:58:34 +05:00
Abdullah Atta
2f3bddf860 web: bump version to 2.6.13 2023-12-22 11:51:11 +05:00
Abdullah Atta
6127eb97af editor: do not mark task list as completed if there are no items 2023-12-22 11:49:10 +05:00
Abdullah Atta
86386e14f3 web: update test snapshots 2023-12-22 11:41:42 +05:00
Abdullah Atta
9cc17c29f6 web: use Cmd-a on macOS to select all items in list 2023-12-22 11:38:40 +05:00
Abdullah Atta
a31e863c7b global: update lockfiles 2023-12-22 11:16:26 +05:00
Muhammad Ali
15a32ac83a editor: fix pasting a word inside a list adds newlines around it (#3843)
* editor: added openstart, openEnd from old slice

* editor: removed extra import

* editor: update test snapshots

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-12-22 11:11:03 +05:00
Ammar Ahmed
fa5b84ec0d mobile: minor fixes 2023-12-22 11:10:19 +05:00
Muhammad Ali
7905584eac editor: disable invalid tools when inside a code block (#3997)
* editor: removed fontSize property from code-text style

* editor: TO BE CONTINUED

* editor: some comments for testing

* editor: comment removed

* editor: diabled font size and family in code-block

* editor: disable invalid tools when inside code block

* editor: remove unused console.log

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-12-22 10:26:25 +05:00
Abdullah Atta
afc9b96a11 web: make importer error resistant 2023-12-21 09:08:04 +05:00
Abdullah Atta
4e6466fc18 editor: handle md links with parentheses (#3996) 2023-12-19 14:54:22 +05:00
Abdullah Atta
233baf78ce web: handle file picker dialog cancelation 2023-12-19 14:39:45 +05:00
Abdullah Atta
42d0bee37f desktop: bump electron to 25.9.8 2023-12-19 13:07:34 +05:00
Abdullah Atta
ccadab6a10 web: add md + frontmatter to export all options 2023-12-19 12:44:23 +05:00
Muhammad Ali
bfe5a5cb96 editor: correctly style other types of lists in outline list (#3889) 2023-12-19 12:15:36 +05:00
Muhammad Ali
88fc24c4cf editor: fix code blocks pasting in a single line without formatting (#3910)
* editor: added code support for w3school

* editor: fixed newline issue in per tag code
2023-12-19 12:13:59 +05:00
Abdullah Atta
8be4fea7a3 ui: use symbols for shortcut keys on macOS 2023-12-19 11:12:20 +05:00
Muhammad Ali
a3d39d8b6d editor: add Ctrl/Cmd+\ keyboard shortcut for "Clear all formatting" (#3989)
* editor: added short-cut key in keyap

* editor: use Mod key instead of Ctrl

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-12-19 11:11:35 +05:00
Muhammad Ali
ff36f0259a editor: add support for converting md link syntax to link on paste (#3919) 2023-12-18 16:23:56 +05:00
Muhammad Ali
d13654088a editor: add support for checking/unchecking all items in a task list (#3975) 2023-12-18 16:21:44 +05:00
Muhammad Ali
8a6b97c757 editor: add special readonly mode for toolbar (#3913)
* editor: added a toolbar display on mobile in readonly mode

* editor: hide editable tools from readonly toolbar

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-12-18 16:04:02 +05:00
Muhammad Ali
d71e0c109b web: going back in search after editing a notebook opens notebook edit dialog again (#3979)
* web: changed afterAction()

* web: fix back navigation for dialogs that replace

* web: remove unused import

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-12-18 15:58:20 +05:00
Ammar Ahmed
7e345303fe mobile: fix app lock hides login page on enter background 2023-12-18 10:49:57 +05:00
Abdullah Atta
d881bdb77c web: fix attachment dialog not opening on error 2023-12-11 15:09:38 +05:00
Ammar Ahmed
4961102d8f mobile: fix subscriptions not verified on ios 2023-12-11 10:54:45 +05:00
Abdullah Atta
4f2ab4f1da docs: fix incorrect noun (fixes #3934)
Signed-off-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-12-07 09:56:55 +05:00
Ammar Ahmed
7540e34366 mobile: update provisioning profiles 2023-11-27 08:22:47 +05:00
Abdullah Atta
4d7a8b9ea0 web: bump version to 2.6.12 2023-11-25 22:20:39 +05:00
Abdullah Atta
812ecf93c8 web: fix tag tests 2023-11-25 22:18:05 +05:00
Ammar Ahmed
74d99d97bc mobile: release v2.6.12 2023-11-25 15:44:43 +05:00
Muhammad Ali
5bbc453268 web: fix new tags do not appear under "recent" tags (#3827) 2023-11-25 15:39:38 +05:00
Ammar Ahmed
d71b9edc7f mobile: add support for markdown + frontmatter 2023-11-25 15:32:31 +05:00
Abdullah Atta
134904b551 web: add md with frontmatter export 2023-11-25 15:32:31 +05:00
Abdullah Atta
3eeb292d70 core: add new md + frontmatter export format 2023-11-25 15:32:31 +05:00
Abdullah Atta
04125bbb98 web: minor ui fixes 2023-11-25 15:19:50 +05:00
Ammar Ahmed
cfc3a8341c mobile: update mmkv package 2023-11-25 15:19:27 +05:00
Abdullah Atta
cbb0a511a8 core: fix logs sorting 2023-11-25 15:19:27 +05:00
Abdullah Atta
dff1c7ed32 core: optimize logger 2023-11-25 15:19:27 +05:00
Abdullah Atta
7987ef81a6 web: use removeMulti to bulk remove old logs 2023-11-25 15:19:27 +05:00
Ammar Ahmed
8d8d4ee782 mobile: fix app freeze when deleting old logs 2023-11-25 15:19:27 +05:00
Ammar Ahmed
3a50c73cab core: add removeMulti to storage 2023-11-25 15:19:27 +05:00
Abdullah Atta
4ee0071eca core: stop localOnly items from always getting synced 2023-11-25 15:12:33 +05:00
Muhammad Ali
248192f404 editor: hide link popup in readonly mode on mobile (#3853) 2023-11-25 11:29:02 +05:00
Krishna Bharadwaj
e56b766c3a web: open testimonial source links in new tab (#3863)
Signed-off-by: Dharmavineta <krishnabharadwaj1995@gmail.com>
2023-11-25 11:27:24 +05:00
Abdullah Atta
170b2b24ab web: fix logged in status alignment 2023-11-25 11:26:19 +05:00
Ammar Ahmed
50137e0994 mobile: fix subscriptions not fulfilling on ios 2023-11-25 10:32:24 +05:00
Abdullah Atta
8b5babd5f8 desktop: use node.js fetch instead of net.fetch 2023-11-25 10:20:19 +05:00
Abdullah Atta
39e83200c8 web: fix attachment upload progress on desktop 2023-11-25 10:19:57 +05:00
Abdullah Atta
ead0e0107e core: allow deleting unuploaded attachments 2023-11-25 10:19:38 +05:00
Abdullah Atta
1c888bd4fd web: always open announcement link in browser on desktop app 2023-11-25 10:18:20 +05:00
Krishna Bharadwaj
ff92530339 web: hide email address from status bar (#3859) 2023-11-24 11:18:46 +05:00
Ammar Ahmed
ee38032403 mobile: release v2.6.11 2023-11-22 14:45:16 +05:00
Ammar Ahmed
2ce245659a mobile: fix pricing plans 2023-11-22 14:27:20 +05:00
Abdullah Atta
2c635eb4d7 web: bump version to 2.6.11 2023-11-22 10:44:39 +05:00
Abdullah Atta
d653223df0 editor: load images threadsafely 2023-11-22 10:36:48 +05:00
Muhammad Ali
290b0dfc78 web: close reminder dialog on setting snooze time (#3842) 2023-11-21 10:53:53 +05:00
Muhammad Ali
06bb9e654b web: fix weird janky animation when opening dialogs (#3826) 2023-11-21 08:20:26 +05:00
Muhammad Ali
576fe78e33 clipper: hide clip preview button when there's no clip data (#3772) 2023-11-21 08:18:28 +05:00
Abdullah Atta
0c16bfb5ff web: fix issue with service worker not getting registered 2023-11-20 12:34:07 +05:00
Abdullah Atta
a101dbdf31 web: use bloburl when previewing images 2023-11-20 11:12:02 +05:00
Abdullah Atta
682609044f editor: add support for previewing SVG images 2023-11-20 11:12:02 +05:00
Abdullah Atta
c0a7fb3a5c misc: remove unnecessary files 2023-11-20 10:01:08 +05:00
Abdullah Atta
a153aa791c web: bump version to 2.6.10 2023-11-20 09:49:31 +05:00
Abdullah Atta
76b3dd1f96 web: check if file exists before starting upload 2023-11-20 09:41:35 +05:00
Ammar Ahmed
8b9e2c8526 mobile: release v2.6.10 2023-11-20 08:44:42 +05:00
Ammar Ahmed
0dc2d14736 mobile: fix crash on pricing plans page on ios 2023-11-20 08:27:49 +05:00
Abdullah Atta
fc5dada701 editor: fix task items getting unchecked on sort 2023-11-20 08:25:27 +05:00
Abdullah Atta
f34060c4e0 editor: fix task list title getting reset 2023-11-20 08:25:27 +05:00
Abdullah Atta
006a239680 web: bump version to 2.6.9 2023-11-18 15:13:40 +05:00
Abdullah Atta
c6ed4bcab1 web: allow restoring backups when logged out 2023-11-18 15:13:05 +05:00
Abdullah Atta
b0fe967087 desktop: destroy system tray on toggle off setting 2023-11-18 14:53:14 +05:00
Abdullah Atta
3f32673b0a desktop: permanently disable menu bar 2023-11-18 14:45:17 +05:00
Ammar Ahmed
0525cecaee mobile: bump version code on android 2023-11-18 14:38:37 +05:00
Ammar Ahmed
7d84a9582b mobile: allow restoring backups when logged out 2023-11-18 14:38:37 +05:00
Abdullah Atta
289acd8ab6 web: add cross icon for removing tags 2023-11-18 14:35:57 +05:00
Abdullah Atta
bb6d9f604b web: wait 1s for math to render on pdf print 2023-11-18 14:23:57 +05:00
Abdullah Atta
c20a8232cd core: safe check for IS_DESKTOP_APP 2023-11-18 14:23:57 +05:00
Ammar Ahmed
c886212e89 core: add padding to math block in exports 2023-11-18 14:23:57 +05:00
Abdullah Atta
799ae111ae editor: disable resizing of floating images 2023-11-18 13:05:00 +05:00
Abdullah Atta
2a990979a0 editor: fix drag/drop of task items 2023-11-18 13:04:45 +05:00
Ammar Ahmed
2d1071117b mobile: release v2.6.9 2023-11-18 12:17:27 +05:00
Ammar Ahmed
aefce1ee67 mobile: add support /now /time in title 2023-11-18 12:17:27 +05:00
Ammar Ahmed
64d10f5050 mobile: reupload if file size is zero 2023-11-18 12:17:11 +05:00
Abdullah Atta
95b9edca62 web: check if attachment really exists on insertion 2023-11-18 12:17:11 +05:00
Abdullah Atta
06c8422cbe core: prevent duplicate attachments on backup restore 2023-11-18 12:17:11 +05:00
Abdullah Atta
177d8b5112 web: remove rogue console.log 2023-11-18 10:18:53 +05:00
Abdullah Atta
39afa98fce web: lazily load fs module 2023-11-18 10:17:23 +05:00
Abdullah Atta
5bc1ad4ba5 editor: fix url is undefined error in loading images 2023-11-18 10:16:59 +05:00
Abdullah Atta
0b1223976c web: fix builds 2023-11-18 10:03:14 +05:00
Muhammad Ali
3873758fe5 clipper(web): add fallback height & width for web clip(#3766) 2023-11-18 10:03:14 +05:00
Abdullah Atta
3c876cb1d8 global: update lockfiles 2023-11-18 10:03:13 +05:00
Abdullah Atta
0a1a16c197 editor: show placeholder when downloading image 2023-11-18 10:03:13 +05:00
Ammar Ahmed
3c56325fa6 mobile: fix image download 2023-11-18 10:03:13 +05:00
Abdullah Atta
e5db3353ae editor: improve image loading 2023-11-18 10:03:13 +05:00
Muhammad Ali
3416ba4eaa editor: removed a useState method 2023-11-18 10:03:13 +05:00
Muhammad Ali
cdb69bf553 editor: removed updateImage command from useEffect 2023-11-18 10:03:13 +05:00
Abdullah Atta
1aff6d0d55 editor: sync task list state at the very end 2023-11-18 10:03:13 +05:00
Ammar Ahmed
67b7bdcea3 mobile: update iap library to latest 2023-11-18 10:02:45 +05:00
Abdullah Atta
9b6a6de415 editor: update snapshots 2023-11-17 12:50:43 +05:00
Abdullah Atta
8325246a56 web: reduce network check retries to 3 2023-11-17 11:49:52 +05:00
Abdullah Atta
3d11fb5e3f web: specify if session has expired during login 2023-11-17 08:44:17 +05:00
Abdullah Atta
4627a58a52 web: show tags in readonly mode 2023-11-17 08:34:16 +05:00
Muhammad Ali
e557047af1 web: fix pressing enter to add a new tag from list of suggestion fails (#3548)
* web: added ref to control resturn key func

* web: click should open autosuggestions menu

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-11-17 08:30:13 +05:00
Muhammad Ali
8b4cea7339 editor: make table header row immovable (#3459) 2023-11-16 15:30:32 +05:00
Muhammad Ali
ba5e35ec5c editor: fix resize for floating images (#3643)
* editor: removed maxWidth to make image float resizeable

* editor: fix resize for floating images

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-11-16 15:26:25 +05:00
aryan katiyar
f53817e94d web: add link to source code in Settings (#3683) 2023-11-16 15:18:11 +05:00
Muhammad Ali
846efc5351 editor: use prosemirror plugin for managing task list state (#3252)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-11-16 15:12:19 +05:00
Abdullah Atta
0149d00d64 web: add support for storing attachments in opfs or cache storage 2023-11-16 15:01:48 +05:00
Abdullah Atta
275f9730f1 web: allow downloading unuploading attachments 2023-11-16 15:01:48 +05:00
Abdullah Atta
43bc954989 core: allow uploading attachments that are in 0 notes 2023-11-16 15:01:48 +05:00
Abdullah Atta
c88bc722e1 fs: get rid of localforage and use generic interface 2023-11-16 15:01:48 +05:00
Muhammad Ali
ec6fc6839e editor: support datetime shortcuts in task list title & note title (#3746)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-11-16 14:14:43 +05:00
Abdullah Atta
8383c93292 desktop: only set openAtLogin if not already set 2023-11-16 13:07:21 +05:00
Muhammad Ali
37d8d85935 clipper: delete import css rules after iteration (#3720)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-11-16 13:06:51 +05:00
Muhammad Ali
95db7c6329 desktop: fix minimize to system tray not working immediately after enabling (#3734)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-11-16 13:01:22 +05:00
Muhammad Ali
636783335f desktop: add setting to disable menu bar (#3728)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-11-16 09:51:01 +05:00
Abdullah Atta
f88431ded4 core: handle case where headline is undefined 2023-11-03 08:28:41 +05:00
Abdullah Atta
91b0de0580 web: bump version to 2.6.8 2023-11-02 13:23:00 +05:00
Abdullah Atta
a5704ad75c desktop: do not show auto update toggle for flatpak users 2023-11-02 13:20:51 +05:00
Abdullah Atta
ba8c09a7d9 desktop: update electron to 25.9.3 2023-11-02 13:07:15 +05:00
Abdullah Atta
dbe4015655 web: preserve note edited time when exporting 2023-11-02 12:59:47 +05:00
Abdullah Atta
76237ad7dd web: fix sync progress in account recovery 2023-11-02 10:35:06 +05:00
Abdullah Atta
dbfb1168fb core: fix restored notes not syncing (closes #3472) 2023-11-02 10:34:21 +05:00
Abdullah Atta
830d28fbe5 editor: fix pasting link replaces selected text
fixes #3520
2023-10-31 12:33:49 +05:00
Abdullah Atta
c6def2a8fe web: fix crash on opening editor properties
(fixes #3585)
2023-10-31 12:03:45 +05:00
Abdullah Atta
ebc95fcea7 web: make duplicate filenames in attachments unique on download (#3678)
* web: make duplicate filenames in attachments unique

* Update apps/web/src/utils/streams/attachment-stream.ts

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

* web: make attachment filename case insensitive

---------

Signed-off-by: Abdullah Atta <thecodrr@protonmail.com>
2023-10-31 11:35:01 +05:00
Abdullah Atta
f78cfe59e8 web: hide note title immediately on setting change 2023-10-31 11:12:11 +05:00
Johnny Avila
a2cbc93d34 web: add setting to allow hiding note title from window title (#3480)
Signed-off-by: Johnny Avila <avila.johnny11@gmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-10-31 11:08:14 +05:00
Muhammad Ali
4728f14e8c core: add year when grouping by month (#3630) 2023-10-31 10:57:52 +05:00
Abdullah Atta
e94b431d58 web: change pwa theme color according to current theme (#3621)
* web: change pwa theme color according to current theme

* web: use background color as pwa theme-color
2023-10-31 10:56:37 +05:00
Muhammad Ali
0ac5e2b995 web: hide unnecessary items from status bar in focus mode (#3577)
* web: used app-store to hide sync-status suring focus mode

* web: hide useless items from status bar in focus mode

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-10-31 10:54:57 +05:00
Muhammad Ali
365764e3e3 web: update vault setting immediately after vault creation (#3542)
* web: added onStateChange function to vault-settings.

* web: fix font style of checkbox in password dialog

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-10-31 10:50:38 +05:00
Ammar Ahmed
8d2b5aa3de mobile: release v2.6.8 2023-10-30 15:24:30 +05:00
Ammar Ahmed
9a031a4a43 mobile: fix selection state causing delete to fail 2023-10-30 14:25:14 +05:00
1585 changed files with 386385 additions and 185585 deletions

View File

@@ -15,6 +15,7 @@ const SCOPES = [
"mobile",
"web",
"vericrypt",
"monograph",
"desktop",
"crypto",
"editor",
@@ -34,7 +35,8 @@ const SCOPES = [
"common",
"global",
"docs",
"themebuilder"
"themebuilder",
"intl"
];
module.exports = {

View File

@@ -15,6 +15,8 @@ apps/mobile/e2e/
# web
apps/web/public/an.js
apps/web/src/common/sqlite/wa-sqlite-async.js
apps/web/src/common/sqlite/wa-sqlite.js
# editor
packages/editor/styles/

View File

@@ -78,7 +78,13 @@ module.exports = {
semi: ["error", "always"],
"@typescript-eslint/no-empty-function": "off",
"react/prop-types": "off",
"header/header": ["error", "block", LICENSE, 1]
"header/header": ["error", "block", LICENSE, 1],
"@typescript-eslint/no-empty-interface": [
"error",
{
allowSingleExtends: true
}
]
},
settings: {
react: {

View File

@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Notesnook Discord Community
url: https://discord.gg/6mHHyncHJE
url: https://go.notesnook.com/discord
about: Reach out to us directly & discuss your issues, suggestions & other feedback!

View File

@@ -5,9 +5,9 @@ runs:
using: "composite"
steps:
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x
cache: "npm"
cache-dependency-path: |
package-lock.json

View File

@@ -6,6 +6,11 @@ jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
NDK_CCACHE: ccache
USE_CCACHE: 1
steps:
- name: Checkout
@@ -24,30 +29,128 @@ jobs:
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: Install CCache
uses: hendrikmuhs/ccache-action@v1.2.11
with:
key: ${{ runner.os }}-ccache-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
max-size: 1500M
restore-keys: |
${{ runner.os }}-ccache-
- name: Setup CCache
run: |
ln -s $(which ccache) /usr/local/bin/gcc
ln -s $(which ccache) /usr/local/bin/g++
ln -s $(which ccache) /usr/local/bin/cc
ln -s $(which ccache) /usr/local/bin/c++
ln -s $(which ccache) /usr/local/bin/clang
ln -s $(which ccache) /usr/local/bin/clang++
ccache --set-config=base_dir=$PWD
ccache --set-config=inode_cache=true
ccache --set-config=compiler_check=content
ccache --set-config=depend_mode=true
ccache --set-config=file_clone=true
ccache --set-config=sloppiness=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
ccache -p
- name: Cache gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- name: Patch CPP Projects to use CCache
run: |
sed -i -e 's/arguments/arguments "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",/g' apps/mobile/node_modules/react-native-mmkv-storage/android/build.gradle
sed -i -e 's/arguments/arguments "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",/g' apps/mobile/node_modules/react-native-reanimated/android/build.gradle
sed -i -e 's/defaultConfig {/ndkVersion safeExtGet('ndkVersion', "25.2.9519653")\n defaultConfig {/g' apps/mobile/node_modules/react-native-reanimated//android/build.gradle
sed -i -e 's/defaultConfig {/ndkVersion safeExtGet('ndkVersion', "25.2.9519653")\n defaultConfig {/g' apps/mobile/node_modules/react-native-mmkv-storage/android/build.gradle
- name: CCache Stats Before Build
run: ccache -sv
- name: Build unsigned app bundle
run: yarn release:android:bundle
- name: CCache Stats after build
run: ccache -sv
- name: Sign app bundle for Playstore release
id: sign_app
uses: r0adkll/sign-android-release@v1
uses: r0adkll/sign-android-release@master
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 }}
env:
BUILD_TOOLS_VERSION: "33.0.0"
- name: Build apks for Github release
run: yarn release:android
- name: Sign apk files
id: sign_apk
uses: r0adkll/sign-android-release@master
with:
releaseDirectory: apps/mobile/native/android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.PUBLIC_SIGNING_KEY }}
alias: ${{ secrets.PUBLIC_ALIAS }}
keyStorePassword: ${{ secrets.PUBLIC_KEY_PASSWORD }}
keyPassword: ${{ secrets.PUBLIC_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "33.0.0"
- name: Rename apk files
run: |
cd apps/mobile/native/android/app/build/outputs/apk/release/
mv app-arm64-v8a-release-unsigned-signed.apk notesnook-arm64-v8a.apk
mv app-armeabi-v7a-release-unsigned-signed.apk notesnook-armeabi-v7a.apk
mv app-x86-release-unsigned-signed.apk notesnook-x86.apk
mv app-x86_64-release-unsigned-signed.apk notesnook-x86_64.apk
- name: Get app version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
with:
path: apps/mobile
- name: Publish to Playstore
id: deploy
uses: r0adkll/upload-google-play@v1
uses: r0adkll/upload-google-play@v1.1.1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.streetwriters.notesnook
releaseFile: ${{steps.sign_app.outputs.signedReleaseFile}}
track: internal
releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}}
track: alpha
status: completed
whatsNewDirectory: apps/mobile/native/android/releasenotes/
- name: Create release draft on Github
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ steps.package-version.outputs.current-version}}-beta-android
name: Notesnook Android v${{ steps.package-version.outputs.current-version}} Beta
repository: streetwriters/notesnook
token: ${{ secrets.GITHUB_TOKEN }}
files: |
apps/mobile/native/android/app/build/outputs/apk/release/notesnook-arm64-v8a.apk
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: Upload sourcemaps
uses: actions/upload-artifact@v4
with:
name: sourcemaps
path: |
apps/mobile/native/android/app/build/**/*.map
packages/editor-mobile/sourcemaps/*.map

View File

@@ -1,4 +1,4 @@
name: Publish @notesnook/mobile
name: Publish @notesnook/android
on: workflow_dispatch
@@ -6,6 +6,11 @@ jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
NDK_CCACHE: ccache
USE_CCACHE: 1
steps:
- name: Checkout
@@ -17,7 +22,7 @@ jobs:
- name: Use specific Java version for the builds
uses: joschi/setup-jdk@v2
with:
java-version: "11"
java-version: "17"
architecture: "x64"
- name: Install node modules
@@ -28,29 +33,65 @@ jobs:
- name: Make Gradlew Executable
run: cd apps/mobile/native/android && chmod +x ./gradlew
- name: Install CCache
uses: hendrikmuhs/ccache-action@v1.2.11
with:
key: ${{ runner.os }}-ccache-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
max-size: 1500M
restore-keys: |
${{ runner.os }}-ccache-
- name: Setup CCache
run: |
ln -s $(which ccache) /usr/local/bin/gcc
ln -s $(which ccache) /usr/local/bin/g++
ln -s $(which ccache) /usr/local/bin/cc
ln -s $(which ccache) /usr/local/bin/c++
ln -s $(which ccache) /usr/local/bin/clang
ln -s $(which ccache) /usr/local/bin/clang++
ccache --set-config=base_dir=$PWD
ccache --set-config=inode_cache=true
ccache --set-config=compiler_check=content
ccache --set-config=depend_mode=true
ccache --set-config=file_clone=true
ccache --set-config=sloppiness=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
ccache -p
- name: Cache gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- name: Patch CPP Projects to use CCache
run: |
sed -i -e 's/arguments/arguments "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",/g' apps/mobile/node_modules/react-native-mmkv-storage/android/build.gradle
sed -i -e 's/arguments/arguments "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",/g' apps/mobile/node_modules/react-native-reanimated/android/build.gradle
sed -i -e 's/defaultConfig {/ndkVersion safeExtGet('ndkVersion', "25.2.9519653")\n defaultConfig {/g' apps/mobile/node_modules/react-native-reanimated//android/build.gradle
sed -i -e 's/defaultConfig {/ndkVersion safeExtGet('ndkVersion', "25.2.9519653")\n defaultConfig {/g' apps/mobile/node_modules/react-native-mmkv-storage/android/build.gradle
- name: CCache Stats Before Build
run: ccache -sv
- name: Build unsigned app bundle
run: yarn release:android:bundle
- name: CCache Stats after build
run: ccache -sv
- name: Sign app bundle for Playstore release
id: sign_app
uses: r0adkll/sign-android-release@v1
uses: r0adkll/sign-android-release@master
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.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/
env:
BUILD_TOOLS_VERSION: "33.0.0"
- name: Build apks for Github release
run: yarn release:android
@@ -64,6 +105,8 @@ jobs:
alias: ${{ secrets.PUBLIC_ALIAS }}
keyStorePassword: ${{ secrets.PUBLIC_KEY_PASSWORD }}
keyPassword: ${{ secrets.PUBLIC_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "33.0.0"
- name: Rename apk files
run: |
@@ -79,6 +122,17 @@ jobs:
with:
path: apps/mobile
- 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: Create release draft on Github
uses: softprops/action-gh-release@v1
with:
@@ -92,3 +146,11 @@ 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: Upload sourcemaps
uses: actions/upload-artifact@v4
with:
name: sourcemaps
path: |
apps/mobile/native/android/app/build/**/*.map
packages/editor-mobile/sourcemaps/*.map

View File

@@ -18,6 +18,21 @@ on:
required: true
default: true
description: "Publish on GitHub releases?"
build-windows:
type: boolean
required: true
default: true
description: "Build for Windows?"
build-linux:
type: boolean
required: true
default: true
description: "Build for Linux?"
build-mac:
type: boolean
required: true
default: true
description: "Build for macOS?"
jobs:
build:
@@ -43,7 +58,7 @@ jobs:
run: npx nx build:desktop @notesnook/web
- name: Archive build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: apps/web/build/**/*
@@ -67,11 +82,13 @@ jobs:
name: Notesnook Desktop v${{ steps.app_metadata.outputs.app_version }}
tag_name: v${{ steps.app_metadata.outputs.app_version }}
files: ./notesnook_build_v${{ steps.app_metadata.outputs.app_version }}.zip
prerelease: ${{ endsWith(steps.app_metadata.outputs.app_version, '-beta') }}
build-macos:
name: Build for macOS
needs: build
runs-on: macos-12
if: inputs.build-mac
runs-on: macos-14
steps:
- name: Check out Git repository
@@ -80,6 +97,9 @@ jobs:
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Install setuptools
run: brew install python-setuptools
- name: Setup notarization
run: |
mkdir -p ~/private_keys/
@@ -106,7 +126,7 @@ jobs:
platform: "MAC_OS"
- name: Download build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build
path: ./apps/web/build
@@ -127,7 +147,7 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
run: |
npx nx run release --project @notesnook/desktop -- --variant=mas
npx electron-builder --mac mas --universal -p never
yarn electron-builder --mac mas --universal -p never
working-directory: ./apps/desktop
- name: Build zip and dmg
@@ -137,13 +157,13 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
APPLE_API_KEY: ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
APPLE_API_KEY_ID: ${{ secrets.api_key_id }}
APPLE_API_KEY_ISSUER: ${{ secrets.api_key_issuer_id }}
APPLE_API_ISSUER: ${{ secrets.api_key_issuer_id }}
run: |
npx nx run release --project @notesnook/desktop
if [ ${{ inputs.publish-github }} == true ]; then
npx electron-builder --mac zip dmg --arm64 --x64 -p always
yarn electron-builder --mac zip dmg --arm64 --x64 -p always
else
npx electron-builder --mac zip dmg --arm64 --x64 -p never
yarn electron-builder --mac zip dmg --arm64 --x64 -p never
fi
working-directory: ./apps/desktop
@@ -163,6 +183,7 @@ jobs:
build-linux:
name: Build for Linux
needs: build
if: inputs.build-linux
runs-on: ubuntu-22.04
steps:
@@ -181,7 +202,7 @@ jobs:
if: inputs.publish-snap
- name: Download build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build
path: ./apps/web/build
@@ -198,7 +219,7 @@ jobs:
- name: Build snap
if: inputs.publish-snap
run: |
npx electron-builder --linux snap:x64 -p never
yarn electron-builder --linux snap:x64 -p never
working-directory: ./apps/desktop
- name: Build AppImage
@@ -206,9 +227,9 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ ${{ inputs.publish-github }} == true ]; then
npx electron-builder --linux AppImage:x64 AppImage:arm64 -p always
yarn electron-builder --linux AppImage:x64 AppImage:arm64 -p always
else
npx electron-builder --linux AppImage:x64 AppImage:arm64 -p never
yarn electron-builder --linux AppImage:x64 AppImage:arm64 -p never
fi
working-directory: ./apps/desktop
@@ -221,17 +242,27 @@ jobs:
build-windows:
name: Build for Windows
needs: build
if: inputs.build-windows
runs-on: windows-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Install TrustedSigning
run: Install-Module -Name TrustedSigning -RequiredVersion 0.3.15 -Force -Repository PSGallery
shell: pwsh
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Download build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build
path: ./apps/web/build
@@ -247,6 +278,9 @@ jobs:
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
run: |
if ($${{ inputs.publish-github }} -eq $true) {
yarn electron-builder --win --publish always

107
.github/workflows/ios.publish.yml vendored Normal file
View File

@@ -0,0 +1,107 @@
name: Publish @notesnook/ios
on: workflow_dispatch
jobs:
build:
runs-on: macos-13
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Install node modules
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=mobile
- name: Build packages
run: npx nx run @notesnook/mobile:build
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.11
with:
key: ${{ runner.os }}-ccache-${{ hashFiles(format('apps/mobile/native/ios/Podfile.lock')) }}
max-size: 1500M
restore-keys: |
${{ runner.os }}-ccache-
- name: Setup ccache
run: |
ccache --set-config=base_dir=$PWD
ccache --set-config=inode_cache=true
ccache --set-config=compiler_check=content
ccache --set-config=depend_mode=true
ccache --set-config=file_clone=true
ccache --set-config=sloppiness=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
ln -s $(which ccache) /usr/local/bin/gcc
ln -s $(which ccache) /usr/local/bin/g++
ln -s $(which ccache) /usr/local/bin/cc
ln -s $(which ccache) /usr/local/bin/c++
ln -s $(which ccache) /usr/local/bin/clang
ln -s $(which ccache) /usr/local/bin/clang++
ccache -p
- name: Cache Pods
uses: actions/cache@v2
id: pods-cache
with:
path: apps/mobile/native/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('apps/mobile/native/ios/Podfile.lock') }}
- name: Install Pods
run: npm run prepare:ios
- name: CCache Stats Before Build
run: ccache -sv
- name: Build iOS App
uses: ammarahm-ed/ios-build-action@master
with:
bundle-identifier: org.streetwriters.notesnook
scheme: Notesnook
configuration: "Release"
export-options: apps/mobile/native/ios/ExportOptions.plist
project-path: apps/mobile/native/ios/Notesnook.xcodeproj
workspace-path: apps/mobile/native/ios/Notesnook.xcworkspace
update-targets: |
Notesnook
Make Note
NotesWidgetExtension
disable-targets: Notesnook-tvOS,Notesnook-tvOSTests,NotesnookTests
code-signing-identity: Apple Distribution
team-id: ${{ secrets.APPLE_TEAM_ID }}
p12-base64: ${{ secrets.APPLE_CERTIFICATE_P12 }}
certificate-password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}
app-store-connect-api-key-issuer-id: ${{ secrets.API_KEY_ISSUER_ID }}
app-store-connect-api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
app-store-connect-api-key-base64: ${{ secrets.APPSTORE_CONNECT_API_KEY_BASE64 }}
output-path: Notesnook.ipa
mobileprovision-base64: |
${{ secrets.APPLE_MOBILE_PROVISION_APP }}
${{ secrets.APPLE_MOBILE_PROVISION_SHARE }}
${{ secrets.APPLE_MOBILE_PROVISION_WIDGET }}
- name: CCache Stats After Build
run: ccache -sv
- name: "Upload app to TestFlight"
uses: apple-actions/upload-testflight-build@v1
with:
app-path: Notesnook.ipa
issuer-id: ${{ secrets.API_KEY_ISSUER_ID }}
api-key-id: ${{ secrets.API_KEY_ID }}
api-private-key: ${{ secrets.API_KEY }}
- name: Upload Notesnook.ipa to Github
uses: actions/upload-artifact@v4
with:
name: Notesnook.zip
path: |
Notesnook.ipa
apps/mobile/native/ios/**/*.map
packages/editor-mobile/sourcemaps/*.map

83
.github/workflows/monograph.publish.yml vendored Normal file
View File

@@ -0,0 +1,83 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Publish @notesnook/monograph
on: workflow_dispatch
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- 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=monograph
- name: Generate build
run: npx nx build @notesnook/monograph
# Setup Buildx
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
ecr: auto
logout: true
# Pull previous image from docker hub to use it as cache to improve the image build time.
- name: docker pull cache image
continue-on-error: true
run: docker pull streetwriters/monograph:latest
# Setup QEMU
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: streetwriters/monograph
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: apps/monograph
file: apps/monograph/Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8
tags: streetwriters/monograph:latest
cache-from: streetwriters/monograph:latest
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: index.docker.io/streetwriters/monograph
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

View File

@@ -1,67 +0,0 @@
name: Publish @notesnook/web Beta
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- "apps/mobile/**"
- "packages/editor-mobile/**"
- "apps/desktop/**"
- "apps/vericrypt/**"
- "servers/**"
- "packages/clipper/**"
- "extensions/web-clipper/**"
pull_request:
types:
- closed
- ready_for_review
- reopened
- opened
- synchronize
branches:
- master
paths-ignore:
- "apps/mobile/**"
- "packages/editor-mobile/**"
- "apps/desktop/**"
- "apps/vericrypt/**"
- "servers/**"
- "packages/clipper/**"
- "extensions/web-clipper/**"
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=web
- name: Setup environment
run: |
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
- name: Generate beta build
run: npm run build:beta:web
- name: Publish to Cloudflare Pages
uses: unlike-ltd/github-actions-cloudflare-pages@v0.1.1
id: pages
with:
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
cloudflare-project-name: notesnook-beta-app
directory: ./apps/web/build
github-token: ${{ secrets.GITHUB_TOKEN }}
github-environment: ${{ (github.ref == 'refs/heads/master' && 'beta') || 'preview' }}

View File

@@ -40,7 +40,7 @@ jobs:
run: npm run build:test:web
- name: Archive build artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: build
path: apps/web/build/**/*
@@ -56,7 +56,7 @@ jobs:
uses: actions/checkout@v3
- name: Download build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build
path: ./apps/web/build
@@ -67,7 +67,7 @@ jobs:
- name: Install packages
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm install -D @playwright/test otplib
npm install -D @playwright/test otplib dayjs @zip.js/zip.js
- name: Validate build extraction
run: ls -ld ./apps/web/build/index.html
@@ -88,7 +88,7 @@ jobs:
working-directory: apps/web
- name: Upload test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results-${{ matrix.shard }}

3
.gitignore vendored
View File

@@ -9,4 +9,5 @@ nx-cloud.env
.env.local
.nyc_output
site
node_modules.backup
node_modules.backup
.nx

View File

@@ -11,4 +11,5 @@ apps/mobile/native/
apps/web/public/an.js
# editor
packages/editor/styles/
packages/editor/styles/
/.nx/cache

View File

@@ -1,4 +1,5 @@
node_modules
build
output
dist
dist
_catalog

View File

@@ -40,12 +40,35 @@ Once you are inside the `./notesnook` directory, run the preparation step:
npm install
```
Now you can finally start the desktop app:
Now you can finally start the desktop app for development:
```bash
npm run start:desktop
```
To run the app in release mode:
```bash
npm run staging -- --rebuild
```
This will compile and run the app in production mode but it won't generate any packages. To create the final packages, you'll have to run the following commands:
```bash
npm run release -- --rebuild
# For macOS
npx electron-builder --mac dmg --arm64 --x64 -publish never
# For Linux (AppImage)
npx electron-builder --linux AppImage:x64 AppImage:arm64 -publish never
# For Windows
npx electron-builder --win --publish never
```
Feel free to play around with the `electron-builder` command to get the packages you need. `npx electron-builder --help` is a great resource to learn different commands & platforms supported by `electron-builder`.
## Developer guide
### The tech stack

View File

@@ -1,3 +1,4 @@
owner: streetwriters
repo: notesnook
provider: github
updaterCacheDirName: Notesnook

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 B

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 KiB

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "@notesnook/desktop",
"productName": "Notesnook",
"description": "Your private note taking space",
"version": "2.6.7",
"version": "3.0.18",
"appAppleId": "1544027013",
"private": true,
"main": "./dist/index.js",
@@ -11,26 +11,31 @@
"repository": "https://github.com/streetwriters/notesnook",
"license": "GPL-3.0-or-later",
"dependencies": {
"@notesnook/crypto": "file:../../packages/crypto",
"@trpc/client": "10.38.3",
"@trpc/server": "10.38.3",
"electron-trpc": "0.5.2",
"electron-updater": "6.1.4",
"icojs": "^0.17.1",
"@lingui/core": "4.11.4",
"@notesnook/intl": "file:../../packages/intl",
"@trpc/client": "10.45.2",
"@trpc/server": "10.45.2",
"better-sqlite3-multiple-ciphers": "11.2.1",
"electron-trpc": "0.6.1",
"electron-updater": "^6.3.4",
"icojs": "^0.19.4",
"typed-emitter": "^2.1.0",
"yargs": "^17.6.2",
"zod": "^3.21.4"
"yargs": "^17.7.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/node": "18.16.1",
"@types/yargs": "^17.0.24",
"chokidar": "^3.5.3",
"electron": "25.8.1",
"electron-builder": "^24.6.4",
"electron-builder-notarize": "^1.5.1",
"esbuild": "^0.17.19",
"@streetwriters/kysely": "^0.27.4",
"@types/node": "22.7.0",
"@types/yargs": "^17.0.33",
"chokidar": "^4.0.1",
"electron": "^30.5.1",
"electron-builder": "^25.1.7",
"esbuild": "^0.24.0",
"node-abi": "^3.68.0",
"node-gyp-build": "^4.8.2",
"prebuildify": "^6.0.1",
"tree-kill": "^1.2.2",
"undici": "^5.23.0"
"undici": "^6.19.8"
},
"optionalDependencies": {
"dmg-license": "^1.0.11"
@@ -40,7 +45,7 @@
"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": "esbuild electron=./src/main.ts ./src/preload.ts --external:electron --external:fsevents --external:better-sqlite3-multiple-ciphers --external:sodium-native --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"
},
@@ -54,7 +59,7 @@
"productName": "Notesnook",
"copyright": "Copyright © 2023 Streetwriters (Private) Limited",
"artifactName": "notesnook_${os}_${arch}.${ext}",
"npmRebuild": false,
"generateUpdatesFilesForAllChannels": true,
"asar": false,
"files": [
"!*.chunk.js.map",
@@ -64,9 +69,17 @@
"!build/banner.jpg",
"!build/*.ico",
"!build/*.png",
"!node_modules${/*}"
"!node_modules${/*}",
"node_modules/better-sqlite3-multiple-ciphers/build/Release/better_sqlite3.node",
"node_modules/better-sqlite3-multiple-ciphers/lib",
"node_modules/better-sqlite3-multiple-ciphers/package.json",
"node_modules/file-uri-to-path",
"node_modules/bindings",
"node_modules/node-gyp-build",
"node_modules/sodium-native/prebuilds/${platform}-${arch}",
"node_modules/sodium-native/index.js",
"node_modules/sodium-native/package.json"
],
"afterSign": "electron-builder-notarize",
"afterPack": "./scripts/removeLocales.js",
"mac": {
"bundleVersion": "240",
@@ -94,7 +107,8 @@
"entitlements": "assets/entitlements.mac.plist",
"entitlementsInherit": "assets/entitlements.mac.plist",
"gatekeeperAssess": false,
"icon": "assets/icons/app.icns"
"icon": "assets/icons/app.icns",
"notarize": true
},
"dmg": {
"contents": [
@@ -135,6 +149,10 @@
]
}
],
"signingHashAlgorithms": [
"sha256"
],
"sign": "./scripts/sign.js",
"icon": "assets/icons/app.ico"
},
"portable": {
@@ -142,7 +160,8 @@
},
"nsis": {
"oneClick": true,
"createDesktopShortcut": "always"
"createDesktopShortcut": "always",
"deleteAppDataOnUninstall": true
},
"linux": {
"target": [

View File

@@ -1,8 +1,8 @@
diff --git a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
index fcb7f54..cb1c7f7 100644
index 739a48c..7a7b4af 100644
--- a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
+++ b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
@@ -116,6 +116,7 @@ class LinuxTargetHelper {
@@ -117,6 +117,7 @@ class LinuxTargetHelper {
StartupWMClass: appInfo.productName,
...extra,
...targetSpecificOptions.desktop,
@@ -10,7 +10,7 @@ index fcb7f54..cb1c7f7 100644
};
const description = this.getDescription(targetSpecificOptions);
if (!(0, builder_util_1.isEmptyOrSpaces)(description)) {
@@ -159,6 +160,23 @@ class LinuxTargetHelper {
@@ -160,6 +161,23 @@ class LinuxTargetHelper {
data += `\n${name}=${desktopMeta[name]}`;
}
data += "\n";

View File

@@ -1,23 +0,0 @@
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,39 @@
diff --git a/node_modules/electron-trpc/dist/main.mjs b/node_modules/electron-trpc/dist/main.mjs
index 07971db..b67a3cf 100644
--- a/node_modules/electron-trpc/dist/main.mjs
+++ b/node_modules/electron-trpc/dist/main.mjs
@@ -537,8 +537,15 @@ class be {
attachWindow(r) {
F(this, w).includes(r) || (y("Attaching window", r.id), F(this, w).push(r), v(this, N, Z).call(this, r));
}
- detachWindow(r) {
- y("Detaching window", r.id), L(this, w, F(this, w).filter((e) => e !== r)), v(this, R, M).call(this, { webContentsId: r.webContents.id });
+ detachWindow(r, webContentsId) {
+ y("Detaching window", r.id);
+
+ if (r.isDestroyed() && webContentsId === undefined) {
+ throw new Error('webContentsId is required when calling detachWindow on a destroyed window');
+ }
+
+ L(this, w, F(this, w).filter((e) => e !== r));
+ v(this, R, M).call(this, { webContentsId: webContentsId ?? r.webContents.id });
}
}
w = new WeakMap(), E = new WeakMap(), R = new WeakSet(), M = function({
@@ -548,6 +555,7 @@ w = new WeakMap(), E = new WeakMap(), R = new WeakSet(), M = function({
for (const [i, a] of F(this, E).entries())
i.startsWith(`${r}-${e ?? ""}`) && (y("Closing subscription", i), a.unsubscribe(), F(this, E).delete(i));
}, N = new WeakSet(), Z = function(r) {
+ const webContentsId = r.webContents.id;
r.webContents.on("did-start-navigation", ({ frame: e }) => {
y(
"Handling webContents `did-start-navigation` event",
@@ -558,7 +566,7 @@ w = new WeakMap(), E = new WeakMap(), R = new WeakSet(), M = function({
frameRoutingId: e.routingId
});
}), r.webContents.on("destroyed", () => {
- y("Handling webContents `destroyed` event"), this.detachWindow(r);
+ y("Handling webContents `destroyed` event"), this.detachWindow(r, webContentsId);
});
};
const me = ({

View File

@@ -18,8 +18,8 @@ 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 fs, { readFile, writeFile } from "fs/promises";
import { existsSync, readFileSync } from "fs";
import yargs from "yargs-parser";
import os from "os";
import * as childProcess from "child_process";
@@ -28,90 +28,76 @@ 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 packageJson = JSON.parse(
readFileSync(path.join(__dirname, "..", "package.json"), "utf-8")
);
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 exec(
"yarn nx build:desktop @notesnook/web",
path.join(__dirname, "..", "..", "..")
);
}
// temporary until there's support for prebuilt binaries for linux ARM
if (os.platform() === "linux") await patchBetterSQLite3();
// if (os.platform() === "win32")
// await exec(
// `npx prebuildify --arch=arm64 --strip -t electron@${packageJson.devDependencies.electron}`,
// path.join(__dirname, "..", "node_modules", "sodium-native")
// );
await fs.cp(path.join(webAppPath, "build"), "build", {
recursive: true,
force: true
});
if (args.variant === "mas") {
await exec(`npm run bundle:mas`);
await exec(`yarn run bundle:mas`);
} else {
await exec(`npm run bundle`);
await exec(`yarn 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
}
);
}
await exec(`yarn tsc`);
if (args.run) {
await exec(`npx electron-builder --dir --x64`);
await exec(`yarn 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`);
await exec(`./output/mac/Notesnook.app/Contents/MacOS/Notesnook`);
} else {
await exec(`./output/linux-unpacked/Notesnook`);
}
}
async function exec(cmd) {
async function exec(cmd, cwd) {
return childProcess.execSync(cmd, {
env: process.env,
stdio: "inherit"
env: { ...process.env, NOTESNOOK_STAGING: true },
stdio: "inherit",
cwd: cwd || process.cwd()
});
}
async function patchBetterSQLite3() {
const jsonPath = path.join(
__dirname,
"..",
"node_modules",
"better-sqlite3-multiple-ciphers",
"package.json"
);
const json = JSON.parse(await readFile(jsonPath, "utf-8"));
json.version = "11.2.2";
json.homepage = "https://github.com/thecodrr/better-sqlite3-multiple-ciphers";
json.repository.url =
"git://github.com/thecodrr/better-sqlite3-multiple-ciphers.git";
await writeFile(jsonPath, JSON.stringify(json));
}

View File

@@ -27,21 +27,15 @@ 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;
const ENV = {
...process.env,
NO_COLOR: "true",
FORCE_COLOR: "false",
COLOR: "0"
};
await onChange(true);
console.log("Watching...");
@@ -58,26 +52,21 @@ process.on("SIGINT", async (s) => {
async function onChange(first) {
if (first) {
await fs.rm("./build/", { force: true, recursive: true });
await exec("yarn electron-builder install-app-deps");
}
await exec(`npm run bundle`);
execAsync(`npx`, [`tsc`]);
await exec(`yarn run bundle`);
execAsync(`yarn`, [`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"],
["yarn", "nx", "start:desktop", "@notesnook/web"],
path.join(__dirname, "..", "..", ".."),
(data) => data.includes("Network: use --host to expose")
);
@@ -89,7 +78,7 @@ async function onChange(first) {
}
execAsync(
"npx",
"yarn",
["electron", path.join("build", "electron.js")],
true,
cleanup
@@ -102,7 +91,7 @@ function spawnAndWaitUntil(cmd, cwd, predicate) {
const s = spawn(cmd[0], cmd.slice(1), {
cwd,
env: { ...process.env, NO_COLOR: "true" },
env: ENV,
shell: false
});
@@ -116,14 +105,15 @@ function spawnAndWaitUntil(cmd, cwd, predicate) {
});
}
async function exec(cmd) {
async function exec(cmd, cwd) {
try {
console.log(">", cmd);
return execSync(cmd, {
env: process.env,
env: ENV,
stdio: "inherit",
shell: false
shell: false,
cwd: cwd || process.cwd()
});
} catch {
//ignore
@@ -136,7 +126,7 @@ function execAsync(cmd, args, restartable, onExit) {
const proc = spawn(cmd, args, {
stdio: "inherit",
env: process.env,
env: ENV,
shell: false
});
@@ -179,9 +169,10 @@ async function cleanup() {
}
async function isBundleSame() {
const bundle = await fs.readFile(
path.join(__dirname, "..", "build", "electron.js")
);
const bundle = Buffer.concat([
await fs.readFile(path.join(__dirname, "..", "build", "electron.js")),
await fs.readFile(path.join(__dirname, "..", "build", "preload.js"))
]);
const hashSum = crypto.createHash("sha256");
hashSum.update(bundle);

View File

@@ -0,0 +1,59 @@
/*
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/>.
*/
const { writeFileSync, rmSync } = require("fs");
const { execSync } = require("child_process");
const { relative, join } = require("path");
module.exports = async function (configuration) {
if (process.env.NOTESNOOK_STAGING) return;
const Endpoint = "https://weu.codesigning.azure.net";
const CodeSigningAccountName = "Notesnook";
const CertificateProfileName = "Notesnook";
const FileDigest = configuration.hash.toUpperCase();
const TimestampRfc3161 = "http://timestamp.acs.microsoft.com";
const TimestampDigest = configuration.hash.toUpperCase();
const Description = "The Notesnook app";
const DescriptionUrl = "https://notesnook.com/";
const FilesCatalog = createCatalog(configuration.path);
const command = `Invoke-TrustedSigning -Endpoint "${Endpoint}" -CodeSigningAccountName "${CodeSigningAccountName}" -CertificateProfileName "${CertificateProfileName}" -FileDigest "${FileDigest}" -TimestampRfc3161 "${TimestampRfc3161}" -TimestampDigest "${TimestampDigest}" -Description "${Description}" -DescriptionUrl "${DescriptionUrl}" -FilesCatalog "${FilesCatalog}"`;
console.debug("Signing", configuration.path, "using command", command);
psexec(command);
console.debug("Signed", configuration.path);
rmSync(FilesCatalog);
};
function createCatalog(path) {
const catalogPath = join(__dirname, "_catalog");
writeFileSync(catalogPath, relative(__dirname, path));
return catalogPath;
}
function psexec(cmd) {
return execSync(cmd, {
env: process.env,
stdio: "inherit",
shell: "pwsh"
});
}

View File

@@ -23,6 +23,8 @@ import { osIntegrationRouter } from "./os-integration";
import { spellCheckerRouter } from "./spell-checker";
import { updaterRouter } from "./updater";
import { bridgeRouter } from "./bridge";
import { safeStorageRouter } from "./safe-storage";
import { windowRouter } from "./window";
const t = initTRPC.create();
@@ -31,7 +33,9 @@ export const router = t.router({
integration: osIntegrationRouter,
spellChecker: spellCheckerRouter,
updater: updaterRouter,
bridge: bridgeRouter
bridge: bridgeRouter,
safeStorage: safeStorageRouter,
window: windowRouter
});
export const api = router.createCaller({});

View File

@@ -19,7 +19,7 @@ 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 { app, dialog, nativeTheme, Notification, shell } from "electron";
import { AutoLaunch } from "../utils/autolaunch";
import { config, DesktopIntegration } from "../utils/config";
import { bringToFront } from "../utils/bring-to-front";
@@ -29,6 +29,10 @@ import { dirname } from "path";
import { resolvePath } from "../utils/resolve-path";
import { observable } from "@trpc/server/observable";
import { AssetManager } from "../utils/asset-manager";
import { isFlatpak } from "../utils";
import { setupDesktopIntegration } from "../utils/desktop-integration";
import { rm } from "fs/promises";
import { disableCustomDns, enableCustomDns } from "../utils/custom-dns";
const t = initTRPC.create();
@@ -44,12 +48,31 @@ const NotificationOptions = z.object({
});
export const osIntegrationRouter = t.router({
isFlatpak: t.procedure.query(() => isFlatpak()),
zoomFactor: t.procedure.query(() => config.zoomFactor),
setZoomFactor: t.procedure.input(z.number()).mutation(({ input: factor }) => {
globalThis.window?.webContents.setZoomFactor(factor);
config.zoomFactor = factor;
}),
customDns: t.procedure.query(() => config.customDns),
setCustomDns: t.procedure
.input(z.boolean().optional())
.mutation(({ input: customDns }) => {
if (customDns) enableCustomDns();
else disableCustomDns();
config.customDns = !!customDns;
}),
proxyRules: t.procedure.query(() => config.proxyRules),
setProxyRules: t.procedure
.input(z.string().optional())
.mutation(({ input: proxyRules }) => {
globalThis.window?.webContents.session.setProxy({ proxyRules });
config.proxyRules = proxyRules || "";
}),
privacyMode: t.procedure.query(() => config.privacyMode),
setPrivacyMode: t.procedure
.input(z.object({ enabled: z.boolean() }))
@@ -79,6 +102,7 @@ export const osIntegrationRouter = t.router({
AutoLaunch.disable();
}
config.desktopSettings = settings;
setupDesktopIntegration(settings);
}),
selectDirectory: t.procedure
@@ -121,10 +145,17 @@ export const osIntegrationRouter = t.router({
.input(z.object({ filePath: z.string() }))
.query(({ input }) => {
const { filePath } = input;
if (!filePath) return;
return resolvePath(filePath);
}),
deleteFile: t.procedure.input(z.string()).query(async ({ input }) => {
await rm(input);
}),
restart: t.procedure.query(() => {
app.relaunch();
app.exit();
}),
showNotification: t.procedure
.input(NotificationOptions)
.query(({ input }) => {
@@ -153,16 +184,45 @@ export const osIntegrationRouter = t.router({
}),
bringToFront: t.procedure.query(() => bringToFront()),
changeTheme: t.procedure
.input(Theme)
.mutation(({ input }) => setTheme(input)),
.input(
z.object({
theme: Theme,
windowControlsIconColor: z.string().optional(),
backgroundColor: z.string().optional()
})
)
.mutation(
({ input: { theme, windowControlsIconColor, backgroundColor } }) => {
if (windowControlsIconColor) {
config.windowControlsIconColor = windowControlsIconColor;
if (
process.platform === "win32" &&
!config.desktopSettings.nativeTitlebar
)
globalThis.window?.setTitleBarOverlay({
symbolColor: windowControlsIconColor
});
}
if (backgroundColor) {
config.backgroundColor = backgroundColor;
}
setTheme(theme);
}
),
onThemeChanged: t.procedure.subscription(() =>
observable<"dark" | "light">((emit) => {
nativeTheme.on("updated", () => {
const updated = () => {
if (getTheme() === "system") {
emit.next(nativeTheme.shouldUseDarkColors ? "dark" : "light");
}
});
};
nativeTheme.on("updated", updated);
return () => {
nativeTheme.off("updated", updated);
};
})
)
});

View File

@@ -0,0 +1,44 @@
/*
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 { safeStorage } from "electron";
import { initTRPC } from "@trpc/server";
import { z } from "zod";
const t = initTRPC.create();
export const safeStorageRouter = t.router({
isEncryptionAvailable: t.procedure.query(() => {
return (
!process.env.PORTABLE_EXECUTABLE_DIR &&
safeStorage.isEncryptionAvailable()
);
}),
/**
* Takes a string and returns an encrypted base64 string
*/
encryptString: t.procedure.input(z.string()).query(({ input }) => {
return safeStorage.encryptString(input).toString("base64");
}),
/**
* Takes an encrypted base64 string and returns a string
*/
decryptString: t.procedure.input(z.string()).query(({ input }) => {
return safeStorage.decryptString(Buffer.from(input, "base64"));
})
});

View File

@@ -118,5 +118,13 @@ export const spellCheckerRouter = t.router({
.mutation(({ input: { enabled } }) => {
globalThis.window?.webContents.session.setSpellCheckerEnabled(enabled);
config.isSpellCheckerEnabled = enabled;
})
}),
words: t.procedure.query(() =>
globalThis.window?.webContents.session.listWordsInSpellCheckerDictionary()
),
deleteWord: t.procedure.input(z.string()).mutation(({ input: word }) => {
globalThis.window?.webContents.session.removeWordFromSpellCheckerDictionary(
word
);
})
});

View File

@@ -0,0 +1,143 @@
/*
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 type { Database, Statement } from "better-sqlite3-multiple-ciphers";
import type { QueryResult } from "@streetwriters/kysely";
type SQLiteCompatibleType =
| number
| string
| Uint8Array
| Array<number>
| bigint
| null;
export class SQLite {
sqlite?: Database;
initialized = false;
preparedStatements: Map<string, Statement<unknown[]>> = new Map();
retryCounter: Record<string, number> = {};
constructor() {
console.log("new sqlite worker");
}
async open(filePath: string) {
if (this.sqlite) {
console.error("Database is already initialized");
return;
}
this.sqlite = require("better-sqlite3-multiple-ciphers")(
filePath
).unsafeMode(true);
}
/**
* Wrapper function for preparing SQL statements with caching
* to avoid unnecessary computations.
*/
async prepare(sql: string): Promise<Statement | undefined> {
if (!this.sqlite) throw new Error("Database is not initialized.");
try {
const cached = this.preparedStatements.get(sql);
if (cached !== undefined) return cached;
const prepared = this.sqlite.prepare(sql);
if (!prepared) return;
this.preparedStatements.set(sql, prepared);
// reset retry count on success
this.retryCounter[sql] = 0;
return prepared;
} catch (ex) {
console.error(ex);
// statement prepare process can be flaky so retry at least 5 times
// before giving up.
if (this.retryCounter[sql] < 5) {
this.retryCounter[sql] = (this.retryCounter[sql] || 0) + 1;
console.warn("Failed to prepare statement. Retrying:", sql);
return this.prepare(sql);
} else this.retryCounter[sql] = 0;
if (ex instanceof Error) ex.message += ` (query: ${sql})`;
throw ex;
}
}
async exec<R>(
sql: string,
parameters: SQLiteCompatibleType[] = []
): Promise<QueryResult<R>> {
const prepared = await this.prepare(sql);
if (!prepared) return { rows: [] };
try {
if (prepared.reader) {
return {
rows: prepared.all(parameters) as R[]
};
} else {
const { changes, lastInsertRowid } = prepared.run(parameters);
const numAffectedRows =
changes !== undefined && changes !== null && !isNaN(changes)
? BigInt(changes)
: undefined;
return {
numAffectedRows,
insertId:
lastInsertRowid !== undefined && lastInsertRowid !== null
? typeof lastInsertRowid === "bigint"
? lastInsertRowid
: BigInt(lastInsertRowid)
: undefined,
rows: [] as R[]
};
}
} catch (e) {
if (e instanceof Error) e.message += ` (query: ${sql})`;
throw e;
}
}
async run<R>(
sql: string,
parameters?: SQLiteCompatibleType[]
): Promise<QueryResult<R>> {
if (!this.sqlite) throw new Error("No database is not opened.");
return await this.exec(sql, parameters);
}
async close() {
if (!this.sqlite) return;
this.preparedStatements.clear();
this.sqlite.close();
this.sqlite = undefined;
}
async delete(filePath: string) {
await this.close();
await require("fs/promises").rm(filePath, {
force: true,
maxRetries: 5,
retryDelay: 500
});
}
}

View File

@@ -28,16 +28,38 @@ type UpdateInfo = { version: string };
type Progress = { percent: number };
const t = initTRPC.create();
let cancellationToken: CancellationToken | undefined = undefined;
let downloadTimeout: NodeJS.Timeout | undefined = undefined;
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);
if (cancellationToken) return;
clearTimeout(downloadTimeout);
await new Promise<string[]>((resolve, reject) => {
downloadTimeout = setTimeout(async () => {
cancellationToken = new CancellationToken();
autoUpdater.isUpdaterActive();
await autoUpdater
.downloadUpdate(cancellationToken)
.then(resolve)
.catch(reject)
.finally(() => (cancellationToken = undefined));
}, 1000);
});
}),
check: t.procedure.query(async () => {
await autoUpdater.checkForUpdates();
if (cancellationToken) return;
clearTimeout(downloadTimeout);
await new Promise<void>((resolve) => {
downloadTimeout = setTimeout(async () => {
await autoUpdater
.checkForUpdates()
.catch(console.error)
.finally(resolve);
}, 1000);
});
}),
toggleAutoUpdates: t.procedure
@@ -57,7 +79,18 @@ export const updaterRouter = t.router({
"update-not-available"
),
onAvailable: createSubscription<"update-available", UpdateInfo>(
"update-available"
"update-available",
() => {
if (!config.automaticUpdates) return false;
autoUpdater.emit("download-progress", {
bytesPerSecond: 0,
delta: 0,
percent: 0,
total: 100,
transferred: 0
});
return true;
}
),
onError: createSubscription("error")
});
@@ -65,12 +98,14 @@ export const updaterRouter = t.router({
function createSubscription<
TName extends keyof AppUpdaterEvents,
TReturnType = Parameters<AppUpdaterEvents[TName]>[0]
>(eventName: TName) {
>(eventName: TName, handler?: (args: TReturnType) => boolean) {
return t.procedure.subscription(() => {
return observable<TReturnType>((emit) => {
const listener: AppUpdaterEvents[TName] = (...args: any[]) => {
if (handler?.(args[0])) return;
emit.next(args[0]);
};
autoUpdater.removeAllListeners(eventName);
autoUpdater.addListener(eventName, listener);
return () => {
autoUpdater.removeListener(eventName, listener);

View File

@@ -0,0 +1,83 @@
/*
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";
const t = initTRPC.create();
export const windowRouter = t.router({
maximize: t.procedure.mutation(() => {
globalThis.window?.maximize();
}),
restore: t.procedure.mutation(() => {
globalThis.window?.restore();
}),
minimze: t.procedure.mutation(() => {
globalThis.window?.minimize();
}),
maximized: t.procedure.query(() => globalThis.window?.isMaximized()),
fullscreen: t.procedure.query(() => globalThis.window?.isFullScreen()),
onWindowStateChanged: t.procedure.subscription(() => {
return observable<{ maximized: boolean; fullscreen: boolean }>((emit) => {
function listener() {
emit.next({
maximized: !!globalThis.window?.isMaximized(),
fullscreen: !!globalThis.window?.isFullScreen()
});
}
function enterFullscreen() {
emit.next({
maximized: !!globalThis.window?.isMaximized(),
fullscreen: true
});
}
function leaveFullscreen() {
emit.next({
maximized: !!globalThis.window?.isMaximized(),
fullscreen: false
});
}
globalThis.window?.addListener("maximize", listener);
globalThis.window?.addListener("minimize", listener);
globalThis.window?.addListener("unmaximize", listener);
globalThis.window?.addListener("restore", listener);
globalThis.window?.addListener("enter-full-screen", enterFullscreen);
globalThis.window?.addListener("leave-full-screen", leaveFullscreen);
globalThis.window?.addListener("leave-html-full-screen", leaveFullscreen);
globalThis.window?.addListener("enter-html-full-screen", enterFullscreen);
return () => {
globalThis.window?.removeListener("maximize", listener);
globalThis.window?.removeListener("minimize", listener);
globalThis.window?.removeListener("unmaximize", listener);
globalThis.window?.removeListener("restore", listener);
globalThis.window?.removeListener("enter-full-screen", enterFullscreen);
globalThis.window?.removeListener("leave-full-screen", leaveFullscreen);
globalThis.window?.removeListener(
"leave-html-full-screen",
leaveFullscreen
);
globalThis.window?.removeListener(
"enter-html-full-screen",
enterFullscreen
);
};
});
})
});

View File

@@ -20,3 +20,5 @@ 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";
export { type DesktopIntegration } from "./utils/config";
export { SQLite } from "./api/sqlite-kysely.js";

View File

@@ -24,7 +24,6 @@ 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";
@@ -35,6 +34,22 @@ import { config } from "./utils/config";
import path from "path";
import { bringToFront } from "./utils/bring-to-front";
import { bridge } from "./api/bridge";
import { setupDesktopIntegration } from "./utils/desktop-integration";
import { disableCustomDns, enableCustomDns } from "./utils/custom-dns";
import { Messages, setI18nGlobal } from "@notesnook/intl";
import { i18n } from "@lingui/core";
const locale =
process.env.NODE_ENV === "development"
? import("@notesnook/intl/dist/locales/$pseudo-LOCALE.json")
: import("@notesnook/intl/dist/locales/$en.json");
locale.then(({ default: locale }) => {
i18n.load({
en: locale.messages as unknown as Messages
});
i18n.activate("en");
});
setI18nGlobal(i18n);
// only run a single instance
if (!MAC_APP_STORE && !app.requestSingleInstanceLock()) {
@@ -77,15 +92,33 @@ async function createWindow() {
darkTheme: getTheme() === "dark",
backgroundColor: getBackgroundColor(),
opacity: 0,
autoHideMenuBar: true,
autoHideMenuBar: false,
icon: AssetManager.appIcon({
size: 512,
format: process.platform === "win32" ? "ico" : "png"
}),
...(config.desktopSettings.nativeTitlebar
? {}
: {
titleBarStyle: "hidden",
frame: process.platform === "win32" || process.platform === "darwin",
titleBarOverlay: {
height: 37,
color: "#00000000",
symbolColor: config.windowControlsIconColor
},
trafficLightPosition: {
x: 16,
y: 12
}
}),
webPreferences: {
zoomFactor: config.zoomFactor,
nodeIntegration: true,
contextIsolation: false,
nodeIntegrationInWorker: true,
spellcheck: config.isSpellCheckerEnabled,
preload: __dirname + "/preload.js"
}
@@ -93,6 +126,7 @@ async function createWindow() {
createIPCHandler({ router, windows: [mainWindow] });
globalThis.window = mainWindow;
mainWindow.setMenuBarVisibility(false);
mainWindowState.manage(mainWindow);
if (cliOptions.hidden && !config.desktopSettings.minimizeToSystemTray)
@@ -106,11 +140,12 @@ async function createWindow() {
}
await AssetManager.loadIcons();
setupDesktopIntegration();
setupDesktopIntegration(config.desktopSettings);
mainWindow.webContents.session.setSpellCheckerDictionaryDownloadURL(
"http://dictionaries.notesnook.com/"
);
mainWindow.webContents.session.setProxy({ proxyRules: config.proxyRules });
mainWindow.once("closed", () => {
globalThis.window = null;
@@ -120,7 +155,7 @@ async function createWindow() {
setupJumplist();
if (isDevelopment())
mainWindow.webContents.openDevTools({ mode: "right", activate: true });
mainWindow.webContents.openDevTools({ mode: "bottom", activate: true });
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url);
@@ -136,6 +171,9 @@ async function createWindow() {
app.once("ready", async () => {
console.info("App ready. Opening window.");
if (config.customDns) enableCustomDns();
else disableCustomDns();
if (!isDevelopment()) registerProtocol();
await createWindow();
configureAutoUpdater();
@@ -176,49 +214,3 @@ function createURL(options: CLIOptions, path = "/") {
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?.on("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

@@ -20,14 +20,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { ELECTRON_TRPC_CHANNEL } from "electron-trpc/main";
import { type RendererGlobalElectronTRPC } from "electron-trpc/src/types";
import type { NNCrypto } from "@notesnook/crypto";
// 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;
// var NativeNNCrypto: (new () => NNCrypto) | undefined;
}
process.once("loaded", async () => {
@@ -40,11 +40,5 @@ process.once("loaded", async () => {
globalThis.electronTRPC = electronTRPC;
});
globalThis.NativeNNCrypto =
process.platform === "win32" &&
process.arch !== "x64" &&
process.arch !== "ia32"
? undefined
: require("@notesnook/crypto").NNCrypto;
// globalThis.NativeNNCrypto = require("@notesnook/crypto").NNCrypto;
globalThis.os = () => (MAC_APP_STORE ? "mas" : platform());

View File

@@ -20,7 +20,7 @@ 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 { ParsedImage, parseICO } from "icojs";
import { getSystemTheme } from "./theme";
import { readFile } from "fs/promises";
@@ -71,7 +71,7 @@ export class AssetManager {
`${icon}${prefix}.ico`
);
const icoBuffer = await readFile(icoPath);
const images = await parse(icoBuffer, "image/png");
const images = await parseICO(icoBuffer, "image/png");
ALL_ICONS.push({ id: icon, images, prefix });
}
}

View File

@@ -25,7 +25,11 @@ Type=Application
Version=${app.getVersion()}
Name=${app.getName()}
Comment=${app.getName()} startup script
Exec=${process.execPath}${hidden ? " --hidden" : ""}
Exec=${
process.env.APPIMAGE
? `${process.env.APPIMAGE}${hidden ? " --hidden" : ""}`
: `${process.execPath}${hidden ? " --hidden" : ""}`
}
StartupNotify=false
Terminal=false`;
@@ -35,6 +39,8 @@ const LINUX_AUTOSTART_DIRECTORY_PATH = path.join(
"autostart"
);
const STARTUP_ARGS = ["--hidden"];
export class AutoLaunch {
static enable(hidden: boolean) {
if (process.platform === "linux") {
@@ -47,10 +53,14 @@ export class AutoLaunch {
LINUX_DESKTOP_ENTRY(hidden)
);
} else {
const loginItemSettings = app.getLoginItemSettings({
args: STARTUP_ARGS
});
if (loginItemSettings.openAtLogin) return;
app.setLoginItemSettings({
openAtLogin: true,
openAsHidden: hidden,
args: ["--hidden"]
args: STARTUP_ARGS
});
}
}

View File

@@ -20,17 +20,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { autoUpdater } from "electron-updater";
import { config } from "./config";
const CHANNEL = autoUpdater.currentVersion.raw.endsWith("-beta")
? "beta"
: "latest";
async function configureAutoUpdater() {
autoUpdater.setFeedURL({
provider: "generic",
url: `https://notesnook.com/releases/${process.platform}/`,
useMultipleRangeRequest: false
url: `https://notesnook.com/api/v1/releases/${process.platform}/${CHANNEL}`,
useMultipleRangeRequest: false,
channel: CHANNEL
});
autoUpdater.autoDownload = config.automaticUpdates;
autoUpdater.allowDowngrade = false;
autoUpdater.allowPrerelease = false;
autoUpdater.autoInstallOnAppQuit = true;
autoUpdater.disableWebInstaller = true;
}
export { configureAutoUpdater };

View File

@@ -25,7 +25,8 @@ export const DesktopIntegration = z.object({
autoStart: z.boolean().optional(),
startMinimized: z.boolean().optional(),
minimizeToSystemTray: z.boolean().optional(),
closeToSystemTray: z.boolean().optional()
closeToSystemTray: z.boolean().optional(),
nativeTitlebar: z.boolean().optional()
});
export type DesktopIntegration = z.infer<typeof DesktopIntegration>;
@@ -35,13 +36,20 @@ export const config = {
autoStart: false,
startMinimized: false,
minimizeToSystemTray: false,
closeToSystemTray: false
closeToSystemTray: false,
nativeTitlebar: false
},
privacyMode: false,
isSpellCheckerEnabled: true,
zoomFactor: 1,
theme: nativeTheme.themeSource,
automaticUpdates: true
automaticUpdates: true,
proxyRules: "",
customDns: true,
backgroundColor: nativeTheme.themeSource === "dark" ? "#0f0f0f" : "#ffffff",
windowControlsIconColor:
nativeTheme.themeSource === "dark" ? "#ffffff" : "#000000"
};
type ConfigKey = keyof typeof config;

View File

@@ -0,0 +1,37 @@
/*
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";
export function enableCustomDns() {
app.configureHostResolver({
secureDnsServers: [
"https://mozilla.cloudflare-dns.com/dns-query",
"https://dns.quad9.net/dns-query"
],
enableBuiltInResolver: true
});
}
export function disableCustomDns() {
app.configureHostResolver({
secureDnsServers: [],
enableBuiltInResolver: true
});
}

View File

@@ -0,0 +1,74 @@
/*
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 { DesktopIntegration, config } from "./config";
import { setupTray, destroyTray } from "./tray";
import { AutoLaunch } from "./autolaunch";
export function setupDesktopIntegration(
desktopIntegration: DesktopIntegration
) {
if (
desktopIntegration.closeToSystemTray ||
desktopIntegration.minimizeToSystemTray
) {
setupTray();
} else {
destroyTray();
}
// when close to system tray is enabled, it becomes nigh impossible
// to "quit" the app. This is necessary in order to fix that.
app.on("before-quit", () =>
desktopIntegration.closeToSystemTray ? app.exit(0) : null
);
globalThis.window?.on("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 {
try {
globalThis.window?.minimize();
globalThis.window?.hide();
} catch (error) {
console.error(error);
}
}
}
});
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

@@ -17,6 +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/>.
*/
import { strings } from "@notesnook/intl";
import { Menu, MenuItem, clipboard, shell } from "electron";
function setupMenu() {
@@ -40,7 +41,7 @@ function setupMenu() {
if (params.misspelledWord) {
menu.append(
new MenuItem({
label: "Add to dictionary",
label: strings.addToDictionary(),
click: () =>
globalThis.window?.webContents.session.addWordToSpellCheckerDictionary(
params.misspelledWord
@@ -59,7 +60,7 @@ function setupMenu() {
if (params.linkURL.length) {
menu.append(
new MenuItem({
label: "Open in browser",
label: strings.openInBrowser(),
click: () => shell.openExternal(params.linkURL)
})
);
@@ -68,7 +69,7 @@ function setupMenu() {
if (params.isEditable) {
menu.append(
new MenuItem({
label: "Undo",
label: strings.undo(),
role: "undo",
enabled: params.isEditable,
accelerator: "CommandOrControl+Z"
@@ -77,7 +78,7 @@ function setupMenu() {
menu.append(
new MenuItem({
label: "Redo",
label: strings.redo(),
role: "redo",
enabled: params.isEditable,
accelerator: "CommandOrControl+Y"
@@ -94,7 +95,7 @@ function setupMenu() {
if (params.isEditable)
menu.append(
new MenuItem({
label: "Cut",
label: strings.cut(),
role: "cut",
enabled: params.selectionText.length > 0,
accelerator: "CommandOrControl+X"
@@ -104,7 +105,7 @@ function setupMenu() {
if (params.linkURL?.length) {
menu.append(
new MenuItem({
label: "Copy link",
label: strings.copyLink(),
click() {
clipboard.writeText(params.linkURL);
}
@@ -113,7 +114,7 @@ function setupMenu() {
menu.append(
new MenuItem({
label: "Copy link text",
label: strings.copyLinkText(),
click() {
clipboard.writeText(params.linkText);
}
@@ -124,17 +125,28 @@ function setupMenu() {
if (params.selectionText.length) {
menu.append(
new MenuItem({
label: "Copy",
label: strings.copy(),
role: "copy",
accelerator: "CommandOrControl+C"
})
);
}
if (params.mediaType === "image")
menu.append(
new MenuItem({
id: "copy-image",
label: strings.copyImage(),
click() {
globalThis.window?.webContents.copyImageAt(params.x, params.y);
}
})
);
if (params.isEditable)
menu.append(
new MenuItem({
label: "Paste",
label: strings.paste(),
role: "pasteAndMatchStyle",
enabled: clipboard.readText("clipboard").length > 0,
accelerator: "CommandOrControl+V"

View File

@@ -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/>.
*/
import { protocol, net } from "electron";
import { net, protocol } from "electron";
import { isDevelopment } from "./index";
import { createReadStream } from "fs";
import { extname, normalize } from "path";
@@ -62,9 +62,7 @@ function registerProtocol() {
headers: { "Content-Type": extensionToMimeType[fileExtension] }
});
} else {
return net.fetch(request, {
bypassCustomProtocolHandlers: true
});
return net.fetch(request, { bypassCustomProtocolHandlers: true });
}
});
console.info(`${SCHEME} protocol inteception "successful"`);

View File

@@ -41,7 +41,10 @@ function setTheme(theme: Theme) {
}
function getBackgroundColor() {
return nativeTheme.shouldUseDarkColors ? "#0f0f0f" : "#ffffff";
return (
config.backgroundColor ||
(nativeTheme.shouldUseDarkColors ? "#0f0f0f" : "#ffffff")
);
}
function getSystemTheme() {

View File

@@ -38,7 +38,7 @@ DerivedData
*.ipa
*.xcuserstate
*.hprof
ios/.xcode.env.local
**/.xcode.env.local
# Android/IntelliJ
#
rn-build-deps/

View File

@@ -16,14 +16,14 @@ 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 "@azure/core-asynciterator-polyfill";
import SettingsService from "./services/settings";
import { i18n } from "@lingui/core";
import { I18nProvider } from "@lingui/react";
import {
THEME_COMPATIBILITY_VERSION,
useThemeEngineStore
} from "@notesnook/theme";
import React, { useEffect } from "react";
import { View } from "react-native";
import { I18nManager, View } from "react-native";
import "react-native-gesture-handler";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { SafeAreaProvider } from "react-native-safe-area-context";
@@ -32,39 +32,42 @@ import { withErrorBoundry } from "./components/exception-handler";
import GlobalSafeAreaProvider from "./components/globalsafearea";
import { useAppEvents } from "./hooks/use-app-events";
import { ApplicationHolder } from "./navigation";
import { themeTrpcClient } from "./screens/settings/theme-selector";
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 { themeTrpcClient } from "./screens/settings/theme-selector";
SettingsService.checkOrientation();
I18nManager.allowRTL(false);
I18nManager.forceRTL(false);
I18nManager.swapLeftAndRightInRTL(false);
const { appLockEnabled, appLockMode } = SettingsService.get();
if (appLockEnabled || appLockMode !== "none") {
useUserStore.getState().lockApp(true);
}
const App = () => {
const init = useAppEvents();
useAppEvents();
//@ts-ignore
globalThis["IS_MAIN_APP_RUNNING"] = true;
useEffect(() => {
let { appLockMode } = SettingsService.get();
if (appLockMode && appLockMode !== "none") {
useUserStore.getState().lockApp(true);
}
globalThis["IS_MAIN_APP_RUNNING"] = true;
init();
SettingsService.onFirstLaunch();
setTimeout(async () => {
SettingsService.onFirstLaunch();
await Notifications.get();
if (SettingsService.get().notifNotes) {
Notifications.pinQuickNote(true);
}
TipManager.init();
}, 100);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
<View
style={{
height: "100%",
width: "100%"
width: "100%",
justifyContent: "center",
alignItems: "center"
}}
>
<View
@@ -97,10 +100,10 @@ const App = () => {
let currTheme =
useThemeStore.getState().colorScheme === "dark"
? SettingsService.getProperty("darkTheme")
: SettingsService.getProperty("lightTheme");
: SettingsService.getProperty("lighTheme");
useThemeEngineStore.getState().setTheme(currTheme);
export const withTheme = (Element) => {
export const withTheme = (Element: () => JSX.Element) => {
return function AppWithThemeProvider() {
const [colorScheme, darkTheme, lightTheme] = useThemeStore((state) => [
state.colorScheme,
@@ -139,7 +142,11 @@ export const withTheme = (Element) => {
currTheme = nextTheme;
}
return <Element />;
return (
<I18nProvider i18n={i18n}>
<Element />
</I18nProvider>
);
};
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

@@ -1,156 +0,0 @@
/*
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 { Platform } from "react-native";
import { MMKV } from "../database/mmkv";
import { useSettingStore } from "../../stores/use-setting-store";
const WEBSITE_ID = "3c6890ce-8410-49d5-8831-15fb2eb28a21";
const baseUrl = "https://analytics.streetwriters.co/api/collect";
const UA =
Platform.OS === "ios"
? "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1"
: `
Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36`;
/**
*
* @param {Routes} route
* @param {Routes[]} conditions
* @returns
*/
async function canUpdateAnalytics(route, conditions = []) {
if (!useSettingStore?.getState()?.settings?.telemetry) return false;
let eventsList = MMKV.getString("notesnookUserEvents");
if (eventsList) {
eventsList = JSON.parse(eventsList);
}
if (eventsList && eventsList[route]) {
console.log("analytics: event already sent", route);
return false;
}
if (route !== "/welcome") {
for (let cond of conditions) {
if (!eventsList || !eventsList[cond]) {
console.log("analytics: conditions not met for event", route, cond);
return false;
}
}
}
console.log("analytics: will send event", route);
return true;
}
async function saveAnalytics(route, value = true) {
let eventsList = MMKV.getString("notesnookUserEvents");
if (eventsList) {
eventsList = JSON.parse(eventsList);
} else {
eventsList = {};
}
eventsList[route] = value;
MMKV.setString("notesnookUserEvents", JSON.stringify(eventsList));
}
/**
*@typedef {"/welcome" | "/home" | "/signup" | "/first-note" | "/account-created" | "/pro-sheet" | "/pro-plans" | "/iap-native" | "/pro-screen" | "/editor" | "/editor-toolbar" | "/properties" | "/sidemenu"} Routes
* @param {Routes} prevRoute
* @param {Routes} route
* @param {Routes[]} conditions
* @param {boolean} once
* @returns
*/
async function pageView(
route,
prevRoute = "",
conditions = ["/welcome"],
once = true
) {
if (__DEV__) return;
if (!(await canUpdateAnalytics(route, conditions)) && once) return;
let body = {
payload: {
website: WEBSITE_ID,
url: `notesnook-${Platform.OS}${prevRoute}${route}`,
referrer: `https://notesnook.com/notesnook-${Platform.OS}${prevRoute}`,
hostname: `notesnook-${Platform.OS}`,
language: "en-US",
screen: "1920x1080"
},
type: "pageview"
};
try {
let response = await fetch(baseUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
"User-Agent": UA
},
body: JSON.stringify(body)
});
console.log("analytics: event sent", route);
await saveAnalytics(route);
return await response.text();
} catch (e) {
console.log(e);
}
}
async function sendEvent(type, value, once = true) {
if (__DEV__) return;
if (!(await canUpdateAnalytics(type)) && once) return;
let body = {
payload: {
website: WEBSITE_ID,
url: "/",
event_type: type,
event_value: value,
hostname: "notesnook-android-app",
language: "en-US",
screen: "1920x1080"
},
type: "event"
};
try {
let response = await fetch(baseUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
"User-Agent": UA
},
body: JSON.stringify(body)
});
console.log(response.status);
return await response.text();
} catch (e) {
console.log(e);
}
}
export default {
sendEvent,
pageView,
saveAnalytics
};

View File

@@ -17,16 +17,39 @@ 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 { Platform } from "react-native";
import "react-native-get-random-values";
import * as Keychain from "react-native-keychain";
import { MMKVLoader, ProcessingModes } from "react-native-mmkv-storage";
import { generateSecureRandom } from "react-native-securerandom";
import Sodium from "@ammarahmed/react-native-sodium";
import { DatabaseLogger } from ".";
import { MMKV } from "./mmkv";
import { ToastManager } from "../../services/event-manager";
// Database key cipher is persisted across different user sessions hence it has
// it's independent storage which we will never clear. This is only used when application has
// app lock with password enabled.
export const CipherStorage = new MMKVLoader()
.withInstanceID("cipher_storage")
.setProcessingMode(
Platform.OS === "ios"
? ProcessingModes.MULTI_PROCESS
: ProcessingModes.SINGLE_PROCESS
)
.disableIndexing()
.initialize();
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 KEYCHAIN_SERVER_DBKEY = "notesnook:db";
const NOTESNOOK_APPLOCK_KEY_SALT = "kBwr1Kre86ebOZ8ThLu2OA";
const NOTESNOOK_DB_KEY_SALT = "SNuzOcEK3amoqL0WvPeKqw";
const DB_KEY_CIPHER = "databaseKeyCipher";
const USER_KEY_CIPHER = "userKeyCipher";
const APPLOCK_CIPHER = "applockCipher";
const KEYSTORE_CONFIG = Platform.select({
ios: {
@@ -37,61 +60,227 @@ const KEYSTORE_CONFIG = Platform.select({
android: {}
});
export async function deriveCryptoKey(name, data) {
try {
let credentials = await Sodium.deriveKey(data.password, data.salt);
await Keychain.setInternetCredentials(
"notesnook",
name,
credentials.key,
KEYSTORE_CONFIG
function generatePassword() {
const length = 80;
const crypto = window.crypto || window.msCrypto;
if (typeof crypto === "undefined") {
throw new Error(
"Crypto API is not supported. Please upgrade your web browser"
);
MMKV.setBool(IOS_KEYCHAIN_UPGRAGE_KEY, true);
return credentials.key;
}
const charset =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&+_{}[]():<>/?;";
const indexes = crypto.getRandomValues(new Uint32Array(length));
let secret = "";
for (const index of indexes) {
secret += charset[index % charset.length];
}
return secret;
}
export async function encryptDatabaseKeyWithPassword(appLockPassword) {
const key = getDatabaseKey();
const appLockCredentials = await Sodium.deriveKey(
appLockPassword,
NOTESNOOK_APPLOCK_KEY_SALT
);
const databaseKeyCipher = await encrypt(appLockCredentials, key);
MMKV.setMap(DB_KEY_CIPHER, databaseKeyCipher);
// We reset the database key from keychain once app lock password is set.
await Keychain.resetInternetCredentials(KEYCHAIN_SERVER_DBKEY);
return true;
}
export async function restoreDatabaseKeyToKeyChain(appLockPassword) {
const databaseKeyCipher = CipherStorage.getMap(DB_KEY_CIPHER);
const databaseKey = await decrypt(
{
password: appLockPassword
},
databaseKeyCipher
);
await Keychain.setInternetCredentials(
KEYCHAIN_SERVER_DBKEY,
"notesnook",
databaseKey,
KEYSTORE_CONFIG
);
MMKV.removeItem(DB_KEY_CIPHER);
return true;
}
export async function setAppLockVerificationCipher(appLockPassword) {
try {
const appLockCredentials = await Sodium.deriveKey(
appLockPassword,
NOTESNOOK_APPLOCK_KEY_SALT
);
const encrypted = await encrypt(appLockCredentials, generatePassword());
CipherStorage.setMap(APPLOCK_CIPHER, encrypted);
DatabaseLogger.info("setAppLockVerificationCipher");
} catch (e) {
console.error(e);
DatabaseLogger.error(e);
console.log(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
export async function clearAppLockVerificationCipher() {
CipherStorage.removeItem(APPLOCK_CIPHER);
}
export async function validateAppLockPassword(appLockPassword) {
try {
const appLockCipher = CipherStorage.getMap(APPLOCK_CIPHER);
if (!appLockCipher) return true;
const key = await Sodium.deriveKey(appLockPassword, appLockCipher.salt);
const decrypted = await decrypt(key, appLockCipher);
DatabaseLogger.info(
`validateAppLockPassword: ${typeof decrypted === "string"}`
);
console.log("IOS KEYCHAIN MIGRATION COMPLETED!");
MMKV.setBool(IOS_KEYCHAIN_UPGRAGE_KEY, true);
return typeof decrypted === "string";
} catch (e) {
DatabaseLogger.error(e);
return false;
}
}
let DB_KEY;
export function clearDatabaseKey() {
DB_KEY = undefined;
DatabaseLogger.info("Cleared database key");
}
export async function getDatabaseKey(appLockPassword) {
if (DB_KEY) return DB_KEY;
try {
if (appLockPassword) {
const databaseKeyCipher = CipherStorage.getMap("databaseKeyCipher");
const databaseKey = await decrypt(
{
password: appLockPassword
},
databaseKeyCipher
);
DatabaseLogger.info("Getting database key from cipher");
DB_KEY = databaseKey;
}
if (!DB_KEY) {
const hasKey = await Keychain.hasInternetCredentials(
KEYCHAIN_SERVER_DBKEY
);
if (hasKey) {
let credentials = await Keychain.getInternetCredentials(
KEYCHAIN_SERVER_DBKEY,
KEYSTORE_CONFIG
);
DatabaseLogger.info("Getting database key from Keychain");
DB_KEY = credentials.password;
}
}
if (!DB_KEY) {
DatabaseLogger.info("Generating new database key");
const password = generatePassword();
const derivedDatabaseKey = await Sodium.deriveKey(
password,
NOTESNOOK_DB_KEY_SALT
);
DB_KEY = derivedDatabaseKey.key;
await Keychain.setInternetCredentials(
KEYCHAIN_SERVER_DBKEY,
"notesnook",
DB_KEY,
KEYSTORE_CONFIG
);
}
if (await Keychain.hasInternetCredentials("notesnook")) {
const userKeyCredentials = await Keychain.getInternetCredentials(
"notesnook",
KEYSTORE_CONFIG
);
if (userKeyCredentials) {
const userKeyCipher = await encrypt(
{
key: DB_KEY,
salt: NOTESNOOK_DB_KEY_SALT
},
userKeyCredentials.password
);
// Store encrypted user key in MMKV
MMKV.setMap(USER_KEY_CIPHER, userKeyCipher);
await Keychain.resetInternetCredentials("notesnook");
}
DatabaseLogger.info("Migrated user credentials to cipher storage");
}
return DB_KEY;
} catch (e) {
ToastManager.error(e, "Error getting database key");
console.log(e, "error");
DatabaseLogger.error(e);
return null;
}
}
export async function deriveCryptoKey(data) {
try {
let credentials = await Sodium.deriveKey(data.password, data.salt);
const userKeyCipher = await encrypt(
{
key: await getDatabaseKey(),
salt: NOTESNOOK_DB_KEY_SALT
},
credentials.key
);
DatabaseLogger.info("User key stored: ", !!userKeyCipher);
// Store encrypted user key in MMKV
MMKV.setMap(USER_KEY_CIPHER, userKeyCipher);
return credentials.key;
} catch (e) {
DatabaseLogger.error(e);
}
}
export async function getCryptoKey(_name) {
try {
if (await Keychain.hasInternetCredentials("notesnook")) {
let credentials = await Keychain.getInternetCredentials(
"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 {
const keyCipher = MMKV.getMap(USER_KEY_CIPHER);
if (!keyCipher) {
DatabaseLogger.info("User key cipher is null");
return null;
}
const key = await decrypt(
{
key: await getDatabaseKey(),
salt: keyCipher.salt
},
keyCipher
);
return key;
} catch (e) {
console.error(e);
console.log("getCryptoKey", e);
DatabaseLogger.error(e);
}
}
export async function removeCryptoKey(_name) {
try {
let result = await Keychain.resetInternetCredentials("notesnook");
return result;
MMKV.removeItem(USER_KEY_CIPHER);
await Keychain.resetInternetCredentials("notesnook");
return true;
} catch (e) {
console.error(e);
DatabaseLogger.error(e);
}
}
@@ -109,7 +298,7 @@ export async function generateCryptoKey(password, salt) {
let credentials = await Sodium.deriveKey(password, salt || null);
return credentials;
} catch (e) {
console.log("generateCryptoKey: ", e);
DatabaseLogger.error(e);
}
}
@@ -123,6 +312,8 @@ export async function decrypt(password, data) {
return undefined;
let _data = { ...data };
_data.output = "plain";
if (!password.salt) password.salt = data.salt;
return await Sodium.decrypt(password, _data);
}
@@ -135,6 +326,11 @@ export async function decryptMulti(password, data) {
d.output = "plain";
return d;
});
if (data.length && !password.salt) {
password.salt = data[0].salt;
}
return await Sodium.decryptMulti(password, data);
}

View File

@@ -16,48 +16,70 @@ 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 "./logger";
import { database } from "@notesnook/common";
import { logger as dbLogger } from "@notesnook/core/dist/logger";
import { logger as dbLogger } from "@notesnook/core";
import { Platform } from "react-native";
import * as Gzip from "react-native-gzip";
import EventSource from "../../utils/sse/even-source-ios";
import AndroidEventSource from "../../utils/sse/event-source";
import {
SqliteAdapter,
SqliteIntrospector,
SqliteQueryCompiler
} from "@streetwriters/kysely";
import filesystem from "../filesystem";
import "./logger";
import Storage from "./storage";
import { RNSqliteDriver } from "./sqlite.kysely";
import { getDatabaseKey } from "./encryption";
import SettingsService from "../../services/settings";
import { strings } from "@notesnook/intl";
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.43.108:5264",
// AUTH_HOST: "http://192.168.43.108:8264",
// SSE_HOST: "http://192.168.43.108:7264",
// SUBSCRIPTIONS_HOST: "http://192.168.43.108:9264",
// ISSUES_HOST: "http://192.168.43.108: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 setupDatabase(password) {
const key = await getDatabaseKey(password);
if (!key) throw new Error(strings.databaseSetupFailed());
database.setup(
Storage,
Platform.OS === "ios" ? EventSource : AndroidEventSource,
filesystem,
{
compress: Gzip.deflate,
decompress: Gzip.inflate
}
);
console.log("Opening database with key:", !!key);
database.host({
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",
...(SettingsService.getProperty("serverUrls") || {})
});
database.setup({
storage: Storage,
eventsource: Platform.OS === "ios" ? EventSource : AndroidEventSource,
fs: filesystem,
compressor: {
compress: Gzip.deflate,
decompress: Gzip.inflate
},
batchSize: 100,
sqliteOptions: {
dialect: (name) => ({
createDriver: () => {
return new RNSqliteDriver({ async: true, dbName: name });
},
createAdapter: () => new SqliteAdapter(),
createIntrospector: (db) => new SqliteIntrospector(db),
createQueryCompiler: () => new SqliteQueryCompiler()
}),
tempStore: "memory",
journalMode: Platform.OS === "ios" ? "DELETE" : "WAL",
password: key
}
});
}
export const db = database;
export const DatabaseLogger = dbLogger;
let DatabaseLogger = dbLogger.scope(Platform.OS);
const setLogger = () => {
DatabaseLogger = dbLogger.scope(Platform.OS);
};
export { DatabaseLogger, setLogger };

View File

@@ -16,14 +16,34 @@ 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 { MMKVLoader } from "react-native-mmkv-storage";
import { initalize } from "@notesnook/core/dist/logger";
import { KV } from "./storage";
const LoggerStorage = new MMKVLoader()
.withInstanceID("notesnook_logs")
.initialize();
import { initialize } from "@notesnook/core";
import {
SqliteAdapter,
SqliteIntrospector,
SqliteQueryCompiler
} from "@streetwriters/kysely";
import { Platform } from "react-native";
import { setLogger } from ".";
import { RNSqliteDriver } from "./sqlite.kysely";
initalize(new KV(LoggerStorage));
let loggerLoaded = false;
const initializeLogger = async () => {
if (loggerLoaded) return;
await initialize({
dialect: (name) => ({
createDriver: () => {
return new RNSqliteDriver({ async: true, dbName: name });
},
createAdapter: () => new SqliteAdapter(),
createIntrospector: (db) => new SqliteIntrospector(db),
createQueryCompiler: () => new SqliteQueryCompiler()
}),
tempStore: "memory",
journalMode: Platform.OS === "ios" ? "DELETE" : "WAL"
});
setLogger();
loggerLoaded = true;
};
export {};
export { initializeLogger };

View File

@@ -0,0 +1,128 @@
/*
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 type {
DatabaseConnection,
Driver,
QueryResult
} from "@streetwriters/kysely";
import { CompiledQuery } from "@streetwriters/kysely";
import { QuickSQLiteConnection, open } from "react-native-quick-sqlite";
import { strings } from "@notesnook/intl";
type Config = { dbName: string; async: boolean; location: string };
export class RNSqliteDriver implements Driver {
private connection?: DatabaseConnection;
private connectionMutex = new ConnectionMutex();
private db: QuickSQLiteConnection;
constructor(private readonly config: Config) {
this.db = open({
name: config.dbName
});
}
async init(): Promise<void> {
this.connection = new RNSqliteConnection(this.db);
}
async acquireConnection(): Promise<DatabaseConnection> {
// SQLite only has one single connection. We use a mutex here to wait
// until the single connection has been released.
await this.connectionMutex.lock();
return this.connection!;
}
async beginTransaction(connection: DatabaseConnection): Promise<void> {
await connection.executeQuery(CompiledQuery.raw("BEGIN TRANSACTION"));
}
async commitTransaction(connection: DatabaseConnection): Promise<void> {
await connection.executeQuery(CompiledQuery.raw("COMMIT"));
}
async rollbackTransaction(connection: DatabaseConnection): Promise<void> {
await connection.executeQuery(CompiledQuery.raw("ROLLBACK"));
}
async releaseConnection(): Promise<void> {
this.connectionMutex.unlock();
}
async destroy(): Promise<void> {
this.db.close();
}
}
class ConnectionMutex {
private promise?: Promise<void>;
private resolve?: () => void;
async lock(): Promise<void> {
while (this.promise) {
await this.promise;
}
this.promise = new Promise((resolve) => {
this.resolve = resolve;
});
}
unlock(): void {
const resolve = this.resolve;
this.promise = undefined;
this.resolve = undefined;
resolve?.();
}
}
class RNSqliteConnection implements DatabaseConnection {
constructor(private readonly db: QuickSQLiteConnection) {}
streamQuery<R>(): AsyncIterableIterator<QueryResult<R>> {
throw new Error(strings.streamingNotSupported());
}
async executeQuery<R>(
compiledQuery: CompiledQuery<unknown>
): Promise<QueryResult<R>> {
const { parameters, sql, query } = compiledQuery;
const mode =
query.kind === "SelectQueryNode"
? "query"
: query.kind === "RawNode"
? "raw"
: "exec";
const result = await this.db.executeAsync(sql, parameters as any[]);
if (mode === "query" || !result.insertId)
return {
rows: result.rows?._array || []
};
return {
insertId: BigInt(result.insertId),
numAffectedRows: BigInt(result.rowsAffected),
rows: mode === "raw" ? result.rows?._array || [] : []
};
}
}

View File

@@ -21,15 +21,15 @@ import { Platform } from "react-native";
import RNFetchBlob from "react-native-blob-util";
import {
decrypt,
decryptMulti,
deriveCryptoKey,
encrypt,
encryptMulti,
generateCryptoKey,
getCryptoKey,
getRandomBytes,
hash,
removeCryptoKey,
decryptMulti,
encryptMulti
removeCryptoKey
} from "./encryption";
import { MMKV } from "./mmkv";
@@ -90,6 +90,11 @@ export class KV {
return this.storage.removeItem(key);
}
async removeMulti(keys) {
if (!keys) return true;
return this.storage.removeItems(keys);
}
async clear() {
return this.storage.clearStore();
}
@@ -145,6 +150,7 @@ export default {
clear: () => DefaultStorage.clear(),
getAllKeys: () => DefaultStorage.getAllKeys(),
writeMulti: (items) => DefaultStorage.writeMulti(items),
removeMulti: (keys) => DefaultStorage.removeMulti(keys),
encrypt,
decrypt,
decryptMulti,

View File

@@ -16,20 +16,60 @@ 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 { Dimensions, Image, 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 { width: screenWidth, scale } = Dimensions.get("window");
console.log("COMPRESSING TO BASE64...");
return new Promise((resolve) => {
console.log(path, "image path...");
Image.getSize(path, async (width) => {
console.log("image width", width);
const response = await ImageResizer.createResizedImage(
path,
screenWidth * scale,
99999,
type,
width <= 1920 ? 100 : 90,
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);
resolve(base64);
});
});
}
export async function compressToFile(path, type) {
const response = await ImageResizer.createResizedImage(
path,
width * scale,
9999,
1920,
99999,
type,
80,
0,
@@ -40,11 +80,6 @@ export async function compressToBase64(path, type) {
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;
return response.uri;
}

View File

@@ -18,23 +18,21 @@ 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/dist/utils/filename";
import { getFileNameWithExtension } from "@notesnook/core";
import { strings } from "@notesnook/intl";
import React from "react";
import { Platform } from "react-native";
import RNFetchBlob from "react-native-blob-util";
import * as ScopedStorage from "react-native-scoped-storage";
import { subscribe, zip } from "react-native-zip-archive";
import RNFetchBlob from "react-native-blob-util";
import { ShareComponent } from "../../components/sheets/export-notes/share";
import { ToastEvent, presentSheet } from "../../services/event-manager";
import { ToastManager, presentSheet } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { db } from "../database";
import { IOS_APPGROUPID } from "../../utils/constants";
import { DatabaseLogger, db } from "../database";
import Storage from "../database/storage";
import { createCacheDir, exists } from "./io";
import { cacheDir, copyFileAsync, releasePermissions } from "./utils";
import { createCacheDir } from "./io";
export const FileDownloadStatus = {
Success: 1,
@@ -45,27 +43,22 @@ export const FileDownloadStatus = {
* Download all user's attachments
* @returns
*/
export function downloadAllAttachments() {
const attachments = db.attachments.all;
export async function downloadAllAttachments() {
const attachments = await db.attachments.all.ids();
return downloadAttachments(attachments);
}
/**
* Downloads provided attachments to a .zip file
* on user's device.
* @param attachments
* @param {string[]} attachments
* @param onProgress
* @returns
*/
export async function downloadAttachments(
attachments,
onProgress,
canceled,
groupId
) {
export async function downloadAttachments(attachments) {
await createCacheDir();
if (!attachments || !attachments.length) return;
const result = new Map();
const groupId = `download-all-${Date.now()}`;
let outputFolder;
if (Platform.OS === "android") {
@@ -83,95 +76,123 @@ export async function downloadAttachments(
Platform.OS === "ios"
? `${outputFolder}/notesnook-attachments-${Date.now()}.zip`
: `${cacheDir}/notesnook-attachments.zip`;
if (await RNFetchBlob.fs.exists(zipSourceFolder))
if (await RNFetchBlob.fs.exists(zipSourceFolder)) {
await RNFetchBlob.fs.unlink(zipSourceFolder);
}
await RNFetchBlob.fs.mkdir(zipSourceFolder);
const isCancelled = () => {
if (useAttachmentStore.getState().downloading[groupId]?.canceled) {
RNFetchBlob.fs.unlink(zipSourceFolder).catch(console.log);
useAttachmentStore.getState().setDownloading({
groupId,
current: 0,
total: 0,
success: false,
message: strings.network.dowloadCancelled(),
canceled: true
});
return true;
}
};
for (let i = 0; i < attachments.length; i++) {
let attachment = attachments[i];
const hash = attachment.metadata.hash;
if (isCancelled()) return;
let attachment = await db.attachments.attachment(attachments[i]);
const hash = attachment.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`
);
useAttachmentStore.getState().setDownloading({
groupId: groupId,
current: i + 1,
total: attachments.length,
filename: attachment.hash
});
// 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");
if (isCancelled()) return;
if (!uri) throw new Error(strings.failedToDownloadFile());
// 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}`;
const filePath = `${zipSourceFolder}/${attachment.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);
DatabaseLogger.error(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`
);
useAttachmentStore.getState().setDownloading({
groupId: groupId,
current: 0,
total: 0,
success: true
});
if (isCancelled()) return;
let sub;
try {
useAttachmentStore.getState().setDownloading({
current: 0,
total: 1,
message: `${strings.savingZipFile()}... ${strings.pleaseWait()}`,
groupId
});
// If all goes well, zip the notesnook-attachments folder in cache.
sub = subscribe(({ progress }) => {
useAttachmentStore.getState().setDownloading({
groupId,
current: progress,
total: 1,
message: `${strings.savingZipFile()} (${(progress * 100).toFixed(
1
)}%)... ${strings.pleaseWait()}`
});
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);
}
});
await zip(zipSourceFolder, zipOutputFile);
sub?.remove();
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);
// 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);
}
}
return result;
useAttachmentStore.getState().setDownloading({
current: 0,
total: 0,
message: undefined,
success: true,
groupId
});
releasePermissions(outputFolder);
} catch (e) {
useAttachmentStore.getState().setDownloading({
current: 0,
total: 0,
message: undefined,
success: false,
groupId
});
releasePermissions(outputFolder);
sub?.remove();
ToastManager.error(e, "Error zipping attachments");
}
// Remove source & zip file from cache.
RNFetchBlob.fs.unlink(zipSourceFolder).catch(console.log);
if (Platform.OS === "android") {
RNFetchBlob.fs.unlink(zipOutputFile).catch(console.log);
}
}
export default async function downloadAttachment(
@@ -181,14 +202,16 @@ export default async function downloadAttachment(
silent: false,
cache: false,
throwError: false,
groupId: undefined
groupId: undefined,
base64: false,
text: false
}
) {
await createCacheDir();
let attachment = db.attachments.attachment(hash);
let attachment = await db.attachments.attachment(hash);
if (!attachment) {
console.log("attachment not found");
DatabaseLogger.log("Attachment not found");
return;
}
@@ -203,39 +226,46 @@ export default async function downloadAttachment(
}
try {
console.log(
"starting download attachment",
attachment.metadata.hash,
options.groupId
);
await db.fs.downloadFile(
options.groupId || attachment.metadata.hash,
attachment.metadata.hash
);
if (
!(await RNFetchBlob.fs.exists(`${cacheDir}/${attachment.metadata.hash}`))
)
await db
.fs()
.downloadFile(
options.groupId || attachment.hash,
attachment.hash,
attachment.chunkSize
);
if (!(await exists(attachment.hash))) {
DatabaseLogger.log("Attachment does not exist after download.");
return;
}
if (options.base64 || options.text) {
DatabaseLogger.log(`Starting to decrypt... hash: ${attachment.hash}`);
return await db.attachments.read(
attachment.hash,
options.base64 ? "base64" : "text"
);
}
let filename = getFileNameWithExtension(
attachment.metadata.filename,
attachment.metadata.type
attachment.filename,
attachment.mimeType
);
let key = await db.attachments.decryptKey(attachment.key);
let info = {
iv: attachment.iv,
salt: attachment.salt,
length: attachment.length,
length: attachment.size,
alg: attachment.alg,
hash: attachment.metadata.hash,
hashType: attachment.metadata.hashType,
mime: attachment.metadata.type,
hash: attachment.hash,
hashType: attachment.hashType,
mime: attachment.mimeType,
fileName: options.cache ? undefined : filename,
uri: options.cache ? undefined : folder.uri,
chunkSize: attachment.chunkSize
chunkSize: attachment.chunkSize,
appGroupId: IOS_APPGROUPID
};
let fileUri = await Sodium.decryptFile(
key,
info,
@@ -243,48 +273,38 @@ export default async function downloadAttachment(
);
if (!options.silent) {
ToastEvent.show({
heading: "Download successful",
message: filename + " downloaded",
ToastManager.show({
heading: strings.network.downloadSuccess(),
message: strings.network.fileDownloaded(filename),
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" && !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"
}`,
title: strings.network.fileDownloaded(),
paragraph: strings.fileSaved(filename, Platform.OS),
icon: "download",
context: global ? null : attachment.metadata.hash,
context: global ? null : attachment.hash,
component: <ShareComponent uri={fileUri} name={filename} padding={12} />
});
}
return fileUri;
} catch (e) {
console.log("download attachment error: ", e);
if (attachment.dateUploaded) {
RNFetchBlob.fs
.unlink(RNFetchBlob.fs.dirs.CacheDir + `/${attachment.metadata.hash}`)
.unlink(RNFetchBlob.fs.dirs.CacheDir + `/${attachment.hash}`)
.catch(console.log);
RNFetchBlob.fs
.unlink(RNFetchBlob.fs.dirs.CacheDir + `/${attachment.hash}_dcache`)
.catch(console.log);
}
useAttachmentStore.getState().remove(attachment.metadata.hash);
DatabaseLogger.error(e);
useAttachmentStore.getState().remove(attachment.hash);
if (options.throwError) {
throw e;
}

View File

@@ -17,108 +17,172 @@ 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 hosts from "@notesnook/core/dist/utils/constants";
import { strings } from "@notesnook/intl";
import NetInfo from "@react-native-community/netinfo";
import RNFetchBlob from "react-native-blob-util";
import { ToastEvent } from "../../services/event-manager";
import { ToastManager } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { db } from "../database";
import { cacheDir, fileCheck } from "./utils";
import { DatabaseLogger, db } from "../database";
import { createCacheDir, exists } from "./io";
import { ABYTES, cacheDir, getUploadedFileSize, parseS3Error } from "./utils";
export async function downloadFile(filename, data, cancelToken) {
if (!data) return false;
export async function downloadFile(filename, requestOptions, cancelToken) {
if (!requestOptions) {
DatabaseLogger.log(
`Error downloading file: ${filename}, reason: No requestOptions`
);
return false;
}
DatabaseLogger.log(`Downloading ${filename}`);
await createCacheDir();
let { url, headers } = data;
let path = `${cacheDir}/${filename}`;
let { url, headers, chunkSize } = requestOptions;
let tempFilePath = `${cacheDir}/${filename}_temp`;
let originalFilePath = `${cacheDir}/${filename}`;
try {
if (await exists(filename)) {
DatabaseLogger.log(`File Exists already: ${filename}`);
return true;
}
const attachment = await db.attachments.attachment(filename);
const size = await getUploadedFileSize(filename);
if (size === -1) {
const error = `${strings.fileVerificationFailed()} (File hash: ${filename})`;
throw new Error(error);
}
if (size === 0) {
const error = `${strings.fileLengthError()} (File hash: ${filename})`;
await db.attachments.markAsFailed(attachment.id, error);
throw new Error(error);
}
const totalChunks = Math.ceil(size / chunkSize);
const decryptedLength = size - totalChunks * ABYTES;
if (attachment && attachment.size !== decryptedLength) {
const error = `${strings.fileLengthMismatch(
attachment.size,
decryptedLength
)} (File hash: ${filename})`;
await db.attachments.markAsFailed(attachment.id, error);
throw new Error(error);
}
let res = await fetch(url, {
method: "GET",
headers
});
if (!res.ok)
throw new Error(`${res.status}: Unable to resolve download url`);
if (!res.ok) {
DatabaseLogger.log(
`Error downloading file: ${filename}, ${res.status}, ${res.statusText}, reason: Unable to resolve download url`
);
throw new Error(
`${res.status}: ${strings.failedToResolvedDownloadUrl()}`
);
}
const downloadUrl = await res.text();
if (!downloadUrl) throw new Error("Unable to resolve download url");
let totalSize = 0;
console.log("Download starting");
if (!downloadUrl) {
DatabaseLogger.log(
`Error downloading file: ${filename}, reason: Unable to resolve download url`
);
throw new Error(strings.failedToResolvedDownloadUrl());
}
DatabaseLogger.log(`Download starting: ${filename}`);
let request = RNFetchBlob.config({
path: path,
IOSBackgroundTask: true
path: tempFilePath,
IOSBackgroundTask: true,
overwrite: true
})
.fetch("GET", downloadUrl, null)
.progress((recieved, total) => {
.progress(async (recieved, total) => {
useAttachmentStore
.getState()
.setProgress(0, total, filename, recieved, "download");
totalSize = total;
console.log("downloading: ", recieved, total);
DatabaseLogger.log(`Downloading: ${filename}, ${recieved}/${total}`);
});
cancelToken.cancel = () => {
useAttachmentStore.getState().remove(filename);
request.cancel();
RNFetchBlob.fs.unlink(tempFilePath).catch(console.log);
DatabaseLogger.log(`Download cancelled: ${filename}`);
};
let response = await request;
await fileCheck(response, totalSize);
console.log(response.info().headers);
const contentType =
response.info().headers?.["content-type"] ||
response.info().headers?.["Content-Type"];
if (contentType === "application/xml") {
const error = parseS3Error(await response.text());
throw new Error(`[${error.Code}] ${error.Message}`);
}
let status = response.info().status;
useAttachmentStore.getState().remove(filename);
if (exists(originalFilePath)) {
await RNFetchBlob.fs.unlink(originalFilePath).catch(console.log);
}
await RNFetchBlob.fs.mv(tempFilePath, originalFilePath);
if (!(await exists(filename))) {
throw new Error("File size mismatch");
}
return status >= 200 && status < 300;
} catch (e) {
if (e.message !== "canceled") {
ToastEvent.show({
heading: "Error downloading file",
if (e.message !== "canceled" && !e.message.includes("NoSuchKey")) {
const toast = {
heading: strings.downloadError(),
message: e.message,
type: "error",
context: "global"
});
ToastEvent.show({
heading: "Error downloading file",
message: e.message,
type: "error",
context: "local"
});
};
ToastManager.show(toast);
toast.context = "local";
ToastManager.show(toast);
}
useAttachmentStore.getState().remove(filename);
RNFetchBlob.fs.unlink(path).catch(console.log);
console.log("Download file error:", e, url, headers);
RNFetchBlob.fs.unlink(tempFilePath).catch(console.log);
RNFetchBlob.fs.unlink(originalFilePath).catch(console.log);
DatabaseLogger.error(e, {
url,
headers
});
return false;
}
}
export async function getUploadedFileSize(hash) {
const url = `${hosts.API_HOST}/s3?name=${hash}`;
const token = await db.user.tokenManager.getAccessToken();
const attachmentInfo = await fetch(url, {
method: "HEAD",
headers: { Authorization: `Bearer ${token}` }
});
const contentLength = parseInt(attachmentInfo.headers?.get("content-length"));
return isNaN(contentLength) ? 0 : contentLength;
}
export async function checkAttachment(hash) {
const internetState = await NetInfo.fetch();
const isInternetReachable =
internetState.isConnected && internetState.isInternetReachable;
if (!isInternetReachable) return { success: true };
const attachment = db.attachments.attachment(hash);
if (!isInternetReachable) return;
const attachment = await db.attachments.attachment(hash);
if (!attachment) return { failed: "Attachment not found." };
try {
const size = await getUploadedFileSize(hash);
if (size <= 0) return { failed: "File length is 0." };
console.log("File Size", size);
if (size === -1) return { success: true };
if (size === 0)
return {
failed: `File length is 0. Please upload this file again from the attachment manager. (File hash: ${hash})`
};
} catch (e) {
return { failed: e?.message };
}

View File

@@ -17,17 +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 } from "./download";
import {
clearFileStorage,
deleteFile,
exists,
readEncrypted,
writeEncryptedBase64,
hashBase64
hashBase64,
clearCache,
deleteCacheFileByName,
deleteCacheFileByPath,
bulkExists,
getCacheSize
} from "./io";
import { uploadFile } from "./upload";
import { cancelable } from "./utils";
import { cancelable, getUploadedFileSize } from "./utils";
export default {
readEncrypted,
@@ -39,5 +44,10 @@ export default {
exists,
clearFileStorage,
getUploadedFileSize,
checkAttachment
checkAttachment,
clearCache,
deleteCacheFileByName,
deleteCacheFileByPath,
bulkExists,
getCacheSize
};

View File

@@ -17,17 +17,17 @@ 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 { Platform } from "react-native";
import Sodium from "@ammarahmed/react-native-sodium";
import { Platform } from "react-native";
import RNFetchBlob from "react-native-blob-util";
import { cacheDir, cacheDirOld, getRandomId } from "./utils";
import { db } from "../database";
import { compressToBase64 } from "./compress";
import { eSendEvent } from "../../services/event-manager";
import { IOS_APPGROUPID } from "../../utils/constants";
import { DatabaseLogger, db } from "../database";
import { ABYTES, cacheDir, cacheDirOld, getRandomId } from "./utils";
export async function readEncrypted(filename, key, cipherData) {
await migrateFilesFromCache();
console.log("Read encrypted file...");
DatabaseLogger.log("Read encrypted file...");
let path = `${cacheDir}/${filename}`;
try {
@@ -35,10 +35,6 @@ export async function readEncrypted(filename, key, cipherData) {
return false;
}
const attachment = db.attachments.attachment(filename);
const isPng = /(png)/g.test(attachment?.metadata.type);
const isJpeg = /(jpeg|jpg)/g.test(attachment?.metadata.type);
console.log("decrypting....");
let output = await Sodium.decryptFile(
key,
{
@@ -46,25 +42,15 @@ export async function readEncrypted(filename, key, cipherData) {
hash: filename,
appGroupId: IOS_APPGROUPID
},
cipherData.outputType === "base64"
? isPng || isJpeg
? "cache"
: "base64"
: "text"
cipherData.outputType === "base64" ? "base64" : "text"
);
console.log("file decrypted...");
if (cipherData.outputType === "base64" && (isPng || isJpeg)) {
const dCachePath = `${cacheDir}/${output}`;
output = await compressToBase64(
`file://${dCachePath}`,
isPng ? "PNG" : "JPEG"
);
}
DatabaseLogger.log("File decrypted...");
return output;
} catch (e) {
RNFetchBlob.fs.unlink(path).catch(console.log);
console.log("readEncrypted", e);
DatabaseLogger.error(e);
return false;
}
}
@@ -81,7 +67,7 @@ export async function hashBase64(data) {
};
}
export async function writeEncryptedBase64({ data, key }) {
export async function writeEncryptedBase64(data, key) {
await createCacheDir();
let filepath = cacheDir + `/${getRandomId("imagecache_")}`;
await RNFetchBlob.fs.writeFile(filepath, data, "base64");
@@ -91,6 +77,8 @@ export async function writeEncryptedBase64({ data, key }) {
});
RNFetchBlob.fs.unlink(filepath).catch(console.log);
console.log("encrypted file output: ", output);
output.size = output.length;
delete output.length;
return {
...output,
alg: "xcha-stream"
@@ -138,9 +126,13 @@ export async function clearFileStorage() {
}
export async function createCacheDir() {
if (!(await RNFetchBlob.fs.exists(cacheDir))) {
await RNFetchBlob.fs.mkdir(cacheDir);
console.log("Cache directory created");
try {
if (!(await RNFetchBlob.fs.exists(cacheDir))) {
await RNFetchBlob.fs.mkdir(cacheDir);
DatabaseLogger.log("Cache directory created");
}
} catch (e) {
DatabaseLogger.error(e);
}
}
@@ -171,7 +163,35 @@ export async function migrateFilesFromCache() {
}
}
const ABYTES = 17;
export async function clearCache() {
await RNFetchBlob.fs.unlink(cacheDir).catch(console.log);
await createCacheDir();
eSendEvent("cache-cleared");
}
export async function deleteCacheFileByPath(path) {
await RNFetchBlob.fs.unlink(path).catch(console.log);
}
export async function deleteCacheFileByName(name) {
const iosAppGroup =
Platform.OS === "ios"
? await RNFetchBlob.fs.pathForAppGroup(IOS_APPGROUPID)
: null;
const appGroupPath = `${iosAppGroup}/${name}`;
await RNFetchBlob.fs.unlink(appGroupPath).catch(console.log);
await RNFetchBlob.fs.unlink(`${cacheDir}/${name}`).catch(console.log);
}
export async function deleteDCacheFiles() {
const files = await RNFetchBlob.fs.ls(cacheDir);
for (const file of files) {
if (file.includes("_dcache")) {
await RNFetchBlob.fs.unlink(file).catch(console.log);
}
}
}
export async function exists(filename) {
let path = `${cacheDir}/${filename}`;
@@ -190,16 +210,19 @@ export async function exists(filename) {
}
if (exists || existsInAppGroup) {
const attachment = db.attachments.attachment(filename);
const totalChunks = Math.ceil(attachment.length / attachment.chunkSize);
const attachment = await db.attachments.attachment(filename);
const totalChunks = Math.ceil(attachment.size / attachment.chunkSize);
const totalAbytes = totalChunks * ABYTES;
const expectedFileSize = attachment.length + totalAbytes;
const expectedFileSize = attachment.size + totalAbytes;
const stat = await RNFetchBlob.fs.stat(
existsInAppGroup ? appGroupPath : path
);
if (stat.size !== expectedFileSize) {
DatabaseLogger.log(
`File size mismatch: ${filename}, expected: ${expectedFileSize}, actual: ${stat.size}`
);
RNFetchBlob.fs
.unlink(existsInAppGroup ? appGroupPath : path)
.catch(console.log);
@@ -210,3 +233,37 @@ export async function exists(filename) {
}
return exists;
}
export async function bulkExists(files) {
try {
await createCacheDir();
const cacheFiles = await RNFetchBlob.fs.ls(cacheDir);
let missingFiles = files.filter((file) => !cacheFiles.includes(file));
if (Platform.OS === "ios") {
const iosAppGroup =
Platform.OS === "ios"
? await RNFetchBlob.fs.pathForAppGroup(IOS_APPGROUPID)
: null;
const appGroupFiles = await RNFetchBlob.fs.ls(iosAppGroup);
missingFiles = missingFiles.filter(
(file) => !appGroupFiles.includes(file)
);
}
return missingFiles;
} catch (e) {
DatabaseLogger.error(e);
return [];
}
}
export async function getCacheSize() {
await createCacheDir();
const stat = await RNFetchBlob.fs.lstat(`file://` + cacheDir);
let total = 0;
console.log("Total files", stat.length);
stat.forEach((s) => {
total += parseInt(s.size);
});
return total;
}

View File

@@ -17,43 +17,68 @@ 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 RNFetchBlob from "react-native-blob-util";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { DatabaseLogger, db } from "../database";
import { cacheDir } from "./utils";
import { isImage, isDocument } from "@notesnook/core/dist/utils/filename";
import { Platform } from "react-native";
import RNFetchBlob from "react-native-blob-util";
import { ToastManager } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { IOS_APPGROUPID } from "../../utils/constants";
import { DatabaseLogger, db } from "../database";
import { createCacheDir } from "./io";
import { cacheDir, checkUpload, getUploadedFileSize } from "./utils";
export async function uploadFile(filename, data, cancelToken) {
if (!data) return false;
let { url, headers } = data;
export async function uploadFile(filename, requestOptions, cancelToken) {
if (!requestOptions) return false;
let { url, headers } = requestOptions;
await createCacheDir();
DatabaseLogger.info(`Preparing to upload file: ${filename}`);
try {
let res = await fetch(url, {
let filePath = `${cacheDir}/${filename}`;
let exists = await RNFetchBlob.fs.exists(filePath);
// Check for file in appGroupPath if it doesn't exist in cacheDir
if (!exists && Platform.OS === "ios") {
const iosAppGroup =
Platform.OS === "ios"
? await RNFetchBlob.fs.pathForAppGroup(IOS_APPGROUPID)
: null;
const appGroupPath = `${iosAppGroup}/${filename}`;
filePath = appGroupPath;
exists = await RNFetchBlob.fs.exists(filePath);
}
if (!exists) {
throw new Error(
`Trying to upload file at path ${filePath} that doest not exist.`
);
}
const fileSize = (await RNFetchBlob.fs.stat(filePath)).size;
let remoteFileSize = await getUploadedFileSize(filename);
if (remoteFileSize === -1) return false;
if (remoteFileSize > 0 && remoteFileSize === fileSize) {
DatabaseLogger.log(`File ${filename} is already uploaded.`);
return true;
}
let uploadUrlResponse = await fetch(url, {
method: "PUT",
headers
});
if (!res.ok) throw new Error(`${res.status}: Unable to resolve upload url`);
const uploadUrl = await res.text();
if (!uploadUrl) throw new Error("Unable to resolve attachment upload url");
let uploadFilePath = `${cacheDir}/${filename}`;
const iosAppGroup =
Platform.OS === "ios"
? await RNFetchBlob.fs.pathForAppGroup(IOS_APPGROUPID)
: null;
const appGroupPath = `${iosAppGroup}/${filename}`;
let exists = await RNFetchBlob.fs.exists(uploadFilePath);
if (!exists && Platform.OS === "ios") {
uploadFilePath = appGroupPath;
const uploadUrl = uploadUrlResponse.ok
? await uploadUrlResponse.text()
: await uploadUrlResponse.json();
if (typeof uploadUrl !== "string") {
throw new Error(
uploadUrl.error || "Unable to resolve attachment upload url."
);
}
DatabaseLogger.info(`Starting upload: ${filename}`);
let request = RNFetchBlob.config({
let uploadRequest = RNFetchBlob.config({
IOSBackgroundTask: !globalThis["IS_SHARE_EXTENSION"]
})
.fetch(
@@ -62,7 +87,7 @@ export async function uploadFile(filename, data, cancelToken) {
{
"content-type": ""
},
RNFetchBlob.wrap(uploadFilePath)
RNFetchBlob.wrap(filePath)
)
.uploadProgress((sent, total) => {
useAttachmentStore
@@ -75,40 +100,33 @@ export async function uploadFile(filename, data, cancelToken) {
cancelToken.cancel = () => {
useAttachmentStore.getState().remove(filename);
request.cancel();
uploadRequest.cancel();
};
let response = await request;
let status = response.info().status;
let text = await response.text();
let result = status >= 200 && status < 300 && text.length === 0;
let uploadResponse = await uploadRequest;
let status = uploadResponse.info().status;
let uploaded = status >= 200 && status < 300;
useAttachmentStore.getState().remove(filename);
if (result) {
DatabaseLogger.info(
`File upload status: ${filename}, ${status}, ${text}`
);
let attachment = db.attachments.attachment(filename);
if (!attachment) return result;
if (
!isImage(attachment.metadata.type) &&
!isDocument(attachment.metadata?.type)
) {
RNFetchBlob.fs.unlink(`${cacheDir}/${filename}`).catch(console.log);
}
} else {
const fileInfo = await RNFetchBlob.fs.stat(uploadFilePath);
if (!uploaded) {
const fileInfo = await RNFetchBlob.fs.stat(filePath);
throw new Error(
`${status}, ${text}, name: ${fileInfo.filename}, length: ${
`${status}, name: ${fileInfo.filename}, length: ${
fileInfo.size
}, info: ${JSON.stringify(response.info())}`
}, info: ${JSON.stringify(uploadResponse.info())}`
);
}
return result;
const attachment = await db.attachments.attachment(filename);
await checkUpload(filename, requestOptions.chunkSize, attachment.size);
DatabaseLogger.info(`File upload status: ${filename}, ${status}`);
return uploaded;
} catch (e) {
useAttachmentStore.getState().remove(filename);
DatabaseLogger.info(`File upload error: ${filename}, ${e}`);
DatabaseLogger.error(e);
ToastManager.error(e, "File upload failed");
DatabaseLogger.error(e, "File upload failed", {
filename
});
return false;
}
}

View File

@@ -17,10 +17,13 @@ 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 * as ScopedStorage from "react-native-scoped-storage";
import { Platform } from "react-native";
import RNFetchBlob from "react-native-blob-util";
import * as ScopedStorage from "react-native-scoped-storage";
import { DatabaseLogger, db } from "../database";
import { hosts } from "@notesnook/core";
export const ABYTES = 17;
export const cacheDirOld = RNFetchBlob.fs.dirs.CacheDir;
export const cacheDir =
@@ -34,24 +37,36 @@ export function getRandomId(prefix) {
.replace("0.", prefix || "");
}
export function extractValueFromXmlTag(code, xml) {
if (!xml.includes(code)) return `Unknown ${code}`;
return xml.slice(
xml.indexOf(`<${code}>`) + code.length + 2,
xml.indexOf(`</${code}>`)
);
}
/**
*
* @param {string | undefined} data
* @returns
*/
export function parseS3Error(data) {
const xml = typeof data === "string" ? data : null;
export async function fileCheck(response, totalSize) {
if (totalSize < 1000) {
let text = await response.text();
if (text.startsWith("<?xml")) {
let errorJson = {
Code: extractValueFromXmlTag("Code", text),
Message: extractValueFromXmlTag("Message", text)
};
throw new Error(`${errorJson.Code}: ${errorJson.Message}`);
const error = {
Code: "UNKNOWN",
Message: xml
};
try {
if (!xml) return error;
const doc = new DOMParser().parseFromString(xml, "text/xml");
const ErrorElement = doc.getElementsByTagName("Error")[0];
if (!ErrorElement) return error;
for (const child of ErrorElement.children) {
if (
child.textContent &&
(child.tagName === "Code" || child.tagName === "Message")
)
error[child.tagName] = child.textContent;
}
return error;
} catch (e) {
return error;
}
}
@@ -59,12 +74,11 @@ export function cancelable(operation) {
const cancelToken = {
cancel: () => {}
};
return (filename, { url, headers }) => {
return (filename, requestOptions) => {
return {
execute: () => operation(filename, { url, headers }, cancelToken),
execute: () => operation(filename, requestOptions, cancelToken),
cancel: async () => {
await cancelToken.cancel();
RNFetchBlob.fs.unlink(`${cacheDir}/${filename}`).catch(console.log);
}
};
};
@@ -91,3 +105,36 @@ export async function releasePermissions(path) {
}
}
}
export async function getUploadedFileSize(hash) {
try {
const url = `${hosts.API_HOST}/s3?name=${hash}`;
const token = await db.tokenManager.getAccessToken();
const attachmentInfo = await fetch(url, {
method: "HEAD",
headers: { Authorization: `Bearer ${token}` }
});
const contentLength = parseInt(
attachmentInfo.headers?.get("content-length")
);
return isNaN(contentLength) ? 0 : contentLength;
} catch (e) {
DatabaseLogger.error(e);
return -1;
}
}
export async function checkUpload(filename, chunkSize, expectedSize) {
const size = await getUploadedFileSize(filename);
const totalChunks = Math.ceil(size / chunkSize);
const decryptedLength = size - totalChunks * ABYTES;
const error =
size === 0
? `File size is 0.`
: size === -1
? `File verification check failed.`
: expectedSize !== decryptedLength
? `File size mismatch. Expected ${size} bytes but got ${decryptedLength} bytes.`
: undefined;
if (error) throw new Error(error);
}

View File

@@ -17,18 +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 React from "react";
import { FlatList, View } from "react-native";
import { useSelectionStore } from "../../stores/use-selection-store";
import { useMessageStore } from "../../stores/use-message-store";
import { useThemeColors } from "@notesnook/theme";
import React from "react";
import { View } from "react-native";
import { useMessageStore } from "../../stores/use-message-store";
import { useSelectionStore } from "../../stores/use-selection-store";
import { allowedOnPlatform, renderItem } from "./functions";
import { getContainerBorder } from "../../utils/colors";
export const Announcement = ({ color }) => {
const { colors } = useThemeColors();
const announcements = useMessageStore((state) => state.announcements);
let announcement = announcements.length > 0 ? announcements[0] : null;
const selectionMode = useSelectionStore((state) => state.selectionMode);
return !announcement || selectionMode ? null : (
<View
style={{
@@ -45,7 +47,8 @@ export const Announcement = ({ color }) => {
borderRadius: 10,
overflow: "hidden",
backgroundColor: colors.secondary.background,
paddingBottom: 12
paddingBottom: 12,
...getContainerBorder(colors.secondary.background)
}}
>
<View

View File

@@ -20,15 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react";
import { Linking, View } from "react-native";
//import SettingsBackupAndRestore from '../../screens/settings/backup-restore';
import { eSendEvent, presentSheet } from "../../services/event-manager";
import Sync from "../../services/sync";
import { useThemeColors } from "@notesnook/theme";
import { eCloseAnnouncementDialog, eCloseSheet } from "../../utils/events";
import { eSendEvent, presentSheet } from "../../services/event-manager";
import { eCloseAnnouncementDialog } from "../../utils/events";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import { PricingPlans } from "../premium/pricing-plans";
import SheetProvider from "../sheet-provider";
import { Progress } from "../sheets/progress";
import { Button } from "../ui/button";
import { allowedOnPlatform, getStyle } from "./functions";
@@ -56,13 +54,6 @@ export const Cta = ({ actions, style = {}, color, inline }) => {
/>
)
});
} else if (item.type === "force-sync") {
eSendEvent(eCloseSheet);
await sleep(300);
Progress.present();
Sync.run("global", true, true, () => {
eSendEvent(eCloseSheet);
});
}
};
return (
@@ -103,7 +94,7 @@ export const Cta = ({ actions, style = {}, color, inline }) => {
key={item.title}
title={item.title}
fontSize={SIZE.sm}
type="gray"
type="plain"
onPress={() => onPress(item)}
width={null}
height={30}
@@ -149,7 +140,7 @@ export const Cta = ({ actions, style = {}, color, inline }) => {
key={item.title}
title={item.title}
fontSize={SIZE.xs}
type="gray"
type="plain"
onPress={() => onPress(item)}
width={null}
height={30}

View File

@@ -34,10 +34,69 @@ import BaseDialog from "../dialog/base-dialog";
import { allowedOnPlatform, renderItem } from "./functions";
import { useCallback } from "react";
/**
* Test announcement
* {
id: "some-announcement",
type: "dialog",
body: [
{
type: "title",
text: "This is a title",
platforms: ["all"]
},
{
type: "description",
text: "Most of you are too busy to keep up to date with what's happening in Notesnook. That is unfortunate because Notesnook has come a looooong way.",
style: {
marginBottom: 1
},
platforms: ["all"]
},
{
type: "description",
text: "To solve this, we are launching the Notesnook Digest — a newsletter to help you stay updated about Notesnook development. And to keep things interesting I'll also sprinkle this newsletter with other interesting stuff like privacy tips & news, interesting books, things I am looking forward to etc.",
style: {
marginBottom: 1
},
platforms: ["all"]
},
{
type: "description",
text: "So be sure to subscribe. There won't be a proper schedule to this (yet) maybe once or twice a month. I promise no spam — only more awesomeness.",
style: {
marginBottom: 1
},
platforms: ["all"]
},
{
type: "description",
text: "— May privacy reign.",
style: {
marginBottom: 1
},
platforms: ["all"]
},
{
type: "callToActions",
actions: [
{
type: "promo",
title: "15% Off",
platforms: ["android"],
data: "com.streetwriters.notesnook.sub.yr.15"
}
],
platforms: ["all"]
}
]
}
*/
export const AnnouncementDialog = () => {
const { colors } = useThemeColors();
const [visible, setVisible] = useState(false);
const [info, setInfo] = useState(null);
const [info, setInfo] = useState();
const remove = useMessageStore((state) => state.remove);
useEffect(() => {
@@ -51,7 +110,9 @@ export const AnnouncementDialog = () => {
const open = (data) => {
setInfo(data);
setVisible(true);
setImmediate(() => {
setVisible(true);
});
};
const close = useCallback(() => {

View File

@@ -54,7 +54,7 @@ export const Title = ({ text, style = {}, inline }) => {
</Heading>
<Button
type="gray"
type="plain"
icon="close"
height={null}
onPress={() => {

View File

@@ -1,215 +0,0 @@
/*
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 React, { useCallback, useEffect, useRef } from "react";
import { Platform, View } from "react-native";
import { enabled } from "react-native-privacy-snapshot";
import { db } from "../../common/database";
import { useAppState } from "../../hooks/use-app-state";
import BiometricService from "../../services/biometrics";
import { useSettingStore } from "../../stores/use-setting-store";
import { useThemeColors } from "@notesnook/theme";
import { useUserStore } from "../../stores/use-user-store";
import { NotesnookModule } from "../../utils/notesnook-module";
import { SIZE } from "../../utils/size";
import { Button } from "../ui/button";
import { IconButton } from "../ui/icon-button";
import Input from "../ui/input";
import Seperator from "../ui/seperator";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
const AppLockedOverlay = () => {
const { colors } = useThemeColors();
const user = useUserStore((state) => state.user);
const appLocked = useUserStore((state) => state.appLocked);
const lockApp = useUserStore((state) => state.lockApp);
const deviceMode = useSettingStore((state) => state.deviceMode);
const passwordInputRef = useRef();
const password = useRef();
const appState = useAppState();
const biometricUnlockAwaitingUserInput = useRef(false);
const onUnlockAppRequested = useCallback(async () => {
if (!(await BiometricService.isBiometryAvailable())) return;
if (Platform.OS === "android") {
const activityName = await NotesnookModule.getActivityName();
if (activityName !== "MainActivity") return;
}
useSettingStore.getState().setRequestBiometrics(true);
let unlocked = await BiometricService.validateUser(
"Unlock to access your notes",
""
);
if (unlocked) {
lockApp(false);
enabled(false);
password.current = null;
}
setTimeout(() => {
biometricUnlockAwaitingUserInput.current = false;
useSettingStore.getState().setRequestBiometrics(false);
}, 1);
}, [lockApp]);
const onSubmit = async () => {
if (!password.current) return;
try {
let unlocked = await db.user.verifyPassword(password.current);
if (unlocked) {
lockApp(false);
enabled(false);
password.current = null;
}
} catch (e) {
console.error(e);
}
};
useEffect(() => {
if (
biometricUnlockAwaitingUserInput.current ||
useUserStore.getState().disableAppLockRequests
)
return;
if (appLocked && appState === "active") {
biometricUnlockAwaitingUserInput.current = true;
onUnlockAppRequested();
}
}, [appState, onUnlockAppRequested, appLocked]);
return (
appLocked && (
<View
style={{
backgroundColor: colors.primary.background,
width: "100%",
height: "100%",
position: "absolute",
zIndex: 999,
justifyContent: "center"
}}
>
<View
style={{
flex: 1,
justifyContent: "center",
width:
deviceMode !== "mobile"
? "50%"
: Platform.OS == "ios"
? "95%"
: "100%",
paddingHorizontal: 12,
marginBottom: 30,
marginTop: 15,
alignSelf: "center"
}}
>
<IconButton
name="fingerprint"
size={100}
customStyle={{
width: 100,
height: 100,
marginBottom: 20,
marginTop: user ? 0 : 50
}}
onPress={onUnlockAppRequested}
color={colors.primary.border}
/>
<Heading
color={colors.primary.heading}
style={{
alignSelf: "center",
textAlign: "center"
}}
>
Unlock your notes
</Heading>
<Paragraph
style={{
alignSelf: "center",
textAlign: "center",
maxWidth: "90%"
}}
>
{"Please verify it's you"}
</Paragraph>
<Seperator />
<View
style={{
width: "100%",
padding: 12,
backgroundColor: colors.primary.background
}}
>
{user ? (
<>
<Input
fwdRef={passwordInputRef}
secureTextEntry
placeholder="Enter account password"
onChangeText={(v) => (password.current = v)}
onSubmit={onSubmit}
/>
</>
) : null}
<View
style={{
marginTop: user ? 25 : 25
}}
>
{user ? (
<>
<Button
title="Continue"
type="accent"
onPress={onSubmit}
width={250}
height={45}
style={{
borderRadius: 150,
marginBottom: 10
}}
fontSize={SIZE.md}
/>
</>
) : null}
<Button
title="Unlock with Biometrics"
width={250}
onPress={onUnlockAppRequested}
icon={"fingerprint"}
type="transparent"
/>
</View>
</View>
</View>
</View>
)
);
};
export default AppLockedOverlay;

View File

@@ -0,0 +1,335 @@
/*
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 React, { useCallback, useEffect, useRef } from "react";
import {
AppStateStatus,
Platform,
TextInput,
useWindowDimensions,
View
} from "react-native";
//@ts-ignore
import { useThemeColors } from "@notesnook/theme";
import { DatabaseLogger } from "../../common/database";
import {
decrypt,
encrypt,
getCryptoKey,
getDatabaseKey,
setAppLockVerificationCipher,
validateAppLockPassword
} from "../../common/database/encryption";
import { MMKV } from "../../common/database/mmkv";
import { useAppState } from "../../hooks/use-app-state";
import BiometricService from "../../services/biometrics";
import { ToastManager } from "../../services/event-manager";
import SettingsService from "../../services/settings";
import { useSettingStore } from "../../stores/use-setting-store";
import { useUserStore } from "../../stores/use-user-store";
import { NotesnookModule } from "../../utils/notesnook-module";
import { SIZE } from "../../utils/size";
import { Toast } from "../toast";
import { Button } from "../ui/button";
import { IconButton } from "../ui/icon-button";
import Input from "../ui/input";
import Seperator from "../ui/seperator";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { strings } from "@notesnook/intl";
const getUser = () => {
const user = MMKV.getString("user");
if (user) {
return JSON.parse(user);
}
};
const verifyUserPassword = async (password: string) => {
try {
await getDatabaseKey();
const key = await getCryptoKey();
const user = getUser();
const cipher = await encrypt(
{
key: key,
salt: user.salt
},
"notesnook"
);
const plainText = await decrypt({ password }, cipher);
return plainText === "notesnook";
} catch (e) {
DatabaseLogger.error(e as Error);
return false;
}
};
const AppLockedOverlay = () => {
const initialLaunchBiometricRequest = useRef(true);
const { colors } = useThemeColors();
const user = getUser();
const appLocked = useUserStore((state) => state.appLocked);
const lockApp = useUserStore((state) => state.lockApp);
const deviceMode = useSettingStore((state) => state.deviceMode);
const passwordInputRef = useRef<TextInput>(null);
const password = useRef<string>();
const appState = useAppState();
const lastAppState = useRef<AppStateStatus>(appState);
const biometricUnlockAwaitingUserInput = useRef(false);
const { height } = useWindowDimensions();
const keyboardType = useSettingStore(
(state) => state.settings.applockKeyboardType
);
const appLockHasPasswordSecurity = useSettingStore(
(state) => state.settings.appLockHasPasswordSecurity
);
const biometricsAuthEnabled = useSettingStore(
(state) =>
state.settings.biometricsAuthEnabled === true ||
(state.settings.biometricsAuthEnabled === undefined &&
!state.settings.appLockHasPasswordSecurity)
);
const onUnlockAppRequested = useCallback(async () => {
if (
!biometricsAuthEnabled ||
!(await BiometricService.isBiometryAvailable())
)
return;
biometricUnlockAwaitingUserInput.current = true;
if (Platform.OS === "android") {
const activityName = await NotesnookModule.getActivityName();
if (activityName !== "MainActivity") return;
}
useSettingStore.getState().setRequestBiometrics(true);
const unlocked = await BiometricService.validateUser(
"Unlock to access your notes",
""
);
if (unlocked) {
lockApp(false);
password.current = undefined;
}
biometricUnlockAwaitingUserInput.current = false;
setTimeout(() => {
if (biometricUnlockAwaitingUserInput.current) return;
useSettingStore.getState().setRequestBiometrics(false);
}, 500);
}, [biometricsAuthEnabled, lockApp]);
const onSubmit = async () => {
if (!password.current) return;
try {
const unlocked = appLockHasPasswordSecurity
? await validateAppLockPassword(password.current)
: await verifyUserPassword(password.current);
if (unlocked) {
if (!appLockHasPasswordSecurity) {
await setAppLockVerificationCipher(password.current);
SettingsService.set({
appLockHasPasswordSecurity: true,
applockKeyboardType: "default"
});
DatabaseLogger.info("App lock migrated to password security");
}
lockApp(false);
password.current = undefined;
} else {
ToastManager.show({
heading: strings.invalid(keyboardType),
type: "error",
context: "local"
});
}
} catch (e) {
console.error(e);
}
};
useEffect(() => {
const prevState = lastAppState.current;
lastAppState.current = appState;
if (
appState === "active" &&
(prevState === "background" || initialLaunchBiometricRequest.current)
) {
if (SettingsService.shouldLockAppOnEnterForeground()) {
DatabaseLogger.info("Locking app on entering foreground");
useUserStore.getState().lockApp(true);
}
if (
!(
biometricUnlockAwaitingUserInput.current ||
useUserStore.getState().disableAppLockRequests ||
!appLocked ||
useSettingStore.getState().requestBiometrics ||
useSettingStore.getState().appDidEnterBackgroundForAction
)
) {
initialLaunchBiometricRequest.current = false;
DatabaseLogger.info("Biometric unlock request");
onUnlockAppRequested();
}
} else {
SettingsService.appEnteredBackground();
}
}, [appState, onUnlockAppRequested, appLocked]);
return appLocked ? (
<KeyboardAwareScrollView
style={{
backgroundColor: colors.primary.background,
width: "100%",
height: "100%",
position: "absolute",
zIndex: 999
}}
contentContainerStyle={{
justifyContent: "center",
minHeight: height
}}
keyboardDismissMode="interactive"
keyboardShouldPersistTaps="handled"
>
<Toast context="local" />
<View
style={{
flex: 1,
justifyContent: "center",
width:
deviceMode !== "mobile"
? "50%"
: Platform.OS == "ios"
? "95%"
: "100%",
paddingHorizontal: 12,
marginBottom: 30,
marginTop: 15,
alignSelf: "center"
}}
>
<IconButton
name="fingerprint"
size={100}
style={{
width: 100,
height: 100,
marginBottom: 20,
marginTop: user ? 0 : 50
}}
onPress={onUnlockAppRequested}
color={colors.primary.border}
/>
<Heading
color={colors.primary.heading}
style={{
alignSelf: "center",
textAlign: "center"
}}
>
{strings.unlockNotes()}
</Heading>
<Paragraph
style={{
alignSelf: "center",
textAlign: "center",
maxWidth: "90%"
}}
>
{strings.verifyItsYou()}
</Paragraph>
<Seperator />
<View
style={{
width: "100%",
padding: 12,
backgroundColor: colors.primary.background
}}
>
{user || appLockHasPasswordSecurity ? (
<>
<Input
fwdRef={passwordInputRef}
secureTextEntry
keyboardType={
appLockHasPasswordSecurity ? keyboardType : "default"
}
placeholder={
appLockHasPasswordSecurity
? keyboardType === "numeric"
? strings.enterApplockPassword()
: strings.enterApplockPin()
: strings.enterAccountPassword()
}
onChangeText={(v) => (password.current = v)}
onSubmit={() => {
onSubmit();
}}
/>
</>
) : null}
<View
style={{
marginTop: user ? 25 : 25
}}
>
{user || appLockHasPasswordSecurity ? (
<>
<Button
title={strings.continue()}
type="accent"
onPress={onSubmit}
width={250}
height={45}
style={{
borderRadius: 150,
marginBottom: 10
}}
fontSize={SIZE.md}
/>
</>
) : null}
{biometricsAuthEnabled ? (
<Button
title={strings.unlockWithBiometrics()}
width={250}
onPress={onUnlockAppRequested}
icon={"fingerprint"}
type="transparent"
/>
) : null}
</View>
</View>
</View>
</KeyboardAwareScrollView>
) : null;
};
export default AppLockedOverlay;

View File

@@ -17,67 +17,88 @@ 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 { formatBytes } from "@notesnook/common";
import { Attachment, Note, VirtualizedGrouping } from "@notesnook/core";
import { useThemeColors } from "@notesnook/theme";
import Clipboard from "@react-native-clipboard/clipboard";
import React, { useCallback, useEffect, useState } from "react";
import React, { RefObject, useEffect, useState } from "react";
import { View } from "react-native";
import { ActionSheetRef } from "react-native-actions-sheet";
import { ScrollView } from "react-native-gesture-handler";
import { db } from "../../common/database";
import filesystem from "../../common/filesystem";
import downloadAttachment from "../../common/filesystem/download-attachment";
import { useAttachmentProgress } from "../../hooks/use-attachment-progress";
import picker from "../../screens/editor/tiptap/picker";
import { useTabStore } from "../../screens/editor/tiptap/use-tab-store";
import { editorController } from "../../screens/editor/tiptap/utils";
import {
ToastManager,
eSendEvent,
presentSheet,
ToastEvent
presentSheet
} from "../../services/event-manager";
import PremiumService from "../../services/premium";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { useThemeColors } from "@notesnook/theme";
import { eCloseAttachmentDialog, eCloseSheet } from "../../utils/events";
import {
eCloseAttachmentDialog,
eCloseSheet,
eDBItemUpdate,
eOnLoadNote
} from "../../utils/events";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import { Dialog } from "../dialog";
import { presentDialog } from "../dialog/functions";
import { openNote } from "../list-items/note/wrapper";
import { DateMeta } from "../properties/date-meta";
import SheetProvider from "../sheet-provider";
import { Button } from "../ui/button";
import { Notice } from "../ui/notice";
import { PressableButton } from "../ui/pressable";
import { Pressable } from "../ui/pressable";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { formatBytes } from "@notesnook/common";
import { strings } from "@notesnook/intl";
const Actions = ({ attachment, setAttachments, fwdRef }) => {
const Actions = ({
attachment,
close,
setAttachments,
fwdRef
}: {
attachment: Attachment;
setAttachments: (attachments?: VirtualizedGrouping<Attachment>) => void;
close?: () => void;
fwdRef: RefObject<ActionSheetRef>;
}) => {
const { colors } = useThemeColors();
const contextId = attachment.metadata.hash;
const [filename, setFilename] = useState(attachment.metadata.filename);
const contextId = attachment.hash;
const [filename, setFilename] = useState(attachment.filename);
const [currentProgress] = useAttachmentProgress(attachment);
const [failed, setFailed] = useState(attachment.failed);
const [notes, setNotes] = useState([]);
const [loading, setLoading] = useState({
name: null
});
const [failed, setFailed] = useState<string | undefined>(attachment.failed);
const [notes, setNotes] = useState<Note[]>([]);
const [loading, setLoading] = useState<{
name?: string;
}>({});
const actions = [
{
name: "Download",
name: strings.network.download(),
onPress: async () => {
if (currentProgress) {
await db.fs.cancel(attachment.metadata.hash, "download");
useAttachmentStore.getState().remove(attachment.metadata.hash);
await db.fs().cancel(attachment.hash);
useAttachmentStore.getState().remove(attachment.hash);
}
downloadAttachment(attachment.metadata.hash, false);
eSendEvent(eCloseSheet, contextId);
downloadAttachment(attachment.hash, false);
fwdRef.current?.hide();
},
icon: "download"
},
{
name: "Reupload",
name: strings.network.reupload(),
onPress: async () => {
if (!PremiumService.get()) {
ToastEvent.show({
heading: "Upgrade to pro",
ToastManager.show({
heading: strings.upgradeToPro(),
type: "error",
context: "local"
});
@@ -85,100 +106,108 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
}
await picker.pick({
reupload: true,
hash: attachment.metadata.hash,
hash: attachment.hash,
context: contextId,
type: attachment.metadata.type
type: attachment.mimeType.startsWith("image") ? "image" : "file"
});
},
icon: "upload"
},
{
name: "Run file check",
name: strings.fileCheck(),
onPress: async () => {
setLoading({
name: "Run file check"
name: strings.fileCheck()
});
let res = await filesystem.checkAttachment(attachment.metadata.hash);
if (res.failed) {
db.attachments.markAsFailed(attachment.id, res.failed);
setFailed(res.failed);
ToastEvent.show({
heading: "File check failed with error: " + res.failed,
const result = await filesystem.checkAttachment(attachment.hash);
if (!result) return;
if (result.failed) {
db.attachments.markAsFailed(attachment.id, result.failed);
setFailed(result.failed);
ToastManager.show({
heading: strings.fileCheckFailed(result.failed),
type: "error",
context: "local"
});
} else {
setFailed(null);
db.attachments.markAsFailed(attachment.id, null);
ToastEvent.show({
heading: "File check passed",
setFailed(undefined);
db.attachments.markAsFailed(attachment.id);
eSendEvent(eDBItemUpdate, attachment.id);
ToastManager.show({
heading: strings.fileCheckPassed(),
type: "success",
context: "local"
});
}
setAttachments([...db.attachments.all]);
setAttachments();
setLoading({
name: null
name: undefined
});
},
icon: "file-check"
},
{
name: "Rename",
name: strings.rename(),
onPress: () => {
presentDialog({
context: contextId,
input: true,
title: "Rename file",
paragraph: "Enter a new name for the file",
defaultValue: attachment.metadata.filename,
title: strings.renameFile(),
defaultValue: attachment.filename,
positivePress: async (value) => {
if (value && value.length > 0) {
await db.attachments.add({
hash: attachment.metadata.hash,
hash: attachment.hash,
filename: value
});
setFilename(value);
setAttachments([...db.attachments.all]);
setAttachments();
eSendEvent(eDBItemUpdate, attachment.id);
}
},
positiveText: "Rename"
positiveText: strings.rename()
});
},
icon: "form-textbox"
},
{
name: "Delete",
name: strings.delete(),
onPress: async () => {
await db.attachments.remove(attachment.metadata.hash, false);
setAttachments([...db.attachments.all]);
eSendEvent(eCloseSheet, contextId);
const relations = await db.relations.to(attachment, "note").get();
await db.attachments.remove(attachment.hash, false);
setAttachments();
eSendEvent(eDBItemUpdate, attachment.id);
relations
.map((relation) => relation.fromId)
.forEach(async (id) => {
const tab = useTabStore.getState().getTabForNote(id);
if (tab !== undefined) {
const isFocused = useTabStore.getState().currentTab === tab;
if (isFocused) {
eSendEvent(eOnLoadNote, {
item: await db.notes.note(id),
forced: true
});
} else {
editorController.current.commands.setLoading(true, tab);
}
}
});
close?.();
},
icon: "delete-outline"
}
];
const getNotes = useCallback(() => {
let allNotes = db.notes.all;
let attachmentNotes = attachment.noteIds?.map((id) => {
let index = allNotes?.findIndex((note) => id === note.id);
if (index !== -1) {
return allNotes[index];
} else {
return {
type: "notfound",
title: `Note with id ${id} does not exist.`,
id: id
};
}
});
return attachmentNotes;
}, [attachment.noteIds]);
useEffect(() => {
setNotes(getNotes());
}, [attachment, getNotes]);
db.relations
.to(attachment, "note")
.selector.items()
.then((items) => {
setNotes(items);
});
}, [attachment]);
return (
<ScrollView
@@ -189,12 +218,14 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
style={{
maxHeight: "100%"
}}
keyboardShouldPersistTaps="never"
>
<Dialog context={contextId} />
<SheetProvider context={contextId} />
<View
style={{
borderBottomWidth: 1,
borderBottomColor: colors.secondary.background,
borderBottomColor: colors.primary.border,
marginBottom: notes && notes.length > 0 ? 0 : 12
}}
>
@@ -211,53 +242,36 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
style={{
flexDirection: "row",
marginBottom: 10,
paddingHorizontal: 12
paddingHorizontal: 12,
marginTop: 6,
gap: 10
}}
>
<Paragraph
size={SIZE.xs}
style={{
marginRight: 10
}}
color={colors.secondary.paragraph}
>
{attachment.metadata.type}
<Paragraph size={SIZE.xs} color={colors.secondary.paragraph}>
{attachment.mimeType}
</Paragraph>
<Paragraph
style={{
marginRight: 10
}}
size={SIZE.xs}
color={colors.secondary.paragraph}
>
{formatBytes(attachment.length)}
<Paragraph size={SIZE.xs} color={colors.secondary.paragraph}>
{formatBytes(attachment.size)}
</Paragraph>
{attachment.noteIds ? (
<Paragraph
style={{
marginRight: 10
}}
size={SIZE.xs}
color={colors.secondary.paragraph}
>
{attachment.noteIds.length} note
{attachment.noteIds.length > 1 ? "s" : ""}
{notes.length ? (
<Paragraph size={SIZE.xs} color={colors.secondary.paragraph}>
{strings.notes(notes.length)}
</Paragraph>
) : null}
<Paragraph
onPress={() => {
Clipboard.setString(attachment.metadata.hash);
ToastEvent.show({
Clipboard.setString(attachment.hash);
ToastManager.show({
type: "success",
heading: "Attachment hash copied",
heading: strings.hashCopied(),
context: "local"
});
}}
size={SIZE.xs}
color={colors.secondary.paragraph}
>
{attachment.metadata.hash}
{attachment.hash}
</Paragraph>
</View>
@@ -268,7 +282,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
<View
style={{
borderBottomWidth: 1,
borderBottomColor: colors.secondary.background,
borderBottomColor: colors.primary.border,
marginBottom: 12,
paddingVertical: 12
}}
@@ -280,29 +294,19 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
}}
size={SIZE.sm}
>
List of notes:
{strings.listOf()} {strings.dataTypesPlural.note()}:
</Heading>
{notes.map((item) => (
<PressableButton
<Pressable
onPress={async () => {
if (item.type === "notfound") {
ToastEvent.show({
heading: "Note not found",
message:
"A note with the given id was not found. Maybe you have deleted the note or moved it to trash already.",
type: "error",
context: "local"
});
return;
}
eSendEvent(eCloseSheet, contextId);
await sleep(150);
eSendEvent(eCloseAttachmentDialog);
await sleep(300);
openNote(item, item.type === "trash");
openNote(item, (item as any).type === "trash");
}}
customStyle={{
style={{
paddingVertical: 12,
alignItems: "flex-start",
@@ -311,7 +315,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
key={item.id}
>
<Paragraph size={SIZE.xs}>{item.title}</Paragraph>
</PressableButton>
</Pressable>
))}
</>
</View>
@@ -321,17 +325,16 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
<Button
key={item.name}
buttonType={{
text: item.on
? colors.primary.accent
: item.name === "Delete" || item.name === "PermDelete"
? colors.error.paragraph
: colors.primary.paragraph
text:
item.name === "Delete"
? colors.error.paragraph
: colors.primary.paragraph
}}
onPress={item.onPress}
title={item.name}
icon={item.icon}
loading={loading?.name === item.name}
type={item.on ? "shade" : "gray"}
type="plain"
fontSize={SIZE.sm}
style={{
borderRadius: 0,
@@ -350,7 +353,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
{failed ? (
<Notice
type="alert"
text={`File check failed with error: ${attachment.failed} Try reuploading the file to fix the issue.`}
text={strings.fileCheckFailed(failed)}
size="small"
/>
) : null}
@@ -359,11 +362,20 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
);
};
Actions.present = (attachment, set, context) => {
Actions.present = (
attachment: Attachment,
set: (attachments?: VirtualizedGrouping<Attachment>) => void,
context?: string
) => {
presentSheet({
context: context,
component: (ref) => (
<Actions fwdRef={ref} setAttachments={set} attachment={attachment} />
component: (ref, close) => (
<Actions
fwdRef={ref}
setAttachments={set}
close={close}
attachment={attachment}
/>
)
});
};

View File

@@ -1,171 +0,0 @@
/*
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 { formatBytes } from "@notesnook/common";
import React from "react";
import { TouchableOpacity, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { db } from "../../common/database";
import { useAttachmentProgress } from "../../hooks/use-attachment-progress";
import { useThemeColors } from "@notesnook/theme";
import { SIZE } from "../../utils/size";
import { IconButton } from "../ui/icon-button";
import { ProgressCircleComponent } from "../ui/svg/lazy";
import Paragraph from "../ui/typography/paragraph";
import Actions from "./actions";
function getFileExtension(filename) {
var ext = /^.+\.([^.]+)$/.exec(filename);
return ext == null ? "" : ext[1];
}
export const AttachmentItem = ({
attachment,
encryption,
setAttachments,
pressable = true,
hideWhenNotDownloading,
context
}) => {
const { colors } = useThemeColors();
const [currentProgress, setCurrentProgress] = useAttachmentProgress(
attachment,
encryption
);
const onPress = () => {
if (!pressable) return;
Actions.present(attachment, setAttachments, context);
};
return hideWhenNotDownloading &&
(!currentProgress || !currentProgress.value) ? null : (
<TouchableOpacity
activeOpacity={0.9}
onPress={onPress}
style={{
flexDirection: "row",
marginVertical: 5,
justifyContent: "space-between",
padding: 12,
paddingVertical: 6,
borderRadius: 5,
backgroundColor: colors.secondary.background
}}
type="grayBg"
>
<View
style={{
flexShrink: 1,
flexDirection: "row",
alignItems: "center"
}}
>
<View
style={{
justifyContent: "center",
alignItems: "center",
marginLeft: -5
}}
>
<Icon name="file" size={SIZE.xxxl} color={colors.primary.icon} />
<Paragraph
adjustsFontSizeToFit
size={6}
color={colors.static.white}
style={{
position: "absolute"
}}
>
{getFileExtension(attachment.metadata.filename).toUpperCase()}
</Paragraph>
</View>
<View
style={{
flexShrink: 1,
marginLeft: 10
}}
>
<Paragraph
size={SIZE.sm - 1}
style={{
flexWrap: "wrap",
marginBottom: 2.5
}}
numberOfLines={1}
lineBreakMode="middle"
color={colors.primary.paragraph}
>
{attachment.metadata.filename}
</Paragraph>
{!hideWhenNotDownloading ? (
<Paragraph color={colors.secondary.paragraph} size={SIZE.xs}>
{formatBytes(attachment.length)}{" "}
{currentProgress?.type
? "(" + currentProgress.type + "ing - tap to cancel)"
: ""}
</Paragraph>
) : null}
</View>
</View>
{currentProgress ? (
<TouchableOpacity
activeOpacity={0.9}
onPress={() => {
if (encryption || !pressable) return;
db.fs.cancel(attachment.metadata.hash, currentProgress.type);
setCurrentProgress(null);
}}
style={{
justifyContent: "center",
marginLeft: 5,
marginTop: 5,
marginRight: -5
}}
>
<ProgressCircleComponent
size={SIZE.xxl}
progress={currentProgress?.value ? currentProgress?.value / 100 : 0}
showsText
textStyle={{
fontSize: 10
}}
color={colors.primary.accent}
formatText={(progress) => (progress * 100).toFixed(0)}
borderWidth={0}
thickness={2}
/>
</TouchableOpacity>
) : (
<>
{attachment.failed ? (
<IconButton
onPress={onPress}
name="alert-circle-outline"
color={colors.error.paragraph}
/>
) : null}
</>
)}
</TouchableOpacity>
);
};

View File

@@ -0,0 +1,191 @@
/*
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 { formatBytes } from "@notesnook/common";
import { Attachment, VirtualizedGrouping } from "@notesnook/core";
import { useThemeColors } from "@notesnook/theme";
import React from "react";
import { TouchableOpacity, View } from "react-native";
import { db } from "../../common/database";
import { useAttachmentProgress } from "../../hooks/use-attachment-progress";
import { useDBItem } from "../../hooks/use-db-item";
import { SIZE } from "../../utils/size";
import { IconButton } from "../ui/icon-button";
import { ProgressCircleComponent } from "../ui/svg/lazy";
import Paragraph from "../ui/typography/paragraph";
import Actions from "./actions";
import { strings } from "@notesnook/intl";
function getFileExtension(filename: string) {
const ext = /^.+\.([^.]+)$/.exec(filename);
return ext == null ? "" : ext[1];
}
export const AttachmentItem = ({
id,
attachments,
encryption,
setAttachments,
pressable = true,
hideWhenNotDownloading,
context,
errorOnly
}: {
id: string | number;
attachments?: VirtualizedGrouping<Attachment>;
encryption?: boolean;
setAttachments: (attachments: any) => void;
pressable?: boolean;
hideWhenNotDownloading?: boolean;
context?: string;
errorOnly?: boolean;
}) => {
const [attachment] = useDBItem(id, "attachment", attachments);
const { colors } = useThemeColors();
const [currentProgress, setCurrentProgress] = useAttachmentProgress(
attachment,
encryption
);
const onPress = () => {
if (!pressable || !attachment) return;
Actions.present(attachment, setAttachments, context);
};
return errorOnly && attachment && !attachment?.failed ? null : (
<TouchableOpacity
activeOpacity={0.9}
onPress={onPress}
style={{
flexDirection: "row",
marginVertical: 5,
justifyContent: "space-between",
padding: 12,
paddingVertical: 6,
minHeight: 45
}}
>
{!attachment ? null : (
<>
<View
style={{
flexShrink: 1,
flexDirection: "row",
alignItems: "center",
gap: 10
}}
>
<View
style={{
justifyContent: "center",
alignItems: "center",
marginLeft: -5,
borderWidth: 1,
borderColor: colors.secondary.border,
paddingHorizontal: 2,
width: 30,
height: 30,
borderRadius: 5
}}
>
<Paragraph
adjustsFontSizeToFit
size={8}
color={colors.secondary.paragraph}
style={{
maxWidth: 30
}}
numberOfLines={1}
>
{getFileExtension(attachment.filename).toUpperCase() ||
attachment.mimeType.split("/")?.[1]?.toUpperCase()}
</Paragraph>
</View>
<View
style={{
flexShrink: 1
}}
>
<Paragraph
size={SIZE.sm}
style={{
flexWrap: "wrap"
}}
numberOfLines={1}
lineBreakMode="middle"
color={colors.primary.paragraph}
>
{attachment.filename}
</Paragraph>
{!hideWhenNotDownloading ? (
<Paragraph color={colors.secondary.paragraph} size={SIZE.xxs}>
{strings.fileSize()}: {formatBytes(attachment.size)}
</Paragraph>
) : null}
</View>
</View>
{currentProgress ? (
<TouchableOpacity
activeOpacity={0.9}
onPress={() => {
if (encryption || !pressable) return;
db.fs().cancel(attachment.hash);
setCurrentProgress(undefined);
}}
style={{
justifyContent: "center",
marginLeft: 5,
marginTop: 5,
marginRight: -5
}}
>
<ProgressCircleComponent
size={SIZE.xxl}
progress={
currentProgress?.value ? currentProgress?.value / 100 : 0
}
showsText
textStyle={{
fontSize: 10
}}
color={colors.primary.accent}
formatText={(progress) => (progress * 100).toFixed(0)}
borderWidth={0}
thickness={2}
/>
</TouchableOpacity>
) : (
<>
{attachment.failed ? (
<IconButton
onPress={onPress}
name="alert-circle-outline"
color={colors.error.paragraph}
/>
) : null}
</>
)}
</>
)}
</TouchableOpacity>
);
};

View File

@@ -1,275 +0,0 @@
/*
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 React, { useRef, useState } from "react";
import { Platform, View } from "react-native";
import { db } from "../../common/database";
import { downloadAttachments } from "../../common/filesystem/download-attachment";
import { presentSheet } from "../../services/event-manager";
import { Button } from "../ui/button";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { ProgressBarComponent } from "../ui/svg/lazy";
import { useThemeColors } from "@notesnook/theme";
import { FlatList } from "react-native-actions-sheet";
import { AttachmentItem } from "./attachment-item";
const DownloadAttachments = ({ close, attachments, isNote, update }) => {
const { colors } = useThemeColors();
const [downloading, setDownloading] = useState(false);
const [progress, setProgress] = useState({
value: 0,
statusText: "Download started... Please wait"
});
const [result, setResult] = useState(new Map());
const canceled = useRef(false);
const groupId = useRef();
const onDownload = async () => {
update({
disableClosing: true
});
setDownloading(true);
canceled.current = false;
groupId.current = Date.now().toString();
const result = await downloadAttachments(
attachments,
(progress, statusText) => setProgress({ value: progress, statusText }),
canceled,
groupId.current
);
if (canceled.current) return;
setResult(result || new Map());
setDownloading(false);
update({
disableClosing: false
});
};
const cancel = async () => {
update({
disableClosing: false
});
canceled.current = true;
console.log(groupId.current, "canceling groupId downloads");
await db.fs.cancel(groupId.current);
setDownloading(false);
groupId.current = null;
};
const successResults = () => {
const results = [];
for (let [key, value] of result.entries()) {
if (value.status === 1) results.push(db.attachments.attachment(key));
}
return results;
};
const failedResults = () => {
const results = [];
for (let [key, value] of result.entries()) {
if (value.status === 0) results.push(db.attachments.attachment(key));
}
return results;
};
function getResultText() {
const downloadedAttachmentsCount =
attachments.length - failedResults().length;
if (downloadedAttachmentsCount === 0)
return "Failed to download all attachments";
return `Successfully downloaded ${downloadedAttachmentsCount}/${
attachments.length
} attachments as a zip file at ${
Platform.OS === "android" ? "the selected folder" : "Notesnook/downloads"
}`;
}
return (
<View
style={{
alignItems: "center",
width: "100%",
paddingVertical: 12,
paddingHorizontal: 12
}}
>
<Heading>
{downloading
? "Downloading attachments"
: result?.size
? "Downloaded attachments"
: "Download attachments"}
</Heading>
{downloading ? (
<Paragraph
style={{
textAlign: "center"
}}
>
{progress.statusText}
</Paragraph>
) : result?.size ? (
<Paragraph
style={{
textAlign: "center"
}}
>
{getResultText()}
</Paragraph>
) : (
<Paragraph
style={{
textAlign: "center"
}}
>
Are you sure you want to download all attachments
{isNote ? " of this note?" : "?"}
</Paragraph>
)}
{downloading ? (
<View
style={{
width: 200,
marginTop: 10
}}
>
<ProgressBarComponent
height={5}
width={null}
animated={true}
useNativeDriver
progress={progress.value ? progress.value / attachments.length : 0}
unfilledColor={colors.secondary.background}
color={colors.primary.accent}
borderWidth={0}
/>
</View>
) : null}
<FlatList
style={{
maxHeight: 300,
width: "100%",
minHeight: 60,
backgroundColor: colors.secondary.background,
borderRadius: 5,
marginVertical: 12
}}
data={downloading ? attachments : []}
ListEmptyComponent={
<View
style={{
width: "100%",
justifyContent: "center",
alignItems: "center",
height: 60
}}
>
<Paragraph color={colors.secondary.paragraph}>
No downloads in progress.
</Paragraph>
</View>
}
keyExtractor={(item) => item.id}
renderItem={({ item }) => {
return (
<AttachmentItem
attachment={item}
setAttachments={() => {}}
pressable={false}
hideWhenNotDownloading={true}
/>
);
}}
/>
{result?.size ? (
<Button
style={{
width: 250,
borderRadius: 100,
marginTop: 20
}}
onPress={close}
type="accent"
title="Done"
/>
) : !downloading ? (
<View
style={{
flexDirection: "row",
width: "100%",
marginTop: 20
}}
>
<Button
style={{
flex: 1,
borderRadius: 100,
marginRight: 5
}}
onPress={close}
type="grayBg"
title="No"
/>
<Button
style={{
flex: 1,
borderRadius: 100,
marginLeft: 5
}}
onPress={onDownload}
type="accent"
title="Yes"
/>
</View>
) : (
<Button
style={{
width: 250,
borderRadius: 100,
marginTop: 20
}}
onPress={cancel}
type="error"
title="Cancel"
/>
)}
</View>
);
};
DownloadAttachments.present = (context, attachments, isNote) => {
presentSheet({
context: context,
component: (ref, close, update) => (
<DownloadAttachments
close={close}
attachments={attachments}
isNote={isNote}
update={update}
/>
)
});
};
export default DownloadAttachments;

View File

@@ -1,329 +0,0 @@
/*
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 React, { useRef, useState } from "react";
import { ActivityIndicator, ScrollView, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { db } from "../../common/database";
import filesystem from "../../common/filesystem";
import { presentSheet } from "../../services/event-manager";
import { useThemeColors } from "@notesnook/theme";
import { SIZE } from "../../utils/size";
import SheetProvider from "../sheet-provider";
import { IconButton } from "../ui/icon-button";
import Input from "../ui/input";
import Seperator from "../ui/seperator";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { AttachmentItem } from "./attachment-item";
import DownloadAttachments from "./download-attachments";
import { Button } from "../ui/button";
import {
isAudio,
isDocument,
isImage,
isVideo
} from "@notesnook/core/dist/utils/filename";
import { useSettingStore } from "../../stores/use-setting-store";
import { FlashList } from "react-native-actions-sheet/dist/src/views/FlashList";
export const AttachmentDialog = ({ note }) => {
const { colors } = useThemeColors();
const { height } = useSettingStore((state) => state.dimensions);
const [attachments, setAttachments] = useState(
note
? db.attachments.ofNote(note.id, "all")
: [...(db.attachments.all || [])]
);
const attachmentSearchValue = useRef();
const searchTimer = useRef();
const [loading, setLoading] = useState(false);
const [currentFilter, setCurrentFilter] = useState("all");
const onChangeText = (text) => {
const attachments = note
? db.attachments.ofNote(note.id, "all")
: [...(db.attachments.all || [])];
attachmentSearchValue.current = text;
if (
!attachmentSearchValue.current ||
attachmentSearchValue.current === ""
) {
setAttachments([...attachments]);
}
clearTimeout(searchTimer.current);
searchTimer.current = setTimeout(() => {
let results = db.lookup.attachments(
attachments,
attachmentSearchValue.current
);
if (results.length === 0) return;
setAttachments(results);
}, 300);
};
const renderItem = ({ item }) => (
<AttachmentItem
setAttachments={setAttachments}
attachment={item}
context="attachments-list"
/>
);
const onCheck = async () => {
setLoading(true);
const checkedAttachments = [];
for (let attachment of attachments) {
let result = await filesystem.checkAttachment(attachment.metadata.hash);
if (result.failed) {
await db.attachments.markAsFailed(
attachment.metadata.hash,
result.failed
);
} else {
await db.attachments.markAsFailed(attachment.id, null);
}
checkedAttachments.push(
db.attachments.attachment(attachment.metadata.hash)
);
setAttachments([...checkedAttachments]);
}
setLoading(false);
};
const attachmentTypes = [
{
title: "All",
filterBy: "all"
},
{
title: "Images",
filterBy: "images"
},
{
title: "Documents",
filterBy: "documents"
},
{
title: "Video",
filterBy: "video"
},
{
title: "Audio",
filterBy: "audio"
}
];
const filterAttachments = (type) => {
const attachments = note
? db.attachments.ofNote(note.id, "all")
: [...(db.attachments.all || [])];
isDocument;
switch (type) {
case "all":
return attachments;
case "images":
return attachments.filter((attachment) =>
isImage(attachment.metadata.type)
);
case "video":
return attachments.filter((attachment) =>
isVideo(attachment.metadata.type)
);
case "audio":
return attachments.filter((attachment) =>
isAudio(attachment.metadata.type)
);
case "documents":
return attachments.filter((attachment) =>
isDocument(attachment.metadata.type)
);
}
};
return (
<View
style={{
width: "100%",
alignSelf: "center",
paddingHorizontal: 12,
height: height * 0.85
}}
>
<SheetProvider context="attachments-list" />
<View
style={{
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center"
}}
>
<Heading>Attachments</Heading>
<View
style={{
flexDirection: "row"
}}
>
{loading ? (
<ActivityIndicator
style={{
height: 40,
width: 40,
marginRight: 10
}}
size={SIZE.lg}
/>
) : (
<IconButton
name="check-all"
customStyle={{
height: 40,
width: 40,
marginRight: 10
}}
color={colors.primary.paragraph}
size={SIZE.lg}
onPress={onCheck}
/>
)}
<IconButton
name="download"
customStyle={{
height: 40,
width: 40
}}
color={colors.primary.paragraph}
onPress={() => {
DownloadAttachments.present(
"attachments-list",
attachments,
!!note
);
}}
size={SIZE.lg}
/>
</View>
</View>
<Seperator />
<Input
placeholder="Filter attachments by filename, type or hash"
onChangeText={onChangeText}
onSubmit={() => {
onChangeText(attachmentSearchValue.current);
}}
/>
<View>
<ScrollView
style={{
width: "100%",
height: 50,
flexDirection: "row",
backgroundColor: colors.primary.background
}}
contentContainerStyle={{
minWidth: "100%",
height: 50
}}
horizontal
>
{attachmentTypes.map((item) => (
<Button
type={currentFilter === item.filterBy ? "grayAccent" : "gray"}
key={item.title}
title={
item.title +
` (${filterAttachments(item.filterBy)?.length || 0})`
}
style={{
borderRadius: 0,
borderBottomWidth: 1,
flexGrow: 1,
borderBottomColor:
currentFilter !== item.filterBy
? "transparent"
: colors.primary.accent
}}
onPress={() => {
setCurrentFilter(item.filterBy);
setAttachments(filterAttachments(item.filterBy));
}}
/>
))}
</ScrollView>
</View>
<FlashList
keyboardDismissMode="none"
keyboardShouldPersistTaps="always"
ListEmptyComponent={
<View
style={{
height: 150,
justifyContent: "center",
alignItems: "center"
}}
>
<Icon name="attachment" size={60} color={colors.secondary.icon} />
<Paragraph>
{note ? "No attachments on this note" : "No attachments"}
</Paragraph>
</View>
}
ListFooterComponent={
<View
style={{
height: 350
}}
/>
}
estimatedItemSize={50}
data={attachments}
renderItem={renderItem}
/>
<Paragraph
color={colors.secondary.paragraph}
size={SIZE.xs}
style={{
textAlign: "center",
marginTop: 10
}}
>
<Icon
name="shield-key-outline"
size={SIZE.xs}
color={colors.primary.icon}
/>
{" "}All attachments are end-to-end encrypted.
</Paragraph>
</View>
);
};
AttachmentDialog.present = (note) => {
presentSheet({
component: () => <AttachmentDialog note={note} />
});
};

View File

@@ -0,0 +1,617 @@
/*
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 {
Attachment,
FilteredSelector,
Note,
SortOptions,
VirtualizedGrouping
} from "@notesnook/core";
import { strings } from "@notesnook/intl";
import { useThemeColors } from "@notesnook/theme";
import React, { useEffect, useRef, useState } from "react";
import { ActivityIndicator, View } from "react-native";
import { FlashList } from "react-native-actions-sheet/dist/src/views/FlashList";
import { ScrollView } from "react-native-gesture-handler";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import create, { State } from "zustand";
import { db } from "../../common/database";
import filesystem from "../../common/filesystem";
import { downloadAttachments } from "../../common/filesystem/download-attachment";
import { AttachmentGroupProgress } from "../../screens/settings/attachment-group-progress";
import { presentSheet, ToastManager } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { SIZE } from "../../utils/size";
import { Dialog } from "../dialog";
import { presentDialog } from "../dialog/functions";
import { Header } from "../header";
import SheetProvider from "../sheet-provider";
import { Button } from "../ui/button";
import { IconButton } from "../ui/icon-button";
import Input from "../ui/input";
import Seperator from "../ui/seperator";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { AttachmentItem } from "./attachment-item";
const DEFAULT_SORTING: SortOptions = {
sortBy: "dateEdited",
sortDirection: "desc"
};
type RecheckerProgress = {
failed: number;
passed: number;
isWorking: boolean;
shown: boolean;
filter: string;
};
interface RecheckerState extends State {
progress: {
[key: string]: RecheckerProgress;
};
setProgress: (key: string, progress: RecheckerProgress) => void;
currentFilter: string;
}
const useRechecker = create<RecheckerState>((set) => ({
progress: {
all: {
failed: 0,
passed: 0,
isWorking: false,
shown: false,
filter: "all"
}
},
currentFilter: "all",
setProgress: (key: string, progress: RecheckerProgress) => {
set((state) => ({
progress: {
...state.progress,
[key]: progress
}
}));
}
}));
const attachmentTypes = [
{
title: strings.mediaTypes.all(),
filterBy: "all"
},
{
title: strings.mediaTypes.image(),
filterBy: "images"
},
{
title: strings.mediaTypes.audio(),
filterBy: "audio"
},
{
title: strings.mediaTypes.video(),
filterBy: "video"
},
{
title: strings.mediaTypes.document(),
filterBy: "documents"
},
{
title: strings.mediaTypes.orphaned(),
filterBy: "orphaned"
},
{
title: strings.mediaTypes.errors(),
filterBy: "errors"
}
];
export const AttachmentDialog = ({
note,
isSheet
}: {
note?: Note;
isSheet: boolean;
}) => {
const { colors } = useThemeColors();
const [attachments, setAttachments] =
useState<VirtualizedGrouping<Attachment>>();
const attachmentSearchValue = useRef<string>();
const [loading, setLoading] = useState(true);
const searchTimer = useRef<NodeJS.Timeout>();
const [currentFilter, setCurrentFilter] = useState("all");
const rechecker = useRechecker((state) =>
note ? state.progress[note.id] || {} : state.progress.all
);
const currentFilterRef = useRef(currentFilter);
currentFilterRef.current = currentFilter;
useEffect(() => {
useRechecker.setState({
currentFilter: currentFilter
});
}, [currentFilter]);
const refresh = React.useCallback(() => {
if (note) {
db.attachments
.ofNote(note.id, "all")
.sorted({
...DEFAULT_SORTING,
sortBy: "dateModified"
})
.then((attachments) => {
setLoading(false);
setAttachments(attachments);
});
} else {
db.attachments.all
.sorted({
...DEFAULT_SORTING,
sortBy: "dateModified"
})
.then((attachments) => {
setAttachments(attachments);
setLoading(false);
});
}
}, [note]);
useEffect(() => {
refresh();
}, [note, refresh]);
const onChangeText = async (text: string) => {
attachmentSearchValue.current = text;
if (
!attachmentSearchValue.current ||
attachmentSearchValue.current === ""
) {
setAttachments(await filterAttachments(currentFilter));
refresh();
}
clearTimeout(searchTimer.current);
searchTimer.current = setTimeout(async () => {
const results = await db.lookup
.attachments(attachmentSearchValue.current as string)
.sorted();
if (results.length === 0) return;
setAttachments(results);
}, 300);
};
const renderItem = ({ index }: { item: boolean; index: number }) => (
<AttachmentItem
setAttachments={async () => {
setAttachments(await filterAttachments(currentFilter));
}}
errorOnly={currentFilter === "errors"}
attachments={attachments}
id={index}
context="global"
/>
);
const onCheck = async () => {
const getState = () =>
useRechecker.getState().progress[note?.id || "all"] || {};
const setState = (state: Partial<RecheckerProgress>) =>
useRechecker.getState().setProgress(note?.id || "all", {
...getState(),
...state
});
if (!attachments || getState().isWorking) return;
setState({
isWorking: true,
failed: 0,
passed: 0,
shown: true,
filter: currentFilterRef.current
});
const filter = currentFilterRef.current;
const filteredAttachments = await filterAttachments(
currentFilterRef.current
);
for (let i = 0; i < filteredAttachments.placeholders.length; i++) {
if (!getState().isWorking) {
ToastManager.show({
message: "Attachment recheck cancelled",
type: "info",
context: isSheet ? "local" : "global"
});
return;
}
const attachment = (await attachments.item(i))?.item;
if (currentFilter == "errors" && !attachment?.failed) continue;
if (!attachment) continue;
const result = await filesystem.checkAttachment(attachment.hash);
if (!result) return;
if (result.failed) {
setState({
failed: getState().failed + 1
});
await db.attachments.markAsFailed(attachment.hash, result.failed);
} else {
setState({
passed: getState().passed + 1
});
await db.attachments.markAsFailed(attachment.id);
}
}
if (filter === useRechecker.getState().currentFilter) {
setAttachments(await filterAttachments(currentFilter));
}
setState({
isWorking: false
});
};
const filterAttachments = async (type: string) => {
let items: FilteredSelector<Attachment> = db.attachments.all;
switch (type) {
case "all":
items = note
? db.attachments.ofNote(note.id, "all")
: db.attachments.all;
break;
case "images":
items = note
? db.attachments.ofNote(note.id, "images")
: db.attachments.images;
break;
case "video":
items = items = note
? db.attachments.ofNote(note.id, "videos")
: db.attachments.videos;
break;
case "audio":
items = note
? db.attachments.ofNote(note.id, "audio")
: db.attachments.audios;
break;
case "documents":
items = note
? db.attachments.ofNote(note.id, "documents")
: db.attachments.documents;
break;
case "orphaned":
items = db.attachments.orphaned;
break;
case "errors":
items = items = note
? db.attachments.ofNote(note.id, "all")
: db.attachments.all;
}
return await items.sorted({
...DEFAULT_SORTING,
sortBy: "dateModified"
});
};
return (
<>
{isSheet ? (
<>
<SheetProvider context="attachments-list" />
<Dialog context="local" />
</>
) : null}
{!isSheet ? (
<Header
title="Manage attachments"
renderedInRoute="SettingsGroup"
canGoBack
headerRightButtons={[
{
onPress() {
onCheck();
},
title: "Recheck all"
},
{
onPress() {
if (!attachments) return;
presentDialog({
title: `Download ${attachments.placeholders.length} attachments`,
paragraph:
"Are you sure you want to download all attachments?",
positiveText: "Download",
positivePress: async () => {
downloadAttachments(await attachments.ids());
},
negativeText: "Cancel"
});
},
title: "Download all"
}
]}
/>
) : (
<View
style={{
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
paddingHorizontal: 12
}}
>
<Heading>{strings.dataTypesPluralCamelCase.attachment()}</Heading>
<View
style={{
flexDirection: "row"
}}
>
<IconButton
name="check-all"
style={{
height: 40,
width: 40,
marginRight: 10
}}
color={colors.primary.paragraph}
size={SIZE.lg}
onPress={onCheck}
/>
<IconButton
name="download"
style={{
height: 40,
width: 40
}}
color={colors.primary.paragraph}
onPress={() => {
if (!attachments) return;
presentDialog({
title: `Download ${attachments.placeholders.length} attachments`,
paragraph:
"Are you sure you want to download all attachments?",
context: "local",
positiveText: "Download",
positivePress: async () => {
downloadAttachments(await attachments.ids());
},
negativeText: "Cancel"
});
}}
size={SIZE.lg}
/>
</View>
</View>
)}
<View
style={{
width: "100%",
alignSelf: "center",
paddingHorizontal: 12,
height: "100%"
}}
>
<Seperator />
<Input
placeholder={strings.filterAttachments()}
onChangeText={onChangeText}
onSubmit={() => {
onChangeText(attachmentSearchValue.current as string);
}}
/>
{rechecker.shown ? (
<View
style={{
flexDirection: "row",
alignItems: "center",
width: "100%",
borderRadius: 10,
padding: 10,
borderWidth: 1,
borderColor: colors.primary.border,
gap: 12,
justifyContent: "space-between"
}}
>
<View
style={{
flexDirection: "row",
gap: 12,
alignItems: "center"
}}
>
{rechecker.isWorking ? (
<ActivityIndicator color={colors.primary.accent} />
) : (
<Icon
name="file-check"
size={30}
color={colors.primary.accent}
/>
)}
<View>
<Paragraph>
{rechecker.isWorking
? note
? `Checking ${rechecker.filter.toLowerCase()} note attachments`
: `Checking ${rechecker.filter.toLowerCase()} attachments`
: "Attachments recheck complete"}
</Paragraph>
<Paragraph>
{`${rechecker.isWorking ? "Please wait... " : ""}Passed: ${
rechecker.passed
}, Failed: ${rechecker.failed}`}
</Paragraph>
</View>
</View>
<IconButton
type={rechecker.isWorking ? "errorShade" : "plain"}
name={rechecker.isWorking ? "close" : "check"}
size={SIZE.lg}
color={
rechecker.isWorking ? colors.error.icon : colors.primary.accent
}
onPress={() => {
useRechecker.getState().setProgress(note?.id || "all", {
...useRechecker.getState().progress[note?.id || "all"],
shown: false,
isWorking: false
});
}}
/>
</View>
) : null}
<View>
<ScrollView
style={{
backgroundColor: colors.primary.background,
flexWrap: "wrap",
flexDirection: "row",
paddingVertical: 12
}}
contentContainerStyle={{
alignItems: "center"
}}
horizontal
>
{attachmentTypes.map((item) =>
item.filterBy === "orphaned" && note ? null : (
<Button
type={
currentFilter === item.filterBy
? "secondaryAccented"
: "plain"
}
key={item.title}
title={item.title}
fontSize={SIZE.sm}
style={{
borderRadius: 100,
paddingHorizontal: 12,
height: 40,
minWidth: 80
}}
onPress={async () => {
const filterBy = item.filterBy;
setCurrentFilter(filterBy);
setLoading(true);
filterAttachments(filterBy)
.then((results) => {
if (filterBy !== currentFilterRef.current) return;
setAttachments(results);
setLoading(false);
})
.catch(console.log);
}}
/>
)
)}
</ScrollView>
</View>
<FlashList
keyboardDismissMode="none"
keyboardShouldPersistTaps="always"
ListEmptyComponent={
<View
style={{
height: "100%",
justifyContent: "center",
alignItems: "center"
}}
>
{loading ? (
<ActivityIndicator size={40} color={colors.primary.accent} />
) : (
<>
<Icon
name="attachment"
size={60}
color={colors.secondary.icon}
/>
<Paragraph>{strings.noAttachments()}</Paragraph>
</>
)}
</View>
}
ListHeaderComponent={<AllProgress note={note} />}
ListFooterComponent={
<View
style={{
height: 350
}}
/>
}
estimatedItemSize={50}
data={loading ? [] : attachments?.placeholders}
renderItem={renderItem}
/>
</View>
</>
);
};
const AllProgress = ({ note }: { note?: Note }) => {
const progress = useAttachmentStore((state) =>
note
? {
downloading: {
[note.id]: state.downloading?.[note.id]
},
uploading: {
[note.id]: state.uploading?.[note.id]
}
}
: state
);
return (
<View
style={{
gap: 10,
width: "100%"
}}
>
{Object.keys(progress.downloading || {}).map((groupId) => (
<AttachmentGroupProgress key={groupId} groupId={groupId} />
))}
{Object.keys(progress.uploading || {}).map((groupId) => (
<AttachmentGroupProgress key={groupId} groupId={groupId} />
))}
</View>
);
};
AttachmentDialog.present = (note?: Note) => {
presentSheet({
component: () => <AttachmentDialog note={note} isSheet={true} />,
keyboardHandlerDisabled: true
});
};

View File

@@ -17,14 +17,16 @@ 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 { useThemeColors } from "@notesnook/theme";
import React, { useEffect, useRef, useState } from "react";
import { Platform, View } from "react-native";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";
import {
eSubscribeEvent,
eUnSubscribeEvent
} from "../../services/event-manager";
import { useThemeColors } from "@notesnook/theme";
import { useUserStore } from "../../stores/use-user-store";
import { eCloseLoginDialog, eOpenLoginDialog } from "../../utils/events";
import { sleep } from "../../utils/time";
import BaseDialog from "../dialog/base-dialog";
@@ -34,7 +36,7 @@ import { IconButton } from "../ui/icon-button";
import { hideAuth, initialAuthMode } from "./common";
import { Login } from "./login";
import { Signup } from "./signup";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { strings } from "@notesnook/intl";
export const AuthMode = {
login: 0,
@@ -68,6 +70,9 @@ const AuthModal = () => {
}
const close = () => {
useUserStore.setState({
disableAppLockRequests: false
});
actionSheetRef.current?.hide();
setCurrentAuthMode(AuthMode.login);
setVisible(false);
@@ -77,6 +82,11 @@ const AuthModal = () => {
<BaseDialog
overlayOpacity={0}
statusBarTranslucent={false}
onShow={() => {
useUserStore.setState({
disableAppLockRequests: true
});
}}
onRequestClose={currentAuthMode !== AuthMode.welcomeSignup && close}
visible={true}
onClose={close}
@@ -86,6 +96,7 @@ const AuthModal = () => {
transparent={false}
animated={false}
centered={false}
enableSheetKeyboardHandler
>
<KeyboardAwareScrollView
style={{
@@ -143,12 +154,12 @@ const AuthModal = () => {
{initialAuthMode.current !== AuthMode.welcomeSignup ? null : (
<Button
title="Skip"
title={strings.skip()}
onPress={() => {
hideAuth();
}}
iconSize={16}
type="gray"
type="plain"
iconPosition="right"
icon="chevron-right"
height={25}

View File

@@ -23,15 +23,19 @@ import { db } from "../../common/database";
import {
eSendEvent,
presentSheet,
ToastEvent
ToastManager
} from "../../services/event-manager";
import { useUserStore } from "../../stores/use-user-store";
import { eCloseSheet } from "../../utils/events";
import { eCloseSheet, eOpenRecoveryKeyDialog } from "../../utils/events";
import DialogHeader from "../dialog/dialog-header";
import { Button } from "../ui/button";
import Input from "../ui/input";
import { Notice } from "../ui/notice";
import Seperator from "../ui/seperator";
import { Dialog } from "../dialog";
import BackupService from "../../services/backup";
import { sleep } from "../../utils/time";
import { strings } from "@notesnook/intl";
export const ChangePassword = () => {
const passwordInputRef = useRef();
@@ -45,18 +49,18 @@ export const ChangePassword = () => {
const changePassword = async () => {
if (!user?.isEmailConfirmed) {
ToastEvent.show({
heading: "Email not confirmed",
message: "Please confirm your email to change account password",
ToastManager.show({
heading: strings.emailNotConfirmed(),
message: strings.emailNotConfirmedDesc(),
type: "error",
context: "local"
});
return;
}
if (error || !oldPassword.current || !password.current) {
ToastEvent.show({
heading: "All fields required",
message: "Fill all the fields and try again.",
ToastManager.show({
heading: strings.allFieldsRequired(),
message: strings.allFieldsRequiredDesc(),
type: "error",
context: "local"
});
@@ -64,19 +68,25 @@ export const ChangePassword = () => {
}
setLoading(true);
try {
const result = await BackupService.run(false, "change-password-dialog");
if (!result.error)
throw new Error(strings.backupFailed() + `: ${result.error}`);
await db.user.clearSessions();
await db.user.changePassword(oldPassword.current, password.current);
ToastEvent.show({
heading: "Account password updated",
ToastManager.show({
heading: strings.passwordChangedSuccessfully(),
type: "success",
context: "global"
});
setLoading(false);
eSendEvent(eCloseSheet);
await sleep(300);
eSendEvent(eOpenRecoveryKeyDialog);
} catch (e) {
setLoading(false);
ToastEvent.show({
heading: "Failed to change password",
ToastManager.show({
heading: strings.passwordChangeFailed(),
message: e.message,
type: "error",
context: "local"
@@ -92,10 +102,8 @@ export const ChangePassword = () => {
padding: 12
}}
>
<DialogHeader
title="Change password"
paragraph="Enter your old and new passwords"
/>
<Dialog context="change-password-dialog" />
<DialogHeader title={strings.changePassword()} />
<Seperator />
<Input
@@ -109,7 +117,7 @@ export const ChangePassword = () => {
autoComplete="password"
autoCapitalize="none"
autoCorrect={false}
placeholder="Old Password"
placeholder={strings.oldPassword()}
/>
<Input
@@ -118,20 +126,21 @@ export const ChangePassword = () => {
password.current = value;
}}
onErrorCheck={(e) => setError(e)}
returnKeyLabel="Next"
returnKeyLabel={strings.next()}
returnKeyType="next"
secureTextEntry
validationType="password"
autoComplete="password"
autoCapitalize="none"
autoCorrect={false}
placeholder="New password"
placeholder={strings.newPassword()}
/>
<Notice
text="Changing password is a non-undoable process. You will be logged out from all your devices. Please make sure you do not close the app while your password is changing and have good internet connection."
type="alert"
/>
<Notice text={strings.changePasswordNotice()} type="alert" />
<View style={{ height: 10 }} />
<Notice text={strings.changePasswordNotice2()} type="alert" />
<Button
style={{
@@ -141,7 +150,7 @@ export const ChangePassword = () => {
loading={loading}
onPress={changePassword}
type="accent"
title={loading ? null : "I understand, change my password"}
title={loading ? null : strings.changePasswordConfirm()}
/>
</View>
);

View File

@@ -22,7 +22,7 @@ import { View } from "react-native";
import ActionSheet from "react-native-actions-sheet";
import { db } from "../../common/database";
import { DDS } from "../../services/device-detection";
import { ToastEvent } from "../../services/event-manager";
import { ToastManager } from "../../services/event-manager";
import SettingsService from "../../services/settings";
import { useThemeColors } from "@notesnook/theme";
import DialogHeader from "../dialog/dialog-header";
@@ -32,6 +32,7 @@ import Input from "../ui/input";
import Seperator from "../ui/seperator";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { strings } from "@notesnook/intl";
export const ForgotPassword = () => {
const { colors } = useThemeColors("sheet");
@@ -43,8 +44,8 @@ export const ForgotPassword = () => {
const sendRecoveryEmail = async () => {
if (!email.current || error) {
ToastEvent.show({
heading: "Account email is required.",
ToastManager.show({
heading: strings.emailRequired(),
type: "error",
context: "local"
});
@@ -57,15 +58,15 @@ export const ForgotPassword = () => {
lastRecoveryEmailTime &&
Date.now() - JSON.parse(lastRecoveryEmailTime) < 60000 * 3
) {
throw new Error("Please wait before requesting another email");
throw new Error(strings.pleaseWaitBeforeSendEmail());
}
await db.user.recoverAccount(email.current.toLowerCase());
SettingsService.set({
lastRecoveryEmailTime: Date.now()
});
ToastEvent.show({
heading: "Check your email to reset password",
message: `Recovery email has been sent to ${email.current.toLowerCase()}`,
ToastManager.show({
heading: strings.recoveryEmailSent(),
message: strings.recoveryEmailSentDesc(),
type: "success",
context: "local",
duration: 7000
@@ -74,8 +75,8 @@ export const ForgotPassword = () => {
setSent(true);
} catch (e) {
setLoading(false);
ToastEvent.show({
heading: "Recovery email not sent",
ToastManager.show({
heading: strings.recoveryEmailFailed(),
message: e.message,
type: "error",
context: "local"
@@ -113,7 +114,7 @@ export const ForgotPassword = () => {
}}
>
<IconButton
customStyle={{
style={{
width: null,
height: null
}}
@@ -121,13 +122,13 @@ export const ForgotPassword = () => {
name="email"
size={50}
/>
<Heading>Recovery email sent!</Heading>
<Heading>{strings.recoveryEmailSent()}</Heading>
<Paragraph
style={{
textAlign: "center"
}}
>
Please follow the link in the email to recover your account.
{strings.recoveryEmailSentDesc()}
</Paragraph>
</View>
) : (
@@ -140,10 +141,7 @@ export const ForgotPassword = () => {
padding: 12
}}
>
<DialogHeader
title="Account recovery"
paragraph="We will send you an email with steps on how to reset your password."
/>
<DialogHeader title={strings.accountRecovery()} />
<Seperator />
<Input
@@ -153,14 +151,14 @@ export const ForgotPassword = () => {
}}
defaultValue={email.current}
onErrorCheck={(e) => setError(e)}
returnKeyLabel="Next"
returnKeyLabel={strings.next()}
returnKeyType="next"
autoComplete="email"
validationType="email"
autoCorrect={false}
autoCapitalize="none"
errorMessage="Email is invalid"
placeholder="Email"
errorMessage={strings.emailInvalid()}
placeholder={strings.email()}
onSubmit={() => {}}
/>
@@ -172,7 +170,7 @@ export const ForgotPassword = () => {
loading={loading}
onPress={sendRecoveryEmail}
type="accent"
title={loading ? null : "Next"}
title={loading ? null : strings.next()}
/>
</View>
)}

View File

@@ -59,22 +59,6 @@ const Auth = ({ navigation, route }) => {
/>
)}
{/* {initialAuthMode.current === AuthMode.welcomeSignup ? null : (
<IconButton
name="arrow-left"
onPress={() => {
hideAuth();
}}
color={colors.primary.paragraph}
customStyle={{
position: 'absolute',
zIndex: 999,
left: 12,
top: Platform.OS === 'ios' ? 12 + insets.top : insets.top
}}
/>
)} */}
<Toast context="local" />
</View>
);

View File

@@ -17,12 +17,16 @@ 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 { useThemeColors } from "@notesnook/theme";
import React, { useEffect, useState } from "react";
import { TouchableOpacity, View, useWindowDimensions } from "react-native";
import { SheetManager } from "react-native-actions-sheet";
import { DDS } from "../../services/device-detection";
import { eSendEvent } from "../../services/event-manager";
import { useThemeColors } from "@notesnook/theme";
import Sync from "../../services/sync";
import { useSettingStore } from "../../stores/use-setting-store";
import { useUserStore } from "../../stores/use-user-store";
import { eUserLoggedIn } from "../../utils/events";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import SheetProvider from "../sheet-provider";
@@ -34,10 +38,7 @@ import Paragraph from "../ui/typography/paragraph";
import { hideAuth } from "./common";
import { ForgotPassword } from "./forgot-password";
import { useLogin } from "./use-login";
import { useSettingStore } from "../../stores/use-setting-store";
import { eUserLoggedIn } from "../../utils/events";
import { useUserStore } from "../../stores/use-user-store";
import Sync from "../../services/sync";
import { strings } from "@notesnook/intl";
const LoginSteps = {
emailAuth: 1,
@@ -66,7 +67,7 @@ export const Login = ({ changeMode }) => {
Progress.present();
setTimeout(() => {
if (!useUserStore.getState().syncing) {
Sync.run("global", false, true);
Sync.run("global", false, "full");
}
}, 5000);
});
@@ -103,7 +104,7 @@ export const Login = ({ changeMode }) => {
justifyContent: "flex-end",
paddingHorizontal: 20,
backgroundColor: colors.secondary.background,
borderBottomWidth: 1,
borderBottomWidth: 0.8,
marginBottom: 12,
borderBottomColor: colors.primary.border,
alignSelf: deviceMode !== "mobile" ? "center" : undefined,
@@ -147,7 +148,7 @@ export const Login = ({ changeMode }) => {
extraBold
size={SIZE.xxl}
>
Login to your {"\n"}account
{strings.loginToYourAccount()}
</Heading>
</View>
@@ -178,12 +179,16 @@ export const Login = ({ changeMode }) => {
validationType="email"
autoCorrect={false}
autoCapitalize="none"
errorMessage="Email is invalid"
placeholder="Enter your email"
errorMessage={strings.emailInvalid()}
placeholder={strings.email()}
defaultValue={email.current}
editable={step === LoginSteps.emailAuth && !loading}
onSubmit={() => {
passwordInputRef.current?.focus();
if (step === LoginSteps.emailAuth) {
login();
} else {
passwordInputRef.current?.focus();
}
}}
/>
@@ -195,20 +200,20 @@ export const Login = ({ changeMode }) => {
password.current = value;
}}
testID="input.password"
returnKeyLabel="Done"
returnKeyLabel={strings.done()}
returnKeyType="done"
secureTextEntry
autoComplete="password"
autoCapitalize="none"
autoCorrect={false}
placeholder="Password"
placeholder={strings.password()}
marginBottom={0}
editable={!loading}
defaultValue={password.current}
onSubmit={() => login()}
/>
<Button
title="Forgot your password?"
title={strings.forgotPassword()}
style={{
alignSelf: "flex-end",
height: 30,
@@ -222,7 +227,7 @@ export const Login = ({ changeMode }) => {
textDecorationLine: "underline"
}}
fontSize={SIZE.xs}
type="gray"
type="plain"
/>
</>
)}
@@ -242,14 +247,15 @@ export const Login = ({ changeMode }) => {
width: 250,
borderRadius: 100
}}
height={50}
fontSize={SIZE.md}
type="accent"
title={!loading ? "Continue" : null}
title={!loading ? strings.continue() : null}
/>
{step === LoginSteps.passwordAuth && (
<Button
title="Cancel logging in"
title={strings.cancelLogin()}
style={{
alignSelf: "center",
height: 30,
@@ -285,12 +291,12 @@ export const Login = ({ changeMode }) => {
size={SIZE.xs + 1}
color={colors.secondary.paragraph}
>
Don't have an account?{" "}
{strings.dontHaveAccount()}{" "}
<Paragraph
size={SIZE.xs + 1}
style={{ color: colors.primary.accent }}
>
Sign up
{strings.signUp()}
</Paragraph>
</Paragraph>
</TouchableOpacity>

View File

@@ -19,12 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useThemeColors } from "@notesnook/theme";
import React, { useEffect, useState } from "react";
import { Modal, View } from "react-native";
import { View } from "react-native";
import { db } from "../../common/database";
import { MMKV } from "../../common/database/mmkv";
import BiometricService from "../../services/biometrics";
import {
ToastEvent,
ToastManager,
eSendEvent,
eSubscribeEvent
} from "../../services/event-manager";
@@ -37,6 +37,7 @@ import { eLoginSessionExpired, eUserLoggedIn } from "../../utils/events";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import { Dialog } from "../dialog";
import BaseDialog from "../dialog/base-dialog";
import { presentDialog } from "../dialog/functions";
import SheetProvider from "../sheet-provider";
import { Toast } from "../toast";
@@ -46,7 +47,7 @@ import Input from "../ui/input";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { LoginSteps, useLogin } from "./use-login";
import BaseDialog from "../dialog/base-dialog";
import { strings } from "@notesnook/intl";
function getObfuscatedEmail(email) {
if (!email) return "";
@@ -69,6 +70,9 @@ export const SessionExpired = () => {
eSendEvent(eUserLoggedIn, true);
setVisible(false);
setFocused(false);
useUserStore.setState({
disableAppLockRequests: false
});
},
true
);
@@ -84,8 +88,11 @@ export const SessionExpired = () => {
MMKV.clearStore();
clearAllStores();
setVisible(false);
useUserStore.setState({
disableAppLockRequests: false
});
} catch (e) {
ToastEvent.show({
ToastManager.show({
heading: e.message,
type: "error",
context: "local"
@@ -102,11 +109,15 @@ export const SessionExpired = () => {
const open = React.useCallback(async () => {
try {
let res = await db.user.tokenManager.getToken();
let res = await db.tokenManager.getToken();
if (!res) throw new Error("no token found");
if (db.user.tokenManager._isTokenExpired(res))
if (db.tokenManager._isTokenExpired(res))
throw new Error("token expired");
Sync.run("global", false, true, async (complete) => {
const key = await db.user.getEncryptionKey();
if (!key) throw new Error("No encryption key found.");
Sync.run("global", false, "full", async (complete) => {
if (!complete) {
let user = await db.user.getUser();
if (!user) return;
@@ -121,12 +132,14 @@ export const SessionExpired = () => {
setVisible(false);
});
} catch (e) {
console.log(e);
let user = await db.user.getUser();
if (!user) return;
email.current = user.email;
setFocused(false);
setVisible(true);
useUserStore.setState({
disableAppLockRequests: true
});
}
}, [email]);
@@ -139,9 +152,15 @@ export const SessionExpired = () => {
animated={false}
centered={false}
onShow={async () => {
useUserStore.setState({
disableAppLockRequests: true
});
await sleep(300);
passwordInputRef.current?.focus();
setFocused(true);
useUserStore.setState({
disableAppLockRequests: true
});
}}
enableSheetKeyboardHandler={true}
visible={true}
@@ -166,7 +185,7 @@ export const SessionExpired = () => {
}}
>
<IconButton
customStyle={{
style={{
width: 60,
height: 60
}}
@@ -175,15 +194,14 @@ export const SessionExpired = () => {
size={50}
/>
<Heading size={SIZE.xxxl} color={colors.primary.heading}>
Session expired
{strings.sessionExpired()}
</Heading>
<Paragraph
style={{
textAlign: "center"
}}
>
Your session on this device has expired. Please enter password for{" "}
{getObfuscatedEmail(email.current)} to continue.
{strings.sessionExpiredDesc(getObfuscatedEmail(email.current))}
</Paragraph>
</View>
@@ -193,13 +211,13 @@ export const SessionExpired = () => {
onChangeText={(value) => {
password.current = value;
}}
returnKeyLabel="Next"
returnKeyLabel={strings.done()}
returnKeyType="next"
secureTextEntry
autoComplete="password"
autoCapitalize="none"
autoCorrect={false}
placeholder="Password"
placeholder={strings.password()}
onSubmit={() => login()}
/>
) : null}
@@ -213,7 +231,7 @@ export const SessionExpired = () => {
loading={loading}
onPress={() => login()}
type="accent"
title={loading ? null : "Login"}
title={loading ? null : strings.login()}
/>
<Button
@@ -224,16 +242,15 @@ export const SessionExpired = () => {
onPress={() => {
presentDialog({
context: "session_expiry",
title: "Logout",
paragraph:
"Are you sure you want to logout from this device? Any unsynced changes will be lost.",
positiveText: "Logout",
title: strings.logoutFromDevice(),
paragraph: strings.logoutDesc(),
positiveText: strings.logout(),
positiveType: "errorShade",
positivePress: logout
});
}}
type="errorShade"
title={loading ? null : "Logout from this device"}
title={loading ? null : strings.logoutFromDevice()}
/>
</View>
<Toast context="local" />

View File

@@ -21,7 +21,7 @@ import React, { useRef, useState } from "react";
import { TouchableOpacity, View, useWindowDimensions } from "react-native";
import { db } from "../../common/database";
import { DDS } from "../../services/device-detection";
import { ToastEvent } from "../../services/event-manager";
import { ToastManager } from "../../services/event-manager";
import { clearMessage, setEmailVerifyMessage } from "../../services/message";
import PremiumService from "../../services/premium";
import { useThemeColors } from "@notesnook/theme";
@@ -35,6 +35,8 @@ import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { hideAuth } from "./common";
import { useSettingStore } from "../../stores/use-setting-store";
import SettingsService from "../../services/settings";
import { strings } from "@notesnook/intl";
export const Signup = ({ changeMode, trial }) => {
const { colors } = useThemeColors();
@@ -52,9 +54,9 @@ export const Signup = ({ changeMode, trial }) => {
const { width, height } = useWindowDimensions();
const validateInfo = () => {
if (!password.current || !email.current || !confirmPassword.current) {
ToastEvent.show({
heading: "All fields required",
message: "Fill all the fields and try again",
ToastManager.show({
heading: strings.allFieldsRequired(),
message: strings.allFieldsRequiredDesc(),
type: "error",
context: "local"
});
@@ -77,6 +79,7 @@ export const Signup = ({ changeMode, trial }) => {
clearMessage();
setEmailVerifyMessage();
hideAuth();
SettingsService.setProperty("encryptedBackup", true);
await sleep(300);
if (trial) {
PremiumService.sheet(null, null, true);
@@ -85,8 +88,8 @@ export const Signup = ({ changeMode, trial }) => {
}
} catch (e) {
setLoading(false);
ToastEvent.show({
heading: "Signup failed",
ToastManager.show({
heading: strings.signupFailed(),
message: e.message,
type: "error",
context: "local"
@@ -111,7 +114,7 @@ export const Signup = ({ changeMode, trial }) => {
paddingHorizontal: 20,
backgroundColor: colors.secondary.background,
marginBottom: 20,
borderBottomWidth: 1,
borderBottomWidth: 0.8,
borderBottomColor: colors.primary.border,
alignSelf: deviceMode !== "mobile" ? "center" : undefined,
borderWidth: deviceMode !== "mobile" ? 1 : null,
@@ -154,7 +157,7 @@ export const Signup = ({ changeMode, trial }) => {
}}
size={SIZE.xxl}
>
Create your {"\n"}account
{strings.createYourAccount()}
</Heading>
</View>
@@ -173,14 +176,14 @@ export const Signup = ({ changeMode, trial }) => {
}}
testID="input.email"
onErrorCheck={(e) => setError(e)}
returnKeyLabel="Next"
returnKeyLabel={strings.next()}
returnKeyType="next"
autoComplete="email"
validationType="email"
autoCorrect={false}
autoCapitalize="none"
errorMessage="Email is invalid"
placeholder="Email"
errorMessage={strings.email()}
placeholder={strings.email()}
onSubmit={() => {
passwordInputRef.current?.focus();
}}
@@ -193,14 +196,14 @@ export const Signup = ({ changeMode, trial }) => {
}}
testID="input.password"
onErrorCheck={(e) => setError(e)}
returnKeyLabel="Next"
returnKeyLabel={strings.next()}
returnKeyType="next"
secureTextEntry
autoComplete="password"
autoCapitalize="none"
validationType="password"
autoCorrect={false}
placeholder="Password"
placeholder={strings.password()}
onSubmit={() => {
confirmPasswordInputRef.current?.focus();
}}
@@ -213,7 +216,7 @@ export const Signup = ({ changeMode, trial }) => {
}}
testID="input.confirmPassword"
onErrorCheck={(e) => setError(e)}
returnKeyLabel="Signup"
returnKeyLabel={strings.done()}
returnKeyType="done"
secureTextEntry
autoComplete="password"
@@ -221,7 +224,7 @@ export const Signup = ({ changeMode, trial }) => {
autoCorrect={false}
validationType="confirmPassword"
customValidator={() => password.current}
placeholder="Confirm password"
placeholder={strings.confirmPassword()}
marginBottom={12}
onSubmit={signup}
/>
@@ -233,7 +236,7 @@ export const Signup = ({ changeMode, trial }) => {
size={SIZE.xs}
color={colors.secondary.paragraph}
>
By signing up, you agree to our{" "}
{strings.signupAgreement[0]()}
<Paragraph
size={SIZE.xs}
onPress={() => {
@@ -244,9 +247,9 @@ export const Signup = ({ changeMode, trial }) => {
}}
color={colors.primary.accent}
>
Terms of Service{" "}
{strings.signupAgreement[1]()}
</Paragraph>
and{" "}
{strings.signupAgreement[2]()}
<Paragraph
size={SIZE.xs}
onPress={() => {
@@ -257,14 +260,13 @@ export const Signup = ({ changeMode, trial }) => {
}}
color={colors.primary.accent}
>
Privacy Policy.
</Paragraph>{" "}
You also agree to recieve marketing emails from us which you can
opt-out of from app settings.
{strings.signupAgreement[3]()}
</Paragraph>
{strings.signupAgreement[4]()}
</Paragraph>
<Button
title={!loading ? "Continue" : null}
title={!loading ? strings.continue() : null}
type="accent"
loading={loading}
onPress={signup}
@@ -289,12 +291,12 @@ export const Signup = ({ changeMode, trial }) => {
}}
>
<Paragraph size={SIZE.xs + 1} color={colors.secondary.paragraph}>
Already have an account?{" "}
{strings.alreadyHaveAccount()}{" "}
<Paragraph
size={SIZE.xs + 1}
style={{ color: colors.primary.accent }}
>
Login
{strings.login()}
</Paragraph>
</Paragraph>
</TouchableOpacity>

View File

@@ -24,7 +24,7 @@ import useTimer from "../../hooks/use-timer";
import {
eSendEvent,
presentSheet,
ToastEvent
ToastManager
} from "../../services/event-manager";
import { useThemeColors } from "@notesnook/theme";
import { eCloseSheet } from "../../utils/events";
@@ -32,11 +32,13 @@ import { SIZE } from "../../utils/size";
import { Button } from "../ui/button";
import { IconButton } from "../ui/icon-button";
import Input from "../ui/input";
import { PressableButton } from "../ui/pressable";
import { Pressable } from "../ui/pressable";
import Seperator from "../ui/seperator";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { useCallback } from "react";
import { ScrollView } from "react-native-actions-sheet";
import { strings } from "@notesnook/intl";
const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
const { colors } = useThemeColors();
@@ -50,20 +52,6 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
const inputRef = useRef();
const [sending, setSending] = useState(false);
const codeHelpText = {
app: "Enter the 6 digit code from your authenticator app to continue logging in",
sms: "Enter the 6 digit code sent to your phone number to continue logging in",
email: "Enter the 6 digit code sent to your email to continue logging in",
recoveryCode: "Enter the recovery code to continue logging in"
};
const secondaryMethodsText = {
app: "I don't have access to authenticator app",
sms: "I don't have access to my phone",
email: "I don't have access to email",
recoveryCode: "I don't have recovery codes"
};
const onNext = async () => {
if (!code.current || code.current.length < 6) return;
setLoading(true);
@@ -93,22 +81,22 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
const methods = [
{
id: "sms",
title: "Send code via SMS",
title: strings.sendCodeSms(),
icon: "message-plus-outline"
},
{
id: "email",
title: "Send code via email",
title: strings.sendCodeEmail(),
icon: "email-outline"
},
{
id: "app",
title: "Enter code from authenticator app",
title: strings.authAppCode(),
icon: "cellphone-key"
},
{
id: "recoveryCode",
title: "I have a recovery code",
title: strings.recoveryCode(),
icon: "key"
}
];
@@ -138,12 +126,15 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
setSending(false);
} catch (e) {
setSending(false);
ToastEvent.error(e, "Error sending 2FA Code", "local");
ToastManager.error(e, "Error sending 2FA Code", "local");
}
}, [currentMethod.method, mfaInfo.token, seconds, sending, start]);
return (
<View>
<ScrollView
keyboardShouldPersistTaps="handled"
keyboardDismissMode="interactive"
>
<View
style={{
alignItems: "center",
@@ -151,7 +142,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
}}
>
<IconButton
customStyle={{
style={{
width: 70,
height: 70
}}
@@ -164,9 +155,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
textAlign: "center"
}}
>
{currentMethod.method
? "Two factor authentication"
: "Select methods for two-factor authentication"}
{currentMethod.method ? strings["2fa"]() : strings.select2faMethod()}
</Heading>
<Paragraph
style={{
@@ -174,8 +163,8 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
textAlign: "center"
}}
>
{codeHelpText[currentMethod.method] ||
"Select how you would like to recieve the code"}
{strings["2faCodeHelpText"][currentMethod.method]() ||
strings.select2faCodeHelpText()}
</Paragraph>
<Seperator />
@@ -183,11 +172,15 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
{currentMethod.method === "sms" || currentMethod.method === "email" ? (
<Button
onPress={onSendCode}
type={seconds ? "gray" : "transparent"}
type={seconds ? "plain" : "transparent"}
title={
sending
? ""
: `${seconds ? `Resend code in (${seconds})` : "Send code"}`
: `${
seconds
? strings.resend2faCode(seconds)
: strings.sendCode()
}`
}
loading={sending}
height={30}
@@ -214,6 +207,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
code.current = value;
//onNext();
}}
onSubmitEditing={onNext}
caretHidden
inputStyle={{
fontSize: SIZE.lg,
@@ -225,6 +219,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
keyboardType={
currentMethod.method === "recoveryCode" ? "default" : "numeric"
}
enablesReturnKeyAutomatically
containerStyle={{
height: 60,
borderWidth: 0,
@@ -234,7 +229,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
/>
<Seperator />
<Button
title={loading ? null : "Next"}
title={loading ? null : strings.next()}
type="accent"
width={250}
loading={loading}
@@ -246,8 +241,10 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
/>
<Button
title={secondaryMethodsText[currentMethod.method]}
type="gray"
title={strings["2faCodeSecondaryMethodText"][
currentMethod.method
]()}
type="plain"
onPress={onRequestSecondaryMethod}
height={30}
/>
@@ -255,7 +252,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
) : (
<>
{getMethods().map((item) => (
<PressableButton
<Pressable
key={item.title}
onPress={() => {
setCurrentMethod({
@@ -263,7 +260,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
isPrimary: false
});
}}
customStyle={{
style={{
paddingHorizontal: 12,
paddingVertical: 12,
marginTop: 0,
@@ -275,8 +272,8 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
}}
>
<IconButton
type="grayAccent"
customStyle={{
type="secondaryAccented"
style={{
width: 40,
height: 40,
marginRight: 10
@@ -292,12 +289,12 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
>
<Paragraph size={SIZE.md}>{item.title}</Paragraph>
</View>
</PressableButton>
</Pressable>
))}
</>
)}
</View>
</View>
</ScrollView>
);
};

View File

@@ -19,13 +19,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useRef, useState } from "react";
import { db } from "../../common/database";
import { eSendEvent, ToastEvent } from "../../services/event-manager";
import { eSendEvent, ToastManager } from "../../services/event-manager";
import { clearMessage } from "../../services/message";
import PremiumService from "../../services/premium";
import SettingsService from "../../services/settings";
import { useUserStore } from "../../stores/use-user-store";
import { eCloseSheet } from "../../utils/events";
import TwoFactorVerification from "./two-factor";
import { strings } from "@notesnook/intl";
export const LoginSteps = {
emailAuth: 1,
@@ -48,9 +49,9 @@ export const useLogin = (onFinishLogin, sessionExpired = false) => {
(!password.current && step === LoginSteps.passwordAuth) ||
(!email.current && step === LoginSteps.emailAuth)
) {
ToastEvent.show({
heading: "All fields required",
message: "Fill all the fields and try again",
ToastManager.show({
heading: strings.allFieldsRequired(),
message: strings.allFieldsRequiredDesc(),
type: "error",
context: "local"
});
@@ -83,7 +84,7 @@ export const useLogin = (onFinishLogin, sessionExpired = false) => {
setLoading(false);
setTimeout(() => {
passwordInputRef.current?.focus();
}, 1);
}, 500);
callback && callback(true);
}
callback && callback(false);
@@ -97,7 +98,7 @@ export const useLogin = (onFinishLogin, sessionExpired = false) => {
}
}, mfaInfo);
} else {
finishWithError(new Error("Unable to send 2FA code"));
finishWithError(new Error(strings.unableToSend2faCode()));
}
break;
}
@@ -121,8 +122,8 @@ export const useLogin = (onFinishLogin, sessionExpired = false) => {
const finishWithError = async (e) => {
if (e.message === "invalid_grant") setStep(LoginSteps.emailAuth);
setLoading(false);
ToastEvent.show({
heading: "Login failed",
ToastManager.show({
heading: strings.loginFailed(),
message: e.message,
type: "error",
context: "local"
@@ -131,13 +132,13 @@ export const useLogin = (onFinishLogin, sessionExpired = false) => {
const finishLogin = async () => {
const user = await db.user.getUser();
if (!user) throw new Error("Email or password incorrect!");
if (!user) throw new Error(strings.emailOrPasswordIncorrect());
PremiumService.setPremiumStatus();
setUser(user);
clearMessage();
ToastEvent.show({
heading: "Login successful",
message: `Logged in as ${user.email}`,
ToastManager.show({
heading: strings.loginSuccess(),
message: strings.loginSuccessDesc(),
type: "success",
context: "global"
});

View File

@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { useThemeColors } from "@notesnook/theme";
import { useRoute } from "@react-navigation/native";
import React, { useCallback, useEffect } from "react";
import { Keyboard, View } from "react-native";
import Animated, {
@@ -33,26 +34,25 @@ import { useSelectionStore } from "../../stores/use-selection-store";
import { useSettingStore } from "../../stores/use-setting-store";
import { getElevationStyle } from "../../utils/elevation";
import { SIZE, normalize } from "../../utils/size";
import NativeTooltip from "../../utils/tooltip";
import { PressableButton } from "../ui/pressable";
import { Pressable } from "../ui/pressable";
interface FloatingButton {
title?: string;
interface FloatingButtonProps {
onPress: () => void;
color?: string;
shouldShow?: boolean;
alwaysVisible?: boolean;
}
const FloatingButton = ({
title,
onPress,
color,
alwaysVisible = false
}: FloatingButton) => {
}: FloatingButtonProps) => {
const { colors } = useThemeColors();
const deviceMode = useSettingStore((state) => state.deviceMode);
const selectionMode = useSelectionStore((state) => state.selectionMode);
const translate = useSharedValue(0);
const route = useRoute();
const animatedStyle = useAnimatedStyle(() => {
return {
@@ -115,19 +115,14 @@ const FloatingButton = ({
animatedStyle
]}
>
<PressableButton
<Pressable
testID={notesnook.buttons.add}
type="accent"
accentColor={colors.static[color as keyof typeof colors.static]}
customStyle={{
accentColor={color}
style={{
...getElevationStyle(5),
borderRadius: 100
}}
onLongPress={(event) => {
if (title) {
NativeTooltip.show(event, title, NativeTooltip.POSITIONS.LEFT);
}
}}
onPress={onPress}
>
<View
@@ -139,12 +134,18 @@ const FloatingButton = ({
}}
>
<Icon
name={title === "Clear all trash" ? "delete" : "plus"}
name={
route.name === "Notebooks"
? "notebook-plus"
: route.name === "Trash"
? "delete"
: "plus"
}
color={colors.primary.accentForeground}
size={SIZE.xxl}
/>
</View>
</PressableButton>
</Pressable>
</Animated.View>
);
};

View File

@@ -17,41 +17,49 @@ 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 React, { PropsWithChildren } from "react";
import { KeyboardAvoidingView, Platform } from "react-native";
import React, { PropsWithChildren, useEffect, useRef, useState } from "react";
import { Dimensions, Platform, View, useWindowDimensions } from "react-native";
import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";
import useIsFloatingKeyboard from "../../hooks/use-is-floating-keyboard";
import { useSettingStore } from "../../stores/use-setting-store";
import { Header } from "../header";
import SelectionHeader from "../selection-header";
import useKeyboard from "../../hooks/use-keyboard";
import { useThemeColors } from "@notesnook/theme";
export const Container = ({ children }: PropsWithChildren) => {
const floating = useIsFloatingKeyboard();
const introCompleted = useSettingStore(
(state) => state.settings.introCompleted
);
const { colors } = useThemeColors();
const insets = useGlobalSafeAreaInsets();
const keyboard = useKeyboard();
const [height, setHeight] = useState(0);
const windowHeightRef = useRef(Dimensions.get("window").height);
const { height: windowHeight } = useWindowDimensions();
const timerRef = useRef<NodeJS.Timeout>();
useEffect(() => {
if (windowHeight !== windowHeightRef.current) {
setHeight(0);
windowHeightRef.current = windowHeight;
}
}, [windowHeight]);
return (
<KeyboardAvoidingView
behavior="padding"
enabled={Platform.OS === "ios" && !floating}
<View
style={{
flex: 1,
overflow: "hidden",
paddingTop: Platform.OS === "android" ? 0 : insets.top,
paddingBottom: Platform.OS === "android" ? 0 : insets.bottom
paddingBottom: Platform.OS === "android" ? 0 : insets.bottom,
height: height || "100%",
width: "100%",
backgroundColor: colors.primary.background
}}
onLayout={(event) => {
const height = event.nativeEvent.layout.height;
clearTimeout(timerRef.current);
timerRef.current = setTimeout(() => {
if (!keyboard.keyboardShown) {
setHeight(height);
}
}, 500);
}}
>
{!introCompleted ? null : (
<>
<SelectionHeader />
<Header />
</>
)}
{children}
</KeyboardAvoidingView>
</View>
);
};

View File

@@ -44,7 +44,7 @@ export default function DelayLayout({
}: IDelayLayoutProps) {
const { colors } = useThemeColors();
const loading = useDelayLayout(
!props.delay || props.delay < 300 ? 300 : props.delay
!props.delay || props.delay < 300 ? 0 : props.delay
);
const Placeholder = placeholder[props.type || "default"];

View File

@@ -17,15 +17,16 @@ 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 React from "react";
import { useNoteStore } from "../../stores/use-notes-store";
import { useThemeColors } from "@notesnook/theme";
import React from "react";
import { AnnouncementDialog } from "../announcements";
import AuthModal from "../auth/auth-modal";
import { SessionExpired } from "../auth/session-expired";
import { Dialog } from "../dialog";
import { AddTopicDialog } from "../dialogs/add-topic";
import { AppLockPassword } from "../dialogs/applock-password";
import JumpToSectionDialog from "../dialogs/jump-to-section";
import { LoadingDialog } from "../dialogs/loading";
import PDFPreview from "../dialogs/pdf-preview";
import ResultDialog from "../dialogs/result";
import { VaultDialog } from "../dialogs/vault";
import ImagePreview from "../image-preview";
@@ -35,33 +36,32 @@ import { Expiring } from "../premium/expiring";
import SheetProvider from "../sheet-provider";
import RateAppSheet from "../sheets/rate-app";
import RecoveryKeySheet from "../sheets/recovery-key";
import RestoreDataSheet from "../sheets/restore-data";
import PDFPreview from "../dialogs/pdf-preview";
import Progress from "../dialogs/progress";
const DialogProvider = () => {
const { colors } = useThemeColors();
const loading = useNoteStore((state) => state.loading);
return (
<>
<AppLockPassword />
<LoadingDialog />
<Dialog context="global" />
<AddTopicDialog colors={colors} />
<PremiumDialog colors={colors} />
<AuthModal colors={colors} />
<MergeConflicts />
<RecoveryKeySheet colors={colors} />
<SheetProvider />
<SheetProvider context="sync_progress" />
<RestoreDataSheet />
<ResultDialog />
<VaultDialog colors={colors} />
<RateAppSheet />
<ImagePreview />
{loading ? null : <Expiring />}
<Expiring />
<AnnouncementDialog />
<SessionExpired />
<PDFPreview />
<JumpToSectionDialog />
<Progress />
</>
);
};

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