partey_workadventure/desktop
dependabot[bot] 8523781e9f
Bump ejs from 3.1.6 to 3.1.7 in /desktop/electron (#2145)
Bumps [ejs](https://github.com/mde/ejs) from 3.1.6 to 3.1.7.
- [Release notes](https://github.com/mde/ejs/releases)
- [Changelog](https://github.com/mde/ejs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mde/ejs/compare/v3.1.6...v3.1.7)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-08 16:55:13 +02:00
..
electron Bump ejs from 3.1.6 to 3.1.7 in /desktop/electron (#2145) 2022-05-08 16:55:13 +02:00
local-app Zod EVERYWHERE (#2027) 2022-04-12 14:21:19 +02:00
LICENSE.txt add desktop app 2022-02-17 18:09:57 +01:00
README.md improve types 2022-02-22 12:02:56 +01:00

Desktop app

The desktop component is an electron app inside ./electron/. It uses a hybrid setup based of two main components:

  • A local-app bundled into the electron app with two main parts:
    • A sidebar to show the server list, with the currently selected server
    • A main page which is used to manage servers and to show other "local" pages like the desktop-app settings
  • A BrowserView (often called appView or app) showing the actual frontend of an external WorkAdventure deployment. If a server is selected the BrowserView / appView is overlaying the whole main part right to the sidebar.

Development

# start local-app in watch mode
cd local-app && yarn dev

# start electron app in watch mode
cd electron && LOCAL_APP_URL=http://localhost:3000 yarn dev

# or create an executable by running:
cd electron && yarn bundle

API for front

TODO:

if (window?.WorkAdventureDesktopApi?.desktop) {
  alert('Yeah you are using the desktop app ;)');
}

let muted = false;

window?.WorkAdventureDesktopApi?.onMutedKeyPress((event) => {
  if (muted) {
    document.getElementById("info-box").innerHTML =
      "Ready to speak! Press ctrl-alt-m to mute.";
  } else {
    document.getElementById("info-box").innerHTML =
      "Muted! Press ctrl-alt-m to unmute again.";
  }
  muted = !muted;
});

window.WorkAdventureDesktopApi.notify("Hello from front");