enhance(dev): upgrade pdfjs (#11914)

* enhance(dev): upgrade pdfjs

* chore: upgrade shadow-cljs
This commit is contained in:
Charlie
2025-06-02 11:13:05 +08:00
committed by GitHub
parent 598d06ae18
commit 84183068fb
9 changed files with 12408 additions and 7813 deletions

View File

@@ -25,7 +25,7 @@
hiccups/hiccups {:mvn/version "0.3.0"}
tongue/tongue {:mvn/version "0.4.4"}
org.clojure/core.async {:mvn/version "1.6.673"}
thheller/shadow-cljs {:mvn/version "2.19.0"}
thheller/shadow-cljs {:mvn/version "2.28.23"}
expound/expound {:mvn/version "0.8.6"}
com.lambdaisland/glogi {:mvn/version "1.1.144"}
binaryage/devtools {:mvn/version "1.0.5"}

View File

@@ -85,9 +85,9 @@ const common = {
'node_modules/@glidejs/glide/dist/css/glide.theme.min.css',
]).pipe(gulp.dest(path.join(outputPath, 'js', 'glide'))),
() => gulp.src([
'node_modules/pdfjs-dist/build/pdf.js',
'node_modules/pdfjs-dist/build/pdf.worker.js',
'node_modules/pdfjs-dist/web/pdf_viewer.js',
'node_modules/pdfjs-dist/legacy/build/pdf.mjs',
'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs',
'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs',
]).pipe(gulp.dest(path.join(outputPath, 'js', 'pdfjs'))),
() => gulp.src([
'node_modules/pdfjs-dist/cmaps/*.*',

View File

@@ -151,7 +151,7 @@
"mldoc": "^1.5.9",
"path": "0.12.7",
"path-complete-extname": "1.0.0",
"pdfjs-dist": "^3.9.179",
"pdfjs-dist": "4.2.67",
"photoswipe": "^5.3.7",
"pixi-graph-fork": "0.2.0",
"pixi.js": "6.2.0",

View File

@@ -49,6 +49,8 @@ const portal = new MagicPortal(worker);
<script defer src="./js/highlight.min.js"></script>
<script defer src="./js/interact.min.js"></script>
<script defer src="./js/marked.min.js"></script>
<script defer type="module" src="./js/pdfjs/pdf.mjs"></script>
<script defer type="module" src="./js/pdf_viewer3.mjs"></script>
<script defer src="./js/eventemitter3.umd.min.js"></script>
<script defer src="./js/html2canvas.min.js"></script>
<script defer src="./js/lsplugin.core.js"></script>

File diff suppressed because it is too large Load Diff

12391
resources/js/pdf_viewer3.mjs Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1062,9 +1062,7 @@
;; load assets
(hooks/use-effect!
(fn []
(p/then
(pdf-utils/load-base-assets$)
(fn [] (set-prepared! true))))
(set-prepared! true))
[])
;; refresh loader

View File

@@ -123,11 +123,6 @@
[]
(common-uuid/gen-uuid))
(defn load-base-assets$
[]
(p/let [_ (util/js-load$ (str util/JS_ROOT "/pdfjs/pdf.js"))
_ (util/js-load$ (str util/JS_ROOT "/pdf_viewer2.js"))]))
(defn get-page-from-el
[^js/HTMLElement el]
(when-let [^js page-el (and el (.closest el ".page"))]

View File

@@ -6437,17 +6437,10 @@ path-type@^4.0.0:
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
path2d-polyfill@^2.0.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/path2d-polyfill/-/path2d-polyfill-2.1.1.tgz#6098b7bf2fc24c306c6377bcd558b17ba437ea27"
integrity sha512-4Rka5lN+rY/p0CdD8+E+BFv51lFaFvJOrlOhyQ+zjzyQrzyh3ozmxd1vVGGDdIbUFSBtIZLSnspxTgPT0iJhvA==
dependencies:
path2d "0.1.1"
path2d@0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/path2d/-/path2d-0.1.1.tgz#d3c3886cd2252fb2a7830c27ea7bb9a862d937ea"
integrity sha512-/+S03c8AGsDYKKBtRDqieTJv2GlkMb0bWjnqOgtF6MkjdUQ9a8ARAtxWf9NgKLGm2+WQr6+/tqJdU8HNGsIDoA==
path2d@^0.2.0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/path2d/-/path2d-0.2.2.tgz#cc85d61ed7827e7863a2ee36713d4b5315a3d85d"
integrity sha512-+vnG6S4dYcYxZd+CZxzXCNKdELYZSKfohrk98yajCo1PtRoDgCTrrwOvK1GT0UoAdVszagDVllQc0U1vaX4NUQ==
path@0.12.7:
version "0.12.7"
@@ -6468,13 +6461,13 @@ pbkdf2@^3.1.2:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
pdfjs-dist@^3.9.179:
version "3.11.174"
resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz#5ff47b80f2d58c8dd0d74f615e7c6a7e7e704c4b"
integrity sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==
pdfjs-dist@4.2.67:
version "4.2.67"
resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-4.2.67.tgz#dd2a65a4b00d95cd4bc2c1f6a27c5e9eb31d512a"
integrity sha512-rJmuBDFpD7cqC8WIkQUEClyB4UAH05K4AsyewToMTp2gSy3Rrx8c1ydAVqlJlGv3yZSOrhEERQU/4ScQQFlLHA==
optionalDependencies:
canvas "^2.11.2"
path2d-polyfill "^2.0.1"
path2d "^0.2.0"
pend@~1.2.0:
version "1.2.0"