Commit Graph

15915 Commits

Author SHA1 Message Date
Calixte Denizet
fe93742c8f Use default colors only in forced-colors mode (bug 1778068) 2022-07-07 19:36:03 +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
edc9ad13bf [Editor] Change the cursor to a pen for the Ink editor 2022-07-07 18:23:59 +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
Jonas Jenwald
f3ba02bc00 [editor] Remove the unused name-property from the editorParamsToolbars DOM elements
As far as I can tell, this is completely unused and can thus be removed.
2022-06-29 11:40:54 +02:00
Jonas Jenwald
4a4c6b9851 [editor] Introduce a proper annotationEditorMode option/preference (PR 15075 follow-up)
This replaces the boolean `annotationEditorEnabled` option/preference with a "proper" `annotationEditorMode` one. This way it's not only possible for the user to control if Editing is enabled/disabled, but also which *specific* Editing-mode should become enabled upon PDF document load.

Given that Editing is not enabled/released yet, I cannot imagine that changing the name and type of the option/preference should be an issue.
2022-06-29 11:35:58 +02:00
Jonas Jenwald
f1d4015508
Merge pull request #15039 from calixteman/params
[editor] Add some UI elements in order to set font size & color, and ink thickness & color
2022-06-28 13:25:04 +02:00
Calixte Denizet
1a3ef2a0aa [editor] Add some UI elements in order to set font size & color, and ink thickness & color 2022-06-28 12:05:04 +02:00
Jonas Jenwald
4e025e1f08
Merge pull request #15105 from calixteman/15094
Always flush the current item with MarkedContent stuff when getting text (#15094)
2022-06-25 18:24:33 +02:00
Jonas Jenwald
f208107276
Merge pull request #15104 from timvandermeij/updates
Update translations and dependencies to the most recent versions
2022-06-25 17:50:17 +02:00
Calixte Denizet
3789dab307 Always flush the current item with MarkedContent stuff when getting text (#15094) 2022-06-25 17:19:57 +02:00
Tim van der Meij
38daef065a
Update dependencies to the most recent versions
Note that even though Puppeteer got a major version bump the changelog
doesn't include compatibility changes that are relevant to us; please
see https://github.com/puppeteer/puppeteer/releases.
2022-06-25 16:28:44 +02:00
calixteman
23fcdabb37
Merge pull request #15088 from calixteman/editor_rotation
Support rotating editor layer
2022-06-25 16:18:07 +02:00
Tim van der Meij
f7d69aab15
Update translations to the most recent versions 2022-06-25 15:45:55 +02:00
Tim van der Meij
def1a30d3e
Merge pull request #15103 from timvandermeij/permissions
chore: Set permissions for GitHub actions
2022-06-25 15:39:19 +02:00
neilnaveen
83ecc3f46c
chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2022-06-25 15:32:33 +02:00
Tim van der Meij
8403bafbfc
Merge pull request #15100 from turrisxyz/Dependabot-GitHub-Actions
chore: Included githubactions in the dependabot config
2022-06-25 15:18:11 +02:00
Tim van der Meij
f93ab76fa8
Merge pull request #15099 from Snuffleupagus/layers-rm-id
Remove element `id`s from the layersView in the sidebar
2022-06-25 14:58:18 +02:00
Tim van der Meij
b8a7cf7aed
Merge pull request #15101 from Snuffleupagus/browsertest-use-viewer-css
Use the *built* `components/pdf_viewer.css` file in the reference tests
2022-06-25 14:53:04 +02:00