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

19225 commits

Author SHA1 Message Date
Tim van der Meij
70b44251ed
Fix the "must check that charLimit is correctly set" scripting integration test
This integration test fails intermittently because we're not (correctly)
awaiting the character limit increase sandbox action.

For the first increase an attempt was made to handle this, but it doesn't
work correctly because the text in the field is `abcdefghijklmnopq` and
it's not be truncated until the sandbox action is completed, so because
we didn't await that we would could pass the `value !== "abcdefgh"` check
because `abcdefghijklmnopq !== abcdefgh` is true. For the second increase
we didn't have a check in place.

This commit fixes the issues by using the `waitForSandboxTrip` and
`waitForSelector` helper functions to make sure that we can only proceed
if the sandbox action is completed and the DOM element is updated.
2024-07-05 21:15:44 +02:00
Tim van der Meij
ccb141e211
Merge pull request #18393 from Snuffleupagus/mustBeViewedWhenEditing-params
Check the relevant parameters inside of the `mustBeViewedWhenEditing` method
2024-07-05 15:33:45 +02:00
Tim van der Meij
cf9dfbc084
Merge pull request #18394 from Snuffleupagus/rm-annotation-getOperatorList-renderForms
Remove the `renderForms` parameter from the Annotation `getOperatorList` methods
2024-07-05 15:30:52 +02:00
Jonas Jenwald
38528d1116 Remove the renderForms parameter from the Annotation getOperatorList methods
The `renderForms` parameter pre-dates the introduction of the general `intent` parameter, which means that we're now effectively passing the same state twice to these `getOperatorList` methods.
2024-07-05 12:25:18 +02:00
Jonas Jenwald
5f744904ac Check the relevant parameters inside of the mustBeViewedWhenEditing method
Similar to the `mustBeViewed` method, we can check the relevant parameters within the `mustBeViewedWhenEditing` method itself since that (in my opinion) slightly helps readability of the code in the `src/core/document.js` file.
2024-07-05 11:38:55 +02:00
Tim van der Meij
9065ee465b
Merge pull request #18387 from Snuffleupagus/RenderingIntentFlag-IS_EDITING
Move the internal API/Worker `isEditing`-state into `RenderingIntentFlag`
2024-07-04 23:42:44 +02:00
Jonas Jenwald
a4ffc1066c Move the internal API/Worker isEditing-state into RenderingIntentFlag
In *hindsight* this seems like a better idea, since it avoids the need to manually pass `isEditing` around as a boolean value.
Note that `RenderingIntentFlag` is *internal* functionality, not exposed in the official API, which means that it can be extended and modified as necessary.
2024-07-04 23:34:30 +02:00
calixteman
8c5b0191cf
Merge pull request #18389 from calixteman/remove_pref_stamp
[Editor] Remove the option enableStamp
2024-07-04 23:06:42 +02:00
Calixte Denizet
74cbfbd09f [Editor] Remove the option enableStamp 2024-07-04 22:01:35 +02:00
Tim van der Meij
790470c1aa
Merge pull request #18383 from calixteman/fix_print_test
Fix the integration tests related to printing
2024-07-04 11:34:06 +02:00
Tim van der Meij
03a0500dcf
Merge pull request #18374 from calixteman/test_editor_visible
Make sure the editor is visible before getting its rect
2024-07-04 11:14:27 +02:00
Calixte Denizet
53ddfd139f Fix the integration tests related to printing 2024-07-04 11:12:31 +02:00
Tim van der Meij
944f3acecd
Merge pull request #18367 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-07-04 11:12:25 +02:00
Jonas Jenwald
396231b90c
Merge pull request #15209 from Snuffleupagus/createDefaultPrefsFile
[Firefox] Generate a PDF.js default-prefs file that can be used directly in mozilla-central (bug 1905864)
2024-07-04 11:06:48 +02:00
calixteman
617f513806
Merge pull request #18369 from calixteman/bug1905623
Use vertical variant of a char when it's in a missing vertical font (bug 1905623)
2024-07-04 09:45:43 +02:00
Calixte Denizet
fd6d0be50f Make sure the editor is visible before getting its rect 2024-07-03 09:57:12 +02:00
Calixte Denizet
832fc93aa4 Use vertical variant of a char when it's in a missing vertical font (bug 1905623) 2024-07-03 09:46:54 +02:00
Tim van der Meij
4e8a015a78
Update translations to the most recent versions 2024-07-02 18:29:19 +02:00
Tim van der Meij
bb54e7e64c
Update dependencies to the most recent versions 2024-07-02 18:20:49 +02:00
Tim van der Meij
ccad2f889a
Merge pull request #18349 from Snuffleupagus/rm-renderTextLayer
[api-minor] Remove the deprecated `renderTextLayer` and `updateTextLayer` functions (PR 18104 follow-up)
2024-07-02 17:23:54 +02:00
calixteman
59620d3748
Merge pull request #18366 from calixteman/clean_switch_annot
[Editor] Make sure everything is cleaned up when we switch to annotation editor mode
2024-07-02 17:13:57 +02:00
Calixte Denizet
68175323f1 [Editor] Make sure everything is cleaned up when we switch to annotation editor mode 2024-07-02 16:54:19 +02:00
calixteman
4f1d4c6bd0
Merge pull request #18365 from calixteman/bump_4.5
Bump library version to 4.5
2024-07-02 15:50:36 +02:00
calixteman
c154b1da23
Update pdfjs.config
Co-authored-by: Jonas Jenwald <jonas.jenwald@gmail.com>
2024-07-02 15:46:05 +02:00
Calixte Denizet
2060944bda Bump library version to 4.5 2024-07-02 15:08:43 +02:00
calixteman
bdcc4a0feb
Merge pull request #18134 from calixteman/hide_annotations
[api-minor][Editor] When switching to editing mode, redraw pages containing editable annotations (bug 1883884)
2024-07-02 15:05:42 +02:00
Jonas Jenwald
033623c8d6 Update the year in the license_header files 2024-07-02 14:34:59 +02:00
Jonas Jenwald
ecb39a75ed [Firefox] Generate a PDF.js default-prefs file that can be used directly in mozilla-central (bug 1905864) 2024-07-02 14:12:23 +02:00
Calixte Denizet
64635f3b35 [api-minor][Editor] When switching to editing mode, redraw pages containing editable annotations
Right now, editable annotations are using their own canvas when they're drawn, but
it induces several issues:
 - if the annotation has to be composed with the page then the canvas must be correctly
   composed with its parent. That means we should move the canvas under canvasWrapper
   and we should extract composing info from the drawing instructions...
   Currently it's the case with highlight annotations.
 - we use some extra memory for those canvas even if the user will never edit them, which
   the case for example when opening a pdf in Fenix.

So with this patch, all the editable annotations are drawn on the canvas. When the
user switches to editing mode, then the pages with some editable annotations are redrawn but
without them: they'll be replaced by their counterpart in the annotation editor layer.
2024-07-02 14:11:40 +02:00
calixteman
75129fd61a
Merge pull request #18361 from calixteman/issue18360.pdf
[Editor] Take into account the page translation when computing the quadpoints when saving an highlight
2024-07-02 11:21:06 +02:00
Calixte Denizet
576aaf7cc1 [Editor] Take into account the page translation when computing the quadpoints when saving an highlight
It fixes #18360.
2024-07-02 10:12:26 +02:00
Tim van der Meij
c280c520ee
Merge pull request #18359 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-07-01 20:14:50 +02:00
Tim van der Meij
2f4d5d25a8
Bump the stable version in pdfjs.config 2024-07-01 20:10:35 +02:00
Tim van der Meij
19fbc89985
Merge pull request #18358 from timvandermeij/npm-url
Fix the repository URL in the `package.json` file for `pdfjs-dist`
2024-07-01 19:55:07 +02:00
Tim van der Meij
bf5dd7ea10
Fix the repository URL in the package.json file for pdfjs-dist
For provenance, enabled in PR #18352, to work the repository URL in
`package.json` is required to match the repository URL of the GitHub
Actions invocation. This should fix the following error we encountered
publishing a new release today:

```
npm error 422 Unprocessable Entity - PUT https://registry.npmjs.org/pdfjs-dist - Error verifying sigstore provenance bundle: Failed to validate repository information: package.json: "repository.url" is "git+https://github.com/mozilla/pdfjs-dist.git", expected to match "https://github.com/mozilla/pdf.js" from provenance
```
2024-07-01 19:32:03 +02:00
Tim van der Meij
7114796430
Merge pull request #18352 from wojtekmaj/provenance
Generate provenance statements on npm publish
2024-07-01 17:42:16 +02:00
Tim van der Meij
067ec20092
Merge pull request #18356 from calixteman/no_newtabpage
Disable new tab page stuff in Firefox when running tests
2024-07-01 16:47:39 +02:00
Calixte Denizet
efb45a705e Disable new tab page stuff in Firefox when running tests
It should help to have such a garbage in the logs:
```
console.warn: TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource.
JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
```
2024-07-01 16:20:07 +02:00
Wojciech Maj
aaa65bf3fc
Generate provenance statements on npm publish
This PR adds [Provenance statements](https://docs.npmjs.com/generating-provenance-statements) on `npm publish`, increasing supply-chain security.
2024-07-01 15:37:25 +02:00
Tim van der Meij
8556a26390
Merge pull request #18353 from wojtekmaj/npm-ci
Use `npm ci`, not `npm install`, on CI
2024-07-01 15:25:02 +02:00
Wojciech Maj
6b449d8884
Use npm ci, not npm install, on CI
This PR switches from `npm install` to `npm ci` on CI. This enables some additional checks to ensure repo integrity when using CI/CD.

Read more: https://docs.npmjs.com/cli/v10/commands/npm-ci
2024-07-01 13:46:23 +02:00
calixteman
b5d554e1b4
Merge pull request #18350 from timvandermeij/github-actions-release
Introduce a GitHub Actions workflow for publishing a release and fix `npm publish` warnings about the `package.json` format
2024-07-01 10:02:41 +02:00
Tim van der Meij
dddb74d5e4
Fix npm publish warnings about the package.json format
This commit removes the following warnings from the `npm publish` output:

```
npm warn publish npm auto-corrected some errors in your package.json when publishing.  Please run "npm pkg fix" to address these errors.
npm warn publish errors corrected:
npm warn publish Removed invalid "scripts"
npm warn publish "repository.url" was normalized to "git+https://github.com/mozilla/pdfjs-dist.git"
```

For the "scripts" section it turns out that if the package doesn't have
any scripts it's expected to explicitly set it to an empty object; refer
to https://github.com/npm/cli/issues/6918 and
https://github.com/denoland/dnt/pull/414.
2024-06-30 16:03:52 +02:00
Tim van der Meij
a5f2b9faeb
Introduce a GitHub Actions workflow for publishing a release
This commit migrates this functionality away from the bots. Note that
the NPM token must be configured as a repository secret before this
workflow can execute.

The following resources are relevant for this patch:

- Publishing packages to the NPM registry:
  https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
- Creating secrets for a repository:
  https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository
2024-06-30 16:03:52 +02:00
Jonas Jenwald
f3d177e3e4 [api-minor] Remove the deprecated renderTextLayer and updateTextLayer functions (PR 18104 follow-up) 2024-06-30 15:16:00 +02:00
Tim van der Meij
40b0c848ee
Merge pull request #18346 from Snuffleupagus/webserver-dev-note
Add a comment about `test/webserver.mjs` being development-only code
2024-06-30 13:45:30 +02:00
Jonas Jenwald
046e281e20 Add a comment about test/webserver.mjs being development-only code 2024-06-29 12:05:28 +02:00
calixteman
fb3a4e4f5c
Merge pull request #18345 from calixteman/issue18305
Take into account PageOpen and PageClose actions which are present in some fields
2024-06-28 22:43:23 +02:00
Calixte Denizet
dacf8bb0d1 Take into account PageOpen and PageClose actions which are present in some fields 2024-06-28 22:21:03 +02:00
calixteman
8709202021
Merge pull request #18341 from calixteman/issue17779_not_in_talos
Ignore test issue17779.pdf in talos because it times out
2024-06-28 18:58:08 +02:00