Merge branch 't3chguy/feat/widgets' of github.com:vector-im/riot-web into t3chguy/demo/widgets2020

This commit is contained in:
Michael Telatynski 2020-10-19 19:38:25 +01:00
commit 55e6ff9b2d
34 changed files with 1599 additions and 1862 deletions

View file

@ -38,7 +38,7 @@ For the web app:
- **Browser**: Chrome, Safari, Firefox? which version?
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web?
- **URL**: develop.element.io / app.element.io / somewhere else? If a private server, what version of Element Web?
For the desktop app:

View file

@ -48,7 +48,7 @@ For the web app:
- **Browser**: Chrome, Safari, Firefox? which version?
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web?
- **URL**: develop.element.io / app.element.io / somewhere else? If a private server, what version of Element Web?
For the desktop app:

View file

@ -50,7 +50,7 @@ For the web app:
- **Browser**: Chrome, Safari, Firefox? which version?
- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc?
- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web?
- **URL**: develop.element.io / app.element.io / somewhere else? If a private server, what version of Element Web?
For the desktop app:

View file

@ -1,3 +1,97 @@
Changes in [1.7.9](https://github.com/vector-im/element-web/releases/tag/v1.7.9) (2020-10-12)
=============================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.9-rc.1...v1.7.9)
* Upgrade to React SDK 3.6.0 and JS SDK 8.5.0
Changes in [1.7.9-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.9-rc.1) (2020-10-07)
=======================================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.8...v1.7.9-rc.1)
* Upgrade to React SDK 3.6.0-rc.1 and JS SDK 8.5.0-rc.1
* Update from Weblate
[\#15406](https://github.com/vector-im/element-web/pull/15406)
* Update Jest and JSDOM
[\#15402](https://github.com/vector-im/element-web/pull/15402)
* Add support for dehydration/fallback keys
[\#15398](https://github.com/vector-im/element-web/pull/15398)
* Remove riot-bot from sample config
[\#15376](https://github.com/vector-im/element-web/pull/15376)
* Switch to using the Widget API SDK for Jitsi widgets
[\#15102](https://github.com/vector-im/element-web/pull/15102)
* Remove workbox
[\#15352](https://github.com/vector-im/element-web/pull/15352)
* Disable workbox when running in webpack dev server, not in dev mode
[\#15345](https://github.com/vector-im/element-web/pull/15345)
* Update Riot -> Element in contribute.json
[\#15326](https://github.com/vector-im/element-web/pull/15326)
* Update Riot -> Element in redeploy.py
[\#15336](https://github.com/vector-im/element-web/pull/15336)
* Update Riot -> Element in docs/feature-flags.md
[\#15325](https://github.com/vector-im/element-web/pull/15325)
* Update Riot -> Element in element.io/README.md
[\#15327](https://github.com/vector-im/element-web/pull/15327)
* Update Riot -> Element in VectorAuthFooter
[\#15328](https://github.com/vector-im/element-web/pull/15328)
* Update Riot -> Element in VectorEmbeddedPage
[\#15329](https://github.com/vector-im/element-web/pull/15329)
* Update Riot -> Element in docs/review.md
[\#15330](https://github.com/vector-im/element-web/pull/15330)
* Update Riot -> Element in welcome.html
[\#15332](https://github.com/vector-im/element-web/pull/15332)
* Update Riot -> Element in issues-burndown.pl
[\#15333](https://github.com/vector-im/element-web/pull/15333)
* Update Riot -> Element in redeploy.py
[\#15334](https://github.com/vector-im/element-web/pull/15334)
* Update Riot -> Element in index.ts
[\#15335](https://github.com/vector-im/element-web/pull/15335)
* Update Riot -> Element Web in issue templates
[\#15324](https://github.com/vector-im/element-web/pull/15324)
* Give the Jitsi widget an icon to help with discovery
[\#15316](https://github.com/vector-im/element-web/pull/15316)
* Jitsi widget wrapper updates for hangup button
[\#15219](https://github.com/vector-im/element-web/pull/15219)
* Tidy up Service Worker, only run Workbox in production
[\#15271](https://github.com/vector-im/element-web/pull/15271)
* Remove conference handler
[\#15274](https://github.com/vector-im/element-web/pull/15274)
* Rebrand the webpack pipeline for Element
[\#15266](https://github.com/vector-im/element-web/pull/15266)
* Replace dummy sw.js with pre-caching and runtime-caching workbox SW
[\#15196](https://github.com/vector-im/element-web/pull/15196)
Changes in [1.7.8](https://github.com/vector-im/element-web/releases/tag/v1.7.8) (2020-09-28)
=============================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.8-rc.1...v1.7.8)
* Upgrade to React SDK 3.5.0 and JS SDK 8.4.1
Changes in [1.7.8-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.8-rc.1) (2020-09-23)
=======================================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.7...v1.7.8-rc.1)
* Upgrade to React SDK 3.5.0-rc.1 and JS SDK 8.4.0-rc.1
* Update from Weblate
[\#15262](https://github.com/vector-im/element-web/pull/15262)
* Upgrade sanitize-html
[\#15260](https://github.com/vector-im/element-web/pull/15260)
* Document config for preferring Secure Backup setup methods
[\#15251](https://github.com/vector-im/element-web/pull/15251)
* Add end-user documentation for UI features
[\#15190](https://github.com/vector-im/element-web/pull/15190)
* Update git checkout instructions
[\#15218](https://github.com/vector-im/element-web/pull/15218)
* If no bug_report_endpoint_url, hide rageshaking from the App
[\#15201](https://github.com/vector-im/element-web/pull/15201)
* Bump node-fetch from 2.6.0 to 2.6.1
[\#15153](https://github.com/vector-im/element-web/pull/15153)
* Remove references to Travis CI
[\#15137](https://github.com/vector-im/element-web/pull/15137)
* Fix onNewScreen to use replace when going from roomId->roomAlias
[\#15127](https://github.com/vector-im/element-web/pull/15127)
* Enable Estonian in language menu
[\#15136](https://github.com/vector-im/element-web/pull/15136)
Changes in [1.7.7](https://github.com/vector-im/element-web/releases/tag/v1.7.7) (2020-09-14)
=============================================================================================
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.6...v1.7.7)

View file

@ -35,7 +35,6 @@
"matrix.org"
]
},
"welcomeUserId": "@riot-bot:matrix.org",
"piwik": {
"url": "https://piwik.riot.im/",
"whitelistedHSUrls": ["https://matrix.org"],

View file

@ -1,13 +1,13 @@
{
"name": "Riot",
"name": "Element",
"description": "A glossy Matrix collaboration client for the web.",
"repository": {
"url": "https://github.com/vector-im/riot-web",
"url": "https://github.com/vector-im/element-web",
"license": "Apache License 2.0"
},
"bugs": {
"list": "https://github.com/vector-im/riot-web/issues",
"report": "https://github.com/vector-im/riot-web/issues/new/choose"
"list": "https://github.com/vector-im/element-web/issues",
"report": "https://github.com/vector-im/element-web/issues/new/choose"
},
"keywords": [
"chat",

34
docs/customisations.md Normal file
View file

@ -0,0 +1,34 @@
# Customisations
Element Web and the React SDK support "customisation points" that can be used to
easily add custom logic specific to a particular deployment of Element Web.
An example of this is the [security customisations
module](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/customisations/Security.ts).
This module in the React SDK only defines some empty functions and their types:
it does not do anything by default.
To make use of these customisation points, you will first need to fork Element
Web so that you can add your own code. Even though the default module is part of
the React SDK, you can still override it from the Element Web layer:
1. Copy the default customisation module to
`element-web/src/customisations/YourNameSecurity.ts`
2. Edit customisations points and make sure export the ones you actually want to
activate
3. Tweak the Element build process to use the customised module instead of the
default by adding this to end of the `plugins` array in `webpack.config.js`:
```js
new webpack.NormalModuleReplacementPlugin(
/src\/customisations\/Security.ts/,
path.resolve(__dirname, 'src/customisations/YourNameSecurity.ts'),
),
```
If we add more customisation modules in the future, we'll likely improve these
steps to remove the need for build changes like the above.
By isolating customisations to their own module, this approach should remove the
chance of merge conflicts when updating your fork, and thus simplify ongoing
maintenance.

View file

@ -8,7 +8,7 @@ For example, flags make the following things possible:
* Extended testing of a feature via labs on develop
* Enabling features when ready instead of the first moment the code is released
* Testing a feature with a specific set of users (by enabling only on a specific
Riot instance)
Element instance)
The size of the feature controlled by a feature flag may vary widely: it could
be a large project like reactions or a smaller change to an existing algorithm.
@ -49,7 +49,7 @@ When starting work on a feature, we should create a matching feature flag:
```js
SettingsStore.getValue("feature_cats")
```
3. Document the feature in the [labs documentation](https://github.com/vector-im/riot-web/blob/develop/docs/labs.md)
3. Document the feature in the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md)
With these steps completed, the feature is disabled by default, but can be
enabled on develop and nightly by interested users for testing.
@ -60,9 +60,9 @@ The following lists a few common options.
## Enabling by default on develop and nightly
Set the feature to `true` in the
[develop](https://github.com/vector-im/riot-web/blob/develop/riot.im/develop/config.json)
[develop](https://github.com/vector-im/element-web/blob/develop/element.io/develop/config.json)
and
[nightly](https://github.com/vector-im/riot-desktop/blob/develop/riot.im/nightly/config.json)
[nightly](https://github.com/vector-im/element-desktop/blob/develop/element.io/nightly/config.json)
configs:
```json
@ -74,9 +74,9 @@ configs:
## Enabling by default on staging, app, and release
Set the feature to `true` in the
[staging / app](https://github.com/vector-im/riot-web/blob/develop/riot.im/app/config.json)
[staging / app](https://github.com/vector-im/element-web/blob/develop/element.io/app/config.json)
and
[release](https://github.com/vector-im/riot-desktop/blob/develop/riot.im/release/config.json)
[release](https://github.com/vector-im/element-desktop/blob/develop/element.io/release/config.json)
configs.
**Note:** The above will only enable the feature for https://app.element.io and official Element
@ -90,18 +90,18 @@ Once we're confident that a feature is working well, we should remove or convert
If the feature is meant to be turned off/on by the user:
1. Remove `isFeature` from the [setting](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts)
2. Change the `default` to `true` (if desired).
3. Remove the feature from the [labs documentation](https://github.com/vector-im/riot-web/blob/develop/docs/labs.md)
3. Remove the feature from the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md)
4. Celebrate! 🥳
If the feature is meant to be forced on (non-configurable):
1. Remove the [setting](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts)
2. Remove all `getValue` lines that test for the feature.
3. Remove the feature from the [labs documentation](https://github.com/vector-im/riot-web/blob/develop/docs/labs.md)
3. Remove the feature from the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md)
4. If applicable, remove the feature state from
[develop](https://github.com/vector-im/riot-web/blob/develop/riot.im/develop/config.json),
[nightly](https://github.com/vector-im/riot-desktop/blob/develop/riot.im/nightly/config.json),
[staging / app](https://github.com/vector-im/riot-web/blob/develop/riot.im/app/config.json),
[develop](https://github.com/vector-im/element-web/blob/develop/element.io/develop/config.json),
[nightly](https://github.com/vector-im/element-desktop/blob/develop/element.io/nightly/config.json),
[staging / app](https://github.com/vector-im/element-web/blob/develop/element.io/app/config.json),
and
[release](https://github.com/vector-im/riot-desktop/blob/develop/riot.im/release/config.json)
[release](https://github.com/vector-im/element-desktop/blob/develop/element.io/release/config.json)
configs
5. Celebrate! 🥳

View file

@ -106,3 +106,8 @@ To enable message previews for reactions in DMs, enable `feature_roomlist_previe
represent what communities v2 will look/feel like and can/will change without notice. Due to the early
stages this feature is in and the requirement for a compatible homeserver, we will not be accepting issues
or feedback for this functionality at this time.
## Dehydrated devices (`feature_dehydration`)
Allows users to receive encrypted messages by creating a device that is stored
encrypted on the server, as described in [MSC2697](https://github.com/matrix-org/matrix-doc/pull/2697).

View file

@ -76,7 +76,7 @@ As it can be difficult to review design work from looking at just the changed
files in a PR, authors should be prepared for Design and / or Product teams to
request a link to an ad-hoc build of Element (hosted anywhere) that can be used for
the review. In the future, we [hope to automate
this](https://github.com/vector-im/riot-web/issues/12624) for every PR.
this](https://github.com/vector-im/element-web/issues/12624) for every PR.
Before starting work on a feature, it's best to ensure your plan aligns well
with our vision for Element. Please chat with the team in

View file

@ -6,7 +6,7 @@ official element.io distribution, but these files may be useful if you want to
inspect the configuration used there.
Element Desktop uses a separate config (see
https://github.com/vector-im/riot-desktop/tree/develop/element.io).
https://github.com/vector-im/element-desktop/tree/develop/element.io).
Deployment scripts (such as app/deploy.py) are meant to be run on the web server
hosting the Element installation.

View file

@ -1,7 +1,7 @@
{
"name": "riot-web",
"productName": "Riot",
"version": "1.7.7",
"version": "1.7.9",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@ -62,7 +62,8 @@
"jsrsasign": "^9.1.5",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
"matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop",
"olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz",
"matrix-widget-api": "^0.1.0-beta.5",
"olm": "https://packages.matrix.org/npm/olm/olm-3.2.1.tgz",
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
@ -92,6 +93,7 @@
"@types/node": "^12.12.41",
"@types/react": "16.9",
"@types/react-dom": "^16.9.4",
"@types/sanitize-html": "^1.23.3",
"autoprefixer": "^9.7.3",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
@ -112,8 +114,8 @@
"file-loader": "^5.0.2",
"fs-extra": "^0.30.0",
"html-webpack-plugin": "^3.2.0",
"jest": "^24.9.0",
"jest-environment-jsdom-fourteen": "^1.0.1",
"jest": "^26.5.2",
"jest-environment-jsdom-sixteen": "^1.0.3",
"json-loader": "^0.5.3",
"loader-utils": "^1.2.3",
"matrix-mock-request": "^1.2.3",
@ -137,16 +139,16 @@
"postcss-strip-inline-comments": "^0.1.5",
"rimraf": "^2.4.3",
"shell-escape": "^0.2.0",
"simple-proxy-agent": "^1.1.0",
"stylelint": "^12.0.1",
"terser-webpack-plugin": "^2.3.0",
"typescript": "^3.7.3",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
"workbox-webpack-plugin": "^5.1.4"
"webpack-dev-server": "^3.9.0"
},
"jest": {
"testEnvironment": "jest-environment-jsdom-fourteen",
"testEnvironment": "jest-environment-jsdom-sixteen",
"testMatch": [
"<rootDir>/test/**/*-test.js"
],

1
res/sw.js Normal file
View file

@ -0,0 +1 @@
self.addEventListener('fetch', () => {});

View file

@ -169,7 +169,7 @@ we don't have an account and should hide them. No account == no guest account ei
</style>
<div class="mx_Parent">
<a href="https://riot.im" target="_blank" rel="noopener">
<a href="https://element.io" target="_blank" rel="noopener">
<img src="welcome/images/logo.svg" alt="" class="mx_Logo"/>
</a>
<h1 class="mx_Header_title">_t("Welcome to Element")</h1>
@ -185,7 +185,7 @@ we don't have an account and should hide them. No account == no guest account ei
</div>
<!-- The comments below are meant to be used by Ansible as a quick way
to strip out the marked content when desired.
See https://github.com/vector-im/riot-web/issues/8622.
See https://github.com/vector-im/element-web/issues/8622.
TODO: Strip out these comments and rely on the guest flag -->
<!-- BEGIN Ansible: Remove these lines when guest access is disabled -->
<div class="mx_ButtonRow mx_WelcomePage_guestFunctions">

View file

@ -7,6 +7,7 @@ const fs = require("fs");
const path = require("path");
const mkdirp = require("mkdirp");
const fetch = require("node-fetch");
const ProxyAgent = require("simple-proxy-agent");
console.log("Making webapp directory");
mkdirp.sync("webapp");
@ -14,7 +15,13 @@ mkdirp.sync("webapp");
// curl -s https://jitsi.riot.im/libs/external_api.min.js > ./webapp/jitsi_external_api.min.js
console.log("Downloading Jitsi script");
const fname = path.join("webapp", "jitsi_external_api.min.js");
fetch("https://jitsi.riot.im/libs/external_api.min.js").then(res => {
const options = {};
if (process.env.HTTPS_PROXY) {
options.agent = new ProxyAgent(process.env.HTTPS_PROXY, {tunnel: true});
}
fetch("https://jitsi.riot.im/libs/external_api.min.js", options).then(res => {
const stream = fs.createWriteStream(fname);
return new Promise((resolve, reject) => {
res.body.pipe(stream);

View file

@ -61,6 +61,7 @@ const INCLUDE_LANGS = [
// "dest/b/...".
const COPY_LIST = [
["res/manifest.json", "webapp"],
["res/sw.js", "webapp"],
["res/welcome.html", "webapp"],
["res/welcome/**", "webapp/welcome"],
["res/themes/**", "webapp/themes"],

View file

@ -18,7 +18,7 @@ my $gh = Net::GitHub->new(
login => 'ara4n', pass => read_password("github password: "),
);
$gh->set_default_user_repo('vector-im', 'riot-web');
$gh->set_default_user_repo('vector-im', 'element-web');
#my @issues = $gh->issue->repos_issues({ state => 'all', milestone => 3 });
my @issues = $gh->issue->repos_issues({ state => 'all' });

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# auto-deploy script for https://riot.im/develop
# auto-deploy script for https://develop.element.io
#
# Listens for buildkite webhook pokes (https://buildkite.com/docs/apis/webhooks)
# When it gets one, downloads the artifact from buildkite
@ -191,7 +191,7 @@ def deploy_tarball(artifact, build_dir):
# Download the tarball here as buildkite needs auth to do this
# we don't pgp-sign buildkite artifacts, relying on HTTPS and buildkite
# not being evil. If that's not good enough for you, don't use riot.im/develop.
# not being evil. If that's not good enough for you, don't use develop.element.io.
resp = requests.get(artifact['download_url'], stream=True, headers=req_headers())
resp.raise_for_status()
with open(artifact['filename'], 'wb') as ofp:

View file

@ -28,7 +28,7 @@ export default class VectorEmbeddedPage extends EmbeddedPage {
// we're overriding the base component here, for Element-specific tweaks
translate(s) {
s = sanitizeHtml(_t(s));
// ugly fix for https://github.com/vector-im/riot-web/issues/4243
// ugly fix for https://github.com/vector-im/element-web/issues/4243
// eslint-disable-next-line max-len
s = s.replace(/\[matrix\]/, '<a href="https://matrix.org" target="_blank" rel="noreferrer noopener"><img width="79" height="34" alt="Matrix" style="padding-left: 1px;vertical-align: middle" src="welcome/images/matrix.svg"/></a>');
return s;

View file

@ -24,7 +24,7 @@ const VectorAuthFooter = () => {
let links = [
{"text": "Blog", "url": "https://element.io/blog"},
{"text": "Twitter", "url": "https://twitter.com/element_hq"},
{"text": "GitHub", "url": "https://github.com/vector-im/riot-web"},
{"text": "GitHub", "url": "https://github.com/vector-im/element-web"},
];
if (brandingConfig && brandingConfig.authFooterLinks) {

View file

@ -0,0 +1 @@
../../docs/customisations.md

View file

@ -10,5 +10,26 @@
"Sign In": "Inicia la sessió",
"Invalid configuration: no default server specified.": "Configuració no vàlida: no s'ha especificat cap servidor per defecte.",
"Invalid JSON": "JSON no vàlid",
"Go to your browser to complete Sign In": "Aneu al vostre navegador per completar l'inici de sessió"
"Go to your browser to complete Sign In": "Aneu al vostre navegador per completar l'inici de sessió",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuració incorrecta: només podeu especificar una de les opcions default_server_config, default_server_name, o default_hs_url.",
"Your Element is misconfigured": "El vostre Element està mal configurat",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "El vostre Element conté un JSON incorrecte. Si us plau arregleu el problema i recarregueu la pàgina.",
"The message from the parser is: %(message)s": "El missatge de l'analitzador és: %(message)s",
"Unable to load config file: please refresh the page to try again.": "No he pogut carregar l'arxiu de configuració: si us plau recarregueu la pàgina per provar-ho de nou.",
"Unexpected error preparing the app. See console for details.": "Error inesperat preparant l'app. Vegeu la consola pels detalls.",
"Download Completed": "Descàrrega completada",
"Open": "Obre",
"Open user settings": "Obre configuració d'usuari",
"Previous/next recently visited room or community": "Anterior/Següent sala o comunitat visitada recentment",
"%(brand)s Desktop (%(platformName)s)": "%(brand)s d'escriptori (%(platformName)s)",
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
"Powered by Matrix": "En funcionament gràcies a Matrix",
"Unsupported browser": "Navegador no suportat",
"Your browser can't run %(brand)s": "El vostre navegador no pot executar %(brand)s",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s usa característiques avançades del navegador que el vostre navegador no suporta.",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Si us plau instal·leu<chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, o <safariLink>Safari</safariLink> per una millor experiència.",
"You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "Podeu continuar usant el vostre navegador actual, però algunes o totes les característiques podrien no funcionar i l'aspepte de l'aplicació podria mostrar errors.",
"I understand the risks and wish to continue": "Entenc els riscos i voldria continuar",
"Go to element.io": "Vés a element.io",
"Failed to start": "Ha fallat en iniciar-se"
}

View file

@ -14,7 +14,20 @@
"Invalid configuration: no default server specified.": "Μη έγκυρη ρύθμιση παραμέτρων: δεν έχει οριστεί προκαθορισμένος διακομιστής.",
"Explore rooms": "Εξερευνήστε δωμάτια",
"Open": "Άνοιγμα",
"Go to your browser to complete Sign In": "Επισκεφτείτε τον browser σας για να ολοκληρωθεί η είσοδος",
"Powered by Matrix": "Παρέχεται από το Matrix",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Παρακαλούμε εγκαταστήστε <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, ή <safariLink>Safari</safariLink> για καλύτερη εμπειρία χρήσης."
"Go to your browser to complete Sign In": "Μεταβείτε στο πρόγραμμα περιήγησής σας για να ολοκληρώσετε τη σύνδεση",
"Powered by Matrix": "Με την υποστήριξη του Matrix",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Παρακαλούμε εγκαταστήστε <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, ή <safariLink>Safari</safariLink> για καλύτερη εμπειρία χρήσης.",
"Your Element is misconfigured": "Το Element σας δεν εχει ρυθμιστεί σωστά",
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Η ρύθμιση του Element περιέχει μη έγκυρο JSON. Διορθώστε το πρόβλημα και φορτώστε ξανά τη σελίδα.",
"Unable to load config file: please refresh the page to try again.": "Δεν είναι δυνατή η φόρτωση του αρχείου config: ανανεώστε τη σελίδα για να δοκιμάσετε ξανά.",
"Download Completed": "Η λήψη ολοκληρώθηκε",
"Open user settings": "Ανοίξτε τις ρυθμίσεις χρήστη",
"Previous/next recently visited room or community": "Προηγούμενο / επόμενο δωμάτιο ή κοινότητα που επισκεφτήκατε πρόσφατα",
"Unsupported browser": "Μη υποστηριζόμενο πρόγραμμα περιήγησης",
"Your browser can't run %(brand)s": "Το πρόγραμμα περιήγησής σας δεν μπορεί να εκτελέσει %(brand)s",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s χρησιμοποιεί προηγμένες δυνατότητες προγράμματος περιήγησης που δεν υποστηρίζονται από το τρέχον πρόγραμμα περιήγησής σας.",
"You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "Μπορείτε να συνεχίσετε να χρησιμοποιείτε το τρέχον πρόγραμμα περιήγησής σας, αλλά ορισμένες ή όλες οι λειτουργίες ενδέχεται να μην λειτουργούν και η εμφάνιση και η αίσθηση της εφαρμογής ενδέχεται να είναι λανθασμένη.",
"I understand the risks and wish to continue": "Κατανοώ τους κινδύνους και επιθυμώ να συνεχίσω",
"Go to element.io": "Πήγαινε στο element.io",
"Failed to start": "Αποτυχία έναρξης"
}

View file

@ -32,5 +32,5 @@
"Open": "打开",
"Your browser can't run %(brand)s": "浏览器无法运行%(brand)s",
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "当前浏览器不支持%(brand)s调用的高级浏览器特性。",
"Powered by Matrix": "Powered by Matrix"
"Powered by Matrix": "由 Matrix 驱动"
}

View file

@ -18,7 +18,7 @@ limitations under the License.
require("./index.scss");
import * as qs from 'querystring';
import {ButtonKind, KnownWidgetActions, WidgetApi} from 'matrix-react-sdk/src/widgets/WidgetApi';
import {ModalButtonKind, WidgetApi, WidgetApiToWidgetAction} from 'matrix-widget-api';
let widgetApi: WidgetApi;
(async function() {
@ -35,20 +35,23 @@ let widgetApi: WidgetApi;
};
// Set this up as early as possible because Element will be hitting it almost immediately.
widgetApi = new WidgetApi(qsParam('parentUrl'), qsParam('widgetId'), []);
const parentOrigin = new URL(qsParam('parentUrl')).origin;
widgetApi = new WidgetApi(qsParam("widgetId"), parentOrigin);
widgetApi.on(KnownWidgetActions.CloseModalWidget, req => {
document.getElementById("answer").innerText = "Response from Modal: " + JSON.stringify(req.data);
widgetApi.addEventListener(WidgetApiToWidgetAction.CloseModalWidget, (req: CustomEvent) => {
document.getElementById("answer").innerText = "Response from Modal: " + JSON.stringify(req.detail);
});
widgetApi.start();
document.getElementById("demoBtn").onclick = () => {
const url = new URL(window.location.href);
url.pathname = url.pathname.substr(0, url.pathname.lastIndexOf("/")) + "/theme_widget.html";
url.search = "";
widgetApi.openModalWidget(url.toString(), "Test Modal Widget", [
{id: "m.close", kind: ButtonKind.Danger, label: "Danger"},
{id: "org.secondary", kind: ButtonKind.Secondary, label: "Secondary"},
{id: "org.primary", kind: ButtonKind.Primary, label: "Primary"},
{id: "m.close", kind: ModalButtonKind.Danger, label: "Danger"},
{id: "org.secondary", kind: ModalButtonKind.Secondary, label: "Secondary"},
{id: "org.primary", kind: ModalButtonKind.Primary, label: "Primary"},
], {question: "Answer to everything?"});
};
} catch (e) {

View file

@ -55,6 +55,16 @@
<section id="matrixchat" style="height: 100%; overflow: auto;" class="notranslate"></section>
<script src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
<!-- Legacy supporting Prefetch images -->
<img src="<%= require('matrix-react-sdk/res/img/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/e2e/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/feather-customised/warning-triangle.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/bold.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/code.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/italics.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/quote.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/strikethrough.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<audio id="messageAudio">
<source src="media/message.ogg" type="audio/ogg" />
<source src="media/message.mp3" type="audio/mpeg" />

View file

@ -30,7 +30,7 @@ import './modernizr';
// load service worker if available on this platform
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js');
navigator.serviceWorker.register('sw.js');
}
async function settled(...promises: Array<Promise<any>>) {
@ -85,7 +85,7 @@ const supportedBrowser = checkBrowserFeatures();
// try in react but fallback to an `alert`
// We start loading stuff but don't block on it until as late as possible to allow
// the browser to use as much parallelism as it can.
// Load parallelism is based on research in https://github.com/vector-im/riot-web/issues/12253
// Load parallelism is based on research in https://github.com/vector-im/element-web/issues/12253
async function start() {
// load init.ts async so that its code is not executed immediately and we can catch any exceptions
const {
@ -114,7 +114,7 @@ async function start() {
// don't try to redirect to the native apps if we're
// verifying a 3pid (but after we've loaded the config)
// or if the user is following a deep link
// (https://github.com/vector-im/riot-web/issues/7378)
// (https://github.com/vector-im/element-web/issues/7378)
const preventRedirect = fragparts.params.client_secret || fragparts.location.length > 0;
if (!preventRedirect) {

View file

@ -9,6 +9,7 @@
<div id="joinButtonContainer">
<div class="joinConferenceFloating">
<div class="joinConferencePrompt">
<span class="icon"><!-- managed by CSS --></span>
<!-- TODO: i18n -->
<h2>Jitsi Video Conference</h2>
<div id="widgetActionContainer">

View file

@ -23,10 +23,19 @@ limitations under the License.
src: url('~matrix-react-sdk/res/fonts/Nunito/Nunito-Regular.ttf') format('truetype');
}
$dark-fg: #edf3ff;
$dark-bg: rgba(141, 151, 165, 0.2);
$light-fg: #2e2f32;
$light-bg: #fff;
body {
font-family: Nunito, Arial, Helvetica, sans-serif;
background-color: #181b21;
color: #edf3ff;
background-color: $dark-bg;
color: $dark-fg;
}
body.theme-light {
background-color: $light-bg;
color: $light-fg;
}
body, html {
@ -73,3 +82,26 @@ body, html {
background-color: #03b381;
border: 0;
}
.icon {
$icon-size: 42px;
margin-top: -$icon-size; // to visually center the form
&::before {
content: '';
background-size: contain;
background-color: $dark-fg;
mask-repeat: no-repeat;
mask-position: center;
mask-image: url("~matrix-react-sdk/res/img/element-icons/call/video-call.svg");
mask-size: $icon-size;
display: block;
width: $icon-size;
height: $icon-size;
margin: 0 auto; // center
}
}
body.theme-light .icon::before {
background-color: $light-fg;
}

View file

@ -18,8 +18,14 @@ limitations under the License.
require("./index.scss");
import * as qs from 'querystring';
import {Capability, WidgetApi} from 'matrix-react-sdk/src/widgets/WidgetApi';
import {KJUR} from 'jsrsasign';
import {
IOpenIDCredentials,
IWidgetApiRequest,
VideoConferenceCapabilities,
WidgetApi,
} from "matrix-widget-api";
import { ElementWidgetActions } from "matrix-react-sdk/src/stores/widgets/ElementWidgetActions";
const JITSI_OPENIDTOKEN_JWT_AUTH = 'openidtoken-jwt';
@ -38,8 +44,10 @@ let avatarUrl: string;
let userId: string;
let jitsiAuth: string;
let roomId: string;
let openIdToken: IOpenIDCredentials;
let widgetApi: WidgetApi;
let meetApi: any; // JitsiMeetExternalAPI
(async function() {
try {
@ -59,13 +67,33 @@ let widgetApi: WidgetApi;
// out into a browser.
const parentUrl = qsParam('parentUrl', true);
const widgetId = qsParam('widgetId', true);
const theme = qsParam('theme', true);
if (theme) {
document.body.classList.add(`theme-${theme}`);
}
// Set this up as early as possible because Element will be hitting it almost immediately.
let readyPromise: Promise<[void, void]>;
if (parentUrl && widgetId) {
widgetApi = new WidgetApi(qsParam('parentUrl'), qsParam('widgetId'), [
Capability.AlwaysOnScreen,
const parentOrigin = new URL(qsParam('parentUrl')).origin;
widgetApi = new WidgetApi(qsParam("widgetId"), parentOrigin);
widgetApi.requestCapabilities(VideoConferenceCapabilities);
readyPromise = Promise.all([
new Promise<void>(resolve => {
widgetApi.once(`action:${ElementWidgetActions.ClientReady}`, ev => {
ev.preventDefault();
widgetApi.transport.reply(ev.detail, {});
resolve();
});
}),
new Promise<void>(resolve => {
widgetApi.once("ready", () => resolve());
}),
]);
widgetApi.expectingExplicitReady = true;
widgetApi.start();
} else {
console.warn("No parent URL or no widget ID - assuming no widget API is available");
}
// Populate the Jitsi params now
@ -78,39 +106,33 @@ let widgetApi: WidgetApi;
roomId = qsParam('roomId', true);
if (widgetApi) {
await widgetApi.waitReady();
await readyPromise;
await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen
// See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification
if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) {
// Request credentials, give callback to continue when received
widgetApi.requestOpenIDCredentials(credentialsResponseCallback);
} else {
enableJoinButton();
openIdToken = await widgetApi.requestOpenIDConnectToken();
console.log("Got OpenID Connect token");
}
// TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795)
} else {
enableJoinButton();
widgetApi.on(`action:${ElementWidgetActions.HangupCall}`,
(ev: CustomEvent<IWidgetApiRequest>) => {
if (meetApi) meetApi.executeCommand('hangup');
widgetApi.transport.reply(ev.detail, {}); // ack
},
);
}
enableJoinButton(); // always enable the button
} catch (e) {
console.error("Error setting up Jitsi widget", e);
document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget";
}
})();
/**
* Enable or show error depending on what the credentials response is.
*/
function credentialsResponseCallback() {
if (widgetApi.openIDCredentials) {
console.info('Successfully got OpenID credentials.');
enableJoinButton();
} else {
console.warn('OpenID credentials request was blocked by user.');
document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget";
}
}
function enableJoinButton() {
document.getElementById("joinButton").onclick = () => joinConference();
}
@ -140,7 +162,7 @@ function createJWTToken() {
room: "*",
context: {
matrix: {
token: widgetApi.openIDCredentials.accessToken,
token: openIdToken.access_token,
room_id: roomId,
},
user: {
@ -163,7 +185,7 @@ function createJWTToken() {
function joinConference() { // event handler bound in HTML
let jwt;
if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) {
if (!widgetApi.openIDCredentials || !widgetApi.openIDCredentials.accessToken) {
if (!openIdToken?.access_token) { // eslint-disable-line camelcase
// We've failing to get a token, don't try to init conference
console.warn('Expected to have an OpenID credential, cannot initialize widget.');
document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget";
@ -199,7 +221,7 @@ function joinConference() { // event handler bound in HTML
jwt: jwt,
};
const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options);
meetApi = new JitsiMeetExternalAPI(jitsiDomain, options);
if (displayName) meetApi.executeCommand("displayName", displayName);
if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl);
if (userId) meetApi.executeCommand("email", userId);
@ -214,5 +236,6 @@ function joinConference() { // event handler bound in HTML
}
document.getElementById("jitsiContainer").innerHTML = "";
meetApi = null;
});
}

View file

@ -140,8 +140,8 @@ class SeshatIndexManager extends BaseEventIndexManager {
return this._ipcCall('supportsEventIndexing');
}
async initEventIndex(): Promise<void> {
return this._ipcCall('initEventIndex');
async initEventIndex(userId: string, deviceId: string): Promise<void> {
return this._ipcCall('initEventIndex', userId, deviceId);
}
async addEventToIndex(ev: MatrixEvent, profile: MatrixProfile): Promise<void> {

View file

@ -18,7 +18,7 @@ limitations under the License.
require("./index.scss");
import * as qs from 'querystring';
import { KnownWidgetActions, WidgetApi } from 'matrix-react-sdk/src/widgets/WidgetApi';
import {WidgetApi, WidgetApiToWidgetAction, IWidgetApiRequest} from 'matrix-widget-api';
let widgetApi: WidgetApi;
(async function() {
@ -35,20 +35,28 @@ let widgetApi: WidgetApi;
};
// Set this up as early as possible because Element will be hitting it almost immediately.
widgetApi = new WidgetApi(qsParam('parentUrl'), qsParam('widgetId'), []);
const parentOrigin = new URL(qsParam('parentUrl')).origin;
widgetApi = new WidgetApi(qsParam("widgetId"), parentOrigin);
widgetApi.on(KnownWidgetActions.ButtonClicked, req => {
console.log("@@ clickety", req);
document.getElementById("button").innerText = "BUTTON CLICKED: " + JSON.stringify(req.data);
setTimeout(() => {
widgetApi.closeModalWidget(req.data);
}, 3000);
});
widgetApi.addEventListener(
`action:${WidgetApiToWidgetAction.ButtonClicked}`,
(ev: CustomEvent<IWidgetApiRequest>) => {
console.log("@@ clickety", ev.detail);
document.getElementById("button").innerText = "BUTTON CLICKED: " + JSON.stringify(ev.detail.data);
setTimeout(() => {
widgetApi.closeModalWidget(ev.detail.data);
}, 3000);
},
);
widgetApi.on(KnownWidgetActions.GetWidgetConfig, (config) => {
console.log("Got widget config: ", config);
document.getElementById("question").innerText = "INIT PARAMS: " + JSON.stringify(config.data);
});
widgetApi.addEventListener(
`action:${WidgetApiToWidgetAction.WidgetConfig}`,
(ev: CustomEvent<IWidgetApiRequest>) => {
console.log("Got widget config: ", ev.detail.data);
document.getElementById("question").innerText = "INIT PARAMS: " + JSON.stringify(ev.detail.data);
},
);
widgetApi.start();
document.getElementById("closeButton").onclick = () => {
widgetApi.closeModalWidget({answer: 42});

View file

@ -3,7 +3,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const webpack = require("webpack");
let og_image_url = process.env.RIOT_OG_IMAGE_URL;
if (!og_image_url) og_image_url = 'https://app.element.io/themes/element/img/logos/opengraph.png';
@ -250,9 +250,9 @@ module.exports = (env, argv) => {
},
},
{
// cache-bust i18n .json files placed in
// cache-bust languages.json file placed in
// riot-web/webapp/i18n during build by copy-res.js
test: /i18n\/.*\.json$/,
test: /\.*languages.json$/,
type: "javascript/auto",
loader: 'file-loader',
options: {
@ -374,20 +374,6 @@ module.exports = (env, argv) => {
minify: argv.mode === 'production',
chunks: ['usercontent'],
}),
new WorkboxPlugin.GenerateSW({
runtimeCaching: [{
urlPattern: /i18n\/.*\.json$/,
handler: 'CacheFirst',
options: {
cacheName: 'i18n',
expiration: {
maxEntries: 2,
},
},
}],
}),
],
output: {

2996
yarn.lock

File diff suppressed because it is too large Load diff