diff --git a/browser/locales/en-US/pdfviewer/viewer.properties b/browser/locales/en-US/pdfviewer/viewer.properties --- a/browser/locales/en-US/pdfviewer/viewer.properties +++ b/browser/locales/en-US/pdfviewer/viewer.properties @@ -249,23 +249,23 @@ printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. # Editor -editor_free_text.title=Add FreeText Annotation -editor_free_text_label=FreeText Annotation -editor_ink.title=Add Ink Annotation -editor_ink_label=Ink Annotation +editor_free_text2.title=Text +editor_free_text2_label=Text +editor_ink2.title=Draw +editor_ink2_label=Draw -free_text_default_content=Enter text… +free_text2_default_content=Start typing… # Editor Parameters editor_free_text_color=Color editor_free_text_size=Size editor_ink_color=Color editor_ink_thickness=Thickness editor_ink_opacity=Opacity # Editor aria -editor_free_text_aria_label=FreeText Editor -editor_ink_aria_label=Ink Editor +editor_free_text2_aria_label=Text Editor +editor_ink2_aria_label=Draw Editor editor_ink_canvas_aria_label=User-created image diff --git a/toolkit/components/pdfjs/content/build/pdf.js b/toolkit/components/pdfjs/content/build/pdf.js --- a/toolkit/components/pdfjs/content/build/pdf.js +++ b/toolkit/components/pdfjs/content/build/pdf.js @@ -1361,11 +1361,11 @@ source.contentDispositionFilename = pdfDataRangeTransport.contentDispositionFilename; } const workerId = await worker.messageHandler.sendWithPromise("GetDocRequest", { docId, - apiVersion: '3.0.7', + apiVersion: '3.0.44', source: { data: source.data, url: source.url, password: source.password, disableAutoFetch: source.disableAutoFetch, @@ -1734,13 +1734,11 @@ optionalContentConfigPromise = null, annotationCanvasMap = null, pageColors = null, printAnnotationStorage = null }) { - if (this._stats) { - this._stats.time("Overall"); - } + this._stats?.time("Overall"); const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage); this.pendingCleanup = false; @@ -1772,14 +1770,11 @@ fnArray: [], argsArray: [], lastChunk: false, separateAnnots: null }; - - if (this._stats) { - this._stats.time("Page Request"); - } + this._stats?.time("Page Request"); this._pumpOperatorList(intentArgs); } const complete = error => { @@ -1800,15 +1795,12 @@ }); } else { internalRenderTask.capability.resolve(); } - if (this._stats) { - this._stats.timeEnd("Rendering"); - - this._stats.timeEnd("Overall"); - } + this._stats?.timeEnd("Rendering"); + this._stats?.timeEnd("Overall"); }; const internalRenderTask = new InternalRenderTask({ callback: complete, params: { @@ -1833,14 +1825,11 @@ if (this.pendingCleanup) { complete(); return; } - if (this._stats) { - this._stats.time("Rendering"); - } - + this._stats?.time("Rendering"); internalRenderTask.initializeGraphics({ transparency, optionalContentConfig }); internalRenderTask.operatorListChanged(); @@ -1881,14 +1870,11 @@ fnArray: [], argsArray: [], lastChunk: false, separateAnnots: null }; - - if (this._stats) { - this._stats.time("Page Request"); - } + this._stats?.time("Page Request"); this._pumpOperatorList(intentArgs); } return intentState.opListReadCapability.promise; @@ -2035,17 +2021,12 @@ if (!intentState) { return; } - if (this._stats) { - this._stats.timeEnd("Page Request"); - } - - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.resolve(transparency); - } + this._stats?.timeEnd("Page Request"); + intentState.displayReadyCapability?.resolve(transparency); } _renderPageChunk(operatorListChunk, intentState) { for (let i = 0, ii = operatorListChunk.length; i < ii; i++) { intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); @@ -3319,23 +3300,17 @@ transparency, background }); this.operatorListIdx = 0; this.graphicsReady = true; - - if (this.graphicsReadyCallback) { - this.graphicsReadyCallback(); - } + this.graphicsReadyCallback?.(); } cancel(error = null) { this.running = false; this.cancelled = true; - - if (this.gfx) { - this.gfx.endDrawing(); - } + this.gfx?.endDrawing(); if (this._canvas) { InternalRenderTask.#canvasInUse.delete(this._canvas); } @@ -3349,13 +3324,11 @@ } return; } - if (this.stepper) { - this.stepper.updateOperatorList(this.operatorList); - } + this.stepper?.updateOperatorList(this.operatorList); if (this.running) { return; } @@ -3408,13 +3381,13 @@ } } } -const version = '3.0.7'; +const version = '3.0.44'; exports.version = version; -const build = '86370bd5c'; +const build = '6852001b0'; exports.build = build; /***/ }), /* 5 */ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { @@ -4134,45 +4107,10 @@ } exports.KeyboardManager = KeyboardManager; -class ClipboardManager { - #elements = null; - - copy(element) { - if (!element) { - return; - } - - if (Array.isArray(element)) { - this.#elements = element.map(el => el.serialize()); - } else { - this.#elements = [element.serialize()]; - } - - this.#elements = this.#elements.filter(el => !!el); - - if (this.#elements.length === 0) { - this.#elements = null; - } - } - - paste() { - return this.#elements; - } - - isEmpty() { - return this.#elements === null; - } - - destroy() { - this.#elements = null; - } - -} - class ColorManager { static _colorsMapping = new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]); get _colors() { const colors = new Map([["CanvasText", null], ["Canvas", null]]); @@ -4212,32 +4150,33 @@ class AnnotationEditorUIManager { #activeEditor = null; #allEditors = new Map(); #allLayers = new Map(); - #clipboardManager = new ClipboardManager(); #commandManager = new CommandManager(); #currentPageIndex = 0; #editorTypes = null; #eventBus = null; #idManager = new IdManager(); #isEnabled = false; #mode = _util.AnnotationEditorType.NONE; #selectedEditors = new Set(); + #boundCopy = this.copy.bind(this); + #boundCut = this.cut.bind(this); + #boundPaste = this.paste.bind(this); #boundKeydown = this.keydown.bind(this); #boundOnEditingAction = this.onEditingAction.bind(this); #boundOnPageChanging = this.onPageChanging.bind(this); #previousStates = { isEditing: false, isEmpty: true, - hasEmptyClipboard: true, hasSomethingToUndo: false, hasSomethingToRedo: false, hasSelectedEditor: false }; #container = null; - static _keyboardManager = new KeyboardManager([[["ctrl+a", "mac+meta+a"], AnnotationEditorUIManager.prototype.selectAll], [["ctrl+c", "mac+meta+c"], AnnotationEditorUIManager.prototype.copy], [["ctrl+v", "mac+meta+v"], AnnotationEditorUIManager.prototype.paste], [["ctrl+x", "mac+meta+x"], AnnotationEditorUIManager.prototype.cut], [["ctrl+z", "mac+meta+z"], AnnotationEditorUIManager.prototype.undo], [["ctrl+y", "ctrl+shift+Z", "mac+meta+shift+Z"], AnnotationEditorUIManager.prototype.redo], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete"], AnnotationEditorUIManager.prototype.delete], [["Escape", "mac+Escape"], AnnotationEditorUIManager.prototype.unselectAll]]); + static _keyboardManager = new KeyboardManager([[["ctrl+a", "mac+meta+a"], AnnotationEditorUIManager.prototype.selectAll], [["ctrl+z", "mac+meta+z"], AnnotationEditorUIManager.prototype.undo], [["ctrl+y", "ctrl+shift+Z", "mac+meta+shift+Z"], AnnotationEditorUIManager.prototype.redo], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete"], AnnotationEditorUIManager.prototype.delete], [["Escape", "mac+Escape"], AnnotationEditorUIManager.prototype.unselectAll]]); constructor(container, eventBus) { this.#container = container; this.#eventBus = eventBus; @@ -4259,11 +4198,10 @@ this.#allLayers.clear(); this.#allEditors.clear(); this.#activeEditor = null; this.#selectedEditors.clear(); - this.#clipboardManager.destroy(); this.#commandManager.destroy(); } onPageChanging({ pageNumber @@ -4281,18 +4219,120 @@ #removeKeyboardManager() { this.#container.removeEventListener("keydown", this.#boundKeydown); } + #addCopyPasteListeners() { + document.addEventListener("copy", this.#boundCopy); + document.addEventListener("cut", this.#boundCut); + document.addEventListener("paste", this.#boundPaste); + } + + #removeCopyPasteListeners() { + document.removeEventListener("copy", this.#boundCopy); + document.removeEventListener("cut", this.#boundCut); + document.removeEventListener("paste", this.#boundPaste); + } + + copy(event) { + event.preventDefault(); + + if (this.#activeEditor) { + this.#activeEditor.commitOrRemove(); + } + + if (!this.hasSelection) { + return; + } + + const editors = []; + + for (const editor of this.#selectedEditors) { + if (!editor.isEmpty()) { + editors.push(editor.serialize()); + } + } + + if (editors.length === 0) { + return; + } + + event.clipboardData.setData("application/pdfjs", JSON.stringify(editors)); + } + + cut(event) { + this.copy(event); + this.delete(); + } + + paste(event) { + event.preventDefault(); + let data = event.clipboardData.getData("application/pdfjs"); + + if (!data) { + return; + } + + try { + data = JSON.parse(data); + } catch (ex) { + (0, _util.warn)(`paste: "${ex.message}".`); + return; + } + + if (!Array.isArray(data)) { + return; + } + + this.unselectAll(); + const layer = this.#allLayers.get(this.#currentPageIndex); + + try { + const newEditors = []; + + for (const editor of data) { + const deserializedEditor = layer.deserialize(editor); + + if (!deserializedEditor) { + return; + } + + newEditors.push(deserializedEditor); + } + + const cmd = () => { + for (const editor of newEditors) { + this.#addEditorToLayer(editor); + } + + this.#selectEditors(newEditors); + }; + + const undo = () => { + for (const editor of newEditors) { + editor.remove(); + } + }; + + this.addCommands({ + cmd, + undo, + mustExec: true + }); + } catch (ex) { + (0, _util.warn)(`paste: "${ex.message}".`); + } + } + keydown(event) { if (!this.getActive()?.shouldGetKeyboardEvents()) { AnnotationEditorUIManager._keyboardManager.exec(this, event); } } onEditingAction(details) { - if (["undo", "redo", "cut", "copy", "paste", "delete", "selectAll"].includes(details.name)) { + if (["undo", "redo", "delete", "selectAll"].includes(details.name)) { this[details.name](); } } #dispatchUpdateStates(details) { @@ -4314,20 +4354,21 @@ } setEditingState(isEditing) { if (isEditing) { this.#addKeyboardManager(); + this.#addCopyPasteListeners(); this.#dispatchUpdateStates({ isEditing: this.#mode !== _util.AnnotationEditorType.NONE, isEmpty: this.#isEmpty(), hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), - hasSelectedEditor: false, - hasEmptyClipboard: this.#clipboardManager.isEmpty() + hasSelectedEditor: false }); } else { this.#removeKeyboardManager(); + this.#removeCopyPasteListeners(); this.#dispatchUpdateStates({ isEditing: false }); } } @@ -4384,10 +4425,14 @@ mode }); } updateParams(type, value) { + if (!this.#editorTypes) { + return; + } + for (const editor of this.#selectedEditors) { editor.updateParams(type, value); } for (const editorType of this.#editorTypes) { @@ -4583,70 +4628,10 @@ undo, mustExec: true }); } - copy() { - if (this.#activeEditor) { - this.#activeEditor.commitOrRemove(); - } - - if (this.hasSelection) { - const editors = []; - - for (const editor of this.#selectedEditors) { - if (!editor.isEmpty()) { - editors.push(editor); - } - } - - if (editors.length === 0) { - return; - } - - this.#clipboardManager.copy(editors); - this.#dispatchUpdateStates({ - hasEmptyClipboard: false - }); - } - } - - cut() { - this.copy(); - this.delete(); - } - - paste() { - if (this.#clipboardManager.isEmpty()) { - return; - } - - this.unselectAll(); - const layer = this.#allLayers.get(this.#currentPageIndex); - const newEditors = this.#clipboardManager.paste().map(data => layer.deserialize(data)); - - const cmd = () => { - for (const editor of newEditors) { - this.#addEditorToLayer(editor); - } - - this.#selectEditors(newEditors); - }; - - const undo = () => { - for (const editor of newEditors) { - editor.remove(); - } - }; - - this.addCommands({ - cmd, - undo, - mustExec: true - }); - } - #selectEditors(editors) { this.#selectedEditors.clear(); for (const editor of editors) { if (editor.isEmpty()) { @@ -5685,14 +5670,11 @@ } nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css); } - if (this.fontRegistry) { - this.fontRegistry.registerFont(this); - } - + this.fontRegistry?.registerFont(this); return nativeFontFace; } createFontFaceRule() { if (!this.data || this.disableFontFace) { @@ -5713,14 +5695,11 @@ } rule = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${css}src:${url}}`; } - if (this.fontRegistry) { - this.fontRegistry.registerFont(this, url); - } - + this.fontRegistry?.registerFont(this, url); return rule; } getPathGenerator(objs, character) { if (this.compiledGlyphs[character] !== undefined) { @@ -9704,10 +9683,12 @@ })); exports.OptionalContentConfig = void 0; var _util = __w_pdfjs_require__(1); +var _murmurhash = __w_pdfjs_require__(10); + const INTERNAL = Symbol("INTERNAL"); class OptionalContentGroup { #visible = true; @@ -9729,13 +9710,13 @@ } } class OptionalContentConfig { - #cachedHasInitialVisibility = true; + #cachedGetHash = null; #groups = new Map(); - #initialVisibility = null; + #initialHash = null; #order = null; constructor(data) { this.name = null; this.creator = null; @@ -9764,15 +9745,11 @@ for (const off of data.off) { this.#groups.get(off)._setVisible(INTERNAL, false); } - this.#initialVisibility = new Map(); - - for (const [id, group] of this.#groups) { - this.#initialVisibility.set(id, group.visible); - } + this.#initialHash = this.getHash(); } #evaluateVisibilityExpression(array) { const length = array.length; @@ -9911,27 +9888,15 @@ return; } this.#groups.get(id)._setVisible(INTERNAL, !!visible); - this.#cachedHasInitialVisibility = null; + this.#cachedGetHash = null; } get hasInitialVisibility() { - if (this.#cachedHasInitialVisibility !== null) { - return this.#cachedHasInitialVisibility; - } - - for (const [id, group] of this.#groups) { - const visible = this.#initialVisibility.get(id); - - if (group.visible !== visible) { - return this.#cachedHasInitialVisibility = false; - } - } - - return this.#cachedHasInitialVisibility = true; + return this.getHash() === this.#initialHash; } getOrder() { if (!this.#groups.size) { return null; @@ -9950,10 +9915,24 @@ getGroup(id) { return this.#groups.get(id) || null; } + getHash() { + if (this.#cachedGetHash !== null) { + return this.#cachedGetHash; + } + + const hash = new _murmurhash.MurmurHash3_64(); + + for (const [id, group] of this.#groups) { + hash.update(`${id}:${group.visible}`); + } + + return this.#cachedGetHash = hash.hexdigest(); + } + } exports.OptionalContentConfig = OptionalContentConfig; /***/ }), @@ -10067,14 +10046,11 @@ } } } _onProgressiveDone() { - if (this._fullRequestReader) { - this._fullRequestReader.progressiveDone(); - } - + this._fullRequestReader?.progressiveDone(); this._progressiveDone = true; } _removeRangeReader(reader) { const i = this._rangeReaders.indexOf(reader); @@ -10104,13 +10080,11 @@ return reader; } cancelAllRequests(reason) { - if (this._fullRequestReader) { - this._fullRequestReader.cancel(reason); - } + this._fullRequestReader?.cancel(reason); for (const reader of this._rangeReaders.slice(0)) { reader.cancel(reason); } @@ -10437,10 +10411,12 @@ } else { this.enableClick(); } this.#uiManager.unselectAll(); + this.div.classList.toggle("freeTextEditing", mode === _util.AnnotationEditorType.FREETEXT); + this.div.classList.toggle("inkEditing", mode === _util.AnnotationEditorType.INK); } addInkEditorIfNeeded(isCommitting) { if (!isCommitting && this.#uiManager.getMode() !== _util.AnnotationEditorType.INK) { return; @@ -10866,11 +10842,11 @@ this.#color = params.color || FreeTextEditor._defaultColor || _editor.AnnotationEditor._defaultLineColor; this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize; } static initialize(l10n) { - this._l10nPromise = new Map(["free_text_default_content", "editor_free_text_aria_label"].map(str => [str, l10n.get(str)])); + this._l10nPromise = new Map(["free_text2_default_content", "editor_free_text2_aria_label"].map(str => [str, l10n.get(str)])); const style = getComputedStyle(document.documentElement); this._internalPadding = parseFloat(style.getPropertyValue("--freetext-padding")); } static updateDefaultParams(type, value) { @@ -10975,10 +10951,11 @@ this.editorDiv.contentEditable = true; this.div.draggable = false; this.editorDiv.addEventListener("keydown", this.#boundEditorDivKeydown); this.editorDiv.addEventListener("focus", this.#boundEditorDivFocus); this.editorDiv.addEventListener("blur", this.#boundEditorDivBlur); + this.parent.div.classList.remove("freeTextEditing"); } disableEditMode() { if (!this.isInEditMode()) { return; @@ -10993,10 +10970,11 @@ this.editorDiv.removeEventListener("keydown", this.#boundEditorDivKeydown); this.editorDiv.removeEventListener("focus", this.#boundEditorDivFocus); this.editorDiv.removeEventListener("blur", this.#boundEditorDivBlur); this.div.focus(); this.isEditing = false; + this.parent.div.classList.add("freeTextEditing"); } focusin(event) { super.focusin(event); @@ -11019,10 +10997,11 @@ } remove() { this.isEditing = false; this.parent.setEditingState(true); + this.parent.div.classList.add("freeTextEditing"); super.remove(); } #extractText() { const divs = this.editorDiv.getElementsByTagName("div"); @@ -11121,13 +11100,13 @@ this.editorDiv = document.createElement("div"); this.editorDiv.className = "internal"; this.editorDiv.setAttribute("id", `${this.id}-editor`); this.enableEditing(); - FreeTextEditor._l10nPromise.get("editor_free_text_aria_label").then(msg => this.editorDiv?.setAttribute("aria-label", msg)); - - FreeTextEditor._l10nPromise.get("free_text_default_content").then(msg => this.editorDiv?.setAttribute("default-content", msg)); + FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then(msg => this.editorDiv?.setAttribute("aria-label", msg)); + + FreeTextEditor._l10nPromise.get("free_text2_default_content").then(msg => this.editorDiv?.setAttribute("default-content", msg)); this.editorDiv.contentEditable = true; const { style } = this.editorDiv; @@ -11259,11 +11238,11 @@ this.x = 0; this.y = 0; } static initialize(l10n) { - this._l10nPromise = new Map(["editor_ink_canvas_aria_label", "editor_ink_aria_label"].map(str => [str, l10n.get(str)])); + this._l10nPromise = new Map(["editor_ink_canvas_aria_label", "editor_ink2_aria_label"].map(str => [str, l10n.get(str)])); } static updateDefaultParams(type, value) { switch (type) { case _util.AnnotationEditorParamsType.INK_THICKNESS: @@ -11683,11 +11662,11 @@ baseY = this.y; } super.render(); - InkEditor._l10nPromise.get("editor_ink_aria_label").then(msg => this.div?.setAttribute("aria-label", msg)); + InkEditor._l10nPromise.get("editor_ink2_aria_label").then(msg => this.div?.setAttribute("aria-label", msg)); const [x, y, w, h] = this.#getInitialBBox(); this.setAt(x, y, 0, 0); this.setDims(w, h); this.#createCanvas(); @@ -12701,14 +12680,11 @@ _dispatchEventFromSandbox(actions, jsEvent) { const commonActions = this._commonActions; for (const name of Object.keys(jsEvent.detail)) { const action = actions[name] || commonActions[name]; - - if (action) { - action(jsEvent); - } + action?.(jsEvent); } } _setDefaultPropertiesFromJS(element) { if (!this.enableScripting) { @@ -12894,10 +12870,13 @@ isBound = true; } else if (data.action) { this._bindNamedAction(link, data.action); isBound = true; + } else if (data.setOCGState) { + this.#bindSetOCGState(link, data.setOCGState); + isBound = true; } else if (data.dest) { this._bindLink(link, data.dest); isBound = true; } else { @@ -12960,10 +12939,21 @@ }; link.className = "internalLink"; } + #bindSetOCGState(link, action) { + link.href = this.linkService.getAnchorUrl(""); + + link.onclick = () => { + this.linkService.executeSetOCGState(action); + return false; + }; + + link.className = "internalLink"; + } + _bindJSAction(link, data) { link.href = this.linkService.getAnchorUrl(""); const map = new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]); for (const name of Object.keys(data.actions)) { @@ -13010,14 +13000,11 @@ return; } link.onclick = () => { - if (otherClickAction) { - otherClickAction(); - } - + otherClickAction?.(); const { fields: resetFormFields, refs: resetFormRefs, include } = resetForm; @@ -14068,27 +14055,25 @@ } } class PopupAnnotationElement extends AnnotationElement { + static IGNORE_TYPES = new Set(["Line", "Square", "Circle", "PolyLine", "Polygon", "Ink"]); + constructor(parameters) { - const isRenderable = !!(parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + const { + data + } = parameters; + const isRenderable = !PopupAnnotationElement.IGNORE_TYPES.has(data.parentType) && !!(data.titleObj?.str || data.contentsObj?.str || data.richText?.str); super(parameters, { isRenderable }); } render() { - const IGNORE_TYPES = ["Line", "Square", "Circle", "PolyLine", "Polygon", "Ink"]; this.container.className = "popupAnnotation"; - - if (IGNORE_TYPES.includes(this.data.parentType)) { - return this.container; - } - - const selector = `[data-annotation-id="${this.data.parentId}"]`; - const parentElements = this.layer.querySelectorAll(selector); + const parentElements = this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`); if (parentElements.length === 0) { return this.container; } @@ -15832,14 +15817,14 @@ var _svg = __w_pdfjs_require__(30); var _xfa_layer = __w_pdfjs_require__(28); -const pdfjsVersion = '3.0.7'; -const pdfjsBuild = '86370bd5c'; +const pdfjsVersion = '3.0.44'; +const pdfjsBuild = '6852001b0'; ; })(); /******/ return __webpack_exports__; /******/ })() ; }); \ No newline at end of file diff --git a/toolkit/components/pdfjs/content/build/pdf.scripting.js b/toolkit/components/pdfjs/content/build/pdf.scripting.js --- a/toolkit/components/pdfjs/content/build/pdf.scripting.js +++ b/toolkit/components/pdfjs/content/build/pdf.scripting.js @@ -2089,21 +2089,16 @@ interval }; this._timeoutIds.set(timeout, id); - if (this._timeoutIdsRegistry) { - this._timeoutIdsRegistry.register(timeout, id); - } - + this._timeoutIdsRegistry?.register(timeout, id); return timeout; } _unregisterTimeout(timeout) { - if (this._timeoutIdsRegistry) { - this._timeoutIdsRegistry.unregister(timeout); - } + this._timeoutIdsRegistry?.unregister(timeout); const data = this._timeoutIds.get(timeout); if (!data) { return; @@ -2683,14 +2678,11 @@ } else if (id === "page") { this._document.obj._dispatchPageEvent(event.name, baseEvent.actions, baseEvent.pageNumber); } else if (id === "app" && baseEvent.name === "ResetForm") { for (const fieldId of baseEvent.ids) { const obj = this._objects[fieldId]; - - if (obj) { - obj.obj._reset(); - } + obj?.obj._reset(); } } return; } @@ -4004,17 +3996,13 @@ getPageRotation() {} getPageTransition() {} getPrintParams() { - if (!this._printParams) { - this._printParams = new _print_params.PrintParams({ - lastPage: this._numPages - 1 - }); - } - - return this._printParams; + return this._printParams ||= new _print_params.PrintParams({ + lastPage: this._numPages - 1 + }); } getSound() {} getTemplate() {} @@ -5082,13 +5070,13 @@ } })); var _initialization = __w_pdfjs_require__(1); -const pdfjsVersion = '3.0.7'; -const pdfjsBuild = '86370bd5c'; +const pdfjsVersion = '3.0.44'; +const pdfjsBuild = '6852001b0'; })(); /******/ return __webpack_exports__; /******/ })() ; }); \ No newline at end of file diff --git a/toolkit/components/pdfjs/content/build/pdf.worker.js b/toolkit/components/pdfjs/content/build/pdf.worker.js --- a/toolkit/components/pdfjs/content/build/pdf.worker.js +++ b/toolkit/components/pdfjs/content/build/pdf.worker.js @@ -115,11 +115,11 @@ let terminated = false; let cancelXHRs = null; const WorkerTasks = []; const verbosity = (0, _util.getVerbosityLevel)(); const apiVersion = docParams.apiVersion; - const workerVersion = '3.0.7'; + const workerVersion = '3.0.44'; if (apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); } @@ -25046,10 +25046,14 @@ function adjustToUnicode(properties, builtInEncoding) { if (properties.isInternalFont) { return; } + if (properties.hasIncludedToUnicodeMap) { + return; + } + if (builtInEncoding === properties.defaultEncoding) { return; } if (properties.toUnicode instanceof _to_unicode_map.IdentityToUnicodeMap) { @@ -25058,15 +25062,11 @@ const toUnicode = [], glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); for (const charCode in builtInEncoding) { - if (properties.hasIncludedToUnicodeMap) { - if (properties.toUnicode.has(charCode)) { - continue; - } - } else if (properties.hasEncoding) { + if (properties.hasEncoding) { if (properties.differences.length === 0 || properties.differences[charCode] !== undefined) { continue; } } @@ -36465,20 +36465,20 @@ })); exports.Type1Font = void 0; var _cff_parser = __w_pdfjs_require__(35); +var _util = __w_pdfjs_require__(2); + var _fonts_utils = __w_pdfjs_require__(38); var _core_utils = __w_pdfjs_require__(6); var _stream = __w_pdfjs_require__(10); var _type1_parser = __w_pdfjs_require__(49); -var _util = __w_pdfjs_require__(2); - function findBlock(streamBytes, signature, startIndex) { const streamBytesLength = streamBytes.length; const signatureLength = signature.length; const scanLength = streamBytesLength - signatureLength; let i = startIndex, @@ -36569,10 +36569,15 @@ }; } function getEexecBlock(stream, suggestedLength) { const eexecBytes = stream.getBytes(); + + if (eexecBytes.length === 0) { + throw new _util.FormatError("getEexecBlock - no font program found."); + } + return { stream: new _stream.Stream(eexecBytes), length: eexecBytes.length }; } @@ -45550,11 +45555,12 @@ throw new _util.FormatError("Invalid outline item encountered."); } const data = { url: null, - dest: null + dest: null, + action: null }; Catalog.parseDestDictionary({ destDict: outlineDict, resultObj: data, docBaseUrl: this.pdfManager.docBaseUrl @@ -45568,14 +45574,16 @@ if (Array.isArray(color) && color.length === 3 && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { rgbColor = _colorspace.ColorSpace.singletons.rgb.getRgb(color, 0); } const outlineItem = { + action: data.action, dest: data.dest, url: data.url, unsafeUrl: data.unsafeUrl, newWindow: data.newWindow, + setOCGState: data.setOCGState, title: (0, _util.stringToPDFString)(title), color: rgbColor, count: Number.isInteger(count) ? count : undefined, bold: !!(flags & 2), italic: !!(flags & 1), @@ -46851,10 +46859,44 @@ resultObj.action = namedAction.name; } break; + case "SetOCGState": + const state = action.get("State"); + const preserveRB = action.get("PreserveRB"); + + if (!Array.isArray(state) || state.length === 0) { + break; + } + + const stateArr = []; + + for (const elem of state) { + if (elem instanceof _primitives.Name) { + switch (elem.name) { + case "ON": + case "OFF": + case "Toggle": + stateArr.push(elem.name); + break; + } + } else if (elem instanceof _primitives.Ref) { + stateArr.push(elem.toString()); + } + } + + if (stateArr.length !== state.length) { + break; + } + + resultObj.setOCGState = { + state: stateArr, + preserveRB: typeof preserveRB === "boolean" ? preserveRB : true + }; + break; + case "JavaScript": const jsAction = action.get("JS"); let js; if (jsAction instanceof _base_stream.BaseStream) { @@ -63433,13 +63475,13 @@ } })); var _worker = __w_pdfjs_require__(1); -const pdfjsVersion = '3.0.7'; -const pdfjsBuild = '86370bd5c'; +const pdfjsVersion = '3.0.44'; +const pdfjsBuild = '6852001b0'; })(); /******/ return __webpack_exports__; /******/ })() ; }); \ No newline at end of file diff --git a/toolkit/components/pdfjs/content/web/images/cursor-editorInk.svg b/toolkit/components/pdfjs/content/web/images/cursor-editorInk.svg new file mode 100644 --- /dev/null +++ b/toolkit/components/pdfjs/content/web/images/cursor-editorInk.svg @@ -0,0 +1,3 @@ + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-download.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-download.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-download.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-download.svg @@ -1,4 +1,4 @@ - - \ No newline at end of file + + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-editorFreeText.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-editorFreeText.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-editorFreeText.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-editorFreeText.svg @@ -1,24 +1,3 @@ - - - - - - - - - - - - - + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-editorInk.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-editorInk.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-editorInk.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-editorInk.svg @@ -1,9 +1,4 @@ - - - - - - - - + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-menuArrow.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-menuArrow.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-menuArrow.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-menuArrow.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-pageDown.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-pageDown.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-pageDown.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-pageDown.svg @@ -1,7 +1,3 @@ - - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-pageUp.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-pageUp.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-pageUp.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-pageUp.svg @@ -1,12 +1,3 @@ - - - - - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-print.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-print.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-print.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-print.svg @@ -1,4 +1,3 @@ - - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-search.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-search.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-search.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-search.svg @@ -1,4 +1,3 @@ - - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-secondaryToolbarToggle.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-secondaryToolbarToggle.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-secondaryToolbarToggle.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-secondaryToolbarToggle.svg @@ -1,4 +1,3 @@ - - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-sidebarToggle.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-sidebarToggle.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-sidebarToggle.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-sidebarToggle.svg @@ -1,4 +1,3 @@ - - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-zoomIn.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-zoomIn.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-zoomIn.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-zoomIn.svg @@ -1,4 +1,3 @@ - - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/images/toolbarButton-zoomOut.svg b/toolkit/components/pdfjs/content/web/images/toolbarButton-zoomOut.svg --- a/toolkit/components/pdfjs/content/web/images/toolbarButton-zoomOut.svg +++ b/toolkit/components/pdfjs/content/web/images/toolbarButton-zoomOut.svg @@ -1,4 +1,3 @@ - - \ No newline at end of file + + + diff --git a/toolkit/components/pdfjs/content/web/viewer.html b/toolkit/components/pdfjs/content/web/viewer.html --- a/toolkit/components/pdfjs/content/web/viewer.html +++ b/toolkit/components/pdfjs/content/web/viewer.html @@ -271,15 +271,15 @@
diff --git a/toolkit/components/pdfjs/content/web/viewer.css b/toolkit/components/pdfjs/content/web/viewer.css --- a/toolkit/components/pdfjs/content/web/viewer.css +++ b/toolkit/components/pdfjs/content/web/viewer.css @@ -702,11 +702,13 @@ :root { --focus-outline: solid 2px blue; --hover-outline: dashed 2px blue; --freetext-line-height: 1.35; --freetext-padding: 2px; - --editorInk-editing-cursor: url(images/toolbarButton-editorInk.svg) 0 16; + --editorInk-editing-cursor: url(images/cursor-editorInk.svg) 0 16; + --editorFreeText-editing-cursor: url(images/toolbarButton-editorFreeText.svg) + 8 16; } @media (forced-colors: active) { :root { --focus-outline: solid 3px ButtonText; @@ -729,10 +731,19 @@ position: absolute; top: 0; left: 0; font-size: calc(100px * var(--scale-factor)); transform-origin: 0 0; + cursor: auto; +} + +.annotationEditorLayer.freeTextEditing { + cursor: var(--editorFreeText-editing-cursor), text; +} + +.annotationEditorLayer.inkEditing { + cursor: var(--editorInk-editing-cursor), pointer; } .annotationEditorLayer .selectedEditor { outline: var(--focus-outline); resize: none; @@ -747,10 +758,11 @@ width: auto; height: auto; z-index: 1; transform-origin: 0 0; touch-action: none; + cursor: auto; } .annotationEditorLayer .freeTextEditor .internal { background: transparent; border: none; @@ -811,11 +823,11 @@ cursor: auto; } .annotationEditorLayer .inkEditor.editing { resize: none; - cursor: var(--editorInk-editing-cursor), pointer; + cursor: inherit; } .annotationEditorLayer .inkEditor .inkEditorCanvas { position: absolute; top: 0; diff --git a/toolkit/components/pdfjs/content/web/viewer.js b/toolkit/components/pdfjs/content/web/viewer.js --- a/toolkit/components/pdfjs/content/web/viewer.js +++ b/toolkit/components/pdfjs/content/web/viewer.js @@ -1282,10 +1282,52 @@ source: this, action }); } + async executeSetOCGState(action) { + const pdfDocument = this.pdfDocument; + const optionalContentConfig = await this.pdfViewer.optionalContentConfigPromise; + + if (pdfDocument !== this.pdfDocument) { + return; + } + + let operator; + + for (const elem of action.state) { + switch (elem) { + case "ON": + case "OFF": + case "Toggle": + operator = elem; + continue; + } + + switch (operator) { + case "ON": + optionalContentConfig.setVisibility(elem, true); + break; + + case "OFF": + optionalContentConfig.setVisibility(elem, false); + break; + + case "Toggle": + const group = optionalContentConfig.getGroup(elem); + + if (group) { + optionalContentConfig.setVisibility(elem, !group.visible); + } + + break; + } + } + + this.pdfViewer.optionalContentConfigPromise = Promise.resolve(optionalContentConfig); + } + cachePageRef(pageNum, pageRef) { if (!pageRef) { return; } @@ -1426,10 +1468,12 @@ setHash(hash) {} executeNamedAction(action) {} + executeSetOCGState(action) {} + cachePageRef(pageNum, pageRef) {} isPageVisible(pageNumber) { return true; } @@ -1619,11 +1663,10 @@ _contentDispositionFilename: null, _contentLength: null, _saveInProgress: false, _docStats: null, _wheelUnusedTicks: 0, - _idleCallbacks: new Set(), _PDFBug: null, _hasAnnotationEditors: false, _title: document.title, _printAnnotationStoragePromise: null, @@ -2087,22 +2130,10 @@ } = this.appConfig; toolbar.viewBookmark.hidden = true; secondaryToolbar.viewBookmarkButton.hidden = true; }, - _cancelIdleCallbacks() { - if (!this._idleCallbacks.size) { - return; - } - - for (const callback of this._idleCallbacks) { - window.cancelIdleCallback(callback); - } - - this._idleCallbacks.clear(); - }, - async close() { this._unblockDocumentLoadEvent(); this._hideViewBookmark(); @@ -2134,13 +2165,10 @@ this._contentDispositionFilename = null; this._contentLength = null; this._saveInProgress = false; this._docStats = null; this._hasAnnotationEditors = false; - - this._cancelIdleCallbacks(); - promises.push(this.pdfScriptingManager.destroyPromise); this.setTitle(); this.pdfSidebar.reset(); this.pdfOutlineViewer.reset(); this.pdfAttachmentViewer.reset(); @@ -2568,19 +2596,10 @@ this.pdfLayerViewer.render({ optionalContentConfig, pdfDocument }); }); - const callback = window.requestIdleCallback(() => { - this._collectTelemetry(pdfDocument); - - this._idleCallbacks.delete(callback); - }, { - timeout: 1000 - }); - - this._idleCallbacks.add(callback); }); this._initializePageLabels(pdfDocument); this._initializeMetadata(pdfDocument); @@ -2620,24 +2639,10 @@ numPages: this.pagesCount, URL: this.url }; }, - async _collectTelemetry(pdfDocument) { - const markInfo = await this.pdfDocument.getMarkInfo(); - - if (pdfDocument !== this.pdfDocument) { - return; - } - - const tagged = markInfo?.Marked || false; - this.externalServices.reportTelemetry({ - type: "tagged", - tagged - }); - }, - async _initializeAutoPrint(pdfDocument, openActionPromise) { const [openAction, javaScript] = await Promise.all([openActionPromise, !this.pdfViewer.enableScripting ? pdfDocument.getJavaScript() : null]); if (pdfDocument !== this.pdfDocument) { return; @@ -5553,11 +5558,11 @@ normalizationRegex = noSyllablesRegExp; } else if (syllablePositions.length > 0 && withSyllablesRegExp) { normalizationRegex = withSyllablesRegExp; } else { const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(""); - const regexp = `([${replace}])|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(\\n)`; + const regexp = `([${replace}])|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(\\p{Ideographic}\\n)|(\\n)`; if (syllablePositions.length === 0) { normalizationRegex = noSyllablesRegExp = new RegExp(regexp + "|(\\u0000)", "gum"); } else { normalizationRegex = withSyllablesRegExp = new RegExp(regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`, "gum"); @@ -5576,11 +5581,11 @@ let syllableIndex = 0; let shift = 0; let shiftOrigin = 0; let eol = 0; let hasDiacritics = false; - normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, i) => { + normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, p6, i) => { i -= shiftOrigin; if (p1) { const replacement = CHARACTERS_TO_NORMALIZE[match]; const jj = replacement.length; @@ -5630,10 +5635,17 @@ eol += 1; return p3.charAt(0); } if (p4) { + positions.push([i - shift + 1, shift]); + shiftOrigin += 1; + eol += 1; + return p4.charAt(0); + } + + if (p5) { positions.push([i - shift + 1, shift - 1]); shift -= 1; shiftOrigin += 1; eol += 1; return " "; @@ -5649,11 +5661,11 @@ shift -= newCharLen; shiftOrigin += newCharLen; } - return p5; + return p6; }); positions.push([normalized.length, shift]); return [normalized, positions, hasDiacritics]; } @@ -7007,18 +7019,25 @@ class PDFLayerViewer extends _base_tree_viewer.BaseTreeViewer { constructor(options) { super(options); this.l10n = options.l10n; - this.eventBus._on("resetlayers", this._resetLayers.bind(this)); + this.eventBus._on("optionalcontentconfigchanged", evt => { + this.#updateLayers(evt.promise); + }); + + this.eventBus._on("resetlayers", () => { + this.#updateLayers(); + }); this.eventBus._on("togglelayerstree", this._toggleAllTreeItems.bind(this)); } reset() { super.reset(); this._optionalContentConfig = null; + this._optionalContentHash = null; } _dispatchEvent(layersCount) { this.eventBus.dispatch("layersloaded", { source: this, @@ -7031,10 +7050,11 @@ input }) { const setVisibility = () => { this._optionalContentConfig.setVisibility(groupId, input.checked); + this._optionalContentHash = this._optionalContentConfig.getHash(); this.eventBus.dispatch("optionalcontentconfig", { source: this, promise: Promise.resolve(this._optionalContentConfig) }); }; @@ -7095,10 +7115,11 @@ this._dispatchEvent(0); return; } + this._optionalContentHash = optionalContentConfig.getHash(); const fragment = document.createDocumentFragment(), queue = [{ parent: fragment, groups }]; @@ -7151,20 +7172,33 @@ } this._finishRendering(fragment, layersCount, hasAnyNesting); } - async _resetLayers() { + async #updateLayers(promise = null) { if (!this._optionalContentConfig) { return; } - const optionalContentConfig = await this._pdfDocument.getOptionalContentConfig(); - this.eventBus.dispatch("optionalcontentconfig", { - source: this, - promise: Promise.resolve(optionalContentConfig) - }); + const pdfDocument = this._pdfDocument; + const optionalContentConfig = await (promise || pdfDocument.getOptionalContentConfig()); + + if (pdfDocument !== this._pdfDocument) { + return; + } + + if (promise) { + if (optionalContentConfig.getHash() === this._optionalContentHash) { + return; + } + } else { + this.eventBus.dispatch("optionalcontentconfig", { + source: this, + promise: Promise.resolve(optionalContentConfig) + }); + } + this.render({ optionalContentConfig, pdfDocument: this._pdfDocument }); } @@ -7247,21 +7281,45 @@ } _bindLink(element, { url, newWindow, - dest + action, + dest, + setOCGState }) { const { linkService } = this; if (url) { linkService.addLinkAttributes(element, url, newWindow); return; } + if (action) { + element.href = linkService.getAnchorUrl(""); + + element.onclick = () => { + linkService.executeNamedAction(action); + return false; + }; + + return; + } + + if (setOCGState) { + element.href = linkService.getAnchorUrl(""); + + element.onclick = () => { + linkService.executeSetOCGState(setOCGState); + return false; + }; + + return; + } + element.href = linkService.getDestinationHash(dest); element.onclick = evt => { this._updateCurrentTreeItem(evt.target.parentNode); @@ -9171,16 +9229,11 @@ }); this._thumbnails.push(thumbnail); } - const firstThumbnailView = this._thumbnails[0]; - - if (firstThumbnailView) { - firstThumbnailView.setPdfPage(firstPdfPage); - } - + this._thumbnails[0]?.setPdfPage(firstPdfPage); const thumbnailView = this._thumbnails[this._currentPageNumber - 1]; thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); }).catch(reason => { console.error("Unable to initialize thumbnail viewer", reason); }); @@ -9817,11 +9870,11 @@ constructor(options) { if (this.constructor === BaseViewer) { throw new Error("Cannot initialize BaseViewer."); } - const viewerVersion = '3.0.7'; + const viewerVersion = '3.0.44'; if (_pdfjsLib.version !== viewerVersion) { throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`); } @@ -10105,17 +10158,12 @@ this._cancelRendering(); this._resetView(); - if (this.findController) { - this.findController.setDocument(null); - } - - if (this._scriptingManager) { - this._scriptingManager.setDocument(null); - } + this.findController?.setDocument(null); + this._scriptingManager?.setDocument(null); if (this.#annotationEditorUIManager) { this.#annotationEditorUIManager.destroy(); this.#annotationEditorUIManager = null; } @@ -10262,17 +10310,12 @@ } else if (this._spreadMode !== _ui_utils.SpreadMode.NONE) { this._updateSpreadMode(); } this.#onePageRenderedOrForceFetch().then(async () => { - if (this.findController) { - this.findController.setDocument(pdfDocument); - } - - if (this._scriptingManager) { - this._scriptingManager.setDocument(pdfDocument); - } + this.findController?.setDocument(pdfDocument); + this._scriptingManager?.setDocument(pdfDocument); if (this.#annotationEditorUIManager) { this.eventBus.dispatch("annotationeditormodechanged", { source: this, mode: this.#annotationEditorMode @@ -11708,13 +11751,13 @@ missing_file_error: "Missing PDF file.", unexpected_response_error: "Unexpected server response.", printing_not_supported: "Warning: Printing is not fully supported by this browser.", printing_not_ready: "Warning: The PDF is not fully loaded for printing.", web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.", - free_text_default_content: "Enter text…", - editor_free_text_aria_label: "FreeText Editor", - editor_ink_aria_label: "Ink Editor", + free_text2_default_content: "Start typing…", + editor_free_text2_aria_label: "Text Editor", + editor_ink2_aria_label: "Draw Editor", editor_ink_canvas_aria_label: "User-created image" }; function getL10nFallback(key, args) { switch (key) { @@ -11987,14 +12030,11 @@ this.reset(); } destroy() { this.reset(); - - if (this.pdfPage) { - this.pdfPage.cleanup(); - } + this.pdfPage?.cleanup(); } async _renderAnnotationLayer() { let error = null; @@ -15200,12 +15240,12 @@ var _pdf_link_service = __webpack_require__(3); var _app = __webpack_require__(4); -const pdfjsVersion = '3.0.7'; -const pdfjsBuild = '86370bd5c'; +const pdfjsVersion = '3.0.44'; +const pdfjsBuild = '6852001b0'; const AppConstants = null; exports.PDFViewerApplicationConstants = AppConstants; window.PDFViewerApplication = _app.PDFViewerApplication; window.PDFViewerApplicationConstants = AppConstants; window.PDFViewerApplicationOptions = _app_options.AppOptions; diff --git a/toolkit/components/pdfjs/moz.yaml b/toolkit/components/pdfjs/moz.yaml --- a/toolkit/components/pdfjs/moz.yaml +++ b/toolkit/components/pdfjs/moz.yaml @@ -18,12 +18,12 @@ # Usually different from repository url url: https://github.com/mozilla/pdf.js # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: 86370bd5c5945789491c8cc4e8cf40951e6b1cde (2022-08-28T17:21:45Z). - revision: 86370bd5c5945789491c8cc4e8cf40951e6b1cde + release: 6852001b02bfabc905a874d72989d000e69419f2 (2022-09-07T09:48:27Z). + revision: 6852001b02bfabc905a874d72989d000e69419f2 # The package's license, where possible using the mnemonic from # https://spdx.org/licenses/ # Multiple licenses can be specified (as a YAML list) # A "LICENSE" file must exist containing the full license text