From 89538afaefd85c4d8c690180e31bde347cf53692 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 9 Jan 2025 09:30:11 +0100 Subject: [PATCH 01/14] [MNT-24538] Bump PDFjs viewer version and use annotation mode disabled --- .../pdf-viewer/pdf-viewer.component.spec.ts | 9 + .../pdf-viewer/pdf-viewer.component.ts | 5 +- package-lock.json | 323 ++++++++++++++---- package.json | 2 +- 4 files changed, 278 insertions(+), 61 deletions(-) diff --git a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts index 831bacc746b..8b453be2b38 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts @@ -159,6 +159,15 @@ describe('Test PdfViewer component', () => { document.body.removeChild(elementUrlTestComponent); }); + it('should init the viewer with annotation mode disabled', (done) => { + fixtureUrlTestComponent.detectChanges(); + + fixtureUrlTestComponent.whenStable().then(() => { + expect(componentUrlTestComponent.pdfViewerComponent.pdfViewer.annotationMode).toBe(6); + done(); + }); + }, 55000); + it('should Total number of pages be loaded', (done) => { fixtureUrlTestComponent.detectChanges(); diff --git a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts index 7bfc29b2ec6..11e2fc21de4 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts @@ -37,7 +37,7 @@ import { MatDialog } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { TranslateModule } from '@ngx-translate/core'; -import { OnProgressParameters, PDFDocumentLoadingTask, PDFDocumentProxy } from 'pdfjs-dist'; +import { AnnotationMode, OnProgressParameters, PDFDocumentLoadingTask, PDFDocumentProxy } from 'pdfjs-dist'; import { Subject } from 'rxjs'; import { catchError, delay } from 'rxjs/operators'; import { AppConfigService } from '../../../app-config'; @@ -246,7 +246,8 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { container, viewer, renderingQueue: this.renderingQueueServices, - eventBus: this.eventBus + eventBus: this.eventBus, + annotationMode: AnnotationMode.DISABLE }); // cspell: disable-next diff --git a/package-lock.json b/package-lock.json index ca29f266511..4d0749b8cfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "material-icons": "^1.13.12", "minimatch-browser": "1.0.0", "ng2-charts": "^4.1.1", - "pdfjs-dist": "3.3.122", + "pdfjs-dist": "^4.10.38", "raphael": "2.3.0", "rxjs": "7.8.1", "subscriptions-transport-ws": "^0.11.0", @@ -4801,8 +4801,10 @@ }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", + "dev": true, "license": "BSD-3-Clause", "optional": true, + "peer": true, "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -4820,8 +4822,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/are-we-there-yet": { "version": "2.0.0", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -4832,8 +4836,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { "version": "3.0.2", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", @@ -4851,8 +4857,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { "version": "5.0.0", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "abbrev": "1" }, @@ -4865,8 +4873,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/npmlog": { "version": "5.0.1", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", @@ -4876,8 +4886,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { "version": "3.0.2", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "glob": "^7.1.3" }, @@ -4890,13 +4902,17 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/signal-exit": { "version": "3.0.7", + "dev": true, "license": "ISC", - "optional": true + "optional": true, + "peer": true }, "node_modules/@mapbox/node-pre-gyp/node_modules/strip-ansi": { "version": "6.0.1", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5635,6 +5651,188 @@ "react": ">=16" } }, + "node_modules/@napi-rs/canvas": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.65.tgz", + "integrity": "sha512-YcFhXQcp+b2d38zFOJNbpyPHnIL7KAEkhJQ+UeeKI5IpE9B8Cpf/M6RiHPQXSsSqnYbrfFylnW49dyh2oeSblQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@napi-rs/canvas-android-arm64": "0.1.65", + "@napi-rs/canvas-darwin-arm64": "0.1.65", + "@napi-rs/canvas-darwin-x64": "0.1.65", + "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.65", + "@napi-rs/canvas-linux-arm64-gnu": "0.1.65", + "@napi-rs/canvas-linux-arm64-musl": "0.1.65", + "@napi-rs/canvas-linux-riscv64-gnu": "0.1.65", + "@napi-rs/canvas-linux-x64-gnu": "0.1.65", + "@napi-rs/canvas-linux-x64-musl": "0.1.65", + "@napi-rs/canvas-win32-x64-msvc": "0.1.65" + } + }, + "node_modules/@napi-rs/canvas-android-arm64": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.65.tgz", + "integrity": "sha512-ZYwqFYEKcT5Zr8lbiaJNJj/poLaeK2TncolY914r+gD2TJNeP7ZqvE7A2SX/1C9MB4E3DQEwm3YhL3WEf0x3MQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-darwin-arm64": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.65.tgz", + "integrity": "sha512-Pg1pfiJEyDIsX+V0QaJPRWvXbw5zmWAk3bivFCvt/5pwZb37/sT6E/RqPHT9NnqpDyKW6SriwY9ypjljysUA1Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-darwin-x64": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.65.tgz", + "integrity": "sha512-3Tr+/HjdJN7Z/VKIcsxV2DvDIibZCExgfYTgljCkUSFuoI7iNkOE6Dc1Q6j212EB9PeO8KmfrViBqHYT6IwWkA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.65.tgz", + "integrity": "sha512-3KP+dYObH7CVkZMZWwk1WX9jRjL+EKdQtD43H8MOI+illf+dwqLlecdQ4d9bQRIxELKJ8dyPWY4fOp/Ngufrdg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm64-gnu": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.65.tgz", + "integrity": "sha512-Ka3StKz7Dq7kjTF3nNJCq43UN/VlANS7qGE3dWkn1d+tQNsCRy/wRmyt1TUFzIjRqcTFMQNRbgYq84+53UBA0A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm64-musl": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.65.tgz", + "integrity": "sha512-O4xMASm2JrmqYoiDyxVWi+z5C14H+oVEag2rZ5iIA67dhWqYZB+iO7wCFpBYRj31JPBR29FOsu6X9zL+DwBFdw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-riscv64-gnu": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.65.tgz", + "integrity": "sha512-dblWDaA59ZU8bPbkfM+riSke7sFbNZ70LEevUdI5rgiFEUzYUQlU34gSBzemTACj5rCWt1BYeu0GfkLSjNMBSw==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-x64-gnu": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.65.tgz", + "integrity": "sha512-wsp+atutw13OJXGU3DDkdngtBDoEg01IuK5xMe0L6VFPV8maGkh17CXze078OD5QJOc6kFyw3DDscMLOPF8+oA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-x64-musl": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.65.tgz", + "integrity": "sha512-odX+nN+IozWzhdj31INcHz3Iy9+EckNw+VqsZcaUxZOTu7/3FmktRNI6aC1qe5minZNv1m05YOS1FVf7fvmjlA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-win32-x64-msvc": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.65.tgz", + "integrity": "sha512-RZQX3luWnlNWgdMnLMQ1hyfQraeAn9lnxWWVCHuUM4tAWEV8UDdeb7cMwmJW7eyt8kAosmjeHt3cylQMHOxGFg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@napi-rs/wasm-runtime": { "version": "0.2.4", "dev": true, @@ -12743,7 +12941,7 @@ }, "node_modules/abbrev": { "version": "1.1.1", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/accepts": { @@ -12874,7 +13072,7 @@ }, "node_modules/agent-base": { "version": "6.0.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "debug": "4" @@ -13061,7 +13259,7 @@ }, "node_modules/aproba": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/are-docs-informative": { @@ -14220,9 +14418,11 @@ }, "node_modules/canvas": { "version": "2.11.2", + "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", "nan": "^2.17.0", @@ -14361,7 +14561,7 @@ }, "node_modules/chownr": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "engines": { "node": ">=10" @@ -14642,7 +14842,7 @@ }, "node_modules/color-support": { "version": "1.1.3", - "devOptional": true, + "dev": true, "license": "ISC", "bin": { "color-support": "bin.js" @@ -14843,7 +15043,7 @@ }, "node_modules/console-control-strings": { "version": "1.1.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/constants-browserify": { @@ -15559,8 +15759,10 @@ }, "node_modules/decompress-response": { "version": "4.2.1", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "mimic-response": "^2.0.0" }, @@ -15798,7 +16000,7 @@ }, "node_modules/delegates": { "version": "1.0.0", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/depd": { @@ -15835,8 +16037,10 @@ }, "node_modules/detect-libc": { "version": "2.0.3", + "dev": true, "license": "Apache-2.0", "optional": true, + "peer": true, "engines": { "node": ">=8" } @@ -16142,7 +16346,7 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/emojis-list": { @@ -19119,7 +19323,7 @@ }, "node_modules/has-unicode": { "version": "2.0.1", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/hasown": { @@ -19460,7 +19664,7 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "agent-base": "6", @@ -22888,7 +23092,7 @@ }, "node_modules/make-dir": { "version": "3.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -22902,7 +23106,7 @@ }, "node_modules/make-dir/node_modules/semver": { "version": "6.3.1", - "devOptional": true, + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -23343,8 +23547,10 @@ }, "node_modules/mimic-response": { "version": "2.1.0", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "engines": { "node": ">=8" }, @@ -23571,7 +23777,7 @@ }, "node_modules/minizlib": { "version": "2.1.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "minipass": "^3.0.0", @@ -23583,7 +23789,7 @@ }, "node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -23594,12 +23800,12 @@ }, "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/mkdirp": { "version": "1.0.4", - "devOptional": true, + "dev": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -23793,8 +23999,10 @@ }, "node_modules/nan": { "version": "2.22.0", + "dev": true, "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/nanoid": { "version": "3.3.8", @@ -24011,8 +24219,10 @@ }, "node_modules/node-fetch": { "version": "2.7.0", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -24030,18 +24240,24 @@ }, "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", + "dev": true, "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", + "dev": true, "license": "BSD-2-Clause", - "optional": true + "optional": true, + "peer": true }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -25656,13 +25872,6 @@ "node": ">=8" } }, - "node_modules/path2d-polyfill": { - "version": "2.0.1", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "2.0.0", "license": "MIT", @@ -25671,14 +25880,15 @@ } }, "node_modules/pdfjs-dist": { - "version": "3.3.122", + "version": "4.10.38", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz", + "integrity": "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ==", "license": "Apache-2.0", - "dependencies": { - "path2d-polyfill": "^2.0.1", - "web-streams-polyfill": "^3.2.1" + "engines": { + "node": ">=20" }, "optionalDependencies": { - "canvas": "^2.11.0" + "@napi-rs/canvas": "^0.1.65" } }, "node_modules/performance-now": { @@ -27488,7 +27698,7 @@ }, "node_modules/readable-stream": { "version": "3.6.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -28271,7 +28481,7 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -28507,7 +28717,7 @@ }, "node_modules/semver": { "version": "7.5.4", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" @@ -28521,7 +28731,7 @@ }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -28532,7 +28742,7 @@ }, "node_modules/semver/node_modules/yallist": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/send": { @@ -28684,7 +28894,7 @@ }, "node_modules/set-blocking": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/set-function-length": { @@ -29036,6 +29246,7 @@ }, "node_modules/simple-concat": { "version": "1.0.1", + "dev": true, "funding": [ { "type": "github", @@ -29051,12 +29262,15 @@ } ], "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/simple-get": { "version": "3.1.1", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "decompress-response": "^4.2.0", "once": "^1.3.1", @@ -29582,7 +29796,7 @@ }, "node_modules/string_decoder": { "version": "1.3.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" @@ -29621,7 +29835,7 @@ }, "node_modules/string-width": { "version": "4.2.3", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -29667,7 +29881,7 @@ }, "node_modules/string-width/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -29675,7 +29889,7 @@ }, "node_modules/string-width/node_modules/strip-ansi": { "version": "6.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -30467,7 +30681,7 @@ }, "node_modules/tar": { "version": "6.2.1", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "chownr": "^2.0.0", @@ -30498,7 +30712,7 @@ }, "node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "minipass": "^3.0.0" @@ -30509,7 +30723,7 @@ }, "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -30520,7 +30734,7 @@ }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "engines": { "node": ">=8" @@ -30528,7 +30742,7 @@ }, "node_modules/tar/node_modules/yallist": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/telejson": { @@ -31603,7 +31817,7 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/util-extend": { @@ -32255,13 +32469,6 @@ "defaults": "^1.0.3" } }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/webdriver-js-extender": { "version": "2.1.0", "dev": true, @@ -32926,7 +33133,7 @@ }, "node_modules/wide-align": { "version": "1.1.5", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" diff --git a/package.json b/package.json index 6c1be59667c..67f7f20c9ef 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "material-icons": "^1.13.12", "minimatch-browser": "1.0.0", "ng2-charts": "^4.1.1", - "pdfjs-dist": "3.3.122", + "pdfjs-dist": "^4.10.38", "raphael": "2.3.0", "rxjs": "7.8.1", "subscriptions-transport-ws": "^0.11.0", From df74a08416519012ba59c6d186914047be1adbbe Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 9 Jan 2025 09:30:54 +0100 Subject: [PATCH 02/14] [MNT-24538] Proper test params --- .../viewer/components/pdf-viewer/pdf-viewer.component.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts index 8b453be2b38..177455b356a 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts @@ -28,6 +28,7 @@ import { CoreTestingModule } from '../../../testing'; import { RenderingQueueServices } from '../../services/rendering-queue.services'; import { PdfThumbListComponent } from '../pdf-viewer-thumbnails/pdf-viewer-thumbnails.component'; import { PdfViewerComponent } from './pdf-viewer.component'; +import { AnnotationMode } from 'pdfjs-dist'; declare const pdfjsLib: any; @@ -163,7 +164,7 @@ describe('Test PdfViewer component', () => { fixtureUrlTestComponent.detectChanges(); fixtureUrlTestComponent.whenStable().then(() => { - expect(componentUrlTestComponent.pdfViewerComponent.pdfViewer.annotationMode).toBe(6); + expect(componentUrlTestComponent.pdfViewerComponent.pdfViewer.annotationMode).toBe(AnnotationMode.DISABLE); done(); }); }, 55000); From 46a53104dc70c19f5bc003d54e3e093052838cab Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 9 Jan 2025 09:34:27 +0100 Subject: [PATCH 03/14] [ci:force] From 124e8669cf6163d4d6305a98d8115f66ae0cc1c5 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 9 Jan 2025 14:50:22 +0100 Subject: [PATCH 04/14] [MNT-24538] Use different pdfjs version --- lib/core/package.json | 2 +- package-lock.json | 319 ++++++++---------------------------------- package.json | 2 +- 3 files changed, 57 insertions(+), 266 deletions(-) diff --git a/lib/core/package.json b/lib/core/package.json index 5521d308f24..cf33095d631 100644 --- a/lib/core/package.json +++ b/lib/core/package.json @@ -41,7 +41,7 @@ "@alfresco/js-api": ">=8.0.0-alpha.7-0", "@alfresco/adf-extensions": ">=7.0.0-alpha.7-0", "minimatch-browser": "1.0.0", - "pdfjs-dist": "3.3.122", + "pdfjs-dist": "3.11.174", "ts-morph": "^20.0.0" }, "keywords": [ diff --git a/package-lock.json b/package-lock.json index 4d0749b8cfe..0263a6b4a04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "material-icons": "^1.13.12", "minimatch-browser": "1.0.0", "ng2-charts": "^4.1.1", - "pdfjs-dist": "^4.10.38", + "pdfjs-dist": "3.11.174", "raphael": "2.3.0", "rxjs": "7.8.1", "subscriptions-transport-ws": "^0.11.0", @@ -4801,10 +4801,8 @@ }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", - "dev": true, "license": "BSD-3-Clause", "optional": true, - "peer": true, "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -4822,10 +4820,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/are-we-there-yet": { "version": "2.0.0", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -4836,10 +4832,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { "version": "3.0.2", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", @@ -4857,10 +4851,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { "version": "5.0.0", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "abbrev": "1" }, @@ -4873,10 +4865,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/npmlog": { "version": "5.0.1", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", @@ -4886,10 +4876,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { "version": "3.0.2", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "glob": "^7.1.3" }, @@ -4902,17 +4890,13 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/signal-exit": { "version": "3.0.7", - "dev": true, "license": "ISC", - "optional": true, - "peer": true + "optional": true }, "node_modules/@mapbox/node-pre-gyp/node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5651,188 +5635,6 @@ "react": ">=16" } }, - "node_modules/@napi-rs/canvas": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.65.tgz", - "integrity": "sha512-YcFhXQcp+b2d38zFOJNbpyPHnIL7KAEkhJQ+UeeKI5IpE9B8Cpf/M6RiHPQXSsSqnYbrfFylnW49dyh2oeSblQ==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 10" - }, - "optionalDependencies": { - "@napi-rs/canvas-android-arm64": "0.1.65", - "@napi-rs/canvas-darwin-arm64": "0.1.65", - "@napi-rs/canvas-darwin-x64": "0.1.65", - "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.65", - "@napi-rs/canvas-linux-arm64-gnu": "0.1.65", - "@napi-rs/canvas-linux-arm64-musl": "0.1.65", - "@napi-rs/canvas-linux-riscv64-gnu": "0.1.65", - "@napi-rs/canvas-linux-x64-gnu": "0.1.65", - "@napi-rs/canvas-linux-x64-musl": "0.1.65", - "@napi-rs/canvas-win32-x64-msvc": "0.1.65" - } - }, - "node_modules/@napi-rs/canvas-android-arm64": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.65.tgz", - "integrity": "sha512-ZYwqFYEKcT5Zr8lbiaJNJj/poLaeK2TncolY914r+gD2TJNeP7ZqvE7A2SX/1C9MB4E3DQEwm3YhL3WEf0x3MQ==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-darwin-arm64": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.65.tgz", - "integrity": "sha512-Pg1pfiJEyDIsX+V0QaJPRWvXbw5zmWAk3bivFCvt/5pwZb37/sT6E/RqPHT9NnqpDyKW6SriwY9ypjljysUA1Q==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-darwin-x64": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.65.tgz", - "integrity": "sha512-3Tr+/HjdJN7Z/VKIcsxV2DvDIibZCExgfYTgljCkUSFuoI7iNkOE6Dc1Q6j212EB9PeO8KmfrViBqHYT6IwWkA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.65.tgz", - "integrity": "sha512-3KP+dYObH7CVkZMZWwk1WX9jRjL+EKdQtD43H8MOI+illf+dwqLlecdQ4d9bQRIxELKJ8dyPWY4fOp/Ngufrdg==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-arm64-gnu": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.65.tgz", - "integrity": "sha512-Ka3StKz7Dq7kjTF3nNJCq43UN/VlANS7qGE3dWkn1d+tQNsCRy/wRmyt1TUFzIjRqcTFMQNRbgYq84+53UBA0A==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-arm64-musl": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.65.tgz", - "integrity": "sha512-O4xMASm2JrmqYoiDyxVWi+z5C14H+oVEag2rZ5iIA67dhWqYZB+iO7wCFpBYRj31JPBR29FOsu6X9zL+DwBFdw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-riscv64-gnu": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.65.tgz", - "integrity": "sha512-dblWDaA59ZU8bPbkfM+riSke7sFbNZ70LEevUdI5rgiFEUzYUQlU34gSBzemTACj5rCWt1BYeu0GfkLSjNMBSw==", - "cpu": [ - "riscv64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-x64-gnu": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.65.tgz", - "integrity": "sha512-wsp+atutw13OJXGU3DDkdngtBDoEg01IuK5xMe0L6VFPV8maGkh17CXze078OD5QJOc6kFyw3DDscMLOPF8+oA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-x64-musl": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.65.tgz", - "integrity": "sha512-odX+nN+IozWzhdj31INcHz3Iy9+EckNw+VqsZcaUxZOTu7/3FmktRNI6aC1qe5minZNv1m05YOS1FVf7fvmjlA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-win32-x64-msvc": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.65.tgz", - "integrity": "sha512-RZQX3luWnlNWgdMnLMQ1hyfQraeAn9lnxWWVCHuUM4tAWEV8UDdeb7cMwmJW7eyt8kAosmjeHt3cylQMHOxGFg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, "node_modules/@napi-rs/wasm-runtime": { "version": "0.2.4", "dev": true, @@ -12941,7 +12743,7 @@ }, "node_modules/abbrev": { "version": "1.1.1", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/accepts": { @@ -13072,7 +12874,7 @@ }, "node_modules/agent-base": { "version": "6.0.2", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "debug": "4" @@ -13259,7 +13061,7 @@ }, "node_modules/aproba": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/are-docs-informative": { @@ -14418,11 +14220,9 @@ }, "node_modules/canvas": { "version": "2.11.2", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", "nan": "^2.17.0", @@ -14561,7 +14361,7 @@ }, "node_modules/chownr": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "ISC", "engines": { "node": ">=10" @@ -14842,7 +14642,7 @@ }, "node_modules/color-support": { "version": "1.1.3", - "dev": true, + "devOptional": true, "license": "ISC", "bin": { "color-support": "bin.js" @@ -15043,7 +14843,7 @@ }, "node_modules/console-control-strings": { "version": "1.1.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/constants-browserify": { @@ -15759,10 +15559,8 @@ }, "node_modules/decompress-response": { "version": "4.2.1", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "mimic-response": "^2.0.0" }, @@ -16000,7 +15798,7 @@ }, "node_modules/delegates": { "version": "1.0.0", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/depd": { @@ -16037,10 +15835,8 @@ }, "node_modules/detect-libc": { "version": "2.0.3", - "dev": true, "license": "Apache-2.0", "optional": true, - "peer": true, "engines": { "node": ">=8" } @@ -16346,7 +16142,7 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/emojis-list": { @@ -19323,7 +19119,7 @@ }, "node_modules/has-unicode": { "version": "2.0.1", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/hasown": { @@ -19664,7 +19460,7 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "agent-base": "6", @@ -23092,7 +22888,7 @@ }, "node_modules/make-dir": { "version": "3.1.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -23106,7 +22902,7 @@ }, "node_modules/make-dir/node_modules/semver": { "version": "6.3.1", - "dev": true, + "devOptional": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -23547,10 +23343,8 @@ }, "node_modules/mimic-response": { "version": "2.1.0", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=8" }, @@ -23777,7 +23571,7 @@ }, "node_modules/minizlib": { "version": "2.1.2", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "minipass": "^3.0.0", @@ -23789,7 +23583,7 @@ }, "node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -23800,12 +23594,12 @@ }, "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/mkdirp": { "version": "1.0.4", - "dev": true, + "devOptional": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -23999,10 +23793,8 @@ }, "node_modules/nan": { "version": "2.22.0", - "dev": true, "license": "MIT", - "optional": true, - "peer": true + "optional": true }, "node_modules/nanoid": { "version": "3.3.8", @@ -24219,10 +24011,8 @@ }, "node_modules/node-fetch": { "version": "2.7.0", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -24240,24 +24030,18 @@ }, "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", - "dev": true, "license": "MIT", - "optional": true, - "peer": true + "optional": true }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", - "dev": true, "license": "BSD-2-Clause", - "optional": true, - "peer": true + "optional": true }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -25872,6 +25656,16 @@ "node": ">=8" } }, + "node_modules/path2d-polyfill": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", + "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pathval": { "version": "2.0.0", "license": "MIT", @@ -25880,15 +25674,16 @@ } }, "node_modules/pdfjs-dist": { - "version": "4.10.38", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz", - "integrity": "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ==", + "version": "3.11.174", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", + "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", "license": "Apache-2.0", "engines": { - "node": ">=20" + "node": ">=18" }, "optionalDependencies": { - "@napi-rs/canvas": "^0.1.65" + "canvas": "^2.11.2", + "path2d-polyfill": "^2.0.1" } }, "node_modules/performance-now": { @@ -27698,7 +27493,7 @@ }, "node_modules/readable-stream": { "version": "3.6.2", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -28481,7 +28276,7 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "dev": true, + "devOptional": true, "funding": [ { "type": "github", @@ -28717,7 +28512,7 @@ }, "node_modules/semver": { "version": "7.5.4", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" @@ -28731,7 +28526,7 @@ }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -28742,7 +28537,7 @@ }, "node_modules/semver/node_modules/yallist": { "version": "4.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/send": { @@ -28894,7 +28689,7 @@ }, "node_modules/set-blocking": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/set-function-length": { @@ -29246,7 +29041,6 @@ }, "node_modules/simple-concat": { "version": "1.0.1", - "dev": true, "funding": [ { "type": "github", @@ -29262,15 +29056,12 @@ } ], "license": "MIT", - "optional": true, - "peer": true + "optional": true }, "node_modules/simple-get": { "version": "3.1.1", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "decompress-response": "^4.2.0", "once": "^1.3.1", @@ -29796,7 +29587,7 @@ }, "node_modules/string_decoder": { "version": "1.3.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" @@ -29835,7 +29626,7 @@ }, "node_modules/string-width": { "version": "4.2.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -29881,7 +29672,7 @@ }, "node_modules/string-width/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -29889,7 +29680,7 @@ }, "node_modules/string-width/node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -30681,7 +30472,7 @@ }, "node_modules/tar": { "version": "6.2.1", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "chownr": "^2.0.0", @@ -30712,7 +30503,7 @@ }, "node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "minipass": "^3.0.0" @@ -30723,7 +30514,7 @@ }, "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -30734,7 +30525,7 @@ }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", - "dev": true, + "devOptional": true, "license": "ISC", "engines": { "node": ">=8" @@ -30742,7 +30533,7 @@ }, "node_modules/tar/node_modules/yallist": { "version": "4.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/telejson": { @@ -31817,7 +31608,7 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/util-extend": { @@ -33133,7 +32924,7 @@ }, "node_modules/wide-align": { "version": "1.1.5", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" diff --git a/package.json b/package.json index 67f7f20c9ef..fb3e9722f70 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "material-icons": "^1.13.12", "minimatch-browser": "1.0.0", "ng2-charts": "^4.1.1", - "pdfjs-dist": "^4.10.38", + "pdfjs-dist": "3.11.174", "raphael": "2.3.0", "rxjs": "7.8.1", "subscriptions-transport-ws": "^0.11.0", From ba45ff46ef65cfad6d3170827ffde7892a568c58 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 9 Jan 2025 14:52:20 +0100 Subject: [PATCH 05/14] [ci:force] From d5380aa9231bf12e34f93f801d60c8f8dbb71bbb Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 9 Jan 2025 15:20:33 +0100 Subject: [PATCH 06/14] [MNT-24538][ci:force] Use proper legacy paths --- lib/content-services/karma.conf.js | 30 +-- lib/content-services/src/test.ts | 2 +- lib/core/karma.conf.js | 52 ++-- lib/core/package.json | 2 +- lib/process-services-cloud/karma.conf.js | 18 +- lib/process-services/karma.conf.js | 7 +- package-lock.json | 328 ++++++++++++++++++----- package.json | 3 +- 8 files changed, 317 insertions(+), 125 deletions(-) diff --git a/lib/content-services/karma.conf.js b/lib/content-services/karma.conf.js index ef92f5fcf84..456177f012e 100644 --- a/lib/content-services/karma.conf.js +++ b/lib/content-services/karma.conf.js @@ -1,5 +1,6 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +/* eslint-env es6 */ const { join } = require('path'); const { constants } = require('karma'); @@ -8,25 +9,27 @@ module.exports = function (config) { basePath: '../../', files: [ - {pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false}, - {pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false}, - {pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false}, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs.map', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs.map', included: true, watched: false, type: 'module' }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: false }, - {pattern: 'lib/content-services/src/lib/i18n/**/en.json', included: false, served: true, watched: false}, + { pattern: 'lib/content-services/src/lib/i18n/**/en.json', included: false, served: true, watched: false }, { pattern: 'lib/content-services/src/lib/assets/images/**/*.svg', included: false, served: true, watched: false }, - {pattern: 'lib/core/src/lib/assets/**/*.svg', included: false, served: true, watched: false}, - {pattern: 'lib/core/src/lib/i18n/**/en.json', included: false, served: true, watched: false}, - {pattern: 'lib/content-services/**/*.ts', included: false, served: true, watched: false}, - {pattern: 'lib/config/app.config.json', included: false, served: true, watched: false} + { pattern: 'lib/core/src/lib/assets/**/*.svg', included: false, served: true, watched: false }, + { pattern: 'lib/core/src/lib/i18n/**/en.json', included: false, served: true, watched: false }, + { pattern: 'lib/content-services/**/*.ts', included: false, served: true, watched: false }, + { pattern: 'lib/config/app.config.json', included: false, served: true, watched: false } ], frameworks: ['jasmine-ajax', 'jasmine', '@angular-devkit/build-angular'], @@ -38,7 +41,7 @@ module.exports = function (config) { '/assets/adf-content-services/i18n/en.json': '/base/lib/content-services/src/lib/i18n/en.json', '/assets/adf-core/i18n/en.json': '/base/lib/core/src/lib/i18n/en.json', '/assets/adf-core/i18n/en-GB.json': '/base/lib/core/src/lib/i18n/en.json', - '/app.config.json': '/base/lib/config/app.config.json', + '/app.config.json': '/base/lib/config/app.config.json' }, plugins: [ @@ -58,7 +61,7 @@ module.exports = function (config) { }, jasmineHtmlReporter: { - suppressAll: true, // removes the duplicated traces + suppressAll: true // removes the duplicated traces }, coverageReporter: { @@ -78,12 +81,7 @@ module.exports = function (config) { customLaunchers: { ChromeHeadless: { base: 'Chrome', - flags: [ - '--no-sandbox', - '--headless', - '--disable-gpu', - '--remote-debugging-port=9222' - ] + flags: ['--no-sandbox', '--headless', '--disable-gpu', '--remote-debugging-port=9222'] } }, diff --git a/lib/content-services/src/test.ts b/lib/content-services/src/test.ts index b0b86723886..f8fc6a555bb 100644 --- a/lib/content-services/src/test.ts +++ b/lib/content-services/src/test.ts @@ -26,4 +26,4 @@ getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDyn }); declare const pdfjsLib: any; -pdfjsLib.GlobalWorkerOptions.workerSrc = 'base/pdfjs-dist/build/pdf.worker.min.js'; +pdfjsLib.GlobalWorkerOptions.workerSrc = 'base/pdfjs-dist/legacy/build/pdf.worker.min.mjs'; diff --git a/lib/core/karma.conf.js b/lib/core/karma.conf.js index 77cc29ff0f1..0569c67efd2 100644 --- a/lib/core/karma.conf.js +++ b/lib/core/karma.conf.js @@ -1,5 +1,6 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +/* eslint-env es6 */ const { join } = require('path'); const { constants } = require('karma'); @@ -8,23 +9,25 @@ module.exports = function (config) { basePath: '../../', files: [ - {pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false}, - {pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false, served: true}, - {pattern: 'node_modules/pdfjs-dist/build/pdf.worker.min.js', included: true, watched: false, served: true}, - {pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false}, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, served: true, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs', included: true, watched: false, served: true, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs.map', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs.map', included: true, watched: false, type: 'module' }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: false }, - {pattern: 'lib/core/src/lib/i18n/**/en.json', included: false, served: true, watched: false}, - {pattern: 'lib/core/**/*.ts', included: false, served: true, watched: false}, - {pattern: 'lib/core/src/lib/assets/**/*.svg', included: false, served: true, watched: false}, - {pattern: 'lib/core/src/lib/assets/**/*.png', included: false, served: true, watched: false}, - {pattern: 'lib/config/app.config.json', included: false, served: true, watched: false}, - {pattern: 'lib/core/src/lib/viewer/assets/fake-test-file.pdf', included: false, served: true, watched: false}, - {pattern: 'lib/core/src/lib/viewer/assets/fake-test-file.txt', included: false, served: true, watched: false}, - {pattern: 'lib/core/src/lib/viewer/assets/fake-test-video.mp4', included: false, served: true, watched: false}, + { pattern: 'lib/core/src/lib/i18n/**/en.json', included: false, served: true, watched: false }, + { pattern: 'lib/core/**/*.ts', included: false, served: true, watched: false }, + { pattern: 'lib/core/src/lib/assets/**/*.svg', included: false, served: true, watched: false }, + { pattern: 'lib/core/src/lib/assets/**/*.png', included: false, served: true, watched: false }, + { pattern: 'lib/config/app.config.json', included: false, served: true, watched: false }, + { pattern: 'lib/core/src/lib/viewer/assets/fake-test-file.pdf', included: false, served: true, watched: false }, + { pattern: 'lib/core/src/lib/viewer/assets/fake-test-file.txt', included: false, served: true, watched: false }, + { pattern: 'lib/core/src/lib/viewer/assets/fake-test-video.mp4', included: false, served: true, watched: false }, { pattern: 'lib/core//viewer/assets/fake-test-password-file.pdf', included: false, @@ -36,21 +39,21 @@ module.exports = function (config) { frameworks: ['jasmine-ajax', 'jasmine', '@angular-devkit/build-angular'], proxies: { - '/pdf.worker.min.js' :'/base/node_modules/pdfjs-dist/build/pdf.worker.min.js', - '/pdf.worker.js' :'/base/node_modules/pdfjs-dist/build/pdf.worker.js', - '/fake-url-file.png' :'/base/lib/core/src/lib/assets/images/logo.png', - '/logo.png' :'/base/lib/core/src/lib/assets/images/logo.png', - '/alfresco-logo.svg' :'/base/lib/core/src/lib/assets/images/alfresco-logo.svg', + '/pdf.worker.min.js': '/base/node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs', + '/pdf.worker.js': '/base/node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', + '/fake-url-file.png': '/base/lib/core/src/lib/assets/images/logo.png', + '/logo.png': '/base/lib/core/src/lib/assets/images/logo.png', + '/alfresco-logo.svg': '/base/lib/core/src/lib/assets/images/alfresco-logo.svg', '/assets/images/': '/base/lib/core/src/lib/assets/images/', '/assets/images/ecm-background.png': '/base/lib/core/src/lib/assets/images/ecm-background.png', '/assets/images/bpm-background.png': '/base/lib/core/src/lib/assets/images/bpm-background.png', '/content.bin': '/base/lib/core/src/lib/viewer/assets/fake-test-file.pdf', - '/base/assets/' :'/base/lib/core/src/lib/assets/', + '/base/assets/': '/base/lib/core/src/lib/assets/', '/assets/adf-core/i18n/en.json': '/base/lib/core/src/lib/i18n/en.json', '/assets/adf-core/i18n/en-GB.json': '/base/lib/core/src/lib/i18n/en.json', '/assets/adf-core/i18n/en-US.json': '/base/lib/core/src/lib/i18n/en.json', - '/fake-content-img' : '/base/lib/core/src/lib/assets/images/logo.png', - '/fake-content-img.bin' : '/base/lib/core/src/lib/assets/images/logo.png', + '/fake-content-img': '/base/lib/core/src/lib/assets/images/logo.png', + '/fake-content-img.bin': '/base/lib/core/src/lib/assets/images/logo.png', '/fake-test-file.pdf': '/base/lib/core/src/lib/viewer/assets/fake-test-file.pdf', '/fake-content-pdf': '/base/lib/core/src/lib/viewer/assets/fake-test-file.pdf', '/fake-content-pdf.bin': '/base/lib/core/src/lib/viewer/assets/fake-test-file.pdf', @@ -77,7 +80,7 @@ module.exports = function (config) { } }, jasmineHtmlReporter: { - suppressAll: true, // removes the duplicated traces + suppressAll: true // removes the duplicated traces }, coverageReporter: { @@ -97,12 +100,7 @@ module.exports = function (config) { customLaunchers: { ChromeHeadless: { base: 'Chrome', - flags: [ - '--no-sandbox', - '--headless', - '--disable-gpu', - '--remote-debugging-port=9222' - ] + flags: ['--no-sandbox', '--headless', '--disable-gpu', '--remote-debugging-port=9222'] } }, diff --git a/lib/core/package.json b/lib/core/package.json index cf33095d631..cb6e89d70e0 100644 --- a/lib/core/package.json +++ b/lib/core/package.json @@ -41,7 +41,7 @@ "@alfresco/js-api": ">=8.0.0-alpha.7-0", "@alfresco/adf-extensions": ">=7.0.0-alpha.7-0", "minimatch-browser": "1.0.0", - "pdfjs-dist": "3.11.174", + "pdfjs-dist": "4.10.38", "ts-morph": "^20.0.0" }, "keywords": [ diff --git a/lib/process-services-cloud/karma.conf.js b/lib/process-services-cloud/karma.conf.js index f6b9daa61b0..d9773e5b791 100644 --- a/lib/process-services-cloud/karma.conf.js +++ b/lib/process-services-cloud/karma.conf.js @@ -1,5 +1,6 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +/* eslint-env es6 */ const { join } = require('path'); const { constants } = require('karma'); @@ -7,9 +8,9 @@ module.exports = function (config) { config.set({ basePath: '../../', files: [ - { pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false }, - { pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false }, - { pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, @@ -32,7 +33,7 @@ module.exports = function (config) { '/assets/adf-core/i18n/en-GB.json': '/base/lib/core/src/lib/i18n/en.json', '/assets/adf-process-services-cloud/i18n/en.json': '/base/lib/process-services-cloud/lib/i18n/en.json', '/assets/adf-process-services-cloud/i18n/en-GB.json': '/base/lib/process-services-cloud/lib/i18n/en.json', - '/app.config.json': '/base/lib/config/app.config.json', + '/app.config.json': '/base/lib/config/app.config.json' }, plugins: [ require('karma-jasmine-ajax'), @@ -50,7 +51,7 @@ module.exports = function (config) { } }, jasmineHtmlReporter: { - suppressAll: true, // removes the duplicated traces + suppressAll: true // removes the duplicated traces }, coverageReporter: { @@ -70,12 +71,7 @@ module.exports = function (config) { customLaunchers: { ChromeHeadless: { base: 'Chrome', - flags: [ - '--no-sandbox', - '--headless', - '--disable-gpu', - '--remote-debugging-port=9222' - ] + flags: ['--no-sandbox', '--headless', '--disable-gpu', '--remote-debugging-port=9222'] } }, diff --git a/lib/process-services/karma.conf.js b/lib/process-services/karma.conf.js index 09409b4a5db..c0eae969e07 100644 --- a/lib/process-services/karma.conf.js +++ b/lib/process-services/karma.conf.js @@ -1,5 +1,6 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +/* eslint-env es6 */ const { join } = require('path'); const { constants } = require('karma'); @@ -7,9 +8,9 @@ module.exports = function (config) { config.set({ basePath: '../../', files: [ - { pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false }, - { pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false }, - { pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, diff --git a/package-lock.json b/package-lock.json index 0263a6b4a04..32d06d1d2f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "material-icons": "^1.13.12", "minimatch-browser": "1.0.0", "ng2-charts": "^4.1.1", - "pdfjs-dist": "3.11.174", + "pdfjs-dist": "4.10.38", "raphael": "2.3.0", "rxjs": "7.8.1", "subscriptions-transport-ws": "^0.11.0", @@ -90,7 +90,6 @@ "@types/minimatch": "^3.0.3", "@types/mocha": "^10.0.6", "@types/node": "20.16.1", - "@types/pdfjs-dist": "^2.10.378", "@types/shelljs": "^0.8.15", "@types/superagent": "^4.1.22", "@typescript-eslint/eslint-plugin": "5.59.8", @@ -4801,8 +4800,10 @@ }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", + "dev": true, "license": "BSD-3-Clause", "optional": true, + "peer": true, "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -4820,8 +4821,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/are-we-there-yet": { "version": "2.0.0", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -4832,8 +4835,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { "version": "3.0.2", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", @@ -4851,8 +4856,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { "version": "5.0.0", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "abbrev": "1" }, @@ -4865,8 +4872,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/npmlog": { "version": "5.0.1", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", @@ -4876,8 +4885,10 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { "version": "3.0.2", + "dev": true, "license": "ISC", "optional": true, + "peer": true, "dependencies": { "glob": "^7.1.3" }, @@ -4890,13 +4901,17 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/signal-exit": { "version": "3.0.7", + "dev": true, "license": "ISC", - "optional": true + "optional": true, + "peer": true }, "node_modules/@mapbox/node-pre-gyp/node_modules/strip-ansi": { "version": "6.0.1", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5635,6 +5650,188 @@ "react": ">=16" } }, + "node_modules/@napi-rs/canvas": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.65.tgz", + "integrity": "sha512-YcFhXQcp+b2d38zFOJNbpyPHnIL7KAEkhJQ+UeeKI5IpE9B8Cpf/M6RiHPQXSsSqnYbrfFylnW49dyh2oeSblQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@napi-rs/canvas-android-arm64": "0.1.65", + "@napi-rs/canvas-darwin-arm64": "0.1.65", + "@napi-rs/canvas-darwin-x64": "0.1.65", + "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.65", + "@napi-rs/canvas-linux-arm64-gnu": "0.1.65", + "@napi-rs/canvas-linux-arm64-musl": "0.1.65", + "@napi-rs/canvas-linux-riscv64-gnu": "0.1.65", + "@napi-rs/canvas-linux-x64-gnu": "0.1.65", + "@napi-rs/canvas-linux-x64-musl": "0.1.65", + "@napi-rs/canvas-win32-x64-msvc": "0.1.65" + } + }, + "node_modules/@napi-rs/canvas-android-arm64": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.65.tgz", + "integrity": "sha512-ZYwqFYEKcT5Zr8lbiaJNJj/poLaeK2TncolY914r+gD2TJNeP7ZqvE7A2SX/1C9MB4E3DQEwm3YhL3WEf0x3MQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-darwin-arm64": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.65.tgz", + "integrity": "sha512-Pg1pfiJEyDIsX+V0QaJPRWvXbw5zmWAk3bivFCvt/5pwZb37/sT6E/RqPHT9NnqpDyKW6SriwY9ypjljysUA1Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-darwin-x64": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.65.tgz", + "integrity": "sha512-3Tr+/HjdJN7Z/VKIcsxV2DvDIibZCExgfYTgljCkUSFuoI7iNkOE6Dc1Q6j212EB9PeO8KmfrViBqHYT6IwWkA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.65.tgz", + "integrity": "sha512-3KP+dYObH7CVkZMZWwk1WX9jRjL+EKdQtD43H8MOI+illf+dwqLlecdQ4d9bQRIxELKJ8dyPWY4fOp/Ngufrdg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm64-gnu": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.65.tgz", + "integrity": "sha512-Ka3StKz7Dq7kjTF3nNJCq43UN/VlANS7qGE3dWkn1d+tQNsCRy/wRmyt1TUFzIjRqcTFMQNRbgYq84+53UBA0A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-arm64-musl": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.65.tgz", + "integrity": "sha512-O4xMASm2JrmqYoiDyxVWi+z5C14H+oVEag2rZ5iIA67dhWqYZB+iO7wCFpBYRj31JPBR29FOsu6X9zL+DwBFdw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-riscv64-gnu": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.65.tgz", + "integrity": "sha512-dblWDaA59ZU8bPbkfM+riSke7sFbNZ70LEevUdI5rgiFEUzYUQlU34gSBzemTACj5rCWt1BYeu0GfkLSjNMBSw==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-x64-gnu": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.65.tgz", + "integrity": "sha512-wsp+atutw13OJXGU3DDkdngtBDoEg01IuK5xMe0L6VFPV8maGkh17CXze078OD5QJOc6kFyw3DDscMLOPF8+oA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-linux-x64-musl": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.65.tgz", + "integrity": "sha512-odX+nN+IozWzhdj31INcHz3Iy9+EckNw+VqsZcaUxZOTu7/3FmktRNI6aC1qe5minZNv1m05YOS1FVf7fvmjlA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/canvas-win32-x64-msvc": { + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.65.tgz", + "integrity": "sha512-RZQX3luWnlNWgdMnLMQ1hyfQraeAn9lnxWWVCHuUM4tAWEV8UDdeb7cMwmJW7eyt8kAosmjeHt3cylQMHOxGFg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@napi-rs/wasm-runtime": { "version": "0.2.4", "dev": true, @@ -11211,14 +11408,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/pdfjs-dist": { - "version": "2.10.378", - "dev": true, - "license": "MIT", - "dependencies": { - "pdfjs-dist": "*" - } - }, "node_modules/@types/prop-types": { "version": "15.7.14", "devOptional": true, @@ -12743,7 +12932,7 @@ }, "node_modules/abbrev": { "version": "1.1.1", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/accepts": { @@ -12874,7 +13063,7 @@ }, "node_modules/agent-base": { "version": "6.0.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "debug": "4" @@ -13061,7 +13250,7 @@ }, "node_modules/aproba": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/are-docs-informative": { @@ -14220,9 +14409,11 @@ }, "node_modules/canvas": { "version": "2.11.2", + "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", "nan": "^2.17.0", @@ -14361,7 +14552,7 @@ }, "node_modules/chownr": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "engines": { "node": ">=10" @@ -14642,7 +14833,7 @@ }, "node_modules/color-support": { "version": "1.1.3", - "devOptional": true, + "dev": true, "license": "ISC", "bin": { "color-support": "bin.js" @@ -14843,7 +15034,7 @@ }, "node_modules/console-control-strings": { "version": "1.1.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/constants-browserify": { @@ -15559,8 +15750,10 @@ }, "node_modules/decompress-response": { "version": "4.2.1", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "mimic-response": "^2.0.0" }, @@ -15798,7 +15991,7 @@ }, "node_modules/delegates": { "version": "1.0.0", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/depd": { @@ -15835,8 +16028,10 @@ }, "node_modules/detect-libc": { "version": "2.0.3", + "dev": true, "license": "Apache-2.0", "optional": true, + "peer": true, "engines": { "node": ">=8" } @@ -16142,7 +16337,7 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/emojis-list": { @@ -19119,7 +19314,7 @@ }, "node_modules/has-unicode": { "version": "2.0.1", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/hasown": { @@ -19460,7 +19655,7 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "agent-base": "6", @@ -22888,7 +23083,7 @@ }, "node_modules/make-dir": { "version": "3.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -22902,7 +23097,7 @@ }, "node_modules/make-dir/node_modules/semver": { "version": "6.3.1", - "devOptional": true, + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -23343,8 +23538,10 @@ }, "node_modules/mimic-response": { "version": "2.1.0", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "engines": { "node": ">=8" }, @@ -23571,7 +23768,7 @@ }, "node_modules/minizlib": { "version": "2.1.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "minipass": "^3.0.0", @@ -23583,7 +23780,7 @@ }, "node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -23594,12 +23791,12 @@ }, "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/mkdirp": { "version": "1.0.4", - "devOptional": true, + "dev": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -23793,8 +23990,10 @@ }, "node_modules/nan": { "version": "2.22.0", + "dev": true, "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/nanoid": { "version": "3.3.8", @@ -24011,8 +24210,10 @@ }, "node_modules/node-fetch": { "version": "2.7.0", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -24030,18 +24231,24 @@ }, "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", + "dev": true, "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", + "dev": true, "license": "BSD-2-Clause", - "optional": true + "optional": true, + "peer": true }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -25656,16 +25863,6 @@ "node": ">=8" } }, - "node_modules/path2d-polyfill": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", - "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "2.0.0", "license": "MIT", @@ -25674,16 +25871,15 @@ } }, "node_modules/pdfjs-dist": { - "version": "3.11.174", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", - "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", + "version": "4.10.38", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz", + "integrity": "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ==", "license": "Apache-2.0", "engines": { - "node": ">=18" + "node": ">=20" }, "optionalDependencies": { - "canvas": "^2.11.2", - "path2d-polyfill": "^2.0.1" + "@napi-rs/canvas": "^0.1.65" } }, "node_modules/performance-now": { @@ -27493,7 +27689,7 @@ }, "node_modules/readable-stream": { "version": "3.6.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -28276,7 +28472,7 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -28512,7 +28708,7 @@ }, "node_modules/semver": { "version": "7.5.4", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" @@ -28526,7 +28722,7 @@ }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -28537,7 +28733,7 @@ }, "node_modules/semver/node_modules/yallist": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/send": { @@ -28689,7 +28885,7 @@ }, "node_modules/set-blocking": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/set-function-length": { @@ -29041,6 +29237,7 @@ }, "node_modules/simple-concat": { "version": "1.0.1", + "dev": true, "funding": [ { "type": "github", @@ -29056,12 +29253,15 @@ } ], "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/simple-get": { "version": "3.1.1", + "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "decompress-response": "^4.2.0", "once": "^1.3.1", @@ -29587,7 +29787,7 @@ }, "node_modules/string_decoder": { "version": "1.3.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" @@ -29626,7 +29826,7 @@ }, "node_modules/string-width": { "version": "4.2.3", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -29672,7 +29872,7 @@ }, "node_modules/string-width/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -29680,7 +29880,7 @@ }, "node_modules/string-width/node_modules/strip-ansi": { "version": "6.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -30472,7 +30672,7 @@ }, "node_modules/tar": { "version": "6.2.1", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "chownr": "^2.0.0", @@ -30503,7 +30703,7 @@ }, "node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "minipass": "^3.0.0" @@ -30514,7 +30714,7 @@ }, "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -30525,7 +30725,7 @@ }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "engines": { "node": ">=8" @@ -30533,7 +30733,7 @@ }, "node_modules/tar/node_modules/yallist": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/telejson": { @@ -31608,7 +31808,7 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/util-extend": { @@ -32924,7 +33124,7 @@ }, "node_modules/wide-align": { "version": "1.1.5", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" diff --git a/package.json b/package.json index fb3e9722f70..43730213b12 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "material-icons": "^1.13.12", "minimatch-browser": "1.0.0", "ng2-charts": "^4.1.1", - "pdfjs-dist": "3.11.174", + "pdfjs-dist": "4.10.38", "raphael": "2.3.0", "rxjs": "7.8.1", "subscriptions-transport-ws": "^0.11.0", @@ -110,7 +110,6 @@ "@types/minimatch": "^3.0.3", "@types/mocha": "^10.0.6", "@types/node": "20.16.1", - "@types/pdfjs-dist": "^2.10.378", "@types/shelljs": "^0.8.15", "@types/superagent": "^4.1.22", "@typescript-eslint/eslint-plugin": "5.59.8", From 228d48048d4103d8b711de8a5c4c4d5e03f1b980 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 9 Jan 2025 16:05:58 +0100 Subject: [PATCH 07/14] [MNT-24538][ci:force] Use Node 22 LTS --- .nvmrc | 2 +- lib/process-services-cloud/.nvmrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.nvmrc b/.nvmrc index d4b7699d36c..6fa8dec4cd6 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.18.1 +22.13.0 diff --git a/lib/process-services-cloud/.nvmrc b/lib/process-services-cloud/.nvmrc index d4b7699d36c..6fa8dec4cd6 100644 --- a/lib/process-services-cloud/.nvmrc +++ b/lib/process-services-cloud/.nvmrc @@ -1 +1 @@ -20.18.1 +22.13.0 From 8e586d73edc2300bf28abcbeeb03e45251f17067 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Tue, 14 Jan 2025 16:02:35 +0100 Subject: [PATCH 08/14] [MNT-24538] Use pdfjs legacy version --- .nvmrc | 2 +- lib/content-services/karma.conf.js | 2 -- lib/core/karma.conf.js | 2 -- .../lib/viewer/components/pdf-viewer/pdf-viewer.component.ts | 2 +- lib/process-services-cloud/.nvmrc | 2 +- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.nvmrc b/.nvmrc index 6fa8dec4cd6..d4b7699d36c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22.13.0 +20.18.1 diff --git a/lib/content-services/karma.conf.js b/lib/content-services/karma.conf.js index 456177f012e..fdf31ee5488 100644 --- a/lib/content-services/karma.conf.js +++ b/lib/content-services/karma.conf.js @@ -12,8 +12,6 @@ module.exports = function (config) { { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, type: 'module' }, { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs.map', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs.map', included: true, watched: false, type: 'module' }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, diff --git a/lib/core/karma.conf.js b/lib/core/karma.conf.js index 0569c67efd2..40eaf07076d 100644 --- a/lib/core/karma.conf.js +++ b/lib/core/karma.conf.js @@ -13,8 +13,6 @@ module.exports = function (config) { { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, served: true, type: 'module' }, { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs', included: true, watched: false, served: true, type: 'module' }, { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs.map', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs.map', included: true, watched: false, type: 'module' }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, diff --git a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts index 11e2fc21de4..736feda3587 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts @@ -37,7 +37,7 @@ import { MatDialog } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { TranslateModule } from '@ngx-translate/core'; -import { AnnotationMode, OnProgressParameters, PDFDocumentLoadingTask, PDFDocumentProxy } from 'pdfjs-dist'; +import { AnnotationMode, OnProgressParameters, PDFDocumentLoadingTask, PDFDocumentProxy } from 'pdfjs-dist/legacy/build/pdf.mjs'; import { Subject } from 'rxjs'; import { catchError, delay } from 'rxjs/operators'; import { AppConfigService } from '../../../app-config'; diff --git a/lib/process-services-cloud/.nvmrc b/lib/process-services-cloud/.nvmrc index 6fa8dec4cd6..d4b7699d36c 100644 --- a/lib/process-services-cloud/.nvmrc +++ b/lib/process-services-cloud/.nvmrc @@ -1 +1 @@ -22.13.0 +20.18.1 From 73a2b38b4a8ad34fb0a35b201c5757483a02adf5 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Wed, 15 Jan 2025 09:59:25 +0100 Subject: [PATCH 09/14] [MNT-24538] Use existing pdfjs-dist version with new param --- lib/content-services/karma.conf.js | 6 +- lib/content-services/src/test.ts | 2 +- lib/core/karma.conf.js | 12 +- .../pdf-viewer/pdf-viewer.component.ts | 2 +- lib/process-services-cloud/karma.conf.js | 6 +- lib/process-services/karma.conf.js | 6 +- package-lock.json | 341 ++++-------------- package.json | 3 +- 8 files changed, 95 insertions(+), 283 deletions(-) diff --git a/lib/content-services/karma.conf.js b/lib/content-services/karma.conf.js index fdf31ee5488..9f8368a3fb4 100644 --- a/lib/content-services/karma.conf.js +++ b/lib/content-services/karma.conf.js @@ -9,9 +9,9 @@ module.exports = function (config) { basePath: '../../', files: [ - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, diff --git a/lib/content-services/src/test.ts b/lib/content-services/src/test.ts index f8fc6a555bb..b0b86723886 100644 --- a/lib/content-services/src/test.ts +++ b/lib/content-services/src/test.ts @@ -26,4 +26,4 @@ getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDyn }); declare const pdfjsLib: any; -pdfjsLib.GlobalWorkerOptions.workerSrc = 'base/pdfjs-dist/legacy/build/pdf.worker.min.mjs'; +pdfjsLib.GlobalWorkerOptions.workerSrc = 'base/pdfjs-dist/build/pdf.worker.min.js'; diff --git a/lib/core/karma.conf.js b/lib/core/karma.conf.js index 40eaf07076d..4a6276e79c7 100644 --- a/lib/core/karma.conf.js +++ b/lib/core/karma.conf.js @@ -9,10 +9,10 @@ module.exports = function (config) { basePath: '../../', files: [ - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, served: true, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs', included: true, watched: false, served: true, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false, served: true }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.worker.min.js', included: true, watched: false, served: true }, + { pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, @@ -37,8 +37,8 @@ module.exports = function (config) { frameworks: ['jasmine-ajax', 'jasmine', '@angular-devkit/build-angular'], proxies: { - '/pdf.worker.min.js': '/base/node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs', - '/pdf.worker.js': '/base/node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', + '/pdf.worker.min.js': '/base/node_modules/pdfjs-dist/build/pdf.worker.min.js', + '/pdf.worker.js': '/base/node_modules/pdfjs-dist/build/pdf.worker.js', '/fake-url-file.png': '/base/lib/core/src/lib/assets/images/logo.png', '/logo.png': '/base/lib/core/src/lib/assets/images/logo.png', '/alfresco-logo.svg': '/base/lib/core/src/lib/assets/images/alfresco-logo.svg', diff --git a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts index 736feda3587..11e2fc21de4 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts @@ -37,7 +37,7 @@ import { MatDialog } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { TranslateModule } from '@ngx-translate/core'; -import { AnnotationMode, OnProgressParameters, PDFDocumentLoadingTask, PDFDocumentProxy } from 'pdfjs-dist/legacy/build/pdf.mjs'; +import { AnnotationMode, OnProgressParameters, PDFDocumentLoadingTask, PDFDocumentProxy } from 'pdfjs-dist'; import { Subject } from 'rxjs'; import { catchError, delay } from 'rxjs/operators'; import { AppConfigService } from '../../../app-config'; diff --git a/lib/process-services-cloud/karma.conf.js b/lib/process-services-cloud/karma.conf.js index d9773e5b791..87c7bd53ad2 100644 --- a/lib/process-services-cloud/karma.conf.js +++ b/lib/process-services-cloud/karma.conf.js @@ -8,9 +8,9 @@ module.exports = function (config) { config.set({ basePath: '../../', files: [ - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.js', included: true, watched: false }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, diff --git a/lib/process-services/karma.conf.js b/lib/process-services/karma.conf.js index c0eae969e07..f2abeb7e203 100644 --- a/lib/process-services/karma.conf.js +++ b/lib/process-services/karma.conf.js @@ -8,9 +8,9 @@ module.exports = function (config) { config.set({ basePath: '../../', files: [ - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', included: true, watched: false, type: 'module' }, - { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', included: true, watched: false, type: 'module' }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.js', included: true, watched: false }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, diff --git a/package-lock.json b/package-lock.json index 32d06d1d2f5..4d16d1b8fee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "material-icons": "^1.13.12", "minimatch-browser": "1.0.0", "ng2-charts": "^4.1.1", - "pdfjs-dist": "4.10.38", + "pdfjs-dist": "3.3.122", "raphael": "2.3.0", "rxjs": "7.8.1", "subscriptions-transport-ws": "^0.11.0", @@ -90,6 +90,7 @@ "@types/minimatch": "^3.0.3", "@types/mocha": "^10.0.6", "@types/node": "20.16.1", + "@types/pdfjs-dist": "^2.10.378", "@types/shelljs": "^0.8.15", "@types/superagent": "^4.1.22", "@typescript-eslint/eslint-plugin": "5.59.8", @@ -4800,10 +4801,8 @@ }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", - "dev": true, "license": "BSD-3-Clause", "optional": true, - "peer": true, "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -4821,10 +4820,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/are-we-there-yet": { "version": "2.0.0", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -4835,10 +4832,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { "version": "3.0.2", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", @@ -4856,10 +4851,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { "version": "5.0.0", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "abbrev": "1" }, @@ -4872,10 +4865,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/npmlog": { "version": "5.0.1", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", @@ -4885,10 +4876,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { "version": "3.0.2", - "dev": true, "license": "ISC", "optional": true, - "peer": true, "dependencies": { "glob": "^7.1.3" }, @@ -4901,17 +4890,13 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/signal-exit": { "version": "3.0.7", - "dev": true, "license": "ISC", - "optional": true, - "peer": true + "optional": true }, "node_modules/@mapbox/node-pre-gyp/node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5650,188 +5635,6 @@ "react": ">=16" } }, - "node_modules/@napi-rs/canvas": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.65.tgz", - "integrity": "sha512-YcFhXQcp+b2d38zFOJNbpyPHnIL7KAEkhJQ+UeeKI5IpE9B8Cpf/M6RiHPQXSsSqnYbrfFylnW49dyh2oeSblQ==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 10" - }, - "optionalDependencies": { - "@napi-rs/canvas-android-arm64": "0.1.65", - "@napi-rs/canvas-darwin-arm64": "0.1.65", - "@napi-rs/canvas-darwin-x64": "0.1.65", - "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.65", - "@napi-rs/canvas-linux-arm64-gnu": "0.1.65", - "@napi-rs/canvas-linux-arm64-musl": "0.1.65", - "@napi-rs/canvas-linux-riscv64-gnu": "0.1.65", - "@napi-rs/canvas-linux-x64-gnu": "0.1.65", - "@napi-rs/canvas-linux-x64-musl": "0.1.65", - "@napi-rs/canvas-win32-x64-msvc": "0.1.65" - } - }, - "node_modules/@napi-rs/canvas-android-arm64": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.65.tgz", - "integrity": "sha512-ZYwqFYEKcT5Zr8lbiaJNJj/poLaeK2TncolY914r+gD2TJNeP7ZqvE7A2SX/1C9MB4E3DQEwm3YhL3WEf0x3MQ==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-darwin-arm64": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.65.tgz", - "integrity": "sha512-Pg1pfiJEyDIsX+V0QaJPRWvXbw5zmWAk3bivFCvt/5pwZb37/sT6E/RqPHT9NnqpDyKW6SriwY9ypjljysUA1Q==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-darwin-x64": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.65.tgz", - "integrity": "sha512-3Tr+/HjdJN7Z/VKIcsxV2DvDIibZCExgfYTgljCkUSFuoI7iNkOE6Dc1Q6j212EB9PeO8KmfrViBqHYT6IwWkA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.65.tgz", - "integrity": "sha512-3KP+dYObH7CVkZMZWwk1WX9jRjL+EKdQtD43H8MOI+illf+dwqLlecdQ4d9bQRIxELKJ8dyPWY4fOp/Ngufrdg==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-arm64-gnu": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.65.tgz", - "integrity": "sha512-Ka3StKz7Dq7kjTF3nNJCq43UN/VlANS7qGE3dWkn1d+tQNsCRy/wRmyt1TUFzIjRqcTFMQNRbgYq84+53UBA0A==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-arm64-musl": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.65.tgz", - "integrity": "sha512-O4xMASm2JrmqYoiDyxVWi+z5C14H+oVEag2rZ5iIA67dhWqYZB+iO7wCFpBYRj31JPBR29FOsu6X9zL+DwBFdw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-riscv64-gnu": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.65.tgz", - "integrity": "sha512-dblWDaA59ZU8bPbkfM+riSke7sFbNZ70LEevUdI5rgiFEUzYUQlU34gSBzemTACj5rCWt1BYeu0GfkLSjNMBSw==", - "cpu": [ - "riscv64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-x64-gnu": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.65.tgz", - "integrity": "sha512-wsp+atutw13OJXGU3DDkdngtBDoEg01IuK5xMe0L6VFPV8maGkh17CXze078OD5QJOc6kFyw3DDscMLOPF8+oA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-linux-x64-musl": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.65.tgz", - "integrity": "sha512-odX+nN+IozWzhdj31INcHz3Iy9+EckNw+VqsZcaUxZOTu7/3FmktRNI6aC1qe5minZNv1m05YOS1FVf7fvmjlA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/canvas-win32-x64-msvc": { - "version": "0.1.65", - "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.65.tgz", - "integrity": "sha512-RZQX3luWnlNWgdMnLMQ1hyfQraeAn9lnxWWVCHuUM4tAWEV8UDdeb7cMwmJW7eyt8kAosmjeHt3cylQMHOxGFg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, "node_modules/@napi-rs/wasm-runtime": { "version": "0.2.4", "dev": true, @@ -11408,6 +11211,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/pdfjs-dist": { + "version": "2.10.378", + "resolved": "https://registry.npmjs.org/@types/pdfjs-dist/-/pdfjs-dist-2.10.378.tgz", + "integrity": "sha512-TRdIPqdsvKmPla44kVy4jv5Nt5vjMfVjbIEke1CRULIrwKNRC4lIiZvNYDJvbUMNCFPNIUcOKhXTyMJrX18IMA==", + "deprecated": "This is a stub types definition. pdfjs-dist provides its own type definitions, so you do not need this installed.", + "dev": true, + "license": "MIT", + "dependencies": { + "pdfjs-dist": "*" + } + }, "node_modules/@types/prop-types": { "version": "15.7.14", "devOptional": true, @@ -12932,7 +12746,7 @@ }, "node_modules/abbrev": { "version": "1.1.1", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/accepts": { @@ -13063,7 +12877,7 @@ }, "node_modules/agent-base": { "version": "6.0.2", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "debug": "4" @@ -13250,7 +13064,7 @@ }, "node_modules/aproba": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/are-docs-informative": { @@ -14409,11 +14223,9 @@ }, "node_modules/canvas": { "version": "2.11.2", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", "nan": "^2.17.0", @@ -14552,7 +14364,7 @@ }, "node_modules/chownr": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "ISC", "engines": { "node": ">=10" @@ -14833,7 +14645,7 @@ }, "node_modules/color-support": { "version": "1.1.3", - "dev": true, + "devOptional": true, "license": "ISC", "bin": { "color-support": "bin.js" @@ -15034,7 +14846,7 @@ }, "node_modules/console-control-strings": { "version": "1.1.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/constants-browserify": { @@ -15750,10 +15562,8 @@ }, "node_modules/decompress-response": { "version": "4.2.1", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "mimic-response": "^2.0.0" }, @@ -15991,7 +15801,7 @@ }, "node_modules/delegates": { "version": "1.0.0", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/depd": { @@ -16028,10 +15838,8 @@ }, "node_modules/detect-libc": { "version": "2.0.3", - "dev": true, "license": "Apache-2.0", "optional": true, - "peer": true, "engines": { "node": ">=8" } @@ -16337,7 +16145,7 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/emojis-list": { @@ -19314,7 +19122,7 @@ }, "node_modules/has-unicode": { "version": "2.0.1", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/hasown": { @@ -19655,7 +19463,7 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "agent-base": "6", @@ -23083,7 +22891,7 @@ }, "node_modules/make-dir": { "version": "3.1.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -23097,7 +22905,7 @@ }, "node_modules/make-dir/node_modules/semver": { "version": "6.3.1", - "dev": true, + "devOptional": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -23538,10 +23346,8 @@ }, "node_modules/mimic-response": { "version": "2.1.0", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=8" }, @@ -23768,7 +23574,7 @@ }, "node_modules/minizlib": { "version": "2.1.2", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "minipass": "^3.0.0", @@ -23780,7 +23586,7 @@ }, "node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -23791,12 +23597,12 @@ }, "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/mkdirp": { "version": "1.0.4", - "dev": true, + "devOptional": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -23990,10 +23796,8 @@ }, "node_modules/nan": { "version": "2.22.0", - "dev": true, "license": "MIT", - "optional": true, - "peer": true + "optional": true }, "node_modules/nanoid": { "version": "3.3.8", @@ -24210,10 +24014,8 @@ }, "node_modules/node-fetch": { "version": "2.7.0", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -24231,24 +24033,18 @@ }, "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", - "dev": true, "license": "MIT", - "optional": true, - "peer": true + "optional": true }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", - "dev": true, "license": "BSD-2-Clause", - "optional": true, - "peer": true + "optional": true }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -25863,6 +25659,15 @@ "node": ">=8" } }, + "node_modules/path2d-polyfill": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", + "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/pathval": { "version": "2.0.0", "license": "MIT", @@ -25871,15 +25676,16 @@ } }, "node_modules/pdfjs-dist": { - "version": "4.10.38", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz", - "integrity": "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ==", + "version": "3.3.122", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.3.122.tgz", + "integrity": "sha512-98WC09jOq3OuqrmF5+LZfcyzTlGA0sY9ocMBbWZ/H6Pwni7deptxwkNZVLieOz+4nSoTEW25PsfnfOj3ELrHdA==", "license": "Apache-2.0", - "engines": { - "node": ">=20" + "dependencies": { + "path2d-polyfill": "^2.0.1", + "web-streams-polyfill": "^3.2.1" }, "optionalDependencies": { - "@napi-rs/canvas": "^0.1.65" + "canvas": "^2.11.0" } }, "node_modules/performance-now": { @@ -27689,7 +27495,7 @@ }, "node_modules/readable-stream": { "version": "3.6.2", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -28472,7 +28278,7 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "dev": true, + "devOptional": true, "funding": [ { "type": "github", @@ -28708,7 +28514,7 @@ }, "node_modules/semver": { "version": "7.5.4", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" @@ -28722,7 +28528,7 @@ }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -28733,7 +28539,7 @@ }, "node_modules/semver/node_modules/yallist": { "version": "4.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/send": { @@ -28885,7 +28691,7 @@ }, "node_modules/set-blocking": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/set-function-length": { @@ -29237,7 +29043,6 @@ }, "node_modules/simple-concat": { "version": "1.0.1", - "dev": true, "funding": [ { "type": "github", @@ -29253,15 +29058,12 @@ } ], "license": "MIT", - "optional": true, - "peer": true + "optional": true }, "node_modules/simple-get": { "version": "3.1.1", - "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "decompress-response": "^4.2.0", "once": "^1.3.1", @@ -29787,7 +29589,7 @@ }, "node_modules/string_decoder": { "version": "1.3.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" @@ -29826,7 +29628,7 @@ }, "node_modules/string-width": { "version": "4.2.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -29872,7 +29674,7 @@ }, "node_modules/string-width/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -29880,7 +29682,7 @@ }, "node_modules/string-width/node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -30672,7 +30474,7 @@ }, "node_modules/tar": { "version": "6.2.1", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "chownr": "^2.0.0", @@ -30703,7 +30505,7 @@ }, "node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "minipass": "^3.0.0" @@ -30714,7 +30516,7 @@ }, "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -30725,7 +30527,7 @@ }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", - "dev": true, + "devOptional": true, "license": "ISC", "engines": { "node": ">=8" @@ -30733,7 +30535,7 @@ }, "node_modules/tar/node_modules/yallist": { "version": "4.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/telejson": { @@ -31808,7 +31610,7 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/util-extend": { @@ -32460,6 +32262,15 @@ "defaults": "^1.0.3" } }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/webdriver-js-extender": { "version": "2.1.0", "dev": true, @@ -33124,7 +32935,7 @@ }, "node_modules/wide-align": { "version": "1.1.5", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" diff --git a/package.json b/package.json index 43730213b12..6c1be59667c 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "material-icons": "^1.13.12", "minimatch-browser": "1.0.0", "ng2-charts": "^4.1.1", - "pdfjs-dist": "4.10.38", + "pdfjs-dist": "3.3.122", "raphael": "2.3.0", "rxjs": "7.8.1", "subscriptions-transport-ws": "^0.11.0", @@ -110,6 +110,7 @@ "@types/minimatch": "^3.0.3", "@types/mocha": "^10.0.6", "@types/node": "20.16.1", + "@types/pdfjs-dist": "^2.10.378", "@types/shelljs": "^0.8.15", "@types/superagent": "^4.1.22", "@typescript-eslint/eslint-plugin": "5.59.8", From cceca63e0c73c38505470a1451419512c1974e1e Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Wed, 15 Jan 2025 10:03:27 +0100 Subject: [PATCH 10/14] [MNT-24538] Legacy build cleanup --- lib/core/package.json | 2 +- lib/process-services-cloud/karma.conf.js | 6 +++--- lib/process-services/karma.conf.js | 6 +++--- package-lock.json | 9 --------- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/lib/core/package.json b/lib/core/package.json index cb6e89d70e0..5521d308f24 100644 --- a/lib/core/package.json +++ b/lib/core/package.json @@ -41,7 +41,7 @@ "@alfresco/js-api": ">=8.0.0-alpha.7-0", "@alfresco/adf-extensions": ">=7.0.0-alpha.7-0", "minimatch-browser": "1.0.0", - "pdfjs-dist": "4.10.38", + "pdfjs-dist": "3.3.122", "ts-morph": "^20.0.0" }, "keywords": [ diff --git a/lib/process-services-cloud/karma.conf.js b/lib/process-services-cloud/karma.conf.js index 87c7bd53ad2..92871aac643 100644 --- a/lib/process-services-cloud/karma.conf.js +++ b/lib/process-services-cloud/karma.conf.js @@ -8,9 +8,9 @@ module.exports = function (config) { config.set({ basePath: '../../', files: [ - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.js', included: true, watched: false }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.js', included: true, watched: false }, - { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, diff --git a/lib/process-services/karma.conf.js b/lib/process-services/karma.conf.js index f2abeb7e203..cbca24faeea 100644 --- a/lib/process-services/karma.conf.js +++ b/lib/process-services/karma.conf.js @@ -8,9 +8,9 @@ module.exports = function (config) { config.set({ basePath: '../../', files: [ - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.js', included: true, watched: false }, - { pattern: 'node_modules/pdfjs-dist/legacy/build/pdf.worker.js', included: true, watched: false }, - { pattern: 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false }, + { pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false }, { pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, diff --git a/package-lock.json b/package-lock.json index 4d16d1b8fee..ca29f266511 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11213,9 +11213,6 @@ }, "node_modules/@types/pdfjs-dist": { "version": "2.10.378", - "resolved": "https://registry.npmjs.org/@types/pdfjs-dist/-/pdfjs-dist-2.10.378.tgz", - "integrity": "sha512-TRdIPqdsvKmPla44kVy4jv5Nt5vjMfVjbIEke1CRULIrwKNRC4lIiZvNYDJvbUMNCFPNIUcOKhXTyMJrX18IMA==", - "deprecated": "This is a stub types definition. pdfjs-dist provides its own type definitions, so you do not need this installed.", "dev": true, "license": "MIT", "dependencies": { @@ -25661,8 +25658,6 @@ }, "node_modules/path2d-polyfill": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", - "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", "license": "MIT", "engines": { "node": ">=8" @@ -25677,8 +25672,6 @@ }, "node_modules/pdfjs-dist": { "version": "3.3.122", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.3.122.tgz", - "integrity": "sha512-98WC09jOq3OuqrmF5+LZfcyzTlGA0sY9ocMBbWZ/H6Pwni7deptxwkNZVLieOz+4nSoTEW25PsfnfOj3ELrHdA==", "license": "Apache-2.0", "dependencies": { "path2d-polyfill": "^2.0.1", @@ -32264,8 +32257,6 @@ }, "node_modules/web-streams-polyfill": { "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", "license": "MIT", "engines": { "node": ">= 8" From ef55000bb0cb6b728e782f9c4f94cf2ba9a86980 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Wed, 15 Jan 2025 10:07:41 +0100 Subject: [PATCH 11/14] [MNT-24538] Lockfile fix --- package-lock.json | 64 +++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index ca29f266511..4332d42dbe9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,7 +95,7 @@ "@types/superagent": "^4.1.22", "@typescript-eslint/eslint-plugin": "5.59.8", "@typescript-eslint/parser": "5.62.0", - "@typescript-eslint/typescript-estree": "8.19.1", + "@typescript-eslint/typescript-estree": "8.14.0", "ajv": "^8.12.0", "commander": "12.0.0", "css-loader": "^7.1.2", @@ -11804,20 +11804,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.1.tgz", - "integrity": "sha512-jk/TZwSMJlxlNnqhy0Eod1PNEvCkpY6MXOXE/WLlblZ6ibb32i2We4uByoKPv1d0OD2xebDv4hbs3fm11SMw8Q==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.14.0.tgz", + "integrity": "sha512-OPXPLYKGZi9XS/49rdaCbR5j/S14HazviBlUQFvSKz3npr3NikF+mrgK7CFVur6XEt95DZp/cmke9d5i3vtVnQ==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^2.0.0" + "ts-api-utils": "^1.3.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -11826,14 +11826,16 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "typescript": ">=4.8.4 <5.8.0" + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.19.1.tgz", - "integrity": "sha512-JBVHMLj7B1K1v1051ZaMMgLW4Q/jre5qGK0Ew6UgXz1Rqh+/xPzV1aW581OM00X6iOfyr1be+QyW8LOUf19BbA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.14.0.tgz", + "integrity": "sha512-yjeB9fnO/opvLJFAsPNYlKPnEM8+z4og09Pk504dkqonT02AyL5Z9SSqlE0XqezS93v6CXn49VHvB2G7XSsl0g==", "dev": true, "license": "MIT", "engines": { @@ -11845,14 +11847,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.1.tgz", - "integrity": "sha512-fzmjU8CHK853V/avYZAvuVut3ZTfwN5YtMaoi+X9Y9MA9keaWNHC3zEQ9zvyX/7Hj+5JkNyK1l7TOR2hevHB6Q==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.14.0.tgz", + "integrity": "sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.19.1", - "eslint-visitor-keys": "^4.2.0" + "@typescript-eslint/types": "8.14.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -11870,19 +11872,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@typescript-eslint/typescript-estree/node_modules/fast-glob": { "version": "3.3.2", "dev": true, @@ -11923,19 +11912,6 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/ts-api-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", - "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, "node_modules/@typescript-eslint/utils": { "version": "5.62.0", "dev": true, From 1e6a5c4076ae7db1ecacc4eaf465d6b31062fdcc Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Wed, 15 Jan 2025 10:14:15 +0100 Subject: [PATCH 12/14] [MNT-24538] Lockfile fix --- package-lock.json | 64 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4332d42dbe9..ca29f266511 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,7 +95,7 @@ "@types/superagent": "^4.1.22", "@typescript-eslint/eslint-plugin": "5.59.8", "@typescript-eslint/parser": "5.62.0", - "@typescript-eslint/typescript-estree": "8.14.0", + "@typescript-eslint/typescript-estree": "8.19.1", "ajv": "^8.12.0", "commander": "12.0.0", "css-loader": "^7.1.2", @@ -11804,20 +11804,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.14.0.tgz", - "integrity": "sha512-OPXPLYKGZi9XS/49rdaCbR5j/S14HazviBlUQFvSKz3npr3NikF+mrgK7CFVur6XEt95DZp/cmke9d5i3vtVnQ==", + "version": "8.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.1.tgz", + "integrity": "sha512-jk/TZwSMJlxlNnqhy0Eod1PNEvCkpY6MXOXE/WLlblZ6ibb32i2We4uByoKPv1d0OD2xebDv4hbs3fm11SMw8Q==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.14.0", - "@typescript-eslint/visitor-keys": "8.14.0", + "@typescript-eslint/types": "8.19.1", + "@typescript-eslint/visitor-keys": "8.19.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -11826,16 +11826,14 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.14.0.tgz", - "integrity": "sha512-yjeB9fnO/opvLJFAsPNYlKPnEM8+z4og09Pk504dkqonT02AyL5Z9SSqlE0XqezS93v6CXn49VHvB2G7XSsl0g==", + "version": "8.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.19.1.tgz", + "integrity": "sha512-JBVHMLj7B1K1v1051ZaMMgLW4Q/jre5qGK0Ew6UgXz1Rqh+/xPzV1aW581OM00X6iOfyr1be+QyW8LOUf19BbA==", "dev": true, "license": "MIT", "engines": { @@ -11847,14 +11845,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.14.0.tgz", - "integrity": "sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==", + "version": "8.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.1.tgz", + "integrity": "sha512-fzmjU8CHK853V/avYZAvuVut3ZTfwN5YtMaoi+X9Y9MA9keaWNHC3zEQ9zvyX/7Hj+5JkNyK1l7TOR2hevHB6Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.14.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.19.1", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -11872,6 +11870,19 @@ "balanced-match": "^1.0.0" } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@typescript-eslint/typescript-estree/node_modules/fast-glob": { "version": "3.3.2", "dev": true, @@ -11912,6 +11923,19 @@ "node": ">=10" } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/ts-api-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", + "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/@typescript-eslint/utils": { "version": "5.62.0", "dev": true, From 82b101b740d4b6d2655c9157c278b8e90d46c633 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Wed, 15 Jan 2025 10:30:02 +0100 Subject: [PATCH 13/14] [MNT-24538] Unit test fix --- .../viewer/components/pdf-viewer/pdf-viewer.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts index 177455b356a..92e52201e64 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts @@ -164,7 +164,7 @@ describe('Test PdfViewer component', () => { fixtureUrlTestComponent.detectChanges(); fixtureUrlTestComponent.whenStable().then(() => { - expect(componentUrlTestComponent.pdfViewerComponent.pdfViewer.annotationMode).toBe(AnnotationMode.DISABLE); + expect(componentUrlTestComponent.pdfViewerComponent.pdfViewer.annotationEditorMode).toBe(AnnotationMode.DISABLE); done(); }); }, 55000); From 98ba30b2a568466441f10d58a83a6445d784afd6 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Wed, 15 Jan 2025 11:11:00 +0100 Subject: [PATCH 14/14] [MNT-24538] Unit test fixes --- .../pdf-viewer/pdf-viewer.component.spec.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts index 92e52201e64..552775033cd 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.spec.ts @@ -253,32 +253,34 @@ describe('Test PdfViewer component', () => { }, 55000); describe('Zoom', () => { - it('should zoom in increment the scale value', fakeAsync(() => { + it('should zoom in increment the scale value', (done) => { spyOn(componentUrlTestComponent.pdfViewerComponent.pdfViewer, 'forceRendering').and.callFake(() => {}); const zoomInButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-in-button'); - tick(250); - const zoomBefore = componentUrlTestComponent.pdfViewerComponent.pdfViewer.currentScaleValue; zoomInButton.click(); + fixtureUrlTestComponent.detectChanges(); + expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto'); const currentZoom = componentUrlTestComponent.pdfViewerComponent.pdfViewer.currentScaleValue; expect(zoomBefore < currentZoom).toBe(true); - }), 55000); + done(); + }, 55000); - it('should zoom out decrement the scale value', fakeAsync(() => { + it('should zoom out decrement the scale value', (done) => { spyOn(componentUrlTestComponent.pdfViewerComponent.pdfViewer, 'forceRendering').and.callFake(() => {}); const zoomOutButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-out-button'); - tick(250); - const zoomBefore = componentUrlTestComponent.pdfViewerComponent.pdfViewer.currentScaleValue; zoomOutButton.click(); + fixtureUrlTestComponent.detectChanges(); + expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto'); const currentZoom = componentUrlTestComponent.pdfViewerComponent.pdfViewer.currentScaleValue; expect(zoomBefore > currentZoom).toBe(true); - }), 55000); + done(); + }, 55000); it('should it-in button toggle page-fit and auto scale mode', fakeAsync(() => { spyOn(componentUrlTestComponent.pdfViewerComponent.pdfViewer, 'forceRendering').and.callFake(() => {});