Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend "legacy" compatibilty to include older browsers #3

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7287e48
Expose characters when getting text content
mrtcode Mar 9, 2023
36f5122
Don't use local storage
mrtcode Mar 9, 2023
33694a2
Filter annotations that are handled by Zotero reader
mrtcode Mar 9, 2023
6875138
Allow PDf reader to receive an event when page is created or destroyed
mrtcode Mar 9, 2023
a43f909
Don't intercept keyboard print shortcut
mrtcode Feb 20, 2023
294c8eb
Allow overriding password prompt
mrtcode Feb 20, 2023
44f73be
Remove canvas and puppeteer packages
mrtcode Mar 9, 2023
64b761f
Implement paragraph extraction
mrtcode Mar 31, 2023
81e59df
Unify page data processing and add foundations for outline extraction
mrtcode Jun 7, 2023
d259eea
Fix issue when PDF.js loads a PDF buf without finishing initialization
mrtcode Jun 8, 2023
279cff4
Don't sort paragraphs when extracting PDF page text structure
mrtcode Jun 9, 2023
3ce5891
Add missing flag determining if annotation was exported from Zotero
mrtcode Jun 29, 2023
ef32f7a
Fix some page label recognition regressions
mrtcode Sep 4, 2023
159a1d5
Round char rotation to the closest standard angle
mrtcode Oct 1, 2023
3f3ba8f
Don't cover find result with find popup
mrtcode Oct 13, 2023
046158b
Include URL for outline item
mrtcode Oct 30, 2023
10691ef
Expose not rounded canvas width
mrtcode Nov 1, 2023
130200b
Ignore Zotero exported FreeText annotations
mrtcode Jan 26, 2024
b9073e7
Disable local storage usage
mrtcode Mar 18, 2024
be81cbe
Extend "legacy" compatibilty to include older browsers zotero/web-lib…
tnajdek May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

const autoprefixer = require("autoprefixer");
const postcssDirPseudoClass = require("postcss-dir-pseudo-class");
const postcssIsPseudoClass = require("@csstools/postcss-is-pseudo-class");
const fs = require("fs");
const gulp = require("gulp");
const postcss = require("gulp-postcss");
Expand Down Expand Up @@ -77,9 +78,9 @@ const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString());

const ENV_TARGETS = [
"last 2 versions",
"Chrome >= 92",
"Firefox ESR",
"Safari >= 15.4",
"Chrome >= 67",
"Firefox >= 68",
"Safari >= 11",
"Node >= 18",
"> 1%",
"not IE > 0",
Expand Down Expand Up @@ -208,9 +209,10 @@ function createWebpackConfig(
// `src/core/{glyphlist,unicode}.js` (Babel is too slow for those when
// source-maps are enabled) should be excluded from processing.
const babelExcludes = ["node_modules[\\\\\\/]core-js"];
if (enableSourceMaps) {
babelExcludes.push("src[\\\\\\/]core[\\\\\\/](glyphlist|unicode)");
}
// NOTE: Re-included files below in babel translation to enable compatiblity with older Safari
// if (enableSourceMaps) {
// babelExcludes.push("src[\\\\\\/]core[\\\\\\/](glyphlist|unicode)");
// }
const babelExcludeRegExp = new RegExp(`(${babelExcludes.join("|")})`);

const babelPlugins = ["@babel/plugin-transform-modules-commonjs"];
Expand Down Expand Up @@ -291,7 +293,7 @@ function createWebpackConfig(
loader: "babel-loader",
exclude: babelExcludeRegExp,
options: {
presets: skipBabel ? undefined : ["@babel/preset-env"],
presets: skipBabel ? undefined : [["@babel/preset-env", { useBuiltIns: "usage", corejs: { version: "3.37" } }]],
plugins: babelPlugins,
targets: BABEL_TARGETS,
},
Expand Down Expand Up @@ -923,7 +925,7 @@ function buildGeneric(defines, dir) {
preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
preprocessCSS("web/viewer.css", defines)
.pipe(
postcss([postcssDirPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
postcss([postcssDirPseudoClass(), postcssIsPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
)
.pipe(gulp.dest(dir + "web")),

Expand Down Expand Up @@ -1000,7 +1002,7 @@ function buildComponents(defines, dir) {
gulp.src(COMPONENTS_IMAGES).pipe(gulp.dest(dir + "images")),
preprocessCSS("web/pdf_viewer.css", defines)
.pipe(
postcss([postcssDirPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
postcss([postcssDirPseudoClass(), postcssIsPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
)
.pipe(gulp.dest(dir)),
]);
Expand Down Expand Up @@ -1092,7 +1094,7 @@ function buildMinified(defines, dir) {
preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
preprocessCSS("web/viewer.css", defines)
.pipe(
postcss([postcssDirPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
postcss([postcssDirPseudoClass(), postcssIsPseudoClass(), autoprefixer(AUTOPREFIXER_CONFIG)])
)
.pipe(gulp.dest(dir + "web")),

Expand Down Expand Up @@ -1422,6 +1424,7 @@ gulp.task(
.pipe(
postcss([
postcssDirPseudoClass(),
postcssIsPseudoClass(),
autoprefixer(AUTOPREFIXER_CONFIG),
])
)
Expand Down
Loading
Loading