1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00
Commit graph

20630 commits

Author SHA1 Message Date
Tim van der Meij
2738d1e4f6
Update translations to the most recent versions 2024-12-07 13:44:57 +01:00
Tim van der Meij
129fc66f65
Upgrade eslint-plugin-perfectionist to version 4.2.0
This requires two changes on our side:

- The order of exports in `web/viewer{-geckoview}.js` changes slightly
  because `eslint-plugin-perfectionist` aligned the sorting order with
  the `eslint-plugin-sort-exports` plugin we used before. This restores
  the change from commit 347f155.
- The `eslint-plugin-import` plugin contains a bug that causes the new
  version of `eslint-plugin-perfectionist` to be reported as unresolved.
  This issue is tracked upstream, and since the plugin works fine we
  can simply extend the ignore list we already have to avoid this error
  until the upstream bug is fixed.
2024-12-07 13:44:48 +01:00
Tim van der Meij
7d1ca73acc
Update dependencies to the most recent versions 2024-12-07 13:22:44 +01:00
Jonas Jenwald
b870c5d2ad
Merge pull request #19185 from Snuffleupagus/issue-19175
Support toggling the `PDFFindBar` options with the `Enter` key (issue 19175)
2024-12-06 23:32:58 +01:00
calixteman
23c42f891b
Merge pull request #19184 from calixteman/issue19182
Get the first codepoint instead of the first char when using the toUnicode map
2024-12-06 18:31:30 +01:00
Calixte Denizet
6fe6b6d6b7 Get the first codepoint instead of the first char when using the toUnicode map
It fixes #19182.
2024-12-06 18:25:13 +01:00
Jonas Jenwald
49326f71c2 Support toggling the PDFFindBar options with the Enter key (issue 19175)
These DOM elements are `input type="checkbox"` and (natively) only support being toggled with the `Space` key, however we can extend an existing event-listener to "manually" support the `Enter` key as well.
2024-12-06 17:53:28 +01:00
Jonas Jenwald
c198e0b446
Merge pull request #19148 from nicolo-ribaudo/error-preserve-trace
Do not stringify errors when logging them
2024-12-06 17:11:33 +01:00
Nicolò Ribaudo
202b26487f
Do not stringify errors when logging them
Converting errors to string drops their stack trace, making it more
difficult to debug their actual reason. We can instead pass the error
objects as-is to console.warn/error, so that Firefox/Chrome devtools
will show both the stack trace of the console.warn/error call, and the
original stack trace of the error.

This commit also enables the `unicorn/no-console-spaces` ESLint rule,
which avoids accidental extra spaces when passing multiple parameters to
`console.*` methods.
2024-12-06 14:47:22 +01:00
Jonas Jenwald
60eba287d4
Merge pull request #19114 from Snuffleupagus/issue-19075
Ensure that a missing/invalid "Content-Range" header is handled in `PDFNetworkStream` (issue 19075)
2024-12-06 12:31:18 +01:00
Jonas Jenwald
eff8ede33e Make the onError callback required in NetworkManager
This helps ensure that loading errors are always handled correctly, and note that both `PDFNetworkStreamFullRequestReader` and `PDFNetworkStreamRangeRequestReader` already provided such a callback.
2024-12-06 12:09:36 +01:00
Jonas Jenwald
2661d0623b Ensure that a missing/invalid "Content-Range" header is handled in PDFNetworkStream (issue 19075)
In the event that the "Content-Range" header is missing/invalid, loading will now be aborted rather than hanging indefinitely.
2024-12-06 12:09:34 +01:00
calixteman
e04b62ba2d
Merge pull request #19164 from calixteman/issue18622
When zooming replace the css-zoomed canvas by the new one only when rendering is finished
2024-12-06 11:44:32 +01:00
Calixte Denizet
f3038406b1 When zooming replace the css-zoomed canvas by the new one only when rendering is finished
It fixes #18622.

It avoids to recreate a canvasWrapper element in order minimize the DOM operations.
2024-12-05 23:15:04 +01:00
Tim van der Meij
ef6ecee34c
Merge pull request #19178 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-12-05 22:30:35 +01:00
Tim van der Meij
34390ca53a
Bump the stable version in pdfjs.config 2024-12-05 22:25:31 +01:00
Tim van der Meij
a4eb8407c1
Merge pull request #19149 from Snuffleupagus/issue-19145
Prevent Webpack from resolving `import.meta.url` statements during building (issue 19145)
2024-12-05 21:38:26 +01:00
Tim van der Meij
f0a8a799a7
Merge pull request #19177 from calixteman/issue19171
Avoid to display an alert or a confirm dialog if the message is empty
2024-12-05 21:36:54 +01:00
Calixte Denizet
d1db8d6294 Avoid to display an alert or a confirm dialog if the message is empty
It fixes #19171.
2024-12-05 21:04:07 +01:00
calixteman
f180de41f3
Merge pull request #19174 from calixteman/ink_update_width
[Editor] Correctly update the current drawing when zooming
2024-12-05 16:06:34 +01:00
Jonas Jenwald
28d801e081
Merge pull request #19172 from Snuffleupagus/toggleButton-hover
Ensure that the `.toggleButton`, as used in the findbar, always have visible hover/focus state (issue 19165)
2024-12-05 15:24:46 +01:00
Calixte Denizet
dfa0e79553 [Editor] Correctly update the current drawing when zooming
We were trying to update the drawing on the current page but if the drawing is an another
page then it wasn't updated.
2024-12-05 14:22:02 +01:00
calixteman
9cbc5baafd
Merge pull request #19163 from calixteman/fix_new_ink_itest
Correctly wait for the editor mode when double clicking on an annotation in integration tests
2024-12-05 13:38:12 +01:00
Jonas Jenwald
61e2eceff6 Ensure that the .toggleButton, as used in the findbar, always have visible hover/focus state (issue 19165)
Similar to the regular toolbarButtons that can be toggled, this ensure that it's always possible to tell when the findbar "buttons" are hovered/focused.
2024-12-05 13:07:57 +01:00
Jonas Jenwald
2ad8f6155c
Merge pull request #19161 from Snuffleupagus/Promise-try
Introduce `Promise.try()` usage in the code-base
2024-12-05 10:48:29 +01:00
Calixte Denizet
3ac55501e9 Correctly wait for the editor mode when double clicking on an annotation in integration tests 2024-12-04 18:42:49 +01:00
Jonas Jenwald
ef0331877d Introduce Promise.try() usage in the code-base
This simplifies the creation of Promises in some cases; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try
2024-12-04 10:31:42 +01:00
calixteman
11ce57ac22
Merge pull request #19160 from calixteman/fix_css_message_bar
Fix unused css variables (follow-up of #18900)
2024-12-04 09:45:17 +01:00
Calixte Denizet
1cd3eb75d5 Fix unused css variables (follow-up of #18900) 2024-12-04 09:15:01 +01:00
calixteman
9a4b7c2612
Merge pull request #19155 from calixteman/bug1929311
[Editor] Corrrectly get the words from the alt-text when reporting the telemetry (bug 1929311)
2024-12-03 19:27:15 +01:00
Calixte Denizet
e161826a44 [Editor] Corrrectly get the words from the alt-text when reporting the telemetry (bug 1929311) 2024-12-03 19:02:58 +01:00
calixteman
a5ce71247b
Merge pull request #18900 from ryzokuken/popup-undo-annotation
Annotation deletion popup (bug 1899731)
2024-12-03 16:53:48 +01:00
Aditi
41bf874461 Add tests for annotation delete popup 2024-12-03 11:03:15 +01:00
Ujjwal Sharma
dd82d78a2d Pop open a message when user deletes an annotation
When a user deletes any number of annotations, they are notified of the action
by a popup message with an undo button. Besides that, this change reuses the
existing messageBar CSS class from the new alt-text dialog as much as possible.
2024-12-03 11:03:15 +01:00
Ujjwal Sharma
962eb6206a Break messageBar class out
Move .messageBar out of .dialog into its own standalone class in order
to reuse as much of it for the upcoming feature for an undo message for
annotations.
2024-12-02 23:01:22 +01:00
Jonas Jenwald
f8d11a3a3a
Merge pull request #19074 from Rob--W/issue-12744-test
Add test cases for redirected responses
2024-12-02 19:06:55 +01:00
calixteman
8a2bdb1a05
Merge pull request #19151 from calixteman/edit_inks
[Editor] Make ink annotation editable
2024-12-02 18:30:40 +01:00
Rob Wu
f97b4b9a66 Add test cases for redirected responses
Regression tests for issue #12744 and PR #19028
2024-12-02 17:57:49 +01:00
Rob Wu
28b0220bc2 Replace createTemporaryNodeServer with TestPdfsServer
Some tests rely on the presence of a server that serves PDF files.
When tests are run from a web browser, the test files and PDF files are
served by the same server (WebServer), but in Node.js that server is not
around.

Currently, the tests that depend on it start a minimal Node.js server
that re-implements part of the functionality from WebServer.

To avoid code duplication when tests depend on more complex behaviors,
this patch replaces createTemporaryNodeServer with the existing
WebServer, wrapped in a new test utility that has the same interface in
Node.js and non-Node.js environments (=TestPdfsServer).

This patch has been tested by running the refactored tests in the
following three configurations:

1. From the browser:
   - http://localhost:8888/test/unit/unit_test.html?spec=api
   - http://localhost:8888/test/unit/unit_test.html?spec=fetch_stream

2. Run specific tests directly with jasmine without legacy bundling:
   `JASMINE_CONFIG_PATH=test/unit/clitests.json ./node_modules/.bin/jasmine --filter='^api|^fetch_stream'`

3. `gulp unittestcli`
2024-12-02 17:57:49 +01:00
Calixte Denizet
7e02c77250 [Editor] Make ink annotation editable 2024-12-02 17:15:33 +01:00
calixteman
97c7a8eb7a
Merge pull request #19144 from calixteman/no_focus_if_invisible
[Editor] Don't focus a newly added drawing if it isn't visible on screen
2024-12-02 14:02:01 +01:00
calixteman
36b1ba8eca
Merge pull request #19142 from calixteman/rotated_ink
Fix the clickable area for rotated ink annotations
2024-12-02 14:01:26 +01:00
Jonas Jenwald
a2b889bb9a Prevent Webpack from resolving import.meta.url statements during building (issue 19145)
This fixes a Node.js-specific regression from PR 18959.
2024-12-02 13:38:22 +01:00
Calixte Denizet
673c93e832 [Editor] Don't focus a newly added drawing if it isn't visible on screen 2024-12-02 11:06:13 +01:00
Calixte Denizet
1460a8128a Fix the clickable area for rotated ink annotations 2024-12-02 09:48:22 +01:00
Tim van der Meij
d448953166
Merge pull request #19139 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-12-01 20:07:54 +01:00
Tim van der Meij
33da75fb36
Bump the stable version in pdfjs.config 2024-12-01 20:04:54 +01:00
Jonas Jenwald
867aaf01fa
Merge pull request #19117 from Snuffleupagus/bot-forceNoChrome
Disable the browser-tests in Google Chrome on the bots
2024-12-01 18:28:03 +01:00
Tim van der Meij
2bbf9b432c
Merge pull request #19099 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-12-01 14:54:07 +01:00
Tim van der Meij
eb51dbf296
Update translations to the most recent versions 2024-12-01 14:49:03 +01:00