Commit Graph

15930 Commits

Author SHA1 Message Date
Jonas Jenwald
e4a7264564 Update l10n files 2022-07-10 10:45:22 +02:00
Jonas Jenwald
dd10f6397f Update npm packages 2022-07-10 10:43:08 +02:00
Tim van der Meij
220f980e12
Merge pull request #15145 from Snuffleupagus/deprecated-enhanceTextSelection
[api-minor] Deprecate the `enhanceTextSelection` functionality
2022-07-09 12:38:41 +02:00
calixteman
2b6a67c5d0
Merge pull request #15153 from calixteman/1778692
[Annotation] A push button can have no action (bug 1778692)
2022-07-08 21:06:53 +02:00
Calixte Denizet
8f26ba5487 [Annotation] A push button can have no action (bug 1778692) 2022-07-08 15:39:56 +02:00
Jonas Jenwald
4b493c2c33
Merge pull request #15152 from Snuffleupagus/validate-Resources
Ensure that the /Resources-entry is actually a dictionary (issue 15150)
2022-07-08 13:24:47 +02:00
Jonas Jenwald
c2f7942aea Ensure that the /Resources-entry is actually a dictionary (issue 15150)
Prevent issues in *corrupt* PDF documents, if the /Resources-entry is not of the correct and expected type.
2022-07-08 12:43:43 +02:00
Jonas Jenwald
efbd429115
Merge pull request #15151 from calixteman/15149
[Editor] Remove useless and faulty code when destroying the global manager
2022-07-08 11:58:14 +02:00
Calixte Denizet
cec2172225 [Editor] Remove useless and faulty code when destroying the global manager 2022-07-08 11:49:19 +02:00
calixteman
b0a3c9e8cf
Merge pull request #15135 from calixteman/forced_colors
Use default colors only in forced-colors mode (bug 1778068)
2022-07-07 20:30:03 +02:00
calixteman
657edb3892
Merge pull request #15147 from calixteman/editor_size
[Editor] Avoid to resize and redraw the ink canvas when it's useless
2022-07-07 19:49:59 +02:00
Calixte Denizet
fe93742c8f Use default colors only in forced-colors mode (bug 1778068) 2022-07-07 19:36:03 +02:00
Jonas Jenwald
d6a75262d5
Merge pull request #15143 from bernatgy/typescript-compilation-fix
[jsdoc] failing typescript builds - wrong type
2022-07-07 19:27:53 +02:00
calixteman
32d8c55642
Merge pull request #15146 from calixteman/editing_cursor
[Editor] Change the cursor to a pen for the Ink editor
2022-07-07 18:43:41 +02:00
Calixte Denizet
9c4077ebc4 [Editor] Avoid to resize and redraw the ink canvas when it's useless
- and because of rounding errors it led to slightly resize again and again
the ink container;
- when zooming the size is changing but not the ratio, so in this case we
don't need to change the dimension of the container.
2022-07-07 18:39:20 +02:00
Calixte Denizet
edc9ad13bf [Editor] Change the cursor to a pen for the Ink editor 2022-07-07 18:23:59 +02:00
Bernát Gyovai
3d62f09fbd [jsdoc] failing typescript builds - wrong type
`HTMLSectionElement` is not part of the DOM, so the generated typescript definitions contain a non-existing type.

HTML Section elements have to be handled as simple `HTMLElements`.

fixing punctuation and lint problems

[jsdoc] failing typescript builds - wrong type
2022-07-07 17:03:46 +02:00
Jonas Jenwald
815c28da0e [api-minor] Deprecate the enhanceTextSelection functionality 2022-07-07 16:15:31 +02:00
calixteman
403ed07ad9
Merge pull request #15144 from calixteman/editing_delete
[Editor] Allow editors deletion on Backspace or Delete keys
2022-07-07 15:37:06 +02:00
Calixte Denizet
a4329d326c [Editor] Allow editors deletion on Backspace or Delete keys 2022-07-07 15:16:01 +02:00
Jonas Jenwald
7f160d49f9
Merge pull request #15142 from Snuffleupagus/fitCurve
[editor] Use the `fit-curve` package (issue 15004)
2022-07-07 14:03:14 +02:00
Jonas Jenwald
345bb18575 [editor] Use the fit-curve package (issue 15004)
Rather than including all of this external code in the PDF.js repository, we should be using the npm package instead.
Unfortunately this is slightly more complicated than you'd hope, since the `fit-curve` package (which is older) isn't directly compatible with modern JavaScript modules.
In particular, the following cases needed to be considered:
 - For the development viewer (i.e. `gulp server`) and the unit-tests, we thus need to build a fitCurve-bundle that can be directly `import`ed.
 - For the actual PDF.js build-targets, we can slightly reduce the sizes by depending on the "raw" `fit-curve` source-code.
 - For the Node.js unit-tests, the `fit-curve` package can be used as-is.
2022-07-07 10:43:43 +02:00
Jonas Jenwald
bde46632d4
Merge pull request #15130 from calixteman/context_menu
[Editor] Dispatch an event when some global states are changing (bug 1777695)
2022-07-05 22:40:12 +02:00
Calixte Denizet
ec0f9f6dcf [Editor] Dispatch an event when some global states are changing
- this way the context menu in Firefox can take into account what we
  have in the clipboard, if an editor is selected, ...
- when the user will click on a context menu item, an action will be
  triggered, hence this patch adds what is required to handle it;
- some tests will be added in the Firefox' patch.
2022-07-05 22:12:56 +02:00
Jonas Jenwald
45fafb2769
Merge pull request #15133 from Snuffleupagus/issue-14999
Improve text-selection for Type3 fonts with bogus /FontBBox-entries (issue 14999)
2022-07-05 22:00:28 +02:00
Jonas Jenwald
79cfc548fc Improve text-selection for Type3 fonts with bogus /FontBBox-entries (issue 14999)
This extends PR 13461, by also building a fallback bounding box for Type3 fonts that contain a much too small /FontBBox-entry.

*Please note:* While this patch improves things overall, copy-and-pasting still doesn't work perfectly for this document. In particular the lowercase letter "c" cannot be selected/copied, however this can be reproduced in both Adobe Reader and PDFium (in Google Chrome) too, which is caused by a lack of proper /ToUnicode-data in the PDF document.
2022-07-05 14:27:14 +02:00
Jonas Jenwald
a1ac1a61b7
Merge pull request #15124 from Snuffleupagus/private-setDimensions
Call `AnnotationLayer.setDimensions` as part of the `render`/`update`-methods (PR 15036 follow-up)
2022-07-04 14:05:47 +02:00
Jonas Jenwald
552ee9decd Call AnnotationLayer.setDimensions as part of the render/update-methods (PR 15036 follow-up)
Rather than forcing the user to *manually* call `setDimensions`, which is also breaking any existing third-party code, it seems that we can simply let the `AnnotationLayer.{render, update}`-methods handle that internally.

As far as I can tell, based on testing manually in the viewer *and* running the browser-tests, everything still appears to work correctly with this patch.
2022-07-04 12:27:20 +02:00
Jonas Jenwald
ca8b112e8c
Merge pull request #15125 from Snuffleupagus/FileAttachmentAnnotationElement-trigger
Fix the Popup-trigger for `FileAttachmentAnnotationElement` (PR 15036 follow-up)
2022-07-04 11:00:24 +02:00
Jonas Jenwald
fda0a87cb5
Merge pull request #15126 from calixteman/update_l10n_id
[Editor] Update the id for a l10n string
2022-07-04 10:59:26 +02:00
Calixte Denizet
ae2cf7e1e7 [Editor] Update the id for a l10n string 2022-07-04 10:18:42 +02:00
Jonas Jenwald
315f450b01 Fix the Popup-trigger for FileAttachmentAnnotationElement (PR 15036 follow-up)
After the changes in PR 15036, the trigger-element created in `FileAttachmentAnnotationElement.render` is now too small. This can be fixed by using the same approach as in PR 15065, and the patch can be tested using the `annotation-fileattachment.pdf` document in the test-suite.
2022-07-04 09:33:27 +02:00
Jonas Jenwald
03c6febc44
Merge pull request #15121 from Snuffleupagus/loadingBar-cleanup
[api-minor] Further modernize the `ProgressBar` class (PR 14918 follow-up)
2022-07-02 16:46:40 +02:00
Jonas Jenwald
845b7f06f9
Merge pull request #15123 from Snuffleupagus/editor-presentation-disable
[editor] Disable editing while PresentationMode is active
2022-07-02 16:39:38 +02:00
Jonas Jenwald
ff0ff75d22
Merge pull request #15122 from Snuffleupagus/editor-max-width
[editor] Tweak `@media` CSS rules to account for the new toolbar buttons
2022-07-02 16:38:21 +02:00
Jonas Jenwald
37b61f2228 [editor] Disable editing while PresentationMode is active 2022-07-01 16:52:17 +02:00
Jonas Jenwald
84ae9f9c58 [editor] Tweak @media CSS rules to account for the new toolbar buttons 2022-07-01 13:27:13 +02:00
Jonas Jenwald
d9ce17642f [api-minor] Further modernize the ProgressBar class (PR 14918 follow-up)
- Simplify how we look-up the DOM-element, which should also be a tiny bit more efficent.

 - Use private class-fields, rather than property-names prefixed with underscores.

 - Inline the `#updateBar` helper-method directly in the `percent`-setter, since having a separate method doesn't seem necessary in this case.

 - Set the `indeterminate`-class on the ProgressBar DOM-element, to simplify the code.

Finally, also (slightly) re-factors the `PDFViewerApplication.progress`-method to make it a bit smaller.
2022-07-01 10:31:25 +02:00
Jonas Jenwald
13c01b6d4a
Merge pull request #15115 from calixteman/editing_a11y_bis
[Editor] Handle correctly colors when saving a document in HCM
2022-06-30 10:31:22 +02:00
Calixte Denizet
9723c5d377 [Editor] Handle correctly colors when saving a document in HCM
- for example in Dusk theme (Windows 11), black appears to be white, so
  the user will draw something in white. But if they want to print or
  save the used color must be black.
- fix a bug with the color input which only accepts hex string colors;
- adjust outline color of the selected/hovered editors in HCM.
2022-06-30 09:56:34 +02:00
calixteman
a520fc9d9a
Merge pull request #15118 from calixteman/editor_selection
[Editor] Allow to select a freetext editor when in ink mode
2022-06-29 19:49:13 +02:00
Calixte Denizet
a694e360a4 [Editor] Allow to select a freetext editor when in ink mode
- and when in ink mode, change the toolbar active button when
  a freetext edited.
2022-06-29 19:35:40 +02:00
calixteman
2e83fa8e2d
Merge pull request #15117 from calixteman/freetext_resize
[Editor] Set the freetext editor dimensions when the changing the font size
2022-06-29 16:38:15 +02:00
Jonas Jenwald
8c15f5a639
Merge pull request #15116 from Snuffleupagus/pr-15113-followup
Fix the `annotationEditorMode`-compatibility for older browsers (PR 15113 follow-up)
2022-06-29 16:25:33 +02:00
Jonas Jenwald
63f2d0bb64 Fix the annotationEditorMode-compatibility for older browsers (PR 15113 follow-up) 2022-06-29 16:16:48 +02:00
Calixte Denizet
bc5b6cd08c [Editor] Set the freetext editor dimensions when the changing the font size 2022-06-29 16:11:11 +02:00
calixteman
ce63663282
Merge pull request #15111 from calixteman/1776914
Add a visible page border in HCM (bug 1776914)
2022-06-29 14:43:56 +02:00
Jonas Jenwald
e08b079691
Merge pull request #15113 from Snuffleupagus/annotationEditorMode-pref
[editor] Introduce a proper `annotationEditorMode` option/preference (PR 15075 follow-up)
2022-06-29 13:39:55 +02:00
Calixte Denizet
3e751679ba Add a visible page border in HCM (bug 1776914) 2022-06-29 11:52:19 +02:00
Jonas Jenwald
44a75c2a0f [editor] Slightly shorten the en-US freetext_default_content placeholder text
Now that it's possible to change the font-size, this placeholder string feels a little bit long (especially for larger font-sizes).

Given that Editing is not enabled/released yet, I hope that it should be fine to update this without changing the l10n-id.
2022-06-29 11:40:54 +02:00