Commit graph

789 commits

Author SHA1 Message Date
Bruno Windels
b84c90891c add very early datachannel support 2022-04-11 15:53:34 +02:00
Bruno Windels
8e82aad86b fix logic error that made tracks disappear on the second track event 2022-04-11 14:55:08 +02:00
Bruno Windels
d7360e7741 fix multiple device support 2022-03-30 15:18:46 +02:00
Bruno Windels
4bf171def9 small fixes 2022-03-29 12:01:47 +02:00
Bruno Windels
a0a07355d4 more improvements, make hangup work 2022-03-29 12:01:47 +02:00
Bruno Windels
0a37fd561e just enough view code to join a call 2022-03-29 12:01:47 +02:00
Bruno Windels
9efd191f4e some more fixes 2022-03-29 12:01:46 +02:00
Bruno Windels
cad2aa760d some fixes 2022-03-29 12:01:46 +02:00
Bruno Windels
4be82cd472 WIP on UI 2022-03-29 12:01:46 +02:00
Bruno Windels
e760b8e556 basic view model setup 2022-03-29 12:01:46 +02:00
Bruno Windels
e482e3aeef expose mediaDevices and webRTC from platform 2022-03-29 12:01:46 +02:00
Bruno Windels
07bc0a2376 move observable values each in their own file 2022-03-29 12:01:46 +02:00
Bruno Windels
6da4a4209c WIP: work on group calling code 2022-03-29 12:01:46 +02:00
Bruno Windels
60da85d641 WIP10 2022-03-29 12:01:46 +02:00
Bruno Windels
ecf7eab3ee WIP8 - implement PeerCall.handleAnswer and other things 2022-03-29 12:01:46 +02:00
Bruno Windels
25b0148073 WIP8 2022-03-29 12:01:46 +02:00
Bruno Windels
98b77fc761 WIP7 2022-03-29 12:01:46 +02:00
Bruno Windels
179c7e74b5 WIP6 2022-03-29 12:01:46 +02:00
Bruno Windels
98e1dcf799 WIP5 2022-03-29 12:01:46 +02:00
Bruno Windels
e5f44aecfb WIP4 2022-03-29 12:01:46 +02:00
Bruno Windels
468841ecea WIP3 2022-03-29 12:01:46 +02:00
Bruno Windels
8b8233ff00
Merge pull request #691 from vector-im/madlittlemods/only-crypto-in-secure-context
Only initialize `Crypto` when olm is provided
2022-03-03 17:33:50 +01:00
Eric Eastwood
2f4c639cef Only initialize Crypto when olm is provided
See https://github.com/vector-im/hydrogen-web/pull/691#discussion_r816988082
2022-03-02 03:17:59 -06:00
Eric Eastwood
c09964dc30
Add data-event-id="$xxx" attributes to timeline items for easy selecting in end-to-end tests (#690)
Split out from https://github.com/vector-im/hydrogen-web/pull/653

Example test assertions: db6d3797d7/test/e2e-tests.js (L248-L252)

```js
// Make sure the $abc event on the page has "foobarbaz" text in it
assert.match(
  dom.document.querySelector(`[data-event-id="$abc"]`).outerHTML,
  new RegExp(`.*foobarbaz.*`)
);
```
2022-03-01 18:36:14 -06:00
Bruno Windels
62ce111938
Merge pull request #692 from ryushar/ryushar/typescriptify
Convert domain/avatar.js and domain/LogoutViewModel.js to Typescript
2022-03-01 18:50:19 +01:00
Tushar
7055f02f16 typescriptify domain/avatar.js 2022-02-25 15:52:54 +05:30
Eric Eastwood
0935f2d23a Only try to use window.crypto.subtle in secure contexts to avoid it throwing and stopping all JavaScript
Relevant error if you crypto is used in a non-secure context like a local LAN IP `http://192.168.1.151:3050/`
```
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'deriveBits')
	at new Crypto
	at new Platform
	at mountHydrogen
```

For my use-case with https://github.com/matrix-org/matrix-public-archive, I don't need crypto/encryption at all.

Docs:

 - https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
 - https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle
    - "Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers."

---

Related to https://github.com/vector-im/hydrogen-web/issues/579
2022-02-25 01:59:48 -06:00
Eric Eastwood
b993331e06 Add more HTML form and SVG elements
Split off from https://github.com/vector-im/hydrogen-web/pull/653

Personally using `select`, `option`, and `path` currently in https://github.com/matrix-org/matrix-public-archive
but added a few extra SVG elements that seemed common to me.
2022-02-25 01:40:52 -06:00
Eric Eastwood
dfed04166e Fix missing reply text when message body is parsed as HTML in [linkedom](https://github.com/WebReflection/linkedom) (SSR).
- [`linkedom`](https://github.com/WebReflection/linkedom) is being used https://github.com/matrix-org/matrix-public-archive to server-side render (SSR) Hydrogen (`hydrogen-view-sdk`)
 - This is being fixed by using a explicit HTML wrapper boilerplate with `DOMParser` to get a matching result in the browser and `linkedom`.

Currently `parseHTML` is only used for HTML content bodies in events. Events with replies have content bodies that look like `<mx-reply>Hello</mx-reply> What's up` so they're parsed as HTML to strip out the `<mx-reply>` part.

Before | After
---  |  ---
![](https://user-images.githubusercontent.com/558581/153692011-2f0e7114-fcb4-481f-b217-49f461b1740a.png) | ![](https://user-images.githubusercontent.com/558581/153692016-52582fdb-abd9-439d-9dce-3f04da6959db.png)

Before:
```js
// Browser (Chrome, Firefox)
new DOMParser().parseFromString(`<div>foo</div>`, "text/html").body.outerHTML;
// '<body><div>foo</div></body>'

// `linkedom` 
new DOMParser().parseFromString(`<div>foo</div>`, "text/html").body.outerHTML;
// '<body></body>'
```

After (consistent matching output):

```js
// Browser (Chrome, Firefox)
new DOMParser().parseFromString(`<!DOCTYPE html><html><body><div>foo</div></body></html>`, "text/html").body.outerHTML;
// '<body><div>foo</div></body>'

// `linkedom`
new DOMParser().parseFromString(`<!DOCTYPE html><html><body><div>foo</div></body></html>`, "text/html").body.outerHTML;
// '<body><div>foo</div></body>'
```

`linkedom` goal is to be close to the current DOM standard, but [not too close](https://github.com/WebReflection/linkedom#faq). Focused on the streamlined cases for server-side rendering (SSR).

Here is some context around getting `DOMParser` to interpret things better. The conclusion was to only support the explicit standard cases with a `<html><body></body></html>` specified instead of adding the magic HTML document creation and massaging that the browser does.

 - https://github.com/WebReflection/linkedom/issues/106
 - https://github.com/WebReflection/linkedom/pull/108

 ---

Part of https://github.com/vector-im/hydrogen-web/pull/653 to support server-side rendering Hydrogen for the [`matrix-public-archive`](https://github.com/matrix-org/matrix-public-archive) project.
2022-02-11 20:10:46 -06:00
Bruno Windels
a442b4b009 Merge branch 'master' into bwindels/create-room 2022-02-10 20:05:40 +01:00
Bruno Windels
d2008a336b fix lint errors 2022-02-10 19:54:47 +01:00
Bruno Windels
955a6bd6f9 styling for button in member details to open DM 2022-02-10 14:38:12 +01:00
Bruno Windels
147810864f add support to set alias and federation flag in create room 2022-02-10 14:09:18 +01:00
Bruno Windels
b5536830d0 improve RoomBeingCreatedView, allow removing the roombeingcreated 2022-02-10 11:07:29 +01:00
Bruno Windels
e8c20c28b2 allow passing label into LoadingView
also doesn't need to be a template view, as it doesn't have bindings
or event handlers
2022-02-10 11:06:44 +01:00
Bruno Windels
bbb1683dbf fixup: login view styling 2022-02-10 09:40:42 +01:00
Bruno Windels
fed42f13ad textarea styling 2022-02-10 09:40:30 +01:00
Bruno Windels
5f6308e7c4 fix homeserver field style in login view 2022-02-10 09:40:19 +01:00
Bruno Windels
5c085efc10 create room view and view model 2022-02-09 19:02:51 +01:00
Bruno Windels
4b1be30dc0 improve form-row classes so they can work with create room form 2022-02-09 19:01:35 +01:00
Bruno Windels
8523f6feaf setup navigation for create room form 2022-02-09 19:00:41 +01:00
Bruno Windels
83d2b58bad add avatar support to creating room 2022-02-09 19:00:00 +01:00
Bruno Windels
743f2270e5 have a single tile view that supports all 3 view models 2022-02-08 16:22:44 +01:00
Bruno Windels
bc09ede09f WIP 2022-02-03 17:57:35 +01:00
RMidhunSuresh
8a3c0afba6 Fix incorrect types 2022-02-03 19:41:11 +05:30
RMidhunSuresh
bb6a885116 Specify what errors are ignored in options 2022-02-03 19:40:25 +05:30
Bruno Windels
06a1421e97 add backupWriteStatus so binding can take multiple fields into account 2022-01-31 16:26:06 +01:00
Bruno Windels
c340746a87 also remove text nodes when updating message body
fixes #649
2022-01-28 16:04:56 +01:00
Bruno Windels
bd2c70b923 adapt key backup view(model) to changes in session, show backup progress 2022-01-28 15:14:23 +01:00
Bruno Windels
86caa5f9b1 rename session backup to key backup to be consistent with RoomKey 2022-01-26 09:51:48 +01:00