Commit Graph

18199 Commits

Author SHA1 Message Date
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
Jonas Jenwald
42f3d57365
Merge pull request #17242 from Snuffleupagus/fieldObjects-async-fetch
Ensure that `fieldObjects` and `#collectFieldObjects` handles References correctly
2023-11-08 15:28:11 +01:00
Jonas Jenwald
ff62fc8e2c Skip fieldObjects that are not actually References
The `fieldObjects`-getter is implemented in the `PDFDocument` class, which means that the `this._localIdFactory`-property that we pass to `AnnotationFactory.create` doesn't actually exist.
The reason that this hasn't caused any bugs, that I'm aware of, is that all /Fields-entries need to be References to actually make sense.
2023-11-08 14:39:13 +01:00
Jonas Jenwald
65c827b0eb Ensure that fieldObjects and #collectFieldObjects handles References correctly
The `fieldObjects`-getter itself is called, from `src/core/worker.js`, in a way that'll ensure that any `MissingDataException`s are handled. However the problem is that the actual data-lookups in `fieldObjects` and `#collectFieldObjects` are done inside of a Promise, which means that `MissingDataException`s won't be handled and parsing could thus break.

To address this we change all data-lookups to be asynchronous instead.
2023-11-08 14:38:57 +01:00
calixteman
c6a717f900
Merge pull request #17233 from calixteman/issue17232
Don't try to collect a nonexistent field because of an invalid ref
2023-11-07 22:50:55 +01:00
Calixte Denizet
acc62f80de Don't try to collect a nonexistent field because of an invalid ref 2023-11-07 19:58:29 +01:00
Tim van der Meij
72338ce05d
Merge pull request #17226 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2023-11-05 19:01:34 +01:00
Tim van der Meij
f16401bd67
Bump the stable version in pdfjs.config 2023-11-05 18:58:09 +01:00
Jonas Jenwald
50f52b43a5
Merge pull request #17222 from Snuffleupagus/rm-viewerCssTheme
Remove the `viewerCssTheme`-option, since it's partially broken
2023-11-04 17:40:03 +01:00
Tim van der Meij
87c83ab31c
Merge pull request #17220 from Snuffleupagus/pr-17176-followup
Also pause translation when expanding the current outline-item (PR 17176 follow-up)
2023-11-04 15:29:14 +01:00
Tim van der Meij
0d574f66bc
Merge pull request #17224 from Snuffleupagus/dist-webpack
Update `external/dist/webpack.js` to account for outputting of JavaScript modules (PR 17055 follow-up)
2023-11-04 15:26:35 +01:00
Jonas Jenwald
13ca668be0 Update external/dist/webpack.js to account for outputting of JavaScript modules (PR 17055 follow-up)
Hopefully this makes sense, since I don't know enough about Webpack to tell exactly how this file is being used in practice.
2023-11-04 13:04:26 +01:00
Tim van der Meij
9eb9d3f949
Merge pull request #17218 from Snuffleupagus/app-open-API-options
Re-factor how some API-options are handled in `PDFViewerApplication.open` (PR 17208 follow-up)
2023-11-04 12:53:18 +01:00
Tim van der Meij
71a6c749d0
Merge pull request #17202 from Snuffleupagus/node-ci-latest
Also test the latest Node.js version in GitHub Actions
2023-11-04 12:45:03 +01:00
Tim van der Meij
09f45e6e52
Merge pull request #17217 from Snuffleupagus/more-optional-chaining-5
Use even more optional chaining in the code-base
2023-11-04 12:36:32 +01:00
Tim van der Meij
5e6d80ad07
Merge pull request #17223 from Snuffleupagus/update-packages
Update packages and translations
2023-11-04 12:30:22 +01:00
Jonas Jenwald
89bb0c9e66 Update l10n files 2023-11-04 09:47:38 +01:00
Jonas Jenwald
e0898a7ee3 Update npm packages
The new major version of `gulp-zip` shouldn't be a problem, given the changes listed in https://github.com/sindresorhus/gulp-zip/releases/tag/v6.0.0
2023-11-04 09:47:31 +01:00
Jonas Jenwald
d46578e959 Remove the viewerCssTheme-option, since it's partially broken
The `viewerCssTheme`-implementation has always been somewhat hacky, and now it's also *partially* broken ever since we've started using CSS nesting.
Trying to support nested media queries would thus require a lot more parsing of the CSS rules, which seems inefficient and thus generally undesirable.[1]

As discussed on Matrix, let's try to remove the `viewerCssTheme`-option and see if there's any (significant) fallout from this.

---
[1] If this option is brought back, it seems to me that it (in Firefox) should probably be set through the platform-code that handles theming.
2023-11-04 09:19:01 +01:00
Jonas Jenwald
bf7e8126df Also pause translation when expanding the current outline-item (PR 17176 follow-up)
Depending on the structure of the outline we could potentially need to expand a few levels, especially in long PDF documents, hence it cannot hurt to pause translation in that case as well.
2023-11-03 13:26:36 +01:00
Jonas Jenwald
84aaafcd3e Use a limit when splitting URL-strings in web/app.js
This should be a *tiny* bit more efficient, since it avoids parsing substrings that we don't care about.
2023-11-03 10:53:19 +01:00
Jonas Jenwald
e20dabb65b Simplify how the docBaseUrl-option is handled in PDFViewerApplication.open
Reduce the "special" handling a bit here, by setting the viewer-option such that it'll be automatically included in the API-parameters.
2023-11-03 10:52:31 +01:00
Jonas Jenwald
8bbfcd3bef Re-factor how the canvasMaxAreaInBytes-option is handled in PDFViewerApplication.open (PR 17208 follow-up)
With the changes in PR 17208, where browser-preferences are now handled as "regular" viewer-options, we can tweak the definition of `canvasMaxAreaInBytes` to slightly simplify things in the `PDFViewerApplication.open` method.
2023-11-03 10:52:27 +01:00
Jonas Jenwald
99522c3201 Also test the latest Node.js version in GitHub Actions
Hopefully this will allow us to catch bugs in new Node.js versions earlier, rather than having to wait for bug reports.

Given that `CompressionStream` is (currently) only potentially used when saving a *modified* PDF document, which is unlikely to be a common use-case in Node.js environments, let's just disable the affected unit-test for now.
2023-11-02 16:58:03 +01:00
Jonas Jenwald
155a302e74 Use even more optional chaining in the code-base 2023-11-02 16:47:33 +01:00
calixteman
f528f6f07b
Merge pull request #17216 from calixteman/issue17215
Render rich text with only one text element
2023-11-02 16:42:01 +01:00
Calixte Denizet
085aa4207d Render rich text with only one text element 2023-11-02 15:35:52 +01:00
Jonas Jenwald
20adb2c44d
Merge pull request #17201 from Snuffleupagus/node-ci-lts
Update the GitHub Actions workflows to use the current Node.js LTS version
2023-11-02 13:28:09 +01:00