Commit Graph

2663 Commits

Author SHA1 Message Date
Kamil Jarosz 5441749e3e web: Use browser focus events for focus management
This patch changes how the player focus is managed.

Before this patch, `instance.has_focus` was unrelated
to the current focus managed by the browser.
When the user clicked anywhere on the window, it was set to `false`,
and when the user clicked on the player, it was set to `true`.
This had two major issues.
1. When the user clicked on the player, `has_focus` was set to `false`,
   and then again to `true`. That was problematic when listening
   to focus change events.
2. Not using browser's focus makes it harder to integrate with Ruffle,
   i.e. tab out of Ruffle.

This patch uses browser's focus management to detect focus
and listen to focus events:
1. on `focusin` – FocusGained event is fired,
2. on `focusout` – FocusLost event is fired, and
3. on `pointerdown` – focus is manually set to the canvas.
The canvas has `tabindex` set to -1 in order to be focusable.
2024-07-12 14:20:35 +02:00
TÖRÖK Attila a66ba15051 ci: Get wasm-opt directly from GitHub using sigoden/install-binary@v1
... instead of from conda-forge using miniconda.

And using wget+tar in the extension builder Dockerfile.
2024-07-12 13:40:12 +02:00
riku-42 e93cf15b7c web/extension: Use source-map as webpack devtool for debug builds 2024-07-12 13:22:16 +02:00
Aaron Hill c852990346 swf: Remove 'libflate' feature
The 'flate2' crate already supports both C and pure Rust
backends, so we don't gain anything by supporting libflate
2024-07-12 09:09:49 +02:00
dependabot[bot] 47564b0b4e build(deps-dev): bump eslint-plugin-react-hooks in /web
Bumps [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) from 5.1.0-rc-fb9a90fa48-20240614 to 5.1.0-rc.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/HEAD/packages/eslint-plugin-react-hooks)

---
updated-dependencies:
- dependency-name: eslint-plugin-react-hooks
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 14:51:54 +02:00
dependabot[bot] d4160a70da build(deps-dev): bump typescript-eslint in /web
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.0.0-alpha.39 to 8.0.0-alpha.41.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/HEAD/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 14:44:11 +02:00
Nathan Adams adebb04e3d web: Removed some unneeded eslint configs 2024-07-08 11:34:35 +02:00
Nathan Adams f5dc3c8975 web: Enable tseslint.configs.strict (it caught a bug!) 2024-07-08 11:34:35 +02:00
Nathan Adams 6e74f57318 web: Update to eslint 9 2024-07-08 11:34:35 +02:00
Nathan Adams 53d56573c1 web: Migrate to 'flat config' style for eslint 2024-07-08 11:34:35 +02:00
dependabot[bot] 6a9b8a5e1b build(deps-dev): bump the npm-minor group in /web with 8 updates
Bumps the npm-minor group in /web with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [@wdio/cli](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/wdio-cli) | `8.39.0` | `8.39.1` |
| [@wdio/local-runner](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/wdio-local-runner) | `8.39.0` | `8.39.1` |
| [mocha](https://github.com/mochajs/mocha) | `10.5.2` | `10.6.0` |
| [tsx](https://github.com/privatenumber/tsx) | `4.16.0` | `4.16.2` |
| [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | `48.5.0` | `48.5.2` |
| [replace-in-file](https://github.com/adamreisnz/replace-in-file) | `8.0.2` | `8.1.0` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `5.3.2` | `5.3.3` |
| [webdriverio](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/webdriverio) | `8.39.0` | `8.39.1` |


Updates `@wdio/cli` from 8.39.0 to 8.39.1
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/v8.39.1/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/commits/v8.39.1/packages/wdio-cli)

Updates `@wdio/local-runner` from 8.39.0 to 8.39.1
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/v8.39.1/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/commits/v8.39.1/packages/wdio-local-runner)

Updates `mocha` from 10.5.2 to 10.6.0
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.5.2...v10.6.0)

Updates `tsx` from 4.16.0 to 4.16.2
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.16.0...v4.16.2)

Updates `eslint-plugin-jsdoc` from 48.5.0 to 48.5.2
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.5.0...v48.5.2)

Updates `replace-in-file` from 8.0.2 to 8.1.0
- [Release notes](https://github.com/adamreisnz/replace-in-file/releases)
- [Changelog](https://github.com/adamreisnz/replace-in-file/blob/main/CHANGELOG.md)
- [Commits](https://github.com/adamreisnz/replace-in-file/commits)

Updates `vite` from 5.3.2 to 5.3.3
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.3.3/packages/vite)

Updates `webdriverio` from 8.39.0 to 8.39.1
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/v8.39.1/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/commits/v8.39.1/packages/webdriverio)

---
updated-dependencies:
- dependency-name: "@wdio/cli"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@wdio/local-runner"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: replace-in-file
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: webdriverio
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-07 12:50:16 +02:00
Kamil Jarosz 9f9d462381 core: Add click index to PlayerEvent::MouseDown 2024-07-06 18:32:10 +02:00
Daniel Jacobs a5a9ef9a03 extension: Don't register 4399 content script if Ruffle is disabled 2024-07-06 12:55:37 +02:00
TÖRÖK Attila 5fb04101e1 web: Fix all context menu items appearing disabled 2024-07-05 17:10:54 +02:00
Crowdin Bot 23b7810a07 chore: Update translations from Crowdin 2024-07-04 23:11:43 +02:00
Nathan Adams d0a37b3b61 web: More error cleanup, remove the indirection of errors through an enum 2024-07-04 13:39:06 +02:00
Nathan Adams e67cc08da5 web: Remove ruffleIndexError as a global thing on Error, make our own Error classes 2024-07-04 13:39:06 +02:00
Nathan Adams a8b146df3e web: Move PanicError enum to its own file 2024-07-04 13:39:06 +02:00
Nathan Adams b254b19be2 web: Remove PanicError.JavascriptConfiguration from rust loading - doesn't happen anymore 2024-07-04 13:39:06 +02:00
Nathan Adams 20a8d7be8a web: Move the actual creation of panic error/actions into panic.tsx 2024-07-04 13:39:06 +02:00
Nathan Adams 5ebf876348 web: Move the creation of the github report url to panic.tsx 2024-07-04 13:39:06 +02:00
Nathan Adams f96ca66f82 web: Simplify the actual creation of the panic screen 2024-07-04 13:39:06 +02:00
Nathan Adams 1603dfb016 web: Simplify panic action links a bit, use tsx 2024-07-04 13:39:06 +02:00
Nathan Adams 024d056418 web: Move PanicLinkInfo and createErrorFooter to own file 2024-07-04 13:39:06 +02:00
Nathan Adams ff3d8744f0 web: Use tsx in ruffle-core, convert context menu to use tsx as proof of concept 2024-07-04 13:39:06 +02:00
Nathan Adams 01903f6aee web: Use 'foo as X' instead of '<X>foo' 2024-07-04 13:39:06 +02:00
Crowdin Bot e9ec441ef7 chore: Update translations from Crowdin 2024-07-03 23:13:58 +02:00
Daniel Jacobs 772518d25a extension: Switch to declarativeNetRequestWithHostAccess 2024-07-03 13:35:59 +02:00
Crowdin Bot ac6f78f8a8 chore: Update translations from Crowdin 2024-07-02 23:56:16 +02:00
Crowdin Bot 2093d950e5 chore: Update translations from Crowdin 2024-07-02 01:21:48 +02:00
dependabot[bot] 353fa41a7f build(deps): bump the npm-minor group in /web with 10 updates
Bumps the npm-minor group in /web with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `7.14.1` | `7.15.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `7.14.1` | `7.15.0` |
| [mocha](https://github.com/mochajs/mocha) | `10.5.0` | `10.5.2` |
| [typescript](https://github.com/Microsoft/TypeScript) | `5.5.2` | `5.5.3` |
| [tsx](https://github.com/privatenumber/tsx) | `4.15.7` | `4.16.0` |
| [chromedriver](https://github.com/giggio/node-chromedriver) | `126.0.3` | `126.0.4` |
| [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | `48.4.0` | `48.5.0` |
| [replace-in-file](https://github.com/adamreisnz/replace-in-file) | `8.0.0` | `8.0.1` |
| [typedoc](https://github.com/TypeStrong/TypeDoc) | `0.26.2` | `0.26.3` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `5.3.1` | `5.3.2` |


Updates `@typescript-eslint/eslint-plugin` from 7.14.1 to 7.15.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.15.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 7.14.1 to 7.15.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.15.0/packages/parser)

Updates `mocha` from 10.5.0 to 10.5.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.5.0...v10.5.2)

Updates `typescript` from 5.5.2 to 5.5.3
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.2...v5.5.3)

Updates `tsx` from 4.15.7 to 4.16.0
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.15.7...v4.16.0)

Updates `chromedriver` from 126.0.3 to 126.0.4
- [Commits](https://github.com/giggio/node-chromedriver/compare/126.0.3...126.0.4)

Updates `eslint-plugin-jsdoc` from 48.4.0 to 48.5.0
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.4.0...v48.5.0)

Updates `replace-in-file` from 8.0.0 to 8.0.1
- [Release notes](https://github.com/adamreisnz/replace-in-file/releases)
- [Changelog](https://github.com/adamreisnz/replace-in-file/blob/main/CHANGELOG.md)
- [Commits](https://github.com/adamreisnz/replace-in-file/commits)

Updates `typedoc` from 0.26.2 to 0.26.3
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.26.2...v0.26.3)

Updates `vite` from 5.3.1 to 5.3.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.3.2/packages/vite)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: replace-in-file
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 22:46:01 +02:00
Crowdin Bot 4b849cd52a chore: Update translations from Crowdin 2024-07-01 01:17:52 +02:00
Nathan Adams 07cfa51731 web: Use automatic publicPath in extension 2024-06-30 23:42:23 +02:00
Nathan Adams fd5ca6ae39 web: Specify the correct path of assets for webpack in extension 2024-06-30 21:00:28 +02:00
Wumbo 5addb6e349 web: Fix keyboard input test (hopefully) 2024-06-30 13:23:16 +02:00
Wumbo 579df56ac0 web: Display save manager correctly in quirks mode 2024-06-30 13:23:16 +02:00
Wumbo 24f587a61e web: Improve clipboard modal 2024-06-30 13:23:16 +02:00
Wumbo e315709e1f web: Improve hardware acceleration modal 2024-06-30 13:23:16 +02:00
Wumbo aa26ca1d23 web: Improve video modal 2024-06-30 13:23:16 +02:00
Wumbo f078fc3b39 web: Don't close modal upon right click
There was a general consensus in the Ruffle Discord that this
functionality was awkward and unneeded (on top of already not
working as intended).
2024-06-30 13:23:16 +02:00
Wumbo 64b7f2edb8 web: Use transforms for modals/context menu instead of position
This lets the context menu escape the bounds of the player and keeps
modals in the center of the player at small widths.
2024-06-30 13:23:16 +02:00
Wumbo e79efb9bd9 web: Enforce nowrap on context menu items
This resolves (literal) edge cases where opening the context menu
too close to the right-hand side of the player would inadvertently
wrap the lengthiest menu item.
2024-06-30 13:23:16 +02:00
Wumbo 45cbb4f14e web: Don't unnecessarily populate Save Manager 2024-06-30 13:23:16 +02:00
Wumbo fe944e017d web: Run formatter because I forgot to before 2024-06-30 13:23:16 +02:00
Wumbo dfe39f4a50 web: Improve modal/context menu behavior
- Open modals now dim the player and prevent interaction with the
  underlying content until it is closed
- Right-clicking outside of an open modal now closes it instead of
  displaying the browser context menu
- Fixed a regression where right-clicking with the Ruffle context
  menu open would open the browser context menu
2024-06-30 13:23:16 +02:00
Wumbo 158e2f8474 web: Core UI improvements
Dark mode support has been added to the context menu as well as the
the Volume and Save Manager modals. The latter two have also received
significant visual upgrades.
2024-06-30 13:23:16 +02:00
Nathan Adams 7905544296 web: Add onFirstLoad option to installRuffle; use it to configure webpack in selfhosted 2024-06-30 13:09:01 +02:00
Nathan Adams 9d4837547f web: Add (optional) options to installRuffle 2024-06-30 13:09:01 +02:00
Nathan Adams f9b0346973 web: Remove the publicAPI.registerSource(name) method, it wouldn't work the way you'd expect. Best keep it an implementation detail. 2024-06-30 13:09:01 +02:00
Nathan Adams 09fdbb9c43 web: sourceName of installRuffle should be required 2024-06-30 13:09:01 +02:00