Compare commits

...

357 Commits

Author SHA1 Message Date
Ren Amamiya
2fdf437789 Merge pull request #120 from luminous-devs/fix/logout
Fix logout function and other issues
2023-11-23 08:54:24 +07:00
731c72535c bump version 2023-11-23 08:52:47 +07:00
628102087e fix total account count function 2023-11-23 08:52:04 +07:00
536ea30ed2 fix logout function 2023-11-23 08:49:05 +07:00
8ee38cdb42 temp disable single-instance plugin 2023-11-22 17:27:09 +07:00
Ren Amamiya
a896300f23 Merge pull request #118 from luminous-devs/v2.1.2
v2.1.2
2023-11-22 16:18:02 +07:00
d3cf1200ba bump version 2023-11-22 16:13:06 +07:00
b5ac3df090 fix package 2023-11-22 16:10:20 +07:00
3b40dd6903 update dependencies 2023-11-22 15:27:19 +07:00
Ren Amamiya
efba6b20ea Merge pull request #117 from luminous-devs/feat/optional-updater
Make auto update is optional
2023-11-22 10:34:49 +07:00
Ren Amamiya
05fb56e5fc Merge pull request #116 from vivganes/patch-1
Little grammar corrections
2023-11-22 10:32:47 +07:00
Vivek Ganesan
59d9646e9f Little grammar corrections 2023-11-22 08:43:31 +05:30
b73d84fccb update storage provider 2023-11-22 09:05:10 +07:00
1929ceb72d add toast message 2023-11-22 08:31:58 +07:00
a1d22c1daf make auto update is optional 2023-11-22 08:30:43 +07:00
cf7af1ba64 fix ci again again 2023-11-20 08:47:16 +07:00
933ca758ee fix ci again 2023-11-20 08:27:37 +07:00
f537209b92 fix ci 2023-11-20 08:16:39 +07:00
6777610b07 update dependencies 2023-11-20 08:02:09 +07:00
88803cd3cd bump version 2023-11-19 19:51:00 +07:00
Ren Amamiya
6adf5933b0 Merge pull request #113 from luminous-devs/hotfix/themes
Add support dark mode for toaster
2023-11-19 19:49:59 +07:00
9521a49fff support dark mode for toaster 2023-11-19 19:49:26 +07:00
Ren Amamiya
5789a105f5 Merge pull request #112 from luminous-devs/hotfix/settings
Fix settings screen
2023-11-19 15:15:11 +07:00
b7a18bea34 respect user settings 2023-11-19 14:50:59 +07:00
7117ed05a9 update settings screen 2023-11-19 08:48:01 +07:00
c53bdb68e5 add change theme function 2023-11-18 21:17:37 +07:00
6725dca807 fix all dms bugs 2023-11-17 16:03:12 +07:00
Ren Amamiya
077712cf43 Merge pull request #105 from luminous-devs/feat/v2.1.0
v2.1.0
2023-11-17 10:06:58 +07:00
2794c78ee1 add new private key screen 2023-11-17 09:24:21 +07:00
21574023db update dark mode 2023-11-17 08:16:25 +07:00
954b729dc9 wip: settings screen 2023-11-16 17:48:29 +07:00
6dc4e1cde6 bump version 2023-11-16 08:38:23 +07:00
efbdf26706 add window state plugin 2023-11-16 08:25:08 +07:00
b41ec353c6 improve relay connection 2023-11-16 07:59:29 +07:00
875225591a wip: settings screen 2023-11-15 14:20:45 +07:00
04c1223f2e update article screen 2023-11-15 13:32:23 +07:00
773e49afa2 wip 2023-11-15 13:13:11 +07:00
025d7a623b polish 2023-11-15 10:27:47 +07:00
b6caab15e1 update tauri controls 2023-11-15 09:26:59 +07:00
1d3d0a17dc fix updater 2023-11-15 08:32:40 +07:00
1cbe781698 update error screen 2023-11-14 16:14:40 +07:00
dc5b4f8ac1 refactor publish event 2023-11-14 15:15:13 +07:00
fee4ad7b98 smal fixes and update article layout 2023-11-13 15:44:58 +07:00
d5647d7452 redesign loading screen 2023-11-13 08:16:36 +07:00
0a5076f06c polish 2023-11-12 15:43:14 +07:00
a3632571ff polish 2023-11-12 08:41:47 +07:00
5c48ebe103 improve spacing 2023-11-11 16:12:50 +07:00
1c3119577f update widget list 2023-11-11 09:14:23 +07:00
0710996a0d wip: update widget list 2023-11-10 16:05:20 +07:00
0cdf199cb5 wip: rework widget 2023-11-09 18:02:25 +07:00
cb9006abb2 add topic widget 2023-11-09 09:12:42 +07:00
108ecafab7 update widgets 2023-11-08 16:17:47 +07:00
6b030f2902 polish 2023-11-08 08:21:52 +07:00
ce864c8990 wip 2023-11-07 16:23:01 +07:00
ee3e8eb105 wip 2023-11-07 09:35:13 +07:00
701712e7b8 polish 2023-11-05 15:19:51 +07:00
dad388c6ab new parser 2023-11-04 14:18:29 +07:00
Ren Amamiya
912c740c51 Merge pull request #103 from luminous-devs/feat/personal-dashboard
Add personal dashboard
2023-11-03 15:41:28 +07:00
da0b48c5df update personal dashboard screen 2023-11-03 15:38:58 +07:00
64b4745993 update personal screen 2023-11-03 08:45:25 +07:00
8aa2ef39c5 update nip-05 and user profile component styles 2023-11-02 13:47:44 +07:00
a945f04959 update dependencies 2023-11-02 13:09:52 +07:00
c93989237a fix app crash issue 2023-11-01 16:59:13 +07:00
95cf3f60f3 readd updater pubkey 2023-11-01 16:42:20 +07:00
Ren Amamiya
dd21633624 Merge pull request #102 from luminous-devs/feat/v2.0.1
v2.0.1
2023-11-01 15:38:39 +07:00
f01074ea9f fix article 2023-11-01 15:37:50 +07:00
c8d04f4695 support tiff image 2023-11-01 15:24:46 +07:00
2f8aa66ff6 bump version 2023-11-01 15:08:22 +07:00
3ad6830bfb update title bar 2023-11-01 14:58:20 +07:00
f2dddf97f5 polish 2023-11-01 13:01:52 +07:00
e218ebee89 refactor text parser 2023-11-01 10:05:08 +07:00
fd5ecc18a9 refactor all widgets 2023-11-01 08:07:49 +07:00
e7738fb128 refactor newsfeed widget 2023-10-30 16:29:49 +07:00
0b25a4a04b add ndk cache tauri 2023-10-29 11:07:05 +07:00
ace58ecdd5 refactor text parser 2023-10-28 14:36:12 +07:00
6685d9af38 update user component 2023-10-28 08:29:38 +07:00
60b803f419 unify upload function 2023-10-28 07:51:42 +07:00
555c8ec08a migrate to tanstack query v5 2023-10-28 07:35:39 +07:00
42eb882f52 update dependencies 2023-10-27 17:45:08 +07:00
b6784aa979 add missing deps to gh ci 2023-10-26 13:39:11 +07:00
08a7bdc6d5 fix ci again 2023-10-26 13:30:43 +07:00
6fac37a0ca improve follow/unfollow, support petname 2023-10-26 13:29:13 +07:00
37ed0f4892 fix ci 2023-10-26 13:11:06 +07:00
1cb2d8cb41 small fixes 2023-10-26 12:32:03 +07:00
3abce5e6d6 update appicon and tauri config 2023-10-26 12:24:32 +07:00
842f9e14e0 add updater v2 2023-10-26 10:33:27 +07:00
0c8dcef937 ready for alpha 2023-10-26 09:29:33 +07:00
Ren Amamiya
50f81a7d0b Merge pull request #98 from sectore/feat/flake-nix
Add Nix dev environment
2023-10-25 09:23:45 +07:00
dcacf23625 add notification widget 2023-10-25 09:23:20 +07:00
jk
b01af39445 typo + cleanup 2023-10-24 17:26:50 +02:00
507628bcaa update ui for consistent in light and dark mode 2023-10-24 21:15:59 +07:00
jk
4dfea49f71 Nix dev environment 2023-10-24 14:57:15 +02:00
854a47f266 wip 2023-10-24 13:11:10 +07:00
b1a44f2cbf wip: new composer 2023-10-22 15:48:06 +07:00
cade8c8b4c wip: multi-type composer 2023-10-21 15:58:39 +07:00
de88ca51fe update 2023-10-20 15:15:30 +07:00
7c8d8a09fd wip: nsecbunker 2023-10-20 09:36:49 +07:00
e1e54c1a98 update thread widget 2023-10-19 14:45:41 +07:00
0de72eb009 polish 2023-10-19 08:59:50 +07:00
823fb0f239 bump version 2023-10-18 14:59:33 +07:00
Ren Amamiya
3660db4887 Merge pull request #94 from luminous-devs/feat/v2
v2.0.0
2023-10-18 14:55:05 +07:00
b18ae56c36 Merge branch 'main' into feat/v2 2023-10-18 14:53:11 +07:00
939a72f945 ok fine 2023-10-18 14:49:20 +07:00
489ab6bd0b wip: polish 2023-10-18 08:43:31 +07:00
7fa1e89dc8 wip: complete new onboarding 2023-10-17 16:33:41 +07:00
3aa4f294f9 wip: new onboarding 2023-10-16 14:42:19 +07:00
cd3b9ada5a wip: new import account 2023-10-15 16:10:16 +07:00
620e763380 wip: new onboarding 2023-10-14 15:19:49 +07:00
0777c483e5 wip: fix ui for macos 2023-10-13 09:12:30 +07:00
893663561d wip: fix light mode 2023-10-13 08:35:07 +07:00
35650a40f2 wip 2023-10-12 09:13:06 +07:00
Phong
3b46e71525 wip: native secure store 2023-10-11 14:46:35 +07:00
Phong
2fcbf1987b rework macos version 2023-10-11 13:45:56 +07:00
Ren Amamiya
c3f399ea0b rollback to virtua v0.9.1 2023-10-11 08:04:20 +07:00
Ren Amamiya
770a63de63 wip 2023-10-10 15:49:23 +07:00
Ren Amamiya
bc4c3b9803 wip 2023-10-10 11:51:01 +07:00
Ren Amamiya
043c1b1220 wip: update color palette 2023-10-10 08:25:31 +07:00
Ren Amamiya
d20ee26e22 wip: add harmony color palette 2023-10-09 19:05:50 +07:00
Ren Amamiya
8930300fb5 wip 2023-10-09 15:17:15 +07:00
Ren Amamiya
140b8a47bf wip: ui 2023-10-09 11:30:52 +07:00
Ren Amamiya
ced23341d2 wip: new sidebar 2023-10-08 18:01:19 +07:00
Ren Amamiya
0946e9125e wip: ui 2023-10-08 14:14:39 +07:00
Ren Amamiya
bce76bd41c wip: ui 2023-10-08 09:31:11 +07:00
Ren Amamiya
cb91373d33 wip: dark mode - light mode 2023-10-07 09:06:33 +07:00
Ren Amamiya
c71bfb3f6d wip: fully migrate to tauri v2 2023-10-06 09:08:37 +07:00
9627c40d75 wip: tauri v2 2023-10-06 08:30:59 +07:00
Ren Amamiya
1240353e30 wip 2023-10-06 07:40:50 +07:00
Ren Amamiya
cef6b9aca9 wip: new chat layout 2023-10-05 14:55:12 +07:00
Ren Amamiya
508a746578 wip 2023-10-05 07:28:35 +07:00
Ren Amamiya
222ef2ca32 fix: vidstack bug 2023-10-04 20:30:41 +07:00
Ren Amamiya
32843018aa chore(release): v1.2.7 2023-10-04 14:27:48 +07:00
Ren Amamiya
f80dd78a8e wip 2023-10-04 14:11:45 +07:00
Ren Amamiya
9df4835be3 fix ci 2023-10-04 11:17:04 +07:00
Ren Amamiya
480580890e wip: new chat screen 2023-10-04 11:15:10 +07:00
Ren Amamiya
ca57ef1760 Merge branch 'main' into feat/nip28 2023-10-04 07:48:52 +07:00
Ren Amamiya
8e39bca57c fix build 2023-10-04 07:48:20 +07:00
Ren Amamiya
8d9ec0dcfd update config 2023-10-03 18:43:39 +07:00
Ren Amamiya
428d52f175 wip 2023-10-03 16:24:09 +07:00
Ren Amamiya
cdeb5afd28 upgrade to tauri v1.5.1 2023-10-03 07:38:23 +07:00
Ren Amamiya
1f3ba09cec new app icon 2023-10-02 15:36:20 +07:00
Ren Amamiya
4915b833e7 small fixed 2023-10-01 15:00:38 +07:00
Ren Amamiya
674e5f0339 finish relay manegament screen 2023-10-01 09:02:14 +07:00
Ren Amamiya
11ed618a7f wip: relay manegament screen 2023-09-30 19:07:17 +07:00
Ren Amamiya
a2e3247432 wip 2023-09-30 15:12:33 +07:00
Ren Amamiya
09b3eeda99 small fixes and bump version 2023-09-29 12:40:02 +07:00
Ren Amamiya
700f3eb85f upgrade to tauri v1.5.0 2023-09-29 09:19:40 +07:00
Ren Amamiya
2f87ed8949 polish widget code 2023-09-29 09:11:38 +07:00
Ren Amamiya
cb3c95b133 clean up and improve perf 2023-09-28 16:18:04 +07:00
Ren Amamiya
4f4e2f5ccd wip: multi account 2023-09-28 14:00:52 +07:00
Ren Amamiya
0e6fc65b08 Merge pull request #91 from luminous-devs/feat/ui-patch
v1.2.6
2023-09-28 08:28:34 +07:00
Ren Amamiya
876d351358 update dependencies and polish 2023-09-28 08:22:38 +07:00
Ren Amamiya
c80414a72d small fixes and support $ boost sign 2023-09-28 07:29:05 +07:00
Ren Amamiya
7cef6efa6f fix crash on windows 2023-09-27 18:24:58 +07:00
Ren Amamiya
74ff49b8db fix app window is not resizable 2023-09-27 16:11:33 +07:00
Ren Amamiya
2b50fc438f improve startup time 2023-09-27 14:53:01 +07:00
Ren Amamiya
b339e842ca perf improve 2023-09-27 08:32:19 +07:00
Ren Amamiya
1d93f8cf6a clean up 2023-09-26 09:40:02 +07:00
Ren Amamiya
236131087a polish 2023-09-26 09:05:39 +07:00
Ren Amamiya
a66770989b wip: finish browse users 2023-09-25 14:35:47 +07:00
Ren Amamiya
9ff74599eb customize traffic light on macOS 2023-09-25 07:43:13 +07:00
Ren Amamiya
c049fa8865 wip: update browse user screen 2023-09-24 15:42:49 +07:00
Ren Amamiya
41b12746a7 wip 2023-09-24 09:13:42 +07:00
Ren Amamiya
50f90ddcc2 wip 2023-09-24 07:55:27 +07:00
Ren Amamiya
c9bc7b81dd wip: browse user 2023-09-22 14:13:55 +07:00
Ren Amamiya
18a9ba3fb0 wip: replace ndk cache with metadata table 2023-09-21 16:11:35 +07:00
Ren Amamiya
413571ee7f wip 2023-09-21 15:28:01 +07:00
Ren Amamiya
17fe3bb1f6 wip: timeline 2023-09-21 09:11:45 +07:00
Ren Amamiya
0e5adb246f resizable widget 2023-09-20 14:31:14 +07:00
Ren Amamiya
296136203a update dependencies 2023-09-20 08:22:02 +07:00
Ren Amamiya
1bbfebc2b8 fix ci again 2023-09-19 16:31:38 +07:00
Ren Amamiya
d84e97b0d4 fix ci 2023-09-19 15:59:50 +07:00
Ren Amamiya
824aa8fa28 back to pnpm, bun is fun but cannot generate tauri build 2023-09-19 15:56:33 +07:00
Ren Amamiya
2b34ef3b7a fix build error 2023-09-19 15:29:26 +07:00
Ren Amamiya
4fa8f40e6a improve nwc 2023-09-19 15:06:12 +07:00
Ren Amamiya
c1bddeb6ed bump version 2023-09-19 11:20:15 +07:00
Ren Amamiya
5c2bfa0ea3 improve notification 2023-09-19 11:15:35 +07:00
Ren Amamiya
60e93965ea respect user's relay list (kind 10002) 2023-09-19 08:01:57 +07:00
Ren Amamiya
380d1fb930 temporary using default relays 2023-09-18 15:42:17 +07:00
Ren Amamiya
53aa13c8aa clean up messy code 2023-09-18 09:50:15 +07:00
Ren Amamiya
13f5190ba1 update dependencies and better handle repost 2023-09-17 16:14:04 +07:00
Ren Amamiya
c590e290e0 Merge pull request #87 from luminous-devs/feat/improve-onboarding
merge now, improve later
2023-09-17 08:44:16 +07:00
Ren Amamiya
cdf86a2613 polish 2023-09-17 08:43:42 +07:00
Ren Amamiya
8726e22b38 replace nostr.com with njump.me 2023-09-17 08:03:29 +07:00
Ren Amamiya
1206486016 partial support replaceable event 2023-09-16 16:06:01 +07:00
Ren Amamiya
11ad281d72 wip 2023-09-16 08:57:24 +07:00
Ren Amamiya
fe4bfa1699 wip: learn nostr widget 2023-09-16 07:47:44 +07:00
Ren Amamiya
c6a0636e8c add complete screen 2023-09-15 10:29:39 +07:00
Ren Amamiya
d3db6492d9 update onboarding 2023-09-15 08:58:09 +07:00
Ren Amamiya
8f8617d8f9 update import key flow 2023-09-14 16:51:38 +07:00
Ren Amamiya
8e513404c3 update create account flow 2023-09-14 09:20:36 +07:00
Ren Amamiya
5a6dd172b1 small fixes 2023-09-13 11:10:24 +07:00
Ren Amamiya
fa0d7cac31 hide nwc secret in frontend 2023-09-12 16:16:57 +07:00
Ren Amamiya
432b2ae185 polish nwc connection flow 2023-09-12 16:00:41 +07:00
Ren Amamiya
fb8a6581dd replace pnpm with bun 2023-09-12 08:43:12 +07:00
Ren Amamiya
a4f221f868 wip: redesign nwc 2023-09-12 08:27:29 +07:00
Ren Amamiya
602d012efe fix alby connection 2023-09-11 07:52:43 +07:00
Ren Amamiya
5bf816eba2 fully suport alby nostr-wallet-connect 2023-09-10 16:25:35 +07:00
Ren Amamiya
a33c9d3517 wip: integrate alby 2023-09-10 07:19:36 +07:00
Ren Amamiya
1553f5ced2 bump version 2023-09-09 07:21:02 +07:00
Ren Amamiya
41901b2174 fix hashtag step in onboarding 2023-09-08 17:02:01 +07:00
Ren Amamiya
177e4c1ff7 fix some bugs 2023-09-08 15:29:41 +07:00
Ren Amamiya
10036500cb small fixes 2023-09-08 09:22:09 +07:00
Ren Amamiya
a1fa777f8c fix logout function, prepare for multi-account support 2023-09-08 08:36:15 +07:00
Ren Amamiya
472925bb05 small fixes 2023-09-07 12:19:28 +07:00
Ren Amamiya
8eb11efb34 update notification 2023-09-07 11:34:26 +07:00
Ren Amamiya
48066a4018 bump version 2023-09-06 16:53:05 +07:00
Ren Amamiya
5c8850ea8f redesign widget list 2023-09-06 14:30:57 +07:00
Ren Amamiya
09aea3cff5 update widgets 2023-09-06 08:58:02 +07:00
Ren Amamiya
45c5a890b9 update tauri config 2023-09-06 07:46:31 +07:00
Ren Amamiya
69a3e85cb3 small updates and bump version 2023-09-05 17:25:00 +07:00
Ren Amamiya
224439f62b support drag and drop upload in composer 2023-09-05 13:07:21 +07:00
Ren Amamiya
2389ad5fdc replace void.cat with nostr.build 2023-09-05 12:46:00 +07:00
Ren Amamiya
4019623d99 small updates 2023-09-05 08:50:13 +07:00
Ren Amamiya
57c17ffbf9 use nostr.com to display unfound event 2023-09-04 18:09:41 +07:00
Ren Amamiya
98d2ccfc86 small fixes 2023-09-04 17:18:28 +07:00
Ren Amamiya
c74a81cfdb re-add link preview 2023-09-04 14:35:57 +07:00
Ren Amamiya
3ebcf4a981 new parser, faster than before 50% 2023-09-04 14:05:04 +07:00
Ren Amamiya
5d45027776 fix build issue 2023-09-04 07:44:57 +07:00
Ren Amamiya
21ea8309c7 fix ci (final) 2023-09-03 12:02:59 +07:00
Ren Amamiya
431331174a fix ci again 2023-09-03 11:30:45 +07:00
Ren Amamiya
c26cfc038d fix ci 2023-09-03 11:08:13 +07:00
Ren Amamiya
39b7b34bb7 new mention popup in composer 2023-09-03 08:43:08 +07:00
Ren Amamiya
a4cf65e7c2 update ui consistent for cross platform 2023-09-03 07:43:38 +07:00
Ren Amamiya
37668393f1 expt: disable note metadata 2023-09-02 17:28:05 +07:00
Ren Amamiya
4309f734b6 Merge pull request #80 from luminous-devs/revert-to-tauri-v1
Revert to Tauri v1.4.0
2023-09-02 12:49:51 +07:00
Ren Amamiya
b4957bae1f native fetch and shadow 2023-09-02 12:49:04 +07:00
Ren Amamiya
7a3b19bf7b revert to tauri v1 2023-09-02 12:15:48 +07:00
Ren Amamiya
1931373515 update composer 2023-09-02 08:50:54 +07:00
Ren Amamiya
28939d1733 improve hashtag parser 2023-09-01 18:26:22 +07:00
Ren Amamiya
e6d35bc635 fix mention in composer and improve error handling 2023-09-01 15:57:31 +07:00
Ren Amamiya
cc315a190a fully support nip05 2023-09-01 08:58:33 +07:00
Ren Amamiya
0d207d471c fix nip94 widget 2023-08-31 09:04:09 +07:00
Ren Amamiya
f2eb7a90ad update settings screen 2023-08-31 08:51:23 +07:00
Ren Amamiya
c29ed9669e bump version 2023-08-30 16:23:38 +07:00
Ren Amamiya
aced6077bd refactor widget 2023-08-30 16:21:42 +07:00
Ren Amamiya
abe4d11498 clean up & polish 2023-08-30 09:03:02 +07:00
Ren Amamiya
91e50efb1a yup, lume is very solid now 2023-08-29 16:11:17 +07:00
Ren Amamiya
2914c54a47 Merge pull request #78 from luminous-devs/wip/ui
Update for UI consistent
2023-08-29 12:15:19 +07:00
Ren Amamiya
d1701eff20 add focus button to note actionbar 2023-08-29 12:14:45 +07:00
Ren Amamiya
d4eb237e40 expandable composer 2023-08-29 11:13:36 +07:00
Ren Amamiya
f4b2458417 ui consistent 2023-08-29 08:24:18 +07:00
Ren Amamiya
c89e7e48ee wip: cross platform ui 2023-08-28 16:00:11 +07:00
Ren Amamiya
5a3207f878 tauri config per platform 2023-08-28 12:19:40 +07:00
Ren Amamiya
3d4afb40bc temporary using custom tauri build 2023-08-28 10:39:18 +07:00
Ren Amamiya
bf91187c1f update notification screen 2023-08-27 14:46:48 +07:00
Ren Amamiya
963328e064 update notification screen 2023-08-27 10:38:32 +07:00
Ren Amamiya
53227c7050 clean up & update edit profile modal 2023-08-27 08:19:42 +07:00
Ren Amamiya
fe28cd95bd clean up & small fixes 2023-08-26 14:52:02 +07:00
Ren Amamiya
0f212828a7 update note replies component 2023-08-26 10:54:06 +07:00
Ren Amamiya
bfb7d7915f update single note screen 2023-08-26 09:45:39 +07:00
Ren Amamiya
92d49c306b update user screen 2023-08-25 09:50:04 +07:00
Ren Amamiya
b2df8ae320 update widgets 2023-08-24 16:44:55 +07:00
Ren Amamiya
98687bd78b fix small issues 2023-08-24 15:23:54 +07:00
Ren Amamiya
970115d059 update message form 2023-08-24 11:20:27 +07:00
Ren Amamiya
4893ebd932 re-enable nip-04 with more polish, prepare for nip-44 2023-08-24 09:05:34 +07:00
Ren Amamiya
3455eb701f rename some files and add nip 94 widget 2023-08-23 15:18:59 +07:00
Ren Amamiya
c97c685149 refactor note component & add support for kind 30023 2023-08-23 09:48:22 +07:00
Ren Amamiya
0912948b31 add notifications screen 2023-08-22 16:34:47 +07:00
Ren Amamiya
4830f0b236 update space screen 2023-08-22 09:10:04 +07:00
Ren Amamiya
917e49b25d Merge pull request #75 from luminous-devs/wip/optimize
[WIP]: Refactor DB and optimize codebase
2023-08-20 15:59:36 +07:00
Ren Amamiya
fe8c2fd2c6 update depedencies 2023-08-20 15:59:07 +07:00
Ren Amamiya
c4a7ef8867 update space screen 2023-08-20 15:55:31 +07:00
Ren Amamiya
bac70b19ec polish 2023-08-19 15:27:10 +07:00
Ren Amamiya
08e3a66ece update default avatar 2023-08-19 11:18:27 +07:00
Ren Amamiya
eda18f8c34 fix some errors cause app crash 2023-08-19 08:56:19 +07:00
Ren Amamiya
c85502e427 small fixes 2023-08-18 17:42:25 +07:00
Ren Amamiya
5626579b3f wip: refactor 2023-08-18 07:37:11 +07:00
Ren Amamiya
414dd50a5c wip: refactor 2023-08-17 15:11:40 +07:00
Ren Amamiya
ab61bfb2cd wip: clean up & refactor 2023-08-16 20:52:09 +07:00
Ren Amamiya
c05bb54976 wip: refactor 2023-08-16 11:43:04 +07:00
Ren Amamiya
2d53019c10 wip: refactor 2023-08-15 21:13:58 +07:00
Ren Amamiya
6e28bcdb96 wip: use new storage layer 2023-08-15 08:29:04 +07:00
Ren Amamiya
adca37223c refactor storage layer 2023-08-14 18:15:58 +07:00
Ren Amamiya
823b203b73 update useNostr hook 2023-08-14 14:12:54 +07:00
Ren Amamiya
6c6f50444e polish splash screen 2023-08-14 09:34:38 +07:00
Ren Amamiya
c42c78fc98 clean up and refactor open graph 2023-08-14 09:03:58 +07:00
Ren Amamiya
33fd7512e7 update zap modal to match new ui 2023-08-13 15:30:33 +07:00
Ren Amamiya
3b02b3f554 update build config for linux 2023-08-13 14:31:10 +07:00
Ren Amamiya
a02577bb55 fix build errors again 2023-08-13 12:28:10 +07:00
Ren Amamiya
f8753eca90 fix build errors 2023-08-13 12:03:00 +07:00
Ren Amamiya
4a0f2c9a67 fix z-index issue 2023-08-13 09:07:59 +07:00
Ren Amamiya
9e5f15e9d5 small updates 2023-08-12 15:43:50 +07:00
Ren Amamiya
bb089bb259 polish 2023-08-12 11:18:10 +07:00
Ren Amamiya
36b2acba6a rename blocks to widgets 2023-08-11 15:25:33 +07:00
Ren Amamiya
0cfc3a48d8 update splash screen 2023-08-11 11:55:31 +07:00
Ren Amamiya
f2fc41018d update settings screen 2023-08-10 17:18:53 +07:00
Ren Amamiya
8024c09642 fixes 2023-08-10 17:03:50 +07:00
Ren Amamiya
e6d8f084ae clean up & save onboarding process as state 2023-08-10 12:34:11 +07:00
Ren Amamiya
d63690e9d0 small updates and bump version 2023-08-09 19:04:32 +07:00
Ren Amamiya
edf56bc97b fix bugs 2023-08-09 13:17:07 +07:00
Ren Amamiya
d1d0a462f4 support nip94 and fix some bugs 2023-08-09 09:04:16 +07:00
Ren Amamiya
e6c6793f6e wip: add relay discover to onboarding 2023-08-08 18:52:46 +07:00
Ren Amamiya
9c7b58ee99 wip: new onboarding process 2023-08-07 15:09:04 +07:00
Ren Amamiya
ed759086c9 Merge pull request #66 from luminous-devs/v1.2.0
prepare for v1.2.0
2023-08-07 09:08:56 +07:00
Ren Amamiya
aa2a9851c3 small fixes 2023-08-07 09:07:53 +07:00
Ren Amamiya
02ff9e3b68 polish 2023-08-06 15:11:58 +07:00
Ren Amamiya
71338b3b07 wip: network 2023-08-06 07:59:43 +07:00
Ren Amamiya
373a0f0608 add network to account 2023-08-04 15:38:38 +07:00
Ren Amamiya
4c7826bbb3 add more actions to note 2023-08-04 11:09:32 +07:00
Ren Amamiya
ac50cd1373 polish 2023-08-04 08:51:26 +07:00
Ren Amamiya
2e47415160 update trending screen and add tauri shell plugin 2023-08-03 16:12:27 +07:00
Ren Amamiya
3432005ade polish 2023-08-03 15:17:28 +07:00
Ren Amamiya
d10462cd4a wip: update chats to new ui 2023-08-03 14:09:12 +07:00
Ren Amamiya
ae1e84655a polish 2023-08-03 08:56:36 +07:00
Ren Amamiya
babcd8698e wip: port more component to new ui 2023-08-02 14:48:51 +07:00
Ren Amamiya
a85bcf917b wip: convert more components to new ui 2023-08-02 08:28:43 +07:00
Ren Amamiya
1ddcbf1654 wip: new ui 2023-08-01 15:34:09 +07:00
Ren Amamiya
e97d0281e2 redesign sidebar 2023-08-01 14:26:16 +07:00
Ren Amamiya
9941305998 fix ndk cache 2023-08-01 07:53:58 +07:00
Ren Amamiya
a898e3013f updated 2023-07-30 21:11:44 +07:00
Ren Amamiya
c80d554630 add ndk cache 2023-07-30 08:13:24 +07:00
Ren Amamiya
996ba3f82d add tauri controls 2023-07-29 15:42:44 +07:00
Ren Amamiya
aca17f104e fully support tauri v2 2023-07-29 09:28:15 +07:00
Ren Amamiya
a1a5544789 upgrade to tauri v2 2023-07-29 08:13:53 +07:00
Ren Amamiya
a17efcf4d3 update deps 2023-07-29 07:26:51 +07:00
Ren Amamiya
15514887a4 bump version 2023-07-27 09:25:47 +07:00
Ren Amamiya
343e1a12d6 v1.1.1 2023-07-27 09:02:04 +07:00
Ren Amamiya
f52ea04541 polish 2023-07-26 09:26:40 +07:00
Ren Amamiya
89dd4f5c9d fix small issues 2023-07-26 08:25:08 +07:00
Ren Amamiya
e30ca0ff82 add hashtag support in composer 2023-07-25 17:45:32 +07:00
Ren Amamiya
8d761caf3e add hashtag block modal 2023-07-25 17:06:18 +07:00
Ren Amamiya
a4e03a59eb add unknown chats modal 2023-07-25 16:12:52 +07:00
Ren Amamiya
1362dfadda update urls and user page 2023-07-25 13:25:14 +07:00
Ren Amamiya
7a245cd375 update icons 2023-07-25 10:39:32 +07:00
Ren Amamiya
a1b93cdb72 polish 2023-07-25 08:09:26 +07:00
Ren Amamiya
d30be10568 fix zap 2023-07-24 10:12:39 +07:00
Ren Amamiya
515fda5e97 wip: zap (done) 2023-07-24 09:30:57 +07:00
Ren Amamiya
22a678ec08 wip: zap 2023-07-23 21:39:04 +07:00
Ren Amamiya
71c4f3db22 add download button to image 2023-07-23 17:27:51 +07:00
Ren Amamiya
13ca8a2c54 update notification 2023-07-23 15:54:34 +07:00
Ren Amamiya
f0fb1bee1e minor updates 2023-07-23 09:16:29 +07:00
Ren Amamiya
b66e11433f Merge pull request #58 from luminous-devs/v1.1.0
prepare v1.1.0
2023-07-22 17:35:37 +07:00
Ren Amamiya
6d20f84489 fix small errors 2023-07-22 17:35:04 +07:00
Ren Amamiya
20a8ce9cba update composer with image upload 2023-07-22 15:32:34 +07:00
Ren Amamiya
17d2a8cb56 add mention to composer 2023-07-21 18:07:17 +07:00
Ren Amamiya
64cd17389d wip: tiptap editor 2023-07-21 16:16:41 +07:00
Ren Amamiya
8f4cf7e948 fix errors 2023-07-20 17:14:32 +07:00
Ren Amamiya
bbfdb139c6 update stronghold 2023-07-20 08:57:58 +07:00
Ren Amamiya
a80477b40e update useProfile hook 2023-07-19 17:37:10 +07:00
Ren Amamiya
29d40ed406 render reply and sub reply accordingly 2023-07-19 17:07:25 +07:00
Ren Amamiya
22c1eaa541 add useBlock hook 2023-07-19 12:47:45 +07:00
Ren Amamiya
6307e8d1e4 add download keys button to onboarding process 2023-07-19 07:57:25 +07:00
Ren Amamiya
12bfa2fca1 clean up database and update depedencies 2023-07-18 14:37:03 +07:00
Ren Amamiya
100204b267 add user block 2023-07-17 17:00:01 +07:00
Ren Amamiya
7d38fa5d85 update depedencies 2023-07-17 15:21:56 +07:00
Ren Amamiya
5606dcb32f update replies 2023-07-17 13:37:01 +07:00
Ren Amamiya
b3b790588a add hashtag block 2023-07-17 08:54:17 +07:00
Ren Amamiya
4f41022b30 update 2023-07-17 07:51:00 +07:00
Ren Amamiya
9a09a04a5d add strangers section to chats sidebar 2023-07-16 18:25:58 +07:00
Ren Amamiya
5ce9fa515a add reaction 2023-07-16 15:46:01 +07:00
Ren Amamiya
abc53a0d9a update note actions component 2023-07-16 14:24:19 +07:00
Ren Amamiya
e0a14ce6cf update markdown 2023-07-15 21:01:27 +07:00
Ren Amamiya
f154d8f5f4 use markdown 2023-07-15 16:03:31 +07:00
Ren Amamiya
1f18d8bb44 refactor note component 2023-07-15 12:20:09 +07:00
Ren Amamiya
41460436df add nostr-fetch 2023-07-11 14:27:14 +07:00
Ren Amamiya
339783a1a4 update set password flow 2023-07-10 17:16:43 +07:00
Ren Amamiya
c664b3e4a4 update gh action and fix migrate page 2023-07-10 15:30:15 +07:00
412 changed files with 20926 additions and 15699 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

3
.eslintignore Normal file
View File

@@ -0,0 +1,3 @@
/**/node_modules/*
node_modules/
dist/

View File

@@ -1,8 +1,5 @@
name: 'publish'
on:
push:
branches:
- release
name: 'Publish'
on: workflow_dispatch
env:
CARGO_INCREMENTAL: 0
@@ -17,16 +14,10 @@ jobs:
settings:
- platform: 'macos-latest'
args: '--target universal-apple-darwin'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: 'ubuntu-20.04'
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: '--target x86_64-pc-windows-msvc'
- platform: 'windows-latest'
args: '--target i686-pc-windows-msvc'
runs-on: ${{ matrix.settings.platform }}
steps:
- uses: actions/checkout@v3
@@ -38,14 +29,14 @@ jobs:
with:
targets: aarch64-apple-darwin
- name: install dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-20.04'
if: matrix.settings.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y build-essential libssl-dev javascriptcoregtk-4.1 libayatana-appindicator3-dev libsoup-3.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev webkit2gtk-4.1 librsvg2-dev patchelf
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x.x
version: 8.x.x
run_install: false
- name: Setup node and cache for package data
uses: actions/setup-node@v3
@@ -60,18 +51,20 @@ jobs:
- uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'App v__VERSION__'
tagName: v__VERSION__
releaseName: 'v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.settings.args }}
includeDebug: true

4
.gitignore vendored
View File

@@ -14,9 +14,11 @@ out
*.local
.next
.vscode
pnpm-lock.yaml
*.db
*.db-journal
bun.lockb
.direnv
# Editor directories and files
.vscode/*

View File

@@ -8,6 +8,12 @@ Download Lume for your platform here: [https://github.com/luminous-devs/lume/rel
Supported platform: macOS, Windows and Linux
### Prerequisites
- PNPM or Bun (experiment)
- Tauri: https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-macos
### Develop
Clone project
@@ -22,20 +28,23 @@ Install packages
pnpm install
```
Run dev
Run dev build
```
pnpm tauri dev
```
Build
Generate production build
```
pnpm tauri build
```
(Advance) - Generate SQLite migration
#### Nix
```
pnpm add-migrate <migrate_name>
```
Requirements:
1. [Install Nix](https://zero-to-flakes.com/install)
1. [Setup `direnv`](https://zero-to-flakes.com/direnv)
`cd` into the root folder of the project to enter `nix develop` shell. Run `direnv allow` (only once). Then run `pnpm` or `bun` (experimental) commands as described above.

130
flake.lock generated Normal file
View File

@@ -0,0 +1,130 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1697723726,
"narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1697940838,
"narHash": "sha256-eyk92QqAoRNC0V99KOcKcBZjLPixxNBS0PRc4KlSQVs=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "a3e829c06eadf848f13d109c7648570ce37ebccd",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

71
flake.nix Normal file
View File

@@ -0,0 +1,71 @@
# Nix.flake to build Lume based on Tauri's Guides:
# Prerequisites -> Installing -> Setting Up Linux -> NixOS
# https://tauri.app/v1/guides/getting-started/prerequisites/#1-system-dependencies
#
# To build Rust backend of Tauri `rust-overlay` is used
# https://github.com/oxalica/rust-overlay
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
libraries = with pkgs;[
webkitgtk
gtk3
cairo
gdk-pixbuf
glib
dbus
openssl_3
librsvg
];
packages = with pkgs; [
curl
wget
pkg-config
dbus
openssl_3
glib
gtk3
libsoup
webkitgtk
librsvg
];
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ]; # needed by rust-analyzer
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
rustToolchain
pkgs.nodejs
pkgs.nodePackages.pnpm
pkgs.bun # experimental in Lume
] ++ packages;
shellHook =
''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath libraries}:$LD_LIBRARY_PATH
export XDG_DATA_DIRS=${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS
'';
# Avoid white screen running with Nix
# https://github.com/tauri-apps/tauri/issues/4315#issuecomment-1207755694
WEBKIT_DISABLE_COMPOSITING_MODE = 1;
};
});
}

View File

@@ -1,11 +1,11 @@
<html lang="en" class="dark">
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lume</title>
</head>
<body class="cursor-default select-none overflow-hidden font-sans antialiased h-screen w-screen dark:bg-black dark:text-zinc-100">
<body class="relative cursor-default select-none overflow-hidden font-sans antialiased h-screen w-screen text-neutral-950 dark:text-neutral-50">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>

View File

@@ -1,7 +1,8 @@
{
"name": "lume",
"description": "the communication app",
"private": true,
"version": "1.0.1",
"version": "2.1.3",
"scripts": {
"dev": "vite",
"build": "vite build",
@@ -9,76 +10,115 @@
"add-migrate": "cd src-tauri/ && sqlx migrate add",
"prepare": "husky install",
"lint": "eslint ./src --fix",
"format": "prettier ./src --write"
"format": "prettier ./src --write",
"dep-update": "pnpm update && cd src-tauri/ && cargo update"
},
"lint-staged": {
"**/*.{ts, tsx}": "eslint --fix",
"**/*.{ts, tsx, css, md, html, json}": "prettier --cache --write"
},
"dependencies": {
"@headlessui/react": "^1.7.15",
"@nostr-dev-kit/ndk": "^0.7.5",
"@radix-ui/react-popover": "^1.0.6",
"@radix-ui/react-tooltip": "^1.0.6",
"@tanstack/react-query": "^4.29.19",
"@tanstack/react-query-devtools": "^4.29.19",
"@tanstack/react-virtual": "3.0.0-beta.54",
"@tauri-apps/api": "^1.4.0",
"cheerio": "1.0.0-rc.12",
"dayjs": "^1.11.9",
"destr": "^1.2.2",
"framer-motion": "^10.12.18",
"get-urls": "^11.0.0",
"immer": "^10.0.2",
"@evilmartians/harmony": "^1.1.0",
"@getalby/sdk": "^2.6.0",
"@nostr-dev-kit/ndk": "^2.0.5",
"@nostr-fetch/adapter-ndk": "^0.13.1",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-hover-card": "^1.0.7",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.7",
"@tanstack/react-query": "^5.8.4",
"@tauri-apps/api": "2.0.0-alpha.11",
"@tauri-apps/cli": "2.0.0-alpha.17",
"@tauri-apps/plugin-autostart": "2.0.0-alpha.3",
"@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.3",
"@tauri-apps/plugin-dialog": "2.0.0-alpha.3",
"@tauri-apps/plugin-fs": "2.0.0-alpha.3",
"@tauri-apps/plugin-http": "2.0.0-alpha.3",
"@tauri-apps/plugin-notification": "2.0.0-alpha.3",
"@tauri-apps/plugin-os": "2.0.0-alpha.4",
"@tauri-apps/plugin-process": "2.0.0-alpha.3",
"@tauri-apps/plugin-shell": "2.0.0-alpha.3",
"@tauri-apps/plugin-sql": "2.0.0-alpha.3",
"@tauri-apps/plugin-updater": "2.0.0-alpha.3",
"@tauri-apps/plugin-upload": "2.0.0-alpha.3",
"@tiptap/extension-character-count": "^2.1.12",
"@tiptap/extension-document": "^2.1.12",
"@tiptap/extension-image": "^2.1.12",
"@tiptap/extension-mention": "^2.1.12",
"@tiptap/extension-paragraph": "^2.1.12",
"@tiptap/extension-placeholder": "^2.1.12",
"@tiptap/extension-text": "^2.1.12",
"@tiptap/pm": "^2.1.12",
"@tiptap/react": "^2.1.12",
"@tiptap/starter-kit": "^2.1.12",
"@tiptap/suggestion": "^2.1.12",
"dayjs": "^1.11.10",
"framer-motion": "^10.16.5",
"html-to-text": "^9.0.5",
"idb-keyval": "^6.2.1",
"light-bolt11-decoder": "^3.0.0",
"nostr-tools": "^1.12.1",
"lru-cache": "^10.1.0",
"markdown-to-jsx": "^7.3.2",
"media-chrome": "^1.5.3",
"minidenticons": "^4.2.0",
"nanoid": "^5.0.3",
"nostr-fetch": "^0.13.1",
"nostr-tools": "^1.17.0",
"qrcode.react": "^3.1.0",
"re-resizable": "^6.9.11",
"react": "^18.2.0",
"react-currency-input-field": "^3.6.12",
"react-dom": "^18.2.0",
"react-hook-form": "^7.45.1",
"react-hook-form": "^7.48.2",
"react-hotkeys-hook": "^4.4.1",
"react-player": "^2.12.0",
"react-router-dom": "^6.14.1",
"react-router-dom": "^6.20.0",
"react-string-replace": "^1.1.1",
"react-virtuoso": "^4.3.11",
"slate": "^0.94.1",
"slate-history": "^0.93.0",
"slate-react": "^0.94.2",
"tailwind-merge": "^1.13.2",
"tauri-plugin-autostart-api": "github:tauri-apps/tauri-plugin-autostart#v1",
"tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql",
"tauri-plugin-stronghold-api": "github:tauri-apps/tauri-plugin-stronghold#v1",
"zustand": "^4.3.9"
"reactflow": "^11.10.1",
"sonner": "^1.2.2",
"tailwind-scrollbar": "^3.0.5",
"tauri-controls": "github:reyamir/tauri-controls",
"tippy.js": "^6.3.7",
"tiptap-markdown": "^0.8.4",
"virtua": "^0.16.6",
"zustand": "^4.4.6"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"@tauri-apps/cli": "^1.4.0",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/node": "^18.16.19",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@types/youtube-player": "^5.5.7",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.14",
"@tailwindcss/typography": "^0.5.10",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/html-to-text": "^9.0.4",
"@types/node": "^20.9.4",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.2.17",
"@types/youtube-player": "^5.5.11",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.16",
"clsx": "^2.0.0",
"cross-env": "^7.0.3",
"csstype": "^3.1.2",
"encoding": "^0.1.13",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-simple-import-sort": "^10.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.3",
"postcss": "^8.4.25",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0",
"lint-staged": "^15.1.0",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.7",
"prop-types": "^15.8.1",
"tailwindcss": "^3.3.2",
"typescript": "^4.9.5",
"vite": "^4.4.2",
"vite-plugin-top-level-await": "^1.3.1",
"vite-tsconfig-paths": "^4.2.0"
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.5",
"typescript": "^5.3.2",
"vite": "^4.5.0",
"vite-tsconfig-paths": "^4.2.1"
}
}

6180
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

BIN
public/anime.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
public/art.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
public/clapping_hands.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

BIN
public/clown_face.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
public/crying_face.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
public/face_with_tongue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 KiB

BIN
public/fallback-image.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
public/gaming.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
public/ghost.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
public/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
public/movie.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
public/music.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
public/nsfw.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
public/photography.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
public/technology.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
public/zap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

3769
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +1,46 @@
[package]
name = "lume"
version = "1.0.1"
description = "nostr client"
version = "2.1.3"
description = "the communication app"
authors = ["Ren Amamiya"]
license = ""
repository = ""
license = "GPL-3.0"
repository = "https://github.com/luminous-devs/lume"
edition = "2021"
rust-version = "1.57"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
rust-version = "1.66"
[build-dependencies]
tauri-build = { version = "1.2", features = [] }
tauri-build = { version = "2.0.0-alpha", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2", features = [ "path-all", "fs-read-dir", "fs-read-file", "clipboard-read-text", "clipboard-write-text", "dialog-open", "http-all", "http-multipart", "notification-all", "os-all", "process-relaunch", "shell-open", "system-tray", "updater", "window-close", "window-start-dragging"] }
tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
sqlx-cli = {version = "0.7.0", default-features = false, features = ["sqlite"] }
rust-argon2 = "1.0"
rand = "0.8.5"
[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/plugins-workspace"
branch = "v1"
features = ["sqlite"]
[target.'cfg(target_os = "macos")'.dependencies]
objc = "0.2.7"
cocoa = "0.24.1"
tauri = { version = "2.0.0-alpha", features = [
"macos-private-api",
"native-tls-vendored",
] }
tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-fs = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-http = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-notification = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-os = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-process = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-shell = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-updater = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-upload = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-theme = { git = "https://github.com/wyhaya/tauri-plugin-theme" }
tauri-plugin-sql = { git = "hhttps://github.com/tauri-apps/plugins-workspace", branch = "v2", features = [
"sqlite",
] }
sqlx-cli = { version = "0.7.0", default-features = false, features = [
"sqlite",
] }
webpage = { version = "1.6.0", features = ["serde"] }
keyring = "2"
[features]
# by default Tauri runs in production mode

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -1,45 +1,29 @@
-- Add migration script here
-- create accounts table
-- is_active (multi-account feature), value:
-- 0: false
-- 1: true
CREATE TABLE
accounts (
id INTEGER NOT NULL PRIMARY KEY,
npub TEXT NOT NULL UNIQUE,
id TEXT NOT NULL PRIMARY KEY,
pubkey TEXT NOT NULL UNIQUE,
privkey TEXT NOT NULL,
follows JSON,
follows TEXT,
circles TEXT,
is_active INTEGER NOT NULL DEFAULT 0,
last_login_at NUMBER NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- create notes table
CREATE TABLE
notes (
id INTEGER NOT NULL PRIMARY KEY,
event_id TEXT NOT NULL UNIQUE,
events (
id TEXT NOT NULL PRIMARY KEY,
account_id INTEGER NOT NULL,
pubkey TEXT NOT NULL,
kind INTEGER NOT NULL DEFAULT 1,
tags JSON,
content TEXT NOT NULL,
event TEXT NOT NULL,
author TEXT NOT NULL,
kind NUMBER NOT NULL DEFAULt 1,
root_id TEXT,
reply_id TEXT,
created_at INTEGER NOT NULL,
parent_id TEXT,
FOREIGN KEY (account_id) REFERENCES accounts (id)
);
-- create channels table
CREATE TABLE
channels (
id INTEGER NOT NULL PRIMARY KEY,
event_id TEXT NOT NULL UNIQUE,
name TEXT,
about TEXT,
picture TEXT,
created_at INTEGER NOT NULL
);
-- create settings table
CREATE TABLE
settings (
@@ -49,11 +33,23 @@ CREATE TABLE
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- create metadata table
CREATE TABLE
metadata (
id TEXT NOT NULL PRIMARY KEY,
pubkey TEXT NOT NULL,
widgets (
id INTEGER NOT NULL PRIMARY KEY,
account_id INTEGER NOT NULL,
kind INTEGER NOT NULL,
title TEXT NOT NULL,
content TEXT NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (account_id) REFERENCES accounts (id)
);
CREATE TABLE
relays (
id INTEGER NOT NULL PRIMARY KEY,
account_id INTEGER NOT NULL,
relay TEXT NOT NULL UNIQUE,
purpose TEXT NOT NULL DEFAULT '',
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (account_id) REFERENCES accounts (id)
);

View File

@@ -1,12 +0,0 @@
-- Add migration script here
-- create chats table
CREATE TABLE
chats (
id INTEGER NOT NULL PRIMARY KEY,
event_id TEXT NOT NULL UNIQUE,
receiver_pubkey INTEGER NOT NULL,
sender_pubkey TEXT NOT NULL,
content TEXT NOT NULL,
tags JSON,
created_at INTEGER NOT NULL
);

View File

@@ -1,14 +0,0 @@
-- Add migration script here
INSERT INTO
settings (key, value)
VALUES
("last_login", "0"),
(
"relays",
'["wss://relayable.org","wss://relay.damus.io","wss://relay.nostr.band/all","wss://relay.nostrgraph.net","wss://nostr.mutinywallet.com"]'
),
("auto_start", "0"),
("cache_time", "86400000"),
("compose_shortcut", "meta+n"),
("add_imageblock_shortcut", "meta+i"),
("add_feedblock_shortcut", "meta+f")

View File

@@ -1,3 +0,0 @@
-- Add migration script here
-- add pubkey to channel
ALTER TABLE channels ADD pubkey TEXT NOT NULL DEFAULT '';

View File

@@ -1,38 +0,0 @@
-- Add migration script here
INSERT
OR IGNORE INTO channels (
event_id,
pubkey,
name,
about,
picture,
created_at
)
VALUES
(
"e3cadf5beca1b2af1cddaa41a633679bedf263e3de1eb229c6686c50d85df753",
"126103bfddc8df256b6e0abfd7f3797c80dcc4ea88f7c2f87dd4104220b4d65f",
"lume-general",
"General channel for Lume",
"https://void.cat/d/UNyxBmAh1MUx5gQTX95jyf.webp",
1681898574
);
INSERT
OR IGNORE INTO channels (
event_id,
pubkey,
name,
about,
picture,
created_at
)
VALUES
(
"25e5c82273a271cb1a840d0060391a0bf4965cafeb029d5ab55350b418953fbb",
"ed1d0e1f743a7d19aa2dfb0162df73bacdbc699f67cc55bb91a98c35f7deac69",
"Nostr",
"",
"https://cloudflare-ipfs.com/ipfs/QmTN4Eas9atUULVbEAbUU8cowhtvK7g3t7jfKztY7wc8eP?.png",
1661333723
);

View File

@@ -1,11 +0,0 @@
-- Add migration script here
-- create blacklist table
CREATE TABLE
blacklist (
id INTEGER NOT NULL PRIMARY KEY,
account_id INTEGER NOT NULL,
content TEXT NOT NULL UNIQUE,
status INTEGER NOT NULL DEFAULT 0,
kind INTEGER NOT NULL,
FOREIGN KEY (account_id) REFERENCES accounts (id)
);

View File

@@ -1,11 +0,0 @@
-- Add migration script here
CREATE TABLE
blocks (
id INTEGER NOT NULL PRIMARY KEY,
account_id INTEGER NOT NULL,
kind INTEGER NOT NULL,
title TEXT NOT NULL,
content TEXT NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (account_id) REFERENCES accounts (id)
);

View File

@@ -1,15 +0,0 @@
-- Add migration script here
CREATE TABLE
channel_messages (
id INTEGER NOT NULL PRIMARY KEY,
channel_id TEXT NOT NULL,
event_id TEXT NOT NULL UNIQUE,
pubkey TEXT NOT NULL,
kind INTEGER NOT NULL,
content TEXT NOT NULL,
tags JSON,
mute BOOLEAN DEFAULT 0,
hide BOOLEAN DEFAULT 0,
created_at INTEGER NOT NULL,
FOREIGN KEY (channel_id) REFERENCES channels (event_id)
);

View File

@@ -1,13 +0,0 @@
-- Add migration script here
CREATE TABLE
replies (
id INTEGER NOT NULL PRIMARY KEY,
parent_id TEXT NOT NULL,
event_id TEXT NOT NULL UNIQUE,
pubkey TEXT NOT NULL,
kind INTEGER NOT NULL DEFAULT 1,
tags JSON,
content TEXT NOT NULL,
created_at INTEGER NOT NULL,
FOREIGN KEY (parent_id) REFERENCES notes (event_id)
);

View File

@@ -0,0 +1,27 @@
-- Add migration script here
CREATE TABLE
ndk_users (
pubkey TEXT NOT NULL PRIMARY KEY,
profile TEXT,
createdAt NUMBER
);
CREATE TABLE
ndk_events (
id TEXT NOT NULL PRIMARY KEY,
pubkey TEXT,
content TEXT,
kind NUMBER,
createdAt NUMBER,
relay TEXT,
event TEXT
);
CREATE TABLE
ndk_eventtags (
id TEXT NOT NULL PRIMARY KEY,
eventId TEXT,
tag TEXT,
value TEXT,
tagValue TEXT
);

View File

@@ -3,19 +3,12 @@
windows_subsystem = "windows"
)]
#[cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
// use rand::distributions::{Alphanumeric, DistString};
use tauri::{Manager, WindowEvent};
use keyring::Entry;
use std::time::Duration;
use tauri_plugin_autostart::MacosLauncher;
use tauri_plugin_sql::{Migration, MigrationKind};
#[cfg(target_os = "macos")]
use window_ext::WindowExt;
#[cfg(target_os = "macos")]
mod window_ext;
use tauri_plugin_theme::ThemePlugin;
use webpage::{Webpage, WebpageOptions};
#[derive(Clone, serde::Serialize)]
struct Payload {
@@ -23,35 +16,110 @@ struct Payload {
cwd: String,
}
#[derive(serde::Serialize)]
struct OpenGraphResponse {
title: String,
description: String,
url: String,
image: String,
}
async fn fetch_opengraph(url: String) -> OpenGraphResponse {
let options = WebpageOptions {
allow_insecure: false,
max_redirections: 3,
timeout: Duration::from_secs(15),
useragent: "lume - desktop app".to_string(),
..Default::default()
};
let result = match Webpage::from_url(&url, options) {
Ok(webpage) => webpage,
Err(_) => {
return OpenGraphResponse {
title: "".to_string(),
description: "".to_string(),
url: "".to_string(),
image: "".to_string(),
}
}
};
let html = result.html;
return OpenGraphResponse {
title: html
.opengraph
.properties
.get("title")
.cloned()
.unwrap_or_default(),
description: html
.opengraph
.properties
.get("description")
.cloned()
.unwrap_or_default(),
url: html
.opengraph
.properties
.get("url")
.cloned()
.unwrap_or_default(),
image: html
.opengraph
.images
.get(0)
.and_then(|i| Some(i.url.clone()))
.unwrap_or_default(),
};
}
#[tauri::command]
async fn opengraph(url: String) -> OpenGraphResponse {
let result = fetch_opengraph(url).await;
return result;
}
#[tauri::command]
fn secure_save(key: String, value: String) -> Result<(), ()> {
let entry = Entry::new("lume", &key).expect("Failed to create entry");
let _ = entry.set_password(&value);
Ok(())
}
#[tauri::command]
fn secure_load(key: String) -> Result<String, String> {
let entry = Entry::new("lume", &key).expect("Failed to create entry");
if let Ok(password) = entry.get_password() {
Ok(password)
} else {
Err("not found".to_string())
}
}
#[tauri::command]
fn secure_remove(key: String) -> Result<(), ()> {
let entry = Entry::new("lume", &key).expect("Failed to create entry");
let _ = entry.delete_password();
Ok(())
}
fn main() {
let mut ctx = tauri::generate_context!();
tauri::Builder::default()
.setup(|app| {
#[cfg(target_os = "macos")]
let main_window = app.get_window("main").unwrap();
#[cfg(target_os = "macos")]
main_window.position_traffic_lights(13.0, 17.0); // set inset for traffic lights (macos)
#[cfg(desktop)]
app
.handle()
.plugin(tauri_plugin_updater::Builder::new().build())?;
Ok(())
})
.on_window_event(|e| {
#[cfg(target_os = "macos")]
let apply_offset = || {
let win = e.window();
// keep inset for traffic lights when window resize (macos)
win.position_traffic_lights(13.0, 17.0);
};
#[cfg(target_os = "macos")]
match e.event() {
WindowEvent::Resized(..) => apply_offset(),
WindowEvent::ThemeChanged(..) => apply_offset(),
_ => {}
}
})
.plugin(ThemePlugin::init(ctx.config_mut()))
.plugin(
tauri_plugin_sql::Builder::default()
.add_migrations(
"sqlite:lume.db",
"sqlite:lume_v2.db",
vec![
Migration {
version: 20230418013219,
@@ -60,90 +128,35 @@ fn main() {
kind: MigrationKind::Up,
},
Migration {
version: 20230418080146,
description: "create chats",
sql: include_str!("../migrations/20230418080146_create_chats.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230420040005,
description: "insert last login to settings",
sql: include_str!("../migrations/20230420040005_insert_last_login_to_settings.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230425023912,
description: "add pubkey to channel",
sql: include_str!("../migrations/20230425023912_add_pubkey_to_channel.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230425024708,
description: "add default channels",
sql: include_str!("../migrations/20230425024708_add_default_channels.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230425050745,
description: "create blacklist",
sql: include_str!("../migrations/20230425050745_add_blacklist_model.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230521092300,
description: "create block",
sql: include_str!("../migrations/20230521092300_add_block_model.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230617003135,
description: "add channel messages",
sql: include_str!("../migrations/20230617003135_add_channel_messages.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230619082415,
description: "add replies",
sql: include_str!("../migrations/20230619082415_add_replies.sql"),
version: 20231028083224,
description: "add ndk cache table",
sql: include_str!("../migrations/20231028083224_add_ndk_cache_table.sql"),
kind: MigrationKind::Up,
},
],
)
.build(),
)
.plugin(
tauri_plugin_stronghold::Builder::new(|password| {
let config = argon2::Config {
lanes: 2,
mem_cost: 50_000,
time_cost: 30,
thread_mode: argon2::ThreadMode::from_threads(2),
variant: argon2::Variant::Argon2id,
..Default::default()
};
// let salt = Alphanumeric.sample_string(&mut rand::thread_rng(), 12);
let key = argon2::hash_raw(
password.as_ref(),
b"LUME_NEED_RUST_DEVELOPER_HELP_MAKE_SALT_RANDOM",
&config,
)
.expect("failed to hash password");
key.to_vec()
})
.build(),
)
.plugin(tauri_plugin_clipboard_manager::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_http::init())
.plugin(tauri_plugin_notification::init())
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_upload::init())
.plugin(tauri_plugin_window_state::Builder::default().build())
.plugin(tauri_plugin_autostart::init(
MacosLauncher::LaunchAgent,
Some(vec!["--flag1", "--flag2"]),
Some(vec![]),
))
.plugin(tauri_plugin_single_instance::init(|app, argv, cwd| {
println!("{}, {argv:?}, {cwd}", app.package_info().name);
app
.emit_all("single-instance", Payload { args: argv, cwd })
.unwrap();
}))
.run(tauri::generate_context!())
.invoke_handler(tauri::generate_handler![
opengraph,
secure_save,
secure_load,
secure_remove
])
.run(ctx)
.expect("error while running tauri application");
}

View File

@@ -1,60 +0,0 @@
use tauri::{Runtime, Window};
pub trait WindowExt {
#[cfg(target_os = "macos")]
fn set_transparent_titlebar(&self, transparent: bool);
fn position_traffic_lights(&self, x: f64, y: f64);
}
impl<R: Runtime> WindowExt for Window<R> {
#[cfg(target_os = "macos")]
fn set_transparent_titlebar(&self, transparent: bool) {
use cocoa::appkit::{NSWindow, NSWindowTitleVisibility};
let window = self.ns_window().unwrap() as cocoa::base::id;
unsafe {
window.setTitleVisibility_(NSWindowTitleVisibility::NSWindowTitleHidden);
if transparent {
window.setTitlebarAppearsTransparent_(cocoa::base::YES);
} else {
window.setTitlebarAppearsTransparent_(cocoa::base::NO);
}
}
}
#[cfg(target_os = "macos")]
fn position_traffic_lights(&self, x: f64, y: f64) {
use cocoa::appkit::{NSView, NSWindow, NSWindowButton};
use cocoa::foundation::NSRect;
let window = self.ns_window().unwrap() as cocoa::base::id;
unsafe {
let close = window.standardWindowButton_(NSWindowButton::NSWindowCloseButton);
let miniaturize = window.standardWindowButton_(NSWindowButton::NSWindowMiniaturizeButton);
let zoom = window.standardWindowButton_(NSWindowButton::NSWindowZoomButton);
let title_bar_container_view = close.superview().superview();
let close_rect: NSRect = msg_send![close, frame];
let button_height = close_rect.size.height;
let title_bar_frame_height = button_height + y;
let mut title_bar_rect = NSView::frame(title_bar_container_view);
title_bar_rect.size.height = title_bar_frame_height;
title_bar_rect.origin.y = NSView::frame(window).size.height - title_bar_frame_height;
let _: () = msg_send![title_bar_container_view, setFrame: title_bar_rect];
let window_buttons = vec![close, miniaturize, zoom];
let space_between = NSView::frame(miniaturize).origin.x - NSView::frame(close).origin.x;
for (i, button) in window_buttons.into_iter().enumerate() {
let mut rect: NSRect = NSView::frame(button);
rect.origin.x = x + (i as f64 * space_between);
button.setFrameOrigin(rect.origin);
}
}
}
}

View File

@@ -1,145 +1,93 @@
{
"build": {
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "pnpm build",
"devPath": "http://localhost:3000",
"distDir": "../dist",
"withGlobalTauri": true
},
"package": {
"productName": "Lume",
"version": "1.0.1"
},
"tauri": {
"allowlist": {
"all": false,
"app": {
"all": false
},
"os": {
"all": true
},
"http": {
"all": true,
"request": true,
"scope": ["http://**", "https://**"]
},
"fs": {
"all": false,
"readFile": true,
"readDir": true,
"scope": [
"$APPDATA/*",
"$DATA/*",
"$LOCALDATA/*",
"$DESKTOP/*",
"$DOCUMENT/*",
"$DOWNLOAD/*",
"$HOME/*",
"$PICTURE/*",
"$PUBLIC/*",
"$VIDEO/*"
]
},
"path": {
"all": true
},
"shell": {
"all": false,
"open": true
},
"clipboard": {
"all": false,
"writeText": true,
"readText": true
},
"dialog": {
"all": false,
"open": true
},
"notification": {
"all": true
},
"window": {
"startDragging": true,
"close": true
},
"process": {
"all": false,
"exit": false,
"relaunch": true,
"relaunchDangerousAllowSymlinkMacos": false
}
},
"bundle": {
"active": true,
"category": "SocialNetworking",
"copyright": "",
"appimage": {
"bundleMediaFramework": true
},
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "com.lume.nu",
"longDescription": "",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": "upgrade-insecure-requests"
},
"updater": {
"active": true,
"dialog": true,
"endpoints": [
"https://lus.reya3772.workers.dev/v1/{{target}}/{{arch}}/{{current_version}}",
"https://lus.reya3772.workers.dev/{{target}}/{{current_version}}"
],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU4RjAzODFBREQ4MkM3RTEKUldUaHg0TGRHamp3NkI5bnhoOEVjanlHWFNzQ2Q3NDhubFFLUmJpSHJ1L2FqNnB3alF1Y2R3U3gK",
"windows": {
"installMode": "passive"
}
},
"systemTray": {
"iconPath": "icons/icon.png",
"iconAsTemplate": true
},
"windows": [
{
"title": "Lume",
"theme": "Dark",
"titleBarStyle": "Overlay",
"hiddenTitle": true,
"transparent": false,
"fullscreen": false,
"resizable": true,
"width": 1080,
"height": 800,
"minWidth": 1080,
"minHeight": 720
}
]
}
}
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": {
"beforeBuildCommand": "pnpm run build",
"beforeDevCommand": "pnpm run dev",
"devPath": "http://localhost:3000",
"distDir": "../dist",
"withGlobalTauri": true
},
"package": {
"productName": "Lume",
"version": "2.1.3"
},
"plugins": {
"fs": {
"scope": [
"$APPDATA/*",
"$DATA/*",
"$LOCALDATA/*",
"$DESKTOP/*",
"$DOCUMENT/*",
"$DOWNLOAD/*",
"$HOME/*",
"$PICTURE/*",
"$PUBLIC/*",
"$VIDEO/*"
]
},
"http": {
"scope": [
"http://**/",
"https://**/"
]
},
"shell": {
"open": true
},
"updater": {
"endpoints": [
"https://lus.reya3772.workers.dev/v1/{{target}}/{{arch}}/{{current_version}}",
"https://lus.reya3772.workers.dev/{{target}}/{{current_version}}"
]
}
},
"tauri": {
"bundle": {
"active": true,
"category": "SocialNetworking",
"deb": {
"depends": []
},
"externalBin": [],
"resources": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"copyright": "",
"identifier": "com.lume.nu",
"longDescription": "The communication app build on Nostr Protocol",
"shortDescription": "",
"targets": "all",
"updater": {
"active": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU3OTdCMkM3RjU5QzE2NzkKUldSNUZwejF4N0tYNTVHYjMrU0JkL090SlEyNUVLYU5TM2hTU3RXSWtEWngrZWJ4a0pydUhXZHEK",
"windows": {
"installMode": "quiet"
}
},
"appimage": {
"bundleMediaFramework": true
},
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"license": "../LICENSE",
"minimumSystemVersion": "10.15.0",
"providerShortName": null,
"signingIdentity": null
},
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"macOSPrivateApi": true
}
}

View File

@@ -0,0 +1,21 @@
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"tauri": {
"windows": [
{
"width": 1080,
"height": 800,
"minWidth": 560,
"minHeight": 800,
"resizable": true,
"title": "Lume",
"center": true,
"fullscreen": false,
"hiddenTitle": true,
"fileDropEnabled": true,
"decorations": false,
"transparent": false
}
]
}
}

View File

@@ -0,0 +1,25 @@
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"tauri": {
"windows": [
{
"width": 1080,
"height": 800,
"minWidth": 560,
"minHeight": 800,
"resizable": true,
"title": "Lume",
"titleBarStyle": "Overlay",
"center": true,
"fullscreen": false,
"hiddenTitle": true,
"fileDropEnabled": true,
"decorations": true,
"transparent": true,
"windowEffects": {
"effects": ["sidebar"]
}
}
]
}
}

View File

@@ -0,0 +1,24 @@
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"tauri": {
"windows": [
{
"width": 1080,
"height": 800,
"minWidth": 560,
"minHeight": 800,
"resizable": true,
"title": "Lume",
"center": true,
"fullscreen": false,
"hiddenTitle": true,
"fileDropEnabled": true,
"decorations": false,
"transparent": true,
"windowEffects": {
"effects": ["micaLight", "micaDark"]
}
}
]
}
}

70
src/app.css Normal file
View File

@@ -0,0 +1,70 @@
@import 'reactflow/dist/style.css';
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer utilities {
.break-p {
word-break: break-word;
word-wrap: break-word;
overflow-wrap: break-word;
}
.prose :where(iframe):not(:where([class~="not-prose"] *)) {
@apply aspect-video w-full h-auto mx-auto;
}
}
html {
font-size: 14px;
}
a {
@apply cursor-default no-underline !important;
}
button {
@apply cursor-default focus:outline-none;
}
input::-ms-reveal,
input::-ms-clear {
display: none;
}
::-webkit-input-placeholder {
line-height: normal;
}
.border {
background-clip: padding-box;
}
.player {
--brand-color: #f5f5f5;
--focus-color: #4e9cf6;
--audio-brand: var(--brand-color);
--audio-focus-ring-color: var(--focus-color);
--audio-border-radius: 2px;
--video-brand: var(--brand-color);
--video-focus-ring-color: var(--focus-color);
--video-border-radius: 8px;
width: 100%;
}
.player[data-view-type='video'] {
aspect-ratio: 16 /9;
}
.ProseMirror p.is-empty::before {
@apply text-neutral-600 dark:text-neutral-400;
content: attr(data-placeholder);
float: left;
height: 0;
pointer-events: none;
}
.ProseMirror img.ProseMirror-selectednode {
@apply outline-blue-500;
}

View File

@@ -1,114 +1,302 @@
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
import { message } from '@tauri-apps/plugin-dialog';
import { fetch } from '@tauri-apps/plugin-http';
import { RouterProvider, createBrowserRouter, defer, redirect } from 'react-router-dom';
import { ReactFlowProvider } from 'reactflow';
import { AuthCreateScreen } from '@app/auth/create';
import { CreateStep1Screen } from '@app/auth/create/step-1';
import { CreateStep2Screen } from '@app/auth/create/step-2';
import { CreateStep3Screen } from '@app/auth/create/step-3';
import { CreateStep4Screen } from '@app/auth/create/step-4';
import { CreateStep5Screen } from '@app/auth/create/step-5';
import { AuthImportScreen } from '@app/auth/import';
import { ImportStep1Screen } from '@app/auth/import/step-1';
import { ImportStep2Screen } from '@app/auth/import/step-2';
import { ImportStep3Screen } from '@app/auth/import/step-3';
import { MigrateScreen } from '@app/auth/migrate';
import { OnboardingScreen } from '@app/auth/onboarding';
import { UnlockScreen } from '@app/auth/unlock';
import { WelcomeScreen } from '@app/auth/welcome';
import { ChannelScreen } from '@app/channel';
import { ChatScreen } from '@app/chat';
import { ChatsScreen } from '@app/chats';
import { ErrorScreen } from '@app/error';
import { NoteScreen } from '@app/note';
import { Root } from '@app/root';
import { AccountSettingsScreen } from '@app/settings/account';
import { GeneralSettingsScreen } from '@app/settings/general';
import { ShortcutsSettingsScreen } from '@app/settings/shortcuts';
import { SpaceScreen } from '@app/space';
import { TrendingScreen } from '@app/trending';
import { UserScreen } from '@app/user';
import { ExploreScreen } from '@app/explore';
import { AppLayout } from '@shared/appLayout';
import { AuthLayout } from '@shared/authLayout';
import { Protected } from '@shared/protected';
import { SettingsLayout } from '@shared/settingsLayout';
import { useStorage } from '@libs/storage/provider';
import './index.css';
import { LoaderIcon } from '@shared/icons';
import { AppLayout } from '@shared/layouts/app';
import { AuthLayout } from '@shared/layouts/auth';
import { NewLayout } from '@shared/layouts/new';
import { NoteLayout } from '@shared/layouts/note';
import { SettingsLayout } from '@shared/layouts/settings';
const router = createBrowserRouter([
{
path: '/',
element: (
<Protected>
<Root />
</Protected>
),
errorElement: <ErrorScreen />,
},
{
path: '/auth',
element: <AuthLayout />,
children: [
{ path: 'welcome', element: <WelcomeScreen /> },
{ path: 'onboarding', element: <OnboardingScreen /> },
{
path: 'import',
element: <AuthImportScreen />,
children: [
{ path: '', element: <ImportStep1Screen /> },
{ path: 'step-2', element: <ImportStep2Screen /> },
{ path: 'step-3', element: <ImportStep3Screen /> },
],
},
{
path: 'create',
element: <AuthCreateScreen />,
children: [
{ path: '', element: <CreateStep1Screen /> },
{ path: 'step-2', element: <CreateStep2Screen /> },
{ path: 'step-3', element: <CreateStep3Screen /> },
{ path: 'step-4', element: <CreateStep4Screen /> },
{ path: 'step-5', element: <CreateStep5Screen /> },
],
},
{ path: 'unlock', element: <UnlockScreen /> },
{ path: 'migrate', element: <MigrateScreen /> },
],
},
{
path: '/app',
element: (
<Protected>
<AppLayout />
</Protected>
),
children: [
{ path: 'space', element: <SpaceScreen /> },
{ path: 'trending', element: <TrendingScreen /> },
{ path: 'note/:id', element: <NoteScreen /> },
{ path: 'user/:pubkey', element: <UserScreen /> },
{ path: 'chat/:pubkey', element: <ChatScreen /> },
{ path: 'channel/:id', element: <ChannelScreen /> },
],
},
{
path: '/settings',
element: (
<Protected>
<SettingsLayout />
</Protected>
),
children: [
{ path: 'general', element: <GeneralSettingsScreen /> },
{ path: 'shortcuts', element: <ShortcutsSettingsScreen /> },
{ path: 'account', element: <AccountSettingsScreen /> },
],
},
]);
import './app.css';
export default function App() {
const { db } = useStorage();
const accountLoader = async () => {
try {
// redirect to welcome screen if none user exist
const totalAccount = await db.checkAccount();
if (totalAccount === 0) return redirect('/auth/welcome');
return null;
} catch (e) {
await message(e, { title: 'An unexpected error has occurred', type: 'error' });
}
};
const relayLoader = async ({ params }) => {
return defer({
relay: fetch(`https://${params.url}`, {
method: 'GET',
headers: {
Accept: 'application/nostr+json',
},
}).then((res) => res.json()),
});
};
const router = createBrowserRouter([
{
path: '/',
element: <AppLayout />,
errorElement: <ErrorScreen />,
loader: accountLoader,
children: [
{
path: '',
async lazy() {
const { HomeScreen } = await import('@app/home');
return { Component: HomeScreen };
},
},
{
path: 'users/:pubkey',
async lazy() {
const { UserScreen } = await import('@app/users');
return { Component: UserScreen };
},
},
{
path: 'nwc',
async lazy() {
const { NWCScreen } = await import('@app/nwc');
return { Component: NWCScreen };
},
},
{
path: 'relays',
async lazy() {
const { RelaysScreen } = await import('@app/relays');
return { Component: RelaysScreen };
},
},
{
path: 'relays/:url',
loader: relayLoader,
async lazy() {
const { RelayScreen } = await import('@app/relays/relay');
return { Component: RelayScreen };
},
},
{
path: 'explore',
element: (
<ReactFlowProvider>
<ExploreScreen />
</ReactFlowProvider>
),
errorElement: <ErrorScreen />,
},
{
path: 'chats',
element: <ChatsScreen />,
errorElement: <ErrorScreen />,
children: [
{
path: 'chat/:pubkey',
async lazy() {
const { ChatScreen } = await import('@app/chats/chat');
return { Component: ChatScreen };
},
},
],
},
],
},
{
path: '/new',
element: <NewLayout />,
errorElement: <ErrorScreen />,
children: [
{
path: '',
async lazy() {
const { NewPostScreen } = await import('@app/new/post');
return { Component: NewPostScreen };
},
},
{
path: 'article',
async lazy() {
const { NewArticleScreen } = await import('@app/new/article');
return { Component: NewArticleScreen };
},
},
{
path: 'file',
async lazy() {
const { NewFileScreen } = await import('@app/new/file');
return { Component: NewFileScreen };
},
},
{
path: 'privkey',
async lazy() {
const { NewPrivkeyScreen } = await import('@app/new/privkey');
return { Component: NewPrivkeyScreen };
},
},
],
},
{
path: '/notes',
element: <NoteLayout />,
errorElement: <ErrorScreen />,
children: [
{
path: 'text/:id',
async lazy() {
const { TextNoteScreen } = await import('@app/notes/text');
return { Component: TextNoteScreen };
},
},
{
path: 'article/:id',
async lazy() {
const { ArticleNoteScreen } = await import('@app/notes/article');
return { Component: ArticleNoteScreen };
},
},
],
},
{
path: '/auth',
element: <AuthLayout />,
errorElement: <ErrorScreen />,
children: [
{
path: 'welcome',
async lazy() {
const { WelcomeScreen } = await import('@app/auth/welcome');
return { Component: WelcomeScreen };
},
},
{
path: 'create',
async lazy() {
const { CreateAccountScreen } = await import('@app/auth/create');
return { Component: CreateAccountScreen };
},
},
{
path: 'import',
async lazy() {
const { ImportAccountScreen } = await import('@app/auth/import');
return { Component: ImportAccountScreen };
},
},
{
path: 'onboarding',
element: <OnboardingScreen />,
errorElement: <ErrorScreen />,
children: [
{
path: '',
async lazy() {
const { OnboardingListScreen } = await import(
'@app/auth/onboarding/list'
);
return { Component: OnboardingListScreen };
},
},
{
path: 'enrich',
async lazy() {
const { OnboardEnrichScreen } = await import(
'@app/auth/onboarding/enrich'
);
return { Component: OnboardEnrichScreen };
},
},
{
path: 'hashtag',
async lazy() {
const { OnboardHashtagScreen } = await import(
'@app/auth/onboarding/hashtag'
);
return { Component: OnboardHashtagScreen };
},
},
],
},
],
},
{
path: '/settings',
element: <SettingsLayout />,
errorElement: <ErrorScreen />,
children: [
{
path: '',
async lazy() {
const { UserSettingScreen } = await import('@app/settings');
return { Component: UserSettingScreen };
},
},
{
path: 'edit-profile',
async lazy() {
const { EditProfileScreen } = await import('@app/settings/editProfile');
return { Component: EditProfileScreen };
},
},
{
path: 'edit-contact',
async lazy() {
const { EditContactScreen } = await import('@app/settings/editContact');
return { Component: EditContactScreen };
},
},
{
path: 'general',
async lazy() {
const { GeneralSettingScreen } = await import('@app/settings/general');
return { Component: GeneralSettingScreen };
},
},
{
path: 'backup',
async lazy() {
const { BackupSettingScreen } = await import('@app/settings/backup');
return { Component: BackupSettingScreen };
},
},
{
path: 'advanced',
async lazy() {
const { AdvancedSettingScreen } = await import('@app/settings/advanced');
return { Component: AdvancedSettingScreen };
},
},
{
path: 'about',
async lazy() {
const { AboutScreen } = await import('@app/settings/about');
return { Component: AboutScreen };
},
},
],
},
]);
return (
<RouterProvider
router={router}
fallbackElement={<p>Loading..</p>}
fallbackElement={
<div className="flex h-full w-full items-center justify-center">
<LoaderIcon className="h-6 w-6 animate-spin text-white" />
</div>
}
future={{ v7_startTransition: true }}
/>
);

View File

@@ -0,0 +1,50 @@
import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';
import { CheckCircleIcon } from '@shared/icons';
import { useOnboarding } from '@stores/onboarding';
export function AllowNotification() {
const [notification, setNotification] = useOnboarding((state) => [
state.notification,
state.toggleNotification,
]);
const allow = async () => {
let permissionGranted = await isPermissionGranted();
if (!permissionGranted) {
const permission = await requestPermission();
permissionGranted = permission === 'granted';
}
if (permissionGranted) {
setNotification();
}
};
return (
<div className="rounded-xl bg-neutral-100 p-3 text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200">
<div className="flex items-start justify-between gap-2">
<div>
<h5 className="font-semibold">Allow notification</h5>
<p className="text-sm">
By allowing Lume to send notifications in your OS settings, you will receive
notification messages when someone interacts with you or your content.
</p>
</div>
{notification ? (
<div className="mt-1 inline-flex h-9 w-24 shrink-0 items-center justify-center rounded-lg bg-teal-500 text-white">
<CheckCircleIcon className="h-4 w-4" />
</div>
) : (
<button
type="button"
onClick={allow}
className="mt-1 inline-flex h-9 w-24 shrink-0 items-center justify-center rounded-lg bg-neutral-200 font-medium hover:bg-blue-500 hover:text-white dark:bg-neutral-800"
>
Allow
</button>
)}
</div>
</div>
);
}

View File

@@ -0,0 +1,100 @@
import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk';
import { LRUCache } from 'lru-cache';
import { useState } from 'react';
import { toast } from 'sonner';
import { useNDK } from '@libs/ndk/provider';
import { useStorage } from '@libs/storage/provider';
import { CheckCircleIcon, LoaderIcon } from '@shared/icons';
import { useOnboarding } from '@stores/onboarding';
export function Circle() {
const { db } = useStorage();
const { ndk } = useNDK();
const [circle, setCircle] = useOnboarding((state) => [
state.circle,
state.toggleCircle,
]);
const [loading, setLoading] = useState(false);
const enableLinks = async () => {
setLoading(true);
const users = ndk.getUser({ pubkey: db.account.pubkey });
const follows = await users.follows();
if (follows.size === 0) {
setLoading(false);
return toast('You need to follow at least 1 account');
}
const lru = new LRUCache<string, string, void>({ max: 300 });
const followsAsArr = [];
// add user's follows to lru
follows.forEach((user) => {
lru.set(user.pubkey, user.pubkey);
followsAsArr.push(user.pubkey);
});
// get follows from follows
const events = await ndk.fetchEvents({
kinds: [NDKKind.Contacts],
authors: followsAsArr,
limit: 300,
});
events.forEach((event: NDKEvent) => {
event.tags.forEach((tag) => {
if (tag[0] === 'p') lru.set(tag[1], tag[1]);
});
});
// get lru values
const circleList = [...lru.values()] as string[];
// update db
await db.updateAccount('follows', JSON.stringify(followsAsArr));
await db.updateAccount('circles', JSON.stringify(circleList));
db.account.follows = followsAsArr;
db.account.circles = circleList;
// clear lru
lru.clear();
// done
await db.createSetting('circles', '1');
setCircle();
};
return (
<div className="rounded-xl bg-neutral-100 p-3 text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200">
<div className="flex items-start justify-between gap-2">
<div>
<h5 className="font-semibold">Enable Circle</h5>
<p className="text-sm">
Beside newsfeed from your follows, you will see more content from all people
that followed by your follows.
</p>
</div>
{circle ? (
<div className="mt-1 inline-flex h-9 w-24 shrink-0 items-center justify-center rounded-lg bg-teal-500 text-white">
<CheckCircleIcon className="h-4 w-4" />
</div>
) : (
<button
type="button"
onClick={enableLinks}
className="mt-1 inline-flex h-9 w-24 shrink-0 items-center justify-center rounded-lg bg-neutral-200 font-medium hover:bg-blue-500 hover:text-white dark:bg-neutral-800"
>
{loading ? <LoaderIcon className="h-4 w-4 animate-spin" /> : 'Enable'}
</button>
)}
</div>
</div>
);
}

View File

@@ -0,0 +1,47 @@
import { useStorage } from '@libs/storage/provider';
import { CheckCircleIcon } from '@shared/icons';
import { useOnboarding } from '@stores/onboarding';
export function OutboxModel() {
const { db } = useStorage();
const [outbox, setOutbox] = useOnboarding((state) => [
state.outbox,
state.toggleOutbox,
]);
const enableOutbox = async () => {
await db.createSetting('outbox', '1');
setOutbox();
};
return (
<div className="rounded-xl bg-neutral-100 p-3 text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200">
<div className="flex items-start justify-between gap-2">
<div>
<h5 className="font-semibold">Enable Outbox (experiment)</h5>
<p className="text-sm">
When you request information about a user, Lume will automatically query the
user&apos;s outbox relays and subsequent queries will favour using those
relays for queries with that user&apos;s pubkey.
</p>
</div>
{outbox ? (
<div className="mt-1 inline-flex h-9 w-24 shrink-0 items-center justify-center rounded-lg bg-teal-500 text-white">
<CheckCircleIcon className="h-4 w-4" />
</div>
) : (
<button
type="button"
onClick={enableOutbox}
className="mt-1 inline-flex h-9 w-24 shrink-0 items-center justify-center rounded-lg bg-neutral-200 font-medium hover:bg-blue-500 hover:text-white dark:bg-neutral-800"
>
Enable
</button>
)}
</div>
</div>
);
}

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