Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
akenejie authored Sep 28, 2024
2 parents c0c9e2c + 726cd17 commit dddd6a1
Show file tree
Hide file tree
Showing 123 changed files with 9,118 additions and 2,590 deletions.
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/texlive_on_linux.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: TeX Live on Linux
env:
cache-version: v12
on: [push, pull_request]
on: push

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/texlive_on_mac.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: TeX Live on macOS
env:
cache-version: v12
on: [push, pull_request]
on: push

permissions:
contents: read

jobs:
macosx:
runs-on: macos-latest
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/texlive_on_win.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: TeX Live on Windows
env:
cache-version: v12
on: [push, pull_request]
on: push

permissions:
contents: read
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Change Log

## [10.4.1] - 2024-09-20

### Fixed
- (#4397) When formatting a selection of `latex`, consider the leading spaces.
- (#4401) Tweaked macro suggestion order, prioritize `\(` and degrade starred macros.

### Upgraded
- Upgrade to PDF.js 4.6.82

## [10.4.0] - 2024-09-18

### Added
- (#4379) Support `tex-fmt` as another LaTeX formatter.
- There are a few config item changes related to `latexindent`.

### Fixed
- Macro suggestions filtered and sorted by both label and argument signature.
- (#4347) `--max-print-line` should be added to string when magic tex argument is present under MikTeX.
- (#4380) Wrong auto-completion after typing `\{`.

## [10.3.2] - 2024-09-11

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dev/editviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
.replace('''this.removePageBorders = options.removePageBorders || false;''', '''this.removePageBorders = options.removePageBorders || true;''') \
.replace('''localStorage.setItem("pdfjs.history", databaseStr);''', '''// localStorage.setItem("pdfjs.history", databaseStr);''') \
.replace('''return localStorage.getItem("pdfjs.history");''', '''return // localStorage.getItem("pdfjs.history");''') \
.replace('''this.setTitle(title);''', '''// this.setTitle(title);''') \
.replace('''this.setTitle(title || url);''', '''// this.setTitle(title || url);''') \
.replace('''localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj));''', '''// localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj));''') \
.replace('''prefs: JSON.parse(localStorage.getItem("pdfjs.preferences"))''', '''prefs: undefined // JSON.parse(localStorage.getItem("pdfjs.preferences"))''') \
.replace('''(!event.shiftKey || window.chrome || window.opera)) {''', '''(!event.shiftKey || window.chrome || window.opera)) {\n if (window.parent !== window) {\n return;\n }''') \
Expand Down
8 changes: 4 additions & 4 deletions dev/viewer/viewer.html.diff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/../../web/viewer.html b/../viewer/viewer.html
index badac98dc..bedfdd304 100644
index 7c05f0ac5..4369c642c 100644
--- a/../../web/viewer.html
+++ b/../viewer/viewer.html
@@ -25,15 +25,17 @@ See https://github.com/adobe-type-tools/cmap-resources
Expand All @@ -22,12 +22,12 @@ index badac98dc..bedfdd304 100644
</head>

<body tabindex="1">
@@ -275,7 +277,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-controls="sidebarContainer">
@@ -280,7 +282,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<button id="sidebarToggle" class="toolbarButton" type="button" title="Toggle Sidebar" tabindex="11" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-controls="sidebarContainer">
<span data-l10n-id="pdfjs-toggle-sidebar-button-label">Toggle Sidebar</span>
</button>
- <div class="toolbarButtonSpacer"></div>
+ <!-- <div class="toolbarButtonSpacer"></div> -->
<button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
<button id="viewFind" class="toolbarButton" type="button" title="Find in Document" tabindex="12" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
<span data-l10n-id="pdfjs-findbar-button-label">Find</span>
</button>
60 changes: 30 additions & 30 deletions dev/viewer/viewer.mjs.diff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/../../web/viewer.mjs b/../viewer/viewer.mjs
index da30c00c4..00c98d358 100644
index f6fcf25fc..743ed5ce4 100644
--- a/../../web/viewer.mjs
+++ b/../viewer/viewer.mjs
@@ -715,7 +715,7 @@ const defaultOptions = {
@@ -763,7 +763,7 @@ const defaultOptions = {
kind: OptionKind.API
},
cMapUrl: {
Expand All @@ -11,16 +11,16 @@ index da30c00c4..00c98d358 100644
kind: OptionKind.API
},
disableAutoFetch: {
@@ -763,7 +763,7 @@ const defaultOptions = {
@@ -815,7 +815,7 @@ const defaultOptions = {
kind: OptionKind.API
},
standardFontDataUrl: {
- value: "../web/standard_fonts/",
+ value: "../standard_fonts/",
kind: OptionKind.API
},
verbosity: {
@@ -775,7 +775,7 @@ const defaultOptions = {
useSystemFonts: {
@@ -832,7 +832,7 @@ const defaultOptions = {
kind: OptionKind.WORKER
},
workerSrc: {
Expand All @@ -29,7 +29,7 @@ index da30c00c4..00c98d358 100644
kind: OptionKind.WORKER
}
};
@@ -785,7 +785,7 @@ const defaultOptions = {
@@ -842,7 +842,7 @@ const defaultOptions = {
kind: OptionKind.VIEWER
};
defaultOptions.sandboxBundleSrc = {
Expand All @@ -38,7 +38,7 @@ index da30c00c4..00c98d358 100644
kind: OptionKind.VIEWER
};
defaultOptions.viewerCssTheme = {
@@ -2592,7 +2592,7 @@ class Localization {
@@ -2619,7 +2619,7 @@ class Localization {
if (typeof console !== "undefined") {
const locale = bundle.locales[0];
const ids = Array.from(missingIds).join(", ");
Expand All @@ -47,7 +47,7 @@ index da30c00c4..00c98d358 100644
}
}
if (!hasAtLeastOneBundle && typeof console !== "undefined") {
@@ -3054,11 +3054,11 @@ class GenericScripting {
@@ -3099,11 +3099,11 @@ class GenericScripting {
function initCom(app) {}
class Preferences extends BasePreferences {
async _writeToStorage(prefObj) {
Expand All @@ -61,7 +61,7 @@ index da30c00c4..00c98d358 100644
};
}
}
@@ -4475,7 +4475,7 @@ const FindState = {
@@ -5138,7 +5138,7 @@ const FindState = {
PENDING: 3
};
const FIND_TIMEOUT = 250;
Expand All @@ -70,7 +70,7 @@ index da30c00c4..00c98d358 100644
const MATCH_SCROLL_OFFSET_LEFT = -400;
const CHARACTERS_TO_NORMALIZE = {
"\u2010": "-",
@@ -6840,6 +6840,9 @@ function renderProgress(index, total) {
@@ -7518,6 +7518,9 @@ function renderProgress(index, total) {
}
window.addEventListener("keydown", function (event) {
if (event.keyCode === 80 && (event.ctrlKey || event.metaKey) && !event.altKey && (!event.shiftKey || window.chrome || window.opera)) {
Expand All @@ -80,7 +80,7 @@ index da30c00c4..00c98d358 100644
window.print();
event.preventDefault();
event.stopImmediatePropagation();
@@ -7425,7 +7428,7 @@ class PDFSidebar {
@@ -8102,7 +8105,7 @@ class PDFSidebar {
this.#dispatchEvent();
return;
}
Expand All @@ -89,24 +89,24 @@ index da30c00c4..00c98d358 100644
if (!this.isInitialEventDispatched) {
this.#dispatchEvent();
}
@@ -9975,7 +9978,7 @@ class PDFViewer {
this.#enableHighlightFloatingButton = options.enableHighlightFloatingButton === true;
@@ -10714,7 +10717,7 @@ class PDFViewer {
this.#enableNewAltTextWhenAddingImage = options.enableNewAltTextWhenAddingImage === true;
this.imageResourcesPath = options.imageResourcesPath || "";
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
- this.removePageBorders = options.removePageBorders || false;
+ this.removePageBorders = options.removePageBorders || true;
this.maxCanvasPixels = options.maxCanvasPixels;
this.l10n = options.l10n;
this.l10n ||= new genericl10n_GenericL10n();
@@ -10275,6 +10278,7 @@ class PDFViewer {
@@ -11028,6 +11031,7 @@ class PDFViewer {
}
}
setDocument(pdfDocument) {
+ const oldScale = lwRecordRender(this);
if (this.pdfDocument) {
this.eventBus.dispatch("pagesdestroy", {
source: this
@@ -10343,7 +10347,7 @@ class PDFViewer {
@@ -11094,7 +11098,7 @@ class PDFViewer {
eventBus._on("pagerendered", onAfterDraw, {
signal
});
Expand All @@ -115,7 +115,7 @@ index da30c00c4..00c98d358 100644
if (pdfDocument !== this.pdfDocument) {
return;
}
@@ -10377,7 +10381,7 @@ class PDFViewer {
@@ -11131,7 +11135,7 @@ class PDFViewer {
}
}
const viewerElement = this._scrollMode === ScrollMode.PAGE ? null : viewer;
Expand All @@ -124,15 +124,15 @@ index da30c00c4..00c98d358 100644
const viewport = firstPdfPage.getViewport({
scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS
});
@@ -10406,6 +10410,7 @@ class PDFViewer {
@@ -11161,6 +11165,7 @@ class PDFViewer {
this._pages.push(pageView);
}
this._pages[0]?.setPdfPage(firstPdfPage);
+ await lwRenderSync(this, pdfDocument, pagesCount);
if (this._scrollMode === ScrollMode.PAGE) {
this.#ensurePageViewVisible();
} else if (this._spreadMode !== SpreadMode.NONE) {
@@ -10498,7 +10503,7 @@ class PDFViewer {
@@ -11253,7 +11258,7 @@ class PDFViewer {
this._pages = [];
this._currentPageNumber = 1;
this._currentScale = UNKNOWN_SCALE;
Expand All @@ -141,7 +141,7 @@ index da30c00c4..00c98d358 100644
this._pageLabels = null;
this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);
this._location = null;
@@ -10517,7 +10522,7 @@ class PDFViewer {
@@ -11272,7 +11277,7 @@ class PDFViewer {
};
this.#eventAbortController?.abort();
this.#eventAbortController = null;
Expand All @@ -150,7 +150,7 @@ index da30c00c4..00c98d358 100644
this._updateScrollMode();
this.viewer.removeAttribute("lang");
this.#hiddenCopyElement?.remove();
@@ -10697,8 +10702,8 @@ class PDFViewer {
@@ -11453,8 +11458,8 @@ class PDFViewer {
} else if (this._scrollMode === ScrollMode.HORIZONTAL) {
[hPadding, vPadding] = [vPadding, hPadding];
}
Expand All @@ -161,7 +161,7 @@ index da30c00c4..00c98d358 100644
switch (value) {
case "page-actual":
scale = 1;
@@ -11946,10 +11951,10 @@ class ViewHistory {
@@ -12793,10 +12798,10 @@ class ViewHistory {
}
async _writeToStorage() {
const databaseStr = JSON.stringify(this.database);
Expand All @@ -174,16 +174,16 @@ index da30c00c4..00c98d358 100644
}
async set(name, val) {
await this._initializedPromise;
@@ -12524,7 +12529,7 @@ const PDFViewerApplication = {
title = url;
}
@@ -13381,7 +13386,7 @@ const PDFViewerApplication = {
title = decodeURIComponent(getFilenameFromUrl(url));
} catch {}
}
- this.setTitle(title);
+ // this.setTitle(title);
- this.setTitle(title || url);
+ // this.setTitle(title || url);
},
setTitle(title = this._title) {
this._title = title;
@@ -12971,7 +12976,7 @@ const PDFViewerApplication = {
@@ -13805,7 +13810,7 @@ const PDFViewerApplication = {
this.metadata = metadata;
this._contentDispositionFilename ??= contentDispositionFilename;
this._contentLength ??= contentLength;
Expand All @@ -192,7 +192,7 @@ index da30c00c4..00c98d358 100644
let pdfTitle = info.Title;
const metadataTitle = metadata?.get("dc:title");
if (metadataTitle) {
@@ -13102,9 +13107,9 @@ const PDFViewerApplication = {
@@ -13936,9 +13941,9 @@ const PDFViewerApplication = {
this.pdfSidebar?.setInitialView(sidebarView);
setViewerModes(scrollMode, spreadMode);
if (this.initialBookmark) {
Expand All @@ -204,7 +204,7 @@ index da30c00c4..00c98d358 100644
this.initialBookmark = null;
} else if (storedHash) {
setRotation(rotation);
@@ -14419,7 +14424,7 @@ function webViewerLoad() {
@@ -15199,7 +15204,7 @@ function webViewerLoad() {
try {
parent.document.dispatchEvent(event);
} catch (ex) {
Expand All @@ -213,7 +213,7 @@ index da30c00c4..00c98d358 100644
document.dispatchEvent(event);
}
PDFViewerApplication.run(config);
@@ -14436,4 +14441,3 @@ var __webpack_exports__PDFViewerApplicationConstants = __webpack_exports__.PDFVi
@@ -15216,4 +15221,3 @@ var __webpack_exports__PDFViewerApplicationConstants = __webpack_exports__.PDFVi
var __webpack_exports__PDFViewerApplicationOptions = __webpack_exports__.PDFViewerApplicationOptions;
export { __webpack_exports__PDFViewerApplication as PDFViewerApplication, __webpack_exports__PDFViewerApplicationConstants as PDFViewerApplicationConstants, __webpack_exports__PDFViewerApplicationOptions as PDFViewerApplicationOptions };

Expand Down
Loading

0 comments on commit dddd6a1

Please sign in to comment.