Compare commits

...

1221 Commits

Author SHA1 Message Date
ammarahm-ed
74a0a117e6 editor: fix code-block ui 2023-09-11 12:35:04 +05:00
ammarahm-ed
e8e50bebcf theme: support code-block css in builder 2023-09-11 12:33:14 +05:00
ammarahm-ed
fa0610e392 mobile: release v2.6.3 2023-09-09 11:54:56 +05:00
Abdullah Atta
124489a5a5 web: bump to version 2.6.3 2023-09-09 11:06:56 +05:00
Abdullah Atta
22fcdc0fb1 desktop: bump to version 2.6.3 2023-09-09 11:06:20 +05:00
Abdullah Atta
1375300a91 desktop: downgrade electron to v25.8.0 2023-09-09 11:05:25 +05:00
Abdullah Atta
e6f4aea4d7 desktop: handle unhandled errors 2023-09-08 14:49:02 +05:00
Abdullah Atta
d72c4057ff theme: support ARGB values in background 2023-09-08 09:45:54 +05:00
Abdullah Atta
02d80ee4fa web: add separate plan for education discount 2023-09-07 18:39:21 +05:00
ammarahm-ed
2da3e9e0be mobile: release v2.6.2 2023-09-06 21:38:20 +05:00
ammarahm-ed
8333e7bdb3 mobile: set NSExtensionActivationDictionaryVersion to v2 2023-09-06 20:07:15 +05:00
ammarahm-ed
cef2472aae mobile: handle state when app entered background
to take some action like pick a file/image etc.
2023-09-06 20:06:46 +05:00
ammarahm-ed
a4946f7e89 mobile: hide caret when input 2fa code 2023-09-06 20:05:06 +05:00
ammarahm-ed
3e95e0feae mobile: fix db logger not logging 2023-09-06 20:04:46 +05:00
Abdullah Atta
b81843cdf7 core: sync settings before everything else 2023-09-06 19:31:06 +05:00
Abdullah Atta
eedd50fc64 web: bump version to 2.6.2 2023-09-06 17:06:02 +05:00
Abdullah Atta
1cb00bca0d core: fix collector tests 2023-09-06 17:00:04 +05:00
Abdullah Atta
8c233570a7 core: return default values for unset settings 2023-09-06 16:42:51 +05:00
Muhammad Ali
8a3c8b85bb web: fix autocomplete hint in signup form password fields (#3272) 2023-09-06 16:09:54 +05:00
Abdullah Atta
2ee8a807dc core: fix settings getting replaced on login 2023-09-06 15:56:20 +05:00
Abdullah Atta
ec85f748fa core: use serverLastSynced time from client 2023-09-06 15:43:20 +05:00
Abdullah Atta
051b7fcb8c core: notify autosync before setting remote= false 2023-09-06 15:28:56 +05:00
Abdullah Atta
9af88811d8 core: remove remote: true from settings after sync 2023-09-06 15:09:31 +05:00
Abdullah Atta
6c4672037c web: do not run sync on file picker closed 2023-09-06 14:49:56 +05:00
Abdullah Atta
d59e0d9ee2 core: sync attachments before anything else 2023-09-06 14:48:43 +05:00
Abdullah Atta
5a001a1457 core: use bulk io operations for logger storage 2023-09-06 12:30:39 +05:00
Abdullah Atta
44d6474b36 core: fix attachments not syncing 2023-09-06 12:14:03 +05:00
Abdullah Atta
0607e005f5 core: only sync syncable attachments 2023-09-06 12:04:58 +05:00
Abdullah Atta
308eb4b55f core: merge remote attachment if local attachment doesn't exist 2023-09-06 11:40:44 +05:00
Abdullah Atta
6abb6207c5 core: always keep remote attachment if it is newer 2023-09-06 11:16:53 +05:00
Abdullah Atta
89189d52ae web: add log on when sync is ignored 2023-09-06 10:28:31 +05:00
Abdullah Atta
e653ce69f8 core: push items serially tcp style 2023-09-06 10:22:53 +05:00
Abdullah Atta
9b89b328f6 core: send sync progress event after merge 2023-09-06 09:58:07 +05:00
Abdullah Atta
77ae71fab1 web: fix sync status progress 2023-09-06 09:40:24 +05:00
Abdullah Atta
7f7c1e6b93 core: use linkedom and node-fetch for tests 2023-09-06 09:40:24 +05:00
ammarahm-ed
30341bea1c mobile: run sync based on lastSyncTime 2023-09-06 09:27:02 +05:00
Abdullah Atta
82d44ea890 web: show sync status in place of placeholder 2023-09-05 20:15:34 +05:00
Abdullah Atta
5f0907168f core: always send sync request to client 2023-09-05 18:01:44 +05:00
Abdullah Atta
48061962b1 web: fix backup/export tests 2023-09-05 17:47:28 +05:00
Abdullah Atta
24141b66cf core: add log to debug relations removal issue 2023-09-05 17:47:11 +05:00
Abdullah Atta
41beee45ba core: migrate in bulk for more performance 2023-09-05 16:08:10 +05:00
Abdullah Atta
cb7c70b0d6 web: fix navigation menu ui 2023-09-05 15:47:39 +05:00
ammarahm-ed
2aa5a57557 mobile: use accentForeground on accent background 2023-09-05 15:40:25 +05:00
Abdullah Atta
17582bcefb web: fix navigation menu not taking up full space 2023-09-05 15:40:25 +05:00
Abdullah Atta
1f5a5afb10 theme: do not throw error if deprecated color is found 2023-09-05 15:40:25 +05:00
Abdullah Atta
d1c724563f web: fix themes selection not showing themes 2023-09-05 15:40:25 +05:00
Abdullah Atta
72aa5eccb7 server: fix themes pagination 2023-09-05 15:40:25 +05:00
Abdullah Atta
95e0c4b0d6 editor: reduce task list header padding 2023-09-05 15:40:25 +05:00
Abdullah Atta
9ec6ca0ded web: fix various colors 2023-09-05 15:40:25 +05:00
Abdullah Atta
85b7611214 theme: increase opacity of shade color 2023-09-05 15:40:25 +05:00
Abdullah Atta
d256d435e4 theme: mark shade and textSelection colors as deprecated 2023-09-05 15:40:25 +05:00
Abdullah Atta
577a976e01 theme: derive shade color from accent color 2023-09-05 15:40:25 +05:00
Abdullah Atta
07453834b0 docs: update list of colors in theme-engine docs 2023-09-05 15:40:25 +05:00
Abdullah Atta
59f6b5e411 theme: get rid of shade & textSelection colors 2023-09-05 15:40:25 +05:00
Abdullah Atta
ac9be8360a web: list item title should use heading color 2023-09-05 15:40:25 +05:00
Abdullah Atta
32d0b07f09 web: use accentForeground color instead of white 2023-09-05 15:40:25 +05:00
Abdullah Atta
7b57639076 theme: add new accentForeground color 2023-09-05 15:40:25 +05:00
Abdullah Atta
1fa174bab7 theme: fix input placeholder color 2023-09-05 15:40:25 +05:00
Abdullah Atta
6c52b5a77d editor: editor toolbar separators should use separator color 2023-09-05 15:40:25 +05:00
Abdullah Atta
d4a6157ed3 web: navigation menu separators should use separator color 2023-09-05 15:40:25 +05:00
Abdullah Atta
a86358bbcd web: borders between panes should use scoped border color 2023-09-05 15:40:25 +05:00
Abdullah Atta
20d0e6d047 web: fix menu borders should use border color 2023-09-05 15:40:25 +05:00
Muhammad Ali
51fc4bf3e4 core: add support for aligning images in PDF/HTML exports (#3197)
* web: added function for aligning images

* web: removed regex and added replaceAll in loop

* Update apps/web/src/common/export.ts

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

* core: add support for image alignment in html/pdf export

---------

Signed-off-by: Abdullah Atta <thecodrr@protonmail.com>
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-09-05 15:39:59 +05:00
Abdullah Atta
61d0dafd21 desktop: update app-builder-lib patch 2023-09-04 16:01:04 +05:00
Abdullah Atta
89398cb5e5 misc: remove all mention of crypto-worker 2023-09-04 15:58:38 +05:00
Abdullah Atta
72ec4063de global: update lockfiles 2023-09-04 15:58:23 +05:00
Abdullah Atta
f8423eeea8 editor: update test snapshots 2023-09-04 15:51:47 +05:00
Abdullah Atta
d91203990e editor: respect text direction when exiting node using arrow keys 2023-09-04 15:51:47 +05:00
Abdullah Atta
fc84c1af51 editor: add keyboard specific android editor tests 2023-09-04 15:51:47 +05:00
Abdullah Atta
58de07073d editor: improve escaping from & deleting of nodes 2023-09-04 15:51:47 +05:00
Abdullah Atta
cafa5ff821 editor: fix blockquote padding & margin on mobile 2023-09-04 15:51:47 +05:00
Abdullah Atta
1859799ca3 editor: fix crash on adding a task list 2023-09-04 15:51:47 +05:00
Abdullah Atta
271aa11f74 editor: use list-keymap extension instead of own workarounds 2023-09-04 15:51:47 +05:00
Abdullah Atta
e42f1a65f5 editor: update tiptap packages to v2.1.7 2023-09-04 15:51:47 +05:00
Abdullah Atta
73f3a31614 editor: fix sub outline lists not getting outdented 2023-09-04 15:51:47 +05:00
Abdullah Atta
4d7792d06a editor: fix alignment of outline list indicator 2023-09-04 15:51:47 +05:00
ammarahm-ed
1a0f17c059 mobile: update relations store on open notification 2023-09-04 15:46:37 +05:00
ammarahm-ed
89d941401a mobile: fix beta tags ui 2023-09-04 15:46:23 +05:00
ammarahm-ed
a076ee640d mobile: save report issue information if app gets
restarted or accidentally closed
2023-09-04 15:45:30 +05:00
Abdullah Atta
8c1629f7dd web: ask for password when doing sensitive actions 2023-09-04 15:10:18 +05:00
ammarahm-ed
9a31c07ac5 mobile: add verification prompts 2023-09-04 15:10:18 +05:00
ammarahm-ed
11f39316b5 mobile: fix color scheme 2023-09-04 15:09:03 +05:00
ammarahm-ed
f157229e00 mobile: fix theme gets reset on opening share extension 2023-09-04 15:09:03 +05:00
ammarahm-ed
a0f25c4e6f mobile: fix list not updating on change date sort 2023-09-04 15:07:33 +05:00
Ammar Ahmed
003b3d2a84 Remove hover effect on mobile in editor (#3163)
* editor: remove background on hover on mobile

* editor: fix task item alignment and size on mobile
2023-09-04 15:06:41 +05:00
ammarahm-ed
1775e0bda1 mobile: fix flash on launch on ios 2023-09-04 14:37:24 +05:00
Ammar Ahmed
d5038ac631 mobile: fix quick notes from notifications (#3165)
- Add note to default notebook
- Respect paragraph spacing

Signed-off-by: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com>
2023-09-04 14:36:55 +05:00
ammarahm-ed
7eab77ba01 mobile: fix share sheet sorting 2023-09-04 14:34:53 +05:00
ammarahm-ed
89413c56e2 mobile: auto update pinned note in notif 2023-09-04 14:33:39 +05:00
Muhammad Ali
4d89643203 web: fix multi-select context menu for list items (#3159) 2023-09-04 14:31:00 +05:00
ammarahm-ed
e119590249 mobile: prevent login/signup request when loading 2023-09-04 14:27:35 +05:00
ammarahm-ed
ace2dfac30 core: increase server timeout 2023-09-04 14:27:35 +05:00
Abdullah Atta
5843df0ce8 web: allow encrypted backups for basic users 2023-09-04 14:24:46 +05:00
Abdullah Atta
403ed8adb6 web: do not clear attachment upload status on complete 2023-09-04 14:24:24 +05:00
Abdullah Atta
1eb5c8bc46 core: do not trigger auto sync on settings merge 2023-09-04 14:24:24 +05:00
Abdullah Atta
46f7ec5e00 core: do not trigger autosync on attachment upload 2023-09-04 14:24:24 +05:00
Abdullah Atta
52adece147 web: upload arraybuffer on desktop builds for attachments 2023-09-04 14:24:24 +05:00
Abdullah Atta
de50be9d1b desktop: use net.fetch instead when handling protocol 2023-09-04 14:24:24 +05:00
Abdullah Atta
0f9e32b49f desktop: update electron to 26.1.0 2023-09-04 14:24:24 +05:00
Muhammad Ali
b4c15adf5d editor: fix formatting issues when pasting from ChatGPT (#3217)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-09-04 14:22:45 +05:00
Abdullah Atta
a3d3886c51 editor: refactor clipboard extension 2023-09-04 14:22:45 +05:00
Abdullah Atta
0cfa7ce774 editor: paste single line of code as inline code 2023-09-04 14:22:45 +05:00
Abdullah Atta
8299ea909e editor: improve code block detection when pasting from vscode 2023-09-04 14:22:45 +05:00
Abdullah Atta
8b056fe610 editor: preserve formatting when pasting text 2023-09-04 14:22:45 +05:00
Abdullah Atta
511c40db5c editor: do not replace newlines with br when pasting 2023-09-04 14:22:45 +05:00
Muhammad Ali
42d0d42188 web: scroll to top when navigating within settings (#3223) 2023-09-04 13:43:07 +05:00
Abdullah Atta
c80a998444 editor: fix image shuffling on real-time editor sync 2023-09-04 13:41:32 +05:00
ammarahm-ed
0a10df75d1 mobile: add encryptMulti 2023-09-04 13:16:22 +05:00
Abdullah Atta
40d755d191 core: fix all tests 2023-09-04 13:16:22 +05:00
Abdullah Atta
0409a610ab core: improve sync status updates 2023-09-04 13:16:22 +05:00
Abdullah Atta
aa9cd23cf3 core: add fix for localOnly items getting deleted on sync 2023-09-04 13:16:22 +05:00
Abdullah Atta
12d89114a4 core: fix tags & colors not resolving on sync 2023-09-04 13:16:22 +05:00
Abdullah Atta
d5b679187a core: send sync completed event udp style 2023-09-04 13:16:22 +05:00
ammarahm-ed
463ba3754a mobile: add encryptMulti function 2023-09-04 13:16:22 +05:00
Abdullah Atta
2fa8fd14e7 core: migrate to sync v2 for data uploads 2023-09-04 13:16:22 +05:00
Abdullah Atta
fac788d2a9 crypto: remove crypto-worker & simplify crypto interface 2023-09-04 13:16:22 +05:00
ammarahm-ed
6554f900d7 mobile: do not start sync if sync is running 2023-09-04 13:16:22 +05:00
Abdullah Atta
81d3ec83d9 core: fix realtime sync 2023-09-04 13:16:22 +05:00
Abdullah Atta
339c5a357b core: update note-storage mock for tests 2023-09-04 13:16:22 +05:00
ammarahm-ed
b484992037 core: remove console.log 2023-09-04 13:16:22 +05:00
ammarahm-ed
87e42e98c6 mobile: fix logout page ui 2023-09-04 13:16:22 +05:00
ammarahm-ed
51bef01609 mobile: fix logout loading ui 2023-09-04 13:16:22 +05:00
ammarahm-ed
6a49244614 core: fix item not loaded on sync 2023-09-04 13:16:22 +05:00
ammarahm-ed
dad2b61a74 mobile: fix crash when logging out user 2023-09-04 13:16:22 +05:00
ammarahm-ed
fabc595f3d mobile: fix storage 2023-09-04 13:16:22 +05:00
Abdullah Atta
a700787cf3 core: make sure all tests are passing 2023-09-04 13:16:22 +05:00
ammarahm-ed
fb26229715 mobile: update libraries 2023-09-04 13:16:22 +05:00
ammarahm-ed
c4f894f8d0 mobile: add async storage & encryption 2023-09-04 13:16:22 +05:00
Abdullah Atta
ddd1c19c64 core: improve merging performance 2023-09-04 13:16:22 +05:00
Abdullah Atta
79cb3bdba4 core: merge vault key on sync 2023-09-04 13:16:22 +05:00
Abdullah Atta
8447c2150b core: improve sync fetch performance 2023-09-04 13:16:22 +05:00
Abdullah Atta
bc465971be web: add support for bulk writes 2023-09-04 13:16:22 +05:00
Abdullah Atta
f8ce23aa11 crypto: add support for bulk decryption 2023-09-04 13:16:22 +05:00
Abdullah Atta
84004c4d73 global: update lockfiles 2023-08-25 14:30:41 +05:00
Muhammad Ali
2b6aa9b89b ui: allow changing menu button icon color (#3170) 2023-08-21 16:38:21 +05:00
ammarahm-ed
54b8a3e789 mobile: refactor to typescript 2023-08-16 10:14:39 +05:00
Abdullah Atta
7ff5f0001c core: tagging an empty note should not create a content item 2023-08-14 13:41:19 +05:00
Abdullah Atta
d384aa9dcf core: use isolated storage for each test for more reliability 2023-08-14 09:54:57 +05:00
Abdullah Atta
1190da7c91 crypto: use buffer from node:buffer 2023-08-14 09:54:57 +05:00
Abdullah Atta
6561791530 setup: remove dist, build & out dirs during cleanup 2023-08-14 09:54:57 +05:00
Abdullah Atta
26e233d3eb global: update lockfiles 2023-08-14 09:54:57 +05:00
Abdullah Atta
0417981538 global: remove maxNodeModuleJsDepth from tsconfig 2023-08-14 09:54:57 +05:00
Abdullah Atta
81fc56937e web: fix syntax errors 2023-08-14 09:54:57 +05:00
Abdullah Atta
cb778d7e35 core: make dateFormat optional 2023-08-14 09:54:57 +05:00
Abdullah Atta
8442b43715 core: don't include tests & unnecessary files during build 2023-08-14 09:54:57 +05:00
Abdullah Atta
28b3306506 core: import isomorphic-fetch 2023-08-14 09:54:57 +05:00
Abdullah Atta
f51f45aeb2 editor: move isomorphic-fetch import 2023-08-14 09:54:57 +05:00
Abdullah Atta
7f1184736c core: use isomorphic-fetch 2023-08-14 09:54:57 +05:00
Abdullah Atta
e4c8e7a0c5 core: download prismjs languages before tests 2023-08-14 09:54:57 +05:00
Abdullah Atta
44e4722de2 global: fix @notesnook/core direct paths 2023-08-14 09:54:57 +05:00
Abdullah Atta
7c2b0c5947 core: start migrating core to typescript & vitest 2023-08-14 09:54:57 +05:00
Abdullah Atta
6ea912ad0e themebuilder: bump version to 1.1.1 2023-08-11 09:54:09 +05:00
Abdullah Atta
124bbb6ac1 web: do not show website link if there's no homepage 2023-08-11 09:53:01 +05:00
Abdullah Atta
30d6345152 theme: make homepage property in themes optional 2023-08-11 09:53:01 +05:00
Abdullah Atta
60ff7b2f97 themebuilder: update themes manually in themebuilder 2023-08-11 09:51:43 +05:00
Abdullah Atta
c6e90142bb themebuilder: bump version to 1.1.0 2023-08-10 07:20:07 +05:00
Abdullah Atta
1289a025a5 web: skip initiation for theme builder 2023-08-10 07:18:49 +05:00
Abdullah Atta
18d0b72785 themebuilder: fix various bugs 2023-08-10 07:18:18 +05:00
Abdullah Atta
0157cf496f themebuilder: add support for loading from pr, url & base64 2023-08-10 07:17:37 +05:00
Abdullah Atta
3450f2d19d setup: support generating flatpak sources from windows 2023-08-09 16:56:29 +05:00
Abdullah Atta
e509c82807 web: bump version to 2.6.1 2023-08-09 16:31:52 +05:00
Abdullah Atta
d5afd6f32e editor: fix recursive loop on loading a code lang that never registered 2023-08-09 16:26:31 +05:00
Abdullah Atta
fb34dd2864 core: do not throw if language grammar is not found on export 2023-08-09 16:26:31 +05:00
Abdullah Atta
0cd1ce3431 core: don't use require in desktop app 2023-08-09 16:26:31 +05:00
Abdullah Atta
a24447d569 web: fix unstyled "0" in theme details dialog 2023-08-09 16:25:43 +05:00
Abdullah Atta
0bf26afa33 web: fix error on installing theme from file 2023-08-09 16:25:43 +05:00
Abdullah Atta
49455e8054 docs: add documentation for custom themes (#3118)
* themebuilder: add docs

* themebuilder: update theme docs

* docs: finalize docs for custom themes

---------

Co-authored-by: ammarahm-ed <ammarahmed6506@gmail.com>
2023-08-09 15:49:33 +05:00
Abdullah Atta
1136e43115 themebuilder: fix layout 2023-08-08 13:54:56 +05:00
Abdullah Atta
4b74cba4e4 themebuilder: fix builder layout with app on the side 2023-08-08 13:42:28 +05:00
Abdullah Atta
c8a77934f2 ci: use themebuilder scope during bootstrap 2023-08-08 13:26:34 +05:00
Abdullah Atta
e1739e04d1 themebuilder: adjust app branding 2023-08-08 13:19:29 +05:00
Abdullah Atta
a5d39a18a7 web: allow custom app title 2023-08-08 13:19:29 +05:00
Abdullah Atta
77eb661b0e themebuilder: update theme builder on theme switch 2023-08-08 13:19:29 +05:00
Abdullah Atta
667d0d16ea themebuilder: finalize 2023-08-08 13:19:29 +05:00
Abdullah Atta
445ea660c3 web: make web app embeddable 2023-08-08 13:19:29 +05:00
ammarahm-ed
7a35640739 themebuilder: add basic search/replace 2023-08-08 13:19:29 +05:00
ammarahm-ed
f1650fd383 themebuilder: fix accordion 2023-08-08 13:19:29 +05:00
ammarahm-ed
5d67a554d6 themebuilder: fix screenshot 2023-08-08 13:19:29 +05:00
ammarahm-ed
380bfba776 theme: add theme builder app 2023-08-08 13:19:29 +05:00
Abdullah Atta
ed6d125391 clipper: publish v0.3.0 2023-08-08 11:07:22 +05:00
Abdullah Atta
adaa5fd56d clipper: bump version to 0.3.0 2023-08-08 10:29:13 +05:00
Abdullah Atta
0a8db237eb clipper: finalize integration with new theming system 2023-08-08 10:29:13 +05:00
ammarahm-ed
6d723e022b mobile: release v2.6.1 2023-08-08 00:49:29 +05:00
ammarahm-ed
dc3b739719 mobile: fix theme reset on app restart 2023-08-08 00:48:28 +05:00
Abdullah Atta
8d67599278 ci: deploy directly using wrangler 2023-08-07 20:11:11 +05:00
Abdullah Atta
c8da5770c8 web: add list of new features 2023-08-07 14:55:00 +05:00
ammarahm-ed
51c11d9d1a mobile: update release notes 2023-08-07 14:52:28 +05:00
ammarahm-ed
414c164100 mobile: enable remove console.log in release 2023-08-07 14:45:10 +05:00
ammarahm-ed
aa5fd6d946 mobile: release v2.6.0 2023-08-07 14:42:12 +05:00
ammarahm-ed
c89f74d35b mobile: fix ui and cleanup 2023-08-07 14:42:12 +05:00
ammarahm-ed
8c2fdf8554 mobile: fix share extension on ios 2023-08-07 14:42:12 +05:00
ammarahm-ed
f2438d9524 mobile: fix loading local theme 2023-08-07 14:42:12 +05:00
ammarahm-ed
54e7b29716 mobile: update fonts 2023-08-07 14:42:12 +05:00
Abdullah Atta
1d7f4036ec theme: do not send scopes when getting all themes 2023-08-07 12:39:36 +05:00
Abdullah Atta
a2d5eda538 web: fix applied theme status not showing on themes 2023-08-07 12:32:52 +05:00
Abdullah Atta
1b6a27376c web: fix editor & toolbar alignment 2023-08-07 12:00:15 +05:00
Abdullah Atta
8431150f0a web: always show currently applied themes in list 2023-08-07 12:00:02 +05:00
ammarahm-ed
ed5107afaa misc: remove notesnook-themes pulled repo 2023-08-07 09:51:10 +05:00
Abdullah Atta
e52bdd7ca5 web: disable sourcemaps even in testing 2023-08-07 09:18:13 +05:00
Abdullah Atta
26e50848da web: set root to src in vitejs for more focused builds 2023-08-07 09:17:04 +05:00
Abdullah Atta
41fa52c9d5 web: adapt dialog announcements to the new theme 2023-08-07 09:02:26 +05:00
Abdullah Atta
885aa3035e editor: show keyboard shortcuts for tools where possible 2023-08-07 08:47:11 +05:00
Abdullah Atta
b20c20983a ui: improve ui for modifiers in menu items 2023-08-07 08:46:45 +05:00
Abdullah Atta
42994847e9 editor: counter in toolbar should have 100% height 2023-08-07 08:46:13 +05:00
Abdullah Atta
b59a12e743 ui: simplify sub-menus markup 2023-08-07 08:45:18 +05:00
Abdullah Atta
f67792cd30 editor: use error color for errors in math blocks 2023-08-07 08:44:45 +05:00
Abdullah Atta
60ba345e6c editor: add font-display: swap to hack fontface 2023-08-07 08:44:27 +05:00
Abdullah Atta
0074548b84 web: fix broken colors in some places 2023-08-07 06:54:33 +05:00
Abdullah Atta
5af5549173 web: introduce "dangerous" variant for menu items 2023-08-07 06:54:11 +05:00
Abdullah Atta
f9f0235d7b editor: replace all old css colors with new ones 2023-08-07 06:03:25 +05:00
Abdullah Atta
cd51420931 web: replace all old css colors with new ones 2023-08-07 06:03:11 +05:00
Abdullah Atta
000d11976b web: update playwright to 1.36.2 2023-08-07 05:49:02 +05:00
Abdullah Atta
392261c208 web: add helper to imperitively match a media query 2023-08-07 05:49:02 +05:00
Abdullah Atta
71aee40f8d web: improve backups test reliability 2023-08-07 05:49:02 +05:00
Abdullah Atta
565ef2c321 web: don't check for notification permission in tests 2023-08-07 05:49:02 +05:00
Abdullah Atta
2d5c8c9e6d web: only allow changing title via event 2023-08-07 05:49:02 +05:00
Abdullah Atta
800f983688 web: show progress when restoring encrypted backups 2023-08-07 05:49:02 +05:00
ammarahm-ed
7291e54db7 mobile: update detox to latest 2023-08-05 16:46:26 +05:00
ammarahm-ed
794b1c70eb mobile: fix editor stuck in loading state 2023-08-05 16:46:26 +05:00
Abdullah Atta
330b227027 web: improve real time sync test reliability 2023-08-05 16:27:42 +05:00
Abdullah Atta
59a66a63c5 web: update all checkout snapshots 2023-08-05 13:52:19 +05:00
Abdullah Atta
ceb28f08c5 web: load paddle checkout in test mode during testing 2023-08-05 12:27:10 +05:00
Abdullah Atta
7287754218 web: bump version to 2.6.0 2023-08-05 12:19:43 +05:00
Abdullah Atta
80d2f64f10 desktop: bring app to front on start of 2nd instance 2023-08-05 12:10:47 +05:00
Abdullah Atta
9951b83539 web: fix navigation menu resizing on tablet mode 2023-08-05 12:01:06 +05:00
Abdullah Atta
66d50be35a theme: improve check for inheriting emotion theme 2023-08-05 11:27:56 +05:00
Abdullah Atta
9eb5a4cee4 web: update all test screenshot snapshots for linux 2023-08-05 11:20:08 +05:00
Abdullah Atta
3c575c01ad web: fix storage for Firefox & Tor private mode 2023-08-05 11:16:18 +05:00
ammarahm-ed
643028f5d8 mobile: update deps 2023-08-05 11:15:06 +05:00
ammarahm-ed
3831b9409e editor: load theme from local storage on init 2023-08-05 11:15:06 +05:00
ammarahm-ed
985ae848d3 mobile: fix tags wrapping in share extension 2023-08-05 11:15:06 +05:00
Abdullah Atta
0c8c8b6040 editor: fix sub toolbar not getting aligned correctly 2023-08-05 11:15:06 +05:00
ammarahm-ed
a01c084045 mobile: fix react-native-html-to-pdf-lite 2023-08-05 11:15:06 +05:00
ammarahm-ed
7577adf09d mobile: ensure that font size is always number 2023-08-05 11:15:06 +05:00
Abdullah Atta
394002eb4c editor(mobile): add theme to global styles 2023-08-05 11:15:06 +05:00
Abdullah Atta
5c386148a4 editor: fix action sheets not opening 2023-08-05 11:15:06 +05:00
Abdullah Atta
3558d3db93 editor: do not try to download image if src is invalid 2023-08-05 11:15:06 +05:00
ammarahm-ed
2bed812df1 mobile: fix editor 2023-08-05 11:15:06 +05:00
ammarahm-ed
c5db2e0ea9 mobile: fix content in share ext editor takes too long to load 2023-08-05 11:15:06 +05:00
ammarahm-ed
6cd1d7c41b mobile: fix webpack build 2023-08-05 11:15:06 +05:00
ammarahm-ed
36662d58da mobile: fix editor when app enter foreground from share ext 2023-08-05 11:15:06 +05:00
ammarahm-ed
e85cc6ac56 mobile: fix ext height behind keyboard on mobile 2023-08-05 11:15:06 +05:00
ammarahm-ed
a17d2d69ef mobile: fix opening search causes crash in share ext 2023-08-05 11:15:06 +05:00
Abdullah Atta
3ec615a6ec web: update export html snapshot for linux 2023-08-05 10:19:48 +05:00
Abdullah Atta
8eadc6aea1 web: do not redirect automatically on login session expire 2023-08-05 09:50:47 +05:00
Abdullah Atta
506678e72c web: format reminder time correctly (fixes #3085) 2023-08-04 20:05:53 +05:00
Abdullah Atta
aa3561555e desktop: fix desktop toggle settings 2023-08-04 19:34:46 +05:00
Abdullah Atta
405a8aaad0 editor: fix embeds in readonly mode are not visible 2023-08-04 19:33:57 +05:00
Abdullah Atta
7edd45419e editor: align outline bullet in the center of item 2023-08-04 19:00:54 +05:00
Abdullah Atta
5af028698c editor: only put bullet before 1st p tag in outline list 2023-08-04 18:27:04 +05:00
Abdullah Atta
ce822e7538 web: fix toggle colors 2023-08-04 16:09:29 +05:00
Abdullah Atta
9936bee8e0 editor: copying 1 nested list item shouldn't copy list meta 2023-08-04 16:07:31 +05:00
Abdullah Atta
b903e8461d web: make monograph password field hidden 2023-08-04 12:58:05 +05:00
ammarahm-ed
4d2c42330e mobile: fix crash on opening sheet with icon 2023-08-04 12:10:58 +05:00
Abdullah Atta
0ea37fdb31 web: improve checkout responsiveness 2023-08-04 10:23:36 +05:00
Abdullah Atta
22bf738d21 web: make sure all tests are passing 2023-08-03 18:48:51 +05:00
Abdullah Atta
922ba7d192 web: fix errored attachment icon color 2023-08-03 15:55:54 +05:00
Abdullah Atta
c38a98c239 web: upload files < 25mb in a single request 2023-08-03 15:55:54 +05:00
Abdullah Atta
0f9452f6ca web: improve handling of errors during upload 2023-08-03 15:55:54 +05:00
Abdullah Atta
5cc9c6e3e4 web: change themes api url to themes-api.notesnook.com 2023-08-03 15:48:42 +05:00
Abdullah Atta
5da30faf71 web: use settings scroller for themes 2023-08-03 15:46:15 +05:00
ammarahm-ed
99d984f516 core: flush once every 10 sec 2023-08-03 15:02:37 +05:00
ammarahm-ed
20f0760f13 core: fix logger performance 2023-08-03 15:02:37 +05:00
ammarahm-ed
20ffa9bee5 mobile: use themes-api server 2023-08-03 13:58:40 +05:00
Abdullah Atta
bdd003f177 web: fix colors in various places 2023-08-03 13:21:59 +05:00
Abdullah Atta
a45a960bfd editor(mobile): do not override background color 2023-08-03 13:21:59 +05:00
ammarahm-ed
fbf56f2663 mobile: fix incorrect colors uage 2023-08-03 12:01:11 +05:00
ammarahm-ed
0e7ac37b9d mobile: remove prism.css 2023-08-03 11:18:22 +05:00
Abdullah Atta
bcf0d86605 web: use new error icon color 2023-08-03 04:12:08 +05:00
Abdullah Atta
954f894738 web: fix crash when opening attachment menu 2023-08-03 01:44:21 +05:00
Abdullah Atta
908def1b69 editor: update lockfile 2023-08-02 19:50:41 +05:00
Abdullah Atta
f26f638ad4 editor: fix action sheet not closing via drag 2023-08-02 19:50:41 +05:00
Abdullah Atta
700f47fd49 web: disable overscroll behavior 2023-08-02 19:50:41 +05:00
Abdullah Atta
3d0eaacaac theme: allow passing ref to emotion theme provider 2023-08-02 19:50:40 +05:00
Abdullah Atta
c76118d9d6 web: load full framer-motion 2023-08-02 19:50:40 +05:00
Abdullah Atta
148c39158b editor: fix crash on action sheet opening 2023-08-02 19:50:40 +05:00
Ammar Ahmed
89c2d45a4b mobile: reduce app size (#3068)
* mobile: reduce app size

* editor: substitute all @mdi/js icons at build time

* mobile: add script to tree shake icon font file

* mobile: fix icon loading

* mobile: remove html-entities dep

* mobile: add missing icon fonts

* mobile: include plain editor

* mobile: add missing fonts

* mobile: use webpack-bundle

* mobile: keep generated fonts in repo

* mobile: update fonts

* mobile: fix duplicate key warning

* mobile: update fonts

* mobile: disable gesure on reminder sheet

* mobile: update fonts

* mobile: reset session correctly on logout

* mobile: update icon fonts

* mobile: set button action on reminder sheet

* mobile: add missing icons

* mobile: fix crash

* mobile: fix right menus

* mobile: remove console.log

* mobile: disable bounce effect

* mobile: update deps

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-08-02 15:35:15 +05:00
Muhammad Ali
c30c54ab97 web: fix cursor jumps on edit in sticky title (#3028)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-08-02 15:18:52 +05:00
Abdullah Atta
734cfba45d ci: publish preview on PR open 2023-08-02 15:04:27 +05:00
Abdullah Atta
3b363a1b20 web: prevent scroll jump when toggling focus mode 2023-08-02 15:04:27 +05:00
Abdullah Atta
a747bafa69 web: use new editorSidebar 2023-08-02 13:10:23 +05:00
Abdullah Atta
9d0c11b051 web: unlock view should use base theme scope 2023-08-02 13:09:56 +05:00
Abdullah Atta
bd9e997ef1 theme: add new editorSidebar scope 2023-08-02 13:09:30 +05:00
Abdullah Atta
f222327a89 theme: fix menu buttons have no hover 2023-08-02 13:09:09 +05:00
Abdullah Atta
4e5351134f global: update lockfiles 2023-08-02 12:26:35 +05:00
Abdullah Atta
ec1d5cc211 setup: only grab local deps during bootstrap 2023-08-02 12:26:22 +05:00
Abdullah Atta
8f41e25ac1 ci: ignore paths unrelated to web app 2023-08-02 12:12:32 +05:00
Abdullah Atta
2d90caafc6 ci: use unlike-ltd/github-actions-cloudflare-pages for deployment 2023-08-02 12:12:32 +05:00
Abdullah Atta
a9f36076b3 ci: deploy master branch to cloudflare as beta 2023-08-02 11:38:35 +05:00
Abdullah Atta
8365e557d5 editor: do not copy prism-theme during build 2023-08-02 11:37:15 +05:00
Abdullah Atta
080160ca70 vericrypt: use old @notesnook/theme version 2023-08-02 11:28:54 +05:00
Abdullah Atta
e6164b0b3e setup: use 4 threads at the minimum when bootstrapping 2023-08-01 20:45:08 +05:00
Abdullah Atta
26d786a368 editor: fix codeblock tests 2023-08-01 20:45:08 +05:00
Abdullah Atta
c6172644f0 editor: DOMSerializer2 -> ClipboardDOMSerializer 2023-08-01 20:45:08 +05:00
Abdullah Atta
5810947a5d editor: improve copy pasting 2023-08-01 20:45:08 +05:00
Abdullah Atta
708c2d373d editor: remove unnecessary console.logs 2023-08-01 20:45:08 +05:00
Abdullah Atta
d11a9b2219 editor: fix tests 2023-08-01 20:39:16 +05:00
Abdullah Atta
32b8b008f2 web: make export tests pass 2023-08-01 20:39:16 +05:00
Abdullah Atta
e066d1ce8d global: update lockfiles 2023-08-01 20:39:16 +05:00
Abdullah Atta
4f3f19a785 web: extract editor styles into a fixed css file during build 2023-08-01 20:39:16 +05:00
Abdullah Atta
6c3ea4517d core: inline codeblock styles into html template 2023-08-01 20:39:16 +05:00
Abdullah Atta
1e7e3b8c42 core: use explicit import/require for dynamic imports 2023-08-01 20:39:16 +05:00
Abdullah Atta
a54c18e89b web: remove require transform plugin 2023-08-01 20:39:16 +05:00
Abdullah Atta
ed4d5efea6 editor: generate code languages index during build 2023-08-01 20:39:16 +05:00
Abdullah Atta
4bab279345 global: fix conflicting package versions across subprojects 2023-08-01 20:39:16 +05:00
ammarahm-ed
ec32eeba0b mobile: fix pdf exports with codeblock & katex 2023-08-01 20:39:16 +05:00
Abdullah Atta
2b74e2afb2 web: fix Dynamic module import is disabled error 2023-08-01 20:33:37 +05:00
Abdullah Atta
c4a9d244a9 editor: bump katex version to 0.16.4 2023-08-01 18:35:31 +05:00
Abdullah Atta
6643fb0d63 web: fix old usage of hooks/useTheme 2023-08-01 18:32:58 +05:00
Abdullah Atta
b2a3949ad0 web: auto detect text direction where possible 2023-08-01 15:48:52 +05:00
Abdullah Atta
93c1a44285 editor: infer text direction from parent before insertion 2023-08-01 15:48:52 +05:00
Abdullah Atta
62c4fb328c editor: use single input rule for heading 2023-08-01 15:48:52 +05:00
Muhammad Ali
578fb72ddc editor: infer dir from parent when adding heading 2023-08-01 15:48:52 +05:00
Abdullah Atta
19faaea10e editor: do not save note with codeblock on open 2023-08-01 12:36:41 +05:00
Muhammad Ali
9951aae398 web: use current color scheme in all fields (#3039)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-08-01 12:32:36 +05:00
Abdullah Atta
0963559a5f global: update lockfiles 2023-08-01 12:09:10 +05:00
Ammar Ahmed
622294b807 global: implement the new theme engine (#2196)
* mobile: theme

* theme: add theme engine

* mobile: migrate app colors to new theme engine

* mobile: fixed some colors

* mobile: fix colors

* mobile: store theme info in store

* theme: `ColorsType` -> `Variants`

* theme: use explicit return type for `useThemeColors`

* theme: add `backdrop` color

* mobile: `const colors` -> `const {colors}

* theme: add default pitch-black theme

* mobile: manage theme state via theme-engine

* mobile: add theme scopes

* mobile: commit

* mobile: fix button width on applock screen

* mobile: fix typings

* mobile: fix theme definition

* web: add partial support for custom themes

only context menus & popups are left.

* theme: add dialog & sheet scopes

* global: sync with master branch and make everything work again

* mobile: fix theme-engine usage in editor & app

* mobile: fix colors

* mobile: fix colors

* mobile: cleanup

* mobile: fix status bar color incorrect on entering foreground

* mobile: fix dark color scheme

* web: move emotion theme provider to @notesnook/theme

* editor: add support for theme enging

* web: adjust hover & focus colors on list item

* mobile: migrate share ext to theme engine

* mobile: fix editor theme provider

* clipper: add support for the new theme engine

* mobile: fix statusbar color on switch from bg

* misc: fix build

* mobile: fix build

* misc: fix colors

* mobile: fix theme colors

* mobile: fix bottom padding

* server: add theme server

* theme: add previewColors

* server: support themes query pagination

* mobile: add client from theme server

* server: reset cache on sync repo

* server: fix types

* server: show ip & port on start server

* server: theme updates

* web: finalize new theme engine on web

* editor: fix build

* global: fix @emotion/react version to 11.11.1

* editor: update katex patch

* web: fix imports

* global: fix @trpc/* versions

* global: a huge set of changes

1. get rid of ThemeVariant. All variants can now be accessed anywhere.
2. remove unnecessary button variants
3. make buttons more responsive
4. implement themes server

* web: add support for theme search and theme switching

* global: update lockfiles

* mobile: fix error

* theme: use vite-plugin-react to start theme server

* web: add support for auto updating themes

* mobile: update theme selector

* mobile: update theme if new verison available

* theme: add `isomorphic-fetch` package

* global: update lockfiles

* web: add theme details dialog

* setup: add scope for themes server in bootstrap script

* web: add production server url

* web: update lockfile

* web: update lockfile

* mobile: remove `react-native-blob-util`

* web: add support for endless scrolling in themes

* web: bring back dark/light mode option in settings

* web: fix colors in places

* theme: add selected variant

* global: use single typescript version across the projects

* web: fix sort & group options not having submenus

* web: apply selected variant where appropriate

* ui: use unique id for all menu items

* config: add ui scope for commits

* theme: export button variant creation fn

* web: fix only 1 theme showing in theme selector

* web: fix navigation item hover & other colors

* mobile: update theme

* editor: fix toolbar group alignments

* editor: set theme provider at app level

* theme: use scope name to get current scope

* mobile: fix color usage in message card

* theme: remove caching

* editor: bring back icons in table menus

* theme: use zustand to manage theme engine state

* web: fix login/signup theming

* mobile: fix webpack build

* misc: remove ThemeProvider usage

* editor: adjust theming and styling of editor toolbar

* mobile: refactor

* editor: fix toolbar group padding everywhere

* web: fix settings sidebar is not scrollable

* web: add loading indicator for themes loading

* mobile: fix warning

* mobile: fix ui issues

* web: fix Loader errors on build

* theme: add getPreviewColors & validateTheme

* theme: fix theme validation

* mobile: load theme from file

* mobile: fix share extension crash

* mobile: rename state

* theme: add sourceURL property

* theme: refactor theme-engine

* web: add support for loading theme from file

* web: improve button hover interaction

* mobile: fix floating button color

* mobile: update theme

* mobile: fix border radius of context menu

* mobile: set sheet overlay color to theme backdrop

* mobile: set sidemenu backdrop to theme backdrop

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-08-01 12:07:21 +05:00
Abdullah Atta
ba72a92a8a setup: switch to fdir from fast-glob 2023-08-01 10:42:21 +05:00
Abdullah Atta
5a5e072fb4 global: update all lockfiles 2023-08-01 10:42:07 +05:00
Abdullah Atta
91cb2935eb logger: publish to npm 2023-08-01 09:33:45 +05:00
Abdullah Atta
387aeab319 core: bump version to 7.4.1 2023-08-01 09:33:28 +05:00
Abdullah Atta
4db7b54a5f theme: bump version to 1.2.0 2023-08-01 09:32:23 +05:00
Abdullah Atta
ddfd7254f1 crypto: publish v1 of @notesnook/sodium 2023-08-01 09:32:09 +05:00
Abdullah Atta
2e410c521a crypto: bump version to 1.1.1 2023-08-01 09:31:45 +05:00
Abdullah Atta
5dd22e85fa editor: bump version to 1.6.1 2023-08-01 09:31:06 +05:00
Abdullah Atta
022dd78eda ci: add workflow for vericrypt publishing 2023-07-31 11:40:09 +05:00
Abdullah Atta
2b1812b5de vericrypt: initial commit 2023-07-31 11:40:09 +05:00
Abdullah Atta
3c9678c6d5 core: reduce sync logger verbosity 2023-07-27 17:12:58 +05:00
Abdullah Atta
4f1f9ecb6b docs: make first step clear as; go to importer.notesnook.com 2023-07-26 13:34:20 +05:00
Abdullah Atta
07fb572a67 core: fix html export empty p tag regex 2023-07-26 12:08:51 +05:00
Abdullah Atta
7d7f4acc8c clipper: remove unnecessary packages 2023-07-25 12:35:31 +05:00
Abdullah Atta
efba05291d global: update lockfiles 2023-07-25 12:31:41 +05:00
Abdullah Atta
8b0d7a5cdb web: include __tests__ directory in tsconfig 2023-07-25 12:28:54 +05:00
Abdullah Atta
162deccf04 web: remove unused renderMath function 2023-07-25 12:28:54 +05:00
alihamuh
083f14bf50 editor: use dom parser to convert br to p tags 2023-07-25 12:28:54 +05:00
Abdullah Atta
cae3f7354e web: convert require to await import 2023-07-25 08:09:27 +05:00
Muhammad Ali
75e62a3fac core: pre-render math & code blocks before HTML export 2023-07-25 08:09:27 +05:00
Abdullah Atta
69dee3be78 web: get rid of print-js lib for printing 2023-07-24 15:50:36 +05:00
Abdullah Atta
36bf7c5cc6 web: don't show "Failed to unlock vault" error when exporting 1 note 2023-07-24 15:50:36 +05:00
Muhammad Ali
c041819930 web: add &nbsp; in empty p tags for printing 2023-07-24 15:50:36 +05:00
Muhammad Ali
dd4d00eae6 web: move focus to editor on Tab press in note title (#2983)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-07-24 14:33:00 +05:00
Abdullah Atta
d12e14ab34 ci: add workflow for publishing help 2023-07-22 06:05:17 +05:00
ammarahm-ed
c0a444d0c6 editor: use contentCopy icon for copy tool 2023-07-21 17:00:12 +05:00
ammarahm-ed
e16a5524b8 editor: use accent color for link 2023-07-21 17:00:12 +05:00
ammarahm-ed
c386e92831 desktop: add buttons in context menu for copy link
& copy link text
2023-07-21 17:00:12 +05:00
ammarahm-ed
ed277a95fb editor: add copy link tool 2023-07-21 17:00:12 +05:00
Abdullah Atta
c14b09ee1d docs: improve importing documentation 2023-07-21 15:58:19 +05:00
Ammar Ahmed
52fecc27ce editor: fix color picker height with bottom toolbar on desktop (#2976) 2023-07-19 13:10:20 +05:00
ammarahm-ed
056b24e936 mobile: fix landscape tablet mode 2023-07-19 07:45:02 +05:00
ammarahm-ed
e34607f244 mobile: fix sorting favorites 2023-07-19 07:37:26 +05:00
ammarahm-ed
7ba7bf64f0 editor: fix copy button is disabled in readonly mode 2023-07-19 06:12:31 +05:00
ammarahm-ed
6f51a98477 web: fix entering password closes publish dialog 2023-07-19 06:12:11 +05:00
Abdullah Atta
cd7e0f5380 setup: parallelize bootstrap depending on device cpu cores 2023-07-18 15:14:40 +05:00
Abdullah Atta
d95aba8cdd setup: add support for offline bootstrapping 2023-07-18 00:09:28 +05:00
Abdullah Atta
922fce7bcc ci: download build to apps/web 2023-07-17 23:34:07 +05:00
Abdullah Atta
9e3646ebc5 web: bump version to 2.5.8 2023-07-17 23:18:37 +05:00
Abdullah Atta
cdf3ea9dab web: disable native crypto due to stream encryption issues 2023-07-17 23:17:19 +05:00
Abdullah Atta
e38ac19a58 setup: fix bootstrap script for non-existent packages 2023-07-17 09:40:47 +05:00
absolutez3
9d3f309fc3 web: fix mastodon link in Settings (#2943)
Fix desktop Mastodon link

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

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

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

* mobile: update to react-native 0.72.0

* mobile: fix release build on android

* mobile: fix editor stuck in loading state

* mobile: fix bootsplash logo in dark mode

* mobile: update patch files

* mobile: cleanup

* mobile: increase delay

* mobile: add logs on upload

* mobile: ensure editor is ready before note loading

* mobile: fix ui

* mobile: fix

* ci: update workflow

* ci: undo workflow changes

---------

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

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

---------

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

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

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

* mobile: ensure full db init when sync is required

---------

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

* mobile: fix db init in background

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

* mobile: improve db init in app/share extension

* mobile: cleanup

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

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

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

* mobile: disable buttons in loading state
2023-02-23 16:15:09 +05:00
ammarahm-ed
fe8ba8ca90 mobile: show error if mfa info not recieved 2023-02-23 15:49:53 +05:00
ammarahm-ed
8fa4b5017c mobile: hide keyboard on ios on app lock screen 2023-02-23 15:49:53 +05:00
Abdullah Atta
d2f39df3bf web: make tests more reliable 2023-02-23 15:14:49 +05:00
Abdullah Atta
2ada289e74 editor: update patch for @tiptap/extension-link 2023-02-23 13:13:27 +05:00
Abdullah Atta
1edf416461 editor: update patch for @tiptap/core 2023-02-23 13:13:27 +05:00
Abdullah Atta
6fae73b612 editor: increase force update debounce timeout to 200ms 2023-02-23 13:13:27 +05:00
Abdullah Atta
ec898748b1 editor: preserve font family in persisted selection 2023-02-23 13:13:27 +05:00
Abdullah Atta
5be67823ce editor: optimize selection updates in codeblock 2023-02-23 13:13:27 +05:00
Abdullah Atta
fd868aec95 web: debounce selection updates in editor 2023-02-23 13:13:27 +05:00
Abdullah Atta
33bf5e26ff editor: only show table toolbars when table is selected 2023-02-23 13:13:27 +05:00
Abdullah Atta
08363f95e0 editor: update tiptap packages 2023-02-23 13:13:27 +05:00
Abdullah Atta
dc62291fba editor: only update node views if attributes change 2023-02-23 13:13:27 +05:00
Abdullah Atta
43034cf3a3 editor: show gradient overlay on image for better contrast 2023-02-23 13:13:27 +05:00
Abdullah Atta
88f047c312 editor: reduce no. of nested nodes in task list for perf 2023-02-23 13:13:27 +05:00
Abdullah Atta
46a635d4f4 editor: migrate to vanilla js outline list 2023-02-23 13:13:27 +05:00
Ammar Ahmed
882217be63 web: Fix sync settings toggles on/off text (#1995)
* web: fix sync toggles text
2023-02-23 13:11:19 +05:00
Ammar Ahmed
87a2650480 mobile: fix background events (#1994) 2023-02-23 13:05:15 +05:00
ammarahm-ed
c41806bd70 editor: fix build errors 2023-02-23 11:02:10 +05:00
ammarahm-ed
ae7a6ba88c mobile: fix fdroid app version code 2023-02-23 09:50:11 +05:00
Abdullah Atta
df78b31527 web: fix invalid submenu position due to element id conflict (#1977) 2023-02-21 09:41:21 +05:00
Abdullah Atta
4040c62dda editor: focus search input on pressing ctrl+f 2023-02-20 17:37:25 +05:00
Abdullah Atta
34bf9d5b45 web: close publish popup on focus lost 2023-02-20 17:26:09 +05:00
Abdullah Atta
80cd37fe4f web: fix sub menus position 2023-02-20 16:48:08 +05:00
Abdullah Atta
21a7dbad53 web: show no menu title when menu opened on 1 item 2023-02-20 16:45:03 +05:00
Abdullah Atta
c2b010d057 web: fix spacing around input in search view
Closes #1961
2023-02-20 16:38:15 +05:00
Abdullah Atta
82b01851c7 web: fix blank email input on session expiry screen 2023-02-20 16:29:06 +05:00
Muhammad Ali
0a81f0a09a editor: fix vertical spacing between nested lists (#1928)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-02-20 16:03:00 +05:00
Muhammad Ali
e06cbb39b0 editor: make link uneditable in readonly mode (#1968) 2023-02-20 15:25:01 +05:00
Abdullah Atta
b52cc0c590 web: do not allow non-string ETag header in attachments upload 2023-02-20 15:23:53 +05:00
Abdullah Atta
82376c8c47 web: make app loading animation smoother 2023-02-20 15:23:53 +05:00
Abdullah Atta
e0b191b9a0 web: get rid of editor-placeholder (always show editor by default) 2023-02-20 15:23:53 +05:00
Abdullah Atta
6ef6259629 web: improve ui of note unlock screen 2023-02-20 15:23:53 +05:00
Abdullah Atta
52d08f9392 web: fix multi-selection in manage attachments dialog 2023-02-20 15:23:53 +05:00
Abdullah Atta
6812d3552a web: fix svg logo in splashscreen 2023-02-20 15:23:52 +05:00
Abdullah Atta
68ebb132cd global: update packages to ensure we bundle only 1 version of @mdi/js 2023-02-20 15:23:52 +05:00
ammarahm-ed
203aa4824d mobile: do not use process.env 2023-02-20 14:54:44 +05:00
ammarahm-ed
047707dd35 mobile: build notifee from source 2023-02-20 12:35:03 +05:00
ammarahm-ed
7c7645c0c6 ci: fix release workflow 2023-02-15 14:02:14 +05:00
ammarahm-ed
2d4ca15e10 mobile: release v2.4.4 2023-02-15 13:57:07 +05:00
Abdullah Atta
9ca831713c docs: update contributing guidelines 2023-02-15 10:18:35 +05:00
Ammar Ahmed
56008c15c5 mobile: remove recovery code input maxLength (#1922) 2023-02-15 10:18:30 +05:00
Ammar Ahmed
2a2811ec54 mobile: fix cannot read property of title (#1921) 2023-02-15 10:17:55 +05:00
alihamuh
aec1d601a3 web: added change default fontstyle feature in the settings 2023-01-18 13:23:39 +05:00
1693 changed files with 178905 additions and 263791 deletions

View File

@@ -14,12 +14,16 @@ const SCOPES = [
"mobile",
"web",
"vericrypt",
"desktop",
"crypto",
"editor",
"logger",
"theme",
"server",
"core",
"fs",
"ui",
"clipper",
"config",
"ci",
@@ -27,7 +31,10 @@ const SCOPES = [
"docs",
"refactor",
"misc",
"global"
"common",
"global",
"docs",
"themebuilder"
];
module.exports = {

View File

@@ -21,4 +21,7 @@ packages/editor/styles/
packages/editor/languages/
# editor mobile
packages/editor-mobile/build.bundle
packages/editor-mobile/build.bundle
# snapshots
tap-snapshots

1
.gitattributes vendored Normal file
View File

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

View File

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

View File

@@ -11,31 +11,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@master
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Use specific Java version for the builds
uses: joschi/setup-jdk@v2
with:
java-version: '11'
architecture: 'x64'
java-version: "11"
architecture: "x64"
- name: Install node modules
run: |
npm ci
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=mobile
- name: Make Gradlew Executable
run: cd apps/mobile/native/android && chmod +x ./gradlew
@@ -50,7 +39,7 @@ 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
@@ -61,4 +50,4 @@ jobs:
releaseFile: ${{steps.sign_app.outputs.signedReleaseFile}}
track: internal
status: completed
whatsNewDirectory: apps/mobile/native/android/releasenotes/
whatsNewDirectory: apps/mobile/native/android/releasenotes/

View File

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

View File

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

View File

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

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

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

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

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

View File

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

View File

@@ -0,0 +1,31 @@
name: Publish @notesnook/theme-builder
on: workflow_dispatch
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=themebuilder
- name: Setup environment
run: |
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
- name: Generate build
run: npm run build:theme-builder
- name: Publish to Cloudflare Pages
run: npx --yes wrangler pages deploy --project-name=notesnook-theme-builder ./apps/theme-builder/build/

31
.github/workflows/vericrypt.publish.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Publish @notesnook/vericrypt
on: workflow_dispatch
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=vericrypt
- name: Setup environment
run: |
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
- name: Generate build
run: npm run build:vericrypt
- name: Publish on Cloudflare Pages
run: npx --yes wrangler pages deploy --project-name=vericrypt ./apps/vericrypt/build/

67
.github/workflows/web.beta.publish.yml vendored Normal file
View File

@@ -0,0 +1,67 @@
name: Publish @notesnook/web Beta
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- "apps/mobile/**"
- "packages/editor-mobile/**"
- "apps/desktop/**"
- "apps/vericrypt/**"
- "servers/**"
- "packages/clipper/**"
- "extensions/web-clipper/**"
pull_request:
types:
- closed
- ready_for_review
- reopened
- opened
- synchronize
branches:
- master
paths-ignore:
- "apps/mobile/**"
- "packages/editor-mobile/**"
- "apps/desktop/**"
- "apps/vericrypt/**"
- "servers/**"
- "packages/clipper/**"
- "extensions/web-clipper/**"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=web
- name: Setup environment
run: |
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
- name: Generate beta build
run: npm run build:beta:web
- name: Publish to Cloudflare Pages
uses: unlike-ltd/github-actions-cloudflare-pages@v0.1.1
id: pages
with:
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
cloudflare-project-name: notesnook-beta-app
directory: ./apps/web/build
github-token: ${{ secrets.GITHUB_TOKEN }}
github-environment: ${{ (github.ref == 'refs/heads/master' && 'beta') || 'preview' }}

View File

@@ -11,26 +11,12 @@ jobs:
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: |
apps/mobile/package-lock.json
apps/web/package-lock.json
packages/core/package-lock.json
packages/crypto/package-lock.json
packages/crypto-worker/package-lock.json
packages/editor-mobile/package-lock.json
packages/editor/package-lock.json
packages/logger/package-lock.json
packages/streamable-fs/package-lock.json
packages/theme/package-lock.json
uses: ./.github/actions/setup-node-with-cache
- name: Install packages
run: |
npm i --ignore-scripts --prefer-offline --no-audit
npx lerna bootstrap --ignore=@notesnook/mobile -- --prefer-offline --no-audit
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=web
- name: Setup environment
run: |
@@ -38,8 +24,8 @@ jobs:
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
- name: Generate desktop build
- name: Generate build
run: npm run build:web
- name: Publish on Cloudflare Pages
run: npx --yes wrangler pages publish --project-name=notesnook-app ./apps/web/build/
- name: Publish to Cloudflare Pages
run: npx --yes wrangler pages deploy --project-name=notesnook-app ./apps/web/build/

View File

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

5
.gitignore vendored
View File

@@ -6,4 +6,7 @@ dist
nx-cloud.env
.idea
.eslintcache
.env.local
.env.local
.nyc_output
site
node_modules.backup

View File

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

View File

@@ -1,72 +0,0 @@
{
"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"]
}
}

15
.vscode/settings.json vendored Normal file
View File

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

View File

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

View File

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

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

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

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

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

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 520 B

View File

Before

Width:  |  Height:  |  Size: 917 B

After

Width:  |  Height:  |  Size: 917 B

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 353 KiB

After

Width:  |  Height:  |  Size: 353 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

58
apps/desktop/global.d.ts vendored Normal file
View File

@@ -0,0 +1,58 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* eslint-disable no-var */
import { BrowserWindow } from "electron";
import {
type FormData as FormDataType,
type Headers as HeadersType,
type Request as RequestType,
type Response as ResponseType
} from "undici";
declare global {
var window: BrowserWindow | null;
var RELEASE: boolean;
var MAC_APP_STORE: boolean;
// Re-export undici fetch function and various classes to global scope.
// These are classes and functions expected to be at global scope according to Node.js v18 API
// documentation.
// See: https://nodejs.org/dist/latest-v18.x/docs/api/globals.html
// eslint-disable-next-line no-var
export var {
FormData,
Headers,
Request,
Response,
fetch
}: typeof import("undici");
type FormData = FormDataType;
type Headers = HeadersType;
type Request = RequestType;
type Response = ResponseType;
}
// NOTE: the import in the global block above needs to be a var for this to work properly.
globalThis.fetch = fetch;
globalThis.FormData = FormData;
globalThis.Headers = Headers;
globalThis.Request = Request;
globalThis.Response = Response;

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

File diff suppressed because it is too large Load Diff

View File

@@ -2,32 +2,46 @@
"name": "@notesnook/desktop",
"productName": "Notesnook",
"description": "Your private note taking space",
"version": "2.4.3",
"version": "2.6.3",
"appAppleId": "1544027013",
"private": true,
"main": "./build/electron.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"homepage": "https://notesnook.com/",
"repository": "https://github.com/streetwriters/notesnook",
"license": "GPL-3.0-or-later",
"dependencies": {
"diary": "^0.3.1",
"electron-updater": "^5.3.0",
"@notesnook/crypto": "file:../../packages/crypto",
"@trpc/client": "10.31.0",
"@trpc/server": "10.31.0",
"electron-trpc": "0.5.2",
"electron-updater": "6.1.4",
"icojs": "^0.17.1",
"isomorphic-fetch": "^3.0.0",
"yargs": "^17.6.2"
"typed-emitter": "^2.1.0",
"yargs": "^17.6.2",
"zod": "^3.21.4"
},
"devDependencies": {
"@types/node-fetch": "^2.6.2",
"electron": "^21.1.1",
"electron-builder": "^23.6.0",
"electron-builder-notarize": "^1.5.0",
"electron-reloader": "^1.2.3",
"esbuild": "^0.15.11",
"patch-package": "^6.5.1"
"@types/node": "18.16.1",
"@types/yargs": "^17.0.24",
"chokidar": "^3.5.3",
"electron": "25.8.0",
"electron-builder": "^24.6.4",
"electron-builder-notarize": "^1.5.1",
"esbuild": "^0.17.19",
"tree-kill": "^1.2.2",
"undici": "^5.23.0"
},
"optionalDependencies": {
"dmg-license": "^1.0.11"
},
"scripts": {
"build": "esbuild ./electron.js ./preload.js --external:electron --external:fsevents --minify --bundle --outdir=./build --platform=node --tsconfig=tsconfig.json --define:MAC_APP_STORE=false --define:RELEASE=true",
"build:mas": "esbuild ./electron.js ./preload.js --minify --external:electron --external:fsevents --bundle --outdir=./build --platform=node --tsconfig=tsconfig.json --define:MAC_APP_STORE=true --define:RELEASE=true",
"pack": "rm -rf ./build && cp -r ../build ./ && npm run build && yarn electron-builder --linux deb",
"start": "node scripts/dev.mjs",
"staging": "node scripts/build.mjs --run",
"release": "node scripts/build.mjs",
"build": "tsc",
"bundle": "esbuild electron=./src/main.ts ./src/preload.ts --external:electron --external:fsevents --minify --bundle --outdir=./build --platform=node --tsconfig=tsconfig.json --define:MAC_APP_STORE=false --define:RELEASE=true",
"bundle:mas": "esbuild electron=./src/main.ts ./src/preload.ts --minify --external:electron --external:fsevents --bundle --outdir=./build --platform=node --tsconfig=tsconfig.json --define:MAC_APP_STORE=true --define:RELEASE=true",
"postinstall": "patch-package"
},
"author": {
@@ -40,12 +54,17 @@
"productName": "Notesnook",
"copyright": "Copyright © 2023 Streetwriters (Private) Limited",
"artifactName": "notesnook_${os}_${arch}.${ext}",
"npmRebuild": false,
"asar": false,
"files": [
"!*.chunk.js.map",
"!*.chunk.js.LICENSE.txt",
"build/",
"!build/screenshots",
"!node_modules"
"!build/screenshots${/*}",
"!build/banner.jpg",
"!build/*.ico",
"!build/*.png",
"!node_modules${/*}"
],
"afterSign": "electron-builder-notarize",
"afterPack": "./scripts/removeLocales.js",
@@ -101,8 +120,20 @@
},
"win": {
"target": [
"nsis",
"portable"
{
"target": "nsis",
"arch": [
"x64",
"arm64"
]
},
{
"target": "portable",
"arch": [
"x64",
"arm64"
]
}
],
"icon": "assets/icons/app.ico"
},
@@ -115,10 +146,20 @@
},
"linux": {
"target": [
"AppImage",
"deb",
"rpm",
"snap"
{
"target": "AppImage",
"arch": [
"x64",
"arm64"
]
},
{
"target": "snap",
"arch": [
"x64",
"arm64"
]
}
],
"category": "Office",
"icon": "assets/icons/app.icns",
@@ -152,9 +193,12 @@
"extraResources": [
"./assets/**"
],
"extraMetadata": {
"main": "./build/electron.js"
},
"directories": {
"buildResources": "assets",
"output": "./dist/"
"output": "./output/"
},
"publish": [
{

View File

@@ -1,20 +1,20 @@
diff --git a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
index ffcc8bd..7e57c9e 100644
index fcb7f54..cb1c7f7 100644
--- a/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
+++ b/node_modules/app-builder-lib/out/targets/LinuxTargetHelper.js
@@ -105,6 +105,7 @@ class LinuxTargetHelper {
@@ -116,6 +116,7 @@ class LinuxTargetHelper {
StartupWMClass: appInfo.productName,
...extra,
...targetSpecificOptions.desktop,
+ actions: undefined
};
const description = this.getDescription(targetSpecificOptions);
if (!builder_util_1.isEmptyOrSpaces(description)) {
@@ -148,6 +149,23 @@ class LinuxTargetHelper {
if (!(0, builder_util_1.isEmptyOrSpaces)(description)) {
@@ -159,6 +160,23 @@ class LinuxTargetHelper {
data += `\n${name}=${desktopMeta[name]}`;
}
data += "\n";
+
+
+ if (targetSpecificOptions.desktop.actions) {
+ let actionsData = "";
+ const validActions = [];

View File

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

View File

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

View File

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

View File

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

View File

@@ -18,16 +18,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import zlib from "node:zlib";
import utils from "node:util";
import { initTRPC } from "@trpc/server";
import { z } from "zod";
const t = initTRPC.create();
const gzipAsync = utils.promisify(zlib.gzip);
const gunzipAsync = utils.promisify(zlib.gunzip);
export async function gzip(args) {
const { data, level } = args;
return (await gzipAsync(data, { level })).toString("base64");
}
export async function gunzip(args) {
const { data } = args;
return (await gunzipAsync(Buffer.from(data, "base64"))).toString("utf-8");
}
export const compressionRouter = t.router({
gzip: t.procedure
.input(z.object({ data: z.string(), level: z.number() }))
.query(async ({ input }) => {
const { data, level } = input;
return (await gzipAsync(data, { level })).toString("base64");
}),
gunzip: t.procedure.input(z.string()).query(async ({ input }) => {
return (await gunzipAsync(Buffer.from(input, "base64"))).toString("utf-8");
})
});

View File

@@ -17,25 +17,25 @@ 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 { ipcMain } from "electron";
import { logger } from "../logger";
import { getAction } from "./actions";
import { getCall } from "./calls";
import { initTRPC } from "@trpc/server";
import { compressionRouter } from "./compression";
import { osIntegrationRouter } from "./os-integration";
import { spellCheckerRouter } from "./spell-checker";
import { updaterRouter } from "./updater";
import { bridgeRouter } from "./bridge";
ipcMain.on("fromRenderer", async (event, args) => {
logger.info("Action requested by renderer", args);
const t = initTRPC.create();
const { type } = args;
const action = getAction(type);
if (!action) return;
await action(args);
export const router = t.router({
compress: compressionRouter,
integration: osIntegrationRouter,
spellChecker: spellCheckerRouter,
updater: updaterRouter,
bridge: bridgeRouter
});
ipcMain.handle("fromRenderer", async (event, args) => {
const { type } = args;
logger.info("Call requested by renderer", type);
const call = getCall(type);
if (!call) return;
export const api = router.createCaller({});
return await call(args, globalThis.window);
});
// Export type router type signature,
// NOT the router itself.
export type AppRouter = typeof router;

View File

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

View File

@@ -17,9 +17,13 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { getIsSpellCheckerEnabled } from "../../config/spellChecker";
import { initTRPC } from "@trpc/server";
import { z } from "zod";
import { config } from "../utils/config";
const LANGUAGES = {
const t = initTRPC.create();
const LANGUAGES: Record<string, string> = {
af: "Afrikaans",
bg: "Bulgarian",
ca: "Catalan",
@@ -78,28 +82,41 @@ const LANGUAGES = {
vi: "Vietnamese"
};
/**
*
* @param {*} args
* @param {import("electron").BrowserWindow} win
* @returns
*/
export default function (_args, win) {
if (!win) return;
type Language = { code: string; name: string };
return {
enabled: getIsSpellCheckerEnabled(),
languages: win.webContents.session.availableSpellCheckerLanguages.map(
(code) => ({
code,
name: LANGUAGES[code]
})
export const spellCheckerRouter = t.router({
isEnabled: t.procedure.query(() => config.isSpellCheckerEnabled),
languages: t.procedure.query(
() =>
<Language[]>(
globalThis.window?.webContents.session.availableSpellCheckerLanguages.map(
(code) => ({
code,
name: LANGUAGES[code]
})
)
)
),
enabledLanguages: t.procedure.query(
() =>
<Language[]>(
globalThis.window?.webContents.session
.getSpellCheckerLanguages()
.map((code) => ({
code,
name: LANGUAGES[code]
}))
)
),
setLanguages: t.procedure
.input(z.array(z.string()))
.mutation(({ input: languages }) =>
globalThis.window?.webContents.session.setSpellCheckerLanguages(languages)
),
enabledLanguages: win.webContents.session
.getSpellCheckerLanguages()
.map((code) => ({
code,
name: LANGUAGES[code]
}))
};
}
toggle: t.procedure
.input(z.object({ enabled: z.boolean() }))
.mutation(({ input: { enabled } }) => {
globalThis.window?.webContents.session.setSpellCheckerEnabled(enabled);
config.isSpellCheckerEnabled = enabled;
})
});

View File

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

View File

@@ -21,18 +21,21 @@ import yargs from "yargs";
import { hideBin } from "yargs/helpers";
export type CLIOptions = {
note?: boolean | string;
notebook?: boolean | string;
reminder?: boolean | string;
note: boolean | string;
notebook: boolean | string;
reminder: boolean | string;
hidden: boolean;
};
export async function parseArguments(): Promise<CLIOptions> {
const result: CLIOptions = {
note: false,
notebook: false,
reminder: false
reminder: false,
hidden: false
};
await yargs(hideBin(process.argv))
const { hidden } = await yargs(hideBin(process.argv))
.boolean("hidden")
.command("new", "Create a new item", (yargs) => {
return yargs
.command("note", "Create a new note", {}, () => {
@@ -52,7 +55,7 @@ export async function parseArguments(): Promise<CLIOptions> {
"Open a note",
{ id: { string: true, description: "Id of the note" } },
(args) => {
result.note = args.id;
result.note = args.id || false;
}
)
.command(
@@ -60,7 +63,7 @@ export async function parseArguments(): Promise<CLIOptions> {
"Open a notebook",
{ id: { string: true, description: "Id of the notebook" } },
(args) => {
result.notebook = args.id;
result.notebook = args.id || false;
}
)
.command(
@@ -76,5 +79,6 @@ export async function parseArguments(): Promise<CLIOptions> {
);
})
.parse();
result.hidden = hidden || false;
return result;
}

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

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

View File

@@ -16,104 +16,111 @@ 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/>.
*/
/* global MAC_APP_STORE, RELEASE */
import "isomorphic-fetch";
import { app, BrowserWindow, nativeTheme, shell } from "electron";
import { isDevelopment } from "./utils";
import { registerProtocol, PROTOCOL_URL } from "./protocol";
import { configureAutoUpdater } from "./autoupdate";
import { getBackgroundColor, getTheme, setTheme } from "./config/theme";
import getZoomFactor from "./ipc/calls/getZoomFactor";
import { logger } from "./logger";
import { setupMenu } from "./menu";
import { WindowState } from "./config/window-state";
import { sendMessageToRenderer } from "./ipc/utils";
import { EVENTS } from "./events";
import "./ipc/index.js";
import getPrivacyMode from "./ipc/calls/getPrivacyMode";
import setPrivacyMode from "./ipc/actions/setPrivacyMode";
import { getIsSpellCheckerEnabled } from "./config/spellChecker";
import { getDesktopIntegration } from "./config/desktopIntegration";
import { AutoLaunch } from "./autolaunch";
import { setupJumplist } from "./jumplist";
import { setupTray } from "./tray";
import { parseArguments } from "./cli";
import { AssetManager } from "./asset-manager";
if (!RELEASE) {
require("electron-reloader")(module);
}
import { registerProtocol, PROTOCOL_URL } from "./utils/protocol";
import { configureAutoUpdater } from "./utils/autoupdater";
import { getBackgroundColor, getTheme, setTheme } from "./utils/theme";
import { setupMenu } from "./utils/menu";
import { WindowState } from "./utils/window-state";
import { AutoLaunch } from "./utils/autolaunch";
import { setupJumplist } from "./utils/jumplist";
import { setupTray } from "./utils/tray";
import { CLIOptions, parseArguments } from "./cli";
import { AssetManager } from "./utils/asset-manager";
import { createIPCHandler } from "electron-trpc/main";
import { router, api } from "./api";
import { config } from "./utils/config";
import path from "path";
import { bringToFront } from "./utils/bring-to-front";
// only run a single instance
if (!MAC_APP_STORE && !app.requestSingleInstanceLock()) {
console.log("Another instance is already running!");
app.exit();
}
if (process.platform == "win32" && process.env.PORTABLE_EXECUTABLE_DIR) {
console.log("Portable app: true");
const root = path.join(process.env.PORTABLE_EXECUTABLE_DIR, "Notesnook");
app.setPath("appData", path.join(root, "AppData"));
app.setPath("documents", path.join(root, "Documents"));
app.setPath("userData", path.join(root, "UserData"));
}
if (process.platform === "win32") {
app.setAppUserModelId(app.name);
}
var mainWindowState;
async function createWindow() {
await AssetManager.loadIcons();
const cliOptions = await parseArguments();
process.on("uncaughtException", (error) => {
console.error("uncaughtException:", error);
});
process.on("unhandledRejection", (reason) => {
console.error("unhandledRejection:", reason);
});
mainWindowState = new WindowState({});
app.commandLine.appendSwitch("lang", "en-US");
async function createWindow() {
const cliOptions = await parseArguments();
setTheme(getTheme());
const mainWindowState = new WindowState({});
const mainWindow = new BrowserWindow({
show: !cliOptions.hidden,
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
darkTheme: getTheme() === "dark",
backgroundColor: getBackgroundColor(),
opacity: 0,
autoHideMenuBar: true,
icon: AssetManager.appIcon({
size: 512,
format: process.platform === "win32" ? "ico" : "png"
}),
webPreferences: {
zoomFactor: getZoomFactor(),
devTools: true, // isDev,
nodeIntegration: false, //true,
contextIsolation: true,
nativeWindowOpen: true,
spellcheck: getIsSpellCheckerEnabled(),
zoomFactor: config.zoomFactor,
nodeIntegration: true,
contextIsolation: false,
spellcheck: config.isSpellCheckerEnabled,
preload: __dirname + "/preload.js"
}
});
mainWindowState.manage(mainWindow);
globalThis.window = mainWindow;
setupMenu();
setupJumplist();
mainWindowState.manage(mainWindow);
if (cliOptions.hidden && !config.desktopSettings.minimizeToSystemTray)
mainWindow.minimize();
await mainWindow.webContents.loadURL(`${createURL(cliOptions, "/")}`);
mainWindow.setOpacity(1);
if (config.privacyMode) {
await api.integration.setPrivacyMode({ enabled: config.privacyMode });
}
await AssetManager.loadIcons();
setupDesktopIntegration();
createIPCHandler({ router, windows: [mainWindow] });
mainWindow.webContents.session.setSpellCheckerDictionaryDownloadURL(
"http://dictionaries.notesnook.com/"
);
if (isDevelopment())
mainWindow.webContents.openDevTools({ mode: "right", activate: true });
if (getPrivacyMode()) {
setPrivacyMode({ privacyMode: getPrivacyMode() });
}
try {
await mainWindow.loadURL(`${createURL(cliOptions)}`);
} catch (e) {
logger.error(e);
}
mainWindow.on("closed", () => {
mainWindow.once("closed", () => {
globalThis.window = null;
});
setupMenu();
setupJumplist();
if (isDevelopment())
mainWindow.webContents.openDevTools({ mode: "right", activate: true });
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url);
return { action: "deny" };
@@ -122,42 +129,38 @@ async function createWindow() {
nativeTheme.on("updated", () => {
setupTray();
setupJumplist();
if (getTheme() === "system") {
sendMessageToRenderer(EVENTS.themeChanged, {
theme: nativeTheme.shouldUseDarkColors ? "dark" : "light"
});
}
});
}
app.commandLine.appendSwitch("lang", "en-US");
app.on("ready", async () => {
logger.info("App ready. Opening window.");
app.once("ready", async () => {
console.info("App ready. Opening window.");
registerProtocol();
if (!isDevelopment()) registerProtocol();
await createWindow();
configureAutoUpdater();
});
app.on("window-all-closed", () => {
app.once("window-all-closed", () => {
if (process.platform !== "darwin" || MAC_APP_STORE) {
app.quit();
}
});
app.on("second-instance", () => {
if (!globalThis.window) return;
bringToFront();
});
app.on("activate", () => {
if (globalThis.window === null) {
createWindow();
}
});
/**
* @param {import("./cli").CLIOptions} options
*/
function createURL(options) {
function createURL(options: CLIOptions, path = "/") {
const url = new URL(isDevelopment() ? "http://localhost:3000" : PROTOCOL_URL);
url.pathname = path;
if (options.note === true) url.hash = "/notes/create/1";
else if (options.notebook === true) url.hash = "/notebooks/create";
else if (options.reminder === true) url.hash = "/reminders/create";
@@ -170,7 +173,7 @@ function createURL(options) {
}
function setupDesktopIntegration() {
const desktopIntegration = getDesktopIntegration();
const desktopIntegration = config.desktopSettings;
if (
desktopIntegration.closeToSystemTray ||
@@ -185,36 +188,32 @@ function setupDesktopIntegration() {
app.on("before-quit", () => app.exit(0));
}
globalThis.window.on("close", (e) => {
if (getDesktopIntegration().closeToSystemTray) {
globalThis.window?.once("close", (e) => {
if (config.desktopSettings.closeToSystemTray) {
e.preventDefault();
if (process.platform == "darwin") {
// on macOS window cannot be minimized/hidden if it is already fullscreen
// so we just close it.
if (globalThis.window.isFullScreen()) app.exit(0);
if (globalThis.window?.isFullScreen()) app.exit(0);
else app.hide();
} else {
globalThis.window.minimize();
globalThis.window.hide();
globalThis.window?.minimize();
globalThis.window?.hide();
}
}
});
globalThis.window.on("minimize", () => {
if (getDesktopIntegration().minimizeToSystemTray) {
globalThis.window?.on("minimize", () => {
if (config.desktopSettings.minimizeToSystemTray) {
if (process.platform == "darwin") {
app.hide();
} else {
globalThis.window.hide();
globalThis.window?.hide();
}
}
});
if (desktopIntegration.autoStart) {
AutoLaunch.enable(desktopIntegration.startMinimized);
if (process.platform === "win32" && desktopIntegration.startMinimized) {
globalThis.window.minimize();
}
AutoLaunch.enable(!!desktopIntegration.startMinimized);
}
}

View File

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

View File

@@ -19,10 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { NativeImage, nativeImage } from "electron";
import path from "path";
import { isDevelopment } from "./utils";
import { isDevelopment } from "./index";
import { parse, ParsedImage } from "icojs";
import { readFileSync } from "fs";
import { getSystemTheme } from "./config/theme";
import { getSystemTheme } from "./theme";
import { readFile } from "fs/promises";
type Formats = "ico" | "png" | "icns";
type IconOptions<TFormat extends Formats> = {
@@ -30,8 +30,8 @@ type IconOptions<TFormat extends Formats> = {
format?: TFormat;
};
type IconNames = typeof icons[number];
type Prefixes = typeof prefixes[number];
type IconNames = (typeof icons)[number];
type Prefixes = (typeof prefixes)[number];
type FlexibleIcon<TFormat extends Formats> = TFormat extends "ico"
? string
@@ -70,7 +70,7 @@ export class AssetManager {
"icons",
`${icon}${prefix}.ico`
);
const icoBuffer = readFileSync(icoPath);
const icoBuffer = await readFile(icoPath);
const images = await parse(icoBuffer, "image/png");
ALL_ICONS.push({ id: icon, images, prefix });
}
@@ -80,10 +80,10 @@ export class AssetManager {
static appIcon(options: IconOptions<Formats>) {
const { size = 32, format = "png" } = options;
if (format === "ico") return path.join("assets", "icons", "app.ico");
if (format === "icns") return path.join("assets", "icons", "app.icns");
if (format === "ico") return "assets\\icons\\app.ico";
if (format === "icns") return "assets/icons/app.icns";
return path.join("assets", "icons", `${size}x${size}.png`);
return `assets/icons/${size}x${size}.png`;
}
static icon<TFormat extends Formats>(

View File

@@ -47,7 +47,11 @@ export class AutoLaunch {
LINUX_DESKTOP_ENTRY(hidden)
);
} else {
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: hidden });
app.setLoginItemSettings({
openAtLogin: true,
openAsHidden: hidden,
args: ["--hidden"]
});
}
}

View File

@@ -17,13 +17,20 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { CancellationToken } from "builder-util-runtime";
import { autoUpdater } from "electron-updater";
import { EVENTS } from "../../events";
import { sendMessageToRenderer } from "../utils";
import { config } from "./config";
export default () => {
sendMessageToRenderer(EVENTS.updateDownloadProgress, { progress: 0 });
autoUpdater.cancellationToken = new CancellationToken();
autoUpdater.downloadUpdate(autoUpdater.cancellationToken);
};
async function configureAutoUpdater() {
autoUpdater.setFeedURL({
provider: "generic",
url: `https://notesnook.com/releases/${process.platform}/`,
useMultipleRangeRequest: false
});
autoUpdater.autoDownload = config.automaticUpdates;
autoUpdater.allowDowngrade = false;
autoUpdater.allowPrerelease = false;
autoUpdater.autoInstallOnAppQuit = true;
}
export { configureAutoUpdater };

View File

@@ -17,9 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { WindowState } from "../../config/window-state";
import { WindowState } from "./window-state";
export default () => {
export function bringToFront() {
if (!globalThis.window) return;
if (globalThis.window.isMinimized()) {
@@ -31,4 +31,4 @@ export default () => {
globalThis.window.focus();
globalThis.window.moveTop();
globalThis.window.webContents.focus();
};
}

View File

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

View File

@@ -17,15 +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 { JSONStorage } from "../jsonstorage";
import { app } from "electron";
import { existsSync } from "fs";
function getPrivacyMode() {
let mode = JSONStorage.get("privacyMode");
return mode === undefined ? false : mode;
export function isDevelopment() {
return process.env.ELECTRON_IS_DEV
? Number.parseInt(process.env.ELECTRON_IS_DEV, 10) === 1
: !app.isPackaged;
}
function setPrivacyMode(mode) {
return JSONStorage.set("privacyMode", mode);
export function isFlatpak() {
return existsSync("/.flatpak-info");
}
export { setPrivacyMode, getPrivacyMode };

View File

@@ -19,9 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { app, Menu } from "electron";
import { AssetManager } from "./asset-manager";
import { EVENTS } from "./events";
import bringToFront from "./ipc/actions/bringToFront";
import { sendMessageToRenderer } from "./ipc/utils";
import { bringToFront } from "./bring-to-front";
import { bridge } from "../api/bridge";
export function setupJumplist() {
if (process.platform === "win32") {
@@ -76,7 +75,7 @@ function setDockMenuOnMacOs() {
type: "normal",
click: () => {
bringToFront();
sendMessageToRenderer(EVENTS.createItem, { itemType: "note" });
bridge.onCreateItem("note");
}
},
{
@@ -84,7 +83,7 @@ function setDockMenuOnMacOs() {
type: "normal",
click: () => {
bringToFront();
sendMessageToRenderer(EVENTS.createItem, { itemType: "notebook" });
bridge.onCreateItem("notebook");
}
},
{
@@ -92,7 +91,7 @@ function setDockMenuOnMacOs() {
type: "normal",
click: () => {
bringToFront();
sendMessageToRenderer(EVENTS.createItem, { itemType: "reminder" });
bridge.onCreateItem("reminder");
}
}
]);

View File

@@ -20,6 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { Menu, MenuItem, clipboard, shell } from "electron";
function setupMenu() {
if (!globalThis.window) return;
globalThis.window.webContents.on("context-menu", (_event, params) => {
const menu = new Menu();
@@ -29,7 +31,7 @@ function setupMenu() {
new MenuItem({
label: suggestion,
click: () =>
globalThis.window.webContents.replaceMisspelling(suggestion)
globalThis.window?.webContents.replaceMisspelling(suggestion)
})
);
}
@@ -40,7 +42,7 @@ function setupMenu() {
new MenuItem({
label: "Add to dictionary",
click: () =>
globalThis.window.webContents.session.addWordToSpellCheckerDictionary(
globalThis.window?.webContents.session.addWordToSpellCheckerDictionary(
params.misspelledWord
)
})
@@ -99,6 +101,26 @@ function setupMenu() {
})
);
if (params.linkURL?.length) {
menu.append(
new MenuItem({
label: "Copy link",
click() {
clipboard.writeText(params.linkURL);
}
})
);
menu.append(
new MenuItem({
label: "Copy link text",
click() {
clipboard.writeText(params.linkText);
}
})
);
}
if (params.selectionText.length) {
menu.append(
new MenuItem({

View File

@@ -0,0 +1,80 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { protocol, net } from "electron";
import { isDevelopment } from "./index";
import { createReadStream } from "fs";
import { extname, normalize } from "path";
import { URL } from "url";
const BASE_PATH = isDevelopment() ? "../public" : "";
const HOSTNAME = `app.notesnook.com`;
const SCHEME = "https";
const extensionToMimeType: Record<string, string> = {
html: "text/html",
json: "application/json",
js: "application/javascript",
css: "text/css",
svg: "image/svg+xml",
png: "image/png",
jpg: "image/jpg",
ttf: "font/ttf",
woff: "font/woff",
woff2: "font/woff2"
};
function registerProtocol() {
protocol.handle(SCHEME, async (request) => {
const url = new URL(request.url);
if (shouldInterceptRequest(url)) {
console.info("Intercepting request:", request.url);
const loadIndex = !extname(url.pathname);
const filePath = normalize(
`${__dirname}${
loadIndex ? `${BASE_PATH}/index.html` : `${BASE_PATH}/${url.pathname}`
}`
);
if (!filePath) {
console.error("Local asset file not found at", filePath);
return new Response(undefined, {
status: 404,
statusText: "FILE_NOT_FOUND"
});
}
const fileExtension = extname(filePath).replace(".", "");
return new Response(createReadStream(filePath), {
headers: { "Content-Type": extensionToMimeType[fileExtension] }
});
} else {
return net.fetch(request, {
bypassCustomProtocolHandlers: true
});
}
});
console.info(`${SCHEME} protocol inteception "successful"`);
}
const bypassedRoutes: string[] = [];
function shouldInterceptRequest(url: URL) {
const shouldIntercept = url.hostname === HOSTNAME;
return shouldIntercept && !bypassedRoutes.includes(url.pathname);
}
const PROTOCOL_URL = `${SCHEME}://${HOSTNAME}/`;
export { registerProtocol, PROTOCOL_URL };

View File

@@ -17,25 +17,17 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { logger } from "../logger";
import { app } from "electron";
import { isAbsolute, join } from "path";
function sendMessageToRenderer(type, payload = {}) {
const message = { type, ...payload };
logger.info("Sending message to renderer", message);
if (globalThis.window)
globalThis.window.webContents.send("fromMain", message);
}
function resolvePath(_path) {
export function resolvePath(_path: string) {
if (isAbsolute(_path)) return _path;
return join(
..._path.split("/").map((segment) => {
let resolved = segment;
try {
resolved = app.getPath(resolved);
resolved = app.getPath(resolved as any);
} catch (e) {
// ignore
}
@@ -43,5 +35,3 @@ function resolvePath(_path) {
})
);
}
export { resolvePath, sendMessageToRenderer };

View File

@@ -17,19 +17,27 @@ 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 { JSONStorage } from "../jsonstorage";
import { nativeTheme } from "electron";
import { config } from "./config";
import { z } from "zod";
type Theme = typeof nativeTheme.themeSource;
function getTheme(): Theme {
return JSONStorage.get("theme", nativeTheme.themeSource);
export const Theme = z.union([
z.literal("system"),
z.literal("light"),
z.literal("dark")
]);
export type Theme = z.infer<typeof Theme>;
function getTheme() {
return config.theme;
}
function setTheme(theme: Theme) {
changeTheme(theme);
if (globalThis.window)
globalThis.window.setBackgroundColor(getBackgroundColor());
return JSONStorage.set("theme", theme);
config.theme = theme;
}
function getBackgroundColor() {

View File

@@ -19,15 +19,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { app, Menu, Tray } from "electron";
import { AssetManager } from "./asset-manager";
import { EVENTS } from "./events";
import bringToFront from "./ipc/actions/bringToFront";
import { sendMessageToRenderer } from "./ipc/utils";
import { isFlatpak } from "./index";
import { bringToFront } from "./bring-to-front";
import { bridge } from "../api/bridge";
let tray: Tray | undefined = undefined;
export function destroyTray() {
if (tray) tray.destroy();
}
export function setupTray() {
if (tray) tray.destroy();
const trayIconSize = process.platform === "win32" || process.platform === "darwin" ? 16 : 32;
const trayIconSize =
process.platform === "win32" || process.platform === "darwin" ? 16 : 32;
tray = new Tray(
AssetManager.icon("tray-icon", {
@@ -39,32 +44,40 @@ export function setupTray() {
{
label: "Show app",
type: "normal",
icon: AssetManager.icon("tray-icon", { size: trayIconSize }),
icon: isFlatpak()
? undefined
: AssetManager.icon("tray-icon", { size: trayIconSize }),
click: bringToFront
},
{ type: "separator" },
{
label: "New note",
type: "normal",
icon: AssetManager.icon("note-add", { size: trayIconSize }),
icon: isFlatpak()
? undefined
: AssetManager.icon("note-add", { size: trayIconSize }),
click: () => {
bringToFront();
sendMessageToRenderer(EVENTS.createItem, { itemType: "note" });
bridge.onCreateItem("note");
}
},
{
label: "New notebook",
type: "normal",
icon: AssetManager.icon("notebook-add", { size: trayIconSize }),
icon: isFlatpak()
? undefined
: AssetManager.icon("notebook-add", { size: trayIconSize }),
click: () => {
bringToFront();
sendMessageToRenderer(EVENTS.createItem, { itemType: "notebook" });
bridge.onCreateItem("notebook");
}
},
{ type: "separator" },
{
label: "Quit",
icon: AssetManager.icon("quit", { size: trayIconSize }),
icon: isFlatpak()
? undefined
: AssetManager.icon("quit", { size: trayIconSize }),
type: "normal",
click: () => {
app.exit(0);

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { JSONStorage } from "../jsonstorage";
import { JSONStorage } from "./json-storage";
import { screen as _screen, BrowserWindow } from "electron";
const screen = _screen;

View File

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

View File

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

View File

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

View File

@@ -5,7 +5,6 @@ artifacts/
.DS_Store
native/android/app/src/main/assets/
*Issues.md
build_cache/
#
@@ -14,7 +13,9 @@ build_cache/
.yarnrc.yml
.yarn
*.log
.cxx/
*.keystore
!debug.keystore
# Xcode
#

View File

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

View File

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

View File

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

View File

@@ -16,44 +16,38 @@ 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 "@azure/core-asynciterator-polyfill";
import SettingsService from "./services/settings";
import {
THEME_COMPATIBILITY_VERSION,
useThemeEngineStore
} from "@notesnook/theme";
import React, { useEffect } from "react";
import { View } from "react-native";
import "react-native-gesture-handler";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { SafeAreaProvider } from "react-native-safe-area-context";
import AppLockedOverlay from "./components/app-lock-overlay";
import { withErrorBoundry } from "./components/exception-handler";
import GlobalSafeAreaProvider from "./components/globalsafearea";
import Launcher from "./components/launcher";
import { useAppEvents } from "./hooks/use-app-events";
import { ApplicationHolder } from "./navigation";
import Notifications from "./services/notifications";
import SettingsService from "./services/settings";
import { TipManager } from "./services/tip-manager";
import { useThemeStore } from "./stores/use-theme-store";
import { useUserStore } from "./stores/use-user-store";
import { View } from "react-native";
import { useState } from "react";
import NetInfo from "@react-native-community/netinfo";
//import { BackgroundSync } from "./services/background-sync";
Notifications.init();
NetInfo.configure({
reachabilityUrl: "https://notesnook.com",
reachabilityTest: (response) => {
if (!response) return false;
return response?.status >= 200 && response?.status < 300;
}
});
import { themeTrpcClient } from "./screens/settings/theme-selector";
SettingsService.init();
SettingsService.checkOrientation();
const App = () => {
useAppEvents();
const [init, setInit] = useState(false);
const init = useAppEvents();
useEffect(() => {
let { appLockMode } = SettingsService.get();
if (appLockMode && appLockMode !== "none") {
useUserStore.getState().setVerifyUser(true);
useUserStore.getState().lockApp(true);
}
//BackgroundSync.start();
setInit(true);
globalThis["IS_MAIN_APP_RUNNING"] = true;
init();
setTimeout(async () => {
SettingsService.onFirstLaunch();
await Notifications.get();
@@ -62,7 +56,10 @@ const App = () => {
}
TipManager.init();
}, 100);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
<View
style={{
@@ -91,10 +88,59 @@ const App = () => {
}}
>
<ApplicationHolder />
{init && <Launcher />}
</GestureHandlerRootView>
<AppLockedOverlay />
</View>
);
};
export default withErrorBoundry(App, "App");
let currTheme =
useThemeStore.getState().colorScheme === "dark"
? SettingsService.getProperty("darkTheme")
: SettingsService.getProperty("lightTheme");
useThemeEngineStore.getState().setTheme(currTheme);
export const withTheme = (Element) => {
return function AppWithThemeProvider() {
const [colorScheme, darkTheme, lightTheme] = useThemeStore((state) => [
state.colorScheme,
state.darkTheme,
state.lightTheme
]);
useEffect(() => {
setTimeout(() => {
const currentTheme = colorScheme === "dark" ? darkTheme : lightTheme;
if (!currentTheme) return;
themeTrpcClient.updateTheme
.query({
version: currentTheme.version,
compatibilityVersion: THEME_COMPATIBILITY_VERSION,
id: currentTheme.id
})
.then((theme) => {
if (theme) {
console.log(theme.version, "theme updated");
theme.colorScheme === "dark"
? useThemeStore.getState().setDarkTheme(theme)
: useThemeStore.getState().setLightTheme(theme);
}
})
.catch(console.log);
}, 1000);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const nextTheme = colorScheme === "dark" ? darkTheme : lightTheme;
if (JSON.stringify(nextTheme) !== JSON.stringify(currTheme)) {
useThemeEngineStore
.getState()
.setTheme(colorScheme === "dark" ? darkTheme : lightTheme);
currTheme = nextTheme;
}
return <Element />;
};
};
export default withTheme(withErrorBoundry(App, "App"));

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -22,10 +22,17 @@ import "react-native-get-random-values";
import * as Keychain from "react-native-keychain";
import { generateSecureRandom } from "react-native-securerandom";
import Sodium from "@ammarahmed/react-native-sodium";
import { MMKV } from "./mmkv";
const IOS_KEYCHAIN_ACCESS_GROUP = "group.org.streetwriters.notesnook";
const IOS_KEYCHAIN_SERVICE_NAME = "org.streetwriters.notesnook";
const IOS_KEYCHAIN_UPGRAGE_KEY = "keychain-ios:upgraded";
const KEYSTORE_CONFIG = Platform.select({
ios: {
accessible: Keychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY
accessible: Keychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
accessGroup: IOS_KEYCHAIN_ACCESS_GROUP,
service: IOS_KEYCHAIN_SERVICE_NAME
},
android: {}
});
@@ -39,12 +46,27 @@ export async function deriveCryptoKey(name, data) {
credentials.key,
KEYSTORE_CONFIG
);
MMKV.setBool(IOS_KEYCHAIN_UPGRAGE_KEY, true);
return credentials.key;
} catch (e) {
console.error(e);
}
}
async function upgradeIOSKeychain(username, password) {
if (Platform.OS !== "ios") return;
if (!MMKV.getBool(IOS_KEYCHAIN_UPGRAGE_KEY)) {
await Keychain.setInternetCredentials(
"notesnook",
username,
password,
KEYSTORE_CONFIG
);
console.log("IOS KEYCHAIN MIGRATION COMPLETED!");
MMKV.setBool(IOS_KEYCHAIN_UPGRAGE_KEY, true);
}
}
export async function getCryptoKey(_name) {
try {
if (await Keychain.hasInternetCredentials("notesnook")) {
@@ -52,6 +74,9 @@ export async function getCryptoKey(_name) {
"notesnook",
KEYSTORE_CONFIG
);
// upgrades ios keychain to use accessGroups
// so we have access to keychain in share extension.
await upgradeIOSKeychain(credentials.username, credentials.password);
return credentials.password;
} else {
return null;
@@ -101,6 +126,18 @@ export async function decrypt(password, data) {
return await Sodium.decrypt(password, _data);
}
export async function decryptMulti(password, data) {
if (!password.password && !password.key) return undefined;
if (password.password && password.password === "" && !password.key)
return undefined;
data = data.map((d) => {
d.output = "plain";
return d;
});
return await Sodium.decryptMulti(password, data);
}
export function parseAlgorithm(alg) {
if (!alg) return {};
const [enc, kdf, compressed, compressionAlg, base64variant] = alg.split("-");
@@ -129,3 +166,24 @@ export async function encrypt(password, data) {
alg: getAlgorithm(7)
};
}
export async function encryptMulti(password, data) {
if (!password.password && !password.key) return undefined;
if (password.password && password.password === "" && !password.key)
return undefined;
let results = await Sodium.encryptMulti(
password,
data.map((item) => ({
type: "plain",
data: item
}))
);
return !results
? []
: results.map((result) => ({
...result,
alg: getAlgorithm(7)
}));
}

View File

@@ -16,37 +16,17 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Database from "@notesnook/core/api/index";
import { initalize, logger as dbLogger } from "@notesnook/core/logger";
import { database } from "@notesnook/common";
import { logger as dbLogger } from "@notesnook/core/dist/logger";
import { Platform } from "react-native";
import { MMKVLoader } from "react-native-mmkv-storage";
import filesystem from "../filesystem";
import * as Gzip from "react-native-gzip";
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";
import filesystem from "../filesystem";
import "./logger";
import Storage from "./storage";
const LoggerStorage = new MMKVLoader()
.withInstanceID("notesnook_logs")
.initialize();
initalize(new KV(LoggerStorage), true);
export const DatabaseLogger = dbLogger;
/**
* @type {import("@notesnook/core/api/index").default}
*/
export var db = new Database(
Storage,
Platform.OS === "ios" ? EventSource : AndroidEventSource,
filesystem,
{
compress: Gzip.deflate,
decompress: Gzip.inflate
}
);
db.host(
database.host(
__DEV__
? {
API_HOST: "https://api.notesnook.com",
@@ -54,11 +34,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.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: "http://192.168.43.108:5264",
// AUTH_HOST: "http://192.168.43.108:8264",
// SSE_HOST: "http://192.168.43.108:7264",
// SUBSCRIPTIONS_HOST: "http://192.168.43.108:9264",
// ISSUES_HOST: "http://192.168.43.108:2624"
}
: {
API_HOST: "https://api.notesnook.com",
@@ -69,13 +49,15 @@ db.host(
}
);
export async function loadDatabase() {
// if (!DB) {
// let module = await import(/* webpackChunkName: "notes-core" */ 'notes-core/api/index');
// DB = module.default;
// }
// db = new DB(Storage, Platform.OS === 'ios' ? EventSource : AndroidEventSource, filesystem);
// if (DOMParser) {
// await DOMParser.prepare();
// }
}
database.setup(
Storage,
Platform.OS === "ios" ? EventSource : AndroidEventSource,
filesystem,
{
compress: Gzip.deflate,
decompress: Gzip.inflate
}
);
export const db = database;
export const DatabaseLogger = dbLogger;

View File

@@ -0,0 +1,29 @@
/*
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 { MMKVLoader } from "react-native-mmkv-storage";
import { initalize } from "@notesnook/core/dist/logger";
import { KV } from "./storage";
const LoggerStorage = new MMKVLoader()
.withInstanceID("notesnook_logs")
.initialize();
initalize(new KV(LoggerStorage));
export {};

View File

@@ -18,12 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Platform } from "react-native";
import MMKVStorage, { ProcessingModes } from "react-native-mmkv-storage";
import { ProcessingModes, MMKVLoader } from "react-native-mmkv-storage";
export const MMKV = new MMKVStorage.Loader()
export const MMKV = new MMKVLoader()
.setProcessingMode(
Platform.OS === "ios"
? ProcessingModes.MULTI_PROCESS
: ProcessingModes.SINGLE_PROCESS
)
.disableIndexing()
.initialize();

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Platform } from "react-native";
import RNFetchBlob from "rn-fetch-blob";
import RNFetchBlob from "react-native-blob-util";
import {
decrypt,
deriveCryptoKey,
@@ -27,11 +27,16 @@ import {
getCryptoKey,
getRandomBytes,
hash,
removeCryptoKey
removeCryptoKey,
decryptMulti,
encryptMulti
} from "./encryption";
import { MMKV } from "./mmkv";
export class KV {
/**
* @type {typeof MMKV}
*/
storage = null;
constructor(storage) {
this.storage = storage;
@@ -53,6 +58,7 @@ export class KV {
key,
typeof data === "string" ? data : JSON.stringify(data)
);
return true;
}
@@ -60,27 +66,32 @@ export class KV {
if (keys.length <= 0) {
return [];
} else {
let data = await this.storage.getMultipleItemsAsync(keys.slice());
return data.map(([key, value]) => {
let obj;
try {
obj = JSON.parse(value);
} catch (e) {
obj = value;
}
return [key, obj];
});
try {
let data = await this.storage.getMultipleItemsAsync(
keys.slice(),
"string"
);
return data.map(([key, value]) => {
let obj;
try {
obj = JSON.parse(value);
} catch (e) {
obj = value;
}
return [key, obj];
});
} catch (e) {
console.log(e);
}
}
}
async remove(key) {
return await this.storage.removeItem(key);
return this.storage.removeItem(key);
}
async clear() {
return await this.storage.clearStore();
return this.storage.clearStore();
}
async getAllKeys() {
@@ -96,6 +107,10 @@ export class KV {
);
return keys;
}
async writeMulti(items) {
return this.storage.setMultipleItemsAsync(items, "object");
}
}
const DefaultStorage = new KV(MMKV);
@@ -129,8 +144,10 @@ export default {
remove: (key) => DefaultStorage.remove(key),
clear: () => DefaultStorage.clear(),
getAllKeys: () => DefaultStorage.getAllKeys(),
writeMulti: (items) => DefaultStorage.writeMulti(items),
encrypt,
decrypt,
decryptMulti,
getRandomBytes,
checkAndCreateDir,
requestPermission,
@@ -138,5 +155,6 @@ export default {
getCryptoKey,
removeCryptoKey,
hash,
generateCryptoKey
generateCryptoKey,
encryptMulti
};

View File

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

View File

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

View File

@@ -17,9 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import hosts from "@notesnook/core/utils/constants";
import hosts from "@notesnook/core/dist/utils/constants";
import NetInfo from "@react-native-community/netinfo";
import RNFetchBlob from "rn-fetch-blob";
import RNFetchBlob from "react-native-blob-util";
import { ToastEvent } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { db } from "../database";
@@ -46,6 +46,7 @@ export async function downloadFile(filename, data, cancelToken) {
if (!downloadUrl) throw new Error("Unable to resolve download url");
let totalSize = 0;
console.log("Download starting");
let request = RNFetchBlob.config({
path: path,
IOSBackgroundTask: true

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