Commit Graph

18622 Commits

Author SHA1 Message Date
Jonas Jenwald
a92b38e71c Inline the HighlightEditor.#telemetryType getter at its only call-site (PR 17748 follow-up) 2024-02-28 20:47:01 +01:00
calixteman
9fe15d4a01
Merge pull request #17748 from calixteman/highlight_telemetry_followup
[Editor] Count the colors used when highlighting whatever the highlight kind is
2024-02-28 20:00:15 +01:00
Calixte Denizet
3a7e638fce [Editor] Count the colors used when highlighting whatever the highlight kind is 2024-02-28 18:24:24 +01:00
calixteman
07abd647f4
Merge pull request #17737 from calixteman/highlight_telemetry
[Editor] Add some telemetry for the highlight feature (bug 1866437)
2024-02-28 15:20:57 +01:00
Calixte Denizet
65342d2bee [Editor] Add some telemetry for the highlight feature (bug 1866437) 2024-02-28 10:17:11 +01:00
calixteman
b1a04fc184
Merge pull request #17738 from calixteman/issue17730
Always add links in the annotation layer
2024-02-28 09:34:10 +01:00
Calixte Denizet
e0b843d991 Always add links in the annotation layer
Fixes #17730.
2024-02-27 22:48:08 +01:00
calixteman
06aef89502
Merge pull request #17733 from calixteman/puppeteer_22_1_0
Update puppeteer to 22.3.0
2024-02-27 13:46:30 +01:00
Calixte Denizet
5e7941afbf Update puppeteer to 22.3.0 2024-02-27 12:19:54 +01:00
calixteman
e42b114e80
Merge pull request #17724 from calixteman/issue17707
Avoid to have to wait to zoom after scrolling
2024-02-26 11:05:10 +01:00
Calixte Denizet
9e042e7acc Avoid to have to wait to zoom after scrolling
Allow to zoom with the wheel once the scrolling is finished.
It's now possible to know that thanks to the scrollend event.

Fixes #17707.
2024-02-25 21:40:48 +01:00
calixteman
ca4ab064e5
Merge pull request #17720 from calixteman/editor_simplify_highlighting
[Editor] In caret browsing mode, allow to select in pressing shift and arrow down (bug 1881802)
2024-02-25 17:52:11 +01:00
Calixte Denizet
0520f2f0cb [Editor] In caret browsing mode, allow to select in pressing shift and arrow down (bug 1881802)
In implementing caret browsing mode in pdf.js, I didn't notice that selectstart isn't always triggered.
So this patch removes the use of selectstart and rely only on selectionchange.
In order to simplify the selection management, the selection code is moved in the AnnotationUIManager:
 - it simplifies the code;
 - it allows to have only one listener for selectionchange instead of having one by visible page
   for selectstart.
I had to add a delay in the integration tests for highlighting (there's a comment with an explanation),
it isn't really nice, but it's the only way I found and in real life there always is a delay between
press and release.
2024-02-25 15:35:30 +01:00
calixteman
1bd6af6dae
Merge pull request #17722 from calixteman/issue17721
Fix the string GlobalConstants.IDS_INVALID_DATE
2024-02-23 21:49:42 +01:00
Calixte Denizet
fe41e789de Fix the string GlobalConstants.IDS_INVALID_DATE 2024-02-23 21:39:06 +01:00
Jonas Jenwald
346efe919a
Merge pull request #17718 from Snuffleupagus/hexNumbers-tweak
Tweak how the `hexNumbers` Array, used by `Util.makeHexColor`, is built
2024-02-23 18:17:10 +01:00
calixteman
b8b8f1af66
Merge pull request #17719 from calixteman/bug1881692
[Editor] In caret browsing mode, get the caret position in the text layer (bug 1881692)
2024-02-23 17:11:51 +01:00
Calixte Denizet
bb19cf9b64 [Editor] In caret browsing mode, get the caret position in the text layer (bug 1881692)
The function caretPositionFromPoint return the position within the last visible element
and sometimes there are some elements on top of the ones in the text layer.
So the idea is to hide the visible elements which aren't in the text layer in order
to get the right caret position.
2024-02-23 16:50:19 +01:00
calixteman
101e8efad7
Merge pull request #17708 from calixteman/editor_highlight_context_menu
[Editor] Add the possibility to create an highlight from the context menu when some text is selected (bug 1867739)
2024-02-23 16:39:03 +01:00
Calixte Denizet
e1f6f5179f [Editor] Add the possibility to create an highlight from the context menu when some text is selected (bug 1867739) 2024-02-23 16:18:03 +01:00
Jonas Jenwald
49a2aff532 Tweak how the hexNumbers Array, used by Util.makeHexColor, is built
*Please note:* This is a micro optimization, hence I fully understand if the patch is rejected.

Currently we create two temporary Arrays and have to iterate twice in total when building the final `hexNumbers` Array.
With this patch there's only one temporary Array and a single iteration required to build the final `hexNumbers` Array.
2024-02-23 14:20:53 +01:00
calixteman
72b8b29147
Merge pull request #17701 from calixteman/alt_text_ai
[Editor] Add the possibility to query some ML stuff to guess an alt text for an image
2024-02-21 10:14:40 +01:00
calixteman
0fb8a23051
Merge pull request #17702 from calixteman/bug1868759
[Editor] Disable annotation layer when highlighting (bug 1868759)
2024-02-21 09:49:48 +01:00
Calixte Denizet
46416bb131 [Editor] Add the possibility to query some ML stuff to guess an alt text for an image
It's only for an experimental purpose.
2024-02-20 21:29:33 +01:00
Calixte Denizet
95f9bedc7c [Editor] Disable annotation layer when highlighting (bug 1868759)
When highlighting, the annotation editor layer is disabled to get pointer events
from the text layer, but the annotation layer must be then disabled either in
order to avoid bad interactions.
2024-02-20 21:17:05 +01:00
calixteman
70015ffe6b
Merge pull request #17688 from calixteman/editor_no_scroll_unselect
[Editor] Avoid to scroll when an editor is unselected
2024-02-20 17:00:43 +01:00
calixteman
99fa713fba
Merge pull request #17690 from calixteman/issue17689
Avoid to access to a missing cidSystemInfo property
2024-02-19 12:04:07 +01:00
Calixte Denizet
a6eadf8150 Avoid to access to a missing cidSystemInfo property
Fixes #17689.
2024-02-19 09:55:23 +01:00
Calixte Denizet
c2fcc66302 [Editor] Avoid to scroll when an editor is unselected 2024-02-18 19:21:45 +01:00
Tim van der Meij
d96fd80ca0
Merge pull request #17687 from Snuffleupagus/pr-17686-followup
Disable source-map generation in the minified builds (PR 17686 follow-up)
2024-02-18 13:35:23 +01:00
Jonas Jenwald
673639c54b Disable source-map generation in the minified builds (PR 17686 follow-up)
As part of the changes in PR 17686 we "accidentally" enabled source-maps for the *minified* builds, which seems unnecessary since those have never been included in the `pdfjs-dist` output.
Locally this patch reduces the run-time of `gulp minified` by ~15 percent.
2024-02-17 22:14:37 +01:00
Tim van der Meij
4ac8ee8b6d
Merge pull request #17686 from Snuffleupagus/Webpack-TerserPlugin
Run minification directly during Webpack building
2024-02-17 19:42:35 +01:00
Jonas Jenwald
091e861531 Run minification directly during Webpack building
Rather than first building the library and then use Terser "manually" to minify the files, we can utilize a Webpack plugin to combine these steps which helps to simplify the gulpfile.
2024-02-17 18:51:34 +01:00
Tim van der Meij
8487c67cb8
Merge pull request #17684 from timvandermeij/modernize-webserver-pt2
Modernize the webserver code (part 2)
2024-02-17 18:22:51 +01:00
Tim van der Meij
33955980c8
Merge pull request #17685 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-02-17 18:09:51 +01:00
Tim van der Meij
2e6fa797d9
Improve the webserver's constructor
This makes the webserver configurable during instantiation rather than
having to set the parameters afterwards.
2024-02-17 16:22:10 +01:00
Tim van der Meij
985ba77579
Modernize the remainder of the webserver's code and enable the no-var ESLint rule
This commit also moves the content type logic into a helper method to
ever so slightly reduce duplication.
2024-02-17 16:22:10 +01:00
Tim van der Meij
0015eb2431
Modernize the webserver's handler method
This commit converts `var` to `const`/`let`, gives the variables more
readable names and annotates the code to make the flow clearer.
2024-02-17 16:22:10 +01:00
Tim van der Meij
6ef813af01
Extract and modernize the webserver's request checking code
The `handler` method contained this code in two inline functions,
triggered via callbacks, which made the `handler` method big and harder
to read. Moreover, this code relied on variables from the outer scope,
which made it harder to reason about because the inputs and outputs
weren't easily visible.

This commit fixes the problems by extracting the request checking code
into a dedicated private method, and modernizing it to use e.g. `const`/
`let` instead of `var` and using template strings. The logic is now
self-contained in a single method that can be read from top to bottom
without callbacks and with comments annotating each check/section.
2024-02-17 16:22:10 +01:00
Tim van der Meij
43cdc1ca8a
Update translations to the most recent versions 2024-02-17 16:00:18 +01:00
Tim van der Meij
6baa439e15
Update dependencies to the most recent versions 2024-02-17 16:00:18 +01:00
Tim van der Meij
f1a225889b
Merge pull request #17681 from Snuffleupagus/parseMinified-changes
Tweak the `parseMinified` handling slightly in the gulpfile
2024-02-17 15:08:30 +01:00
Tim van der Meij
678c79cc78
Merge pull request #17678 from Snuffleupagus/pr-17637-followup
Remove unneeded `tweakWebpackOutput` usage in the gulpfile (PR 17637 follow-up)
2024-02-17 14:58:24 +01:00
Tim van der Meij
fd5d040073
Merge pull request #17667 from Snuffleupagus/createPrintService-params
Change `PDFPrintServiceFactory.createPrintService` to take a parameter object
2024-02-17 14:54:53 +01:00
Jonas Jenwald
179a3ecee6
Merge pull request #17680 from Snuffleupagus/issue-17679
Add a dummy `beginMarkedContentProps` operator when optional content parsing fails (issue 17679)
2024-02-17 14:29:08 +01:00
Jonas Jenwald
b767e12111
Merge pull request #17676 from Snuffleupagus/app-findBar-optional-chain
Access `PDFViewerApplication.findBar` safely in more spots (PR 15831 follow-up)
2024-02-17 13:54:00 +01:00
Jonas Jenwald
a7bcc81eb1 Add a dummy beginMarkedContentProps operator when optional content parsing fails (issue 17679) 2024-02-17 13:45:16 +01:00
Jonas Jenwald
75a5b2051d Tweak the parseMinified handling slightly in the gulpfile
- Run the minification in "parallel" since that should be a *tiny* bit more efficient.
 - Don't rename the minified files since that seems unnecessary, especially considering that they are only used in the `dist-pre` target where we currently change the name back manually.
2024-02-16 16:54:13 +01:00
Jonas Jenwald
751611f690 Remove unneeded tweakWebpackOutput usage in the gulpfile (PR 17637 follow-up)
After the changes in PR 17637 there's no longer any reason to invoke `tweakWebpackOutput` without an argument, since the `__non_webpack_import__` re-writing was moved into the Babel plugin.
This way we can avoid a (little) bit of unnecessary parsing during building.
2024-02-16 11:42:40 +01:00
Jonas Jenwald
b420bd8b20 Access PDFViewerApplication.findBar safely in more spots (PR 15831 follow-up)
Note that this patch is the result of code-inspection, and the code as written doesn't (currently) cause any bugs in e.g. the GeckoView PDF Viewer.
2024-02-15 11:25:29 +01:00