Compare commits
31 Commits
travis/thi
...
v1.7.22
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06798f3030 | ||
|
|
594c07b2d9 | ||
|
|
f94f97d83a | ||
|
|
799f60c0ee | ||
|
|
4f13b707bb | ||
|
|
aff0c9823e | ||
|
|
c3c1a5da8d | ||
|
|
d35d6f253b | ||
|
|
29fb984062 | ||
|
|
6c3530d249 | ||
|
|
d63f5a2282 | ||
|
|
2b7dbb4fce | ||
|
|
aaecbab4b9 | ||
|
|
220ee62d38 | ||
|
|
29fd47d611 | ||
|
|
e18bf6be86 | ||
|
|
7562fd3703 | ||
|
|
57f0d5191d | ||
|
|
dd0e2e52f8 | ||
|
|
2e00314dc0 | ||
|
|
afb469ce42 | ||
|
|
31ec953a92 | ||
|
|
94a5cd3f83 | ||
|
|
c67951f254 | ||
|
|
aface37853 | ||
|
|
46af8ba17a | ||
|
|
beb922cbfa | ||
|
|
c4c1b728cc | ||
|
|
402f97b430 | ||
|
|
f998f85c3c | ||
|
|
78d6ad8f29 |
61
CHANGELOG.md
61
CHANGELOG.md
@@ -1,3 +1,64 @@
|
||||
Changes in [1.7.22](https://github.com/vector-im/element-web/releases/tag/v1.7.22) (2021-03-01)
|
||||
===============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.22-rc.1...v1.7.22)
|
||||
|
||||
## Security notice
|
||||
|
||||
Element Web 1.7.22 fixes (by upgrading to matrix-react-sdk 3.15.0) a low
|
||||
severity issue (CVE-2021-21320) where the user content sandbox can be abused to
|
||||
trick users into opening unexpected documents. The content is opened with a
|
||||
`blob` origin that cannot access Matrix user data, so messages and secrets are
|
||||
not at risk. Thanks to @keerok for responsibly disclosing this via Matrix's
|
||||
Security Disclosure Policy.
|
||||
|
||||
## All changes
|
||||
|
||||
* Upgrade to React SDK 3.15.0 and JS SDK 9.8.0
|
||||
|
||||
Changes in [1.7.22-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.22-rc.1) (2021-02-24)
|
||||
=========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.21...v1.7.22-rc.1)
|
||||
|
||||
* Upgrade to React SDK 3.15.0-rc.1 and JS SDK 9.8.0-rc.1
|
||||
* Translations update from Weblate
|
||||
[\#16529](https://github.com/vector-im/element-web/pull/16529)
|
||||
* Add hostSignup config for element.io clients
|
||||
[\#16515](https://github.com/vector-im/element-web/pull/16515)
|
||||
* VoIP virtual rooms, mkII
|
||||
[\#16442](https://github.com/vector-im/element-web/pull/16442)
|
||||
* Jitsi widget: Read room name from query parameters
|
||||
[\#16456](https://github.com/vector-im/element-web/pull/16456)
|
||||
* fix / sso: make sure to delete only loginToken after redirect
|
||||
[\#16415](https://github.com/vector-im/element-web/pull/16415)
|
||||
* Disable Countly
|
||||
[\#16433](https://github.com/vector-im/element-web/pull/16433)
|
||||
|
||||
Changes in [1.7.21](https://github.com/vector-im/element-web/releases/tag/v1.7.21) (2021-02-16)
|
||||
===============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.21-rc.1...v1.7.21)
|
||||
|
||||
* Upgrade to React SDK 3.14.0 and JS SDK 9.7.0
|
||||
|
||||
Changes in [1.7.21-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.21-rc.1) (2021-02-10)
|
||||
=========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.20...v1.7.21-rc.1)
|
||||
|
||||
* Upgrade to React SDK 3.14.0-rc.1 and JS SDK 9.7.0-rc.1
|
||||
* Translations update from Weblate
|
||||
[\#16427](https://github.com/vector-im/element-web/pull/16427)
|
||||
* Add RegExp dotAll feature test
|
||||
[\#16408](https://github.com/vector-im/element-web/pull/16408)
|
||||
* Fix Electron type merging
|
||||
[\#16405](https://github.com/vector-im/element-web/pull/16405)
|
||||
* README: remove Jenkins reference
|
||||
[\#16381](https://github.com/vector-im/element-web/pull/16381)
|
||||
* Enable PostCSS Calc in webpack builds
|
||||
[\#16307](https://github.com/vector-im/element-web/pull/16307)
|
||||
* Add configuration security best practices to the README.
|
||||
[\#16367](https://github.com/vector-im/element-web/pull/16367)
|
||||
* Upgrade matrix-widget-api
|
||||
[\#16347](https://github.com/vector-im/element-web/pull/16347)
|
||||
|
||||
Changes in [1.7.20](https://github.com/vector-im/element-web/releases/tag/v1.7.20) (2021-02-04)
|
||||
===============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.19...v1.7.20)
|
||||
|
||||
@@ -110,18 +110,6 @@ For a good example, see https://develop.element.io/config.json.
|
||||
1. `logo`: An HTTP URL to the avatar for the desktop build. Should be 24x24, ideally
|
||||
an SVG.
|
||||
1. `url`: An HTTP URL for where to send the user to download the desktop build.
|
||||
1. `voip_mxid_translate_pattern`: Used to route VoIP calls to different Matrix IDs.
|
||||
Any VoIP calls placed will instead be placed to the translated Matrix ID from the
|
||||
pattern string but still appear to be with the original Matrix ID. Correspondingly,
|
||||
incoming VoIP calls will be made to appear as if they came from a different Matrix ID.
|
||||
The value is a template string with substitution `$(mxid)` which is the complete
|
||||
URL-encoded native Matrix ID, using '=' instead of '%'. For example, a value of
|
||||
`@_myappservice_$(mxid):example.org` would cause any VoIP call to `@bob:foo.example`
|
||||
to be redirected to `@_myappservice_=40bob=3Afoo.example:example.org` and calls
|
||||
from the latter to appear as if they were from the former.
|
||||
This option is experimental and may be removed at any time without notice. It's
|
||||
also strongly advised not to set this option unless you're absolutly certain you
|
||||
know what you're doing.
|
||||
1. `mobileGuideToast`: Whether to show a toast a startup which nudges users on
|
||||
iOS and Android towards the native mobile apps. The toast redirects to the
|
||||
mobile guide if they accept. Defaults to false.
|
||||
|
||||
@@ -37,5 +37,15 @@
|
||||
"url": "https://element.io/cookie-policy",
|
||||
"text": "Cookie Policy"
|
||||
}
|
||||
]
|
||||
],
|
||||
"hostSignup": {
|
||||
"brand": "Element Home",
|
||||
"cookiePolicyUrl": "https://element.io/cookie-policy",
|
||||
"domains": [
|
||||
"matrix.org"
|
||||
],
|
||||
"privacyPolicyUrl": "https://element.io/privacy",
|
||||
"termsOfServiceUrl": "https://element.io/terms-of-service",
|
||||
"url": "https://ems.element.io/element-home/in-app-loader"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,5 +37,15 @@
|
||||
"url": "https://element.io/cookie-policy",
|
||||
"text": "Cookie Policy"
|
||||
}
|
||||
]
|
||||
],
|
||||
"hostSignup": {
|
||||
"brand": "Element Home",
|
||||
"cookiePolicyUrl": "https://element.io/cookie-policy",
|
||||
"domains": [
|
||||
"matrix.org"
|
||||
],
|
||||
"privacyPolicyUrl": "https://element.io/privacy",
|
||||
"termsOfServiceUrl": "https://element.io/terms-of-service",
|
||||
"url": "https://ems.element.io/element-home/in-app-loader"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "element-web",
|
||||
"version": "1.7.20",
|
||||
"version": "1.7.22",
|
||||
"description": "A feature-rich client for Matrix.org",
|
||||
"author": "New Vector Ltd.",
|
||||
"repository": {
|
||||
@@ -58,8 +58,8 @@
|
||||
"highlight.js": "^10.5.0",
|
||||
"jsrsasign": "^10.1.5",
|
||||
"katex": "^0.12.0",
|
||||
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
|
||||
"matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop",
|
||||
"matrix-js-sdk": "9.8.0",
|
||||
"matrix-react-sdk": "3.15.0",
|
||||
"matrix-widget-api": "^0.1.0-beta.13",
|
||||
"olm": "https://packages.matrix.org/npm/olm/olm-3.2.1.tgz",
|
||||
"prop-types": "^15.7.2",
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"%(brand)s Desktop (%(platformName)s)": "%(brand)s Desktop (%(platformName)s)",
|
||||
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
|
||||
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Bitte installiere <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, oder <safariLink>Safari</safariLink> für das beste Erlebnis.",
|
||||
"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.": "Du kannst mit deinem aktuellen Browser weiterhin verwenden, aber es kann sein, dass einige oder alle Funktionen nicht funktionieren und das Aussehen und die Bedienung der Anwendung nicht korrekt ist.",
|
||||
"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.": "Du kannst deinen aktuellen Browser weiterhin verwenden, es kann aber sein, dass einige oder alle Funktionen nicht verfügbar sind oder dass das Aussehen und die Bedienung der Anwendung nicht korrekt ist.",
|
||||
"I understand the risks and wish to continue": "Ich verstehe die Risiken und möchte fortfahren",
|
||||
"Your Element is misconfigured": "Dein Element ist fehlkonfiguriert",
|
||||
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Deine Element Konfiguration enthält ungültiges JSON. Bitte korrigiere das Problem und lade die Seite neu.",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"Create Account": "Créer un compte",
|
||||
"Explore rooms": "Explorer les salons",
|
||||
"Unexpected error preparing the app. See console for details.": "Une erreur inattendue est survenue pendant la préparation de l’application. Consultez la console pour avoir des détails.",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuration invalide : il ne faut spécifier qu’un des trois champs entre default_server_config, default_server_name et default_hs_url.",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuration invalide : il ne faut spécifier qu’un des trois champs parmis default_server_config, default_server_name et default_hs_url.",
|
||||
"Invalid configuration: no default server specified.": "Configuration invalide : aucun serveur par défaut spécifié.",
|
||||
"The message from the parser is: %(message)s": "Le message de l’analyseur est : %(message)s",
|
||||
"Invalid JSON": "JSON non valide",
|
||||
@@ -21,7 +21,7 @@
|
||||
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
|
||||
"Unsupported browser": "Navigateur non pris en charge",
|
||||
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Veuillez installer <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink> ou <safariLink>Safari</safariLink> pour une expérience optimale.",
|
||||
"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.": "Vous pouvez continuer à utiliser votre navigateur actuel, mais vous risquez de trouver que certaines fonctionnalités et/ou l'apparence de l'application sont incorrectes.",
|
||||
"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.": "Vous pouvez continuer à utiliser votre navigateur actuel, mais vous risquez de trouver que certaines fonctionnalités et/ou l’apparence de l’application sont incorrectes.",
|
||||
"I understand the risks and wish to continue": "Je comprends les risques et souhaite continuer",
|
||||
"Go to element.io": "Aller vers element.io",
|
||||
"Failed to start": "Échec au démarrage",
|
||||
@@ -31,6 +31,6 @@
|
||||
"Your Element is misconfigured": "Votre Element est mal configuré",
|
||||
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "La configuration de votre Element contient du JSON invalide. Veuillez corriger le problème et recharger la page.",
|
||||
"Your browser can't run %(brand)s": "Votre navigateur ne peut pas exécuter %(brand)s",
|
||||
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s nécessite des fonctionnalités avancées que votre navigateur actuel ne supporte pas.",
|
||||
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s nécessite des fonctionnalités avancées que votre navigateur actuel ne pas en charge.",
|
||||
"Powered by Matrix": "Propulsé par Matrix"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"Dismiss": "שחרר",
|
||||
"Dismiss": "התעלם",
|
||||
"powered by Matrix": "מופעל ע\"י Matrix",
|
||||
"Unknown device": "מכשיר לא ידוע",
|
||||
"You need to be using HTTPS to place a screen-sharing call.": "עליך להשתמש ב HTTPS בכדי לבצע שיחת ווידאו משותפת.",
|
||||
@@ -8,13 +8,13 @@
|
||||
"Invalid JSON": "JSON לא חוקי",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "תצורה שגויה: ניתן לציין רק אחד מהבאים, default_server_config, default_server_name, או default_hs_url.",
|
||||
"Invalid configuration: no default server specified.": "תצורה שגויה: לא צוין שרת ברירת מחדל.",
|
||||
"Open user settings": "פתיחת הגדרות משתמש",
|
||||
"Open user settings": "פתח הגדרות משתמש",
|
||||
"Go to your browser to complete Sign In": "עבור לדפדפן להמשך ההתחברות",
|
||||
"Explore rooms": "שיטוט בחדרים",
|
||||
"Create Account": "יצירת חשבון",
|
||||
"Sign In": "כניסה",
|
||||
"Previous/next recently visited room or community": "הבא\\קודם חדרים וקהילות שביקרתם לאחרונה",
|
||||
"Open": "פתיחה",
|
||||
"Open": "פתח",
|
||||
"Download Completed": "ההורדה הושלמה",
|
||||
"Unexpected error preparing the app. See console for details.": "שגיאה לא צפויה במהלך הכנת האפליקציה. ראו קונסול לפרטים נוספים.",
|
||||
"Unable to load config file: please refresh the page to try again.": "לא יכול לקרוא את קובץ ההגדרות: אנא אתחלו את הדף לנסות שנית.",
|
||||
@@ -32,5 +32,5 @@
|
||||
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
|
||||
"%(brand)s Desktop (%(platformName)s)": "%(brand)s שולחן עבודה %(platformName)s",
|
||||
"The message from the parser is: %(message)s": "ההודעה מהניתוח היא: %(message)s",
|
||||
"Missing indexeddb worker script!": "חסר סקריפט עובד indexeddb!"
|
||||
"Missing indexeddb worker script!": "סקריפט indexeddb worker חסר!"
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
"You need to be using HTTPS to place a screen-sharing call.": "സ്ക്രീന് ഷെയറിങ്ങ് കോള് നടത്തണമെങ്കില് https ഉപയോഗിക്കണം.",
|
||||
"Decentralised, encrypted chat & collaboration powered by [matrix]": "വികേന്ദ്രീകൃത , എന്ക്രിപ്റ്റഡ് ചാറ്റ് & മാട്രിക്സ് നല്കുന്ന കൊളാബൊറേഷന്",
|
||||
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s%(browserName)s%(osName)s",
|
||||
"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> ഇൻസ്റ്റാൾ ചെയ്യുക",
|
||||
"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 തെറ്റായിട്ടാണ് കോൺഫിഗർ ചെയ്തിരിക്കുന്നത്",
|
||||
"Invalid configuration: no default server specified.": "അസാധുവായ കോൺഫിഗറേഷൻ: സ്ഥിര സെർവരൊന്നും വ്യക്തമാക്കിയില്ല.",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "അസാധുവായ കോൺഫിഗറേഷൻ: can only specify one of default_server_config, default_server_name, or default_hs_url.",
|
||||
"Missing indexeddb worker script!": "Missing indexeddb worker script!",
|
||||
"Invalid configuration: no default server specified.": "അസാധുവായ കോൺഫിഗറേഷൻ: സ്ഥിര സെർവർ ഒന്നും വ്യക്തമാക്കിയില്ല.",
|
||||
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "അസാധുവായ കോൺഫിഗറേഷൻ: default_server_config, default_server_name, or default_hs_url-ൽ ഒരെണ്ണം മാത്രമേ വ്യക്തമാക്കാൻ കഴിയൂ.",
|
||||
"Missing indexeddb worker script!": "indexeddb worker സ്ക്രിപ്റ്റ് കണ്ടെത്താനായില്ല!",
|
||||
"Open user settings": "യൂസർ ക്രമീകരങ്ങൾ തുറക്കുക",
|
||||
"Download Completed": "ഡൗൺലോഡ് പൂർത്തിയായി",
|
||||
"Unsupported browser": "പിന്തുണയ്ക്കാത്ത ബ്രൗസർ",
|
||||
|
||||
@@ -28,7 +28,16 @@ require('katex/dist/katex.css');
|
||||
// These are things that can run before the skin loads - be careful not to reference the react-sdk though.
|
||||
import {parseQsFromFragment} from "./url_utils";
|
||||
import './modernizr';
|
||||
import {settled} from "./promise_utils";
|
||||
|
||||
async function settled(...promises: Array<Promise<any>>) {
|
||||
for (const prom of promises) {
|
||||
try {
|
||||
await prom;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkBrowserFeatures() {
|
||||
if (!window.Modernizr) {
|
||||
|
||||
@@ -45,6 +45,7 @@ let userId: string;
|
||||
let jitsiAuth: string;
|
||||
let roomId: string;
|
||||
let openIdToken: IOpenIDCredentials;
|
||||
let roomName: string;
|
||||
|
||||
let widgetApi: WidgetApi;
|
||||
let meetApi: any; // JitsiMeetExternalAPI
|
||||
@@ -104,6 +105,7 @@ let meetApi: any; // JitsiMeetExternalAPI
|
||||
userId = qsParam('userId');
|
||||
jitsiAuth = qsParam('auth', true);
|
||||
roomId = qsParam('roomId', true);
|
||||
roomName = qsParam('roomName', true);
|
||||
|
||||
if (widgetApi) {
|
||||
await readyPromise;
|
||||
@@ -226,6 +228,7 @@ function joinConference() { // event handler bound in HTML
|
||||
if (displayName) meetApi.executeCommand("displayName", displayName);
|
||||
if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl);
|
||||
if (userId) meetApi.executeCommand("email", userId);
|
||||
if (roomName) meetApi.executeCommand("subject", roomName);
|
||||
|
||||
meetApi.on("readyToClose", () => {
|
||||
switchVisibleContainers();
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
Copyright 2021 New Vector Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
export async function settled(...promises: Array<Promise<any>>) {
|
||||
for (const prom of promises) {
|
||||
try {
|
||||
await prom;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
Copyright 2021 New Vector Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import AppTile from "matrix-react-sdk/src/components/views/elements/AppTile";
|
||||
import { IWidget } from "matrix-widget-api";
|
||||
import MatrixClientContext from "matrix-react-sdk/src/contexts/MatrixClientContext";
|
||||
import { MatrixClientPeg } from "matrix-react-sdk/src/MatrixClientPeg";
|
||||
|
||||
// add React and ReactPerf to the global namespace, to make them easier to access via the console
|
||||
// this incidentally means we can forget our React imports in JSX files without penalty.
|
||||
window.React = React;
|
||||
|
||||
export interface IStartOpts {
|
||||
widgetId: string;
|
||||
roomId?: string;
|
||||
}
|
||||
|
||||
export async function loadApp(widget: IWidget) {
|
||||
return (
|
||||
<MatrixClientContext.Provider value={MatrixClientPeg.get()}>
|
||||
<div id="mx_ThinWrapper_container">
|
||||
<AppTile
|
||||
app={widget}
|
||||
fullWidth={true}
|
||||
userId={MatrixClientPeg.get().getUserId()}
|
||||
userWidget={false}
|
||||
/>
|
||||
</div>
|
||||
</MatrixClientContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Thin Widget</title>
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
<noscript>Sorry, this requires JavaScript to be enabled.</noscript> <!-- TODO: Translate this? -->
|
||||
<section id="matrixchat" style="height: 100%; overflow: auto;" class="notranslate"></section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
Copyright 2021 New Vector Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// TODO: Match the user's theme: https://github.com/vector-im/element-web/issues/12794
|
||||
|
||||
@font-face {
|
||||
font-family: 'Nunito';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url('~matrix-react-sdk/res/fonts/Nunito/Nunito-Regular.ttf') format('truetype');
|
||||
}
|
||||
|
||||
$dark-fg: #edf3ff;
|
||||
$dark-bg: #363c43;
|
||||
$light-fg: #2e2f32;
|
||||
$light-bg: #fff;
|
||||
body {
|
||||
font-family: Nunito, Arial, Helvetica, sans-serif;
|
||||
background-color: $dark-bg;
|
||||
color: $dark-fg;
|
||||
}
|
||||
|
||||
body.theme-light {
|
||||
background-color: $light-bg;
|
||||
color: $light-fg;
|
||||
}
|
||||
|
||||
body, html {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#mx_ThinWrapper_container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
|
||||
.mx_AppTileFullWidth {
|
||||
width: unset !important;
|
||||
height: calc(100% - 10px); // 5px top + bottom borders on the AppTile
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
Copyright 2021 New Vector Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// We have to trick webpack into loading our CSS for us.
|
||||
require("./index.scss");
|
||||
import * as qs from 'querystring';
|
||||
import { settled } from "../promise_utils";
|
||||
import ReactDOM from 'react-dom';
|
||||
import { StopGapWidgetDriver, WidgetRenderMode } from "matrix-react-sdk/src/stores/widgets/StopGapWidgetDriver";
|
||||
import WidgetUtils from "matrix-react-sdk/src/utils/WidgetUtils";
|
||||
import { MatrixClientPeg } from "matrix-react-sdk/src/MatrixClientPeg";
|
||||
|
||||
// The widget's options are encoded into the fragment to avoid leaking info to the server. The widget
|
||||
// spec on the other hand requires the widgetId and parentUrl to show up in the regular query string.
|
||||
const widgetQuery = qs.parse(window.location.hash.substring(2));
|
||||
const qsParam = (name: string, optional = false): string => {
|
||||
if (!optional && (!widgetQuery[name] || typeof (widgetQuery[name]) !== 'string')) {
|
||||
throw new Error(`Expected singular ${name} in query string`);
|
||||
}
|
||||
return widgetQuery[name] as string;
|
||||
};
|
||||
|
||||
const accessToken = qsParam("accessToken");
|
||||
const homeserverUrl = qsParam("hsUrl");
|
||||
const roomId = qsParam("roomId", true);
|
||||
const widgetId = qsParam("widgetId"); // state_key or account data key
|
||||
|
||||
// TODO: clear href so people don't accidentally copy/paste it
|
||||
//window.location.hash = '';
|
||||
|
||||
(async function() {
|
||||
const {
|
||||
rageshakePromise,
|
||||
preparePlatform,
|
||||
loadSkin,
|
||||
loadOlm, // to handle timelines
|
||||
loadLanguage,
|
||||
loadTheme,
|
||||
showError,
|
||||
_t,
|
||||
} = await import(
|
||||
/* webpackChunkName: "thin-wrapper-init" */
|
||||
/* webpackPreload: true */
|
||||
"../init");
|
||||
|
||||
try {
|
||||
// give rageshake a chance to load/fail, we don't actually assert rageshake loads, we allow it to fail if no IDB
|
||||
console.log("Waiting for rageshake...");
|
||||
await settled(rageshakePromise);
|
||||
|
||||
console.log("Running startup...");
|
||||
StopGapWidgetDriver.RENDER_MODE = WidgetRenderMode.ThinWrapper;
|
||||
await loadSkin();
|
||||
await loadOlm();
|
||||
preparePlatform();
|
||||
await MatrixClientPeg.shim(homeserverUrl, accessToken);
|
||||
await loadTheme();
|
||||
await loadLanguage();
|
||||
|
||||
console.log("Locating widget...");
|
||||
const stateEvent = await MatrixClientPeg.get()._http.authedRequest(
|
||||
undefined, "GET",
|
||||
`/rooms/${encodeURIComponent(roomId)}/state/im.vector.modular.widgets/${encodeURIComponent(widgetId)}`,
|
||||
undefined, undefined, {},
|
||||
);
|
||||
if (!stateEvent?.url) {
|
||||
throw new Error("Invalid widget");
|
||||
}
|
||||
const app = WidgetUtils.makeAppConfig(
|
||||
widgetId,
|
||||
stateEvent,
|
||||
MatrixClientPeg.get().getUserId(), // assume we are the sender
|
||||
roomId,
|
||||
widgetId);
|
||||
|
||||
// Now we can start our custom code
|
||||
console.log("Loading app...");
|
||||
const module = await import(
|
||||
/* webpackChunkName: "thin-wrapper-app" */
|
||||
/* webpackPreload: true */
|
||||
"./app");
|
||||
window.matrixChat = ReactDOM.render(await module.loadApp(app),
|
||||
document.getElementById('matrixchat'));
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
// Like the compatibility page, AWOOOOOGA at the user
|
||||
// This uses the default brand since the app config is unavailable.
|
||||
await showError(_t("Your Element is misconfigured"), [
|
||||
err.translatedMessage || _t("Unexpected error preparing the app. See console for details."),
|
||||
]);
|
||||
}
|
||||
})();
|
||||
@@ -31,15 +31,6 @@ module.exports = (env, argv) => {
|
||||
const reactSdkSrcDir = path.resolve(require.resolve("matrix-react-sdk/package.json"), '..', 'src');
|
||||
const jsSdkSrcDir = path.resolve(require.resolve("matrix-js-sdk/package.json"), '..', 'src');
|
||||
|
||||
const themeBundles = {
|
||||
"theme-legacy": "./node_modules/matrix-react-sdk/res/themes/legacy-light/css/legacy-light.scss",
|
||||
"theme-legacy-dark": "./node_modules/matrix-react-sdk/res/themes/legacy-dark/css/legacy-dark.scss",
|
||||
"theme-light": "./node_modules/matrix-react-sdk/res/themes/light/css/light.scss",
|
||||
"theme-dark": "./node_modules/matrix-react-sdk/res/themes/dark/css/dark.scss",
|
||||
"theme-light-custom": "./node_modules/matrix-react-sdk/res/themes/light-custom/css/light-custom.scss",
|
||||
"theme-dark-custom": "./node_modules/matrix-react-sdk/res/themes/dark-custom/css/dark-custom.scss",
|
||||
};
|
||||
|
||||
return {
|
||||
...development,
|
||||
|
||||
@@ -49,10 +40,14 @@ module.exports = (env, argv) => {
|
||||
"mobileguide": "./src/vector/mobile_guide/index.js",
|
||||
"jitsi": "./src/vector/jitsi/index.ts",
|
||||
"usercontent": "./node_modules/matrix-react-sdk/src/usercontent/index.js",
|
||||
"thinwidget": "./src/vector/thin_widget/index.ts",
|
||||
|
||||
// CSS themes
|
||||
...themeBundles,
|
||||
"theme-legacy": "./node_modules/matrix-react-sdk/res/themes/legacy-light/css/legacy-light.scss",
|
||||
"theme-legacy-dark": "./node_modules/matrix-react-sdk/res/themes/legacy-dark/css/legacy-dark.scss",
|
||||
"theme-light": "./node_modules/matrix-react-sdk/res/themes/light/css/light.scss",
|
||||
"theme-dark": "./node_modules/matrix-react-sdk/res/themes/dark/css/dark.scss",
|
||||
"theme-light-custom": "./node_modules/matrix-react-sdk/res/themes/light-custom/css/light-custom.scss",
|
||||
"theme-dark-custom": "./node_modules/matrix-react-sdk/res/themes/dark-custom/css/dark-custom.scss",
|
||||
},
|
||||
|
||||
optimization: {
|
||||
@@ -318,7 +313,7 @@ module.exports = (env, argv) => {
|
||||
// HtmlWebpackPlugin will screw up our formatting like the names
|
||||
// of the themes and which chunks we actually care about.
|
||||
inject: false,
|
||||
excludeChunks: ['mobileguide', 'usercontent', 'jitsi', 'thinwidget'],
|
||||
excludeChunks: ['mobileguide', 'usercontent', 'jitsi'],
|
||||
minify: argv.mode === 'production',
|
||||
vars: {
|
||||
og_image_url: og_image_url,
|
||||
@@ -333,14 +328,6 @@ module.exports = (env, argv) => {
|
||||
chunks: ['jitsi'],
|
||||
}),
|
||||
|
||||
// This is a small thin wrapper for widgets (popout; isolated stack)
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/vector/thin_widget/index.html',
|
||||
filename: 'thin_widget.html',
|
||||
minify: argv.mode === 'production',
|
||||
chunks: ['thinwidget', ...Object.keys(themeBundles)],
|
||||
}),
|
||||
|
||||
// This is the mobile guide's entry point (separate for faster mobile loading)
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/vector/mobile_guide/index.html',
|
||||
|
||||
30
yarn.lock
30
yarn.lock
@@ -3049,11 +3049,6 @@ commander@^2.19.0, commander@^2.20.0:
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
||||
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
|
||||
|
||||
commander@^6.1.0:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
|
||||
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==
|
||||
|
||||
commander@~2.19.0:
|
||||
version "2.19.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
|
||||
@@ -7511,9 +7506,10 @@ mathml-tag-names@^2.1.3:
|
||||
resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3"
|
||||
integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==
|
||||
|
||||
"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop":
|
||||
version "9.6.0"
|
||||
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/6ad3fb16b3813c717943f6bc8bca5a55fe325477"
|
||||
matrix-js-sdk@9.8.0:
|
||||
version "9.8.0"
|
||||
resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.8.0.tgz#d71d8c777d2fea3dbc9a050060e4f1a74217dca6"
|
||||
integrity sha512-QKRsnmId53upz4oMhQzm119lT0EcST2SZhnKRRFyykxZI0x7qSulnTTUwztpS/g9yZuZqy7PTVUTHOE2caX5IQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.12.5"
|
||||
another-json "^0.2.0"
|
||||
@@ -7533,9 +7529,10 @@ matrix-mock-request@^1.2.3:
|
||||
bluebird "^3.5.0"
|
||||
expect "^1.20.2"
|
||||
|
||||
"matrix-react-sdk@github:matrix-org/matrix-react-sdk#develop":
|
||||
version "3.13.1"
|
||||
resolved "https://codeload.github.com/matrix-org/matrix-react-sdk/tar.gz/e9740f5a693861fb993bf9b85560d6c25784bca9"
|
||||
matrix-react-sdk@3.15.0:
|
||||
version "3.15.0"
|
||||
resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.15.0.tgz#08ceba225383affa194632dceb3408dcb9127fde"
|
||||
integrity sha512-85dSe0dBptgC6U98ujN6RIA8WSmRGWnxOW6Ph8LiEsAjI4FKxaShsPjuNM6PDBd5Fl/5ygktA7s3JYzDMJVIrA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.12.5"
|
||||
await-lock "^2.1.0"
|
||||
@@ -7563,13 +7560,12 @@ matrix-mock-request@^1.2.3:
|
||||
katex "^0.12.0"
|
||||
linkifyjs "^2.1.9"
|
||||
lodash "^4.17.20"
|
||||
matrix-js-sdk "github:matrix-org/matrix-js-sdk#develop"
|
||||
matrix-js-sdk "9.8.0"
|
||||
matrix-widget-api "^0.1.0-beta.13"
|
||||
minimist "^1.2.5"
|
||||
pako "^2.0.3"
|
||||
parse5 "^6.0.1"
|
||||
png-chunks-extract "^1.0.0"
|
||||
project-name-generator "^2.1.9"
|
||||
prop-types "^15.7.2"
|
||||
qrcode "^1.4.4"
|
||||
qs "^6.9.6"
|
||||
@@ -9700,14 +9696,6 @@ progress@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
|
||||
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
|
||||
|
||||
project-name-generator@^2.1.9:
|
||||
version "2.1.9"
|
||||
resolved "https://registry.yarnpkg.com/project-name-generator/-/project-name-generator-2.1.9.tgz#959177f1feb2355d74fa98745d72a65a5f75b674"
|
||||
integrity sha512-QmLHqz2C4VHmAyDEAFlVfnuWAHr4vwZhK2bbm4IrwuHNzNKOdG9b4U+NmQbsm1uOoV4kGWv7+FVLsu7Bb/ieYQ==
|
||||
dependencies:
|
||||
commander "^6.1.0"
|
||||
lodash "^4.17.20"
|
||||
|
||||
promise-inflight@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
|
||||
|
||||
Reference in New Issue
Block a user