Compare commits

...

773 Commits

Author SHA1 Message Date
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
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
1257 changed files with 125423 additions and 54434 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,7 +213,7 @@ 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
working-directory: ./apps/web/desktop
@@ -218,7 +230,7 @@ jobs:
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

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

@@ -0,0 +1,54 @@
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: 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

@@ -28,12 +28,6 @@ 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.
@@ -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

View File

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

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

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",

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";
@@ -68,7 +68,7 @@ export default async function downloadAttachment(hash, global = true) {
chunkSize: attachment.chunkSize
};
let fileUri = await Sodium.decryptFile(key, info, false);
let fileUri = await Sodium.decryptFile(key, info, "file");
ToastEvent.show({
heading: "Download successful",
message: attachment.metadata.filename + " downloaded",

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,10 +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 {
checkAttachment, downloadFile,
getUploadedFileSize
} from "./download";
import { checkAttachment, downloadFile, getUploadedFileSize } from "./download";
import {
clearFileStorage,
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,13 +41,24 @@ 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;
}
}

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

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
@@ -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,27 +27,23 @@ 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) {
function getObfuscatedEmail(email) {
if (!email) return null;
return email.replace(/(.{2})(.*)(?=@)/, function (gp1, gp2, gp3) {
for (let i = 0; i < gp3.length; i++) {
@@ -59,15 +55,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 +87,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 +115,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 +133,8 @@ export const SessionExpired = () => {
width: focused ? "100%" : "99.9%",
padding: 12,
justifyContent: "center",
flex: 1
flex: 1,
backgroundColor: colors.bg
}}
>
<View
@@ -225,29 +165,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
@@ -26,6 +26,7 @@ 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";
@@ -47,6 +48,7 @@ const DialogProvider = () => {
return (
<>
<LoadingDialog />
<Dialog context="global" />
<AddTopicDialog colors={colors} />
<AddNotebookSheet colors={colors} />

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

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,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

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

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
@@ -32,6 +32,7 @@ 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 = {};
@@ -104,7 +105,8 @@ export const Title = () => {
style={{
opacity: 1,
flexShrink: 1,
flexDirection: "row"
flexDirection: "row",
alignItems: "center"
}}
>
{!hide && !isHidden ? (
@@ -135,6 +137,7 @@ export const Title = () => {
{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

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
@@ -24,13 +24,8 @@ import { checkVersion } from "react-native-check-version";
import { enabled } from "react-native-privacy-snapshot";
import { DatabaseLogger, db, loadDatabase } 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";
@@ -55,6 +50,10 @@ import { SvgView } from "../ui/svg";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { Walkthrough } from "../walkthroughs";
import Config from "react-native-config";
import { getGithubVersion } from "../../utils/github-version";
import notifee from "@notifee/react-native";
const Launcher = React.memo(
function Launcher() {
@@ -102,7 +101,8 @@ const Launcher = React.memo(
if (db.migrations.required() && !verifyUser) {
presentSheet({
component: <Migrate />,
onClose: () => {
onClose: async () => {
await db.init();
loadNotes();
},
disableClosing: true
@@ -117,10 +117,6 @@ const Launcher = React.memo(
}
}, [loadNotes, verifyUser]);
// useEffect(() => {
// hideSplashScreen();
// }, [verifyUser]);
useEffect(() => {
if (!loading) {
doAppLoadActions();
@@ -136,20 +132,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;
@@ -169,8 +153,11 @@ const Launcher = React.memo(
const checkAppUpdateAvailable = async () => {
if (__DEV__) 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 +198,7 @@ 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;
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,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { getUpcomingReminder } from "@notesnook/core/collections/reminders";
import { decode, EntityLevel } from "entities";
import React from "react";
import { View } from "react-native";
@@ -25,6 +26,7 @@ import { notesnook } from "../../../../e2e/test.ids";
import { db } from "../../../common/database";
import { TaggedNotes } from "../../../screens/notes/tagged";
import { TopicNotes } from "../../../screens/notes/topic-notes";
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,6 +34,7 @@ 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";
@@ -86,7 +89,10 @@ const NoteItem = ({
const compactMode = notesListMode === "compact";
const attachmentCount = db.attachments?.ofNote(item.id, "all")?.length || 0;
const notebooks = React.useMemo(() => getNotebook(item), [item]);
const reminders = db.relations.from(item, "reminder");
const reminder = getUpcomingReminder(reminders);
const _update = useRelationStore((state) => state.updater);
const noteColor = COLORS_NOTE[item.color?.toLowerCase()];
return (
<>
<View
@@ -102,14 +108,15 @@ const NoteItem = ({
alignItems: "center",
zIndex: 10,
elevation: 10,
marginBottom: 2.5
marginBottom: 2.5,
flexWrap: "wrap"
}}
>
{notebooks?.map((_item) => (
<Button
title={_item.title}
key={_item}
height={20}
height={25}
icon="book-outline"
type="grayBg"
fontSize={SIZE.xs}
@@ -122,11 +129,23 @@ const NoteItem = ({
marginRight: 5,
borderWidth: 0.5,
borderColor: colors.icon,
paddingHorizontal: 6
paddingHorizontal: 6,
marginBottom: 5
}}
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, tags, dateBy, isSheet }) {
const isTrash = item.type === "trash";
const setSelectedItem = useSelectionStore((state) => state.setSelectedItem);
@@ -137,7 +109,8 @@ 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} />

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
@@ -101,7 +101,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 +118,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>
);
};

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,16 +17,11 @@ 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, useState } from "react";
import {
eSubscribeEvent,
eUnSubscribeEvent
} from "../../../services/event-manager";
import React, { useRef } from "react";
import { useSelectionStore } from "../../../stores/use-selection-store";
import { useSettingStore } from "../../../stores/use-setting-store";
import { useThemeStore } from "../../../stores/use-theme-store";
import { history } from "../../../utils";
import { PressableButton } from "../../ui/pressable";
import { ActionStrip } from "./action-strip";
import { Filler } from "./back-fill";
import { SelectionIcon } from "./selection";
@@ -36,10 +31,11 @@ const SelectionWrapper = ({
background,
onLongPress,
onPress,
testID
testID,
isSheet
}) => {
const itemId = useRef(item.id);
const colors = useThemeStore((state) => state.colors);
const [actionStrip, setActionStrip] = useState(false);
const notebooksListMode = useSettingStore(
(state) => state.settings.notebooksListMode
);
@@ -51,34 +47,23 @@ const SelectionWrapper = ({
(item.type === "notebook" || item.type === "note") &&
listMode === "compact";
if (item.id !== itemId.current) {
itemId.current = item.id;
}
const _onLongPress = () => {
if (history.selectedItemsList.length > 0) return;
setActionStrip(!actionStrip);
if (!useSelectionStore.getState().selectionMode) {
useSelectionStore.getState().setSelectionMode(true);
}
useSelectionStore.getState().setSelectedItem(item);
};
const _onPress = async () => {
if (actionStrip) {
setActionStrip(false);
return;
}
await onPress();
};
const closeStrip = () => {
setActionStrip(false);
};
useEffect(() => {
eSubscribeEvent("navigate", closeStrip);
return () => {
eUnSubscribeEvent("navigate", closeStrip);
};
}, []);
return (
<PressableButton
customColor="transparent"
customColor={isSheet ? colors.transGray : "transparent"}
testID={testID}
onLongPress={_onLongPress}
onPress={_onPress}
@@ -90,10 +75,11 @@ const SelectionWrapper = ({
justifyContent: "space-between",
alignItems: "center",
width: "100%",
borderRadius: 0,
overflow: "hidden",
paddingHorizontal: 12,
paddingVertical: compactMode ? 8 : 12
paddingVertical: compactMode ? 8 : 12,
borderRadius: isSheet ? 10 : 0,
marginBottom: isSheet ? 12 : undefined
}}
>
{item.type === "note" ? (
@@ -101,15 +87,10 @@ const SelectionWrapper = ({
) : null}
<SelectionIcon
compactMode={compactMode}
setActionStrip={setActionStrip}
item={item}
onLongPress={onLongPress}
/>
{children}
{actionStrip ? (
<ActionStrip note={item} setActionStrip={setActionStrip} />
) : null}
</PressableButton>
);
};

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,25 +18,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { useEffect, useState } from "react";
import { TouchableOpacity, View } from "react-native";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { useSelectionStore } from "../../../stores/use-selection-store";
import { useThemeStore } from "../../../stores/use-theme-store";
import { SIZE } from "../../../utils/size";
export const SelectionIcon = ({ setActionStrip, item, compactMode }) => {
export const SelectionIcon = ({ item }) => {
const colors = useThemeStore((state) => state.colors);
const selectionMode = useSelectionStore((state) => state.selectionMode);
const selectedItemsList = useSelectionStore(
(state) => state.selectedItemsList
);
const setSelectedItem = useSelectionStore((state) => state.setSelectedItem);
const [selected, setSelected] = useState(false);
useEffect(() => {
if (selectionMode) {
setActionStrip(false);
let exists = selectedItemsList.filter(
(o) => o.dateCreated === item.dateCreated
);
@@ -51,52 +49,29 @@ export const SelectionIcon = ({ setActionStrip, item, compactMode }) => {
}
}
}
}, [
selectedItemsList,
item.id,
selectionMode,
setActionStrip,
item.dateCreated,
selected
]);
const onPress = () => {
setSelectedItem(item);
};
}, [selectedItemsList, item.id, selectionMode, item.dateCreated, selected]);
return selectionMode ? (
<View
style={{
display: "flex",
opacity: 1,
width: "10%",
height: compactMode ? 40 : 70,
width: 40,
height: 40,
justifyContent: "center",
alignItems: "center",
backgroundColor: colors.bg,
borderRadius: 5,
marginRight: 10,
borderWidth: 1,
borderColor: selected ? colors.accent : colors.border
borderRadius: 100,
borderColor: colors.border
}}
pointerEvents="none"
>
<TouchableOpacity
activeOpacity={1}
onPress={onPress}
style={{
justifyContent: "center",
alignItems: "center",
height: 70
}}
>
{selected && (
<Icon
size={SIZE.xl}
color={selected ? colors.accent : colors.icon}
name="check"
/>
)}
</TouchableOpacity>
{selected ? (
<Icon
size={SIZE.xl}
color={selected ? colors.accent : colors.icon}
name={"check"}
/>
) : null}
</View>
) : null;
};

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