Commit Graph

16054 Commits

Author SHA1 Message Date
Jonas Jenwald
f6db7975c5 Enable the ESLint prefer-spread rule
Note that in a couple of spots the argument could be `undefined` and there we simply disable the rule instead.

Please refer to https://eslint.org/docs/latest/rules/prefer-spread
2022-08-06 10:17:00 +02:00
Jonas Jenwald
d6d4653d80
Merge pull request #15275 from calixteman/textbox
[Editor] Remove some a11y properties only useful when a FreeText editor is edited
2022-08-05 09:36:56 +02:00
Calixte Denizet
fce83f8656 [Editor] Remove some a11y properties only useful when a FreeText editor is edited 2022-08-04 15:28:25 +02:00
calixteman
e88c90e898
Merge pull request #15274 from calixteman/missing_annotation
[Editor] A pasted FreeText editor was missing when printing/saving
2022-08-04 13:10:23 +02:00
Calixte Denizet
3c8d8f0d02 [Editor] A pasted FreeText editor was missing when printing/saving
When a FreeText editor is pasted then it hasn't an editorDiv yet when added
to the layer, hence it's empty.
So this patch just move the call to addToAnnotationStorage to ensure we've
what we need.
2022-08-04 13:00:45 +02:00
calixteman
b985eaa98c
Merge pull request #15267 from calixteman/freetext_a11y
[Annotation] Add a div containing the text of a FreeText annotation (bug 1780375)
2022-08-04 11:49:29 +02:00
Calixte Denizet
31155740c3 [Annotation] Add a div containing the text of a FreeText annotation (bug 1780375)
An annotation doesn't have to be in the text flow, hence it's likely a bad idea
to insert its text in the text layer. But the text must be visible from a screen
reader point of view so it must somewhere in the DOM.
So with this patch, the text from a FreeText annotation is extracted and added in
a div in its HTML counterpart, and with the patch #15237 the text should be visible
and positioned relatively to the text flow.
2022-08-04 11:14:05 +02:00
Jonas Jenwald
5ad8bbe8cb
Merge pull request #15271 from calixteman/null_field
Skip unknown fields when calculating a value in using AFSimple_Calculate
2022-08-04 10:11:46 +02:00
Calixte Denizet
6916fabd51 Skip unknown fields when calculating a value in using AFSimple_Calculate 2022-08-03 23:40:09 +02:00
calixteman
8bad06f158
Merge pull request #15268 from calixteman/bug1777693
Fix a typo in firefox print service (bug 1777693)
2022-08-03 18:02:18 +02:00
Calixte Denizet
6c9e538f56 Fix a typo in firefox print service (bug 1777693) 2022-08-03 17:25:01 +02:00
Jonas Jenwald
4f6cd05a53
Merge pull request #15264 from calixteman/editing_telemetry
[Editor] Add some telemetry to know how often the editing features are used (bug 1782254)
2022-08-03 11:28:08 +02:00
Calixte Denizet
94f57e5dd7 [Editor] Add some telemetry to know how often the editing features are used (bug 1782254) 2022-08-03 09:54:27 +02:00
Jonas Jenwald
159f853e06
Merge pull request #15263 from Snuffleupagus/issue-15262
Always set a border-radius for RadioButton annotations (issue 15262)
2022-08-02 15:35:36 +02:00
Jonas Jenwald
899fc29eef Always set a border-radius for RadioButton annotations (issue 15262) 2022-08-02 13:58:20 +02:00
Jonas Jenwald
803e7af595
Merge pull request #15253 from Snuffleupagus/update-Safari-compat
[api-minor] Update the minimum supported Safari version
2022-07-31 18:33:47 +02:00
Jonas Jenwald
ad11cea33c [api-minor] Update the minimum supported Safari version
The Ink-editor uses `ResizeObserver`, which is supported in all reasonably modern browsers; see https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#browser_compatibility

With the exception of Safari, `ResizeObserver` is thus available in all of the browsers that the PDF.js library currently support. Rather than trying to e.g. add a polyfill, let's just bump the compatibility (slightly) to Safari 13.1 instead; see https://en.wikipedia.org/wiki/Safari_version_history#Safari_13
2022-07-31 17:40:26 +02:00
Tim van der Meij
f9c593d66c
Merge pull request #15251 from Snuffleupagus/thumbnail-setImage-small
Ignore too small page-canvases in `PDFThumbnailView.setImage`
2022-07-31 14:29:15 +02:00
Tim van der Meij
7798252285
Merge pull request #15252 from timvandermeij/bump
Bump versions in `pdfjs.config`
2022-07-31 14:22:21 +02:00
Tim van der Meij
91e6830ec4
Bump versions in pdfjs.config 2022-07-31 14:16:06 +02:00
Jonas Jenwald
5b50a50559 Ignore too small page-canvases in PDFThumbnailView.setImage
It doesn't make sense to use a page-canvas that's *smaller* than the resulting thumbnail, since that causes the image to be upscaled which results in a blurry thumbnail. Note that this doesn't normally happen, unless a very small zoom-level is used in the viewer.
2022-07-31 13:59:56 +02:00
Tim van der Meij
b8aa9c6221
Merge pull request #15246 from Snuffleupagus/thumbnail-setImage-improvements
[api-minor] Improve `thumbnail` handling in documents that contain interactive forms
2022-07-31 11:42:55 +02:00
Tim van der Meij
77b3489987
Merge pull request #15247 from Snuffleupagus/css-more-cleanup
Misc. small CSS cleanup
2022-07-31 11:23:16 +02:00
Jonas Jenwald
37d77f29f7
Merge pull request #15248 from Snuffleupagus/update-l10n
Update l10n files
2022-07-31 10:25:40 +02:00
Jonas Jenwald
635bd12050 Update l10n files 2022-07-31 10:23:00 +02:00
Jonas Jenwald
7543a91086 [Firefox] Remove a couple of webkit CSS rules related to editing
Thanks to the CSS preprocessor, we can get rid of a couple of unnecessary CSS rules in the Firefox PDF Viewer.
2022-07-30 20:07:44 +02:00
Jonas Jenwald
4a38949886 Remove unnecessary color CSS property
This property is first of all unused, and secondly it contained a static value which means that it'd not have worked correctly in light/dark themes.
2022-07-30 19:53:34 +02:00
Jonas Jenwald
0c31320c12 [api-minor] Improve thumbnail handling in documents that contain interactive forms
To improve performance of the sidebar we use the page-canvases to generate the thumbnails whenever possible, since that avoids unnecessary re-rendering when the sidebar is open. This works generally well, however there's an old problem in PDF documents that contain interactive forms (when those are enabled): Note how the thumbnails become partially (or fully) blank, since those Annotations are not included in the OperatorList.[1]

We obviously want to keep using the `PDFThumbnailView.setImage`-method for most documents, however we need a way to skip it only for those pages that contain interactive forms.
As it turns out it's unfortunately not all that simple to tell, after the fact, from looking only at the OperatorList that some Annotations were skipped. While it might have been possible to try and infer that in the viewer, it'd not have been pretty considering that at the time when rendering finishes the annotationLayer has not yet been built.
The overall simplest solution that I could come up with, was instead to include a *summary* of the interactive form-state when doing the final "flushing" of the OperatorList and expose that information in the API.

---
[1] Some examples from our test-suite: `annotation-tx2.pdf` where the thumbnail is completely blank, and `bug1737260.pdf` where the thumbnail is missing the "buttons" found on the page.
2022-07-30 16:53:32 +02:00
Tim van der Meij
c7b71a3376
Merge pull request #15215 from Snuffleupagus/optional-content-initial
[api-minor] Improve how we disable `PDFThumbnailView.setImage` for documents with Optional Content
2022-07-30 12:04:23 +02:00
Jonas Jenwald
ee8fab929c
Merge pull request #15244 from calixteman/15241
[Editor] Add an editor in the annotation storage only when it's non-empty (#15241)
2022-07-29 20:58:53 +02:00
Calixte Denizet
e819834505 [Editor] Add an editor in the annotation storage only when it's non-empty (#15241) 2022-07-29 18:00:52 +02:00
Jonas Jenwald
cfdf940c05
Merge pull request #15242 from calixteman/ink_avoid_move
[Editor] Avoid to slightly move ink editor when undoing/redoing
2022-07-29 17:17:40 +02:00
Jonas Jenwald
6bb800a7e1
Merge pull request #15240 from Snuffleupagus/web-factory-object
[api-minor] Change the various factories, in the viewer, to accept Objects
2022-07-29 17:00:20 +02:00
Calixte Denizet
9a464b70c1 [Editor] Avoid to slightly move ink editor when undoing/redoing 2022-07-29 16:53:03 +02:00
Jonas Jenwald
2e059727a9 [api-minor] Change the various factories, in the viewer, to accept Objects
Currently all of these factories take a bunch of (randomly ordered) parameters, which first of all doesn't look that nice in the `PDFPageView`-class when some parameters are optional.
Furthermore, it also makes deprecation/removal of any existing parameter a *potentially* breaking change.
Finally, using an Object will provide a small amount of "documentation" at the call-site which isn't really the case with a bunch of "regular" parameters.

Note that all of the `viewer component` examples still work as-is with this patch, which is why I don't believe that we necessarily have to deprecate in the usual fashion.
2022-07-29 16:31:04 +02:00
Jonas Jenwald
80689c6444
Merge pull request #15238 from calixteman/bug1782186
Fix wrong order of arguments when calling the CipherTransform ctor (bug 1782186)
2022-07-29 13:22:25 +02:00
Calixte Denizet
d092a85b6c Fix wrong order of arguments when calling the CipherTransform ctor (bug 1782186) 2022-07-29 12:46:45 +02:00
Jonas Jenwald
0c5afe9269
Merge pull request #15232 from calixteman/15229
Fix text selection with hdpi screens (#15229)
2022-07-29 09:50:49 +02:00
Calixte Denizet
51c8e2f3ab Fix text selection with hdpi screens (#15229) 2022-07-28 19:44:13 +02:00
Jonas Jenwald
d7cc47d73a
Merge pull request #15235 from Snuffleupagus/annot-isUsingOwnCanvas
Ensure that the `isUsingOwnCanvas`-parameter is consistently included in operatorLists (PR 14247 follow-up)
2022-07-28 17:04:45 +02:00
Jonas Jenwald
de02d30b00
Merge pull request #15236 from Snuffleupagus/editor-test-opacity
Set `opacity` in the reference tests (PR 15219 follow-up)
2022-07-28 15:56:26 +02:00
Jonas Jenwald
2cad5cf45b Set opacity in the reference tests (PR 15219 follow-up)
Without these changes in the manifest, the affected test-cases fail to render correctly.
2022-07-28 14:35:09 +02:00
Jonas Jenwald
2fb083f3e2 Ensure that the isUsingOwnCanvas-parameter is consistently included in operatorLists (PR 14247 follow-up)
Currently some `OPS.beginAnnotation` arguments will contain a `Number` value for the `isUsingOwnCanvas`-parameter, or in some cases an `undefined` value, which is inconsistent from an API perspective.
2022-07-28 13:37:37 +02:00
Jonas Jenwald
b06d190451
Merge pull request #15217 from calixteman/15216
[Editor] Simplify the strings for the tools in the UI
2022-07-28 10:15:59 +02:00
Calixte Denizet
a85359b031 [Editor] Simplify the strings for the tools in the UI 2022-07-28 10:02:59 +02:00
calixteman
e515a88faf
Merge pull request #15234 from calixteman/reset_undo_queue
[Editor] Reset the queue when a command is added after having undone all the commands
2022-07-28 09:43:10 +02:00
Calixte Denizet
3c10c71a91 [Editor] Reset the queue when a command is added after having undone all the commands 2022-07-27 23:23:28 +02:00
calixteman
085dd0a6c5
Merge pull request #15233 from calixteman/lock_undo
[Editor] Avoid to add unexpected commands in the undo/redo queue when undoing/redoing (bug 1781790)
2022-07-27 20:10:26 +02:00
Calixte Denizet
759116f4c5 [Editor] Avoid to add unexpected commands in the undo/redo queue when undoing/redoing (bug 1781790)
We can undo/redo a command which will at some point add a command in the queue: typically
it can happening when redoing an addition.
So the idea is to lock the queue when undoing/redoing.
2022-07-27 19:12:06 +02:00
calixteman
89d1892959
Merge pull request #15219 from calixteman/editor_opacity
[Editor] Add the possibility to change line opacity in Ink editor
2022-07-27 18:57:37 +02:00