Commit Graph

18376 Commits

Author SHA1 Message Date
Calixte Denizet
31d9b9f574 [Editor] Add a way to extract the outlines of a union of rectangles
The goal is to be able to get these outlines to fill the shape corresponding
to a text selection in order to highlight some text contents.
The outlines will be used either to show selected/hovered highlights.
2023-11-20 18:45:19 +01:00
Jonas Jenwald
a6f0609a6e Throw a JpegError when a JPEG image has no frame data (issue 17302)
Given that there's nothing to parse in this case, since we're dealing with an invalid JPEG image, throwing an *explicit* Error makes sense here.
2023-11-20 17:33:49 +01:00
calixteman
d8424a43ba
Merge pull request #17300 from calixteman/issue17299
[Editor] Make the alt-text button large enough to display correctly whatever string
2023-11-20 15:45:53 +01:00
Calixte Denizet
bd6c2a192c [Editor] Make the alt-text button large enough to display correctly whatever string 2023-11-20 13:22:02 +01:00
calixteman
3459615ec3
Merge pull request #17293 from calixteman/dark
Restore the option to set light/dark mode for chromium and generic builds
2023-11-18 21:48:09 +01:00
Calixte Denizet
53101b379b Restore the option to set light/dark mode for chromium and generic builds 2023-11-18 21:32:25 +01:00
calixteman
ffbfd680ec
Merge pull request #17281 from calixteman/delete_button_tooltip
[Editor] Add a tooltip to the delete button
2023-11-15 12:59:52 +01:00
Calixte Denizet
b7d28a3bf6 [Editor] Add a tooltip to the delete button 2023-11-15 10:51:39 +01:00
Jonas Jenwald
1df648733e
Merge pull request #17277 from Snuffleupagus/L10n-fetchData
Re-factor how the `GenericL10n` class fetches localization-data
2023-11-14 16:09:05 +01:00
Jonas Jenwald
5099dc4699
Merge pull request #17273 from Snuffleupagus/L10n-lowercase-locales
Re-factor the `L10n`-implementations to use lowercase language-codes internally
2023-11-14 15:59:13 +01:00
Jonas Jenwald
709d89420e Re-factor how the GenericL10n class fetches localization-data
- Re-factor the existing `fetchData` helper function such that it can fetch more types of data, and it now supports "arraybuffer", "json", and "text".
   This only needed minor adjustments in the `DOMCMapReaderFactory` and `DOMStandardFontDataFactory` classes.[1]

 - Expose the `fetchData` helper function in the API, such that the viewer is able to access it.

 - Use the `fetchData` helper function in the `GenericL10n` class, since this should allow fetching of localization-data even if the default viewer is run in an environment without support for the Fetch API.

---
[1] While testing this I also noticed a minor inconsistency when handling standard font-data on the worker-thread.
2023-11-14 13:45:14 +01:00
Jonas Jenwald
1f9533bae9 Re-factor the L10n-implementations to use lowercase language-codes internally
This is consistent with the implementation used in the (now removed) webL10n-library, and by only using lowercase language-codes internally in the `L10n`-implementations we should avoid future issues e.g. when users manually set the `locale`-option (in the default viewer).
2023-11-13 21:06:03 +01:00
Jonas Jenwald
44cde3ccca
Merge pull request #17263 from timvandermeij/font-tests
Introduce a GitHub Actions workflow for running the font tests
2023-11-13 17:43:08 +01:00
calixteman
787d092ecb
Merge pull request #17271 from calixteman/maif
Get the field name from its parent when it doesn't have one when collecting fields (bug 1864136)
2023-11-13 15:57:42 +01:00
Calixte Denizet
09b4fe6a30 Get the field name from its parent when it doesn't have one when collecting fields (bug 1864136)
Some fields, somewhere under the Fields entry in Acroform, could have no name (in T)
but with a parent which has a name but which isn't somewhere under Fields.
As a side-effect, this patch prevents infinite loops because of potential cycles
under Fields.
2023-11-13 14:41:14 +01:00
Jonas Jenwald
096c5fe2b5
Merge pull request #17272 from Snuffleupagus/issue-17254
Fix typo in the `--hcm-highlight-filter` CSS variable name (issue 17254)
2023-11-13 11:34:02 +01:00
Jonas Jenwald
90864a5672 Fix typo in the --hcm-highlight-filter CSS variable name (issue 17254) 2023-11-13 11:18:35 +01:00
Jonas Jenwald
7b89e7e0d2
Merge pull request #17270 from Snuffleupagus/issue-17269
[GENERIC viewer] Fallback to the short-format of the language code (issue 17269)
2023-11-13 11:10:33 +01:00
Jonas Jenwald
3f7fd2f035 [GENERIC viewer] Fallback to the short-format of the language code (issue 17269)
This shouldn't cause any issues, since `GenericL10n.#createBundle` has an early return for languages that don't exist in the `locale.json` file.
2023-11-13 10:04:48 +01:00
Tim van der Meij
8157f39c62
Introduce a GitHub Actions workflow for running the font tests
This commit migrates the font tests away from the bots. Not only are the
font tests broken on the Windows bot since some time, they also run on
Python 2 (end of life since January 2020) and `ttx` 3.19.0 (released in
November 2017). The latter is installed via a submodule, which requires
more complicated logic for finding and running `ttx`.

We solve the issues by implementing a modern workflow that installs the
most recent stable Python and `ttx` (`fonttools` package) versions. This
simplifies the `ttx` driver code as well because it can now assume `ttx`
is available on the path (just like we do for e.g. `node` invocations).
GitHub Actions takes care of creating a virtual environment with
`fonttools` in it so that the `ttx`  entrypoint is available. Locally
the font tests can be run in a similar way by creating and sourcing a
virtual environment with `fonttools` in it before running the font
tests, and a README file is included with instructions for doing so.
2023-11-12 17:48:04 +01:00
Tim van der Meij
69452bb60e
Implement optionally running the tests in headless mode
This commit prepares for running the font tests on GitHub Actions where
we can't spin up headful browsers because there are no display
capabilities on the workers. This will also be useful for porting other
test targets to GitHub Actions at a later time, as well as running the
tests locally in headless mode.
2023-11-12 17:48:04 +01:00
Tim van der Meij
a1d84f8ce1
Refactor parameter passing for the startBrowser(s) functions in test.mjs
This commit prepares for the introduction of extra options in later
commits by changing the function signatures of the `startBrowser(s)`
functions to take parameter objects instead of plain parameters. This
makes the call sites explicitly state which parameters they pass,
improving overall readability as well.
2023-11-12 14:59:25 +01:00
Tim van der Meij
24fcc042f4
Refactor URL handling for the startBrowsers function in test.mjs
The current logic is more complicated than it needs to be because it's
passing a callback function to `startBrowsers` instead of a string.
This commit simplifies the logic by passing the base URL as a string to
`startBrowsers` and having it do further augmentation internally,
thereby removing all indirection of the function calls to `makeTestUrl`
and the inner function it returned.
2023-11-12 14:06:45 +01:00
Tim van der Meij
7884119975
Merge pull request #17268 from Snuffleupagus/ci-test-refactor
Clean-up the CI workflow a bit
2023-11-12 14:04:02 +01:00
Jonas Jenwald
5687326046 Clean-up the CI workflow a bit
After recent PRs the size and scope of the CI workflow is now reduced, and this patch tries to simplify things further. More specifically we can directly specify the gulp-tasks in the workflow, and thus clean-up the `gulpfile` a tiny bit.

Note that this will technically be slower, since the tests are now run in series (rather than in parallel), however `gulp externaltest` runs so quickly that it really won't matter in practice.
2023-11-12 13:48:02 +01:00
Tim van der Meij
af3147c3fe
Merge pull request #17266 from Snuffleupagus/typestest-workflow
Move `gulp typestest` to a separate GitHub Actions workflow
2023-11-12 13:32:20 +01:00
Jonas Jenwald
d89ca97887 Move gulp typestest to a separate GitHub Actions workflow
This way we introduce more parallelism in the GitHub Actions tests, which should reduce overall runtime and thus cannot hurt.
2023-11-12 13:27:29 +01:00
Tim van der Meij
e0e5be2c62
Merge pull request #17267 from Snuffleupagus/lint-workflow
Move linting to a separate GitHub Actions workflow
2023-11-12 13:08:26 +01:00
Tim van der Meij
9172d649ed
Merge pull request #17264 from calixteman/issue17262
[Editor] Avoid to click on the delete button in the freetext integration tests
2023-11-12 13:04:13 +01:00
Tim van der Meij
290b483167
Merge pull request #17255 from Snuffleupagus/issue-17228
Ensure that the viewer waits for the library to complete loading (issue 17228)
2023-11-12 13:02:34 +01:00
Tim van der Meij
2869b63800
Merge pull request #17252 from tamuratak/to_mts
Rename *.d.ts to *.d.mts
2023-11-12 13:00:44 +01:00
Tim van der Meij
37a8311b4c
Merge pull request #17265 from Snuffleupagus/createCDNWrapper-blob-type
Set a type for the `Blob` used in `createCDNWrapper` (issue 17259)
2023-11-12 12:58:21 +01:00
Jonas Jenwald
2f70369d02 Move linting to a separate GitHub Actions workflow
This way we introduce more parallelism in the GitHub Actions tests, which should reduce overall runtime and thus cannot hurt.
2023-11-12 10:21:29 +01:00
Jonas Jenwald
ade692ff2e Set a type for the Blob used in createCDNWrapper (issue 17259)
Hopefully this is enough to address the problem of initializing the Worker in Chromium-based browsers.
Locally I've tried to *force* use of `createCDNWrapper` in development mode, by commenting out the `isSameOrigin` checks, and worker-loading fails against `master` and works with this patch.
2023-11-12 09:30:26 +01:00
Takashi Tamura
61ed77cfb4 Rename *.d.ts to *.d.mts. Close #17241
Add a type test for legacy.

- https://www.typescriptlang.org/docs/handbook/modules/reference.html#file-extension-substitution
2023-11-12 07:30:36 +09:00
Calixte Denizet
2d42c04543 [Editor] Avoid to click on the delete button in the freetext integration tests 2023-11-11 20:47:05 +01:00
Tim van der Meij
26fcd261fb
Merge pull request #17260 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2023-11-11 18:46:18 +01:00
Tim van der Meij
4b7a0d1841
Update translations to the most recent versions 2023-11-11 15:58:30 +01:00
Tim van der Meij
8e2c9a30d7
Update dependencies to the most recent versions 2023-11-11 15:57:28 +01:00
Jonas Jenwald
8e5311ebf7
Merge pull request #17256 from Snuffleupagus/editorParamsToolbar-color
Tweak the background-color of the `editorParamsToolbar`s
2023-11-10 23:04:30 +01:00
Jonas Jenwald
e61b832764 Tweak the background-color of the editorParamsToolbars
Currently the background-color of the `editorParamsToolbar`s don't match that of the arrow, which is especially noticable in dark mode (see zoomed-in screen-shots below).
The simplest solution seem to be to just style the `editorParamsToolbar`s like the `secondaryToolbar`, to limit the amount of CSS changes required.
2023-11-10 18:19:39 +01:00
calixteman
17213062cc
Merge pull request #17253 from calixteman/issue16839
Fix the maxp table version in font to make it visible on Windows
2023-11-10 17:57:33 +01:00
calixteman
f56215f246
Merge pull request #17243 from calixteman/editor_bin
[Editor] Add a toolbar to selected editors with a button to delete it  (bug 1863763)
2023-11-10 17:01:31 +01:00
Calixte Denizet
334f0eb060 [Editor] Add a toolbar to selected editors with a button to delete it (bug 1863763) 2023-11-10 15:19:43 +01:00
Calixte Denizet
59ce1a4a3f Fix the maxp table version in font to make it visible on Windows 2023-11-10 14:16:20 +01:00
Jonas Jenwald
823d375b8b Ensure that the viewer waits for the library to complete loading (issue 17228)
This should *hopefully* fix 17228, by tweaking the build scripts to give the GENERIC viewer something to await to avoid breaking third-party users of the standalone viewer components.
2023-11-10 13:22:49 +01:00
Jonas Jenwald
1b88aad0db
Merge pull request #17244 from Snuffleupagus/rm-openFile-button
Remove the "Open file"-button from the main toolbar
2023-11-10 10:24:30 +01:00
calixteman
f1122f048e
Merge pull request #17247 from calixteman/bug1863910
Don't avoid to execute the Blur callback when blurring a text field (bug 1863910)
2023-11-09 20:05:53 +01:00
Calixte Denizet
ec396c2150 Don't avoid to execute the Blur callback when blurring a text field (bug 1863910) 2023-11-09 13:50:33 +01:00
Jonas Jenwald
bf016743fc Remove the "Open file"-button from the main toolbar
This button is *only* used in the GENERIC viewer, and will currently be visible either in the main or secondary toolbars (depending on the viewer width).
To simplify upcoming changes, and to avoid then having to complicate the relevant CSS rules unnecessarily, let's place the "Open file"-button permanently in the secondary toolbar instead.

(Note that the GENERIC viewer also, since five years, supports drag-and-drop in order to open local files.)
2023-11-09 08:08:17 +01:00