From ea1102b7f23501010bb4697377cdacc141961497 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 22:02:20 +0000 Subject: [PATCH] Chore(deps): Bump pdfjs-dist from 5.7.284 to 6.0.227 in /src-ui (#13080) Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> Signed-off-by: dependabot[bot] --- src-ui/package.json | 2 +- src-ui/pnpm-lock.yaml | 106 +++++++++--------- .../common/pdf-viewer/pdf-viewer.component.ts | 14 ++- .../common/pdf-viewer/pdf-viewer.types.ts | 2 - .../document-detail.component.html | 1 + .../document-detail.component.spec.ts | 11 +- .../document-detail.component.ts | 10 +- 7 files changed, 74 insertions(+), 72 deletions(-) diff --git a/src-ui/package.json b/src-ui/package.json index 1e261ec95..fbaaf76a4 100644 --- a/src-ui/package.json +++ b/src-ui/package.json @@ -33,7 +33,7 @@ "ngx-device-detector": "^11.0.0", "ngx-ui-tour-ng-bootstrap": "^18.0.0", "normalize-diacritics": "^5.0.0", - "pdfjs-dist": "^5.7.284", + "pdfjs-dist": "^6.0.227", "rxjs": "^7.8.2", "tslib": "^2.8.1", "utif": "^3.1.0", diff --git a/src-ui/pnpm-lock.yaml b/src-ui/pnpm-lock.yaml index 70a8991ea..9a3c1e725 100644 --- a/src-ui/pnpm-lock.yaml +++ b/src-ui/pnpm-lock.yaml @@ -75,8 +75,8 @@ importers: specifier: ^5.0.0 version: 5.0.0 pdfjs-dist: - specifier: ^5.7.284 - version: 5.7.284 + specifier: ^6.0.227 + version: 6.0.227 rxjs: specifier: ^7.8.2 version: 7.8.2 @@ -2367,74 +2367,74 @@ packages: cpu: [x64] os: [win32] - '@napi-rs/canvas-android-arm64@0.1.100': - resolution: {integrity: sha512-hjhCKhntPv9+t4ckHymdx0phYNcVW+GKQR6Lzw2zE+pOVjOplSmtx9nNNknTjbEDLcuLZqA1y8ufKg1XfgftzQ==} + '@napi-rs/canvas-android-arm64@1.0.2': + resolution: {integrity: sha512-IMXKVQod0ol4vt3gmClUfXz4JAgHYESGPCUqmH3lQxBoL0K/2greJaQE1HVBVxWWFKfLc4OLZVdxg7kXVyXv+g==} engines: {node: '>= 10'} cpu: [arm64] os: [android] - '@napi-rs/canvas-darwin-arm64@0.1.100': - resolution: {integrity: sha512-2PcswRaC7Ly645DGt88///zuFDhJxJYdKAs1uU3mfk1atYkXufgcgLfBpk6Tm12nCQBaNt1wpybuPZ4qOhTo8A==} + '@napi-rs/canvas-darwin-arm64@1.0.2': + resolution: {integrity: sha512-Sc8tPi6cF+5lqOzCCKFALJHhDiRwyMzTPYm3bbhdXsOunU0lQO5f05ucyOzN2r55I23Hg5bsjH63uSCvWp3EgQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@napi-rs/canvas-darwin-x64@0.1.100': - resolution: {integrity: sha512-ePNZtj7pNIva/siZMg+HmbeozkIjqUIYdoymH8HaA3qK7LfzFN4WMBM8G6HQ9ZC+H3+Dnn5pqtiXpgLykaPOhw==} + '@napi-rs/canvas-darwin-x64@1.0.2': + resolution: {integrity: sha512-niDXZ9LhKB1zLrUdYB64RHQFDGz9rr0eGx061qtJJU3U20EMMIx28ADF5fVYbhtOgkWQrBjFicfaye1yM0U62A==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@napi-rs/canvas-linux-arm-gnueabihf@0.1.100': - resolution: {integrity: sha512-d5cDB48oWFGU8/XPhUOFAlySgb/VAu7D+s8fi55K1Pcfg8aPplHWqMgibhVLU8ky7Pyg/fuiVLz4Nf3JrSTuUA==} + '@napi-rs/canvas-linux-arm-gnueabihf@1.0.2': + resolution: {integrity: sha512-sgatQL9JxGRH/Amzcvu0P3t8Am3duou74CisfuJ41Dwt8cWy723z/9KZ8LlgmxfypEwEZxSTNFJtU8d281lmhQ==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - '@napi-rs/canvas-linux-arm64-gnu@0.1.100': - resolution: {integrity: sha512-rDxgxRu69RvDlX/bh9o22DxLsGr8EqsNgotL9+RwQE1S0b0cqeatqsw6aW45mukm0B42DIAaAacKaYQ8cqS1nw==} + '@napi-rs/canvas-linux-arm64-gnu@1.0.2': + resolution: {integrity: sha512-dgKuX0peF3xwY6ZF5QxGS4wbfDqpoFAJYXiLSp+guZKARQUKMkRqZSDrXKj7nfrec3UCMzC0PFCPte0ES98AiA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@napi-rs/canvas-linux-arm64-musl@0.1.100': - resolution: {integrity: sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==} + '@napi-rs/canvas-linux-arm64-musl@1.0.2': + resolution: {integrity: sha512-qwROoDIC9upfvDoRLuPn2aNg9CGW1x0Ygr4k2Or+8paA9d0qBLwk87U+g8KQpoOviKoPoiwl97kvBYuYD7qZoA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@napi-rs/canvas-linux-riscv64-gnu@0.1.100': - resolution: {integrity: sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==} + '@napi-rs/canvas-linux-riscv64-gnu@1.0.2': + resolution: {integrity: sha512-fXRjnPihdnbO6qy1QQOgxAonb68A0TCEG7rj1x7v7rxNElsE8EVIKIEUTvyDtU+sthYSbX+8e7g3oZiLGnOmxw==} engines: {node: '>= 10'} cpu: [riscv64] os: [linux] - '@napi-rs/canvas-linux-x64-gnu@0.1.100': - resolution: {integrity: sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==} + '@napi-rs/canvas-linux-x64-gnu@1.0.2': + resolution: {integrity: sha512-nPR97DXhbWIAy7yazF3jc06kEPMqYMLmPzFOVNlwKPfIoSChnI+x7dc0hTLaihz3jxrjL6j4BbA7earxfx4X3g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@napi-rs/canvas-linux-x64-musl@0.1.100': - resolution: {integrity: sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==} + '@napi-rs/canvas-linux-x64-musl@1.0.2': + resolution: {integrity: sha512-l7zZY5+jL5qnBZtDz7CoBtY6p7EkHu422g/0zWwrOrzIwWyWxZFRfZZORY1UG7YApymPLx+UbOkN206xXn/c1Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@napi-rs/canvas-win32-arm64-msvc@0.1.100': - resolution: {integrity: sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==} + '@napi-rs/canvas-win32-arm64-msvc@1.0.2': + resolution: {integrity: sha512-yE0koHCFF4PIbMc2o2SEALhnipz7WBISh5glLvQiomtIoCcW0np3H4Lw93ceJAfJttTTeIIWFbwH84F7EVzjMQ==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@napi-rs/canvas-win32-x64-msvc@0.1.100': - resolution: {integrity: sha512-MyT1j3mHC2+Lu4pBi9mKyMJhtP6U7k7EldY7sj/uS5gJA65gTXt8MefJQXLJo5d/vZbuWmfxzkEUNc/urV3pHA==} + '@napi-rs/canvas-win32-x64-msvc@1.0.2': + resolution: {integrity: sha512-okU8/t2foV6C31n0GtvEMbfD5rOFc70+/6xUNME9Guld29sgSOIGUEDScAWFlcP3k5TYQRl9TNkwJEEjh15w8A==} engines: {node: '>= 10'} cpu: [x64] os: [win32] - '@napi-rs/canvas@0.1.100': - resolution: {integrity: sha512-xglYA6q3XO5P3BNJYxVZ1IV7DLVjp1Py6nwag88YntrS+3vKHyYcMqXVS4ZztJmwz2uGvz1FWhI/4LgbR5uQDA==} + '@napi-rs/canvas@1.0.2': + resolution: {integrity: sha512-EYEqlMYaCbpZDz+IgDH5xp9MTd3ui4dmGqbQYryhMLnSRxrhHKq5KQWHHKxFUcEP4Hp8/BWgvqXocX4j7iSbOQ==} engines: {node: '>= 10'} '@napi-rs/nice-android-arm-eabi@1.1.1': @@ -5731,8 +5731,8 @@ packages: path-to-regexp@8.4.2: resolution: {integrity: sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==} - pdfjs-dist@5.7.284: - resolution: {integrity: sha512-h4EdYQczmGhbOlqc3PPZwxevn7ApdWPbovAuWXOB/DjIyigSnwfy2oze7c6mRcSr9XgLp3eN3EeL4DyySTPMFw==} + pdfjs-dist@6.0.227: + resolution: {integrity: sha512-/P6M4SXw+70waMVLUM7rdRtvo+dEzqE1t6W/zQNvBETo2MaRa5rrvCcAYdfWGiUzadTgM0lJmRApUrW0d9zgKg==} engines: {node: '>=22.13.0 || >=24'} picocolors@1.1.1: @@ -9520,52 +9520,52 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.4': optional: true - '@napi-rs/canvas-android-arm64@0.1.100': + '@napi-rs/canvas-android-arm64@1.0.2': optional: true - '@napi-rs/canvas-darwin-arm64@0.1.100': + '@napi-rs/canvas-darwin-arm64@1.0.2': optional: true - '@napi-rs/canvas-darwin-x64@0.1.100': + '@napi-rs/canvas-darwin-x64@1.0.2': optional: true - '@napi-rs/canvas-linux-arm-gnueabihf@0.1.100': + '@napi-rs/canvas-linux-arm-gnueabihf@1.0.2': optional: true - '@napi-rs/canvas-linux-arm64-gnu@0.1.100': + '@napi-rs/canvas-linux-arm64-gnu@1.0.2': optional: true - '@napi-rs/canvas-linux-arm64-musl@0.1.100': + '@napi-rs/canvas-linux-arm64-musl@1.0.2': optional: true - '@napi-rs/canvas-linux-riscv64-gnu@0.1.100': + '@napi-rs/canvas-linux-riscv64-gnu@1.0.2': optional: true - '@napi-rs/canvas-linux-x64-gnu@0.1.100': + '@napi-rs/canvas-linux-x64-gnu@1.0.2': optional: true - '@napi-rs/canvas-linux-x64-musl@0.1.100': + '@napi-rs/canvas-linux-x64-musl@1.0.2': optional: true - '@napi-rs/canvas-win32-arm64-msvc@0.1.100': + '@napi-rs/canvas-win32-arm64-msvc@1.0.2': optional: true - '@napi-rs/canvas-win32-x64-msvc@0.1.100': + '@napi-rs/canvas-win32-x64-msvc@1.0.2': optional: true - '@napi-rs/canvas@0.1.100': + '@napi-rs/canvas@1.0.2': optionalDependencies: - '@napi-rs/canvas-android-arm64': 0.1.100 - '@napi-rs/canvas-darwin-arm64': 0.1.100 - '@napi-rs/canvas-darwin-x64': 0.1.100 - '@napi-rs/canvas-linux-arm-gnueabihf': 0.1.100 - '@napi-rs/canvas-linux-arm64-gnu': 0.1.100 - '@napi-rs/canvas-linux-arm64-musl': 0.1.100 - '@napi-rs/canvas-linux-riscv64-gnu': 0.1.100 - '@napi-rs/canvas-linux-x64-gnu': 0.1.100 - '@napi-rs/canvas-linux-x64-musl': 0.1.100 - '@napi-rs/canvas-win32-arm64-msvc': 0.1.100 - '@napi-rs/canvas-win32-x64-msvc': 0.1.100 + '@napi-rs/canvas-android-arm64': 1.0.2 + '@napi-rs/canvas-darwin-arm64': 1.0.2 + '@napi-rs/canvas-darwin-x64': 1.0.2 + '@napi-rs/canvas-linux-arm-gnueabihf': 1.0.2 + '@napi-rs/canvas-linux-arm64-gnu': 1.0.2 + '@napi-rs/canvas-linux-arm64-musl': 1.0.2 + '@napi-rs/canvas-linux-riscv64-gnu': 1.0.2 + '@napi-rs/canvas-linux-x64-gnu': 1.0.2 + '@napi-rs/canvas-linux-x64-musl': 1.0.2 + '@napi-rs/canvas-win32-arm64-msvc': 1.0.2 + '@napi-rs/canvas-win32-x64-msvc': 1.0.2 optional: true '@napi-rs/nice-android-arm-eabi@1.1.1': @@ -13229,9 +13229,9 @@ snapshots: path-to-regexp@8.4.2: {} - pdfjs-dist@5.7.284: + pdfjs-dist@6.0.227: optionalDependencies: - '@napi-rs/canvas': 0.1.100 + '@napi-rs/canvas': 1.0.2 picocolors@1.1.1: {} diff --git a/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.ts b/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.ts index 5b3ea514e..54783f9d7 100644 --- a/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.ts +++ b/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.component.ts @@ -27,7 +27,6 @@ import { } from 'pdfjs-dist/web/pdf_viewer.mjs' import { PdfRenderMode, - PdfSource, PdfZoomLevel, PdfZoomScale, PngxPdfDocumentProxy, @@ -43,7 +42,8 @@ export class PngxPdfViewerComponent { private readonly document = inject(DOCUMENT) - @Input() src!: PdfSource + @Input() src!: string + @Input() password?: string @Input() page?: number @Output() pageChange = new EventEmitter() @Input() rotation?: number @@ -93,7 +93,7 @@ export class PngxPdfViewerComponent } ngOnChanges(changes: SimpleChanges): void { - if (changes['src']) { + if (changes['src'] || changes['password']) { this.resetViewerState() if (this.src) { this.loadDocument() @@ -174,8 +174,12 @@ export class PngxPdfViewerComponent 'assets/js/pdf.worker.min.mjs', this.document.baseURI ).toString() - this.loadingTask = getDocument(this.src) - + let initOptions = { + url: this.src, + password: this.password, + withCredentials: true, + } + this.loadingTask = getDocument(initOptions) try { const pdf = await this.loadingTask.promise this.pdf = pdf diff --git a/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.types.ts b/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.types.ts index edce9a7e7..42f413848 100644 --- a/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.types.ts +++ b/src-ui/src/app/components/common/pdf-viewer/pdf-viewer.types.ts @@ -2,8 +2,6 @@ export type PngxPdfDocumentProxy = { numPages: number } -export type PdfSource = string | { url: string; password?: string } - export enum PdfRenderMode { Single = 'single', All = 'all', diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.html index b1b8a35ba..edcda7ce2 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.html +++ b/src-ui/src/app/components/document-detail/document-detail.component.html @@ -473,6 +473,7 @@
{ }) it('should clear pdf source if preview URL is empty', () => { - component.pdfSource = { url: '/preview', password: 'secret' } as any + component.pdfSource = '/preview' + component.pdfPassword = 'secret' component.previewUrl = null ;(component as any).updatePdfSource() - expect(component.pdfSource).toEqual({ url: null, password: undefined }) + expect(component.pdfSource).toEqual(null) + expect(component.pdfPassword).toBeUndefined() }) it('should close incoming update modal if one is open', () => { @@ -1871,9 +1873,8 @@ describe('DocumentDetailComponent', () => { expect(component.thumbUrl).toBe('thumb-version') expect(component.previewText).toBe('version text') expect(component.documentForm.get('content').value).toBe('version-content') - const pdfSource = component.pdfSource as { url: string; password?: string } - expect(pdfSource.url).toBe('preview-version') - expect(pdfSource.password).toBeUndefined() + expect(component.pdfSource).toBe('preview-version') + expect(component.pdfPassword).toBeUndefined() previewSpy.mockReturnValueOnce('preview-error') component.selectVersion(11) diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index 615f30978..a0fee743b 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -115,7 +115,6 @@ import { PDFEditorComponent } from '../common/pdf-editor/pdf-editor.component' import { PngxPdfViewerComponent } from '../common/pdf-viewer/pdf-viewer.component' import { PdfRenderMode, - PdfSource, PdfZoomLevel, PdfZoomScale, PngxPdfDocumentProxy, @@ -242,7 +241,8 @@ export class DocumentDetailComponent title: string titleSubject: Subject = new Subject() previewUrl: string - pdfSource?: PdfSource + pdfSource?: string + pdfPassword?: string thumbUrl: string previewText: string previewLoaded: boolean = false @@ -375,10 +375,8 @@ export class DocumentDetailComponent } private updatePdfSource() { - this.pdfSource = { - url: this.previewUrl, - password: this.password, - } + this.pdfSource = this.previewUrl + this.pdfPassword = this.password } private loadMetadataForSelectedVersion() {