Compare commits

...

1074 Commits

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

* mobile: fix db init in background

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

* mobile: improve db init in app/share extension

* mobile: cleanup

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

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

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

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

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

* editor: added headers

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

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

* core: move html template styles to core

* core: inline prism-dracula styles

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* editor(#1228): use STD console instead

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

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

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

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

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

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

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

For example:

An item at version 5.2 will go through:
- 5.3
- 5.4
- and so on
2022-10-13 19:18:52 +05:00
Abdullah Atta
9701a3d660 web: make table row toolbar vertical for compactness 2022-10-13 19:18:33 +05:00
Abdullah Atta
73ed73b2b3 web: improve tag auto suggest 2022-10-12 20:16:26 +05:00
Abdullah Atta
c6201532f2 core: lookup by tag alias 2022-10-12 20:16:26 +05:00
Abdullah Atta
b5ab8e5d3e core: allow free users to assign same 5 tags without limits 2022-10-12 20:16:26 +05:00
Abdullah Atta
74bcd1b27d web: clicking under table should create a new paragraph 2022-10-12 15:16:42 +05:00
Abdullah Atta
d2d269e4ca editor: toggle only the clicked item if it's not selected 2022-10-12 15:16:29 +05:00
ammarahm-ed
595994a495 mobile: add skip signup button on welcome 2022-10-12 14:41:46 +05:00
Abdullah Atta
ee0fb3680a desktop: reduce minimum required macOS version to 10.12.0
This fixes #1180
2022-10-12 14:35:07 +05:00
ammarahm-ed
9d7c2bbe15 mobile: use fixed numColumns value 2022-10-12 13:26:07 +05:00
ammarahm-ed
b975c9c8ca mobile: prevent saving if note content is empty 2022-10-12 13:04:59 +05:00
ammarahm-ed
bc8a336254 mobile: wait before saving note in widget 2022-10-12 13:04:06 +05:00
ammarahm-ed
9934417d07 mobile: disable encrypted backups account downgrade 2022-10-12 10:35:22 +05:00
ammarahm-ed
05f3709a5c mobile: fix app freeze on adding > 3 notebooks 2022-10-12 10:30:43 +05:00
Abdullah Atta
b5843c24d4 editor: do not use shebang to execute build script 2022-10-06 13:19:44 +05:00
ammarahm-ed
80cf1f9bb6 mobile: bump version to 2.2.3 2022-10-06 12:25:47 +05:00
ammarahm-ed
92aab25da2 mobile: fix crash on android 7.0 devices 2022-10-06 12:05:50 +05:00
ammarahm-ed
9af77e1161 mobile: fix incorrect device orientation detection 2022-09-30 11:40:16 +05:00
Abdullah Atta
bba3e5cf37 desktop: update package-lock.json 2022-09-29 22:40:52 +05:00
Abdullah Atta
b384f85b01 desktop: use official electron-builder-notarize package 2022-09-29 22:37:10 +05:00
Abdullah Atta
aa27c27e8b ci: fix altool command for deploying to testflight 2022-09-29 21:29:45 +05:00
Abdullah Atta
c81046081f ci: specify full path to API_KEY 2022-09-29 21:13:18 +05:00
ammarahm-ed
fea0bade69 mobile: bump version code on android 2022-09-29 20:27:46 +05:00
Abdullah Atta
cd9096d1a8 ci: change both APPLE_API_KEY env_vars 2022-09-29 20:26:17 +05:00
Ammar Ahmed
dc92f40ee2 Merge pull request #1104 from streetwriters/fix-migration-flow
Fix migration flow
2022-09-29 20:26:03 +05:00
Abdullah Atta
2f5de8149d ci: use api key name as APPLE_API_KEY 2022-09-29 20:14:29 +05:00
Abdullah Atta
f7ade8a4c3 ci: upload web app build artifact folder 2022-09-29 19:59:07 +05:00
Abdullah Atta
f200737e9b ci: do not skip snapcraft publishing 2022-09-29 19:50:22 +05:00
Abdullah Atta
32283e973b desktop: use custom fork of electron-builder-notarize 2022-09-29 19:46:41 +05:00
Abdullah Atta
ce889cf1c3 web: bump version to v2.2.1 2022-09-29 19:05:25 +05:00
ammarahm-ed
6ab9777fbd mobile: bump version to 2.2.2 2022-09-29 18:52:52 +05:00
ammarahm-ed
e3820b3e12 mobile: remove pin limit 2022-09-29 18:48:13 +05:00
Abdullah Atta
53ce66f4a6 web: remove limit on no. of pins 2022-09-29 18:48:13 +05:00
Abdullah Atta
c19fed1d9f ci: add proper env_vars for mac-os app notarization 2022-09-29 18:42:23 +05:00
Abdullah Atta
0eeaf808fc desktop: fix issue with snap desktop integration 2022-09-29 18:17:11 +05:00
Abdullah Atta
78afb7eaf7 web: update note title only on note open
this was a subtle bug where typing really fast in the editor
caused jank & erratic behavior.
2022-09-29 18:09:03 +05:00
Abdullah Atta
6469c6d689 core: forcefully set item type to tiptap if it is content 2022-09-29 16:59:43 +05:00
ammarahm-ed
3c00938fe8 mobile: fix back button hidden on tablet 2022-09-29 16:04:13 +05:00
Abdullah Atta
2334987359 web: set user status to premium during tests 2022-09-29 16:03:24 +05:00
Abdullah Atta
745c89ef86 web: fix issue where onboarding is shown to everyone
this happened due to a very annoying issue with javascript where
`null <= 0` is true but `null === 0` is false & `null < 0` is false too.
2022-09-29 16:03:24 +05:00
Abdullah Atta
2d277fbe2b web: don't treat dev environment as a special case 2022-09-29 16:03:24 +05:00
Abdullah Atta
f69afd2d9a editor: defer update propagation by 100ms
by default our editor sends an update "signal" on every single transaction.
This is oftentimes unnecessary. We can
improve the responsiveness by deferring this so multiple transactions cause
1 rerender.
2022-09-29 15:56:24 +05:00
Abdullah Atta
02459d759f web: speed up word counting
Previously we moved to getting the `innerText` directly from the browser.
This was okay but it strained the browser quite a bit. Now we are moving
back to using `textBetween` since after some benchmarking the difference
in speed is minimal. It is possible
that there is a better alternative
specifically designed for prosemirror.
2022-09-29 15:56:24 +05:00
Abdullah Atta
69d48ce5c1 editor: menus not opening on web/desktop 2022-09-29 15:56:05 +05:00
Abdullah Atta
db5abecb43 web: set title on nav item menus 2022-09-29 15:55:52 +05:00
Abdullah Atta
89123c0be5 web: right click on selected items deselects them 2022-09-29 15:55:52 +05:00
Abdullah Atta
119a931312 web: install @types/marked 2022-09-29 15:55:37 +05:00
Abdullah Atta
e3d86440c1 web: open all links in release notes in a new tab/window 2022-09-29 15:55:37 +05:00
Abdullah Atta
20819325fb core: add null sanity checks in migration 2022-09-29 15:12:20 +05:00
Abdullah Atta
8a19fd8de5 desktop: handle MAC_APP_STORE is not defined error 2022-09-29 14:37:35 +05:00
ammarahm-ed
65b8faa5c9 mobile: add error handling in migration sheet 2022-09-29 14:13:27 +05:00
ammarahm-ed
058431836d mobile: add missing null check 2022-09-29 10:32:28 +05:00
ammarahm-ed
f7d0267ad5 mobile: bump version to 2.2.1 2022-09-28 18:03:37 +05:00
ammarahm-ed
4fc4951e2e mobile: fix crash in notes list 2022-09-28 15:42:33 +05:00
1290 changed files with 130412 additions and 58712 deletions

View File

@@ -20,6 +20,7 @@ const SCOPES = [
"logger",
"theme",
"core",
"clipper",
"config",
"ci",
"setup",

View File

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

View File

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

4
.github/dco.yml vendored Normal file
View File

@@ -0,0 +1,4 @@
allowRemediationCommits:
individual: true
require:
members: false

View File

@@ -0,0 +1,64 @@
name: Publish @notesnook/android-internal
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@master
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
- name: Use specific Java version for the builds
uses: joschi/setup-jdk@v2
with:
java-version: '11'
architecture: 'x64'
- name: Install node modules
run: |
npm ci
- name: Make Gradlew Executable
run: cd apps/mobile/native/android && chmod +x ./gradlew
- name: Build unsigned app bundle
run: yarn release:android:bundle
- name: Sign app bundle for Playstore release
id: sign_app
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: apps/mobile/native/android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Publish to Playstore
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.streetwriters.notesnook
releaseFile: ${{steps.sign_app.outputs.signedReleaseFile}}
track: internal
status: completed
whatsNewDirectory: apps/mobile/native/android/releasenotes/

View File

@@ -50,7 +50,18 @@ jobs:
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Publish to Playstore
id: deploy
uses: r0adkll/upload-google-play@v1.1.1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.streetwriters.notesnook
releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}}
track: production
status: completed
whatsNewDirectory: apps/mobile/native/android/releasenotes/
- name: Build apks for Github release
run: yarn release:android
@@ -91,15 +102,4 @@ jobs:
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: Publish to Playstore
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.streetwriters.notesnook
releaseFile: ${{steps.sign_app.outputs.signedReleaseFile}}
track: production
status: completed
whatsNewDirectory: apps/mobile/native/android/releasenotes/
apps/mobile/native/android/app/build/outputs/apk/release/notesnook-x86_64.apk

View File

@@ -45,9 +45,10 @@ jobs:
npm ci --prefer-offline --no-audit
- name: Add environment variables
run: |
echo "EMAIL=${{ secrets.USER_EMAIL }}" >> $GITHUB_ENV
echo "PASSWORD='${{ secrets.USER_PASSWORD }}'" >> $GITHUB_ENV
echo "HASHED_PASSWORD=${{ secrets.USER_HASHED_PASSWORD }}" >> $GITHUB_ENV
echo "USER_EMAIL=${{ secrets.USER_EMAIL }}" >> $GITHUB_ENV
echo "USER_PASSWORD=${{ secrets.USER_PASSWORD }}" >> $GITHUB_ENV
echo "USER_TOTP_SECRET=${{ secrets.USER_TOTP_SECRET }}" >> $GITHUB_ENV
echo "USER_HASHED_PASSWORD=${{ secrets.USER_HASHED_PASSWORD }}" >> $GITHUB_ENV
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
- name: Run all @notesnook/core tests

View File

@@ -62,6 +62,26 @@ jobs:
name: build
path: apps/web/build/**/*
- name: Collect app metadata
id: app_metadata
working-directory: ./apps/web/desktop
run: |
echo ::set-output name=app_version::$(cat package.json | jq -r .version)
- name: Package desktop build
run: |
zip -r ./notesnook_build_v${{ steps.app_metadata.outputs.app_version }}.zip ./apps/web/build/
echo "Build folder archived to ./notesnook_build_v${{ steps.app_metadata.outputs.app_version }}.zip"
- name: Upload desktop build
uses: softprops/action-gh-release@v1
if: inputs.publish-github
with:
draft: true
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
build-macos:
name: Build for macOS
needs: build
@@ -107,7 +127,9 @@ jobs:
path: ./apps/web/desktop/build
- name: Install packages
run: npm i
run: |
npm i
npm i dmg-license
working-directory: ./apps/web/desktop
- name: Install provisioning profile
@@ -129,6 +151,9 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_LINK: ${{ secrets.mac_certs }}
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 }}
run: |
npm run build
if [ ${{ inputs.publish-github }} == true ]; then
@@ -148,7 +173,7 @@ jobs:
echo "Uploading ${package} using altool..."
xcrun altool --upload-package $package -t osx --apiKey $API_KEY_ID --apiIssuer $API_KEY_ISSUER_ID --apple-id ${{ steps.app_metadata.outputs.apple_app_id }} --bundle-id ${{ steps.app_metadata.outputs.app_bundle_id }}--bundle-short-version-string ${{ steps.app_metadata.outputs.app_version }} --bundle-version ${{ steps.app_metadata.outputs.bundle_version }}
xcrun altool --upload-package $package -t osx --apiKey $API_KEY_ID --apiIssuer $API_KEY_ISSUER_ID --apple-id ${{ steps.app_metadata.outputs.apple_app_id }} --bundle-id ${{ steps.app_metadata.outputs.app_bundle_id }} --bundle-short-version-string ${{ steps.app_metadata.outputs.app_version }} --bundle-version ${{ steps.app_metadata.outputs.bundle_version }}
working-directory: ./apps/web/desktop
build-linux:
@@ -160,12 +185,6 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Collect app metadata
id: app_metadata
working-directory: ./apps/web/desktop
run: |
echo ::set-output name=app_version::$(cat package.json | jq -r .version)
- name: Setup Snapcraft Auth
if: inputs.publish-snap
run: echo "SNAPCRAFT_STORE_CREDENTIALS=${{ secrets.snapcraft_token }}" >> $GITHUB_ENV
@@ -173,13 +192,6 @@ jobs:
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
if: inputs.publish-snap
- name: Get version info from Snapcraft
if: inputs.publish-snap
id: snapcraft
run:
echo ::set-output name=is_published::$(snapcraft status notesnook | grep ${{ steps.app_metadata.outputs.app_version }} | wc -l)
echo $is_published
- name: Setup Node
uses: actions/setup-node@v3
@@ -201,24 +213,24 @@ jobs:
working-directory: ./apps/web/desktop
- name: Build snap
if: inputs.publish-snap && steps.snapcraft.outputs.is_published <= 0
if: inputs.publish-snap
run: |
npx electron-builder --linux snap -p never
npx electron-builder --linux snap:x64 -p never
working-directory: ./apps/web/desktop
- name: Build AppImage deb and rpm
- name: Build AppImage
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ ${{ inputs.publish-github }} == true ]; then
npx electron-builder --linux AppImage deb rpm -p always
npx electron-builder --linux AppImage:x64 AppImage:arm64 -p always
else
npx electron-builder --linux AppImage deb rpm -p never
npx electron-builder --linux AppImage:x64 AppImage:arm64 -p never
fi
working-directory: ./apps/web/desktop
- name: Publish on Snapcraft
if: inputs.publish-snap && steps.snapcraft.outputs.is_published <= 0
if: inputs.publish-snap
run: |
snapcraft upload --release=stable ./dist/notesnook_linux_amd64.snap
working-directory: ./apps/web/desktop

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

@@ -0,0 +1,57 @@
name: Test @notesnook/editor
on:
workflow_dispatch:
push:
branches:
- "master"
paths:
- "packages/editor/**"
# re-run workflow if workflow file changes
- ".github/workflows/editor.tests.yml"
pull_request:
types:
- "ready_for_review"
- "opened"
- "synchronize"
- "reopened"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
- name: Install packages
run: |
npm i --ignore-scripts --prefer-offline --no-audit
npx lerna bootstrap --ignore=@notesnook/mobile -- --prefer-offline --no-audit
- name: Setup environment
run: |
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
- name: Build editor
run: npx nx build @notesnook/editor
- name: Run all @notesnook/editor tests
run: npx nx test @notesnook/editor

View File

@@ -63,7 +63,7 @@ jobs:
name: 🧪 Test (${{ matrix.shard }}/${{ strategy.job-total }})
strategy:
matrix:
shard: [1, 2, 3]
shard: [1, 2, 3, 4]
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -95,7 +95,7 @@ jobs:
- name: Install packages
run: |
npm i --ignore-scripts --prefer-offline --no-audit
npm install -D @playwright/test
npm install -D @playwright/test otplib
- name: Validate build extraction
run: ls -ld ./apps/web/build/index.html
@@ -107,8 +107,9 @@ jobs:
- name: Add environment variables
run: |
echo "USER_EMAIL=${{ secrets.USER_EMAIL }}" >> $GITHUB_ENV
echo "CURRENT_USER_PASSWORD=${{ secrets.USER_PASSWORD }}" >> $GITHUB_ENV
echo "CURRENT_USER_KEY=${{ secrets.USER_KEY }}" >> $GITHUB_ENV
echo "USER_PASSWORD=${{ secrets.USER_PASSWORD }}" >> $GITHUB_ENV
echo "USER_TOTP_SECRET=${{ secrets.USER_TOTP_SECRET }}" >> $GITHUB_ENV
echo "USER_KEY=${{ secrets.USER_KEY }}" >> $GITHUB_ENV
- name: Run tests
run: npx playwright test --shard=${{ matrix.shard }}/${{ strategy.job-total }}

6
.gitignore vendored
View File

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

View File

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

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

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

72
.vscode/notesnook.code-workspace vendored Normal file
View File

@@ -0,0 +1,72 @@
{
"folders": [
{
"name": "✨ notesnook",
"path": ".."
},
{
"name": "🚀 @notesnook/mobile",
"path": "../apps/mobile"
},
{
"name": "🚀 @notesnook/web",
"path": "../apps/web"
},
{
"name": "🚀 @notesnook/desktop",
"path": "../apps/web/desktop"
},
{
"name": "🚀 @notesnook/web-clipper",
"path": "../extensions/web-clipper"
},
{
"name": "📦 @notesnook/clipper",
"path": "../packages/clipper"
},
{
"name": "📦 @notesnook/core",
"path": "../packages/core"
},
{
"name": "📦 @notesnook/crypto",
"path": "../packages/crypto"
},
{
"name": "📦 @notesnook/crypto-worker",
"path": "../packages/crypto-worker"
},
{
"name": "📦 @notesnook/editor",
"path": "../packages/editor"
},
{
"name": "📦 @notesnook/editor-mobile",
"path": "../packages/editor-mobile"
},
{
"name": "📦 @notesnook/logger",
"path": "../packages/logger"
},
{
"name": "📦 @notesnook/streamable-fs",
"path": "../packages/streamable-fs"
},
{
"name": "📦 @notesnook/theme",
"path": "../packages/theme"
}
],
"settings": {
"typescript.tsdk": "node_modules/typescript/lib",
"javascript.format.enable": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modificationsIfAvailable",
"eslint.packageManager": "npm",
"eslint.run": "onSave",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.execArgv": ["--cache"]
}
}

View File

@@ -1,3 +0,0 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}

View File

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

View File

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

View File

@@ -10,11 +10,11 @@
## Overview
Notesnook is a free (as in speech) & open source note taking app focused on user privacy & ease of use. To ensure zero knowledge principles, Notesnook encrypts everything on your device using `XChaCha20-Poly1305` & `Argon2`.
Notesnook is a free (as in speech) & open-source note-taking app focused on user privacy & ease of use. To ensure zero knowledge principles, Notesnook encrypts everything on your device using `XChaCha20-Poly1305` & `Argon2`.
Notesnook is our **proof** that privacy does _not_ (always) have to come at the cost of convenience. Our goal is to provide users peace of mind & 100% confidence that their notes are safe and secure. The decision to go fully open source is one of the most crucial steps towards that.
Notesnook is our **proof** that privacy does _not_ (always) have to come at the cost of convenience. We aim to provide users peace of mind & 100% confidence that their notes are safe and secure. The decision to go fully open source is one of the most crucial steps towards that.
This repository contains all the code required to build & use the Notesnook web, desktop & mobile clients. If you are looking for a full features list or screenshots, please check the [website](https://notesnook.com/).
This repository contains all the code required to build & use the Notesnook web, desktop & mobile clients. If you are looking for a full feature list or screenshots, please check the [website](https://notesnook.com/).
## Developer guide

View File

@@ -25,4 +25,4 @@
"request": "attach"
}
]
}
}

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import "react-native-gesture-handler";
import React, { useEffect } from "react";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { SafeAreaProvider } from "react-native-safe-area-context";
@@ -30,16 +30,28 @@ import SettingsService from "./services/settings";
import { TipManager } from "./services/tip-manager";
import { useUserStore } from "./stores/use-user-store";
import { View } from "react-native";
import { useState } from "react";
import NetInfo from "@react-native-community/netinfo";
NetInfo.configure({
reachabilityUrl: "https://notesnook.com",
reachabilityTest: (response) => {
if (!response) return false;
return response?.status >= 200 && response?.status < 300;
}
});
SettingsService.init();
SettingsService.checkOrientation();
const App = () => {
useAppEvents();
const [init, setInit] = useState(false);
useEffect(() => {
let { appLockMode } = SettingsService.get();
if (appLockMode && appLockMode !== "none") {
useUserStore.getState().setVerifyUser(true);
}
//BackgroundSync.start();
setInit(true);
setTimeout(async () => {
SettingsService.onFirstLaunch();
await Notifications.get();
@@ -77,7 +89,7 @@ const App = () => {
}}
>
<ApplicationHolder />
<Launcher />
{init && <Launcher />}
</GestureHandlerRootView>
</View>
);

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ import { Platform } from "react-native";
import "react-native-get-random-values";
import * as Keychain from "react-native-keychain";
import { generateSecureRandom } from "react-native-securerandom";
import Sodium from "react-native-sodium";
import Sodium from "@ammarahmed/react-native-sodium";
const KEYSTORE_CONFIG = Platform.select({
ios: {

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,10 +25,12 @@ import filesystem from "../filesystem";
import EventSource from "../../utils/sse/even-source-ios";
import AndroidEventSource from "../../utils/sse/event-source";
import Storage, { KV } from "./storage";
import * as Gzip from "react-native-gzip";
const LoggerStorage = new MMKVLoader()
.withInstanceID("notesnook_logs")
.initialize();
initalize(new KV(LoggerStorage));
initalize(new KV(LoggerStorage), true);
export const DatabaseLogger = dbLogger;
/**
@@ -37,7 +39,11 @@ export const DatabaseLogger = dbLogger;
export var db = new Database(
Storage,
Platform.OS === "ios" ? EventSource : AndroidEventSource,
filesystem
filesystem,
{
compress: Gzip.deflate,
decompress: Gzip.inflate
}
);
db.host(
@@ -48,11 +54,11 @@ db.host(
SSE_HOST: "https://events.streetwriters.co",
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
ISSUES_HOST: "https://issues.streetwriters.co"
// API_HOST: 'http://192.168.10.29:5264',
// AUTH_HOST: 'http://192.168.10.29:8264',
// SSE_HOST: 'http://192.168.10.29:7264',
// SUBSCRIPTIONS_HOST: 'http://192.168.10.29:9264',
// ISSUES_HOST: 'http://192.168.10.29:2624'
// API_HOST: "http://192.168.8.101:5264",
// AUTH_HOST: "http://192.168.8.101:8264",
// SSE_HOST: "http://192.168.8.101:7264",
// SUBSCRIPTIONS_HOST: "http://192.168.8.101:9264",
// ISSUES_HOST: "http://192.168.8.101:2624"
}
: {
API_HOST: "https://api.notesnook.com",
@@ -62,14 +68,3 @@ db.host(
ISSUES_HOST: "https://issues.streetwriters.co"
}
);
export async function loadDatabase() {
// if (!DB) {
// let module = await import(/* webpackChunkName: "notes-core" */ 'notes-core/api/index');
// DB = module.default;
// }
// db = new DB(Storage, Platform.OS === 'ios' ? EventSource : AndroidEventSource, filesystem);
// if (DOMParser) {
// await DOMParser.prepare();
// }
}

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react";
import { Platform } from "react-native";
import * as ScopedStorage from "react-native-scoped-storage";
import Sodium from "react-native-sodium";
import Sodium from "@ammarahmed/react-native-sodium";
import RNFetchBlob from "rn-fetch-blob";
import { ShareComponent } from "../../components/sheets/export-notes/share";
import { presentSheet, ToastEvent } from "../../services/event-manager";
@@ -28,8 +28,16 @@ import { useAttachmentStore } from "../../stores/use-attachment-store";
import { db } from "../database";
import Storage from "../database/storage";
import { cacheDir } from "./utils";
import { getFileNameWithExtension } from "@notesnook/core/utils/filename";
export default async function downloadAttachment(hash, global = true) {
export default async function downloadAttachment(
hash,
global = true,
options = {
silent: false,
cache: false
}
) {
let attachment = db.attachments.attachment(hash);
if (!attachment) {
console.log("attachment not found");
@@ -37,11 +45,13 @@ export default async function downloadAttachment(hash, global = true) {
}
let folder = {};
if (Platform.OS === "android") {
folder = await ScopedStorage.openDocumentTree();
if (!folder) return;
} else {
folder.uri = await Storage.checkAndCreateDir("/downloads/");
if (!options.cache) {
if (Platform.OS === "android") {
folder = await ScopedStorage.openDocumentTree();
if (!folder) return;
} else {
folder.uri = await Storage.checkAndCreateDir("/downloads/");
}
}
try {
@@ -54,6 +64,11 @@ export default async function downloadAttachment(hash, global = true) {
)
return;
let filename = getFileNameWithExtension(
attachment.metadata.filename,
attachment.metadata.type
);
let key = await db.attachments.decryptKey(attachment.key);
let info = {
iv: attachment.iv,
@@ -63,46 +78,50 @@ export default async function downloadAttachment(hash, global = true) {
hash: attachment.metadata.hash,
hashType: attachment.metadata.hashType,
mime: attachment.metadata.type,
fileName: attachment.metadata.filename,
uri: folder.uri,
fileName: options.cache ? undefined : filename,
uri: options.cache ? undefined : folder.uri,
chunkSize: attachment.chunkSize
};
let fileUri = await Sodium.decryptFile(key, info, false);
ToastEvent.show({
heading: "Download successful",
message: attachment.metadata.filename + " downloaded",
type: "success"
});
let fileUri = await Sodium.decryptFile(
key,
info,
options.cache ? "cache" : "file"
);
if (attachment.dateUploaded) {
if (!options.silent) {
ToastEvent.show({
heading: "Download successful",
message: filename + " downloaded",
type: "success"
});
}
if (
attachment.dateUploaded &&
!attachment.metadata?.type?.startsWith("image")
) {
RNFetchBlob.fs
.unlink(RNFetchBlob.fs.dirs.CacheDir + `/${attachment.metadata.hash}`)
.catch(console.log);
}
if (Platform.OS === "ios") {
fileUri = folder.uri + `/${attachment.metadata.filename}`;
if (Platform.OS === "ios" && !options.cache) {
fileUri = folder.uri + `/${filename}`;
}
if (!options.silent) {
presentSheet({
title: "File downloaded",
paragraph: `${filename} saved to ${
Platform.OS === "android"
? "selected path"
: "File Manager/Notesnook/downloads"
}`,
icon: "download",
context: global ? null : attachment.metadata.hash,
component: <ShareComponent uri={fileUri} name={filename} padding={12} />
});
}
console.log("saved file uri: ", fileUri);
presentSheet({
title: "File downloaded",
paragraph: `${attachment.metadata.filename} saved to ${
Platform.OS === "android"
? "selected path"
: "File Manager/Notesnook/downloads"
}`,
icon: "download",
context: global ? null : attachment.metadata.hash,
component: (
<ShareComponent
uri={fileUri}
name={attachment.metadata.filename}
padding={12}
/>
)
});
return fileUri;
} catch (e) {
console.log("download attachment error: ", e);

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,9 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Platform } from "react-native";
import Sodium from "react-native-sodium";
import Sodium from "@ammarahmed/react-native-sodium";
import RNFetchBlob from "rn-fetch-blob";
import { cacheDir, getRandomId } from "./utils";
import { db } from "../database";
import { compressToBase64 } from "./compress";
export async function readEncrypted(filename, key, cipherData) {
let path = `${cacheDir}/${filename}`;
@@ -29,6 +31,9 @@ export async function readEncrypted(filename, key, cipherData) {
if (!exists) {
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);
let output = await Sodium.decryptFile(
key,
@@ -36,28 +41,48 @@ export async function readEncrypted(filename, key, cipherData) {
...cipherData,
hash: filename
},
true
cipherData.outputType === "base64"
? isPng || isJpeg
? "cache"
: "base64"
: "text"
);
if (cipherData.outputType === "base64" && (isPng || isJpeg)) {
const dCachePath = `${cacheDir}/${output}`;
output = await compressToBase64(
`file://${dCachePath}`,
isPng ? "PNG" : "JPEG"
);
}
return output;
} catch (e) {
RNFetchBlob.fs.unlink(path).catch(console.log);
console.log(e);
console.log("error");
return false;
}
}
export async function writeEncrypted(filename, { data, type, key }) {
console.log("file input: ", { type, key });
export async function hashBase64(data) {
const hash = await Sodium.hashFile({
type: "base64",
data,
uri: ""
});
return {
hash: hash,
type: "xxh64"
};
}
export async function writeEncryptedBase64({ data, key }) {
let filepath = cacheDir + `/${getRandomId("imagecache_")}`;
console.log(filepath);
await RNFetchBlob.fs.writeFile(filepath, data, "base64");
let output = await Sodium.encryptFile(key, {
uri: Platform.OS === "ios" ? filepath : "file://" + filepath,
type: "url"
});
RNFetchBlob.fs.unlink(filepath).catch(console.log);
console.log("encrypted file output: ", output);
return {
...output,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,10 +23,7 @@ import { Linking, View } from "react-native";
import { eSendEvent, presentSheet } from "../../services/event-manager";
import Sync from "../../services/sync";
import { useThemeStore } from "../../stores/use-theme-store";
import {
eCloseAnnouncementDialog,
eCloseProgressDialog
} from "../../utils/events";
import { eCloseAnnouncementDialog, eCloseSheet } from "../../utils/events";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import { PricingPlans } from "../premium/pricing-plans";
@@ -60,11 +57,11 @@ export const Cta = ({ actions, style = {}, color, inline }) => {
)
});
} else if (item.type === "force-sync") {
eSendEvent(eCloseProgressDialog);
eSendEvent(eCloseSheet);
await sleep(300);
Progress.present();
Sync.run("global", true, true, () => {
eSendEvent(eCloseProgressDialog);
eSendEvent(eCloseSheet);
});
}
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,10 +35,7 @@ import PremiumService from "../../services/premium";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { useThemeStore } from "../../stores/use-theme-store";
import { formatBytes } from "../../utils";
import {
eCloseAttachmentDialog,
eCloseProgressDialog
} from "../../utils/events";
import { eCloseAttachmentDialog, eCloseSheet } from "../../utils/events";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import { Dialog } from "../dialog";
@@ -71,7 +68,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
useAttachmentStore.getState().remove(attachment.metadata.hash);
}
downloadAttachment(attachment.metadata.hash, false);
eSendEvent(eCloseProgressDialog, contextId);
eSendEvent(eCloseSheet, contextId);
},
icon: "download"
},
@@ -150,7 +147,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
onPress: async () => {
await db.attachments.remove(attachment.metadata.hash, false);
setAttachments([...db.attachments.all]);
eSendEvent(eCloseProgressDialog, contextId);
eSendEvent(eCloseSheet, contextId);
},
icon: "delete-outline"
}
@@ -230,16 +227,18 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
{formatBytes(attachment.length)}
</Paragraph>
<Paragraph
style={{
marginRight: 10
}}
size={SIZE.xs + 1}
color={colors.icon}
>
{attachment.noteIds.length} note
{attachment.noteIds.length > 1 ? "s" : ""}
</Paragraph>
{attachment.noteIds ? (
<Paragraph
style={{
marginRight: 10
}}
size={SIZE.xs + 1}
color={colors.icon}
>
{attachment.noteIds.length} note
{attachment.noteIds.length > 1 ? "s" : ""}
</Paragraph>
) : null}
<Paragraph
onPress={() => {
Clipboard.setString(attachment.metadata.hash);
@@ -291,7 +290,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
});
return;
}
eSendEvent(eCloseProgressDialog, contextId);
eSendEvent(eCloseSheet, contextId);
await sleep(150);
eSendEvent(eCloseAttachmentDialog);
await sleep(300);

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,11 @@ function getFileExtension(filename) {
var ext = /^.+\.([^.]+)$/.exec(filename);
return ext == null ? "" : ext[1];
}
/**
*
* @param {any} param0
* @returns
*/
export const AttachmentItem = ({ attachment, encryption, setAttachments }) => {
const colors = useThemeStore((state) => state.colors);
const [currentProgress, setCurrentProgress] = useAttachmentProgress(
@@ -46,7 +50,6 @@ export const AttachmentItem = ({ attachment, encryption, setAttachments }) => {
const encryptionProgress = useAttachmentStore(
(state) => state.encryptionProgress
);
const onPress = () => {
Actions.present(attachment, setAttachments, attachment.metadata.hash);
};
@@ -122,7 +125,9 @@ export const AttachmentItem = ({ attachment, encryption, setAttachments }) => {
</View>
</View>
{currentProgress || encryptionProgress || encryption ? (
{currentProgress ||
(encryptionProgress && encryptionProgress !== "0.00") ||
encryption ? (
<TouchableOpacity
activeOpacity={0.9}
onPress={() => {

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,70 +17,33 @@ 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, { useEffect, useRef, useState } from "react";
import React, { useRef, useState } from "react";
import { View } from "react-native";
import { FlatList } from "react-native-gesture-handler";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { db } from "../../common/database";
import filesystem from "../../common/filesystem";
import {
eSubscribeEvent,
eUnSubscribeEvent
} from "../../services/event-manager";
import { presentSheet } from "../../services/event-manager";
import { useThemeStore } from "../../stores/use-theme-store";
import {
eCloseAttachmentDialog,
eOpenAttachmentsDialog
} from "../../utils/events";
import { SIZE } from "../../utils/size";
import DialogHeader from "../dialog/dialog-header";
import { Toast } from "../toast";
import Input from "../ui/input";
import Seperator from "../ui/seperator";
import SheetWrapper from "../ui/sheet";
import Paragraph from "../ui/typography/paragraph";
import { AttachmentItem } from "./attachment-item";
export const AttachmentDialog = () => {
import { FlatList } from "react-native-actions-sheet";
export const AttachmentDialog = ({ data }) => {
const colors = useThemeStore((state) => state.colors);
const [visible, setVisible] = useState(false);
const [note, setNote] = useState(null);
const actionSheetRef = useRef();
const [attachments, setAttachments] = useState([]);
const [note, setNote] = useState(data);
const [attachments, setAttachments] = useState(
data
? db.attachments.ofNote(data.id, "all")
: [...(db.attachments.all || [])]
);
const attachmentSearchValue = useRef();
const searchTimer = useRef();
const [loading, setLoading] = useState(false);
useEffect(() => {
eSubscribeEvent(eOpenAttachmentsDialog, open);
eSubscribeEvent(eCloseAttachmentDialog, close);
return () => {
eUnSubscribeEvent(eOpenAttachmentsDialog, open);
eUnSubscribeEvent(eCloseAttachmentDialog, close);
};
}, [visible]);
const open = (data) => {
if (data?.id) {
setNote(data);
let _attachments = db.attachments.ofNote(data.id, "all");
setAttachments(_attachments);
} else {
setAttachments([...db.attachments.all]);
}
setVisible(true);
};
useEffect(() => {
if (visible) {
actionSheetRef.current?.show();
}
}, [visible]);
const close = () => {
actionSheetRef.current?.hide();
setVisible(false);
};
const onChangeText = (text) => {
attachmentSearchValue.current = text;
if (
@@ -104,107 +67,101 @@ export const AttachmentDialog = () => {
<AttachmentItem setAttachments={setAttachments} attachment={item} />
);
return !visible ? null : (
<SheetWrapper
centered={false}
fwdRef={actionSheetRef}
onClose={async () => {
setVisible(false);
return (
<View
style={{
width: "100%",
alignSelf: "center",
paddingHorizontal: 12
}}
>
<Toast context="local" />
<View
style={{
width: "100%",
alignSelf: "center",
paddingHorizontal: 12
}}
>
<DialogHeader
title={note ? "Attachments" : "Manage attachments"}
paragraph="Tap on an attachment to view properties"
button={{
title: "Check all",
type: "grayAccent",
loading: loading,
onPress: async () => {
setLoading(true);
for (let attachment of attachments) {
let result = await filesystem.checkAttachment(
attachment.metadata.hash
<DialogHeader
title={note ? "Attachments" : "Manage attachments"}
paragraph="Tap on an attachment to view properties"
button={{
title: "Check all",
type: "grayAccent",
loading: loading,
onPress: async () => {
setLoading(true);
for (let attachment of attachments) {
let result = await filesystem.checkAttachment(
attachment.metadata.hash
);
if (result.failed) {
db.attachments.markAsFailed(
attachment.metadata.hash,
result.failed
);
if (result.failed) {
db.attachments.markAsFailed(
attachment.metadata.hash,
result.failed
);
} else {
db.attachments.markAsFailed(attachment.id, null);
}
setAttachments([...db.attachments.all]);
} else {
db.attachments.markAsFailed(attachment.id, null);
}
setLoading(false);
setAttachments([...db.attachments.all]);
}
setLoading(false);
}
}}
/>
<Seperator />
{!note ? (
<Input
placeholder="Filter attachments by filename, type or hash"
onChangeText={onChangeText}
onSubmit={() => {
onChangeText(attachmentSearchValue.current);
}}
/>
<Seperator />
{!note ? (
<Input
placeholder="Filter attachments by filename, type or hash"
onChangeText={onChangeText}
onSubmit={() => {
onChangeText(attachmentSearchValue.current);
) : null}
<FlatList
keyboardDismissMode="none"
keyboardShouldPersistTaps="always"
maxToRenderPerBatch={10}
initialNumToRender={10}
windowSize={5}
ListEmptyComponent={
<View
style={{
height: 150,
justifyContent: "center",
alignItems: "center"
}}
>
<Icon name="attachment" size={60} color={colors.icon} />
<Paragraph>
{note ? "No attachments on this note" : "No attachments"}
</Paragraph>
</View>
}
ListFooterComponent={
<View
style={{
height: 350
}}
/>
) : null}
}
data={attachments}
keyExtractor={(item) => item.id}
renderItem={renderItem}
/>
<FlatList
nestedScrollEnabled
overScrollMode="never"
scrollToOverflowEnabled={false}
keyboardDismissMode="none"
keyboardShouldPersistTaps="always"
onMomentumScrollEnd={() => {
actionSheetRef.current?.handleChildScrollEnd();
}}
ListEmptyComponent={
<View
style={{
height: 150,
justifyContent: "center",
alignItems: "center"
}}
>
<Icon name="attachment" size={60} color={colors.icon} />
<Paragraph>
{note ? "No attachments on this note" : "No attachments"}
</Paragraph>
</View>
}
ListFooterComponent={
<View
style={{
height: 350
}}
/>
}
data={attachments}
keyExtractor={(item) => item.id}
renderItem={renderItem}
/>
<Paragraph
color={colors.icon}
size={SIZE.xs}
style={{
textAlign: "center",
marginTop: 10
}}
>
<Icon name="shield-key-outline" size={SIZE.xs} color={colors.icon} />
{" "}All attachments are end-to-end encrypted.
</Paragraph>
</View>
</SheetWrapper>
<Paragraph
color={colors.icon}
size={SIZE.xs}
style={{
textAlign: "center",
marginTop: 10
}}
>
<Icon name="shield-key-outline" size={SIZE.xs} color={colors.icon} />
{" "}All attachments are end-to-end encrypted.
</Paragraph>
</View>
);
};
AttachmentDialog.present = (note) => {
presentSheet({
component: () => <AttachmentDialog data={note} />
});
};

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@ import {
ToastEvent
} from "../../services/event-manager";
import { useUserStore } from "../../stores/use-user-store";
import { eCloseProgressDialog } from "../../utils/events";
import { eCloseSheet } from "../../utils/events";
import DialogHeader from "../dialog/dialog-header";
import { Button } from "../ui/button";
import Input from "../ui/input";
@@ -72,7 +72,7 @@ export const ChangePassword = () => {
context: "global"
});
setLoading(false);
eSendEvent(eCloseProgressDialog);
eSendEvent(eCloseSheet);
} catch (e) {
setLoading(false);
ToastEvent.show({

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -97,6 +97,9 @@ export const ForgotPassword = () => {
text: email.current
});
}}
indicatorStyle={{
width: 100
}}
gestureEnabled
id="forgotpassword_sheet"
>

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,21 +17,15 @@ 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, { useEffect, useRef, useState } from "react";
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import { SheetManager } from "react-native-actions-sheet";
import Animated, { FadeInDown, FadeOutUp } from "react-native-reanimated";
import { db } from "../../common/database";
import { DDS } from "../../services/device-detection";
import { eSendEvent, ToastEvent } from "../../services/event-manager";
import { clearMessage } from "../../services/message";
import PremiumService from "../../services/premium";
import SettingsService from "../../services/settings";
import { eSendEvent } from "../../services/event-manager";
import { useThemeStore } from "../../stores/use-theme-store";
import { useUserStore } from "../../stores/use-user-store";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import BaseDialog from "../dialog/base-dialog";
import SheetProvider from "../sheet-provider";
import { Progress } from "../sheets/progress";
import { Button } from "../ui/button";
@@ -42,108 +36,52 @@ import Paragraph from "../ui/typography/paragraph";
import { SVG } from "./background";
import { hideAuth } from "./common";
import { ForgotPassword } from "./forgot-password";
import TwoFactorVerification from "./two-factor";
import { useLogin } from "./use-login";
const LoginSteps = {
emailAuth: 1,
mfaAuth: 2,
passwordAuth: 3
};
export const Login = ({ changeMode }) => {
const colors = useThemeStore((state) => state.colors);
const email = useRef();
const emailInputRef = useRef();
const passwordInputRef = useRef();
const password = useRef();
const [focused, setFocused] = useState(false);
const [error, setError] = useState(false);
const [loading, setLoading] = useState(false);
const setUser = useUserStore((state) => state.setUser);
const validateInfo = () => {
if (!password.current || !email.current) {
ToastEvent.show({
heading: "All fields required",
message: "Fill all the fields and try again",
type: "error",
context: "local"
});
return false;
}
return true;
};
const {
step,
setStep,
password,
email,
emailInputRef,
passwordInputRef,
loading,
setLoading,
setError,
login
} = useLogin(async () => {
hideAuth();
eSendEvent("userLoggedIn", true);
await sleep(500);
Progress.present();
});
useEffect(() => {
async () => {
setStep(LoginSteps.emailAuth);
await sleep(500);
emailInputRef.current?.focus();
setFocused(true);
};
return () => {
setStep(LoginSteps.emailAuth);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const login = async (mfa, callback) => {
if (!validateInfo() || error) return;
setLoading(true);
let user;
try {
if (mfa) {
await db.user.mfaLogin(
email.current.toLowerCase(),
password.current,
mfa
);
} else {
await db.user.login(email.current.toLowerCase(), password.current);
}
callback && callback(true);
user = await db.user.getUser();
if (!user) throw new Error("Email or password incorrect!");
PremiumService.setPremiumStatus();
setUser(user);
clearMessage();
ToastEvent.show({
heading: "Login successful",
message: `Logged in as ${user.email}`,
type: "success",
context: "global"
});
hideAuth();
SettingsService.set({
sessionExpired: false,
userEmailConfirmed: user?.isEmailConfirmed
});
eSendEvent("userLoggedIn", true);
await sleep(500);
Progress.present();
} catch (e) {
callback && callback(false);
if (e.message === "Multifactor authentication required.") {
setLoading(false);
await sleep(300);
TwoFactorVerification.present(async (mfa) => {
if (mfa) {
await login(mfa);
} else {
setLoading(false);
}
}, e.data);
} else {
setLoading(false);
ToastEvent.show({
heading: user ? "Failed to sync" : "Login failed",
message: e.message,
type: "error",
context: "local"
});
}
}
};
return (
<>
<ForgotPassword />
<SheetProvider context="two_factor_verify" />
{loading ? (
<BaseDialog transparent={true} visible={true} animation="fade" />
) : null}
<Animated.View
entering={FadeInDown}
exiting={FadeOutUp}
@@ -192,6 +130,7 @@ export const Login = ({ changeMode }) => {
marginTop: 5
}}
onPress={() => {
if (loading) return;
changeMode(1);
}}
size={SIZE.md}
@@ -228,48 +167,56 @@ export const Login = ({ changeMode }) => {
autoCorrect={false}
autoCapitalize="none"
errorMessage="Email is invalid"
placeholder="Email"
placeholder="Enter your email"
defaultValue={email.current}
editable={step === LoginSteps.emailAuth && !loading}
onSubmit={() => {
passwordInputRef.current?.focus();
}}
/>
<Input
fwdRef={passwordInputRef}
onChangeText={(value) => {
password.current = value;
}}
testID="input.password"
returnKeyLabel="Done"
returnKeyType="done"
secureTextEntry
autoComplete="password"
autoCapitalize="none"
autoCorrect={false}
placeholder="Password"
marginBottom={0}
onSubmit={() => login()}
/>
<Button
title="Forgot your password?"
style={{
alignSelf: "flex-end",
height: 30,
paddingHorizontal: 0
}}
onPress={() => {
SheetManager.show("forgotpassword_sheet", email.current);
}}
textStyle={{
textDecorationLine: "underline"
}}
fontSize={SIZE.xs}
type="gray"
/>
{step === LoginSteps.passwordAuth && (
<>
<Input
fwdRef={passwordInputRef}
onChangeText={(value) => {
password.current = value;
}}
testID="input.password"
returnKeyLabel="Done"
returnKeyType="done"
secureTextEntry
autoComplete="password"
autoCapitalize="none"
autoCorrect={false}
placeholder="Password"
marginBottom={0}
editable={!loading}
defaultValue={password.current}
onSubmit={() => login()}
/>
<Button
title="Forgot your password?"
style={{
alignSelf: "flex-end",
height: 30,
paddingHorizontal: 0
}}
onPress={() => {
if (loading) return;
SheetManager.show("forgotpassword_sheet", email.current);
}}
textStyle={{
textDecorationLine: "underline"
}}
fontSize={SIZE.xs}
type="gray"
/>
</>
)}
<View
style={{
// position: 'absolute',
marginTop: 25,
alignSelf: "center"
}}
@@ -280,11 +227,40 @@ export const Login = ({ changeMode }) => {
borderRadius: 100
}}
loading={loading}
onPress={() => login()}
// width="100%"
onPress={() => {
if (loading) return;
login();
}}
type="accent"
title={loading ? null : "Login to your account"}
title={
loading
? null
: step === LoginSteps.emailAuth
? "Login"
: "Continue"
}
/>
{step === LoginSteps.passwordAuth && (
<Button
title="Cancel logging in"
style={{
alignSelf: "center",
height: 30,
marginTop: 10
}}
onPress={() => {
if (loading) return;
setStep(LoginSteps.emailAuth);
setLoading(false);
}}
textStyle={{
textDecorationLine: "underline"
}}
fontSize={SIZE.xs}
type="errorShade"
/>
)}
</View>
</View>
</Animated.View>

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { useEffect, useRef, useState } from "react";
import React, { useEffect, useState } from "react";
import { Modal, View } from "react-native";
import { db } from "../../common/database";
import BiometricService from "../../services/biometrics";
@@ -27,29 +27,27 @@ import {
eUnSubscribeEvent,
ToastEvent
} from "../../services/event-manager";
import { clearMessage } from "../../services/message";
import PremiumService from "../../services/premium";
import SettingsService from "../../services/settings";
import Sync from "../../services/sync";
import { useThemeStore } from "../../stores/use-theme-store";
import { useUserStore } from "../../stores/use-user-store";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import { Dialog } from "../dialog";
import { presentDialog } from "../dialog/functions";
import SheetProvider from "../sheet-provider";
import { Progress } from "../sheets/progress";
import { Toast } from "../toast";
import { Button } from "../ui/button";
import { IconButton } from "../ui/icon-button";
import Input from "../ui/input";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import TwoFactorVerification from "./two-factor";
import { LoginSteps, useLogin } from "./use-login";
function getEmail(email) {
if (!email) return null;
return email.replace(/(.{2})(.*)(?=@)/, function (gp1, gp2, gp3) {
function getObfuscatedEmail(email) {
if (!email) return "";
const [username, provider] = email.split("@");
if (username.length === 1) return `****@${provider}`;
return email.replace(/(.{1})(.*)(?=@)/, function (gp1, gp2, gp3) {
for (let i = 0; i < gp3.length; i++) {
gp2 += "*";
}
@@ -59,15 +57,14 @@ function getEmail(email) {
export const SessionExpired = () => {
const colors = useThemeStore((state) => state.colors);
const email = useRef();
const passwordInputRef = useRef();
const password = useRef();
const [visible, setVisible] = useState(false);
const [focused, setFocused] = useState(false);
const setUser = useUserStore((state) => state.setUser);
const [loading, setLoading] = useState(false);
const { step, password, email, passwordInputRef, loading, login } = useLogin(
() => {
eSendEvent("userLoggedIn", true);
setVisible(false);
}
);
const logout = async () => {
try {
@@ -92,9 +89,9 @@ export const SessionExpired = () => {
eUnSubscribeEvent("session_expired", open);
setFocused(false);
};
}, [visible]);
}, [visible, open]);
const open = async () => {
const open = React.useCallback(async () => {
try {
let res = await db.user.tokenManager.getToken();
if (!res) throw new Error("no token found");
@@ -120,64 +117,8 @@ export const SessionExpired = () => {
email.current = user.email;
setVisible(true);
}
};
}, [email]);
const login = async (mfa, callback) => {
setLoading(true);
let user;
try {
if (mfa) {
await db.user.mfaLogin(
email.current.toLowerCase(),
password.current,
mfa
);
} else {
await db.user.login(email.current.toLowerCase(), password.current);
}
callback && callback(true);
setVisible(false);
user = await db.user.getUser();
if (!user) throw new Error("Email or password incorrect!");
PremiumService.setPremiumStatus();
setUser(user);
clearMessage();
ToastEvent.show({
heading: "Login successful",
message: `Logged in as ${user.email}`,
type: "success",
context: "global"
});
await SettingsService.set({
sessionExpired: false,
userEmailConfirmed: user?.isEmailConfirmed
});
eSendEvent("userLoggedIn", true);
await sleep(500);
Progress.present();
setLoading(false);
} catch (e) {
callback && callback(false);
if (e.message === "Multifactor authentication required.") {
TwoFactorVerification.present(async (mfa) => {
if (mfa) {
await login(mfa);
} else {
setLoading(false);
}
}, e.data);
} else {
console.log(e.stack);
setLoading(false);
ToastEvent.show({
heading: user ? "Failed to sync" : "Login failed",
message: e.message,
type: "error",
context: "local"
});
}
}
};
return (
visible && (
<Modal
@@ -194,7 +135,8 @@ export const SessionExpired = () => {
width: focused ? "100%" : "99.9%",
padding: 12,
justifyContent: "center",
flex: 1
flex: 1,
backgroundColor: colors.bg
}}
>
<View
@@ -225,29 +167,32 @@ export const SessionExpired = () => {
}}
>
Your session on this device has expired. Please enter password for{" "}
{getEmail(email.current)} to continue.
{getObfuscatedEmail(email.current)} to continue.
</Paragraph>
</View>
<Input
fwdRef={passwordInputRef}
onChangeText={(value) => {
password.current = value;
}}
returnKeyLabel="Next"
returnKeyType="next"
secureTextEntry
autoComplete="password"
autoCapitalize="none"
autoCorrect={false}
placeholder="Password"
onSubmit={() => login()}
/>
{step === LoginSteps.passwordAuth ? (
<Input
fwdRef={passwordInputRef}
onChangeText={(value) => {
password.current = value;
}}
returnKeyLabel="Next"
returnKeyType="next"
secureTextEntry
autoComplete="password"
autoCapitalize="none"
autoCorrect={false}
placeholder="Password"
onSubmit={() => login()}
/>
) : null}
<Button
style={{
marginTop: 10,
width: "100%"
width: 250,
borderRadius: 100
}}
loading={loading}
onPress={() => login()}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { useRef, useState } from "react";
import { Dimensions, View } from "react-native";
import Animated, { FadeInDown, FadeOutUp } from "react-native-reanimated";
import umami from "../../common/analytics";
import { db } from "../../common/database";
import { DDS } from "../../services/device-detection";
import { ToastEvent } from "../../services/event-manager";
@@ -31,7 +30,6 @@ import { useUserStore } from "../../stores/use-user-store";
import { openLinkInBrowser } from "../../utils/functions";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import BaseDialog from "../dialog/base-dialog";
import { Button } from "../ui/button";
import Input from "../ui/input";
import { SvgView } from "../ui/svg";
@@ -79,7 +77,6 @@ export const Signup = ({ changeMode, trial }) => {
clearMessage();
setEmailVerifyMessage();
hideAuth();
umami.pageView("/account-created", "/welcome/signup");
await sleep(300);
if (trial) {
PremiumService.sheet(null, null, true);
@@ -99,9 +96,6 @@ export const Signup = ({ changeMode, trial }) => {
return (
<>
{loading ? (
<BaseDialog transparent={true} visible={true} animation="fade" />
) : null}
<Animated.View
entering={FadeInDown}
exiting={FadeOutUp}
@@ -150,6 +144,7 @@ export const Signup = ({ changeMode, trial }) => {
textAlign: "center"
}}
onPress={() => {
if (loading) return;
changeMode(0);
}}
size={SIZE.md}
@@ -237,7 +232,10 @@ export const Signup = ({ changeMode, trial }) => {
borderRadius: 100
}}
loading={loading}
onPress={signup}
onPress={() => {
if (loading) return;
signup();
}}
type="accent"
title={loading ? null : "Agree and continue"}
/>

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ import {
ToastEvent
} from "../../services/event-manager";
import { useThemeStore } from "../../stores/use-theme-store";
import { eCloseProgressDialog } from "../../utils/events";
import { eCloseSheet } from "../../utils/events";
import { SIZE } from "../../utils/size";
import { Button } from "../ui/button";
import { IconButton } from "../ui/icon-button";
@@ -54,7 +54,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
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 8 digit recovery code to continue logging in"
recoveryCode: "Enter the recovery code to continue logging in"
};
const secondaryMethodsText = {
@@ -65,9 +65,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
};
const onNext = async () => {
const length = currentMethod.method === "recoveryCode" ? 8 : 6;
if (!code.current || code.current.length !== length) return;
if (!code.current || code.current.length < 6) return;
setLoading(true);
inputRef.current?.blur();
await onMfaLogin(
@@ -77,7 +75,7 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
},
(result) => {
if (result) {
eSendEvent(eCloseProgressDialog, "two_factor_verify");
eSendEvent(eCloseSheet, "two_factor_verify");
}
setLoading(false);
}
@@ -202,21 +200,26 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
<>
<Input
placeholder={
currentMethod.method === "recoveryCode" ? "xxxxxxxx" : "xxxxxx"
currentMethod.method === "recoveryCode"
? "xxxxx-xxxxx"
: "xxxxxx"
}
testID={"input.totp"}
maxLength={
currentMethod.method === "recoveryCode" ? undefined : 6
}
maxLength={currentMethod.method === "recoveryCode" ? 8 : 6}
fwdRef={inputRef}
textAlign="center"
onChangeText={(value) => {
code.current = value;
onNext();
//onNext();
}}
inputStyle={{
fontSize: SIZE.lg,
height: 60,
textAlign: "center",
letterSpacing: 10,
width: null
width: 250
}}
keyboardType={
currentMethod.method === "recoveryCode" ? "default" : "numeric"
@@ -299,7 +302,9 @@ const TwoFactorVerification = ({ onMfaLogin, mfaInfo }) => {
TwoFactorVerification.present = (onMfaLogin, data, context) => {
presentSheet({
component: <TwoFactorVerification onMfaLogin={onMfaLogin} mfaInfo={data} />,
component: () => (
<TwoFactorVerification onMfaLogin={onMfaLogin} mfaInfo={data} />
),
context: context || "two_factor_verify",
onClose: () => {
onMfaLogin();

View File

@@ -0,0 +1,158 @@
/*
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 { useRef, useState } from "react";
import { db } from "../../common/database";
import { eSendEvent, ToastEvent } 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";
export const LoginSteps = {
emailAuth: 1,
mfaAuth: 2,
passwordAuth: 3
};
export const useLogin = (onFinishLogin) => {
const [error, setError] = useState(false);
const [loading, setLoading] = useState(false);
const setUser = useUserStore((state) => state.setUser);
const [step, setStep] = useState(LoginSteps.emailAuth);
const email = useRef();
const password = useRef();
const emailInputRef = useRef();
const passwordInputRef = useRef();
const validateInfo = () => {
if (
(!password.current && step === LoginSteps.passwordAuth) ||
(!email.current && step === LoginSteps.emailAuth)
) {
ToastEvent.show({
heading: "All fields required",
message: "Fill all the fields and try again",
type: "error",
context: "local"
});
return false;
}
return true;
};
const login = async () => {
if (!validateInfo() || error) return;
try {
setLoading(true);
switch (step) {
case LoginSteps.emailAuth: {
const mfaInfo = await db.user.authenticateEmail(email.current);
if (mfaInfo) {
TwoFactorVerification.present(async (mfa, callback) => {
try {
const success = await db.user.authenticateMultiFactorCode(
mfa.code,
mfa.method
);
if (success) {
setStep(LoginSteps.passwordAuth);
setLoading(false);
setTimeout(() => {
passwordInputRef.current?.focus();
}, 1);
callback && callback(true);
}
callback && callback(false);
} catch (e) {
callback && callback(false);
if (e.message === "invalid_grant") {
eSendEvent(eCloseSheet, "two_factor_verify");
setLoading(false);
setStep(LoginSteps.emailAuth);
}
}
}, mfaInfo);
} else {
finishWithError(new Error("Unable to send 2FA code"));
}
break;
}
case LoginSteps.passwordAuth: {
await db.user.authenticatePassword(email.current, password.current);
finishLogin();
break;
}
}
setLoading(false);
} catch (e) {
finishWithError(e);
}
};
const finishWithError = async (e) => {
if (e.message === "invalid_grant") setStep(LoginSteps.emailAuth);
setLoading(false);
ToastEvent.show({
heading: "Login failed",
message: e.message,
type: "error",
context: "local"
});
};
const finishLogin = async () => {
const user = await db.user.getUser();
if (!user) throw new Error("Email or password incorrect!");
PremiumService.setPremiumStatus();
setUser(user);
clearMessage();
ToastEvent.show({
heading: "Login successful",
message: `Logged in as ${user.email}`,
type: "success",
context: "global"
});
SettingsService.set({
sessionExpired: false,
userEmailConfirmed: user?.isEmailConfirmed
});
onFinishLogin?.();
setLoading(false);
};
return {
login,
step,
setStep,
email,
password,
passwordInputRef,
emailInputRef,
loading,
setLoading,
error,
setError
};
};

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from "react";
import { KeyboardAvoidingView, Platform, SafeAreaView } from "react-native";
import { KeyboardAvoidingView, Platform, View } 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";
@@ -28,6 +29,7 @@ export const Container = ({ children }) => {
const introCompleted = useSettingStore(
(state) => state.settings.introCompleted
);
const insets = useGlobalSafeAreaInsets();
return (
<KeyboardAvoidingView
behavior="padding"
@@ -36,10 +38,12 @@ export const Container = ({ children }) => {
flex: 1
}}
>
<SafeAreaView
<View
style={{
flex: 1,
overflow: "hidden"
overflow: "hidden",
paddingTop: Platform.OS === "android" ? 0 : insets.top,
paddingBottom: Platform.OS === "android" ? 0 : insets.bottom
}}
>
{!introCompleted ? null : (
@@ -50,7 +54,7 @@ export const Container = ({ children }) => {
)}
{children}
</SafeAreaView>
</View>
</KeyboardAvoidingView>
);
};

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@ import React from "react";
import { useNoteStore } from "../../stores/use-notes-store";
import { useThemeStore } from "../../stores/use-theme-store";
import { AnnouncementDialog } from "../announcements";
import { AttachmentDialog } from "../attachments";
import AuthModal from "../auth/auth-modal";
import { SessionExpired } from "../auth/session-expired";
import { Dialog } from "../dialog";
import { AddTopicDialog } from "../dialogs/add-topic";
import { LoadingDialog } from "../dialogs/loading";
import ResultDialog from "../dialogs/result";
import { VaultDialog } from "../dialogs/vault";
import ImagePreview from "../image-preview";
@@ -33,10 +33,6 @@ import MergeConflicts from "../merge-conflicts";
import PremiumDialog from "../premium";
import { Expiring } from "../premium/expiring";
import SheetProvider from "../sheet-provider";
import { AddNotebookSheet } from "../sheets/add-notebook";
import AddToNotebookSheet from "../sheets/add-to";
import ManageTagsSheet from "../sheets/manage-tags";
import PublishNoteSheet from "../sheets/publish-note";
import RateAppSheet from "../sheets/rate-app";
import RecoveryKeySheet from "../sheets/recovery-key";
import RestoreDataSheet from "../sheets/restore-data";
@@ -47,9 +43,9 @@ const DialogProvider = () => {
return (
<>
<LoadingDialog />
<Dialog context="global" />
<AddTopicDialog colors={colors} />
<AddNotebookSheet colors={colors} />
<PremiumDialog colors={colors} />
<AuthModal colors={colors} />
<MergeConflicts />
@@ -59,12 +55,8 @@ const DialogProvider = () => {
<RestoreDataSheet />
<ResultDialog />
<VaultDialog colors={colors} />
<AddToNotebookSheet colors={colors} />
<RateAppSheet />
<ImagePreview />
<PublishNoteSheet />
<ManageTagsSheet />
<AttachmentDialog />
{loading ? null : <Expiring />}
<AnnouncementDialog />
<SessionExpired />

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from "react";
import { Text, View } from "react-native";
import { Text, View, ViewStyle } from "react-native";
import { useThemeStore } from "../../stores/use-theme-store";
import { SIZE } from "../../utils/size";
import { Button } from "../ui/button";
@@ -35,11 +35,13 @@ type DialogHeaderProps = {
loading?: boolean;
title?: string;
type?: PressableButtonProps["type"];
icon?: string;
};
paragraphColor?: string;
padding?: number;
centered?: boolean;
titlePart?: string;
style?: ViewStyle;
};
const DialogHeader = ({
@@ -49,7 +51,8 @@ const DialogHeader = ({
paragraphColor,
padding,
centered,
titlePart
titlePart,
style
}: DialogHeaderProps) => {
const colors = useThemeStore((state) => state.colors);
@@ -61,7 +64,8 @@ const DialogHeader = ({
alignItems: "center",
justifyContent: "space-between",
minHeight: 50,
paddingHorizontal: padding
paddingHorizontal: padding,
...style
}}
>
<View
@@ -96,6 +100,7 @@ const DialogHeader = ({
loading={button.loading}
fontSize={13}
title={button.title}
icon={button.icon}
type={button.type || "grayBg"}
height={25}
/>

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@ import BaseDialog from "./base-dialog";
import DialogButtons from "./dialog-buttons";
import DialogHeader from "./dialog-header";
import { useCallback } from "react";
import { Button } from "../ui/button";
export const Dialog = ({ context = "global" }) => {
const colors = useThemeStore((state) => state.colors);
@@ -54,7 +55,11 @@ export const Dialog = ({ context = "global" }) => {
input: false,
inputPlaceholder: "Enter some text",
defaultValue: "",
disableBackdropClosing: false
disableBackdropClosing: false,
check: {
info: "Check",
type: "transparent"
}
});
useEffect(() => {
@@ -87,6 +92,7 @@ export const Dialog = ({ context = "global" }) => {
if (data.context !== context) return;
setDialogInfo(data);
setVisible(true);
setInputValue(data.defaultValue);
},
[context]
);
@@ -137,6 +143,9 @@ export const Dialog = ({ context = "global" }) => {
paragraph={dialogInfo.paragraph}
paragraphColor={dialogInfo.paragraphColor}
padding={12}
style={{
minHeight: 0
}}
/>
<Seperator half />
@@ -163,6 +172,28 @@ export const Dialog = ({ context = "global" }) => {
</View>
) : null}
{dialogInfo.check ? (
<>
<Button
onPress={() => {
setInputValue(!inputValue);
}}
icon={
inputValue
? "check-circle-outline"
: "checkbox-blank-circle-outline"
}
style={{
justifyContent: "flex-start"
}}
height={35}
width="100%"
title={dialogInfo.check.info}
type={inputValue ? dialogInfo.check.type : "gray"}
/>
</>
) : null}
<DialogButtons
onPressNegative={onNegativePress}
onPressPositive={dialogInfo.positivePress && onPressPositive}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@ import { View } from "react-native";
import { useMenuStore } from "../../../stores/use-menu-store";
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent,
ToastEvent
@@ -30,6 +31,7 @@ import Navigation from "../../../services/navigation";
import { db } from "../../../common/database";
import {
eCloseAddTopicDialog,
eOnTopicSheetUpdate,
eOpenAddTopicDialog
} from "../../../utils/events";
import { sleep } from "../../../utils/time";
@@ -40,6 +42,7 @@ import DialogHeader from "../../dialog/dialog-header";
import Input from "../../ui/input";
import Seperator from "../../ui/seperator";
import { Toast } from "../../toast";
import { useRelationStore } from "../../../stores/use-relation-store";
export class AddTopicDialog extends React.Component {
constructor(props) {
@@ -59,14 +62,12 @@ export class AddTopicDialog extends React.Component {
addNewTopic = async () => {
try {
this.setState({ loading: true });
if (!this.title || this.title?.trim() === "") {
ToastEvent.show({
heading: "Topic title is required",
type: "error",
context: "local"
});
this.setState({ loading: false });
return;
}
@@ -78,10 +79,13 @@ export class AddTopicDialog extends React.Component {
await db.notebooks.notebook(topic.notebookId).topics.add(topic);
}
this.setState({ loading: false });
this.close();
Navigation.queueRoutesForUpdate("Notebooks", "Notebook", "TopicNotes");
useMenuStore.getState().setMenuPins();
setTimeout(() => {
Navigation.queueRoutesForUpdate();
useMenuStore.getState().setMenuPins();
});
eSendEvent(eOnTopicSheetUpdate);
useRelationStore.getState().update();
} catch (e) {
console.error(e);
}
@@ -177,7 +181,6 @@ export class AddTopicDialog extends React.Component {
positiveTitle={this.toEdit ? "Save" : "Add"}
onPressNegative={() => this.close()}
onPressPositive={() => this.addNewTopic()}
loading={this.state.loading}
/>
</DialogContainer>
<Toast context="local" />

View File

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

View File

@@ -0,0 +1,88 @@
/*
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 from "react";
import { View } from "react-native";
import { useThemeStore } from "../../../stores/use-theme-store";
import BaseDialog from "../../dialog/base-dialog";
import { ProgressBarComponent } from "../../ui/svg/lazy";
import { useEffect } from "react";
import {
eSubscribeEvent,
eUnSubscribeEvent
} from "../../../services/event-manager";
import { useState } from "react";
import { eCloseLoading, eOpenLoading } from "../../../utils/events";
export const LoadingDialog = () => {
const colors = useThemeStore((state) => state.colors);
const [visible, setVisible] = useState(false);
useEffect(() => {
eSubscribeEvent(eOpenLoading, open);
eSubscribeEvent(eCloseLoading, close);
return () => {
eUnSubscribeEvent(eOpenLoading, open);
eUnSubscribeEvent(eCloseLoading, close);
};
}, []);
const open = () => setVisible(true);
const close = () => setVisible(false);
return (
<BaseDialog
animated={false}
bounce={false}
visible={visible}
onRequestClose={undefined}
onShow={undefined}
premium={undefined}
transparent={undefined}
>
<View
style={{
width: "100%",
height: "100%",
backgroundColor: colors.bg,
justifyContent: "center",
alignItems: "center"
}}
>
<View
style={{
flexDirection: "row",
width: 100,
marginTop: 15
}}
>
<ProgressBarComponent
height={5}
width={100}
animated={true}
useNativeDriver
indeterminate
indeterminateAnimationDuration={2000}
unfilledColor={colors.nav}
color={colors.accent}
borderWidth={0}
/>
</View>
</View>
</BaseDialog>
);
};

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -135,7 +135,6 @@ const ResultDialog = () => {
paddingHorizontal: 12
}}
onPress={close}
height={50}
fontSize={SIZE.md + 2}
/>
</View>

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@ import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { eSendEvent } from "../../../services/event-manager";
import { useThemeStore } from "../../../stores/use-theme-store";
import {
eCloseProgressDialog,
eCloseSheet,
eCloseResultDialog,
eOpenPremiumDialog
} from "../../../utils/events";
@@ -82,7 +82,7 @@ export const ProFeatures = ({ count = 6 }) => {
<Paragraph
onPress={async () => {
eSendEvent(eCloseResultDialog);
eSendEvent(eCloseProgressDialog);
eSendEvent(eCloseSheet);
await sleep(300);
eSendEvent(eOpenPremiumDialog);
}}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -207,13 +207,7 @@ export class VaultDialog extends Component {
return;
}
Navigation.queueRoutesForUpdate(
"Notes",
"Favorites",
"TopicNotes",
"TaggedNotes",
"ColoredNotes"
);
Navigation.queueRoutesForUpdate();
this.password = null;
this.confirmPassword = null;

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ export const LeftMenus = () => {
}
};
return isTablet ? null : (
return isTablet && !canGoBack ? null : (
<IconButton
testID={notesnook.ids.default.header.buttons.left}
customStyle={{

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,8 +30,8 @@ import { useThemeStore } from "../../stores/use-theme-store";
import { eScrollEvent } from "../../utils/events";
import { SIZE } from "../../utils/size";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { useCallback } from "react";
import Tag from "../ui/tag";
const titleState = {};
@@ -63,13 +63,15 @@ export const Title = () => {
}
if (data.y > 150) {
if (!hide) return;
titleState[currentScreen.id] = false;
setHide(false);
} else {
if (hide) return;
titleState[currentScreen.id] = true;
setHide(true);
}
},
[currentScreen.name, hide]
[currentScreen.id, currentScreen.name, hide]
);
useEffect(() => {
@@ -84,10 +86,6 @@ export const Title = () => {
}
}, [currentScreen.id, currentScreen.name]);
useEffect(() => {
titleState[currentScreen.id] = hide;
}, [currentScreen.id, hide]);
useEffect(() => {
eSubscribeEvent(eScrollEvent, onScroll);
return () => {
@@ -104,37 +102,30 @@ export const Title = () => {
style={{
opacity: 1,
flexShrink: 1,
flexDirection: "row"
flexDirection: "row",
alignItems: "center"
}}
>
{!hide && !isHidden ? (
<Heading
onPress={navigateToNotebook}
numberOfLines={isTopic ? 2 : 1}
size={isTopic ? SIZE.md + 2 : SIZE.xl}
numberOfLines={1}
size={SIZE.xl}
style={{
flexWrap: "wrap",
marginTop: Platform.OS === "ios" ? -1 : 0
}}
color={currentScreen.color || colors.heading}
>
{isTopic ? (
<Paragraph numberOfLines={1} size={SIZE.xs + 1}>
{notebook?.title}
{"\n"}
</Paragraph>
) : null}
{isTag ? (
<Heading
size={isTopic ? SIZE.md + 2 : SIZE.xl}
color={colors.accent}
>
<Heading size={SIZE.xl} color={colors.accent}>
#
</Heading>
) : null}
{title}
</Heading>
) : null}
<Tag visible={currentScreen.beta} text="BETA" />
</View>
);
};

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,18 +18,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import { Platform, View } from "react-native";
import ImageViewer from "react-native-image-zoom-viewer";
import downloadAttachment from "../../common/filesystem/download-attachment";
import { cacheDir } from "../../common/filesystem/utils";
import {
eSubscribeEvent,
eUnSubscribeEvent
} from "../../services/event-manager";
import { useThemeStore } from "../../stores/use-theme-store";
import BaseDialog from "../dialog/base-dialog";
import { IconButton } from "../ui/icon-button";
import { ProgressBarComponent } from "../ui/svg/lazy";
import Sodium from "@ammarahmed/react-native-sodium";
import dataurl from "@notesnook/core/utils/dataurl";
const ImagePreview = () => {
const colors = useThemeStore((state) => state.colors);
const [visible, setVisible] = useState(false);
const [image, setImage] = useState("");
const [loading, setLoading] = useState(false);
useEffect(() => {
eSubscribeEvent("ImagePreview", open);
@@ -39,9 +47,29 @@ const ImagePreview = () => {
};
}, []);
const open = (image) => {
setImage(image);
const open = async (image) => {
setVisible(true);
setLoading(true);
setTimeout(async () => {
let hash = image.hash;
if (!hash && dataurl.toObject(image.src)) {
const data = dataurl.toObject(image.src);
if (!data) return;
hash = await Sodium.hashFile({
data: data.data,
type: "base64",
uri: ""
});
}
if (!hash) return;
const uri = await downloadAttachment(hash, false, {
silent: true,
cache: true
});
const path = `${cacheDir}/${uri}`;
setImage("file://" + path);
setLoading(false);
}, 100);
};
const close = () => {
@@ -59,44 +87,60 @@ const ImagePreview = () => {
backgroundColor: "black"
}}
>
<ImageViewer
enableImageZoom={true}
renderIndicator={() => <></>}
enableSwipeDown
useNativeDriver
onSwipeDown={close}
saveToLocalByLongPress={false}
renderHeader={() => (
<View
style={{
flexDirection: "row",
width: "100%",
justifyContent: "flex-end",
alignItems: "center",
height: 80,
marginTop: 0,
paddingHorizontal: 12,
position: "absolute",
zIndex: 999,
backgroundColor: "rgba(0,0,0,0.3)",
paddingTop: 30
}}
>
<IconButton
name="close"
color="white"
onPress={() => {
close();
{loading ? (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center"
}}
>
<ProgressBarComponent
indeterminate
color={colors.accent}
borderColor="transparent"
/>
</View>
) : (
<ImageViewer
enableImageZoom={true}
renderIndicator={() => <></>}
enableSwipeDown
useNativeDriver
onSwipeDown={close}
saveToLocalByLongPress={false}
renderHeader={() => (
<View
style={{
flexDirection: "row",
width: "100%",
justifyContent: "flex-end",
alignItems: "center",
height: 80,
marginTop: 0,
paddingHorizontal: 12,
position: "absolute",
zIndex: 999,
backgroundColor: "rgba(0,0,0,0.3)",
paddingTop: Platform.OS === "android" ? 30 : 0
}}
/>
</View>
)}
imageUrls={[
{
url: image
}
]}
/>
>
<IconButton
name="close"
color="white"
onPress={() => {
close();
}}
/>
</View>
)}
imageUrls={[
{
url: image
}
]}
/>
)}
</View>
</BaseDialog>
)

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,15 +19,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react";
import Animated, { FadeInDown } from "react-native-reanimated";
import umami from "../../common/analytics";
import { DDS } from "../../services/device-detection";
import { eSendEvent } from "../../services/event-manager";
import Navigation from "../../services/navigation";
import SettingsService from "../../services/settings";
import { useThemeStore } from "../../stores/use-theme-store";
import { getElevation } from "../../utils";
import { eOpenLoginDialog } from "../../utils/events";
import {
eCloseLoading,
eOpenLoading,
eOpenLoginDialog
} from "../../utils/events";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import { AuthMode } from "../auth";
import { Button } from "../ui/button";
import { SvgView } from "../ui/svg";
@@ -82,7 +86,6 @@ export const WelcomeNotice = () => {
}
);
}, 1000);
umami.pageView("/encryptionnotice", "/welcome/privacymode");
}}
style={{
paddingHorizontal: 24,
@@ -94,6 +97,39 @@ export const WelcomeNotice = () => {
type="accent"
title="Create your account"
/>
<Button
title="Skip for now"
onPress={async () => {
eSendEvent(eOpenLoading);
await sleep(1000);
SettingsService.set({
introCompleted: true
});
Navigation.replace(
{
name: "Notes"
},
{
canGoBack: false
}
);
await sleep(1000);
eSendEvent(eCloseLoading);
}}
iconSize={20}
type="gray"
iconPosition="right"
icon="chevron-right"
height={25}
iconStyle={{
marginTop: 2
}}
style={{
paddingHorizontal: 6,
marginTop: 10
}}
/>
</Animated.View>
);
};

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,20 +17,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 notifee from "@notifee/react-native";
import React, { useCallback, useEffect, useRef } from "react";
import { Platform, View } from "react-native";
import RNBootSplash from "react-native-bootsplash";
import { checkVersion } from "react-native-check-version";
import Config from "react-native-config";
import { enabled } from "react-native-privacy-snapshot";
import { DatabaseLogger, db, loadDatabase } from "../../common/database";
import { DatabaseLogger, db } from "../../common/database";
import { useAppState } from "../../hooks/use-app-state";
import BackupService from "../../services/backup";
import BiometricService from "../../services/biometrics";
import {
eSendEvent,
presentSheet,
ToastEvent
} from "../../services/event-manager";
import { eSendEvent, presentSheet } from "../../services/event-manager";
import { setRateAppMessage } from "../../services/message";
import PremiumService from "../../services/premium";
import SettingsService from "../../services/settings";
@@ -40,7 +37,9 @@ import { useNoteStore } from "../../stores/use-notes-store";
import { useSettingStore } from "../../stores/use-setting-store";
import { useThemeStore } from "../../stores/use-theme-store";
import { useUserStore } from "../../stores/use-user-store";
import { AndroidModule } from "../../utils";
import { eOpenAnnouncementDialog } from "../../utils/events";
import { getGithubVersion } from "../../utils/github-version";
import { SIZE } from "../../utils/size";
import { sleep } from "../../utils/time";
import { SVG } from "../auth/background";
@@ -71,7 +70,7 @@ const Launcher = React.memo(
const introCompleted = useSettingStore(
(state) => state.settings.introCompleted
);
const dbInitCompleted = useRef(false);
const loadNotes = useCallback(async () => {
if (verifyUser) {
return;
@@ -82,27 +81,25 @@ const Launcher = React.memo(
initialize();
setImmediate(() => {
setLoading(false);
if (!dbInitCompleted.current) {
setImmediate(() => doAppLoadActions());
}
});
});
});
}, [doAppLoadActions, setLoading, verifyUser]);
}, [setLoading, verifyUser]);
const init = useCallback(async () => {
if (!dbInitCompleted.current) {
if (!db.isInitialized) {
await RNBootSplash.hide({ fade: true });
await loadDatabase();
DatabaseLogger.info("Initializing database");
await db.init();
dbInitCompleted.current = true;
}
if (db.migrations.required() && !verifyUser) {
presentSheet({
component: <Migrate />,
onClose: () => {
onClose: async () => {
if (!db.isInitialized) {
await db.init();
}
loadNotes();
},
disableClosing: true
@@ -117,17 +114,10 @@ const Launcher = React.memo(
}
}, [loadNotes, verifyUser]);
// useEffect(() => {
// hideSplashScreen();
// }, [verifyUser]);
useEffect(() => {
if (!loading) {
doAppLoadActions();
}
return () => {
dbInitCompleted.current = false;
};
}, [doAppLoadActions, loading]);
const doAppLoadActions = useCallback(async () => {
@@ -136,20 +126,8 @@ const Launcher = React.memo(
eSendEvent("session_expired");
return;
}
const user = await db.user.getUser();
notifee.setBadgeCount(0);
await useMessageStore.getState().setAnnouncement();
if (PremiumService.get() && user) {
if (SettingsService.get().reminder === "off") {
SettingsService.set({ reminder: "daily" });
}
if (
await BackupService.checkBackupRequired(
SettingsService.get().reminder
)
) {
sleep(2000).then(() => BackupService.run());
}
}
if (NewFeature.present()) return;
if (await checkAppUpdateAvailable()) return;
if (await checkForRateAppRequest()) return;
@@ -167,10 +145,13 @@ const Launcher = React.memo(
}, [introCompleted]);
const checkAppUpdateAvailable = async () => {
if (__DEV__) return;
if (__DEV__ || Config.isTesting === "true") return;
try {
const version = await checkVersion();
if (!version.needsUpdate) return false;
const version =
Config.GITHUB_RELEASE === "true"
? await getGithubVersion()
: await checkVersion();
if (!version || !version?.needsUpdate) return false;
presentSheet({
component: (ref) => <Update version={version} fwdRef={ref} />
});
@@ -211,13 +192,12 @@ const Launcher = React.memo(
};
const onUnlockBiometrics = useCallback(async () => {
if (!(await BiometricService.isBiometryAvailable())) {
ToastEvent.show({
heading: "Biometrics unavailable",
message: "Try unlocking the app with your account password"
});
return;
if (!(await BiometricService.isBiometryAvailable())) return;
if (Platform.OS === "android") {
const activityName = await AndroidModule.getActivityName();
if (activityName !== "MainActivity") return;
}
let verified = await BiometricService.validateUser(
"Unlock to access your notes",
""

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -122,7 +122,7 @@ export const SectionHeader = React.memo(
alignItems: "center"
}}
>
{index === 0 ? (
{index === 0 && (
<>
<Button
onPress={() => {
@@ -130,6 +130,7 @@ export const SectionHeader = React.memo(
component: <Sort screen={screen} type={type} />
});
}}
hidden={screen === "Reminders"}
tooltipText="Change sorting of items in list"
fwdRef={sortRef}
title={groupBy}
@@ -152,38 +153,35 @@ export const SectionHeader = React.memo(
iconPosition="right"
/>
{type === "notes" || type === "notebooks" || type === "home" ? (
<IconButton
customStyle={{
width: 25,
height: 25
}}
testID="icon-compact-mode"
tooltipText={
listMode == "compact"
? "Switch to normal mode"
: "Switch to compact mode"
}
fwdRef={compactModeRef}
color={colors.icon}
name={
listMode == "compact" ? "view-list" : "view-list-outline"
}
onPress={() => {
let settings = {};
settings[
type !== "notebooks"
? "notesListMode"
: "notebooksListMode"
] = listMode === "normal" ? "compact" : "normal";
<IconButton
customStyle={{
width: 25,
height: 25
}}
hidden={
type !== "notes" && type !== "notebooks" && type !== "home"
}
testID="icon-compact-mode"
tooltipText={
listMode == "compact"
? "Switch to normal mode"
: "Switch to compact mode"
}
fwdRef={compactModeRef}
color={colors.icon}
name={listMode == "compact" ? "view-list" : "view-list-outline"}
onPress={() => {
let settings = {};
settings[
type !== "notebooks" ? "notesListMode" : "notebooksListMode"
] = listMode === "normal" ? "compact" : "normal";
SettingsService.set(settings);
}}
size={SIZE.lg - 2}
/>
) : null}
SettingsService.set(settings);
}}
size={SIZE.lg - 2}
/>
</>
) : null}
)}
</View>
</View>
);

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,14 +17,18 @@ 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 { getUpcomingReminder } from "@notesnook/core/collections/reminders";
import { decode, EntityLevel } from "entities";
import React from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { notesnook } from "../../../../e2e/test.ids";
import { db } from "../../../common/database";
import Notebook from "../../../screens/notebook";
import { TaggedNotes } from "../../../screens/notes/tagged";
import { TopicNotes } from "../../../screens/notes/topic-notes";
import useNavigationStore from "../../../stores/use-navigation-store";
import { useRelationStore } from "../../../stores/use-relation-store";
import { useSettingStore } from "../../../stores/use-setting-store";
import { useThemeStore } from "../../../stores/use-theme-store";
import { COLORS_NOTE } from "../../../utils/color-scheme";
@@ -32,14 +36,11 @@ import { SIZE } from "../../../utils/size";
import { Properties } from "../../properties";
import { Button } from "../../ui/button";
import { IconButton } from "../../ui/icon-button";
import { ReminderTime } from "../../ui/reminder-time";
import { TimeSince } from "../../ui/time-since";
import Heading from "../../ui/typography/heading";
import Paragraph from "../../ui/typography/paragraph";
const navigateToTopic = (topic) => {
TopicNotes.navigate(topic, true);
};
function navigateToTag(item) {
const tag = db.tags.tag(item.id);
if (!tag) return;
@@ -52,30 +53,48 @@ const showActionSheet = (item) => {
function getNotebook(item) {
const isTrash = item.type === "trash";
if (isTrash || !item.notebooks || item.notebooks.length < 1) return [];
const currentId = useNavigationStore.getState().currentScreen.id;
if (isTrash) return [];
const items = [];
const notebooks = db.relations.to(item, "notebook") || [];
return item.notebooks.reduce(function (prev, curr) {
if (prev && prev.length > 0) return prev;
const topicId = curr.topics[0];
const notebook = db.notebooks?.notebook(curr.id)?.data;
if (!notebook) return;
const topic = notebook.topics.find((t) => t.id === topicId);
if (!topic) return;
for (let notebook of notebooks) {
if (items.length > 1) break;
if (notebook.id === currentId) continue;
items.push(notebook);
}
return [
{
title: `${notebook?.title} ${topic?.title}`,
notebook: notebook,
topic: topic
if (item.notebooks) {
for (let nb of item.notebooks) {
if (items.length > 1) break;
const notebook = db.notebooks?.notebook(nb.id)?.data;
if (!notebook) continue;
for (let topicId of nb.topics) {
if (items.length > 1) break;
if (topicId === currentId) continue;
const topic = notebook.topics.find((t) => t.id === topicId);
if (!topic) continue;
items.push(topic);
}
];
}, []);
}
}
return items;
}
function getTags(item) {
const noteTags = item.tags?.slice(0, 3) || [];
const tags = [];
for (const tagName of noteTags) {
const tag = db.tags.tag(tagName);
if (!tag) continue;
tags.push(tag);
}
return tags;
}
const NoteItem = ({
item,
isTrash,
tags,
dateBy = "dateCreated",
noOpen = false
}) => {
@@ -85,8 +104,13 @@ const NoteItem = ({
);
const compactMode = notesListMode === "compact";
const attachmentCount = db.attachments?.ofNote(item.id, "all")?.length || 0;
const notebooks = React.useMemo(() => getNotebook(item), [item]);
const _update = useRelationStore((state) => state.updater);
// eslint-disable-next-line react-hooks/exhaustive-deps
const notebooks = React.useMemo(() => getNotebook(item), [item, _update]);
const reminders = db.relations.from(item, "reminder");
const reminder = getUpcomingReminder(reminders);
const noteColor = COLORS_NOTE[item.color?.toLowerCase()];
const tags = getTags(item);
return (
<>
<View
@@ -102,15 +126,21 @@ const NoteItem = ({
alignItems: "center",
zIndex: 10,
elevation: 10,
marginBottom: 2.5
marginBottom: 2.5,
flexWrap: "wrap"
}}
>
{notebooks.map((_item) => (
{notebooks?.map((item) => (
<Button
title={_item.title}
key={_item}
height={20}
icon="book-outline"
title={
item.title.length > 25
? item.title.slice(0, 25) + "..."
: item.title
}
tooltipText={item.title}
key={item.id}
height={25}
icon={item.type === "topic" ? "bookmark" : "book-outline"}
type="grayBg"
fontSize={SIZE.xs}
iconSize={SIZE.sm}
@@ -122,11 +152,29 @@ const NoteItem = ({
marginRight: 5,
borderWidth: 0.5,
borderColor: colors.icon,
paddingHorizontal: 6
paddingHorizontal: 6,
marginBottom: 5
}}
onPress={() => {
if (item.type === "topic") {
TopicNotes.navigate(item, true);
} else {
Notebook.navigate(item);
}
}}
onPress={() => navigateToTopic(_item.topic)}
/>
))}
<ReminderTime
reminder={reminder}
color={noteColor}
onPress={() => {
Properties.present(reminder);
}}
style={{
height: 25
}}
/>
</View>
) : null}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,21 +20,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react";
import NoteItem from ".";
import { notesnook } from "../../../../e2e/test.ids";
import { useSelectionStore } from "../../../stores/use-selection-store";
import { useTrashStore } from "../../../stores/use-trash-store";
import { useEditorStore } from "../../../stores/use-editor-store";
import { db } from "../../../common/database";
import { DDS } from "../../../services/device-detection";
import {
eSendEvent,
hideSheet,
openVault,
ToastEvent
presentSheet
} from "../../../services/event-manager";
import Navigation from "../../../services/navigation";
import { useEditorStore } from "../../../stores/use-editor-store";
import { useSelectionStore } from "../../../stores/use-selection-store";
import { history } from "../../../utils";
import { db } from "../../../common/database";
import { eOnLoadNote, eShowMergeDialog } from "../../../utils/events";
import { tabBarRef } from "../../../utils/global-refs";
import { presentDialog } from "../../dialog/functions";
import NotePreview from "../../note-history/preview";
import SelectionWrapper from "../selection-wrapper";
const present = () =>
@@ -44,9 +44,9 @@ const present = () =>
paragraph: "Please sync again to open this note for editing"
});
export const openNote = async (item, isTrash, setSelectedItem) => {
export const openNote = async (item, isTrash, setSelectedItem, isSheet) => {
let _note = item;
if (isSheet) hideSheet();
if (!isTrash) {
_note = db.notes.note(item.id).data;
if (!db.notes.note(item.id)?.synced()) {
@@ -84,39 +84,11 @@ export const openNote = async (item, isTrash, setSelectedItem) => {
return;
}
if (isTrash) {
presentDialog({
title: `Restore ${item.itemType}`,
paragraph: `Restore or delete ${item.itemType} forever`,
positiveText: "Restore",
negativeText: "Delete",
positivePress: async () => {
await db.trash.restore(item.id);
Navigation.queueRoutesForUpdate(
"Tags",
"Notes",
"Notebooks",
"Favorites",
"Trash",
"TaggedNotes",
"ColoredNotes",
"TopicNotes"
);
useSelectionStore.getState().setSelectionMode(false);
ToastEvent.show({
heading: "Restore successful",
type: "success"
});
},
onClose: async () => {
await db.trash.delete(item.id);
useTrashStore.getState().setTrash();
useSelectionStore.getState().setSelectionMode(false);
ToastEvent.show({
heading: "Permanantly deleted items",
type: "success",
context: "local"
});
}
const content = await db.content.get(item.contentId);
presentSheet({
component: (
<NotePreview note={item} content={{ type: "tiptap", data: content }} />
)
});
} else {
useEditorStore.getState().setReadonly(_note?.readonly);
@@ -128,7 +100,7 @@ export const openNote = async (item, isTrash, setSelectedItem) => {
};
export const NoteWrapper = React.memo(
function NoteWrapper({ item, index, tags, dateBy }) {
function NoteWrapper({ item, index, dateBy, isSheet }) {
const isTrash = item.type === "trash";
const setSelectedItem = useSelectionStore((state) => state.setSelectedItem);
@@ -137,10 +109,11 @@ export const NoteWrapper = React.memo(
index={index}
height={100}
testID={notesnook.ids.note.get(index)}
onPress={() => openNote(item, isTrash, setSelectedItem)}
onPress={() => openNote(item, isTrash, setSelectedItem, isSheet)}
isSheet={isSheet}
item={item}
>
<NoteItem item={item} dateBy={dateBy} tags={tags} isTrash={isTrash} />
<NoteItem item={item} dateBy={dateBy} isTrash={isTrash} />
</SelectionWrapper>
);
},
@@ -152,10 +125,6 @@ export const NoteWrapper = React.memo(
return false;
}
if (JSON.stringify(prev.tags) !== JSON.stringify(next.tags)) {
return false;
}
if (prev.item !== next.item) {
return false;
}

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@ import { notesnook } from "../../../../e2e/test.ids";
import { TopicNotes } from "../../../screens/notes/topic-notes";
import { useSettingStore } from "../../../stores/use-setting-store";
import { useThemeStore } from "../../../stores/use-theme-store";
import { getTotalNotes, history } from "../../../utils";
import { history } from "../../../utils";
import { SIZE } from "../../../utils/size";
import { Properties } from "../../properties";
import { Button } from "../../ui/button";
@@ -41,14 +41,19 @@ const navigateToTopic = (topic) => {
TopicNotes.navigate(topic, true);
};
export const NotebookItem = ({ item, isTopic = false, isTrash, dateBy }) => {
export const NotebookItem = ({
item,
isTopic = false,
isTrash,
dateBy,
totalNotes
}) => {
const colors = useThemeStore((state) => state.colors);
const notebooksListMode = useSettingStore(
(state) => state.settings.notebooksListMode
);
const compactMode = notebooksListMode === "compact";
const topics = item.topics?.slice(0, 3) || [];
const totalNotes = getTotalNotes(item);
return (
<>
@@ -126,16 +131,6 @@ export const NotebookItem = ({ item, isTopic = false, isTrash, dateBy }) => {
height: SIZE.md + 2
}}
>
<Paragraph
color={colors.accent}
size={SIZE.xs}
style={{
marginRight: 6
}}
>
{isTopic ? "Topic" : "Notebook"}
</Paragraph>
{isTrash ? (
<>
<Paragraph

View File

@@ -1,7 +1,7 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -64,16 +64,7 @@ export const openNotebookTopic = (item) => {
negativeText: "Delete",
positivePress: async () => {
await db.trash.restore(item.id);
Navigation.queueRoutesForUpdate(
"Tags",
"Notes",
"Notebooks",
"Favorites",
"Trash",
"TaggedNotes",
"ColoredNotes",
"TopicNotes"
);
Navigation.queueRoutesForUpdate();
useSelectionStore.getState().setSelectionMode(false);
ToastEvent.show({
heading: "Restore successful",
@@ -101,7 +92,7 @@ export const openNotebookTopic = (item) => {
};
export const NotebookWrapper = React.memo(
function NotebookWrapper({ item, index, dateBy }) {
function NotebookWrapper({ item, index, dateBy, totalNotes }) {
const isTrash = item.type === "trash";
return (
@@ -118,11 +109,13 @@ export const NotebookWrapper = React.memo(
dateBy={dateBy}
index={index}
isTrash={isTrash}
totalNotes={totalNotes}
/>
</SelectionWrapper>
);
},
(prev, next) => {
if (prev.totalNotes !== next.totalNotes) return false;
if (prev.item.title !== next.item.title) return false;
if (prev.dateBy !== next.dateBy) {
return false;

View File

@@ -0,0 +1,187 @@
/*
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 from "react";
import { View } from "react-native";
import { notesnook } from "../../../../e2e/test.ids";
import type { Reminder } from "../../../services/notifications";
import { useThemeStore } from "../../../stores/use-theme-store";
import { SIZE } from "../../../utils/size";
import { Properties } from "../../properties";
import { IconButton } from "../../ui/icon-button";
import Heading from "../../ui/typography/heading";
import Paragraph from "../../ui/typography/paragraph";
import SelectionWrapper from "../selection-wrapper";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import ReminderSheet from "../../sheets/reminder";
import { ReminderTime } from "../../ui/reminder-time";
const ReminderItem = React.memo(
({
item,
index,
isSheet
}: {
item: Reminder;
index: number;
isSheet: boolean;
}) => {
const colors = useThemeStore((state) => state.colors);
const openReminder = () => {
ReminderSheet.present(item, undefined, isSheet);
};
return (
<SelectionWrapper
//@ts-ignore
index={index}
height={100}
onPress={openReminder}
item={item}
isSheet={isSheet}
>
<View
style={{
flexShrink: 1,
opacity: item.disabled ? 0.5 : 1
}}
>
<Heading
numberOfLines={1}
style={{
flexWrap: "wrap"
}}
size={SIZE.md}
>
{item.title}
</Heading>
{item.description ? (
<Paragraph
style={{
flexWrap: "wrap"
}}
numberOfLines={2}
>
{item.description}
</Paragraph>
) : null}
<View
style={{
flexDirection: "row",
flexWrap: "wrap"
}}
>
{item.disabled ? (
<View
style={{
backgroundColor: colors.nav,
borderRadius: 5,
flexDirection: "row",
paddingHorizontal: 6,
alignItems: "center",
marginTop: 5,
justifyContent: "flex-start",
alignSelf: "flex-start",
marginRight: 10,
height: 30
}}
>
<Icon
name="bell-off-outline"
size={SIZE.md}
color={colors.errorText}
/>
<Paragraph
size={SIZE.xs + 1}
color={colors.icon}
style={{ marginLeft: 5 }}
>
Disabled
</Paragraph>
</View>
) : null}
{item.mode === "repeat" && item.recurringMode ? (
<View
style={{
backgroundColor: colors.nav,
borderRadius: 5,
flexDirection: "row",
paddingHorizontal: 6,
alignItems: "center",
marginTop: 5,
justifyContent: "flex-start",
alignSelf: "flex-start",
marginRight: 10,
height: 30
}}
>
<Icon name="reload" size={SIZE.md} color={colors.accent} />
<Paragraph
size={SIZE.xs + 1}
color={colors.icon}
style={{ marginLeft: 5 }}
>
{item.recurringMode.slice(0, 1).toUpperCase() +
item.recurringMode.replace("y", "i").slice(1) +
"ly"}
</Paragraph>
</View>
) : null}
<ReminderTime
reminder={item}
checkIsActive={false}
fontSize={SIZE.xs + 1}
style={{
justifyContent: "flex-start",
borderWidth: 0,
height: 30,
alignSelf: "flex-start",
marginTop: 5
}}
/>
</View>
</View>
<IconButton
testID={notesnook.listitem.menu}
color={colors.pri}
name="dots-horizontal"
size={SIZE.xl}
onPress={() => Properties.present(item, [], isSheet)}
customStyle={{
justifyContent: "center",
height: 35,
width: 35,
borderRadius: 100,
alignItems: "center"
}}
/>
</SelectionWrapper>
);
},
(prev, next) => {
if (prev.item?.dateModified !== next.item?.dateModified) {
return false;
}
return true;
}
);
ReminderItem.displayName = "ReminderItem";
export default ReminderItem;

View File

@@ -1,323 +0,0 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 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 Clipboard from "@react-native-clipboard/clipboard";
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import Animated, { SlideInUp, SlideOutDown } from "react-native-reanimated";
import { db } from "../../../common/database";
import { openVault, ToastEvent } from "../../../services/event-manager";
import Navigation from "../../../services/navigation";
import { useMenuStore } from "../../../stores/use-menu-store";
import { useNotebookStore } from "../../../stores/use-notebook-store";
import { useSelectionStore } from "../../../stores/use-selection-store";
import { useThemeStore } from "../../../stores/use-theme-store";
import { useTrashStore } from "../../../stores/use-trash-store";
import { dWidth, getElevation, toTXT } from "../../../utils";
import { deleteItems } from "../../../utils/functions";
import { presentDialog } from "../../dialog/functions";
import { Button } from "../../ui/button";
import { IconButton } from "../../ui/icon-button";
export const ActionStrip = ({ note, setActionStrip }) => {
const colors = useThemeStore((state) => state.colors);
const selectionMode = useSelectionStore((state) => state.selectionMode);
const setNotebooks = useNotebookStore((state) => state.setNotebooks);
const setMenuPins = useMenuStore((state) => state.setMenuPins);
const setSelectedItem = useSelectionStore((state) => state.setSelectedItem);
const setSelectionMode = useSelectionStore((state) => state.setSelectionMode);
const [isPinnedToMenu, setIsPinnedToMenu] = useState(false);
const [width, setWidth] = useState(dWidth - 16);
useEffect(() => {
if (note.type === "note") return;
setIsPinnedToMenu(db.shortcuts.exists(note.id));
}, [note.id, note.type]);
const updateNotes = () => {
Navigation.queueRoutesForUpdate(
"Notes",
"Favorites",
"ColoredNotes",
"TaggedNotes",
"TopicNotes"
);
};
const actions = [
{
title: "Pin " + note.type,
icon: note.pinned ? "pin-off" : "pin",
visible: note.type === "note" || note.type === "notebook",
onPress: async () => {
if (!note.id) return;
if (note.type === "note") {
if (db.notes.pinned.length === 3 && !note.pinned) {
ToastEvent.show({
heading: "Cannot pin more than 3 notes",
type: "error"
});
return;
}
await db.notes.note(note.id).pin();
} else {
if (db.notebooks.pinned.length === 3 && !note.pinned) {
ToastEvent.show({
heading: "Cannot pin more than 3 notebooks",
type: "error"
});
return;
}
await db.notebooks.notebook(note.id).pin();
setNotebooks();
}
updateNotes();
setActionStrip(false);
}
},
{
title: "Add to favorites",
icon: note.favorite ? "star-off" : "star",
onPress: async () => {
if (!note.id) return;
if (note.type === "note") {
await db.notes.note(note.id).favorite();
} else {
await db.notebooks.notebook(note.id).favorite();
}
updateNotes();
setActionStrip(false);
},
visible: note.type === "note",
color: !note.favorite ? "orange" : null
},
{
title: isPinnedToMenu
? "Remove Shortcut from Menu"
: "Add Shortcut to Menu",
icon: isPinnedToMenu ? "link-variant-remove" : "link-variant",
onPress: async () => {
try {
if (isPinnedToMenu) {
await db.shortcuts.remove(note.id);
ToastEvent.show({
heading: "Shortcut removed from menu",
type: "success"
});
} else {
if (note.type === "topic") {
await db.shortcuts.add({
item: {
type: "topic",
id: note.id,
notebookId: note.notebookId
}
});
} else {
await db.shortcuts.add({
item: {
type: "notebook",
id: note.id
}
});
}
ToastEvent.show({
heading: "Shortcut added to menu",
type: "success"
});
}
setIsPinnedToMenu(db.shortcuts.exists(note.id));
setMenuPins();
setActionStrip(false);
} catch (e) {
console.error(e);
}
},
visible: note.type !== "note"
},
{
title: "Copy Note",
icon: "content-copy",
visible: note.type === "note",
onPress: async () => {
if (note.locked) {
openVault({
copyNote: true,
novault: true,
locked: true,
item: note,
title: "Copy note",
description: "Unlock note to copy to clipboard."
});
} else {
let text = await toTXT(note);
text = `${note.title}\n \n ${text}`;
Clipboard.setString(text);
ToastEvent.show({
heading: "Note copied to clipboard",
type: "success"
});
}
setActionStrip(false);
}
},
{
title: "Restore " + note.itemType,
icon: "delete-restore",
onPress: async () => {
await db.trash.restore(note.id);
Navigation.queueRoutesForUpdate(
"Notes",
"Favorites",
"ColoredNotes",
"TaggedNotes",
"TopicNotes",
"Trash",
"Notebooks"
);
ToastEvent.show({
heading:
note.type === "note"
? "Note restored from trash"
: "Notebook restored from trash",
type: "success"
});
setActionStrip(false);
},
visible: note.type === "trash"
},
{
title: "Delete" + note.itemType,
icon: "delete",
visible: note.type === "trash",
onPress: () => {
presentDialog({
title: "Permanent delete",
paragraph: `Are you sure you want to delete this ${note.itemType} permanantly from trash?`,
positiveText: "Delete",
negativeText: "Cancel",
positivePress: async () => {
await db.trash.delete(note.id);
useTrashStore.getState().setTrash();
useSelectionStore.getState().setSelectionMode(false);
ToastEvent.show({
heading: "Permanantly deleted items",
type: "success",
context: "local"
});
},
positiveType: "errorShade"
});
setActionStrip(false);
}
},
{
title: "Delete" + note.type,
icon: "delete",
visible: note.type !== "trash",
onPress: async () => {
try {
await deleteItems(note);
} catch (e) {
console.error(e);
}
setActionStrip(false);
}
},
{
title: "Close",
icon: "close",
onPress: () => setActionStrip(false),
color: colors.light,
bg: colors.red,
visible: true
}
];
return (
<Animated.View
onLayout={(event) => {
setWidth(event.nativeEvent.layout.width);
}}
entering={SlideInUp.springify().mass(0.4)}
exiting={SlideOutDown}
style={{
position: "absolute",
zIndex: 999,
width: "102%",
height: "100%",
flexDirection: "row",
justifyContent: "flex-end",
alignItems: "center"
}}
>
<Button
type="accent"
title="Select"
icon="check"
tooltipText="Select Item"
onPress={() => {
if (!selectionMode) {
setSelectionMode(true);
}
setSelectedItem(note);
setActionStrip(false);
}}
style={{
borderRadius: 100,
paddingHorizontal: 12,
...getElevation(5)
}}
height={30}
/>
{actions.map((item) =>
item.visible ? (
<View
key={item.icon}
style={{
width: width / 1.4 / actions.length,
height: width / 1.4 / actions.length,
backgroundColor: item.bg || colors.nav,
borderRadius: 100,
justifyContent: "center",
alignItems: "center",
...getElevation(5),
marginLeft: 15
}}
>
<IconButton
color={item.color || colors.heading}
onPress={item.onPress}
tooltipText={item.title}
top={60}
bottom={60}
name={item.icon}
size={width / 2.8 / actions.length}
/>
</View>
) : null
)}
</Animated.View>
);
};

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