Commit Graph

196 Commits

Author SHA1 Message Date
Felicio Mununga 665d2df7e8
Setup apps/website (#383)
* scaffold website project with Next.js

* set tamagui target

* remove whitespace

* update clean npm scripts

* apply patches post-install

* lock tamagui version

* add patch-package to root

* patch @tamagui/core-node

* patch @tamagui/normalize-css-color

* patch @achingbrain/ssdp

* remove patches from website

* update clean script in website

* remove @tamagui/vite-plugin from dependencies

* patch @tamagui/static

* update node-version

* define env vars
2023-04-26 12:06:18 +02:00
Felicio Mununga adac3ad25e
format files 2023-04-17 12:17:23 +02:00
Felicio Mununga a0406e834a
add `happy-dom` to `@status-im/js` 2023-04-06 17:22:04 +02:00
Pavel Prichodko a9e9682ed0
rename typegen -> build:types 2023-03-14 13:49:33 +01:00
Pavel Prichodko 47308ca5c3
unify package.jsons 2023-03-13 21:48:42 +01:00
Pavel Prichodko 1042d1acfd
replace rm with rimraf 2023-01-20 15:27:05 +01:00
Felicio Mununga a0d3277733
Add `ethers` and resolve chat key from ENS name (#357)
* add `ethers`

* add `resolveChatKey`
2023-04-04 14:10:56 +02:00
Felicio Mununga 3dbd022f47
encode only community's name in channel URL (#358) 2023-04-04 14:10:43 +02:00
Felicio Mununga 60413bf39b
add unverified URL data test case 2023-03-21 12:42:37 +01:00
Felicio Mununga 67b12fceb0
Add url data encoding (#345)
* add @scure/base

* add link-preview.proto

* add prototype of encode function

* add tests

* add test cases

* update proto

* more

* more

* add missing community chat description to proto

* more

* more

* add browser brotli and lz-string

* move encoding comparison

* add sinlge encoding

* split encoding

* add decoding

* update .prettierignore

* exclude comparison

* remove comparison tests

* Update packages/status-js/src/utils/encode-url-data.test.ts

* Update packages/status-js/src/utils/encode-url-data.test.ts

* remove checksum

* ensure channel is serializable

* Update .prettierignore

* update protos

* add creaet-url.ts

* set links

* comment

* update protos

* add nominal type for EncodedUrlData

* add sign/verify fns

* export fns from index

* set zlib as external module

* add tag indices

* encode channel uuid

* use `.toJson()` with type assertion

* use uppercase url

* split url creating fns

* fix typo

* describe test suite

* use getters

* fix nominal type

* remove `node:` prefix from `zlib` import

* remove todos?:

* rename URLProps to URLParams

* fix package.json after rebase
2023-03-21 11:05:59 +01:00
Felicio Mununga d832a0c283
Add request client (#342)
* add `preview-client.ts`

* add exports

* fix imports

* set emoji hash

* use `message.timestamp`

* rename `RequestClient`

* drop preview keyword

* rm `appUrl`

* rm todo?:

* remove social urls

* remove if clause
2023-03-15 14:14:26 +01:00
Felicio Mununga 6b3ef713e9
Add public key deserialization (#341)
* add `multiformats` dep

* add `deserialize-public-key.ts`

* compress by default

* add tests

* Update packages/status-js/src/utils/deserialize-public-key.ts

Co-authored-by: Pavel <14926950+prichodko@users.noreply.github.com>

* rename vars

---------

Co-authored-by: Pavel <14926950+prichodko@users.noreply.github.com>
2023-02-23 16:48:31 +01:00
Felicio Mununga 1faeb69ac1
Add emoji hash function (#343)
* add emojis

* add func

* add tests
2023-02-21 14:26:42 +01:00
Felicio Mununga 16edb12048
remove `long` 2023-02-21 13:57:25 +01:00
Felicio Mununga 942146d0be
Use `@bufbuild` (#337)
* remove old `communities.proto`

* fix `protos` npm script

* apply `protos` changes overwriting `Record<>` patches

* update proto files

* regenerate files

* update `protons*` packages

* regen files

* use `protons` generate communities

* add `@bufbuild*` packages

* update `buf` yaml files

* generate `@bufbuild` files

* use `@bufbuild` files

* format

* remove `protobufjs`

* remove `protons`

* resolve build errors

* fix image content type
2023-02-21 12:34:48 +01:00
Felicio Mununga 587a0786ad
add `decompress-public-key.ts` (#336) 2023-02-10 10:09:42 +01:00
Felicio Mununga 8bebe944e7
dispatch `CONNECT` 2022-11-28 03:02:25 +01:00
Felicio Mununga cd0f10d94e
remove codec eval from `connectionManager` listener 2022-11-28 00:11:19 +01:00
Felicio Mununga 5cef43991f
add `libp2p` connection listeners 2022-11-27 23:54:43 +01:00
Felicio Mununga 3d5c490185
move `wakuDisconnectionTimer` to constructor 2022-11-27 22:52:24 +01:00
Felicio Mununga 8e61ebf90c
change `wakuDisconnectionTimer` to handle light protocols 2022-11-27 17:45:56 +01:00
Felicio Mununga 86ac150626
dispatch `FAIL`
- stops client on failed initialization
- displays failed message
2022-11-27 17:07:58 +01:00
Felicio Mununga d35c311096
specify protocols in waitForRemotePeer 2022-11-17 02:47:57 +01:00
Felicio Mununga a2550b61d7
set pingKeepAlive to aid in connection recovery 2022-11-16 23:45:42 +01:00
Felicio Mununga 4590d4b852
Use WakuLight 2022-11-15 01:47:56 +01:00
Felicio Mununga 48d7f34803
Use MessageV1 type 2022-11-15 00:59:16 +01:00
Felicio Mununga d68409eb6f
Install `js-waku@^0.30.0` 2022-11-14 23:06:34 +01:00
Pavel Prichodko 27430ce846
v0.1.1 2022-10-09 18:58:52 -05:00
Pavel Prichodko 9379dc6078
fix account restoration 2022-10-09 18:26:11 -05:00
Pavel Prichodko 3896ea8f6e
v0.1.0 2022-10-07 22:09:04 +02:00
Pavel 95dc03b99f
Fetch history (#292) 2022-10-07 21:30:22 +02:00
Pavel 213ca26877
Add persistence of throwaway accounts (#315)
* add account membership status

* add storage and account listeners

* update membership

* update ui

* update membership status value

* use boolean instead of undefined

* rename callback function

* remove noise

* listeners -> callbacks

* update storage

* lint issue workaround

* update account storing
2022-10-07 20:05:09 +02:00
Felicio Mununga 36322d5a41
Add Activity Center (#312)
* add activityCenter.ts

* use activityCenter.ts

* add "Launch via Vite Node"

* remove comments

* add comments

* type hook

* reverse order of notifications

* remove `activityCenter` from `provider.tsx`

* set `count`'s default value

* ref `ChatMessage` by id instead of object reference

* Revert "ref `ChatMessage` by id instead of object reference"

This reverts commit 1284386d22.

* add badge `totalCount`

* add `@radix-ui/react-tabs`

* skip non-mentions

* update comments

* add `member` to `ChatMessage`

* add `MarkAllAsReadIcon`

* add `40` avatar variant

* add `initialsCount` to `Avatar`

* add `TinyReplyIcon`

* use `Popover`

* move components

* move components

* wip

* ignore clicks on tags themselves

* add root route

* use chat display name

* fix icons

* use `asChild` for tabs

* remove `vertical`

* use `value` and `onValueChange`

* use active state with `compoundVariants`

* use `&[data-state]...` instead of `compoundVarinats` and `active` prop

* fixup `chatDisplayName`

* postion badge

* prevent dragging of the whole page in either direction

* add tooltips

* change message's background on hover

* change navigation style

* add `category` to `removeNotifications`

* prevent deleting of messages that are not mentions or replies from activity center

* show members sidebar by default

* fix members layout

* add comment

* add `date-fns`

* add date separator

* comment

* move `Badge` to `/system`

* move `Tag` to `/system`

* comment `Text`

* replace `Link` for `useNavigate`

* move `Activity` to `/system`

* comment

* export `Notification`

* update fixtures in `activityCenter`

* remove fixtures

* movet `Tabs` to `/system`

* update `mapChatMessage`

* update `.eslintignore`

* resolve typecheck errors

* update `.prettierignore`

* resolve formatting error

* upgrade tooltip

* use `scrollIntoView`

* remove comments

* rename `close` to `onNavigateChange`

* revert scrolling changes in `/member-sidebar`

* rename members label from `Online` to `All`

* rename `initialsCount` and use union

* rename `MarkAllAsReadIcon`

* rename `selected`

* fix typo

* revert formatting

* close `Avatar`

* use `css` where possible without changing elements

* extract props types to interfaces

* rename `ActivityCenter`

* remove `overflow`

* replace `style` for not yet stitched elements

* revert global style changes
2022-10-07 20:02:17 +02:00
Felicio Mununga 788fe3ba34
Add predefined nodes (#313) 2022-10-05 16:28:54 +02:00
Felicio Mununga a083d3251b
Install `js-waku@^0.25.0` (#307)
* install `js-waku@^0.24.0`

* install `js-waku@^0.25.0`

* resolve some breaking changes

* add timeout

* upgrade `eslint-import-resolver-typescript`

* add `process.env.VITEST` condition

* increase timeout

* fixup

* ignore `emitSelf`

* replace `parcel` with `vite`

* update `.gitignore`

* change `dev` npm script

* fix favicon href

* load `.env` files

* remove 'alias"

* add `preview`

* upgrade vite

* set `target`s in `vite.config.ts`

* upgrade `@vitejs/plugin-react`

* remove comment

* Update package.json

* Update vite.config.ts
2022-09-16 16:27:47 +02:00
Felicio Mununga abd26c9c1d
Indicate unread chats and mentions (#303)
* add activityCenter.ts

* use `process.env.VITEST`

* add `isMention` and `isReply`

* use activityCenter.ts

* fix initial `count`

* add `Badge` component

* add "Launch via Vite Node"

* remove comments

* remove `console.log`

* add comments

* type hook

* reverse order of notifications

* remove `activityCenter` from `provider.tsx`

* set `count`'s default value

* ref `ChatMessage` by id instead of object reference

* Revert "ref `ChatMessage` by id instead of object reference"

This reverts commit 1284386d22.

* use `isAuthor`
2022-09-16 15:49:20 +02:00
Felicio Mununga 62c499c50f
fix community fetching on `js-waku`'s abort 2022-09-05 18:03:17 +02:00
Pavel e1c4f0591d
Use built-in PBKDF2 implementation for browsers (#295)
* add pbkdf2 browser implementation

* use webcrypto in pbkdf2

* rename pbkdf2 file

* use pbkdf2

* add changeset

* revert rename

* remove browser field from package.json

* use `resolve.alias` for pbkdf2 if test

* use `mode` in vite.config.ts

Co-authored-by: Felicio Mununga <felicio@users.noreply.github.com>
2022-07-19 17:45:29 +02:00
Felicio Mununga 82625fe6db
Get peer based on environment (#294)
* get peer based on environment

* add changeset

* default to prod
2022-07-19 10:19:46 +02:00
Felicio Mununga c4f052f71a
set `"access": "public"` for publishing 2022-07-06 15:37:35 +02:00
Pavel Prichodko f59b38a3e4
remove unnecessary configuration 2022-07-01 15:22:26 +02:00
Pavel Prichodko 4ff961a6ae
export Reactions type from status-js 2022-07-01 15:20:23 +02:00
Felicio Mununga d225623df9
v0.1.0-alpha.2 2022-06-30 17:03:12 +02:00
Felicio Mununga d4fb2e4d95
send request on creating account 2022-06-30 16:34:50 +02:00
Felicio Mununga 1b89774ad1
v0.1.0-alpha.1 2022-06-30 16:02:34 +02:00
Felicio Mununga 1f19d61193
Reestablish peer connection on silent stream destruction (#288) 2022-06-30 15:12:26 +02:00
Felicio Mununga 2f3ac73e5e
Set clocks (#284)
* add clock functions

* remove bind
2022-06-30 15:11:13 +02:00
Pavel 0677fedc0e
Setup GitHub Actions (#287)
* add new GitHub Action for CI

* add yarn flag

* use actions v3

* add ci badge (lol)

* cache lint and format scripts

* add more steps

* remove unused component

* fix lint errors

* remove unsued eslint plugins
2022-06-29 16:46:51 +02:00
Pavel Prichodko df6b52736e
set mode to development during dev 2022-06-28 16:54:21 +02:00
Pavel 680ce2f79b
Move to ESM, Vite, Vitest and Turborepo (#286)
* fix example hot module replacement

* add turbo

* migrate to vite

* use turbo for running scripts

* migrate testing to vitest

* set yarn in settings.json

* set noEmit in base tsconfig

* update yarn.lock

* move protos to src

* remove relative paths from status-js

* remove unused files

* update declaration dir

* use vite-node as a debugging runtime

* fix test

* unify tests

* fix test case typo
2022-06-28 16:40:39 +02:00
Felicio Mununga 36f448cb96
Fix key and topic generation, and remove dependencies (#285)
* update yarn.lock

* remove modules

* move client

* move account

* revert chat_identity.ts

* fix key gen

* fix topic gen

* fix non-null assertion

* fix build errors
2022-06-24 17:39:09 +02:00
Felicio Mununga fed1dd210f
Update messages data structure (#278)
* Update messages data structure

* remove setting of DeletedChatMessage

* delete unathorized events

* use event pks

* remove comment

* remove else

* fix ui

* fix more ui

* fix sendReaction
2022-06-23 16:47:14 +02:00
Felicio Mununga 0a30fe0cf6
Check owner, member and author prior handling (#283)
* check owner, member and author

* fix isOwner
2022-06-22 13:30:24 +02:00
Felicio Mununga cb88ee7a62
handle only MessageType.COMMUNITY_CHAT (#281) 2022-06-21 09:17:15 +02:00
Felicio Mununga 66628d9c34
rename communit callbacks 2022-06-17 14:09:43 +02:00
Felicio Mununga 7d720018f5
remove success flag from message handler 2022-06-17 14:06:17 +02:00
Felicio Mununga c2ecb7ed78
support multiple community description callbacks (#280) 2022-06-17 09:36:43 +02:00
Felicio Mununga fb78bc5dc8
Wrap decoding in try...catch (#279) 2022-06-17 09:35:40 +02:00
Pavel Prichodko f22d744732
fix: creation of message ID 2022-06-15 15:19:28 +02:00
Pavel Prichodko 36aeebb629
add link to generateUsername util 2022-06-15 13:39:29 +02:00
Pavel Prichodko cac8fe58be
use concatBytes in payloadToId
https://jsben.ch/jze3P
2022-06-15 13:38:44 +02:00
Pavel 72d1e679fc
Add more chat methods (#276)
* add requestToJoin method

* add editMessage method

* add deleteMessage method

* add todos

* remove unnecessary parameter

* add community ID property

* add missing method
2022-06-15 11:51:56 +02:00
Pavel Prichodko 112cd0d9ab
add rationale comment 2022-06-15 11:45:50 +02:00
Pavel 83777e9759
Update handling of reactions (#277)
* fix: reactions argument in callback

* replace object with Set in reactions

* update reactions in UI
2022-06-15 11:30:43 +02:00
Pavel c50b32546b
Handle emoji content type (#275)
* add containsOnly emoji helper

* add emoji check when sending text message
2022-06-15 11:08:30 +02:00
Pavel c45d0a61f0
Use chat keys in the UI (#274)
* add util for compressing public key

* add chat keys to account and member

* use compressPublicKey in color hash util

* use chat keys in UI
2022-06-14 14:28:08 +02:00
Pavel Prichodko dd67a504bf
fix generating of message ID 2022-06-14 14:15:19 +02:00
Pavel Prichodko 805944a3d7
fix: add username to account 2022-06-13 22:44:22 +02:00
Felicio Mununga 8bdff5d869
Return new array on emit to trigger re-rendering in react (#273)
* fix type

* return new array to trigger re-rendering in react
2022-06-13 22:44:12 +02:00
Felicio Mununga b7e61f16d1
Emit to self on send (#272)
* fix chat references in status-react

* emit to self on send
2022-06-13 20:07:00 +02:00
Pavel c9bffe4a52
Add members (#271)
* export ColorHash type

* add getObjectsDifference helper

* fix CommunityDescription generated type

* add members to community module

* use members in sidebar
2022-06-13 19:02:37 +02:00
Felicio Mununga b62bc86dfe
Add Chat module (#270)
* add packages/status-js/src/client/chat.ts

* cache received but skipped waku messages

* comment missing Map type in generate proto type

* handle removed and added chats

* remove lodash

* use this.client.waku instead of this.waku in community.ts

* rename community props

* fix waku reference in Community

* fix community reference in chat

* handle chat.description changes

* fix references in ui

* revert use of contentTopic

* fix callback on fetch

* use clock to limit fetch

* fix use of clock for community description

* remove notes

* remove await

* use Object.keys() for diff in chats

* fix typo

* add decryption key in start()

* set content topics when adding decryption keys

* add getter with tmp name

* rename community handler to handleDescription

* return this.description !== undefined

* add options to constructor
2022-06-13 16:33:57 +02:00
Felicio Mununga 9b1347d233
Add color hash function (#264) 2022-06-10 19:30:23 +02:00
Felicio Mununga 1734f0edeb
remove more debug references 2022-06-10 18:23:37 +02:00
Felicio Mununga 25943d29a5
remove comments 2022-06-10 18:16:51 +02:00
Felicio Mununga 020f20e801
remove debug 2022-06-10 17:46:38 +02:00
Felicio Mununga cc6f665f26
add comments 2022-06-10 16:53:15 +02:00
Felicio Mununga 8c2f200d0e
remove client.test.ts 2022-06-10 16:48:56 +02:00
Felicio Mununga a14eb6e011
remove console log 2022-06-10 16:47:59 +02:00
Felicio Mununga 1981b8a27d
remove scripts 2022-06-10 16:44:24 +02:00
Pavel Prichodko 5b7c3cbb5a
fix recoverPublicKey test 2022-06-10 13:45:15 +02:00
Pavel Prichodko e976c5bc1f
add basic validateMessage function 2022-06-10 13:43:48 +02:00
Felicio Mununga 70ec7c030f
change requestToJoin() 2022-06-10 02:13:05 +02:00
Felicio Mununga c34eeea0d6
use Set for waku message IDs 2022-06-10 02:11:29 +02:00
Felicio Mununga e1b1036695
add comment 2022-06-09 21:05:13 +02:00
Felicio Mununga ca66e8b132
use clock 2022-06-09 20:32:36 +02:00
Felicio Mununga d6c1ff0450
change community fetch 2022-06-09 19:33:01 +02:00
Felicio Mununga c84ed7ac7b
return chat messages from history fetch only if new found 2022-06-09 19:22:58 +02:00
Felicio Mununga 2ac11ab094
ignore already received chat messages 2022-06-09 18:48:27 +02:00
Felicio Mununga c416ec3e94
fix observing of new channels 2022-06-09 18:28:52 +02:00
Felicio Mununga 75dd342bcd
remove other waku message handlers 2022-06-09 18:27:47 +02:00
Felicio Mununga faa60f6ad4
add packages/status-js/src/client/community/handle-waku-message.ts 2022-06-09 18:23:31 +02:00
Pavel Prichodko c3840f8725
cleanup generateUsername function 2022-06-09 19:22:05 +02:00
Pavel Prichodko 58a10a5239
add generate username util 2022-06-09 18:59:04 +02:00
Pavel Prichodko bf3e6de2a7
fix sending messages 2022-06-09 15:56:43 +02:00
Pavel Prichodko 6ce1344af1
unify reaction type 2022-06-09 15:56:19 +02:00
Pavel Prichodko 128dbbe5f1
fix account tests 2022-06-09 14:44:45 +02:00
Pavel Prichodko 56a44eb255
add methods for sending messages 2022-06-09 14:44:23 +02:00
Pavel Prichodko e2cfc3ca6e
make recoverPublicKey universal 2022-06-09 14:40:08 +02:00
Felicio Mununga 6252736ad2
use pub key to gen chat message id 2022-06-08 17:09:36 +02:00