|
21 | 21 | */ |
22 | 22 |
|
23 | 23 | /** |
24 | | - * pdfjsVersion = 6.0.213 |
25 | | - * pdfjsBuild = 389853d47 |
| 24 | + * pdfjsVersion = 6.0.229 |
| 25 | + * pdfjsBuild = 145feeaa3 |
26 | 26 | */ |
27 | 27 |
|
28 | 28 | ;// ./src/shared/util.js |
@@ -1996,10 +1996,17 @@ class FloatingToolbar { |
1996 | 1996 | } |
1997 | 1997 | } |
1998 | 1998 |
|
| 1999 | +;// ./src/shared/internal_evt.js |
| 2000 | +const INTERNAL_EVT = "1684dd60-3936-4889-b86a-7f7f4e3a1938"; |
| 2001 | +const internalOpt = Object.freeze({ |
| 2002 | + internal: INTERNAL_EVT |
| 2003 | +}); |
| 2004 | + |
1999 | 2005 | ;// ./src/display/editor/tools.js |
2000 | 2006 |
|
2001 | 2007 |
|
2002 | 2008 |
|
| 2009 | + |
2003 | 2010 | function bindEvents(obj, element, names) { |
2004 | 2011 | for (const name of names) { |
2005 | 2012 | element.addEventListener(name, obj[name].bind(obj)); |
@@ -2558,24 +2565,16 @@ class AnnotationEditorUIManager { |
2558 | 2565 | this.#signatureManager = signatureManager; |
2559 | 2566 | this.#pdfDocument = pdfDocument; |
2560 | 2567 | this._eventBus = eventBus; |
2561 | | - eventBus._on("editingaction", this.onEditingAction.bind(this), { |
2562 | | - signal |
2563 | | - }); |
2564 | | - eventBus._on("pagechanging", this.onPageChanging.bind(this), { |
2565 | | - signal |
2566 | | - }); |
2567 | | - eventBus._on("scalechanging", this.onScaleChanging.bind(this), { |
2568 | | - signal |
2569 | | - }); |
2570 | | - eventBus._on("rotationchanging", this.onRotationChanging.bind(this), { |
2571 | | - signal |
2572 | | - }); |
2573 | | - eventBus._on("setpreference", this.onSetPreference.bind(this), { |
2574 | | - signal |
2575 | | - }); |
2576 | | - eventBus._on("switchannotationeditorparams", evt => this.updateParams(evt.type, evt.value), { |
2577 | | - signal |
2578 | | - }); |
| 2568 | + const evtOpts = { |
| 2569 | + signal, |
| 2570 | + ...internalOpt |
| 2571 | + }; |
| 2572 | + eventBus.on("editingaction", this.onEditingAction.bind(this), evtOpts); |
| 2573 | + eventBus.on("pagechanging", this.onPageChanging.bind(this), evtOpts); |
| 2574 | + eventBus.on("scalechanging", this.onScaleChanging.bind(this), evtOpts); |
| 2575 | + eventBus.on("rotationchanging", this.onRotationChanging.bind(this), evtOpts); |
| 2576 | + eventBus.on("setpreference", this.onSetPreference.bind(this), evtOpts); |
| 2577 | + eventBus.on("switchannotationeditorparams", evt => this.updateParams(evt.type, evt.value), evtOpts); |
2579 | 2578 | window.addEventListener("pointerdown", () => { |
2580 | 2579 | this.#isPointerDown = true; |
2581 | 2580 | }, { |
@@ -2775,7 +2774,7 @@ class AnnotationEditorUIManager { |
2775 | 2774 | } = Promise.withResolvers(); |
2776 | 2775 | const onEditorsRendered = evt => { |
2777 | 2776 | if (evt.pageNumber === pageNumber) { |
2778 | | - this._eventBus._off("editorsrendered", onEditorsRendered); |
| 2777 | + this._eventBus.off("editorsrendered", onEditorsRendered); |
2779 | 2778 | resolve(); |
2780 | 2779 | } |
2781 | 2780 | }; |
@@ -14121,7 +14120,7 @@ function getDocument(src = {}) { |
14121 | 14120 | } |
14122 | 14121 | const docParams = { |
14123 | 14122 | docId, |
14124 | | - apiVersion: "6.0.213", |
| 14123 | + apiVersion: "6.0.229", |
14125 | 14124 | data, |
14126 | 14125 | password, |
14127 | 14126 | disableAutoFetch, |
@@ -15373,12 +15372,27 @@ class WorkerTransport { |
15373 | 15372 | pageInfos |
15374 | 15373 | }; |
15375 | 15374 | let transfer; |
| 15375 | + const ImageBitmapCtor = globalThis.ImageBitmap; |
| 15376 | + if (typeof ImageBitmapCtor === "function") { |
| 15377 | + const infos = Array.isArray(pageInfos) ? pageInfos : [pageInfos]; |
| 15378 | + for (const pageInfo of infos) { |
| 15379 | + if (pageInfo?.image instanceof ImageBitmapCtor) { |
| 15380 | + (transfer ||= []).push(pageInfo.image); |
| 15381 | + } |
| 15382 | + } |
| 15383 | + } |
15376 | 15384 | if (this.annotationStorage.size > 0) { |
15377 | 15385 | const serialized = this.annotationStorage.serializable; |
15378 | 15386 | let { |
15379 | 15387 | map |
15380 | 15388 | } = serialized; |
15381 | | - transfer = serialized.transfer; |
| 15389 | + if (serialized.transfer?.length) { |
| 15390 | + if (transfer) { |
| 15391 | + transfer.push(...serialized.transfer); |
| 15392 | + } else { |
| 15393 | + transfer = serialized.transfer; |
| 15394 | + } |
| 15395 | + } |
15382 | 15396 | const mapping = this.pagesMapper.getMapping(); |
15383 | 15397 | if (mapping) { |
15384 | 15398 | const remapped = new Map(); |
@@ -15749,8 +15763,8 @@ class InternalRenderTask { |
15749 | 15763 | } |
15750 | 15764 | } |
15751 | 15765 | } |
15752 | | -const version = "6.0.213"; |
15753 | | -const build = "389853d47"; |
| 15766 | +const version = "6.0.229"; |
| 15767 | +const build = "145feeaa3"; |
15754 | 15768 |
|
15755 | 15769 | ;// ./src/display/editor/color_picker.js |
15756 | 15770 |
|
|
0 commit comments