Compare commits

...

300 Commits

Author SHA1 Message Date
RiotRobot
153d0badf5 v1.10.7 2022-03-15 14:47:32 +00:00
RiotRobot
c6b25e86eb Prepare changelog for v1.10.7 2022-03-15 14:47:31 +00:00
Element Translate Bot
08f8f88508 Translations update from Weblate (#327)
* Added translation using Weblate (Vietnamese)

* Added translation using Weblate (English (United States))

* Translated using Weblate (English (United States))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/en_US/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

* Translated using Weblate (Frisian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/fy/

* Added translation using Weblate (Polish)

* Translated using Weblate (Polish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/pl/

* Added translation using Weblate (Chinese (Traditional))

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/zh_Hant/

* Added translation using Weblate (Slovak)

* Added translation using Weblate (Turkish)

* Translated using Weblate (Hebrew)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/he/

* Translated using Weblate (Indonesian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/id/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/tr/

* Added translation using Weblate (Norwegian Nynorsk)

* Translated using Weblate (Norwegian Nynorsk)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/nn/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

* Translated using Weblate (Icelandic)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/is/

Co-authored-by: Dinh Quang Tuyen <tuyen.dinh@aarenet.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: James Salter <iteration@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Fjoerfoks <fryskefirefox@gmail.com>
Co-authored-by: m1chj <8hm0nutuhsa9@opayq.com>
Co-authored-by: SiderealArt <nelson22768384@gmail.com>
Co-authored-by: Tomas <tominokov@gmail.com>
Co-authored-by: Erkin Alp Güney <erkinalp9035@gmail.com>
Co-authored-by: Vulcan <element@zbug.anonaddy.com>
Co-authored-by: Linerly <linerly@protonmail.com>
Co-authored-by: Bjørn I.Svindseth <bjorni.svindseth@yahoo.com>
Co-authored-by: Jozef Gaal <preklady@mayday.sk>
Co-authored-by: Bui Minh Duc <m.nhduc.bui1@gmail.com>
Co-authored-by: Sveinn í Felli <sv1@fellsnet.is>
2022-03-08 10:41:44 +00:00
RiotRobot
6e8aa5e308 Merge branch 'master' into develop 2022-03-01 12:09:39 +00:00
RiotRobot
e1651f30b4 v1.10.6 2022-03-01 12:09:26 +00:00
RiotRobot
e7cccf6ad1 Prepare changelog for v1.10.6 2022-03-01 12:09:26 +00:00
RiotRobot
ce8d31f4ea Merge branch 'master' into develop 2022-02-28 17:38:23 +00:00
RiotRobot
07c11853f5 v1.10.5 2022-02-28 17:38:11 +00:00
RiotRobot
60e42e4cfa Prepare changelog for v1.10.5 2022-02-28 17:38:10 +00:00
James Salter
7fea56ed8b Update native-node-modules.md (#326) 2022-02-28 11:03:33 +00:00
Element Translate Bot
193487eb9e Translations update from Weblate (#325)
* Added translation using Weblate (Vietnamese)

* Added translation using Weblate (English (United States))

* Translated using Weblate (English (United States))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/en_US/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

* Translated using Weblate (Frisian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/fy/

* Added translation using Weblate (Polish)

* Translated using Weblate (Polish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/pl/

* Added translation using Weblate (Chinese (Traditional))

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/zh_Hant/

* Added translation using Weblate (Slovak)

* Added translation using Weblate (Turkish)

* Translated using Weblate (Hebrew)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/he/

* Translated using Weblate (Indonesian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/id/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/tr/

* Added translation using Weblate (Norwegian Nynorsk)

* Translated using Weblate (Norwegian Nynorsk)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/nn/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

* Translated using Weblate (Icelandic)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/is/

Co-authored-by: Dinh Quang Tuyen <tuyen.dinh@aarenet.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: James Salter <iteration@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Fjoerfoks <fryskefirefox@gmail.com>
Co-authored-by: m1chj <8hm0nutuhsa9@opayq.com>
Co-authored-by: SiderealArt <nelson22768384@gmail.com>
Co-authored-by: Tomas <tominokov@gmail.com>
Co-authored-by: Erkin Alp Güney <erkinalp9035@gmail.com>
Co-authored-by: Vulcan <element@zbug.anonaddy.com>
Co-authored-by: Linerly <linerly@protonmail.com>
Co-authored-by: Bjørn I.Svindseth <bjorni.svindseth@yahoo.com>
Co-authored-by: Jozef Gaal <preklady@mayday.sk>
Co-authored-by: Bui Minh Duc <m.nhduc.bui1@gmail.com>
Co-authored-by: Sveinn í Felli <sv1@fellsnet.is>
2022-02-22 10:49:54 +00:00
RiotRobot
0f54e90250 Merge branch 'master' into develop 2022-02-17 12:23:38 +00:00
RiotRobot
467e6189f7 v1.10.4 2022-02-17 12:23:26 +00:00
RiotRobot
5c527e3bc9 Prepare changelog for v1.10.4 2022-02-17 12:23:26 +00:00
James Salter
f0107d64a9 Refactor the build docs into something easier to follow (#324)
* Refactor the build docs into something easier to follow

* fix typo
2022-02-16 11:25:14 +00:00
RiotRobot
fb8fff7799 Merge branch 'master' into develop 2022-02-14 18:32:49 +00:00
RiotRobot
031043f2d8 v1.10.3 2022-02-14 18:32:37 +00:00
RiotRobot
926ecec65f Prepare changelog for v1.10.3 2022-02-14 18:32:36 +00:00
David Baker
fb5490e8e8 Provide map style config for release (#321) (#322)
And update nightly from the trial version we were using.

Co-authored-by: Andy Balaam <mail@artificialworlds.net>
2022-02-14 18:02:13 +00:00
Andy Balaam
65a446db75 Provide map style config for release (#321)
And update nightly from the trial version we were using.
2022-02-14 17:53:32 +00:00
RiotRobot
ca91532635 Merge branch 'master' into develop 2022-02-14 15:59:15 +00:00
RiotRobot
8f71628533 v1.10.2 2022-02-14 15:59:02 +00:00
RiotRobot
9359c38939 Prepare changelog for v1.10.2 2022-02-14 15:59:01 +00:00
Šimon Brandner
634c5c66a6 Switch to IPC channel for getDesktopCapturerSources (#320) 2022-02-11 10:38:19 +00:00
David Baker
a80bc76e22 Upgrade to electron 17 (#318)
In theory, this might make https://github.com/vector-im/element-web/issues/20467 go away
2022-02-08 19:25:06 +00:00
David Baker
230657b1db Yarn upgrade (#317) 2022-02-08 19:17:09 +00:00
Michael Telatynski
da6b3b02f2 Enable new search experience by default on Develop & Nightly (#314) 2022-02-08 14:03:01 +00:00
RiotRobot
e2b9922d44 Merge branch 'master' into develop 2022-02-01 16:08:24 +00:00
RiotRobot
3421979db4 v1.10.1 2022-02-01 16:08:14 +00:00
RiotRobot
47f59a4840 Prepare changelog for v1.10.1 2022-02-01 16:08:13 +00:00
David Baker
e3f3814a25 yarn upgrade (#313) 2022-01-31 17:06:55 +00:00
RiotRobot
ec4057f7e5 v1.10.0 2022-01-31 15:09:41 +00:00
RiotRobot
275e228387 Prepare changelog for v1.10.0 2022-01-31 15:09:40 +00:00
Maxwell Clarke
61ed2a21c6 "Show/Hide" tray action shows window from background instead of hiding it. (#312) 2022-01-31 12:15:31 +00:00
David Baker
8fd24d2fa2 Downgrade to electron 15 (#311)
Attempt 2 of https://github.com/vector-im/element-desktop/pull/310 after conflicting dependabot PR

Due to https://github.com/vector-im/element-web/issues/20467
2022-01-26 16:45:58 +00:00
dependabot[bot]
bfb96a33ba Bump node-fetch from 2.6.6 to 2.6.7 (#309)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.6 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.6...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 16:35:36 +00:00
David Baker
0d37d8d8e9 Upgrade to electron 16.0.7 (#308)
Couple of minor fixes (although doesn't look like it fixes https://github.com/vector-im/element-web/issues/20467)

Also un-pin the version as we now can (and should) upgrade electron
as we would a regular dependency.
2022-01-26 13:31:39 +00:00
Faye Duxovni
f4ee34cc56 Set app name for UISI autorageshakes in element.io configs (#307) 2022-01-25 10:57:10 -05:00
Element Translate Bot
379a9e9969 Translations update from Weblate (#306)
* Added translation using Weblate (Vietnamese)

* Added translation using Weblate (English (United States))

* Translated using Weblate (English (United States))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/en_US/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

* Translated using Weblate (Frisian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/fy/

* Added translation using Weblate (Polish)

* Translated using Weblate (Polish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/pl/

* Added translation using Weblate (Chinese (Traditional))

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/zh_Hant/

* Added translation using Weblate (Slovak)

* Added translation using Weblate (Turkish)

* Translated using Weblate (Hebrew)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/he/

* Translated using Weblate (Indonesian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/id/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/tr/

* Added translation using Weblate (Norwegian Nynorsk)

* Translated using Weblate (Norwegian Nynorsk)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/nn/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

Co-authored-by: Dinh Quang Tuyen <tuyen.dinh@aarenet.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: James Salter <iteration@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Fjoerfoks <fryskefirefox@gmail.com>
Co-authored-by: m1chj <8hm0nutuhsa9@opayq.com>
Co-authored-by: SiderealArt <nelson22768384@gmail.com>
Co-authored-by: Tomas <tominokov@gmail.com>
Co-authored-by: Erkin Alp Güney <erkinalp9035@gmail.com>
Co-authored-by: Vulcan <element@zbug.anonaddy.com>
Co-authored-by: Linerly <linerly@protonmail.com>
Co-authored-by: Bjørn I.Svindseth <bjorni.svindseth@yahoo.com>
Co-authored-by: Jozef Gaal <preklady@mayday.sk>
Co-authored-by: Bui Minh Duc <m.nhduc.bui1@gmail.com>
2022-01-25 15:20:25 +00:00
Michael Telatynski
4b6983747e De-labs Metaspaces (#305) 2022-01-25 12:33:27 +00:00
RiotRobot
8027988239 Merge branch 'master' into develop 2022-01-17 14:37:10 +00:00
RiotRobot
025a8808b8 v1.9.9 2022-01-17 14:36:53 +00:00
RiotRobot
528a93a3a9 Prepare changelog for v1.9.9 2022-01-17 14:36:52 +00:00
David Baker
5b3301bb0e Upgrade docker iage to bionic (#303)
xenial is no longer in LTS, so the docker image just doesn't build
anymore (lacks the letsencrypt ISRG root cert that classic.yarnpkg.com
uses).

Upgrade to the next LTS (bionic).

The libcurl change essentally reverts a change made when changing
back to xenial initially (xenial had curl3 and bionic has 4, so
installing a different libcurl version caused curl itself to be
removed).

Headlines: The Linux build image has been updated to bionic. This version of element will use a newer glibc which will drop support for some older systems.
2022-01-14 16:24:46 +00:00
James Salter
747b596e8b Enable posthog in release (#302) 2022-01-13 16:55:44 +00:00
J. Ryan Stinnett
9aaeab2221 Use published matrix-web-i18n (#301) 2022-01-13 10:30:19 +00:00
J. Ryan Stinnett
87c5232ba5 Disable Git interactive auth when fetching deps (#298) 2022-01-12 11:02:51 +00:00
David Baker
771483d324 Yarn upgrade (#300) 2022-01-11 17:17:28 +00:00
Michael Telatynski
90359643ba Upgrade to Electron 16 (#299) 2022-01-11 16:15:08 +00:00
Element Translate Bot
ccade5eccf Translations update from Weblate (#297)
* Added translation using Weblate (Vietnamese)

* Added translation using Weblate (English (United States))

* Translated using Weblate (English (United States))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/en_US/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

* Translated using Weblate (Frisian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/fy/

* Added translation using Weblate (Polish)

* Translated using Weblate (Polish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/pl/

* Added translation using Weblate (Chinese (Traditional))

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/zh_Hant/

* Added translation using Weblate (Slovak)

* Added translation using Weblate (Turkish)

* Translated using Weblate (Hebrew)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/he/

* Translated using Weblate (Indonesian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/id/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/tr/

* Added translation using Weblate (Norwegian Nynorsk)

* Translated using Weblate (Norwegian Nynorsk)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/nn/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

Co-authored-by: Dinh Quang Tuyen <tuyen.dinh@aarenet.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: James Salter <iteration@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Fjoerfoks <fryskefirefox@gmail.com>
Co-authored-by: m1chj <8hm0nutuhsa9@opayq.com>
Co-authored-by: SiderealArt <nelson22768384@gmail.com>
Co-authored-by: Tomas <tominokov@gmail.com>
Co-authored-by: Erkin Alp Güney <erkinalp9035@gmail.com>
Co-authored-by: Vulcan <element@zbug.anonaddy.com>
Co-authored-by: Linerly <linerly@protonmail.com>
Co-authored-by: Bjørn I.Svindseth <bjorni.svindseth@yahoo.com>
Co-authored-by: Jozef Gaal <preklady@mayday.sk>
2022-01-11 11:47:51 +00:00
Travis Ralston
79b0f14984 Fix git protocol usage for CI (#296)
Prevents this:
```
+ git clone git://github.com/matrix-org/matrix-js-sdk.git matrix-js-sdk --branch develop --depth 1
Cloning into 'matrix-js-sdk'...
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
```
2022-01-11 09:06:07 +00:00
J. Ryan Stinnett
989e030d97 Update linting plugin (#294) 2022-01-10 12:57:33 +00:00
Michael Telatynski
531dde8bff Fix open button for downloads not working due to ipc filtering (#295) 2022-01-10 11:35:23 +00:00
Michael Telatynski
99ce48be8c Abstract electron download path behind an opaque id (#292) 2021-12-21 15:34:59 +00:00
RiotRobot
f18be113c3 Merge branch 'master' into develop 2021-12-20 14:43:15 +00:00
RiotRobot
8b25178aed v1.9.8 2021-12-20 14:43:02 +00:00
RiotRobot
eef3dfc724 Prepare changelog for v1.9.8 2021-12-20 14:43:02 +00:00
David Baker
37d7559d86 Change module mode for hak (#291)
Turns out the previous setting didn't work, and apparently this
needs to be CommonJS.
2021-12-15 15:40:26 +00:00
David Baker
326e6577e1 Convert hak to TypeScript (#289)
* Convert hak to TypeScript

* Fix linter & remove stray log line

* Fix more linting errors

In one case by switching to import() and hence esnext

* Return type for getNodeModuleBin

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* More types

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2021-12-14 14:32:27 +00:00
Element Translate Bot
18500e7ec3 Translations update from Weblate (#290)
* Added translation using Weblate (Vietnamese)

* Added translation using Weblate (English (United States))

* Translated using Weblate (English (United States))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/en_US/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

* Translated using Weblate (Frisian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/fy/

* Added translation using Weblate (Polish)

* Translated using Weblate (Polish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/pl/

* Added translation using Weblate (Chinese (Traditional))

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/zh_Hant/

* Added translation using Weblate (Slovak)

* Added translation using Weblate (Turkish)

* Translated using Weblate (Hebrew)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/he/

* Translated using Weblate (Indonesian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/id/

* Translated using Weblate (Slovak)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/sk/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/tr/

Co-authored-by: Dinh Quang Tuyen <tuyen.dinh@aarenet.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: James Salter <iteration@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Fjoerfoks <fryskefirefox@gmail.com>
Co-authored-by: m1chj <8hm0nutuhsa9@opayq.com>
Co-authored-by: SiderealArt <nelson22768384@gmail.com>
Co-authored-by: Tomas <tominokov@gmail.com>
Co-authored-by: Erkin Alp Güney <erkinalp9035@gmail.com>
Co-authored-by: Vulcan <element@zbug.anonaddy.com>
Co-authored-by: Linerly <linerly@protonmail.com>
2021-12-14 13:06:46 +00:00
Michael Telatynski
1cd299b98e Update typescript-eslint plugin & parser (#286) 2021-12-13 23:34:46 +00:00
David Baker
3c8650065c Use app-builder-lib to get electron version (#288)
So we can get it the same way electron-builder does and not need
electronVersion in package.json
2021-12-13 21:15:17 +00:00
David Baker
e2bdedfec1 Put electronVersion back (#287)
seems letting electron builder take it from the dependencies confuses
the keytar build process
2021-12-13 17:04:03 +00:00
RiotRobot
aa6e4d5ce2 Merge branch 'master' into develop 2021-12-13 15:45:09 +00:00
RiotRobot
846a8df9a6 v1.9.7 2021-12-13 15:44:56 +00:00
RiotRobot
eb8429ae9d Prepare changelog for v1.9.7 2021-12-13 15:44:56 +00:00
David Baker
89b1e39b80 Merge pull request from GHSA-mjrg-9f8r-h3m7
* Patch part 1: remove electronVersion

We no longer need to specify electronVersion at all since electron
is now in devDependencies. Removing it means electron can be updated
the same way as any other dependency.

* Only allow main app page to be opened via URL

We previously allowed any URL to be opened in the main electron
window. Allow only the main app page, as commented.

* use exact equals

* Make url logic clearer
2021-12-13 15:35:27 +00:00
David Baker
b9880e2463 Merge pull request from GHSA-mjrg-9f8r-h3m7
* Patch part 1: remove electronVersion

We no longer need to specify electronVersion at all since electron
is now in devDependencies. Removing it means electron can be updated
the same way as any other dependency.

* Only allow main app page to be opened via URL

We previously allowed any URL to be opened in the main electron
window. Allow only the main app page, as commented.

* use exact equals

* Make url logic clearer
2021-12-13 15:09:53 +00:00
Michael Telatynski
7f292b12ea Update Typescript to 4.5 (#285) 2021-12-13 13:39:24 +00:00
Šimon Brandner
3599a015d7 Enable webgl (#284) 2021-12-10 14:55:35 +00:00
Michael Telatynski
0681fa81a4 Add map_style_url to Element Nightly (#282) 2021-12-06 17:08:57 +00:00
RiotRobot
b79645adb4 v1.9.6 2021-12-06 15:43:57 +00:00
RiotRobot
f52b10a63a Prepare changelog for v1.9.6 2021-12-06 15:43:56 +00:00
J. Ryan Stinnett
e100388495 Upgrade allchange to 1.0.6 (#280) 2021-11-30 17:56:12 +00:00
Element Translate Bot
aacb8cb349 Translations update from Weblate (#279)
* Added translation using Weblate (Vietnamese)

* Added translation using Weblate (English (United States))

* Translated using Weblate (English (United States))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/en_US/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

* Translated using Weblate (Frisian)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/fy/

* Added translation using Weblate (Polish)

* Translated using Weblate (Polish)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/pl/

* Added translation using Weblate (Chinese (Traditional))

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/zh_Hant/

Co-authored-by: Dinh Quang Tuyen <tuyen.dinh@aarenet.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: James Salter <iteration@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Fjoerfoks <fryskefirefox@gmail.com>
Co-authored-by: m1chj <8hm0nutuhsa9@opayq.com>
Co-authored-by: SiderealArt <nelson22768384@gmail.com>
2021-11-30 17:38:00 +00:00
RiotRobot
20d9e2b14b v1.9.5 2021-11-22 14:44:25 +00:00
RiotRobot
9b96700daf Prepare changelog for v1.9.5 2021-11-22 14:44:24 +00:00
Element Translate Bot
ffd6cf5ad7 Translations update from Weblate (#278)
* Added translation using Weblate (Vietnamese)

* Added translation using Weblate (English (United States))

* Translated using Weblate (English (United States))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/en_US/

* Translated using Weblate (Vietnamese)

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/vi/

Co-authored-by: Dinh Quang Tuyen <tuyen.dinh@aarenet.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: James Salter <iteration@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
2021-11-15 15:32:10 +00:00
Michael Telatynski
4a44ad0a8f Enable feature_spaces_metaspaces on Nightly (#277) 2021-11-11 13:07:49 +00:00
RiotRobot
548f22d438 v1.9.4 2021-11-08 18:05:01 +00:00
RiotRobot
145485326a Prepare changelog for v1.9.4 2021-11-08 18:05:00 +00:00
David Baker
8dd564a7dc Update allchange to 1.0.5 (#276) 2021-11-02 13:30:28 +00:00
Element Translate Bot
12809ff4fd Translations update from Weblate (#275)
* Added translation using Weblate (Vietnamese)

* Added translation using Weblate (English (United States))

* Translated using Weblate (English (United States))

Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/en_US/

Co-authored-by: Dinh Quang Tuyen <tuyen.dinh@aarenet.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: James Salter <iteration@gmail.com>
2021-11-02 12:03:50 +00:00
RiotRobot
26e02eff94 Merge branch 'master' into develop 2021-10-25 11:49:06 +01:00
RiotRobot
4b23aaa31e v1.9.3 2021-10-25 11:48:54 +01:00
RiotRobot
fc86ad3db0 Prepare changelog for v1.9.3 2021-10-25 11:48:54 +01:00
Travis Ralston
0af82dbbbd Update allchange (#273) 2021-10-19 18:21:33 +01:00
Germain
0c3736f3af Merge pull request #272 from RiotTranslateBot/weblate-element-desktop-element-desktop
Translations update from Weblate
2021-10-19 10:36:57 +01:00
Linerly
7af662cd38 Translated using Weblate (Indonesian)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/id/
2021-10-19 09:34:50 +00:00
Jiri Grönroos
4bc4eb74e2 Translated using Weblate (Finnish)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/fi/
2021-10-13 19:25:35 +00:00
RiotRobot
c68dcab7c6 Merge branch 'master' into develop 2021-10-12 09:15:46 +01:00
RiotRobot
f53e12624e v1.9.2 2021-10-12 09:15:26 +01:00
RiotRobot
5cefdb028d Prepare changelog for v1.9.2 2021-10-12 09:15:25 +01:00
Michael Telatynski
48b01f7070 Merge pull request #271 from vector-im/t3chguy/fix/16942 2021-10-11 14:59:18 +01:00
RiotRobot
1122c41cc1 v1.9.1 2021-10-11 12:24:02 +01:00
RiotRobot
54d13516b7 Prepare changelog for v1.9.1 2021-10-11 12:24:02 +01:00
Michael Telatynski
b662846bf1 Only set badgeCount on Mac/Linux because Windows is made of fail 2021-10-11 09:13:30 +01:00
Germain
f5ee82a8ca Merge pull request #270 from vector-im/gsouquet/fix-19261 2021-10-06 11:36:43 +01:00
Germain Souquet
c1bc40d9f8 Upgrade to electron 13.5.1
Fixes an issue where Element-desktop can not establish a connection with a homeserver that has a Let's Encrypt SSL certificate

Fixes vector-im/element-web#19261
2021-10-06 09:01:44 +01:00
Germain
62cb1a36c0 Merge pull request #269 from RiotTranslateBot/weblate-element-desktop-element-desktop
Translations update from Weblate
2021-10-04 11:46:31 +01:00
jelv
859889c3f3 Translated using Weblate (Dutch)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/nl/
2021-09-30 08:25:31 +00:00
jelv
69c946132d Added translation using Weblate (Dutch) 2021-09-28 19:14:32 +00:00
James Salter
74a3e4fd8b Merge pull request #267 from vector-im/electron-13-5
Update to Electron 13.5
2021-09-28 16:23:18 +01:00
James Salter
048b7932bd Update electronVersion 2021-09-28 15:29:03 +01:00
James Salter
2fbb9ca630 Update to Electron 13.5 2021-09-28 15:23:22 +01:00
RiotRobot
67f6c60e52 v1.9.0 2021-09-27 15:20:34 +01:00
RiotRobot
452ab97314 Prepare changelog for v1.9.0 2021-09-27 15:20:34 +01:00
David Baker
f48c5e7de4 Merge pull request #265 from vector-im/dbkr/revert_to_electron_13
Revert to electron 13
2021-09-17 11:09:14 +01:00
David Baker
eaa515de07 Revert to electron 13
electron 14 has chrome 93 which isn't going to work with jitsi
2021-09-17 10:56:25 +01:00
David Baker
b498885b2d Merge pull request #264 from vector-im/dbkr/yarnupgrade_20210914
yarn upgrade
2021-09-15 18:52:10 +01:00
David Baker
db86a3f726 yarn upgrade
Remove `enableRemoteModule` which has now been removed from the types
(the default was false and has been for som time, we were passing
false anyway).
2021-09-15 18:27:50 +01:00
RiotRobot
6b35146f84 v1.8.5 2021-09-14 16:25:48 +01:00
RiotRobot
1659ce7624 changelog 2021-09-14 16:25:25 +01:00
RiotRobot
4e29b24f1e Merge branch 'master' into develop 2021-09-13 13:11:41 +01:00
RiotRobot
4fe261b3d0 v1.8.4 2021-09-13 13:11:28 +01:00
RiotRobot
bf8a648fd4 changelog 2021-09-13 13:11:05 +01:00
James Salter
58d56f0068 Merge pull request #263 from vector-im/config-posthog-nightly
Enable posthog on nightly
2021-09-09 13:44:23 +01:00
James Salter
0e5e92015c Enable posthog on nightly 2021-09-09 11:19:25 +01:00
James Salter
6a4c1afe27 Merge pull request #262 from vector-im/config-sentry-nightly
Add config for sentry
2021-09-09 11:17:40 +01:00
James Salter
bd7e74545a Add config for sentry 2021-09-08 17:20:41 +01:00
Travis Ralston
c16c473dbf Merge pull request #261 from yu-re-ka/feature/fix-enable-features
Only set `enable-features` if the user hasn't
2021-09-06 22:36:26 -06:00
Yureka
96e5389779 Only set enable-features if the user hasn't 2021-09-06 16:18:16 +02:00
RiotRobot
798a042481 Merge branch 'master' into develop 2021-08-31 14:52:41 +01:00
RiotRobot
fdf99f3d53 v1.8.2 2021-08-31 14:52:29 +01:00
RiotRobot
fd16f79a23 Prepare changelog for v1.8.2 2021-08-31 14:52:28 +01:00
David Baker
2b5208f4e6 Merge pull request #259 from vector-im/dbkr/bump_dependencies
Update Dependencies
2021-08-31 13:09:06 +01:00
David Baker
a6b038e207 Merge remote-tracking branch 'origin/develop' into dbkr/bump_dependencies 2021-08-31 13:06:23 +01:00
David Baker
2b4a8a6ca9 Merge pull request #260 from vector-im/dbkr/allchange102
Update changelog generator
2021-08-26 09:41:47 +01:00
David Baker
87ac970ee5 Update changelog generator 2021-08-25 17:21:54 +01:00
David Baker
010ad9825f more yarn upgrade
including allchange update
2021-08-25 09:47:26 +01:00
David Baker
31245c7c3a Seems latest electron is actually 13.2.2 2021-08-24 18:20:45 +01:00
David Baker
f498c7de30 yarn upgrade 2021-08-24 18:20:23 +01:00
David Baker
58611e41d3 Bump electronVersion 2021-08-24 18:18:14 +01:00
David Baker
31a43aeb24 Merge pull request #258 from RiotTranslateBot/weblate-element-desktop-element-desktop
Translations update from Weblate
2021-08-24 13:33:09 +01:00
Martin Berg Alstad
836a99745c Translated using Weblate (Norwegian Bokmål)
Currently translated at 79.5% (35 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/nb_NO/
2021-08-22 12:25:18 +00:00
Weblate
093dde799d Merge branch 'origin/develop' into Weblate. 2021-08-20 08:14:07 +00:00
David Baker
df6fb175b3 Merge pull request #257 from vector-im/dbkr/element_io_release
Switch release build to new update URL
2021-08-20 09:14:04 +01:00
David Baker
de6570c58e New domain for release build too 2021-08-18 17:12:35 +01:00
Weblate
c9eb2379ef Merge branch 'origin/develop' into Weblate. 2021-08-18 14:06:06 +00:00
jonas siversten
bc75eac336 Translated using Weblate (Norwegian Bokmål)
Currently translated at 75.0% (33 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/nb_NO/
2021-08-18 14:06:06 +00:00
David Baker
4117f3f858 Merge pull request #256 from SimonBrandner/fix/screen-sharing-wayland/18607
Enable Pipewire support for Wayland screen-sharing
2021-08-18 15:06:02 +01:00
Šimon Brandner
96203a882c Enable Pipewire support
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-08-18 08:34:06 +02:00
Weblate
2b6d064fb5 Merge branch 'origin/develop' into Weblate. 2021-08-17 08:58:19 +00:00
RiotRobot
7a03dd2b0c Merge branch 'master' into develop 2021-08-17 09:58:15 +01:00
RiotRobot
03862cda8b v1.8.1 2021-08-17 09:58:02 +01:00
RiotRobot
6fd0c7c87e Prepare changelog for v1.8.1 2021-08-17 09:58:02 +01:00
Weblate
0dac5a3384 Merge branch 'origin/develop' into Weblate. 2021-08-16 22:23:26 +00:00
David Baker
bdfc6ac35c Merge pull request #255 from vector-im/dbkr/electron_1319_take_two
Bump to electron 13.1.9
2021-08-16 23:23:23 +01:00
David Baker
71c46e7365 Bump to electron 13.1.9
...take two
2021-08-16 18:07:35 +01:00
Weblate
ea30e1ab96 Merge branch 'origin/develop' into Weblate. 2021-08-16 14:30:31 +00:00
RiotRobot
9fde6791e5 v1.8.0 2021-08-16 15:29:14 +01:00
RiotRobot
13db0f5ea1 Prepare changelog for v1.8.0 2021-08-16 15:29:13 +01:00
Weblate
24a27bbd17 Merge branch 'origin/develop' into Weblate. 2021-08-16 12:31:02 +00:00
David Baker
8146de344b Merge pull request #253 from vector-im/dbkr/update_allchange
Update changelog generator
2021-08-16 13:30:58 +01:00
Weblate
30634ffedd Merge branch 'origin/develop' into Weblate. 2021-08-16 12:30:22 +00:00
David Baker
3e1a9e8db4 Fix date 2021-08-16 13:30:13 +01:00
David Baker
ec8a406348 Update changelog generator 2021-08-16 13:18:14 +01:00
Safa Alfulaij
53d25e14e7 Translated using Weblate (Arabic)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/ar/
2021-08-14 10:25:15 +00:00
David Baker
240c07c65d Merge pull request #252 from vector-im/dependabot/npm_and_yarn/jszip-3.7.1
Bump jszip from 3.6.0 to 3.7.1
2021-08-12 15:07:52 +01:00
dependabot[bot]
019f4fa22e Bump jszip from 3.6.0 to 3.7.1
Bumps [jszip](https://github.com/Stuk/jszip) from 3.6.0 to 3.7.1.
- [Release notes](https://github.com/Stuk/jszip/releases)
- [Changelog](https://github.com/Stuk/jszip/blob/master/CHANGES.md)
- [Commits](https://github.com/Stuk/jszip/compare/v3.6.0...v3.7.1)

---
updated-dependencies:
- dependency-name: jszip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-12 14:03:20 +00:00
David Baker
45c5a4acb5 Merge pull request #251 from vector-im/dbkr/allchange_npm
Use changelog generator from npm
2021-08-12 15:02:35 +01:00
David Baker
af8a686fac Use changelog generator from npm 2021-08-11 21:50:28 +01:00
David Baker
18a9b07218 Merge pull request #250 from RiotTranslateBot/weblate-element-desktop-element-desktop
Translations update from Weblate
2021-08-10 11:30:26 +01:00
Weblate
f26ca3d61d Merge branch 'origin/develop' into Weblate. 2021-08-09 19:21:04 +00:00
David Baker
7e59fa6e21 Merge pull request #249 from vector-im/dbkr/preview_changelog
Add changelog preview action
2021-08-09 20:21:00 +01:00
Weblate
3a8bde850a Merge branch 'origin/develop' into Weblate. 2021-08-09 14:17:04 +00:00
David Baker
609677d9c1 Merge pull request #248 from vector-im/dbkr/mac_universal_update_path
Revert to generic update path for universal builds & switch to new domain
2021-08-09 15:17:01 +01:00
David Baker
d24ae7b4c1 Switch to new domain (finally) 2021-08-09 14:55:26 +01:00
Linerly
368cdd4d20 Translated using Weblate (Indonesian)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/id/
2021-08-08 11:25:13 +00:00
Linerly
2631ceecb8 Added translation using Weblate (Indonesian) 2021-08-07 11:00:07 +00:00
David Baker
9133260b61 Add changelog preview action 2021-08-06 23:05:08 +01:00
David Baker
e4afc40887 Revert to generic update path for universal builds 2021-08-06 22:47:37 +01:00
Weblate
bedc4be8bd Merge branch 'origin/develop' into Weblate. 2021-08-06 16:05:17 +00:00
Germain
1ac971112f Merge pull request #246 from vector-im/gsouquet/tsconfig-types
Change tsconfig to autodiscover all @types packages rather setting them explicitely
2021-08-06 17:05:14 +01:00
Weblate
00bbd043d6 Merge branch 'origin/develop' into Weblate. 2021-08-06 15:48:44 +00:00
Germain
a978ca52ec Merge pull request #247 from vector-im/gsouquet/codeowners
Add GitHub CODEOWNERS for Element desktop
2021-08-06 16:48:41 +01:00
Germain Souquet
b1085f7a8c Add GitHub CODEOWNERS for Element desktop 2021-08-06 17:06:46 +02:00
Germain Souquet
986f728019 Change tsconfig to autodiscover all @types packages rather setting them explicitely 2021-08-06 17:02:29 +02:00
Weblate
254ac4e0b8 Merge branch 'origin/develop' into Weblate. 2021-08-04 09:02:29 +00:00
David Baker
394e3cde3a Merge pull request #244 from vector-im/dbkr/allchange
Switch to new changelog generator
2021-08-04 10:02:26 +01:00
Weblate
b725ac99de Merge branch 'origin/develop' into Weblate. 2021-08-03 21:50:46 +00:00
Travis Ralston
63cefd4540 Merge pull request #245 from vector-im/dependabot/npm_and_yarn/tar-6.1.2
Bump tar from 6.1.0 to 6.1.2
2021-08-03 15:50:43 -06:00
dependabot[bot]
bf5d3f0dc6 Bump tar from 6.1.0 to 6.1.2
Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.2.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v6.1.0...v6.1.2)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-03 21:49:20 +00:00
David Baker
d8f14a4644 Switch to new changelog generator
See https://github.com/vector-im/element-web/pull/18370 / https://github.com/matrix-org/matrix-react-sdk/pull/6537 / https://github.com/matrix-org/matrix-js-sdk/pull/1824
2021-08-03 18:13:25 +01:00
Weblate
f8f6a3c36d Merge branch 'origin/develop' into Weblate. 2021-08-03 16:18:34 +00:00
Vancha
cce5816da5 Translated using Weblate (Frisian)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/fy/
2021-08-03 16:18:34 +00:00
David Baker
291205170b Merge pull request #243 from vector-im/dbkr/argh_the_linting
Update eslint plugin & fix silly indenting
2021-08-03 17:18:31 +01:00
David Baker
f174abb8b0 Update eslint plugin & fix silly indenting
As per matrix-org/eslint-plugin-matrix-org#15
this caused a bunch of silly indenting to creep in, so this fixes it
back to the previous style.
2021-08-03 17:12:28 +01:00
Vancha
ab6b21d47b Added translation using Weblate (Frisian) 2021-08-03 11:06:47 +00:00
Weblate
f1dd3d95ea Merge branch 'origin/develop' into Weblate. 2021-08-02 12:22:53 +00:00
Oskars G
bdae96d939 Translated using Weblate (Latvian)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/lv/
2021-08-02 12:22:53 +00:00
RiotRobot
4ceb91b3ae v1.7.34 2021-08-02 13:22:32 +01:00
David Baker
dbac457d14 Changelog for v1.7.34 2021-08-02 12:58:18 +01:00
Oskars G
511867e5f0 Added translation using Weblate (Latvian) 2021-08-01 00:46:57 +00:00
David Baker
731e5718e1 Merge pull request #242 from RiotTranslateBot/weblate-element-desktop-element-desktop
Translations update from Weblate
2021-07-27 13:52:01 +01:00
Weblate
0c823f5c2d Merge branch 'origin/develop' into Weblate. 2021-07-27 11:05:12 +00:00
David Baker
937f1c4b40 Merge pull request #241 from vector-im/t3chguy/fix/18087
Fix issue with Squirrel.Windows install/update handler not firing properly
2021-07-27 12:05:08 +01:00
Michael Telatynski
984a98b9df Fix issue with Squirrel.Windows install/update handler not firing properly 2021-07-27 11:47:44 +01:00
Weblate
905223517e Merge branch 'origin/develop' into Weblate. 2021-07-23 15:25:05 +00:00
Michael Telatynski
15600584ec Merge pull request #240 from vector-im/t3chguy/eslint1
Update matrix-org-eslint-plugin and tighten max warning limit
2021-07-23 16:25:01 +01:00
Michael Telatynski
2be7b56a2b Update matrix-org-eslint-plugin and tighten max warning limit
Whilst it is down, make the most of it!
2021-07-23 16:12:07 +01:00
Michael Mihai
39c56e6d6a Translated using Weblate (Romanian)
Currently translated at 84.0% (37 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/ro/
2021-07-23 11:25:08 +00:00
David Baker
c7dea97893 Merge pull request #239 from vector-im/dbkr/yarn_upgrade_210721
yarn upgrade
2021-07-21 15:57:28 +01:00
David Baker
928d8c5d56 yarn upgrade 2021-07-21 15:46:09 +01:00
David Baker
a76d7796a8 Merge pull request #238 from vector-im/dbkr/electron13
Update to electron 13
2021-07-21 15:36:28 +01:00
David Baker
6aef1fc203 Update electron devDependency too 2021-07-21 15:34:12 +01:00
David Baker
3fb802e563 Update to electron 13
and to seshat 2.3.0 which supports it.
2021-07-21 15:27:49 +01:00
David Baker
1a38ca6fa7 Merge pull request #234 from vector-im/dbkr/pacote
Use pacote to fetch native modules
2021-07-21 15:26:40 +01:00
Michael Telatynski
3e69d1ec63 Merge pull request #237 from vector-im/t3chguy/eslint
Add lint:js-fix script
2021-07-20 09:18:42 +01:00
Michael Telatynski
0bdb69372f Update eslint-plugin-matrix-org 2021-07-20 09:15:26 +01:00
Michael Telatynski
0ac9454e3a Add lint:js-fix script 2021-07-19 22:49:17 +01:00
David Baker
63065761ed Merge pull request #236 from vector-im/dbkr/fix_docker_var_prefix
Fix docker variable passthrough
2021-07-19 20:36:11 +01:00
David Baker
71134c448d Fix docker variable passthrough 2021-07-19 20:09:13 +01:00
David Baker
290907a427 Merge pull request #235 from vector-im/dbkr/pass_through_indocker_env_vars
Pass through env vars with special prefix
2021-07-19 18:43:24 +01:00
David Baker
bfcb1e6bfb Pass through env vars with special prefix 2021-07-19 18:38:30 +01:00
RiotRobot
494200d576 v1.7.33 2021-07-19 16:40:58 +01:00
RiotRobot
28cbc01d61 Prepare changelog for v1.7.33 2021-07-19 16:40:58 +01:00
David Baker
ba0dd9e2a6 Use pacote to fetch native modules
Fact: 8 out of 10 native node module packages published to npm are broken.
Actual fact: npm has a library called pacote that handles resolving the
package specifier you put in your dependencies to files on disk, and it's
actually really nice.

Change hak to use that library so now it's much simpler, handles
versions correctly and supports git / github etc. urls so we can
specify dependencies from git when a package author only publishes
half of the package to npm.
2021-07-16 23:38:04 +01:00
David Baker
45eb1252b6 Bump electron to 12.0.14 2021-07-14 12:10:10 +01:00
David Baker
b9e2fbbd23 Merge pull request #232 from RiotTranslateBot/weblate-element-desktop-element-desktop
Translations update from Weblate
2021-07-14 11:43:30 +01:00
Weblate
5febbeb681 Merge branch 'origin/develop' into Weblate. 2021-07-14 10:30:56 +00:00
Michael Telatynski
768066e764 Merge pull request #231 from SimonBrandner/ignore-vscode 2021-07-13 19:19:08 +01:00
Šimon Brandner
e436b87e80 Ignore vscode
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-07-13 20:11:54 +02:00
Alex Henrie
d5c395f509 Translated using Weblate (Catalan)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/ca/
2021-07-10 08:25:03 +00:00
David Baker
7107f45cee Merge pull request #230 from vector-im/dbkr/windows_use_target_build_dir
Use the target-specific build dir for sqlcipher / openssl
2021-07-09 10:10:44 +01:00
David Baker
bd85f19c15 Use the target-specific build dir for sqlcipher / openssl 2021-07-09 10:07:07 +01:00
HelaBasa
e2697cd8b4 Translated using Weblate (Sinhala)
Currently translated at 65.9% (29 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/si/
2021-07-09 03:34:50 +00:00
JosephZERO
15ca3a3145 Translated using Weblate (Belarusian)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/be/
2021-07-09 03:34:50 +00:00
Alex Henrie
e2829822a3 Added translation using Weblate (Catalan) 2021-07-08 17:36:32 +00:00
David Baker
fac9f53bb6 Merge pull request #229 from vector-im/dbkr/fix_default_target
Fix not specifying a target
2021-07-08 09:18:06 +01:00
HelaBasa
3c324ad5f7 Added translation using Weblate (Sinhala) 2021-07-08 02:32:52 +00:00
David Baker
d82377e2de Fix not specifying a target
ie. it should use whatever's detected
2021-07-07 21:38:09 +01:00
Germain
79a426b1c0 Merge pull request #227 from vector-im/gsouquet/ci-pure-lockfile
Do not generate a lockfile when running in CI
2021-07-07 17:53:38 +01:00
David Baker
00a91489a8 Merge pull request #228 from vector-im/dbkr/windows_compatible_quotes
Use double quotes in readme
2021-07-07 15:52:33 +01:00
David Baker
b315b71e43 Use double quotes in readme
which work in the windows shell
2021-07-07 15:48:58 +01:00
Germain Souquet
e132e1c610 Do not generate a lockfile when running in CI 2021-07-07 16:10:01 +02:00
JosephZERO
8592840143 Added translation using Weblate (Belarusian) 2021-07-07 11:24:46 +00:00
David Baker
a8f44fd6e9 Merge pull request #226 from vector-im/dbkr/universally_speaking
Support universal builds
2021-07-07 11:19:26 +01:00
David Baker
a22ba39e63 Use colons consistently in build scripts 2021-07-07 11:17:31 +01:00
David Baker
3dd611b5d5 Address macos properly
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
2021-07-07 11:01:45 +01:00
David Baker
eed1252f33 Merge pull request #225 from vector-im/dbkr/no_rustup
Check target with rustc directly
2021-07-07 11:00:43 +01:00
David Baker
9913b0ff78 Fix confused toolchain / target naming
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
2021-07-07 10:58:54 +01:00
David Baker
e07bfc1d6a Support universal builds
Hopefully adequately documented in the README
2021-07-06 23:52:19 +01:00
David Baker
b5725da9ea lint 2021-07-06 19:06:58 +01:00
David Baker
5bbce91e51 Check target with rustc directly
To avoid depending on rustup (at least when not cross-compiling)
2021-07-06 19:01:34 +01:00
a5r0n
0aed8eac36 Translated using Weblate (Hebrew)
Currently translated at 97.7% (43 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/he/
2021-07-06 05:34:49 +00:00
RiotRobot
ad337b1f7c v1.7.32 2021-07-05 16:55:20 +01:00
RiotRobot
8d380fe533 Prepare changelog for v1.7.32 2021-07-05 16:55:19 +01:00
a5r0n
b6cd3c4cee Added translation using Weblate (Hebrew) 2021-07-05 04:51:02 +00:00
David Baker
6e7913c7d1 Merge pull request #224 from vector-im/dbkr/fix_rootdir
Fix the build: make the rootDir correct
2021-07-01 17:33:36 +01:00
David Baker
9cb171f953 Fix the build: make the rootDir correct 2021-07-01 17:18:26 +01:00
David Baker
44310712f3 Merge pull request #223 from vector-im/t3chguy/ts/10
Fix i18n in Element Desktop
2021-07-01 15:51:31 +01:00
Michael Telatynski
9b65962d26 Update scripts/copy-res.js
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
2021-07-01 15:48:07 +01:00
Michael Telatynski
8302e284a3 delint 2021-07-01 12:03:38 +01:00
Michael Telatynski
390e2306d0 Fix i18n in Element Desktop 2021-07-01 11:32:09 +01:00
Michael Telatynski
60e61415ea Merge pull request #222 from vector-im/t3chguy/ts/10 2021-07-01 09:26:42 +01:00
Michael Telatynski
f4be51959b disable require lint rule in couple more places 2021-07-01 09:24:02 +01:00
Michael Telatynski
397bc66522 fix ts linting and delint the world 2021-07-01 09:22:57 +01:00
Michael Telatynski
4db0a0ac0c Make eslint happy 2021-07-01 09:16:49 +01:00
Michael Telatynski
d353c68a75 Convert preload.js to Typescript so that it gets copied to lib where we expect it 2021-07-01 09:11:42 +01:00
David Baker
0143b4b114 Merge pull request #221 from vector-im/dbkr/lib_not_src
Bundle the `lib` dir now, not `src`
2021-06-30 19:14:40 +01:00
David Baker
93dd8aa2ba Bbundle the lib dir now, not src 2021-06-30 18:56:48 +01:00
Michael Telatynski
140b0b8c29 Merge pull request #219 from vector-im/t3chguy/ts/d 2021-06-30 17:55:25 +01:00
David Baker
744050d8f4 Electron 12.0.12 2021-06-29 14:16:52 +01:00
David Baker
39f3e3b9c2 Merge pull request #220 from RiotTranslateBot/weblate-element-desktop-element-desktop
Translations update from Weblate
2021-06-29 14:14:43 +01:00
Weblate
43c8b13d75 Merge branch 'origin/develop' into Weblate. 2021-06-29 13:08:43 +00:00
Michael Telatynski
2d568f9688 iterate ts support 2021-06-29 11:41:08 +01:00
J. Ryan Stinnett
3f49046980 Merge pull request #218 from vector-im/jryans/aarch64-apple-darwin
Fix Windows target arch in native build
2021-06-25 14:36:05 +01:00
Michael Telatynski
53e7100033 Initial Typescripting for Element Desktop 2021-06-25 14:35:58 +01:00
J. Ryan Stinnett
b8cb53e11b Fix Windows target arch in native build 2021-06-25 13:10:08 +01:00
J. Ryan Stinnett
c751470abf Merge pull request #217 from vector-im/jryans/libera-chat
Add libera.chat to default room directory
2021-06-25 11:24:16 +01:00
J. Ryan Stinnett
9860ac6b75 Add libera.chat to default room directory 2021-06-25 10:59:16 +01:00
J. Ryan Stinnett
6e76d658b1 Merge pull request #216 from vector-im/jryans/aarch64-apple-darwin
Add update and native build support for Apple silicon
2021-06-24 15:37:02 +01:00
J. Ryan Stinnett
3aff9cb9eb Add generated file warning 2021-06-24 15:20:24 +01:00
J. Ryan Stinnett
6579ba80b4 More copyright headers 2021-06-24 15:11:57 +01:00
J. Ryan Stinnett
37410e6bc4 Log update URL 2021-06-24 14:45:35 +01:00
J. Ryan Stinnett
b036113786 Revert "Prefer machine's native arch on macOS"
This reverts commit ebcd68428e.
2021-06-24 14:44:59 +01:00
Ridhubharan
c579031afc Translated using Weblate (Tamil)
Currently translated at 100.0% (44 of 44 strings)

Translation: Element Desktop/element-desktop
Translate-URL: https://translate.element.io/projects/element-desktop/element-desktop/ta/
2021-06-23 19:34:45 +00:00
J. Ryan Stinnett
ebcd68428e Prefer machine's native arch on macOS
This uses `uname` to check the machine's native architecture, and tries to
prefer builds for that, rather than continuing to use emulation.
2021-06-23 16:42:00 +01:00
J. Ryan Stinnett
f63436a2cb Send the current arch when updating
This depends on further builder changes to actually place updates at this new
location for both architectures.
2021-06-23 16:18:10 +01:00
J. Ryan Stinnett
c5dd6195f2 Fix copy command log 2021-06-23 16:18:10 +01:00
J. Ryan Stinnett
c3a36bb17d Cross-compile matrix-seshat for aarch64-apple-darwin 2021-06-23 16:18:09 +01:00
J. Ryan Stinnett
f3c1db3313 Cross-compile SQLCipher for aarch64-apple-darwin 2021-06-23 16:18:09 +01:00
J. Ryan Stinnett
c57a173649 Check for Rust host and target support 2021-06-23 16:18:09 +01:00
J. Ryan Stinnett
48dc1ab396 Print rejections that reach the root handler 2021-06-23 16:18:09 +01:00
J. Ryan Stinnett
997f2c21bf Use targets in hak environment for cross-compiling
This arranges the hak environment target info around target IDs that come from
the builder, which simplifies cross-compiling. The `target.js` module is a
generated copy of the builder's `target.ts`.
2021-06-23 16:18:09 +01:00
J. Ryan Stinnett
a171fa417b Borrow target definition from electron-builder
A bit hacky, but for now we paste in the JS generated version of the builder's
`target.ts` module. It's quite unlikely to change often, so this is perhaps
enough for now.
2021-06-23 16:18:09 +01:00
J. Ryan Stinnett
115f25165a Rename hak target to runtime version
The hak environment's `target` is more like a runtime version, so this renames
to call it that, especially since we're about to add more traditional target
strings. `npm_config_target` remains, since that's what `npm` expects.
2021-06-23 16:18:09 +01:00
J. Ryan Stinnett
c1ca909c7c Limit macOS updates to x86_64 temporarily
As a temporary measure, this limits the updater on macOS to only supporting the
`x86_64` / `x64` architecture. This ensures `aarch64` users are not
inadvertently kicked back to `x86_64`.
2021-06-23 16:18:09 +01:00
Travis Ralston
f61370505b Merge pull request #203 from dogancelik/numpad-zoom
Add numpad accelerators for zooming
2021-06-22 19:42:49 -06:00
Travis Ralston
02d0999b18 Merge pull request #201 from aaronraimist/invalid-config
Add warning dialog when custom config.json is invalid
2021-06-22 14:16:24 -06:00
Ridhubharan
5b15bc9b5d Added translation using Weblate (Tamil) 2021-06-22 17:30:41 +00:00
Michael Telatynski
6b4e6f6be6 Merge pull request #215 from alarsyo/develop 2021-06-22 15:43:27 +01:00
Antoine Martin
10a11242ff Don't show Quit warning on keyUp residual event
The warning triggered whenever the app got focus after another window
was closed with a Ctrl+Q shortcut and the keys were then released.

Hitting the 'Close Element' button didn't even close the app in this
case, as only the warning handler was triggered, not the actual quit
shortcut (which does discriminate between key press and key release).

Actually checking for 'keyDown' should prevent this from occurring
again.

Fixes vector-im/element-web#17714

Signed-off-by: Antoine Martin <antoine@alarsyo.net>
2021-06-22 16:35:36 +02:00
Michael Telatynski
e59a2588ec Merge pull request #213 from vector-im/t3chguy/fix/17631
Fix accelerator for save-image-as clashing with copy-link-address
2021-06-22 09:27:18 +01:00
Michael Telatynski
b18bcd9bed Fix accelerator for save-image-as clashing with copy-link-address 2021-06-14 22:38:37 +01:00
Doğan Çelik
225456b8e0 Add numpad accelerators for zooming
Signed-off-by: Doğan Çelik <dogancelik93@gmail.com>
2021-06-05 16:29:26 +03:00
Aaron Raimist
03e59aa60c Remove translation
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-06-04 17:18:02 -05:00
Aaron Raimist
f109065606 lint
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-06-04 00:23:02 -05:00
Aaron Raimist
bc0e3bb317 Add warning dialog when custom config.json is invalid
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-06-03 23:39:33 -05:00
74 changed files with 5710 additions and 3518 deletions

View File

@@ -1,7 +1,5 @@
module.exports = {
plugins: [
"matrix-org",
],
plugins: ["matrix-org"],
extends: [
"plugin:matrix-org/javascript",
],
@@ -19,5 +17,19 @@ module.exports = {
"indent": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
}
}
},
overrides: [{
files: ["{src,scripts,hak}/**/*.{ts,tsx}"],
extends: [
"plugin:matrix-org/typescript",
],
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
// We disable this while we're transitioning
"@typescript-eslint/no-explicit-any": "off",
},
}],
};

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @vector-im/element-web

View File

@@ -0,0 +1,12 @@
name: Preview Changelog
on:
pull_request_target:
types: [ opened, edited, labeled ]
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Preview Changelog
uses: matrix-org/allchange@main
with:
ghToken: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/dist
/lib
/webapp
/webapp.asar
/packages
@@ -10,3 +11,5 @@
/.yarnrc
/docker
/.npmrc
.vscode
.vscode/

View File

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@ so the first step is to get a working copy of Element Web. There are a few ways
# Fetch the prebuilt release Element package from the element-web GitHub releases page. The version
# fetched will be the same as the local element-desktop package.
# We're explicitly asking for no config, so the packaged Element will have no config.json.
yarn run fetch --noverify --cfgdir ''
yarn run fetch --noverify --cfgdir ""
```
...or if you'd like to use GPG to verify the downloaded package:
@@ -30,14 +30,14 @@ yarn run fetch --noverify --cfgdir ''
# once.
yarn run fetch --importkey
# Fetch the package and verify the signature
yarn run fetch --cfgdir ''
yarn run fetch --cfgdir ""
```
...or either of the above, but fetching a specific version of Element:
```
# Fetch the prebuilt release Element package from the element-web GitHub releases page. The version
# fetched will be the same as the local element-desktop package.
yarn run fetch --noverify --cfgdir '' v1.5.6
yarn run fetch --noverify --cfgdir "" v1.5.6
```
If you only want to run the app locally and don't need to build packages, you can
@@ -49,26 +49,17 @@ ln -s ../element-web/webapp ./
[TODO: add support for fetching develop builds, arbitrary URLs and arbitrary paths]
Building
========
Now you have a copy of Element, you're ready to build packages. If you'd just like to
run Element locally, skip to the next section.
If you'd like to build the native modules (for searching in encrypted rooms and
secure storage), do this first. This will take 10 minutes or so, and will
require a number of native tools to be installed, depending on your OS (eg.
rust, tcl, make/nmake). If you don't need these features, you can skip this
step.
```
yarn run build:native
```
## Native Build
On Windows, this will automatically determine the architecture to build for based
on the environment. Make sure that you have all the [tools required to perform the native modules build](docs/windows-requirements.md)
TODO: List native pre-requisites
Now you can build the package:
Optionally, [build the native modules](https://github.com/vector-im/element-desktop/blob/develop/docs/native-node-modules.md),
which include support for searching in encrypted rooms and secure storage. Skipping this step is fine, you just won't have those features.
Then, run
```
yarn run build
```
@@ -78,18 +69,9 @@ This will do a couple of things:
* Run electron-builder to build a package. The package built will match the operating system
you're running the build process on.
If you're on Windows, you can choose to build specifically for 32 or 64 bit:
```
yarn run build32
```
or
```
yarn run build64
```
## Docker
This build step will not build any native modules.
You can also build using docker, which will always produce the linux package:
Alternatively, you can also build using docker, which will always produce the linux package:
```
# Run this once to make the docker image
yarn run docker:setup

View File

@@ -1,4 +1,4 @@
FROM buildpack-deps:xenial-curl
FROM buildpack-deps:bionic-curl
ENV DEBIAN_FRONTEND noninteractive
@@ -10,7 +10,7 @@ RUN apt-get -qq update && apt-get -qq dist-upgrade && \
# python for node-gyp
# rpm is required for FPM to build rpm package
# libsecret-1-dev and libgnome-keyring-dev are required even for prebuild keytar
apt-get -qq install --no-install-recommends qtbase5-dev bsdtar build-essential autoconf libssl-dev gcc-multilib g++-multilib lzip rpm python libcurl3 git git-lfs ssh unzip \
apt-get -qq install --no-install-recommends qtbase5-dev bsdtar build-essential autoconf libssl-dev gcc-multilib g++-multilib lzip rpm python libcurl4 git git-lfs ssh unzip \
libsecret-1-dev libgnome-keyring-dev \
libopenjp2-tools \
# Used by Seshat

View File

@@ -10,20 +10,26 @@ modules from source to ensure we can trust the compiled output. In the future,
we may offer a pre-compiled path for those who want to use these features in a
custom build of Element without installing the various build tools required.
Do note that compiling a module for a particular operating system
(Linux/macOS/Windows) will need to be done on that operating system.
Cross-compiling from a host OS for a different target OS may be possible, but
we don't support this flow with Element dependencies at this time.
The process is automated by [vector-im/element-builder](https://github.com/vector-im/element-builder)
when releasing.
The following sections explain the manual steps you can use with a custom build of Element to enable
these features if you'd like to try them out.
It is possible to [build those native modules locally automatically](https://github.com/vector-im/element-desktop#building).
when releasing.
## Building
Install the pre-requisites for your system:
* [Windows pre-requisites](https://github.com/vector-im/element-desktop/blob/develop/docs/windows-requirements.md)
* Linux: TODO
* OS X: TODO
Then optionally, [add seshat and dependencies to support search in E2E rooms](#adding-seshat-for-search-in-e2e-encrypted-rooms).
Then, to build for an architecture selected automatically based on your system (recommended), run:
```
yarn run build:native
```
If you need to build for a specific architecture, see [here](#compiling-for-specific-architectures).
## Adding Seshat for search in E2E encrypted rooms
Seshat is a native Node module that adds support for local event indexing and
@@ -59,3 +65,74 @@ After this is done the Electron version of Element can be run from the main fold
as usual using:
yarn start
## Compiling for specific architectures
### macOS
On macOS, you can build universal native modules too:
```
yarn run build:native:universal
```
...or you can build for a specific architecture:
```
yarn run build:native --target x86_64-apple-darwin
```
or
```
yarn run build:native --target aarch64-apple-darwin
```
You'll then need to create a built bundle with the same architecture.
To bundle a universal build for macOS, run:
```
yarn run build:universal
```
### Windows
If you're on Windows, you can choose to build specifically for 32 or 64 bit:
```
yarn run build:32
```
or
```
yarn run build:64
```
### Cross compiling
Compiling a module for a particular operating system (Linux/macOS/Windows) needs
to be done on that operating system. Cross-compiling from a host OS for a different
target OS may be possible, but we don't support this flow with Element dependencies
at this time.
### Switching between architectures
The native module build system keeps the different architectures
separate, so you can keep native modules for several architectures at the same
time and switch which are active using a `yarn run hak copy` command, passing
the appropriate architectures. This will error if you haven't yet built those
architectures. eg:
```
yarn run build:native --target x86_64-apple-darwin
# We've now built & linked into place native modules for Intel
yarn run build:native --target aarch64-apple-darwin
# We've now built Apple Silicon modules too, and linked them into place as the active ones
yarn run hak copy --target x86_64-apple-darwin
# We've now switched back to our Intel modules
yarn run hak copy --target x86_64-apple-darwin --target aarch64-apple-darwin
# Now our native modules are universal x86_64+aarch64 binaries
```
The current set of native modules are stored in `.hak/hakModules`,
so you can use this to check what architecture is currently in place, eg:
```
$ lipo -info .hak/hakModules/keytar/build/Release/keytar.node
Architectures in the fat file: .hak/hakModules/keytar/build/Release/keytar.node are: x86_64 arm64
```

View File

@@ -1,5 +1,5 @@
{
"update_base_url": "https://packages.riot.im/nightly/update/",
"update_base_url": "https://packages.element.io/nightly/update/",
"default_server_name": "matrix.org",
"brand": "Element Nightly",
"integrations_ui_url": "https://scalar.vector.im/",
@@ -13,6 +13,7 @@
],
"hosting_signup_link": "https://element.io/matrix-services?utm_source=element-web&utm_medium=web",
"bug_report_endpoint_url": "https://element.io/bugreports/submit",
"uisi_autorageshake_app": "element-auto-uisi",
"showLabsSettings": true,
"piwik": {
"url": "https://piwik.riot.im/",
@@ -22,7 +23,8 @@
"roomDirectory": {
"servers": [
"matrix.org",
"gitter.im"
"gitter.im",
"libera.chat"
]
},
"enable_presence_by_hs_url": {
@@ -38,5 +40,17 @@
"url": "https://element.io/cookie-policy",
"text": "Cookie Policy"
}
]
],
"sentry": {
"dsn": "https://029a0eb289f942508ae0fb17935bd8c5@sentry.matrix.org/6",
"environment": "nightly"
},
"posthog": {
"projectApiKey": "phc_Jzsm6DTm6V2705zeU5dcNvQDlonOR68XvX2sh1sEOHO",
"apiHost": "https://posthog.hss.element.io"
},
"features": {
"feature_spotlight": true
},
"map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx"
}

View File

@@ -1,5 +1,5 @@
{
"update_base_url": "https://packages.riot.im/desktop/update/",
"update_base_url": "https://packages.element.io/desktop/update/",
"default_server_name": "matrix.org",
"brand": "Element",
"integrations_ui_url": "https://scalar.vector.im/",
@@ -13,10 +13,12 @@
],
"hosting_signup_link": "https://element.io/matrix-services?utm_source=element-web&utm_medium=web",
"bug_report_endpoint_url": "https://element.io/bugreports/submit",
"uisi_autorageshake_app": "element-auto-uisi",
"roomDirectory": {
"servers": [
"matrix.org",
"gitter.im"
"gitter.im",
"libera.chat"
]
},
"showLabsSettings": false,
@@ -38,5 +40,10 @@
"url": "https://element.io/cookie-policy",
"text": "Cookie Policy"
}
]
],
"posthog": {
"projectApiKey": "phc_Jzsm6DTm6V2705zeU5dcNvQDlonOR68XvX2sh1sEOHO",
"apiHost": "https://posthog.hss.element.io"
},
"map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx"
}

View File

@@ -14,18 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const path = require('path');
const childProcess = require('child_process');
import path from 'path';
import childProcess from 'child_process';
module.exports = async function(hakEnv, moduleInfo) {
await buildKeytar(hakEnv, moduleInfo);
};
import HakEnv from '../../scripts/hak/hakEnv';
import { DependencyInfo } from '../../scripts/hak/dep';
async function buildKeytar(hakEnv, moduleInfo) {
export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const env = hakEnv.makeGypEnv();
console.log("Running yarn with env", env);
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
path.join(moduleInfo.nodeModuleBinDir, 'node-gyp' + (hakEnv.isWin() ? '.cmd' : '')),
['rebuild'],

View File

@@ -14,13 +14,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const childProcess = require('child_process');
import childProcess from 'child_process';
module.exports = async function(hakEnv, moduleInfo) {
import HakEnv from '../../scripts/hak/hakEnv';
import { DependencyInfo } from '../../scripts/hak/dep';
export default async function(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const tools = [['python', '--version']]; // node-gyp uses python for reasons beyond comprehension
for (const tool of tools) {
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(tool[0], tool.slice(1), {
stdio: ['ignore'],
});
@@ -33,4 +36,4 @@ module.exports = async function(hakEnv, moduleInfo) {
});
});
}
};
}

View File

@@ -1,7 +1,7 @@
{
"scripts": {
"check": "check.js",
"build": "build.js"
"check": "check.ts",
"build": "build.ts"
},
"copy": "build/Release/keytar.node",
"dependencies": {

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,13 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const path = require('path');
const childProcess = require('child_process');
import path from 'path';
import childProcess from 'child_process';
import mkdirp from 'mkdirp';
import fsExtra from 'fs-extra';
const mkdirp = require('mkdirp');
const fsExtra = require('fs-extra');
import HakEnv from '../../scripts/hak/hakEnv';
import { DependencyInfo } from '../../scripts/hak/dep';
module.exports = async function(hakEnv, moduleInfo) {
export default async function(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (hakEnv.isWin()) {
await buildOpenSslWin(hakEnv, moduleInfo);
await buildSqlCipherWin(hakEnv, moduleInfo);
@@ -28,24 +30,24 @@ module.exports = async function(hakEnv, moduleInfo) {
await buildSqlCipherUnix(hakEnv, moduleInfo);
}
await buildMatrixSeshat(hakEnv, moduleInfo);
};
}
async function buildOpenSslWin(hakEnv, moduleInfo) {
const version = moduleInfo.cfg.dependencies.openssl;
const openSslDir = path.join(moduleInfo.moduleDotHakDir, `openssl-${version}`);
const openSslDir = path.join(moduleInfo.moduleTargetDotHakDir, `openssl-${version}`);
const openSslArch = hakEnv.arch === 'x64' ? 'VC-WIN64A' : 'VC-WIN32';
const openSslArch = hakEnv.getTargetArch() === 'x64' ? 'VC-WIN64A' : 'VC-WIN32';
console.log("Building openssl in " + openSslDir);
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
'perl',
[
'Configure',
'--prefix=' + moduleInfo.depPrefix,
// sqlcipher only uses about a tiny part of openssl. We link statically
// so will only pull in the symbols we use, but we may as well turn off
// as much as possible to save on build time.
// sqlcipher only uses about a tiny part of openssl. We link statically
// so will only pull in the symbols we use, but we may as well turn off
// as much as possible to save on build time.
'no-afalgeng',
'no-capieng',
'no-cms',
@@ -103,7 +105,7 @@ async function buildOpenSslWin(hakEnv, moduleInfo) {
});
});
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
'nmake',
['build_libs'],
@@ -117,7 +119,7 @@ async function buildOpenSslWin(hakEnv, moduleInfo) {
});
});
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
'nmake',
['install_dev'],
@@ -134,12 +136,12 @@ async function buildOpenSslWin(hakEnv, moduleInfo) {
async function buildSqlCipherWin(hakEnv, moduleInfo) {
const version = moduleInfo.cfg.dependencies.sqlcipher;
const sqlCipherDir = path.join(moduleInfo.moduleDotHakDir, `sqlcipher-${version}`);
const sqlCipherDir = path.join(moduleInfo.moduleTargetDotHakDir, `sqlcipher-${version}`);
const buildDir = path.join(sqlCipherDir, 'bld');
await mkdirp(buildDir);
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
'nmake',
['/f', path.join('..', 'Makefile.msc'), 'libsqlite3.lib', 'TOP=..'],
@@ -171,7 +173,7 @@ async function buildSqlCipherWin(hakEnv, moduleInfo) {
async function buildSqlCipherUnix(hakEnv, moduleInfo) {
const version = moduleInfo.cfg.dependencies.sqlcipher;
const sqlCipherDir = path.join(moduleInfo.moduleDotHakDir, `sqlcipher-${version}`);
const sqlCipherDir = path.join(moduleInfo.moduleTargetDotHakDir, `sqlcipher-${version}`);
const args = [
'--prefix=' + moduleInfo.depPrefix + '',
@@ -182,12 +184,39 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
if (hakEnv.isMac()) {
args.push('--with-crypto-lib=commoncrypto');
}
args.push('CFLAGS=-DSQLITE_HAS_CODEC');
if (hakEnv.isMac()) {
args.push('LDFLAGS=-framework Security -framework Foundation');
if (!hakEnv.isHost()) {
// In the nonsense world of `configure`, it is assumed you are building
// a compiler like `gcc`, so the `host` option actually means the target
// the build output runs on.
args.push(`--host=${hakEnv.getTargetId()}`);
}
await new Promise((resolve, reject) => {
const cflags = [
'-DSQLITE_HAS_CODEC',
];
if (!hakEnv.isHost()) {
// `clang` uses more logical option naming.
cflags.push(`--target=${hakEnv.getTargetId()}`);
}
if (cflags.length) {
args.push(`CFLAGS=${cflags.join(' ')}`);
}
const ldflags = [];
if (hakEnv.isMac()) {
ldflags.push('-framework Security');
ldflags.push('-framework Foundation');
}
if (ldflags.length) {
args.push(`LDFLAGS=${ldflags.join(' ')}`);
}
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
path.join(sqlCipherDir, 'configure'),
args,
@@ -201,7 +230,7 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
});
});
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
'make',
[],
@@ -215,7 +244,7 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
});
});
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
'make',
['install'],
@@ -231,6 +260,9 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
}
async function buildMatrixSeshat(hakEnv, moduleInfo) {
// seshat now uses n-api so we shouldn't need to specify a node version to
// build against, but it does seems to still need something in here, so leaving
// it for now: we should confirm how much of this it still actually needs.
const env = hakEnv.makeGypEnv();
if (!hakEnv.isLinux()) {
@@ -248,11 +280,15 @@ async function buildMatrixSeshat(hakEnv, moduleInfo) {
// the build scripts since they run on the host, but vcvarsall.bat sets the c
// compiler in the path to be the one for the target, so we just use the matching
// toolchain for the target architecture which makes everything happy.
env.RUSTUP_TOOLCHAIN = hakEnv.arch == 'x64' ? 'stable-x86_64-pc-windows-msvc' : 'stable-i686-pc-windows-msvc';
env.RUSTUP_TOOLCHAIN = `stable-${hakEnv.getTargetId()}`;
}
if (!hakEnv.isHost()) {
env.CARGO_BUILD_TARGET = hakEnv.getTargetId();
}
console.log("Running neon with env", env);
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
path.join(moduleInfo.nodeModuleBinDir, 'neon' + (hakEnv.isWin() ? '.cmd' : '')),
['build', '--release'],

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,12 +14,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const childProcess = require('child_process');
import childProcess from 'child_process';
import fsProm from 'fs/promises';
module.exports = async function(hakEnv, moduleInfo) {
import HakEnv from '../../scripts/hak/hakEnv';
import { DependencyInfo } from '../../scripts/hak/dep';
export default async function(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
// of course tcl doesn't have a --version
if (!hakEnv.isLinux()) {
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn('tclsh', [], {
stdio: ['pipe', 'ignore', 'ignore'],
});
@@ -34,7 +38,10 @@ module.exports = async function(hakEnv, moduleInfo) {
});
}
const tools = [['python', '--version']]; // node-gyp uses python for reasons beyond comprehension
const tools = [
['rustc', '--version'],
['python', '--version'], // node-gyp uses python for reasons beyond comprehension
];
if (hakEnv.isWin()) {
tools.push(['perl', '--version']); // for openssl configure
tools.push(['patch', '--version']); // to patch sqlcipher Makefile.msc
@@ -44,7 +51,7 @@ module.exports = async function(hakEnv, moduleInfo) {
}
for (const tool of tools) {
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(tool[0], tool.slice(1), {
stdio: ['ignore'],
});
@@ -57,4 +64,22 @@ module.exports = async function(hakEnv, moduleInfo) {
});
});
}
};
// Ensure Rust target exists (nb. we avoid depending on rustup)
await new Promise((resolve, reject) => {
const rustc = childProcess.execFile('rustc', [
'--target', hakEnv.getTargetId(), '-o', 'tmp', '-',
], (err, out) => {
if (err) {
reject(
"rustc can't build for target " + hakEnv.getTargetId() +
": ensure target is installed via `rustup target add " + hakEnv.getTargetId() + "` " +
"or your package manager if not using `rustup`",
);
}
fsProm.unlink('tmp').then(resolve);
});
rustc.stdin.write('fn main() {}');
rustc.stdin.end();
});
}

View File

@@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const path = require('path');
const childProcess = require('child_process');
import path from 'path';
import childProcess from 'child_process';
import fs from 'fs';
import fsProm from 'fs/promises';
import needle from 'needle';
import tar from 'tar';
const fs = require('fs');
const fsProm = require('fs').promises;
const needle = require('needle');
const tar = require('tar');
import HakEnv from '../../scripts/hak/hakEnv';
import { DependencyInfo } from '../../scripts/hak/dep';
module.exports = async function(hakEnv, moduleInfo) {
export default async function(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (!hakEnv.isLinux()) {
await getSqlCipher(hakEnv, moduleInfo);
}
@@ -30,11 +32,11 @@ module.exports = async function(hakEnv, moduleInfo) {
if (hakEnv.isWin()) {
await getOpenSsl(hakEnv, moduleInfo);
}
};
}
async function getSqlCipher(hakEnv, moduleInfo) {
async function getSqlCipher(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const version = moduleInfo.cfg.dependencies.sqlcipher;
const sqlCipherDir = path.join(moduleInfo.moduleDotHakDir, `sqlcipher-${version}`);
const sqlCipherDir = path.join(moduleInfo.moduleTargetDotHakDir, `sqlcipher-${version}`);
let haveSqlcipher;
try {
@@ -62,9 +64,10 @@ async function getSqlCipher(hakEnv, moduleInfo) {
await bob;
}
// Extract the tarball to per-target directories, then we avoid cross-contaiminating archs
await tar.x({
file: sqlCipherTarball,
cwd: moduleInfo.moduleDotHakDir,
cwd: moduleInfo.moduleTargetDotHakDir,
});
if (hakEnv.isWin()) {
@@ -73,8 +76,8 @@ async function getSqlCipher(hakEnv, moduleInfo) {
// set it to 2 (default to memory).
const patchFile = path.join(moduleInfo.moduleHakDir, `sqlcipher-${version}-win.patch`);
await new Promise((resolve, reject) => {
const readStream = fs.createReadStream(patchFile);
await new Promise<void>((resolve, reject) => {
const readStream = fs.createReadStream(patchFile);
const proc = childProcess.spawn(
'patch',
@@ -92,9 +95,9 @@ async function getSqlCipher(hakEnv, moduleInfo) {
}
}
async function getOpenSsl(hakEnv, moduleInfo) {
async function getOpenSsl(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const version = moduleInfo.cfg.dependencies.openssl;
const openSslDir = path.join(moduleInfo.moduleDotHakDir, `openssl-${version}`);
const openSslDir = path.join(moduleInfo.moduleTargetDotHakDir, `openssl-${version}`);
let haveOpenSsl;
try {
@@ -121,9 +124,9 @@ async function getOpenSsl(hakEnv, moduleInfo) {
});
}
console.log("extracting " + openSslTarball + " in " + moduleInfo.moduleDotHakDir);
console.log("extracting " + openSslTarball + " in " + moduleInfo.moduleTargetDotHakDir);
await tar.x({
file: openSslTarball,
cwd: moduleInfo.moduleDotHakDir,
cwd: moduleInfo.moduleTargetDotHakDir,
});
}

View File

@@ -1,8 +1,8 @@
{
"scripts": {
"check": "check.js",
"fetchDeps": "fetchDeps.js",
"build": "build.js"
"check": "check.ts",
"fetchDeps": "fetchDeps.ts",
"build": "build.ts"
},
"prune": "native",
"copy": "native/index.node",

17
hak/tsconfig.json Normal file
View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"moduleResolution": "node",
"esModuleInterop": true,
"target": "es2016",
"sourceMap": false,
"lib": [
"es2019",
]
},
"include": [
"./**/*.ts"
],
"ts-node": {
"transpileOnly": true
}
}

View File

@@ -1,8 +1,8 @@
{
"name": "element-desktop",
"productName": "Element",
"main": "src/electron-main.js",
"version": "1.7.31",
"main": "lib/electron-main.js",
"version": "1.10.7",
"description": "A feature-rich client for Matrix.org",
"author": "Element",
"repository": {
@@ -18,19 +18,26 @@
"mkdirs": "mkdirp packages deploys",
"fetch": "yarn run mkdirs && node scripts/fetch-package.js",
"asar-webapp": "asar p webapp webapp.asar",
"start": "electron .",
"lint": "eslint src/ scripts/ hak/",
"start": "yarn run build:ts && yarn run build:res && electron .",
"lint": "yarn lint:types && yarn lint:js",
"lint:js": "eslint --max-warnings 0 src scripts hak",
"lint:js-fix": "eslint --fix src scripts hak",
"lint:types": "tsc --noEmit && tsc -p scripts/hak/tsconfig.json --noEmit && tsc -p hak/tsconfig.json --noEmit",
"build:native": "yarn run hak",
"build32": "electron-builder --ia32",
"build64": "electron-builder --x64",
"build": "electron-builder",
"build:native:universal": "yarn run hak --target x86_64-apple-darwin fetchandbuild && yarn run hak --target aarch64-apple-darwin fetchandbuild && yarn run hak --target x86_64-apple-darwin --target aarch64-apple-darwin copyandlink",
"build:32": "yarn run build:ts && yarn run build:res && electron-builder --ia32",
"build:64": "yarn run build:ts && yarn run build:res && electron-builder --x64",
"build:universal": "yarn run build:ts && yarn run build:res && electron-builder --universal",
"build": "yarn run build:ts && yarn run build:res && electron-builder",
"build:ts": "tsc",
"build:res": "node scripts/copy-res.js",
"docker:setup": "docker build -t element-desktop-dockerbuild dockerbuild",
"docker:build:native": "scripts/in-docker.sh yarn run hak",
"docker:build": "scripts/in-docker.sh yarn run build",
"docker:install": "scripts/in-docker.sh yarn install",
"debrepo": "scripts/mkrepo.sh",
"clean": "rimraf webapp.asar dist packages deploys",
"hak": "node scripts/hak/index.js"
"clean": "rimraf webapp.asar dist packages deploys lib",
"hak": "ts-node scripts/hak/index.ts"
},
"dependencies": {
"auto-launch": "^5.0.5",
@@ -42,40 +49,53 @@
"request": "^2.88.2"
},
"devDependencies": {
"@types/auto-launch": "^5.0.1",
"@types/counterpart": "^0.18.1",
"@types/minimist": "^1.2.1",
"@types/mkdirp": "^1.0.2",
"@types/pacote": "^11.1.1",
"@types/rimraf": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"allchange": "^1.0.6",
"app-builder-lib": "^22.14.10",
"asar": "^2.0.1",
"chokidar": "^3.5.2",
"electron": "^17",
"electron-builder": "22.11.4",
"electron-builder-squirrel-windows": "22.11.4",
"electron-devtools-installer": "^3.1.1",
"electron-notarize": "^1.0.0",
"eslint": "7.18.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-matrix-org": "github:matrix-org/eslint-plugin-matrix-org#main",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^0.4.0",
"find-npm-prefix": "^1.0.2",
"fs-extra": "^8.1.0",
"glob": "^7.1.6",
"matrix-web-i18n": "github:matrix-org/matrix-web-i18n",
"matrix-web-i18n": "^1.2.0",
"mkdirp": "^1.0.3",
"needle": "^2.5.0",
"node-pre-gyp": "^0.15.0",
"npm": "^6.14.11",
"pacote": "^11.3.5",
"rimraf": "^3.0.2",
"semver": "^7.3.4",
"tar": "^6.1.0"
"tar": "^6.1.2",
"ts-node": "^10.4.0",
"typescript": "^4.5.3"
},
"hakDependencies": {
"matrix-seshat": "^2.2.3",
"matrix-seshat": "^2.3.0",
"keytar": "^5.6.0"
},
"build": {
"appId": "im.riot.app",
"electronVersion": "12.0.11",
"files": [
"package.json",
{
"from": ".hak/hakModules",
"to": "node_modules"
},
"src/**"
"lib/**"
],
"extraResources": [
{

View File

@@ -1 +1,7 @@
signing_id: releases@riot.im
subprojects:
element-web:
includeByDefault: true
# Because element-web is not in our dependencies, but the versions
# follow those of this project (well, vice-versa really)
mirrorVersion: true

View File

@@ -2,4 +2,4 @@
set -ex
yarn install $@
yarn install --pure-lockfile $@

121
scripts/copy-res.js Executable file
View File

@@ -0,0 +1,121 @@
#!/usr/bin/env node
// copies resources into the lib directory.
const parseArgs = require('minimist');
const chokidar = require('chokidar');
const path = require('path');
const fs = require('fs');
const argv = parseArgs(process.argv.slice(2), {});
const watch = argv.w;
const verbose = argv.v;
function errCheck(err) {
if (err) {
console.error(err.message);
process.exit(1);
}
}
const I18N_BASE_PATH = "src/i18n/strings/";
const INCLUDE_LANGS = fs.readdirSync(I18N_BASE_PATH).filter(fn => fn.endsWith(".json"));
// Ensure lib, lib/i18n and lib/i18n/strings all exist
fs.mkdirSync('lib/i18n/strings', { recursive: true });
function genLangFile(file, dest) {
let translations = {};
[file].forEach(function(f) {
if (fs.existsSync(f)) {
try {
Object.assign(
translations,
JSON.parse(fs.readFileSync(f).toString()),
);
} catch (e) {
console.error("Failed: " + f, e);
throw e;
}
}
});
translations = weblateToCounterpart(translations);
const json = JSON.stringify(translations, null, 4);
const filename = path.basename(file);
fs.writeFileSync(dest + filename, json);
if (verbose) {
console.log("Generated language file: " + filename);
}
}
/*
* Convert translation key from weblate format
* (which only supports a single level) to counterpart
* which requires object values for 'count' translations.
*
* eg.
* "there are %(count)s badgers|one": "a badger",
* "there are %(count)s badgers|other": "%(count)s badgers"
* becomes
* "there are %(count)s badgers": {
* "one": "a badger",
* "other": "%(count)s badgers"
* }
*/
function weblateToCounterpart(inTrs) {
const outTrs = {};
for (const key of Object.keys(inTrs)) {
const keyParts = key.split('|', 2);
if (keyParts.length === 2) {
let obj = outTrs[keyParts[0]];
if (obj === undefined) {
obj = {};
outTrs[keyParts[0]] = obj;
}
obj[keyParts[1]] = inTrs[key];
} else {
outTrs[key] = inTrs[key];
}
}
return outTrs;
}
/*
watch the input files for a given language,
regenerate the file, and regenerating languages.json with the new filename
*/
function watchLanguage(file, dest) {
// XXX: Use a debounce because for some reason if we read the language
// file immediately after the FS event is received, the file contents
// appears empty. Possibly https://github.com/nodejs/node/issues/6112
let makeLangDebouncer;
const makeLang = () => {
if (makeLangDebouncer) {
clearTimeout(makeLangDebouncer);
}
makeLangDebouncer = setTimeout(() => {
genLangFile(file, dest);
}, 500);
};
chokidar.watch(file)
.on('add', makeLang)
.on('change', makeLang)
.on('error', errCheck);
}
// language resources
const I18N_DEST = "lib/i18n/strings/";
INCLUDE_LANGS.forEach((file) => {
genLangFile(I18N_BASE_PATH + file, I18N_DEST);
}, {});
if (watch) {
INCLUDE_LANGS.forEach(file => watchLanguage(I18N_BASE_PATH + file, I18N_DEST));
}

View File

@@ -10,13 +10,12 @@ const asar = require('asar');
const needle = require('needle');
const riotDesktopPackageJson = require('../package.json');
const { setPackageVersion } = require('./set-version.js');
const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc";
const PACKAGE_URL_PREFIX = "https://github.com/vector-im/element-web/releases/download/";
const ASAR_PATH = 'webapp.asar';
const { setPackageVersion } = require('./set-version.js');
async function getLatestDevelopUrl(bkToken) {
const buildsResult = await needle('get',
"https://api.buildkite.com/v2/organizations/matrix-dot-org/pipelines/element-web/builds",

View File

@@ -17,7 +17,8 @@ clone() {
if [ -n "$branch" ]
then
echo "Trying to use $org/$repo#$branch"
git clone git://github.com/$org/$repo.git $repo --branch "$branch" --depth 1 && exit 0
# Disable auth prompts: https://serverfault.com/a/665959
GIT_TERMINAL_PROMPT=0 git clone https://github.com/$org/$repo.git $repo --branch "$branch" --depth 1 && exit 0
fi
}

View File

@@ -14,8 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
async function build(hakEnv, moduleInfo) {
import { DependencyInfo } from "./dep";
import HakEnv from "./hakEnv";
export default async function build(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await moduleInfo.scripts.build(hakEnv, moduleInfo);
}
module.exports = build;

View File

@@ -14,10 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
async function check(hakEnv, moduleInfo) {
import { DependencyInfo } from "./dep";
import HakEnv from "./hakEnv";
export default async function check(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (moduleInfo.scripts.check) {
await moduleInfo.scripts.check(hakEnv, moduleInfo);
}
}
module.exports = check;

View File

@@ -14,13 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const path = require('path');
import path from 'path';
import rimraf from 'rimraf';
const rimraf = require('rimraf');
import { DependencyInfo } from './dep';
import HakEnv from './hakEnv';
async function clean(hakEnv, moduleInfo) {
await new Promise((resolve, reject) => {
rimraf(moduleInfo.moduleDotHakDir, (err) => {
export default async function clean(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await new Promise<void>((resolve, reject) => {
rimraf(moduleInfo.moduleDotHakDir, (err: Error) => {
if (err) {
reject(err);
} else {
@@ -29,8 +31,8 @@ async function clean(hakEnv, moduleInfo) {
});
});
await new Promise((resolve, reject) => {
rimraf(path.join(hakEnv.dotHakDir, 'links', moduleInfo.name), (err) => {
await new Promise<void>((resolve, reject) => {
rimraf(path.join(hakEnv.dotHakDir, 'links', moduleInfo.name), (err: Error) => {
if (err) {
reject(err);
} else {
@@ -39,8 +41,8 @@ async function clean(hakEnv, moduleInfo) {
});
});
await new Promise((resolve, reject) => {
rimraf(path.join(hakEnv.projectRoot, 'node_modules', moduleInfo.name), (err) => {
await new Promise<void>((resolve, reject) => {
rimraf(path.join(hakEnv.projectRoot, 'node_modules', moduleInfo.name), (err: Error) => {
if (err) {
reject(err);
} else {
@@ -49,5 +51,3 @@ async function clean(hakEnv, moduleInfo) {
});
});
}
module.exports = clean;

View File

@@ -1,67 +0,0 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
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.
*/
const path = require('path');
const fsProm = require('fs').promises;
const rimraf = require('rimraf');
const glob = require('glob');
const mkdirp = require('mkdirp');
async function copy(hakEnv, moduleInfo) {
if (moduleInfo.cfg.prune) {
console.log("Removing " + moduleInfo.cfg.prune + " from " + moduleInfo.moduleOutDir);
// rimraf doesn't have a 'cwd' option: it always uses process.cwd()
// (and if you set glob.cwd it just breaks because it can't find the files)
const oldCwd = process.cwd();
try {
process.chdir(moduleInfo.moduleOutDir);
await new Promise((resolve, reject) => {
rimraf(moduleInfo.cfg.prune, {}, err => {
err ? reject(err) : resolve();
});
});
} finally {
process.chdir(oldCwd);
}
}
if (moduleInfo.cfg.copy) {
console.log(
"Copying " + moduleInfo.cfg.prune + " from " +
moduleInfo.moduleOutDir + " to " + moduleInfo.moduleOutDir,
);
const files = await new Promise(async (resolve, reject) => {
glob(moduleInfo.cfg.copy, {
nosort: true,
silent: true,
cwd: moduleInfo.moduleBuildDir,
}, (err, files) => {
err ? reject(err) : resolve(files);
});
});
for (const f of files) {
console.log("\t" + f);
const src = path.join(moduleInfo.moduleBuildDir, f);
const dst = path.join(moduleInfo.moduleOutDir, f);
await mkdirp(path.dirname(dst));
await fsProm.copyFile(src, dst);
}
}
}
module.exports = copy;

100
scripts/hak/copy.ts Normal file
View File

@@ -0,0 +1,100 @@
/*
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
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 path from 'path';
import fsProm from 'fs/promises';
import childProcess from 'child_process';
import rimraf from 'rimraf';
import glob from 'glob';
import mkdirp from 'mkdirp';
import HakEnv from './hakEnv';
import { DependencyInfo } from './dep';
export default async function copy(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (moduleInfo.cfg.prune) {
console.log("Removing " + moduleInfo.cfg.prune + " from " + moduleInfo.moduleOutDir);
// rimraf doesn't have a 'cwd' option: it always uses process.cwd()
// (and if you set glob.cwd it just breaks because it can't find the files)
const oldCwd = process.cwd();
try {
process.chdir(moduleInfo.moduleOutDir);
await new Promise<void>((resolve, reject) => {
rimraf(moduleInfo.cfg.prune, {}, err => {
err ? reject(err) : resolve();
});
});
} finally {
process.chdir(oldCwd);
}
}
if (moduleInfo.cfg.copy) {
// If there are multiple moduleBuildDirs, singular moduleBuildDir
// is the same as moduleBuildDirs[0], so we're just listing the contents
// of the first one.
const files = await new Promise<string[]>((resolve, reject) => {
glob(moduleInfo.cfg.copy, {
nosort: true,
silent: true,
cwd: moduleInfo.moduleBuildDir,
}, (err, files) => {
err ? reject(err) : resolve(files);
});
});
if (moduleInfo.moduleBuildDirs.length > 1) {
if (!hakEnv.isMac()) {
console.error(
"You asked me to copy multiple targets but I've only been taught " +
"how to do that on macOS.",
);
throw new Error("Can't copy multiple targets on this platform");
}
for (const f of files) {
const components = moduleInfo.moduleBuildDirs.map(dir => path.join(dir, f));
const dst = path.join(moduleInfo.moduleOutDir, f);
await mkdirp(path.dirname(dst));
await new Promise<void>((resolve, reject) => {
childProcess.execFile('lipo',
['-create', '-output', dst, ...components], (err) => {
if (err) {
reject(err);
} else {
resolve();
}
},
);
});
}
} else {
console.log(
"Copying files from " +
moduleInfo.moduleBuildDir + " to " + moduleInfo.moduleOutDir,
);
for (const f of files) {
console.log("\t" + f);
const src = path.join(moduleInfo.moduleBuildDir, f);
const dst = path.join(moduleInfo.moduleOutDir, f);
await mkdirp(path.dirname(dst));
await fsProm.copyFile(src, dst);
}
}
}
}

32
scripts/hak/dep.ts Normal file
View File

@@ -0,0 +1,32 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
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 HakEnv from "./hakEnv";
export interface DependencyInfo {
name: string;
version: string;
cfg: Record<string, any>;
moduleHakDir: string;
moduleDotHakDir: string;
moduleTargetDotHakDir: string;
moduleBuildDir: string;
moduleBuildDirs: string[];
moduleOutDir: string;
nodeModuleBinDir: string;
depPrefix: string;
scripts: Record<string, (hakEnv: HakEnv, moduleInfo: DependencyInfo) => Promise<void> >;
}

View File

@@ -1,125 +0,0 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
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.
*/
const path = require('path');
const url = require('url');
const fsProm = require('fs').promises;
const childProcess = require('child_process');
const npm = require('npm');
const semver = require('semver');
const needle = require('needle');
const mkdirp = require('mkdirp');
const tar = require('tar');
async function fetch(hakEnv, moduleInfo) {
let haveModuleBuildDir;
try {
const stats = await fsProm.stat(moduleInfo.moduleBuildDir);
haveModuleBuildDir = stats.isDirectory();
} catch (e) {
haveModuleBuildDir = false;
}
if (haveModuleBuildDir) return;
await new Promise((resolve) => {
npm.load({ 'loglevel': 'silent' }, resolve);
});
console.log("Fetching " + moduleInfo.name + " at version " + moduleInfo.version);
const versions = await new Promise((resolve, reject) => {
npm.view([
moduleInfo.name + '@' + moduleInfo.version,
'dist.tarball',
(err, versions) => {
if (err) {
reject(err);
} else {
resolve(versions);
}
},
]);
});
const orderedVersions = Object.keys(versions);
semver.sort(orderedVersions);
console.log("Resolved version " + orderedVersions[0] + " for " + moduleInfo.name);
const tarballUrl = versions[orderedVersions[0]]['dist.tarball'];
await mkdirp(moduleInfo.moduleDotHakDir);
const parsedUrl = url.parse(tarballUrl);
const tarballFile = path.join(moduleInfo.moduleDotHakDir, path.basename(parsedUrl.path));
let haveTarball;
try {
await fsProm.stat(tarballFile);
haveTarball = true;
} catch (e) {
haveTarball = false;
}
if (!haveTarball) {
console.log("Downloading " + tarballUrl);
await needle('get', tarballUrl, { output: tarballFile });
} else {
console.log(tarballFile + " already exists.");
}
await mkdirp(moduleInfo.moduleBuildDir);
await tar.x({
file: tarballFile,
cwd: moduleInfo.moduleBuildDir,
strip: 1,
});
console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
await new Promise((resolve, reject) => {
const proc = childProcess.spawn(
hakEnv.isWin() ? 'yarn.cmd' : 'yarn',
['install', '--ignore-scripts'],
{
stdio: 'inherit',
cwd: moduleInfo.moduleBuildDir,
},
);
proc.on('exit', code => {
code ? reject(code) : resolve();
});
});
// also extract another copy to the output directory at this point
// nb. we do not yarn install in the output copy: we could install in
// production mode to get only runtime dependencies and not devDependencies,
// but usually native modules come with dependencies that are needed for
// building/fetching the native modules (eg. node-pre-gyp) rather than
// actually used at runtime: we do not want to bundle these into our app.
// We therefore just install no dependencies at all, and accept that any
// actual runtime dependencies will have to be added to the main app's
// dependencies. We can't tell what dependencies are real runtime deps
// and which are just used for native module building.
await mkdirp(moduleInfo.moduleOutDir);
await tar.x({
file: tarballFile,
cwd: moduleInfo.moduleOutDir,
strip: 1,
});
}
module.exports = fetch;

70
scripts/hak/fetch.ts Normal file
View File

@@ -0,0 +1,70 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
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 fsProm from 'fs/promises';
import childProcess from 'child_process';
import pacote from 'pacote';
import HakEnv from './hakEnv';
import { DependencyInfo } from './dep';
export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
let haveModuleBuildDir;
try {
const stats = await fsProm.stat(moduleInfo.moduleBuildDir);
haveModuleBuildDir = stats.isDirectory();
} catch (e) {
haveModuleBuildDir = false;
}
if (haveModuleBuildDir) return;
console.log("Fetching " + moduleInfo.name + "@" + moduleInfo.version);
const packumentCache = new Map();
await pacote.extract(`${moduleInfo.name}@${moduleInfo.version}`, moduleInfo.moduleBuildDir, {
packumentCache,
});
console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(
hakEnv.isWin() ? 'yarn.cmd' : 'yarn',
['install', '--ignore-scripts'],
{
stdio: 'inherit',
cwd: moduleInfo.moduleBuildDir,
},
);
proc.on('exit', code => {
code ? reject(code) : resolve();
});
});
// also extract another copy to the output directory at this point
// nb. we do not yarn install in the output copy: we could install in
// production mode to get only runtime dependencies and not devDependencies,
// but usually native modules come with dependencies that are needed for
// building/fetching the native modules (eg. node-pre-gyp) rather than
// actually used at runtime: we do not want to bundle these into our app.
// We therefore just install no dependencies at all, and accept that any
// actual runtime dependencies will have to be added to the main app's
// dependencies. We can't tell what dependencies are real runtime deps
// and which are just used for native module building.
await pacote.extract(`${moduleInfo.name}@${moduleInfo.version}`, moduleInfo.moduleOutDir, {
packumentCache,
});
}

View File

@@ -14,13 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const mkdirp = require('mkdirp');
import mkdirp from 'mkdirp';
async function fetchDeps(hakEnv, moduleInfo) {
import { DependencyInfo } from './dep';
import HakEnv from './hakEnv';
export default async function fetchDeps(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await mkdirp(moduleInfo.moduleDotHakDir);
if (moduleInfo.scripts.fetchDeps) {
await moduleInfo.scripts.fetchDeps(hakEnv, moduleInfo);
}
}
module.exports = fetchDeps;

View File

@@ -1,115 +0,0 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
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.
*/
const path = require('path');
const os = require('os');
const nodePreGypVersioning = require('node-pre-gyp/lib/util/versioning');
function getElectronVersion(packageJson) {
// should we pick the version of an installed electron
// dependency, and if so, before or after electronVersion?
if (packageJson.build && packageJson.build.electronVersion) {
return packageJson.build.electronVersion;
}
return null;
}
function getRuntime(packageJson) {
const electronVersion = getElectronVersion(packageJson);
return electronVersion ? 'electron' : 'node-webkit';
}
function getTarget(packageJson) {
const electronVersion = getElectronVersion(packageJson);
if (electronVersion) {
return electronVersion;
} else {
return process.version.substr(1);
}
}
function detectArch() {
if (process.platform === 'win32') {
// vcvarsall.bat (the script that sets up the environment for
// visual studio build tools) sets an env var to tell us what
// architecture the active build tools target, so we auto-detect
// this.
const targetArch = process.env.VSCMD_ARG_TGT_ARCH;
if (targetArch === 'x86') {
return 'ia32';
} else if (targetArch === 'x64') {
return 'x64';
}
}
return process.arch;
}
module.exports = class HakEnv {
constructor(prefix, packageJson) {
Object.assign(this, {
// what we're targeting
runtime: getRuntime(packageJson),
target: getTarget(packageJson),
platform: process.platform,
arch: detectArch(),
// paths
projectRoot: prefix,
dotHakDir: path.join(prefix, '.hak'),
});
}
getRuntimeAbi() {
return nodePreGypVersioning.get_runtime_abi(
this.runtime,
this.target,
);
}
// {node_abi}-{platform}-{arch}
getNodeTriple() {
return this.getRuntimeAbi() + '-' + this.platform + '-' + this.arch;
}
isWin() {
return this.platform === 'win32';
}
isMac() {
return this.platform === 'darwin';
}
isLinux() {
return this.platform === 'linux';
}
makeGypEnv() {
return Object.assign({}, process.env, {
npm_config_target: this.target,
npm_config_arch: this.arch,
npm_config_target_arch: this.arch,
npm_config_disturl: 'https://atom.io/download/electron',
npm_config_runtime: this.runtime,
npm_config_build_from_source: true,
npm_config_devdir: path.join(os.homedir(), ".electron-gyp"),
});
}
getNodeModuleBin(name) {
return path.join(this.projectRoot, 'node_modules', '.bin', name);
}
};

117
scripts/hak/hakEnv.ts Normal file
View File

@@ -0,0 +1,117 @@
/*
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
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 path from 'path';
import os from 'os';
import nodePreGypVersioning from "node-pre-gyp/lib/util/versioning";
import { getElectronVersion } from "app-builder-lib/out/electron/electronVersion";
import { Arch, Target, TARGETS, getHost, isHostId, TargetId } from './target';
async function getRuntime(projectRoot: string): Promise<string> {
const electronVersion = await getElectronVersion(projectRoot);
return electronVersion ? 'electron' : 'node-webkit';
}
async function getRuntimeVersion(projectRoot: string): Promise<string> {
const electronVersion = await getElectronVersion(projectRoot);
if (electronVersion) {
return electronVersion;
} else {
return process.version.substr(1);
}
}
export default class HakEnv {
public target: Target;
public projectRoot: string;
public runtime: string;
public runtimeVersion: string;
public dotHakDir: string;
constructor(prefix: string, targetId: TargetId) {
let target;
if (targetId) {
target = TARGETS[targetId];
} else {
target = getHost();
}
if (!target) {
throw new Error(`Unknown target ${targetId}!`);
}
this.target = target;
this.projectRoot = prefix;
this.dotHakDir = path.join(this.projectRoot, '.hak');
}
async init() {
this.runtime = await getRuntime(this.projectRoot);
this.runtimeVersion = await getRuntimeVersion(this.projectRoot);
}
getRuntimeAbi(): string {
return nodePreGypVersioning.get_runtime_abi(
this.runtime,
this.runtimeVersion,
);
}
// {node_abi}-{platform}-{arch}
getNodeTriple(): string {
return this.getRuntimeAbi() + '-' + this.target.platform + '-' + this.target.arch;
}
getTargetId(): TargetId {
return this.target.id;
}
isWin(): boolean {
return this.target.platform === 'win32';
}
isMac(): boolean {
return this.target.platform === 'darwin';
}
isLinux(): boolean {
return this.target.platform === 'linux';
}
getTargetArch(): Arch {
return this.target.arch;
}
isHost(): boolean {
return isHostId(this.target.id);
}
makeGypEnv(): Record<string, string> {
return Object.assign({}, process.env, {
npm_config_arch: this.target.arch,
npm_config_target_arch: this.target.arch,
npm_config_disturl: 'https://atom.io/download/electron',
npm_config_runtime: this.runtime,
npm_config_target: this.runtimeVersion,
npm_config_build_from_source: true,
npm_config_devdir: path.join(os.homedir(), ".electron-gyp"),
});
}
getNodeModuleBin(name: string): string {
return path.join(this.projectRoot, 'node_modules', '.bin', name);
}
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,11 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const path = require('path');
import path from 'path';
import findNpmPrefix from 'find-npm-prefix';
const findNpmPrefix = require('find-npm-prefix');
const HakEnv = require('./hakEnv');
import HakEnv from './hakEnv';
import { TargetId } from './target';
import { DependencyInfo } from './dep';
const GENERALCOMMANDS = [
'target',
@@ -35,6 +36,13 @@ const MODULECOMMANDS = [
'clean',
];
// Shortcuts for multiple commands at once (useful for building universal binaries
// because you can run the fetch/fetchDeps/build for each arch and then copy/link once)
const METACOMMANDS = {
'fetchandbuild': ['check', 'fetch', 'fetchDeps', 'build'],
'copyandlink': ['copy', 'link'],
};
// Scripts valid in a hak.json 'scripts' section
const HAKSCRIPTS = [
'check',
@@ -53,9 +61,30 @@ async function main() {
process.exit(1);
}
const hakEnv = new HakEnv(prefix, packageJson);
const targetIds = [] as TargetId[];
// Apply `--target <target>` option if specified
// Can be specified multiple times for the copy command to bundle
// multiple archs into a single universal output module)
while (true) { // eslint-disable-line no-constant-condition
const targetIndex = process.argv.indexOf('--target');
if (targetIndex === -1) break;
const deps = {};
if ((targetIndex + 1) >= process.argv.length) {
console.error("--target option specified without a target");
process.exit(1);
}
// Extract target ID and remove from args
targetIds.push(process.argv.splice(targetIndex, 2)[1] as TargetId);
}
const hakEnvs = targetIds.map(tid => new HakEnv(prefix, tid));
if (hakEnvs.length == 0) hakEnvs.push(new HakEnv(prefix, null));
for (const h of hakEnvs) {
await h.init();
}
const hakEnv = hakEnvs[0];
const deps = {} as Record<string, DependencyInfo>;
const hakDepsCfg = packageJson.hakDependencies || {};
@@ -75,16 +104,23 @@ async function main() {
cfg: hakJson,
moduleHakDir: path.join(prefix, 'hak', dep),
moduleDotHakDir: path.join(hakEnv.dotHakDir, dep),
moduleBuildDir: path.join(hakEnv.dotHakDir, dep, 'build'),
moduleTargetDotHakDir: path.join(hakEnv.dotHakDir, dep, hakEnv.getTargetId()),
moduleBuildDir: path.join(hakEnv.dotHakDir, dep, hakEnv.getTargetId(), 'build'),
moduleBuildDirs: hakEnvs.map(h => path.join(h.dotHakDir, dep, h.getTargetId(), 'build')),
moduleOutDir: path.join(hakEnv.dotHakDir, 'hakModules', dep),
nodeModuleBinDir: path.join(hakEnv.dotHakDir, dep, 'build', 'node_modules', '.bin'),
depPrefix: path.join(hakEnv.dotHakDir, dep, 'opt'),
nodeModuleBinDir: path.join(hakEnv.dotHakDir, dep, hakEnv.getTargetId(), 'build', 'node_modules', '.bin'),
depPrefix: path.join(hakEnv.dotHakDir, dep, hakEnv.getTargetId(), 'opt'),
scripts: {},
};
for (const s of HAKSCRIPTS) {
if (hakJson.scripts && hakJson.scripts[s]) {
deps[dep].scripts[s] = require(path.join(prefix, 'hak', dep, hakJson.scripts[s]));
const scriptModule = await import(path.join(prefix, 'hak', dep, hakJson.scripts[s]));
if (scriptModule.__esModule) {
deps[dep].scripts[s] = scriptModule.default;
} else {
deps[dep].scripts[s] = scriptModule;
}
}
}
}
@@ -92,10 +128,18 @@ async function main() {
let cmds;
if (process.argv.length < 3) {
cmds = ['check', 'fetch', 'fetchDeps', 'build', 'copy', 'link'];
} else if (METACOMMANDS[process.argv[2]]) {
cmds = METACOMMANDS[process.argv[2]];
} else {
cmds = [process.argv[2]];
}
if (hakEnvs.length > 1 && cmds.some(c => !['copy', 'link'].includes(c))) {
// We allow link here too for convenience because it's completely arch independent
console.error("Multiple targets only supported with the copy command");
return;
}
let modules = process.argv.slice(3);
if (modules.length === 0) modules = Object.keys(deps);
@@ -116,7 +160,7 @@ async function main() {
process.exit(1);
}
const cmdFunc = require('./' + cmd);
const cmdFunc = (await import('./' + cmd)).default;
for (const mod of modules) {
const depInfo = deps[mod];
@@ -133,4 +177,7 @@ async function main() {
}
}
main().catch(() => process.exit(1));
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -14,12 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const path = require('path');
const os = require('os');
const fsProm = require('fs').promises;
const childProcess = require('child_process');
import path from 'path';
import os from 'os';
import fsProm from 'fs/promises';
import childProcess from 'child_process';
async function link(hakEnv, moduleInfo) {
import HakEnv from './hakEnv';
import { DependencyInfo } from './dep';
export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const yarnrc = path.join(hakEnv.projectRoot, '.yarnrc');
// this is fairly terrible but it's reasonably clunky to either parse a yarnrc
// properly or get yarn to do it, so this will probably suffice for now.
@@ -46,7 +49,7 @@ async function link(hakEnv, moduleInfo) {
const yarnCmd = 'yarn' + (hakEnv.isWin() ? '.cmd' : '');
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(yarnCmd, ['link'], {
cwd: moduleInfo.moduleOutDir,
stdio: 'inherit',
@@ -56,7 +59,7 @@ async function link(hakEnv, moduleInfo) {
});
});
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(yarnCmd, ['link', moduleInfo.name], {
cwd: hakEnv.projectRoot,
stdio: 'inherit',
@@ -66,5 +69,3 @@ async function link(hakEnv, moduleInfo) {
});
});
}
module.exports = link;

126
scripts/hak/target.ts Normal file
View File

@@ -0,0 +1,126 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
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 borrow Rust's target naming scheme as a way of expressing all target
// details in a single string.
// See https://doc.rust-lang.org/rustc/platform-support.html.
export type TargetId =
'aarch64-apple-darwin' |
'x86_64-apple-darwin' |
'universal-apple-darwin' |
'i686-pc-windows-msvc' |
'x86_64-pc-windows-msvc' |
'x86_64-unknown-linux-gnu';
// Values are expected to match those used in `process.platform`.
export type Platform = 'darwin' | 'linux' | 'win32';
// Values are expected to match those used in `process.arch`.
export type Arch = 'arm64' | 'ia32' | 'x64' | 'universal';
// Values are expected to match those used by Visual Studio's `vcvarsall.bat`.
// See https://docs.microsoft.com/cpp/build/building-on-the-command-line?view=msvc-160#vcvarsall-syntax
export type VcVarsArch = 'amd64' | 'arm64' | 'x86';
export type Target = {
id: TargetId;
platform: Platform;
arch: Arch;
};
export type WindowsTarget = Target & {
platform: 'win32';
vcVarsArch: VcVarsArch;
};
export type UniversalTarget = Target & {
arch: 'universal';
subtargets: Target[];
};
const aarch64AppleDarwin: Target = {
id: 'aarch64-apple-darwin',
platform: 'darwin',
arch: 'arm64',
};
const x8664AppleDarwin: Target = {
id: 'x86_64-apple-darwin',
platform: 'darwin',
arch: 'x64',
};
const universalAppleDarwin: UniversalTarget = {
id: 'universal-apple-darwin',
platform: 'darwin',
arch: 'universal',
subtargets: [
aarch64AppleDarwin,
x8664AppleDarwin,
],
};
const i686PcWindowsMsvc: WindowsTarget = {
id: 'i686-pc-windows-msvc',
platform: 'win32',
arch: 'ia32',
vcVarsArch: 'x86',
};
const x8664PcWindowsMsvc: WindowsTarget = {
id: 'x86_64-pc-windows-msvc',
platform: 'win32',
arch: 'x64',
vcVarsArch: 'amd64',
};
const x8664UnknownLinuxGnu: Target = {
id: 'x86_64-unknown-linux-gnu',
platform: 'linux',
arch: 'x64',
};
export const TARGETS: Record<TargetId, Target> = {
'aarch64-apple-darwin': aarch64AppleDarwin,
'x86_64-apple-darwin': x8664AppleDarwin,
'universal-apple-darwin': universalAppleDarwin,
'i686-pc-windows-msvc': i686PcWindowsMsvc,
'x86_64-pc-windows-msvc': x8664PcWindowsMsvc,
'x86_64-unknown-linux-gnu': x8664UnknownLinuxGnu,
};
// The set of targets we build by default, sorted by increasing complexity so
// that we fail fast when the native host target fails.
export const ENABLED_TARGETS: Target[] = [
TARGETS['universal-apple-darwin'],
TARGETS['x86_64-unknown-linux-gnu'],
TARGETS['x86_64-pc-windows-msvc'],
];
export function getHost(): Target {
return Object.values(TARGETS).find(target => (
target.platform === process.platform &&
target.arch === process.arch
));
}
export function isHostId(id: TargetId): boolean {
return getHost()?.id === id;
}
export function isHost(target: Target): boolean {
return getHost()?.id === target.id;
}

18
scripts/hak/tsconfig.json Normal file
View File

@@ -0,0 +1,18 @@
{
"compilerOptions": {
"moduleResolution": "node",
"esModuleInterop": true,
"target": "es2017",
"module": "commonjs",
"sourceMap": false,
"lib": [
"es2019",
]
},
"include": [
"./**/*.ts"
],
"ts-node": {
"transpileOnly": true
}
}

View File

@@ -7,8 +7,9 @@ if [ $? != 0 ]; then
fi
# Taken from https://www.electron.build/multi-platform-build#docker
# Pass through any vars prefixed with INDOCKER_, removing the prefix
docker run --rm -ti \
--env-file <(env | grep -iE '^BUILDKITE_API_KEY=') \
--env-file <(env | grep -E '^INDOCKER_' | sed -e 's/^INDOCKER_//') \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v ${PWD}:/project \

26
src/@types/global.d.ts vendored Normal file
View File

@@ -0,0 +1,26 @@
/*
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 { BrowserWindow } from "electron";
declare global {
namespace NodeJS {
interface Global {
mainWindow: BrowserWindow;
appQuitting: boolean;
}
}
}

View File

@@ -17,37 +17,42 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Squirrel on windows starts the app with various flags
// as hooks to tell us when we've been installed/uninstalled
// etc.
const checkSquirrelHooks = require('./squirrelhooks');
if (checkSquirrelHooks()) return;
// Squirrel on windows starts the app with various flags as hooks to tell us when we've been installed/uninstalled etc.
import "./squirrelhooks";
import {
app,
ipcMain,
powerSaveBlocker,
BrowserWindow,
Menu,
autoUpdater,
protocol,
dialog,
desktopCapturer,
} from "electron";
import AutoLaunch from "auto-launch";
import path from "path";
import windowStateKeeper from 'electron-window-state';
import Store from 'electron-store';
import fs, { promises as afs } from "fs";
import crypto from "crypto";
import { URL } from "url";
import minimist from "minimist";
const argv = require('minimist')(process.argv, {
import * as tray from "./tray";
import { buildMenuTemplate } from './vectormenu';
import webContentsHandler from './webcontents-handler';
import * as updater from './updater';
import { getProfileFromDeeplink, protocolInit, recordSSOSession } from './protocol';
import { _t, AppLocalization } from './language-helper';
const argv = minimist(process.argv, {
alias: { help: "h" },
});
const {
app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater, protocol, dialog,
} = require('electron');
const AutoLaunch = require('auto-launch');
const path = require('path');
const tray = require('./tray');
const buildMenuTemplate = require('./vectormenu');
const webContentsHandler = require('./webcontents-handler');
const updater = require('./updater');
const { getProfileFromDeeplink, protocolInit, recordSSOSession } = require('./protocol');
const windowStateKeeper = require('electron-window-state');
const Store = require('electron-store');
const fs = require('fs');
const afs = fs.promises;
const crypto = require('crypto');
let keytar;
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
keytar = require('keytar');
} catch (e) {
if (e.code === "MODULE_NOT_FOUND") {
@@ -57,14 +62,13 @@ try {
}
}
const { _t, AppLocalization } = require('./language-helper');
let seshatSupported = false;
let Seshat;
let SeshatRecovery;
let ReindexError;
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const seshatModule = require('matrix-seshat');
Seshat = seshatModule.Seshat;
SeshatRecovery = seshatModule.SeshatRecovery;
@@ -181,6 +185,7 @@ async function setupGlobals() {
]);
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
vectorConfig = require(asarPath + 'config.json');
} catch (e) {
// it would be nice to check the error code here and bail if the config
@@ -192,6 +197,7 @@ async function setupGlobals() {
try {
// Load local config and use it to override values from the one baked with the build
// eslint-disable-next-line @typescript-eslint/no-var-requires
const localConfig = require(path.join(app.getPath('userData'), 'config.json'));
// If the local config has a homeserver defined, don't use the homeserver from the build
@@ -207,6 +213,16 @@ async function setupGlobals() {
vectorConfig = Object.assign(vectorConfig, localConfig);
} catch (e) {
if (e instanceof SyntaxError) {
dialog.showMessageBox({
type: "error",
title: `Your ${vectorConfig.brand || 'Element'} is misconfigured`,
message: `Your custom ${vectorConfig.brand || 'Element'} configuration contains invalid JSON. ` +
`Please correct the problem and reopen ${vectorConfig.brand || 'Element'}.`,
detail: e.message || "",
});
}
// Could not load local config, this is expected in most cases.
}
@@ -249,7 +265,13 @@ async function moveAutoLauncher() {
}
const eventStorePath = path.join(app.getPath('userData'), 'EventStore');
const store = new Store({ name: "electron-config" });
const store = new Store<{
warnBeforeExit?: boolean;
minimizeToTray?: boolean;
spellCheckerEnabled?: boolean;
autoHideMenuBar?: boolean;
locale?: string | string[];
}>({ name: "electron-config" });
let eventIndex = null;
@@ -264,7 +286,8 @@ const exitShortcuts = [
const warnBeforeExit = (event, input) => {
const shouldWarnBeforeExit = store.get('warnBeforeExit', true);
const exitShortcutPressed = exitShortcuts.some(shortcutFn => shortcutFn(input, process.platform));
const exitShortcutPressed =
input.type === 'keyDown' && exitShortcuts.some(shortcutFn => shortcutFn(input, process.platform));
if (shouldWarnBeforeExit && exitShortcutPressed) {
const shouldCancelCloseRequest = dialog.showMessageBoxSync(mainWindow, {
@@ -312,7 +335,12 @@ process.on('uncaughtException', function(error) {
let focusHandlerAttached = false;
ipcMain.on('setBadgeCount', function(ev, count) {
app.badgeCount = count;
if (process.platform !== 'win32') {
// only set badgeCount on Mac/Linux, the docs say that only those platforms support it but turns out Electron
// has some Windows support too, and in some Windows environments this leads to two badges rendering atop
// each other. See https://github.com/vector-im/element-web/issues/16942
app.badgeCount = count;
}
if (count === 0 && mainWindow) {
mainWindow.flashFrame(false);
}
@@ -484,6 +512,13 @@ ipcMain.on('ipcCall', async function(ev, payload) {
await keytar.deletePassword("riot.im", `${args[0]}|${args[1]}`);
} catch (e) {}
break;
case 'getDesktopCapturerSources':
ret = (await desktopCapturer.getSources(args[0])).map((source) => ({
id: source.id,
name: source.name,
thumbnailURL: source.thumbnail.toDataURL(),
}));
break;
default:
mainWindow.webContents.send('ipcReply', {
@@ -767,6 +802,9 @@ ipcMain.on('seshat', async function(ev, payload) {
});
app.commandLine.appendSwitch('--enable-usermedia-screen-capturing');
if (!app.commandLine.hasSwitch('enable-features')) {
app.commandLine.appendSwitch('enable-features', 'WebRTCPipeWireCapturer');
}
const gotLock = app.requestSingleInstanceLock();
if (!gotLock) {
@@ -821,6 +859,7 @@ app.on('ready', async () => {
if (argv['devtools']) {
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { default: installExt, REACT_DEVELOPER_TOOLS, REACT_PERF } = require('electron-devtools-installer');
installExt(REACT_DEVELOPER_TOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
@@ -917,9 +956,8 @@ app.on('ready', async () => {
preload: preloadScript,
nodeIntegration: false,
//sandbox: true, // We enable sandboxing from app.enableSandbox() above
enableRemoteModule: false,
contextIsolation: true,
webgl: false,
webgl: true,
},
});
mainWindow.loadURL('vector://vector/webapp/');
@@ -1005,7 +1043,7 @@ function beforeQuit() {
}
app.on('before-quit', beforeQuit);
app.on('before-quit-for-update', beforeQuit);
autoUpdater.on('before-quit-for-update', beforeQuit);
app.on('second-instance', (ev, commandLine, workingDirectory) => {
// If other instance launched with --hidden then skip showing window

View File

@@ -1,12 +1,46 @@
{
"File": َلَفّ",
"Close": "إغلاق",
"Actual Size": "الحَجمُ الفِعلي",
"View": "الاِطِّلاع",
"Select All": "تَحدِيدُ الكُل",
"Delete": َذف",
"Copy": َسخ",
"Edit": َحرير",
"Close Element": "إغلَاقُ Element",
"Cancel": "إلغَاء"
"File": لف",
"Close": "أغلِق",
"Actual Size": "المقاس الفعلي",
"View": "منظور",
"Select All": "حدّد الكل",
"Delete": "احذف",
"Copy": "انسخ",
"Edit": "تحرير",
"Close Element": "أغلِق Element",
"Cancel": "ألغِ",
"Bring All to Front": "ضَع الكل في المقدّمة",
"Speech": "نطق",
"Add to dictionary": "أضِف إلى القاموس",
"The image failed to save": "فشل حفظ الصورة",
"Failed to save image": "فشل حفظ الصورة",
"Save image as...": "احفظ الصورة كَ‍...",
"Copy link address": "انسخ عنوان الرابط",
"Copy email address": "انسخ عنوان البريد الإلكتروني",
"Copy image": "انسخ الصورة",
"Zoom": "تقريب",
"Stop Speaking": "أوقِف النطق",
"Start Speaking": "ابدأ النطق",
"Unhide": "اعرض",
"Hide Others": "أخفِ البقية",
"Hide": "أخفِ",
"Services": "الخدمات",
"About": "عن",
"Element Help": "مساعدة Element",
"Help": "مساعدة",
"Minimize": "صغّر",
"Window": "نافذة",
"Toggle Developer Tools": "فعّل/عطّل أدوات المطوّرين",
"Toggle Full Screen": "فعّل/عطّل ملء الشاشة",
"Preferences": "التفضيلات",
"Zoom In": "قرّب",
"Zoom Out": "بعّد",
"Paste and Match Style": "ألصِق وطابِق النمط",
"Paste": "ألصِق",
"Cut": "قصّ",
"Redo": "أعِد",
"Undo": "تراجَع",
"Quit": "غادِر",
"Show/Hide": "اعرض/أخفِ",
"Are you sure you want to quit?": "أمتأكّد من الإغلاق؟"
}

46
src/i18n/strings/be.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Add to dictionary": "Дадаць у слоўнік",
"The image failed to save": "Не атрымалася захаваць малюнак",
"Failed to save image": "Не атрымалася захаваць малюнак",
"Save image as...": "Захаваць малюнак як...",
"Copy link address": "Скапіраваць спасылку",
"Copy email address": "Скапіраваць адрас пошты",
"Copy image": "Скапіраваць малюнак",
"File": "Файл",
"Bring All to Front": "Вынесці ўсё наперад",
"Zoom": "Маштаб",
"Stop Speaking": "Перастаць гаварыць",
"Start Speaking": "Гаварыць",
"Speech": "Голас",
"Unhide": "Паказаць",
"Hide Others": "Схаваць іншыя",
"Hide": "Схаваць",
"Services": "Сервісы",
"About": "Аб праграме",
"Element Help": "Даведка Element",
"Help": "Даведка",
"Close": "Зачыніць",
"Minimize": "Згарнуць",
"Window": "Акно",
"Toggle Developer Tools": "Пераключэнне інструментаў распрацоўніка",
"Toggle Full Screen": "Пераключэнне на ўвесь экран",
"Preferences": "Параметры",
"Zoom Out": "Паменшыць",
"Zoom In": "Павялічыць",
"Actual Size": "Фактычны Памер",
"View": "Прагляд",
"Select All": "Выбраць усё",
"Delete": "Выдаліць",
"Paste and Match Style": "Уставіць і супаставіць стыль",
"Paste": "Уставіць",
"Copy": "Капіяваць",
"Cut": "Выразаць",
"Redo": "Паўтарыць",
"Undo": "Адмяніць",
"Edit": "Змяніць",
"Quit": "Выйсці",
"Show/Hide": "Паказаць / схаваць",
"Are you sure you want to quit?": "Вы ўпэўненыя, што хочаце выйсці?",
"Close Element": "Зачыніць Element",
"Cancel": "Адмена"
}

46
src/i18n/strings/ca.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Add to dictionary": "Afegeix al diccionari",
"The image failed to save": "S'ha fallat en desar la imatge",
"Failed to save image": "S'ha fallat en desar la imatge",
"Save image as...": "Anomena i desa la imatge...",
"Copy link address": "Copia l'adreça de l'enllaç",
"Copy email address": "Copia l'adreça de correu electrònic",
"Copy image": "Copia la imatge",
"File": "Fitxer",
"Bring All to Front": "Porta-ho tot al davant",
"Zoom": "Escala",
"Stop Speaking": "Para la veu",
"Start Speaking": "Comença la veu",
"Speech": "Veu",
"Unhide": "Deixa d'amagar",
"Hide Others": "Amaga les altres",
"Hide": "Amaga",
"Services": "Serveis",
"About": "Quant a",
"Element Help": "Ajuda sobre l'Element",
"Help": "Ajuda",
"Close": "Tanca",
"Minimize": "Minimitza",
"Window": "Finestra",
"Toggle Developer Tools": "Commuta les eines per a desenvolupadors",
"Toggle Full Screen": "Commuta la pantalla completa",
"Preferences": "Preferències",
"Zoom Out": "Allunya",
"Zoom In": "Apropia",
"Actual Size": "Mida real",
"View": "Visualitza",
"Select All": "Selecciona-ho tot",
"Delete": "Suprimeix",
"Paste and Match Style": "Enganxa i fes coincidir l'estil",
"Paste": "Enganxa",
"Copy": "Copia",
"Cut": "Retalla",
"Redo": "Refés",
"Undo": "Desfés",
"Edit": "Edita",
"Quit": "Surt",
"Show/Hide": "Mostra/Amaga",
"Are you sure you want to quit?": "Esteu segur que voleu sortir?",
"Close Element": "Tanca l'Element",
"Cancel": "Cancel·la"
}

View File

@@ -0,0 +1,46 @@
{
"Close": "Close",
"Add to dictionary": "Add to dictionary",
"The image failed to save": "The image failed to save",
"Failed to save image": "Failed to save image",
"Save image as...": "Save image as...",
"Copy link address": "Copy link address",
"Copy email address": "Copy email address",
"Copy image": "Copy image",
"File": "File",
"Bring All to Front": "Bring All to Front",
"Zoom": "Zoom",
"Stop Speaking": "Stop Speaking",
"Start Speaking": "Start Speaking",
"Speech": "Speech",
"Unhide": "Unhide",
"Hide Others": "Hide Others",
"Hide": "Hide",
"Services": "Services",
"About": "About",
"Element Help": "Element Help",
"Help": "Help",
"Minimize": "Minimize",
"Window": "Window",
"Toggle Developer Tools": "Toggle Developer Tools",
"Toggle Full Screen": "Toggle Full Screen",
"Preferences": "Preferences",
"Zoom Out": "Zoom Out",
"Zoom In": "Zoom In",
"Actual Size": "Actual Size",
"View": "View",
"Select All": "Select All",
"Delete": "Delete",
"Paste and Match Style": "Paste and Match Style",
"Paste": "Paste",
"Copy": "Copy",
"Cut": "Cut",
"Redo": "Redo",
"Undo": "Undo",
"Edit": "Edit",
"Quit": "Quit",
"Show/Hide": "Show/Hide",
"Are you sure you want to quit?": "Are you sure you want to quit?",
"Close Element": "Close Element",
"Cancel": "Cancel"
}

View File

@@ -25,7 +25,7 @@
"Minimize": "Pienennä",
"Window": "Ikkuna",
"Toggle Developer Tools": "Näytä tai piilota kehittäjätyökalut",
"Toggle Full Screen": "Vaihda koko näyttö-tilaa",
"Toggle Full Screen": "Vaihda koko näytön tilaa",
"Preferences": "Asetukset",
"Zoom Out": "Pienennä",
"Zoom In": "Suurenna",
@@ -39,8 +39,8 @@
"Undo": "Peru",
"Edit": "Muokkaa",
"Quit": "Lopeta",
"Show/Hide": "Näytä/Piilota",
"Are you sure you want to quit?": "Oletko varma että haluat poistua?",
"Show/Hide": "Näytä/piilota",
"Are you sure you want to quit?": "Haluatko varmasti poistua?",
"Close Element": "Sulje Element",
"Cancel": "Peruuta"
}

46
src/i18n/strings/fy.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Copy image": "Ofbylding kopiearje",
"Speech": "Spraak",
"View": "Byld",
"Paste and Match Style": "Plakke en lit stilen oerienkomme",
"Add to dictionary": "Oan wurdlist tafoegje",
"The image failed to save": "It is net slagge de ôfbylding te bewarjen",
"Failed to save image": "Ofbylding bewarjen mislearre",
"Save image as...": "Ofbylding bewarje as…",
"Copy link address": "Keppeling kopiearje",
"Copy email address": "E-mailadres kopiearje",
"File": "Bestân",
"Bring All to Front": "Alles nei foaren bringe",
"Zoom": "Zoom",
"Stop Speaking": "Stopje mei praten",
"Start Speaking": "Begjin mei praten",
"Unhide": "Wer toane",
"Hide Others": "Oare ferbergje",
"Hide": "Ferbergje",
"Services": "Tsjinsten",
"About": "Oer",
"Element Help": "Element help",
"Help": "Help",
"Close": "Slute",
"Minimize": "Minimalisearje",
"Window": "Finster",
"Toggle Developer Tools": "Untwikkelersark yn-/útskeakelje",
"Toggle Full Screen": "Folslein skerm yn-/útskeakelje",
"Preferences": "Foarkarren",
"Zoom Out": "Utzoome",
"Zoom In": "Ynzoome",
"Actual Size": "Werklike grutte",
"Select All": "Alles selektearje",
"Delete": "Fuortsmite",
"Paste": "Plakke",
"Copy": "Kopiearje",
"Cut": "Knippe",
"Redo": "Opnij útfiere",
"Undo": "Ungedien meitsje",
"Edit": "Bewurkje",
"Quit": "Ofslute",
"Show/Hide": "Toane/Ferbergje",
"Are you sure you want to quit?": "Binne jo der wis fan dat jo ôfslute wolle?",
"Close Element": "Element ôfslute",
"Cancel": "Annulearje"
}

46
src/i18n/strings/he.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Actual Size": "גודל ממשי",
"Add to dictionary": "הוסף למילון",
"The image failed to save": "שמירת התמונה נכשלה",
"Failed to save image": "נכשל בשמירת התמונה",
"Save image as...": "שמור תמונה בשם...",
"Copy link address": "העתק קישור",
"Copy email address": "העתק כתובת אימייל",
"Copy image": "העתק תמונה",
"File": "קובץ",
"Bring All to Front": "הבא הכל לחזית",
"Zoom": "גודל תצוגה",
"Stop Speaking": "הפסק לדבר",
"Start Speaking": "התחל לדבר",
"Speech": "דיבור",
"Unhide": "בטל הסתרה",
"Hide Others": "הסתר אחרים",
"Hide": "הסתר",
"Services": "שרותים",
"About": "אודות",
"Element Help": "עזרה של אלמנט",
"Help": "עזרה",
"Close": "סגור",
"Minimize": "מזער",
"Window": "חלון",
"Toggle Developer Tools": "הפעל כלי מפתחים",
"Toggle Full Screen": "הפעל מצב מסך מלא",
"Preferences": "העדפות",
"Zoom Out": "התרחק",
"Zoom In": "התקרב",
"View": "צפה",
"Select All": "בחר הכל",
"Delete": "מחק",
"Paste": "הדבק",
"Copy": "העתק",
"Cut": "גזור",
"Undo": "בטל ביצוע",
"Redo": "בצע שוב",
"Edit": "עריכה",
"Quit": "יציאה",
"Show/Hide": "הצג\\הסתר",
"Are you sure you want to quit?": "האם אתה בטוח שברצונך לצאת?",
"Close Element": "סגור את אלמנט",
"Cancel": "ביטול",
"Paste and Match Style": "הדבק והתאם סגנון"
}

46
src/i18n/strings/id.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Add to dictionary": "Tambah ke kamus",
"The image failed to save": "Gambar gagal disimpan",
"Failed to save image": "Gagal menyimpan gambar",
"Save image as...": "Simpan gambar sebagai...",
"Copy link address": "Salin alamat tautan",
"Copy email address": "Salin surel",
"Copy image": "Salin gambar",
"File": "File",
"Hide Others": "Sembunyikan yang Lain",
"Bring All to Front": "Bawa Semua ke Depan",
"Zoom": "Perbesar",
"Stop Speaking": "Berhenti Berbicara",
"Start Speaking": "Mulai Berbicara",
"Speech": "Dikte",
"Unhide": "Tampilkan",
"Hide": "Sembunyikan",
"Services": "Layanan",
"About": "Tentang",
"Element Help": "Bantuan Element",
"Help": "Bantuan",
"Close": "Tutup",
"Minimize": "Minimalkan",
"Window": "Jendela",
"Toggle Developer Tools": "Beralih Alat Pengembang",
"Toggle Full Screen": "Beralih Layar Penuh",
"Preferences": "Pengaturan",
"Zoom Out": "Perkecil",
"Zoom In": "Perbesar",
"Cut": "Potong",
"Redo": "Ulangi",
"Undo": "Urungkan",
"Actual Size": "Ukuran Sebenarnya",
"View": "Tampilan",
"Select All": "Pilih Semua",
"Delete": "Hapus",
"Paste and Match Style": "Tempel dan Cocokkan Gaya",
"Paste": "Tempel",
"Copy": "Salin",
"Edit": "Edit",
"Quit": "Keluar",
"Show/Hide": "Tampilkan/Sembunyikan",
"Are you sure you want to quit?": "Apakah Anda yakin ingin keluar?",
"Close Element": "Tutup Element",
"Cancel": "Batal"
}

View File

@@ -1,37 +1,37 @@
{
"Add to dictionary": "Bæta við orðabók",
"The image failed to save": "Myndin mistóksts að vista",
"Add to dictionary": "Bæta við orðasafn",
"The image failed to save": "Myndina var ekki hægt að vista",
"Failed to save image": "Mistókst að vista mynd",
"Save image as...": "Vista mynd sem...",
"Copy link address": "Afrita nethlekk",
"Copy link address": "Afrita vistfang tengils",
"Copy email address": "Afrita tölvupóstfang",
"Copy image": "Afrita mynd",
"File": "Skrá",
"Bring All to Front": "Koma Öllum að Framan",
"Bring All to Front": "Setja allt fremst",
"Zoom": "Stærð",
"Stop Speaking": "Hætta Tal",
"Start Speaking": "Byrja Tal",
"Stop Speaking": "Hætta tali",
"Start Speaking": "Byrja tal",
"Speech": "Tal",
"Unhide": "Birta",
"Hide Others": "Fela Aðra",
"Hide Others": "Fela aðra",
"Hide": "Fela",
"Services": "Þjónustur",
"About": "Um",
"Element Help": "Element Hjálp",
"About": "Um hugbúnaðinn",
"Element Help": "Hjálp við Element",
"Help": "Hjálp",
"Close": "Loka",
"Minimize": "Lágmarka",
"Window": "Gluggi",
"Toggle Developer Tools": "Skipta Framkvæmdaraðilaverkfæri",
"Toggle Full Screen": "Skipta um Fullskjá",
"Toggle Developer Tools": "Víxla forritunarverkfærum af/á",
"Toggle Full Screen": "Víxla fullum skjá af/á",
"Preferences": "Stillingar",
"Zoom Out": "Minnka",
"Zoom In": "Stækka",
"Actual Size": "Raunveruleg Stærð",
"Actual Size": "Raunstærð",
"View": "Skoða",
"Select All": "Velja Allt",
"Select All": "Velja allt",
"Delete": "Eyða",
"Paste and Match Style": "Líma og Passa Stíl",
"Paste and Match Style": "Líma og samsvara stíl",
"Paste": "Líma",
"Copy": "Afrita",
"Cut": "Klippa",

46
src/i18n/strings/lv.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Start Speaking": "Runājiet...",
"Add to dictionary": "Pievienot vārdnīcai",
"The image failed to save": "Attēlu saglabāt neizdevās",
"Failed to save image": "Neizdevās saglabāt attēlu",
"Save image as...": "Saglabāt attēlu kā...",
"Copy link address": "Kopēt saiti",
"Copy email address": "Kopēt e-pastu",
"Copy image": "Kopēt attēlu",
"File": "Fails",
"Bring All to Front": "Iznest visu priekšplānā",
"Zoom": "Mērogošana",
"Stop Speaking": "Beidziet runāt",
"Speech": "Runa",
"Unhide": "Rādīt",
"Hide Others": "Slēpt citus",
"Hide": "Slēpt",
"Services": "Servisi/pakalpojumi",
"About": "Par programmu",
"Element Help": "Element palīdzība",
"Help": "Palīdzība",
"Close": "Aizvērt",
"Minimize": "Minimizēt",
"Window": "Logs",
"Toggle Developer Tools": "Pārslēgt uz Izstrādātāja rīkiem",
"Toggle Full Screen": "Pārslēgt uz pilnekrānu",
"Preferences": "Parametri/iestatījumi",
"Zoom Out": "Samazināt",
"Zoom In": "Palielināt",
"Actual Size": "Faktiskais izmērs",
"View": "Skats",
"Select All": "Atzīmēt visus",
"Delete": "Dzēst",
"Paste and Match Style": "Ievietot, saglabājot stilu",
"Paste": "Ievietot",
"Copy": "Kopēt",
"Cut": "Izgriezt",
"Redo": "Atatdarīt/atatgriezt (redo)",
"Undo": "Atgreizt/atdarīt (undo)",
"Edit": "Rediģēt",
"Quit": "Iziet",
"Show/Hide": "Rādīt/nerādīt",
"Are you sure you want to quit?": "Tiešām vēlaties iziet?",
"Close Element": "Aizvērt Elementu",
"Cancel": "Atcelt"
}

View File

@@ -1,3 +1,37 @@
{
"Toggle Developer Tools": "Veksle Utvikleralternativer"
"Toggle Developer Tools": "Veksle Utvikleralternativer",
"Add to dictionary": "Legg til i ordbok",
"The image failed to save": "Bildet kunne ikke lagres",
"Failed to save image": "Kunne ikke lagre bildet",
"Save image as...": "Lagre bildet som...",
"Copy email address": "Kopier e-postadressen",
"Copy image": "Kopier bildet",
"File": "Fil",
"Stop Speaking": "Slutt å snakke",
"Start Speaking": "Begynn å snakke",
"Speech": "Tale",
"Hide": "Skjul",
"About": "Om",
"Element Help": "Element Hjelp",
"Help": "Hjelp",
"Close": "Lukk",
"Minimize": "Minimere",
"Window": "Vindu",
"Zoom Out": "Zoom ut",
"Zoom In": "Zoom inn",
"Actual Size": "Faktisk størrelse",
"View": "Se",
"Select All": "Velg alle",
"Delete": "Slett",
"Paste": "Lim inn",
"Copy": "Kopier",
"Undo": "Angre",
"Edit": "Rediger",
"Quit": "Avslutt",
"Show/Hide": "Vis/Skjul",
"Are you sure you want to quit?": "Er du sikker på at du vil slutte?",
"Close Element": "Lukk Element",
"Cancel": "Avbryt",
"Services": "Tjenester",
"Hide Others": "Skjul Andre"
}

46
src/i18n/strings/nl.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Add to dictionary": "Aan woordenboek toevoegen",
"The image failed to save": "De afbeelding opslaan is mislukt",
"Failed to save image": "Afbeelding opslaan is mislukt",
"Save image as...": "Afbeelding opslaan als...",
"Copy link address": "Link kopiëren",
"Copy email address": "E-mailadres kopiëren",
"Copy image": "Afbeelding kopiëren",
"File": "Bestand",
"Bring All to Front": "Alles naar voren brengen",
"Zoom": "Zoom",
"Stop Speaking": "Stop met praten",
"Start Speaking": "Begin met praten",
"Speech": "Spraak",
"Unhide": "Weer laten zien",
"Hide Others": "Andere verbergen",
"Hide": "Verbergen",
"Services": "Diensten",
"About": "Over",
"Element Help": "Element Help",
"Help": "Help",
"Close": "Sluiten",
"Minimize": "Minimaliseren",
"Window": "Venster",
"Toggle Developer Tools": "Developer Tools wisselen",
"Toggle Full Screen": "Volledig scherm wisselen",
"Preferences": "Voorkeuren",
"Zoom Out": "Uitzoomen",
"Zoom In": "Inzoomen",
"Actual Size": "Werkelijke grootte",
"View": "Bekijken",
"Select All": "Alles selecteren",
"Delete": "Verwijderen",
"Paste and Match Style": "Plakken zonder stijl",
"Paste": "Plakken",
"Copy": "Kopiëren",
"Cut": "Knippen",
"Redo": "Opnieuw doen",
"Undo": "Ongedaan maken",
"Edit": "Bewerken",
"Quit": "Sluiten",
"Show/Hide": "Tonen/Verbergen",
"Are you sure you want to quit?": "Weet u zeker dat u wilt stoppen?",
"Close Element": "Element sluiten",
"Cancel": "Annuleren"
}

46
src/i18n/strings/nn.json Normal file
View File

@@ -0,0 +1,46 @@
{
"The image failed to save": "Biletet vart ikkje lagra",
"Paste and Match Style": "Lim inn og tilpass stil",
"Redo": "Gjer om",
"Undo": "Angre",
"Are you sure you want to quit?": "Er du sikker på at du vil avslutta?",
"Add to dictionary": "Legg til i ordlista",
"Failed to save image": "Klarte ikkje å lagra biletet",
"Save image as...": "Lagre bilete som…",
"Copy link address": "Kopier lenkjeadresse",
"Copy email address": "Kopier e-postadresse",
"Copy image": "Kopier bilete",
"File": "Fil",
"Bring All to Front": "Plasser lengst fram",
"Zoom": "Zoom",
"Stop Speaking": "Stopp snakka",
"Start Speaking": "Byrja snakka",
"Speech": "Tale",
"Unhide": "Ikkje gøym",
"Hide Others": "Gøym andre",
"Hide": "Gøym",
"Services": "Tenester",
"About": "Om",
"Element Help": "Hjelp med Element",
"Help": "Hjelp",
"Close": "Lat att",
"Minimize": "Minimer",
"Window": "Vindauga",
"Toggle Developer Tools": "Developer Tools av/på",
"Toggle Full Screen": "Fullskjerm av/på",
"Preferences": "Innstillingar",
"Zoom Out": "Zoom ut",
"Zoom In": "Zoom inn",
"Actual Size": "Faktisk storleik",
"View": "Vis",
"Select All": "Marker alt",
"Delete": "Slett",
"Paste": "Lim inn",
"Copy": "Lim inn",
"Cut": "Klipp ut",
"Edit": "Rediger",
"Quit": "Avslutt",
"Show/Hide": "Vis/Gøym",
"Close Element": "Lat att Element",
"Cancel": "Avbryt"
}

46
src/i18n/strings/pl.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Bring All to Front": "Wyciągnij wszystko do przodu",
"Add to dictionary": "Dodaj do słownika",
"The image failed to save": "Obraz nie został zapisany",
"Failed to save image": "Nie udało się zapisać obrazu",
"Save image as...": "Zapisz obraz jako...",
"Copy link address": "Skopiuj adres łącza",
"Copy email address": "Skopiuj adres email",
"Copy image": "Skopiuj obraz",
"File": "Plik",
"Zoom": "Powiększenie",
"Stop Speaking": "Przestań mówić",
"Start Speaking": "Zacznij mówić",
"Speech": "Mowa",
"Unhide": "Odkryj",
"Hide Others": "Ukryj inne",
"Hide": "Ukryj",
"Services": "Usługi",
"About": "O nas",
"Element Help": "Pomoc Element",
"Help": "Pomoc",
"Close": "Zamknij",
"Minimize": "Zminimalizuj",
"Window": "Okno",
"Toggle Developer Tools": "Przełącz na narzędzia deweloperskie",
"Toggle Full Screen": "Przełącz na pełny ekran",
"Preferences": "Preferencje",
"Zoom Out": "Pomniejsz",
"Zoom In": "Powiększ",
"Actual Size": "Rzeczywisty rozmiar",
"View": "Pokaż",
"Select All": "Zaznacz wszystko",
"Delete": "Usuń",
"Paste and Match Style": "Wklej i dopasuj styl",
"Paste": "Wklej",
"Copy": "Skopiuj",
"Cut": "Wytnij",
"Redo": "Powtórz",
"Undo": "Cofnij",
"Edit": "Edytuj",
"Quit": "Zamknij",
"Show/Hide": "Pokaż/Ukryj",
"Are you sure you want to quit?": "Czy na pewno chcesz zamknąć?",
"Close Element": "Zamknij Elementa",
"Cancel": "Anuluj"
}

View File

@@ -1 +1,43 @@
{}
{
"Add to dictionary": "Adăugați la dicționar",
"Failed to save image": "Eroare in salvarea imaginii",
"Save image as...": "Salvează imagine ca ...",
"Copy link address": "Copiază link",
"Copy email address": "Copiază adresă de email",
"Copy image": "Copiază imagine",
"File": "Fișier",
"Bring All to Front": "Aduce-ți totul in față",
"Zoom": "zoom",
"Stop Speaking": "Oprire Voce",
"Start Speaking": "Pornire Voce",
"Speech": "Voce",
"Hide Others": "Ascunde restul",
"Hide": "Ascunde",
"Services": "Servicii",
"About": "Despre",
"Element Help": "Ajutor Element",
"Help": "Ajutor",
"Close": "Inchide",
"Minimize": "Minimizare",
"Window": "Fereastră",
"Toggle Developer Tools": "Comutare unelte dezvoltator",
"Toggle Full Screen": "Comutare pe tot ecranul",
"Preferences": "Preferințe",
"Zoom Out": "Micșorează",
"Zoom In": "Mărește",
"Actual Size": "Mărime reală",
"View": "Vizualizează",
"Select All": "Selectează tot",
"Delete": "Șterge",
"Paste and Match Style": "Lipește si potrivește stilul",
"Paste": "Lipește",
"Copy": "Copiere",
"Redo": "Refă",
"Undo": "Anulare",
"Edit": "Editare",
"Quit": "Închide",
"Show/Hide": "Arată/Ascunde",
"Are you sure you want to quit?": "Sunte-ți sigur ca doriți sa inchideți aplicația ?",
"Close Element": "închide aplicația",
"Cancel": "Anulare"
}

31
src/i18n/strings/si.json Normal file
View File

@@ -0,0 +1,31 @@
{
"Show/Hide": "පෙන්වන්න/සඟවන්න",
"Are you sure you want to quit?": "ඔබට ඉවත් වීමට අවශ්‍ය බව විශ්වාස ද?",
"Close Element": "ඉලමෙන්ට් වසන්න",
"Cancel": "අවලංගු කරන්න",
"Add to dictionary": "ශබ්ද කෝෂයට එකතු කරන්න",
"Copy link address": "සබැඳියේ ලිපිනය පිටපත් කරන්න",
"Copy email address": "වි-තැපෑල පිටපත් කරන්න",
"File": "ගොනුව",
"Zoom": "විශාල කරන්න",
"Hide Others": "වෙනත් දෑ සඟවන්න",
"Hide": "සඟවන්න",
"Services": "සේවා",
"About": "පිළිබඳව",
"Element Help": "ඉලමෙන්ට් උපකාර",
"Help": "උපකාර",
"Close": "වසන්න",
"Minimize": "හකුලන්න",
"Window": "කවුළුව",
"Zoom Out": "කුඩාලනය කරන්න",
"Zoom In": "විශාලනය කරන්න",
"Actual Size": "සැබෑ ප්‍රමාණය",
"Select All": "සියල්ල තෝරන්න",
"Paste": "අලවන්න",
"Copy": "පිටපත්",
"Cut": "කපන්න",
"Redo": "පසුසේ",
"Undo": "පෙරසේ",
"Edit": "සංස්කරණය",
"Quit": "ඉවත් වන්න"
}

46
src/i18n/strings/sk.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Unhide": "Odkryť",
"Stop Speaking": "Zastaviť nahrávanie hlasu",
"Start Speaking": "Spustiť nahrávanie hlasu",
"Speech": "Reč",
"Element Help": "Pomocník pre aplikáciu Element",
"Paste and Match Style": "Vložiť a prispôsobiť štýl",
"Close Element": "Zavrieť aplikáciu Element",
"Add to dictionary": "Pridať do slovníka",
"The image failed to save": "Obrázok sa nepodarilo uložiť",
"Failed to save image": "Chyba pri ukladaní obrázka",
"Save image as...": "Uložiť obrázok ako...",
"Copy link address": "Kopírovať adresu odkazu",
"Copy email address": "Kopírovať e-mailovú adresu",
"Copy image": "Kopírovať obrázok",
"File": "Súbor",
"Bring All to Front": "Preniesť všetky do popredia",
"Zoom": "Lupa",
"Hide Others": "Skryť ostatné",
"Hide": "Skryť",
"Services": "Služby",
"About": "O aplikácii",
"Help": "Pomocník",
"Close": "Zavrieť",
"Minimize": "Minimalizovať",
"Window": "Okno",
"Toggle Developer Tools": "Nástroje pre vývojárov",
"Toggle Full Screen": "Celá obrazovka",
"Preferences": "Vlastnosti",
"Zoom Out": "Oddialiť",
"Zoom In": "Priblížiť",
"Actual Size": "Aktuálna veľkosť",
"View": "Zobraziť",
"Select All": "Vybrať všetko",
"Delete": "Odstrániť",
"Paste": "Vložiť",
"Copy": "Kopírovať",
"Cut": "Vystrihnúť",
"Redo": "Opakovať",
"Undo": "Späť",
"Edit": "Úpravy",
"Quit": "Ukončiť",
"Show/Hide": "Zobraziť/Skryť",
"Are you sure you want to quit?": "Naozaj chcete zavrieť aplikáciu?",
"Cancel": "Zrušiť"
}

46
src/i18n/strings/ta.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Zoom": "பெரிதாக்குதல்",
"Minimize": "சிறிதாக்கு",
"Toggle Developer Tools": "படைப்பாளர் கருவிகளை நிலைமாற்று",
"Toggle Full Screen": "முழு திரையை நிலைமாற்று",
"Paste and Match Style": "ஒட்டு மற்றும் நடையை பொறுத்து",
"Add to dictionary": "அகராதியில் சேர்",
"The image failed to save": "படம் சேமிக்கத் தவறிவிட்டது",
"Failed to save image": "படத்தைச் சேமிப்பதில் தோல்வி",
"Save image as...": "படத்தை இவ்வாறு சேமி...",
"Copy link address": "இணைப்பு முகவரியை நகலெடு",
"Copy email address": "மின்னஞ்சல் முகவரியை நகலெடு",
"Copy image": "படத்தை நகலெடு",
"File": "கோப்பு",
"Bring All to Front": "அனைத்தையும் முன்னால் கொண்டுவா",
"Stop Speaking": "பேசுவதை நிறுத்து",
"Start Speaking": "பேசத் துவங்கு",
"Speech": "பேச்சு",
"Unhide": "காட்டு",
"Hide Others": "மற்றதை மறை",
"Hide": "மறை",
"Services": "சேவைகள்",
"About": "இதனைப் பற்றி",
"Element Help": "எலிமெண்ட் உதவி",
"Help": "உதவி",
"Close": "மூடு",
"Window": "சாளரம்",
"Preferences": "விருப்பத்தேர்வுகள்",
"Zoom Out": "சிறிதாக்கு",
"Zoom In": "பெரிதாக்கு",
"Actual Size": "உண்மையான அளவு",
"View": "காட்சி",
"Select All": "அனைத்தையும் தெரிவுசெய்",
"Delete": "அழி",
"Paste": "ஒட்டு",
"Copy": "நகலெடு",
"Cut": "வெட்டு",
"Redo": "மீண்டும் செய்",
"Undo": "செயல்தவிர்",
"Edit": "திருத்து",
"Quit": "வெளியேறு",
"Show/Hide": "காட்டு/மறை",
"Are you sure you want to quit?": "நீங்கள் நிச்சயம் வெளியேற விரும்புகிறீர்களா?",
"Close Element": "எலிமெண்ட் ஐ மூடு",
"Cancel": "ரத்துசெய்"
}

46
src/i18n/strings/tr.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Add to dictionary": "Sözlüğe ekle",
"The image failed to save": "Bu resim kaydedilemedi",
"Failed to save image": "Resim kaydedilemedi",
"Save image as...": "Resmi ... olarak farklı kaydet",
"Copy link address": "Bağlantılı adresi kopyala",
"Copy email address": "E-posta adresini kopyala",
"Copy image": "Resmi kopyala",
"File": "Dosya",
"Bring All to Front": "Hepsini öne getir",
"Zoom": "Yaklaştır",
"Stop Speaking": "Konuşmayı durdur",
"Start Speaking": "Konuşmaya başla",
"Speech": "Konuşma",
"Unhide": "Gizlemeyi bırak",
"Hide Others": "Diğerlerini gizle",
"Hide": "Gizle",
"Services": "Hizmetler",
"About": "Hakkında",
"Element Help": "Element yardımı",
"Help": "Yardım",
"Close": "Kapat",
"Minimize": "Küçült",
"Window": "Pencere",
"Toggle Developer Tools": "Geliştirici araçları",
"Toggle Full Screen": "Tam ekran",
"Preferences": "Tercihler",
"Zoom Out": "Uzaklaştır",
"Zoom In": "Yaklaştır",
"Actual Size": "Gerçek boyut",
"View": "Görünüm",
"Select All": "Tümünü seç",
"Delete": "Sil",
"Paste and Match Style": "Biçimiyle bir yapıştır",
"Paste": "Yapıştır",
"Copy": "Kopyala",
"Cut": "Kes",
"Redo": "Yinele",
"Undo": "Geri al",
"Edit": "Düzenle",
"Quit": ık",
"Show/Hide": "Göster/Gizle",
"Are you sure you want to quit?": ıkmak istediğinize emin misiniz?",
"Close Element": "Element'i kapat",
"Cancel": "İptal"
}

46
src/i18n/strings/vi.json Normal file
View File

@@ -0,0 +1,46 @@
{
"Add to dictionary": "Thêm vào từ điển",
"The image failed to save": "Ảnh không lưu được",
"Failed to save image": "Lưu ảnh thất bại",
"Save image as...": "Lưu ảnh…",
"Copy link address": "Sao chép địa chỉ liên kết",
"Copy email address": "Sao chép địa chỉ email",
"Copy image": "Sao chép ảnh",
"File": "Tệp",
"Bring All to Front": "Đưa tất cả lên trước",
"Zoom": "Thu phóng",
"Stop Speaking": "Dừng nói",
"Start Speaking": "Bắt đầu nói",
"Speech": "Đọc màn hình",
"Unhide": "Bỏ ẩn",
"Hide Others": "Ẩn cái khác",
"Hide": "Ẩn",
"Services": "Dịch vụ",
"About": "Giới thiệu",
"Element Help": "Trợ giúp Element",
"Help": "Hỗ trợ",
"Close": "Đóng",
"Minimize": "Thu nhỏ",
"Window": "Cửa sổ",
"Toggle Developer Tools": "Công cụ cho Nhà phát triển",
"Toggle Full Screen": "Toàn màn hình",
"Preferences": "Tùy chọn",
"Zoom Out": "Thu nhỏ",
"Zoom In": "Phóng to",
"Actual Size": "Kích thước thực",
"View": "Xem",
"Select All": "Chọn tất cả",
"Delete": "Xóa",
"Paste and Match Style": "Dán và khớp kiểu",
"Paste": "Dán",
"Copy": "Sao chép",
"Cut": "Cắt",
"Redo": "Làm lại",
"Undo": "Hoàn tác",
"Edit": "Chỉnh sửa",
"Quit": "Thoát",
"Show/Hide": "Hiển thị/Ẩn",
"Are you sure you want to quit?": "Bạn có chắc chắn muốn thoát?",
"Close Element": "Đóng Element",
"Cancel": "Hủy bỏ"
}

View File

@@ -0,0 +1,46 @@
{
"Bring All to Front": "全部移至最前",
"Add to dictionary": "加入至字典",
"The image failed to save": "儲存圖片失敗",
"Failed to save image": "儲存圖片失敗",
"Save image as...": "另存圖片為...",
"Copy link address": "複製連結",
"Copy email address": "複製電子郵件地址",
"Copy image": "複製圖片",
"File": "檔案",
"Zoom": "縮放",
"Stop Speaking": "停止說話",
"Start Speaking": "開始說話",
"Speech": "語音",
"Unhide": "取消隱藏",
"Hide Others": "隱藏其他",
"Hide": "隱藏",
"Services": "服務",
"About": "關於",
"Element Help": "Element 協助",
"Help": "協助",
"Close": "關閉",
"Minimize": "最小化",
"Window": "視窗",
"Toggle Developer Tools": "切換開發工具",
"Toggle Full Screen": "切換全螢幕",
"Preferences": "偏好設定",
"Zoom Out": "縮小",
"Zoom In": "放大",
"Actual Size": "實際大小",
"View": "檢視",
"Select All": "全選",
"Delete": "刪除",
"Paste and Match Style": "貼上並保留格式",
"Paste": "貼上",
"Copy": "複製",
"Cut": "剪下",
"Redo": "取消復原",
"Undo": "復原",
"Edit": "編輯",
"Quit": "退出",
"Show/Hide": "顯示/隱藏",
"Are you sure you want to quit?": "您確定要退出嗎?",
"Close Element": "關閉 Element",
"Cancel": "取消"
}

View File

@@ -14,15 +14,24 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const counterpart = require('counterpart');
import counterpart from "counterpart";
import type Store from 'electron-store';
const DEFAULT_LOCALE = "en";
function _td(text) {
export function _td(text: string): string {
return text;
}
function _t(text, variables = {}) {
type SubstitutionValue = number | string;
interface IVariables {
[key: string]: SubstitutionValue;
count?: number;
}
export function _t(text: string, variables: IVariables = {}): string {
const args = Object.assign({ interpolate: false }, variables);
const { count } = args;
@@ -55,11 +64,17 @@ function _t(text, variables = {}) {
return translated;
}
class AppLocalization {
constructor({ store, components = [] }) {
// TODO: Should be static field, but that doesn't parse without Babel
this.STORE_KEY = "locale";
type Component = () => void;
type TypedStore = Store<{ locale?: string | string[] }>;
export class AppLocalization {
private static readonly STORE_KEY = "locale";
private readonly store: TypedStore;
private readonly localizedComponents: Set<Component>;
constructor({ store, components = [] }: { store: TypedStore, components: Component[] }) {
counterpart.registerTranslations("en", this.fetchTranslationJson("en_EN"));
counterpart.setFallbackLocale('en');
counterpart.setSeparator('|');
@@ -69,15 +84,15 @@ class AppLocalization {
}
this.store = store;
if (this.store.has(this.STORE_KEY)) {
const locales = this.store.get(this.STORE_KEY);
if (this.store.has(AppLocalization.STORE_KEY)) {
const locales = this.store.get(AppLocalization.STORE_KEY);
this.setAppLocale(locales);
}
this.resetLocalizedUI();
}
fetchTranslationJson(locale) {
public fetchTranslationJson(locale: string): Record<string, string> {
try {
console.log("Fetching translation json for locale: " + locale);
return require(`./i18n/strings/${locale}.json`);
@@ -87,11 +102,7 @@ class AppLocalization {
}
}
get languageTranslationJson() {
return this.translationJsonMap.get(this.language);
}
setAppLocale(locales) {
public setAppLocale(locales: string | string[]): void {
console.log(`Changing application language to ${locales}`);
if (!Array.isArray(locales)) {
@@ -105,13 +116,15 @@ class AppLocalization {
}
});
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - this looks like a bug but is out of scope for this conversion
counterpart.setLocale(locales);
this.store.set(this.STORE_KEY, locales);
this.store.set(AppLocalization.STORE_KEY, locales);
this.resetLocalizedUI();
}
resetLocalizedUI() {
public resetLocalizedUI(): void {
console.log("Resetting the UI components after locale change");
this.localizedComponents.forEach(componentSetup => {
if (typeof componentSetup === "function") {
@@ -120,9 +133,3 @@ class AppLocalization {
});
}
}
module.exports = {
AppLocalization,
_t,
_td,
};

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const { ipcRenderer, desktopCapturer, contextBridge } = require('electron');
import { ipcRenderer, contextBridge, IpcRendererEvent } from 'electron';
// Expose only expected IPC wrapper APIs to the renderer process to avoid
// handing out generalised messaging access.
@@ -33,39 +33,25 @@ const CHANNELS = [
"setBadgeCount",
"update-downloaded",
"userDownloadCompleted",
"userDownloadOpen",
"userDownloadAction",
];
contextBridge.exposeInMainWorld(
"electron",
{
on(channel, listener) {
on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): void {
if (!CHANNELS.includes(channel)) {
console.error(`Unknown IPC channel ${channel} ignored`);
return;
}
ipcRenderer.on(channel, listener);
},
send(channel, ...args) {
send(channel: string, ...args: any[]): void {
if (!CHANNELS.includes(channel)) {
console.error(`Unknown IPC channel ${channel} ignored`);
return;
}
ipcRenderer.send(channel, ...args);
},
async getDesktopCapturerSources(options) {
const sources = await desktopCapturer.getSources(options);
const desktopCapturerSources = [];
for (const source of sources) {
desktopCapturerSources.push({
id: source.id,
name: source.name,
thumbnailURL: source.thumbnail.toDataURL(),
});
}
return desktopCapturerSources;
},
},
);

View File

@@ -1,102 +0,0 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
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.
*/
const { app } = require("electron");
const path = require("path");
const fs = require("fs");
const PROTOCOL = "element://";
const SEARCH_PARAM = "element-desktop-ssoid";
const STORE_FILE_NAME = "sso-sessions.json";
// we getPath userData before electron-main changes it, so this is the default value
const storePath = path.join(app.getPath("userData"), STORE_FILE_NAME);
const processUrl = (url) => {
if (!global.mainWindow) return;
console.log("Handling link: ", url);
global.mainWindow.loadURL(url.replace(PROTOCOL, "vector://"));
};
const readStore = () => {
try {
const s = fs.readFileSync(storePath, { encoding: "utf8" });
const o = JSON.parse(s);
return typeof o === "object" ? o : {};
} catch (e) {
return {};
}
};
const writeStore = (data) => {
fs.writeFileSync(storePath, JSON.stringify(data));
};
module.exports = {
recordSSOSession: (sessionID) => {
const userDataPath = app.getPath('userData');
const store = readStore();
for (const key in store) {
// ensure each instance only has one (the latest) session ID to prevent the file growing unbounded
if (store[key] === userDataPath) {
delete store[key];
break;
}
}
store[sessionID] = userDataPath;
writeStore(store);
},
getProfileFromDeeplink: (args) => {
// check if we are passed a profile in the SSO callback url
const deeplinkUrl = args.find(arg => arg.startsWith('element://'));
if (deeplinkUrl && deeplinkUrl.includes(SEARCH_PARAM)) {
const parsedUrl = new URL(deeplinkUrl);
if (parsedUrl.protocol === 'element:') {
const ssoID = parsedUrl.searchParams.get(SEARCH_PARAM);
const store = readStore();
console.log("Forwarding to profile: ", store[ssoID]);
return store[ssoID];
}
}
},
protocolInit: () => {
// get all args except `hidden` as it'd mean the app would not get focused
// XXX: passing args to protocol handlers only works on Windows, so unpackaged deep-linking
// --profile/--profile-dir are passed via the SEARCH_PARAM var in the callback url
const args = process.argv.slice(1).filter(arg => arg !== "--hidden" && arg !== "-hidden");
if (app.isPackaged) {
app.setAsDefaultProtocolClient('element', process.execPath, args);
} else if (process.platform === 'win32') { // on Mac/Linux this would just cause the electron binary to open
// special handler for running without being packaged, e.g `electron .` by passing our app path to electron
app.setAsDefaultProtocolClient('element', process.execPath, [app.getAppPath(), ...args]);
}
if (process.platform === 'darwin') {
// Protocol handler for macos
app.on('open-url', function(ev, url) {
ev.preventDefault();
processUrl(url);
});
} else {
// Protocol handler for win32/Linux
app.on('second-instance', (ev, commandLine) => {
const url = commandLine[commandLine.length - 1];
if (!url.startsWith(PROTOCOL)) return;
processUrl(url);
});
}
},
};

123
src/protocol.ts Normal file
View File

@@ -0,0 +1,123 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
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 { app } from "electron";
import { URL } from "url";
import path from "path";
import fs from "fs";
const PROTOCOL = "element:";
const SEARCH_PARAM = "element-desktop-ssoid";
const STORE_FILE_NAME = "sso-sessions.json";
// we getPath userData before electron-main changes it, so this is the default value
const storePath = path.join(app.getPath("userData"), STORE_FILE_NAME);
function processUrl(url: string): void {
if (!global.mainWindow) return;
const parsed = new URL(url);
// sanity check: we only register for the one protocol, so we shouldn't
// be getting anything else unless the user is forcing a URL to open
// with the Element app.
if (parsed.protocol !== PROTOCOL) {
console.log("Ignoring unexpected protocol: ", parsed.protocol);
return;
}
const urlToLoad = new URL("vector://vector/webapp/");
// ignore anything other than the search (used for SSO login redirect)
// and the hash (for general element deep links)
// There's no reason to allow anything else, particularly other paths,
// since this would allow things like the internal jitsi wrapper to
// be loaded, which would get the app stuck on that page and generally
// be a bit strange and confusing.
urlToLoad.search = parsed.search;
urlToLoad.hash = parsed.hash;
console.log("Opening URL: ", urlToLoad.href);
global.mainWindow.loadURL(urlToLoad.href);
}
function readStore(): object {
try {
const s = fs.readFileSync(storePath, { encoding: "utf8" });
const o = JSON.parse(s);
return typeof o === "object" ? o : {};
} catch (e) {
return {};
}
}
function writeStore(data: object): void {
fs.writeFileSync(storePath, JSON.stringify(data));
}
export function recordSSOSession(sessionID: string): void {
const userDataPath = app.getPath('userData');
const store = readStore();
for (const key in store) {
// ensure each instance only has one (the latest) session ID to prevent the file growing unbounded
if (store[key] === userDataPath) {
delete store[key];
break;
}
}
store[sessionID] = userDataPath;
writeStore(store);
}
export function getProfileFromDeeplink(args): string | undefined {
// check if we are passed a profile in the SSO callback url
const deeplinkUrl = args.find(arg => arg.startsWith(PROTOCOL + '//'));
if (deeplinkUrl && deeplinkUrl.includes(SEARCH_PARAM)) {
const parsedUrl = new URL(deeplinkUrl);
if (parsedUrl.protocol === PROTOCOL) {
const ssoID = parsedUrl.searchParams.get(SEARCH_PARAM);
const store = readStore();
console.log("Forwarding to profile: ", store[ssoID]);
return store[ssoID];
}
}
}
export function protocolInit(): void {
// get all args except `hidden` as it'd mean the app would not get focused
// XXX: passing args to protocol handlers only works on Windows, so unpackaged deep-linking
// --profile/--profile-dir are passed via the SEARCH_PARAM var in the callback url
const args = process.argv.slice(1).filter(arg => arg !== "--hidden" && arg !== "-hidden");
if (app.isPackaged) {
app.setAsDefaultProtocolClient('element', process.execPath, args);
} else if (process.platform === 'win32') { // on Mac/Linux this would just cause the electron binary to open
// special handler for running without being packaged, e.g `electron .` by passing our app path to electron
app.setAsDefaultProtocolClient('element', process.execPath, [app.getAppPath(), ...args]);
}
if (process.platform === 'darwin') {
// Protocol handler for macos
app.on('open-url', function(ev, url) {
ev.preventDefault();
processUrl(url);
});
} else {
// Protocol handler for win32/Linux
app.on('second-instance', (ev, commandLine) => {
const url = commandLine[commandLine.length - 1];
if (!url.startsWith(PROTOCOL + '//')) return;
processUrl(url);
});
}
}

View File

@@ -14,12 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const path = require('path');
const spawn = require('child_process').spawn;
const { app } = require('electron');
const fsProm = require('fs').promises;
import path from "path";
import { spawn } from "child_process";
import { app } from "electron";
import { promises as fsProm } from "fs";
function runUpdateExe(args) {
function runUpdateExe(args: string[]): Promise<void> {
// Invokes Squirrel's Update.exe which will do things for us like create shortcuts
// Note that there's an Update.exe in the app-x.x.x directory and one in the parent
// directory: we need to run the one in the parent directory, because it discovers
@@ -28,20 +28,18 @@ function runUpdateExe(args) {
console.log(`Spawning '${updateExe}' with args '${args}'`);
return new Promise(resolve => {
spawn(updateExe, args, {
detached: true,
detached: true,
}).on('close', resolve);
});
}
function checkSquirrelHooks() {
function checkSquirrelHooks(): boolean {
if (process.platform !== 'win32') return false;
const cmd = process.argv[1];
const target = path.basename(process.execPath);
if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') {
Promise.resolve().then(() => {
return runUpdateExe(['--createShortcut=' + target]);
}).then(() => {
runUpdateExe(['--createShortcut=' + target]).then(() => {
// remove the old 'Riot' shortcuts, if they exist (update.exe --removeShortcut doesn't work
// because it always uses the name of the product as the name of the shortcut: the only variable
// is what executable you're linking to)
@@ -83,4 +81,6 @@ function checkSquirrelHooks() {
return false;
}
module.exports = checkSquirrelHooks;
if (checkSquirrelHooks()) {
process.exit(1);
}

View File

@@ -15,36 +15,42 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const { app, Tray, Menu, nativeImage } = require('electron');
const pngToIco = require('png-to-ico');
const path = require('path');
const fs = require('fs');
const { _t } = require('./language-helper');
import { app, Tray, Menu, nativeImage } from "electron";
import pngToIco from "png-to-ico";
import path from "path";
import fs from "fs";
let trayIcon = null;
import { _t } from "./language-helper";
exports.hasTray = function hasTray() {
let trayIcon: Tray = null;
export function hasTray(): boolean {
return (trayIcon !== null);
};
}
exports.destroy = function() {
export function destroy(): void {
if (trayIcon) {
trayIcon.destroy();
trayIcon = null;
}
};
}
const toggleWin = function() {
if (global.mainWindow.isVisible() && !global.mainWindow.isMinimized()) {
function toggleWin(): void {
if (global.mainWindow.isVisible() && !global.mainWindow.isMinimized() && global.mainWindow.isFocused()) {
global.mainWindow.hide();
} else {
if (global.mainWindow.isMinimized()) global.mainWindow.restore();
if (!global.mainWindow.isVisible()) global.mainWindow.show();
global.mainWindow.focus();
}
};
}
exports.create = function(config) {
interface IConfig {
icon_path: string; // eslint-disable-line camelcase
brand: string;
}
export function create(config: IConfig): void {
// no trays on darwin
if (process.platform === 'darwin' || trayIcon) return;
const defaultIcon = nativeImage.createFromPath(config.icon_path);
@@ -89,9 +95,9 @@ exports.create = function(config) {
global.mainWindow.webContents.on('page-title-updated', function(ev, title) {
trayIcon.setToolTip(title);
});
};
}
function initApplicationMenu() {
export function initApplicationMenu(): void {
if (!trayIcon) {
return;
}
@@ -112,5 +118,3 @@ function initApplicationMenu() {
trayIcon.setContextMenu(contextMenu);
}
exports.initApplicationMenu = initApplicationMenu;

View File

@@ -1,16 +1,32 @@
const { app, autoUpdater, ipcMain } = require('electron');
/*
Copyright 2016-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 { app, autoUpdater, ipcMain } from "electron";
const UPDATE_POLL_INTERVAL_MS = 60 * 60 * 1000;
const INITIAL_UPDATE_DELAY_MS = 30 * 1000;
function installUpdate() {
function installUpdate(): void {
// for some reason, quitAndInstall does not fire the
// before-quit event, so we need to set the flag here.
global.appQuitting = true;
autoUpdater.quitAndInstall();
}
function pollForUpdates() {
function pollForUpdates(): void {
try {
autoUpdater.checkForUpdates();
} catch (e) {
@@ -18,8 +34,7 @@ function pollForUpdates() {
}
}
module.exports = {};
module.exports.start = function startAutoUpdate(updateBaseUrl) {
export function start(updateBaseUrl: string): void {
if (updateBaseUrl.slice(-1) !== '/') {
updateBaseUrl = updateBaseUrl + '/';
}
@@ -48,6 +63,7 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
}
if (url) {
console.log(`Update URL: ${url}`);
autoUpdater.setFeedURL(url);
// We check for updates ourselves rather than using 'updater' because we need to
// do it in the main process (and we don't really need to check every 10 minutes:
@@ -63,18 +79,25 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
// will fail if running in debug mode
console.log('Couldn\'t enable update checking', err);
}
};
}
ipcMain.on('install_update', installUpdate);
ipcMain.on('check_updates', pollForUpdates);
function ipcChannelSendUpdateStatus(status) {
function ipcChannelSendUpdateStatus(status: boolean | string): void {
if (!global.mainWindow) return;
global.mainWindow.webContents.send('check_updates', status);
}
interface ICachedUpdate {
releaseNotes: string;
releaseName: string;
releaseDate: Date;
updateURL: string;
}
// cache the latest update which has been downloaded as electron offers no api to read it
let latestUpdateDownloaded;
let latestUpdateDownloaded: ICachedUpdate;
autoUpdater.on('update-available', function() {
ipcChannelSendUpdateStatus(true);
}).on('update-not-available', function() {

View File

@@ -14,14 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const { app, shell, Menu } = require('electron');
const { _t } = require('./language-helper');
import { app, shell, Menu, MenuItem, MenuItemConstructorOptions } from 'electron';
import { _t } from './language-helper';
const isMac = process.platform === 'darwin';
function buildMenuTemplate() {
export function buildMenuTemplate(): Menu {
// Menu template from http://electron.atom.io/docs/api/menu/, edited
const template = [
const template: Array<(MenuItemConstructorOptions) | (MenuItem)> = [
{
label: _t('Edit'),
accelerator: 'e',
@@ -48,7 +49,7 @@ function buildMenuTemplate() {
label: _t('Paste'),
},
{
role: 'pasteandmatchstyle',
role: 'pasteAndMatchStyle',
label: _t('Paste and Match Style'),
},
{
@@ -56,7 +57,7 @@ function buildMenuTemplate() {
label: _t('Delete'),
},
{
role: 'selectall',
role: 'selectAll',
label: _t('Select All'),
},
],
@@ -67,15 +68,30 @@ function buildMenuTemplate() {
submenu: [
{ type: 'separator' },
{
role: 'resetzoom',
role: 'resetZoom',
accelerator: 'CmdOrCtrl+Num0',
visible: false,
},
{
role: 'zoomIn',
accelerator: 'CmdOrCtrl+NumAdd',
visible: false,
},
{
role: 'zoomOut',
accelerator: 'CmdOrCtrl+NumSub',
visible: false,
},
{
role: 'resetZoom',
label: _t('Actual Size'),
},
{
role: 'zoomin',
role: 'zoomIn',
label: _t('Zoom In'),
},
{
role: 'zoomout',
role: 'zoomOut',
label: _t('Zoom Out'),
},
{ type: 'separator' },
@@ -89,7 +105,7 @@ function buildMenuTemplate() {
label: _t('Toggle Full Screen'),
},
{
role: 'toggledevtools',
role: 'toggleDevTools',
label: _t('Toggle Developer Tools'),
},
],
@@ -151,7 +167,7 @@ function buildMenuTemplate() {
label: _t('Hide'),
},
{
role: 'hideothers',
role: 'hideOthers',
label: _t('Hide Others'),
},
{
@@ -167,17 +183,17 @@ function buildMenuTemplate() {
});
// Edit menu.
// This has a 'speech' section on macOS
template[1].submenu.push(
(template[1].submenu as MenuItemConstructorOptions[]).push(
{ type: 'separator' },
{
label: _t('Speech'),
submenu: [
{
role: 'startspeaking',
role: 'startSpeaking',
label: _t('Start Speaking'),
},
{
role: 'stopspeaking',
role: 'stopSpeaking',
label: _t('Stop Speaking'),
},
],
@@ -228,6 +244,3 @@ function buildMenuTemplate() {
return Menu.buildFromTemplate(template);
}
module.exports = buildMenuTemplate;

View File

@@ -1,19 +1,50 @@
const { clipboard, nativeImage, Menu, MenuItem, shell, dialog, ipcMain } = require('electron');
const url = require('url');
const fs = require('fs');
const request = require('request');
const path = require('path');
const { _t } = require('./language-helper');
/*
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 {
clipboard,
nativeImage,
Menu,
MenuItem,
shell,
dialog,
ipcMain,
NativeImage,
WebContents,
ContextMenuParams,
DownloadItem,
MenuItemConstructorOptions,
IpcMainEvent,
} from 'electron';
import url from 'url';
import fs from 'fs';
import request from 'request';
import path from 'path';
import { _t } from './language-helper';
const MAILTO_PREFIX = "mailto:";
const PERMITTED_URL_SCHEMES = [
const PERMITTED_URL_SCHEMES: string[] = [
'http:',
'https:',
MAILTO_PREFIX,
];
function safeOpenURL(target) {
function safeOpenURL(target: string): void {
// openExternal passes the target to open/start/xdg-open,
// so put fairly stringent limits on what can be opened
// (for instance, open /bin/sh does indeed open a terminal
@@ -28,7 +59,7 @@ function safeOpenURL(target) {
}
}
function onWindowOrNavigate(ev, target) {
function onWindowOrNavigate(ev: Event, target: string): void {
// always prevent the default: if something goes wrong,
// we don't want to end up opening it in the electron
// app, as we could end up opening any sort of random
@@ -37,7 +68,7 @@ function onWindowOrNavigate(ev, target) {
safeOpenURL(target);
}
function writeNativeImage(filePath, img) {
function writeNativeImage(filePath: string, img: NativeImage): Promise<void> {
switch (filePath.split('.').pop().toLowerCase()) {
case "jpg":
case "jpeg":
@@ -50,7 +81,7 @@ function writeNativeImage(filePath, img) {
}
}
function onLinkContextMenu(ev, params) {
function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: WebContents): void {
let url = params.linkURL || params.srcURL;
if (url.startsWith('vector://vector/webapp')) {
@@ -76,7 +107,7 @@ function onLinkContextMenu(ev, params) {
label: _t('Copy image'),
accelerator: 'c',
click() {
ev.sender.copyImageAt(params.x, params.y);
webContents.copyImageAt(params.x, params.y);
},
}));
}
@@ -108,7 +139,7 @@ function onLinkContextMenu(ev, params) {
if (params.hasImageContents && !url.startsWith('blob:')) {
popupMenu.append(new MenuItem({
label: _t('Save image as...'),
accelerator: 'a',
accelerator: 's',
async click() {
const targetFileName = params.titleText || "image.png";
const { filePath } = await dialog.showSaveDialog({
@@ -140,8 +171,8 @@ function onLinkContextMenu(ev, params) {
ev.preventDefault();
}
function _CutCopyPasteSelectContextMenus(params) {
const options = [];
function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemConstructorOptions[] {
const options: MenuItemConstructorOptions[] = [];
if (params.misspelledWord) {
params.dictionarySuggestions.forEach(word => {
@@ -180,10 +211,10 @@ function _CutCopyPasteSelectContextMenus(params) {
accelerator: 'p',
enabled: params.editFlags.canPaste,
}, {
role: 'pasteandmatchstyle',
role: 'pasteAndMatchStyle',
enabled: params.editFlags.canPaste,
}, {
role: 'selectall',
role: 'selectAll',
label: _t("Select All"),
accelerator: 'a',
enabled: params.editFlags.canSelectAll,
@@ -192,7 +223,7 @@ function _CutCopyPasteSelectContextMenus(params) {
}
function onSelectedContextMenu(ev, params) {
const items = _CutCopyPasteSelectContextMenus(params);
const items = cutCopyPasteSelectContextMenus(params);
const popupMenu = Menu.buildFromTemplate(items);
// popup() requires an options object even for no options
@@ -200,12 +231,13 @@ function onSelectedContextMenu(ev, params) {
ev.preventDefault();
}
function onEditableContextMenu(ev, params) {
const items = [
function onEditableContextMenu(ev: Event, params: ContextMenuParams) {
const items: MenuItemConstructorOptions[] = [
{ role: 'undo' },
{ role: 'redo', enabled: params.editFlags.canRedo },
{ type: 'separator' },
].concat(_CutCopyPasteSelectContextMenus(params));
...cutCopyPasteSelectContextMenus(params),
];
const popupMenu = Menu.buildFromTemplate(items);
@@ -214,20 +246,25 @@ function onEditableContextMenu(ev, params) {
ev.preventDefault();
}
ipcMain.on('userDownloadOpen', function(ev, { path }) {
shell.openPath(path);
let userDownloadIndex = 0;
const userDownloadMap = new Map<number, string>(); // Map from id to path
ipcMain.on('userDownloadAction', function(ev: IpcMainEvent, { id, open = false }) {
if (open) {
shell.openPath(userDownloadMap.get(id));
}
userDownloadMap.delete(id);
});
module.exports = (webContents) => {
export default (webContents: WebContents): void => {
webContents.on('new-window', onWindowOrNavigate);
webContents.on('will-navigate', (ev, target) => {
webContents.on('will-navigate', (ev: Event, target: string): void => {
if (target.startsWith("vector://")) return;
return onWindowOrNavigate(ev, target);
});
webContents.on('context-menu', function(ev, params) {
webContents.on('context-menu', function(ev: Event, params: ContextMenuParams): void {
if (params.linkURL || params.srcURL) {
onLinkContextMenu(ev, params);
onLinkContextMenu(ev, params, webContents);
} else if (params.selectionText) {
onSelectedContextMenu(ev, params);
} else if (params.isEditable) {
@@ -235,12 +272,14 @@ module.exports = (webContents) => {
}
});
webContents.session.on('will-download', (event, item) => {
webContents.session.on('will-download', (event: Event, item: DownloadItem): void => {
item.once('done', (event, state) => {
if (state === 'completed') {
const savePath = item.getSavePath();
const id = userDownloadIndex++;
userDownloadMap.set(id, savePath);
webContents.send('userDownloadCompleted', {
path: savePath,
id,
name: path.basename(savePath),
});
}

21
tsconfig.json Normal file
View File

@@ -0,0 +1,21 @@
{
"compilerOptions": {
"resolveJsonModule": true,
"esModuleInterop": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "es2016",
"noImplicitAny": false,
"sourceMap": false,
"outDir": "./lib",
"rootDir": "./src",
"declaration": true,
"lib": [
"es2019",
"dom"
]
},
"include": [
"./src/**/*.ts"
]
}

4994
yarn.lock
View File

File diff suppressed because it is too large Load Diff