2013-02-02 01:36:58 +09:00
|
|
|
{
|
|
|
|
"name": "pdf.js",
|
2017-10-28 02:51:15 +09:00
|
|
|
"version": "2.0.0",
|
2014-04-11 02:01:51 +09:00
|
|
|
"devDependencies": {
|
2020-09-06 18:49:49 +09:00
|
|
|
"@babel/core": "^7.11.6",
|
2020-07-13 18:05:50 +09:00
|
|
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
|
2020-09-29 22:45:05 +09:00
|
|
|
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
|
2020-07-13 18:05:50 +09:00
|
|
|
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
|
2020-09-06 18:49:49 +09:00
|
|
|
"@babel/plugin-transform-runtime": "^7.11.5",
|
|
|
|
"@babel/preset-env": "^7.11.5",
|
2020-08-09 18:03:07 +09:00
|
|
|
"@babel/runtime": "^7.11.2",
|
|
|
|
"acorn": "^7.4.0",
|
|
|
|
"autoprefixer": "^9.8.6",
|
2020-04-02 19:13:14 +09:00
|
|
|
"babel-loader": "^8.1.0",
|
2019-12-29 03:57:25 +09:00
|
|
|
"canvas": "^2.6.1",
|
2020-04-18 18:08:46 +09:00
|
|
|
"core-js": "^3.6.5",
|
2020-04-19 00:46:58 +09:00
|
|
|
"cross-env": "^7.0.2",
|
2020-06-27 18:30:30 +09:00
|
|
|
"es-module-shims": "^0.4.7",
|
2020-09-29 22:35:58 +09:00
|
|
|
"escodegen": "^2.0.0",
|
2020-10-04 20:49:28 +09:00
|
|
|
"eslint": "^7.10.0",
|
|
|
|
"eslint-config-prettier": "^6.12.0",
|
2019-09-07 19:37:13 +09:00
|
|
|
"eslint-plugin-fetch-options": "^0.0.5",
|
2020-09-20 18:34:24 +09:00
|
|
|
"eslint-plugin-html": "^6.1.0",
|
2020-10-04 20:49:28 +09:00
|
|
|
"eslint-plugin-import": "^2.22.1",
|
2020-08-09 18:03:07 +09:00
|
|
|
"eslint-plugin-mozilla": "^2.8.0",
|
2020-10-04 20:49:28 +09:00
|
|
|
"eslint-plugin-no-unsanitized": "^3.1.4",
|
2020-06-27 18:30:30 +09:00
|
|
|
"eslint-plugin-prettier": "^3.1.4",
|
2020-05-30 17:58:10 +09:00
|
|
|
"eslint-plugin-unicorn": "^20.1.0",
|
2019-05-25 23:36:42 +09:00
|
|
|
"globals": "^11.12.0",
|
|
|
|
"gulp": "^4.0.2",
|
2018-12-23 00:00:53 +09:00
|
|
|
"gulp-postcss": "^8.0.0",
|
2018-08-06 04:20:37 +09:00
|
|
|
"gulp-rename": "^1.4.0",
|
2018-05-20 21:21:08 +09:00
|
|
|
"gulp-replace": "^1.0.0",
|
2018-08-06 04:20:37 +09:00
|
|
|
"gulp-zip": "^4.2.0",
|
2020-08-02 04:11:32 +09:00
|
|
|
"jasmine": "^3.6.1",
|
2020-09-20 18:34:24 +09:00
|
|
|
"jsdoc": "^3.6.6",
|
2018-11-25 05:39:54 +09:00
|
|
|
"jstransformer-markdown-it": "^2.1.0",
|
2017-01-11 02:50:38 +09:00
|
|
|
"merge-stream": "^1.0.1",
|
2020-04-18 18:08:46 +09:00
|
|
|
"mkdirp": "^1.0.4",
|
2020-09-06 18:49:49 +09:00
|
|
|
"needle": "^2.5.2",
|
2020-10-04 20:49:28 +09:00
|
|
|
"postcss-calc": "^7.0.5",
|
Add support for CSS variables using the `PostCSS CSS Variables` package (issue 11462)
Having thought *briefly* about using `css-vars-ponyfill`, I'm no longer convinced that it'd be a good idea. The reason is that if we actually want to properly support CSS variables, then that functionality should be available in *all* of our CSS files.
Note in particular the `pdf_viewer.css` file that's built as part of the `COMPONENTS` target, in which case I really cannot see how a rewrite-at-the-client solution would ever be guaranteed to always work correctly and without accidentally touching other CSS in the surrounding application.
All-in-all, simply re-writing the CSS variables at build-time seems much easier and is thus the approach taken in this patch; courtesy of https://github.com/MadLittleMods/postcss-css-variables
By using its `preserve` option, the built files will thus include *both* a fallback and a modern `var(...)` format[1]. As a proof-of-concept this patch removes a couple of manually added fallback values, and converts an additional sidebar related property to use a CSS variable.
---
[1] Comparing the `master` branch with this patch, when using `gulp generic`, produces the following diff for the built `web/viewer.css` file:
```diff
@@ -408,6 +408,7 @@
:root {
--sidebar-width: 200px;
+ --sidebar-transition-duration: 200ms;
}
* {
@@ -550,27 +551,28 @@
position: absolute;
top: 32px;
bottom: 0;
- width: 200px; /* Here, and elsewhere below, keep the constant value for compatibility
- with older browsers that lack support for CSS variables. */
+ width: 200px;
width: var(--sidebar-width);
visibility: hidden;
z-index: 100;
border-top: 1px solid rgba(51, 51, 51, 1);
-webkit-transition-duration: 200ms;
transition-duration: 200ms;
+ -webkit-transition-duration: var(--sidebar-transition-duration);
+ transition-duration: var(--sidebar-transition-duration);
-webkit-transition-timing-function: ease;
transition-timing-function: ease;
}
html[dir='ltr'] #sidebarContainer {
-webkit-transition-property: left;
transition-property: left;
- left: -200px;
+ left: calc(-1 * 200px);
left: calc(-1 * var(--sidebar-width));
}
html[dir='rtl'] #sidebarContainer {
-webkit-transition-property: right;
transition-property: right;
- right: -200px;
+ right: calc(-1 * 200px);
right: calc(-1 * var(--sidebar-width));
}
@@ -640,6 +642,8 @@
#viewerContainer:not(.pdfPresentationMode) {
-webkit-transition-duration: 200ms;
transition-duration: 200ms;
+ -webkit-transition-duration: var(--sidebar-transition-duration);
+ transition-duration: var(--sidebar-transition-duration);
-webkit-transition-timing-function: ease;
transition-timing-function: ease;
}
```
2020-02-05 06:28:38 +09:00
|
|
|
"postcss-css-variables": "^0.14.0",
|
2020-09-20 18:34:24 +09:00
|
|
|
"prettier": "^2.1.2",
|
2020-10-04 06:06:31 +09:00
|
|
|
"puppeteer": "^5.3.1",
|
2019-08-25 03:08:09 +09:00
|
|
|
"rimraf": "^2.7.1",
|
2018-01-31 23:51:03 +09:00
|
|
|
"streamqueue": "^1.1.2",
|
2020-10-04 20:49:28 +09:00
|
|
|
"stylelint": "^13.7.2",
|
2020-08-29 23:35:27 +09:00
|
|
|
"stylelint-config-prettier": "^8.0.2",
|
|
|
|
"stylelint-prettier": "^1.1.2",
|
2019-01-21 00:34:24 +09:00
|
|
|
"systemjs": "^0.21.6",
|
2017-09-30 06:34:54 +09:00
|
|
|
"systemjs-plugin-babel": "^0.0.25",
|
2020-06-27 18:30:30 +09:00
|
|
|
"terser": "^4.8.0",
|
|
|
|
"through2": "^3.0.2",
|
2019-12-29 03:57:25 +09:00
|
|
|
"ttest": "^2.1.1",
|
2020-07-23 05:38:04 +09:00
|
|
|
"typescript": "^3.9.7",
|
2018-07-01 03:39:31 +09:00
|
|
|
"typogr": "^0.6.8",
|
2020-10-04 20:49:28 +09:00
|
|
|
"vinyl": "^2.2.1",
|
2018-05-20 21:21:08 +09:00
|
|
|
"vinyl-fs": "^3.0.3",
|
2020-04-18 18:08:46 +09:00
|
|
|
"web-streams-polyfill": "^2.1.1",
|
2020-09-20 18:34:24 +09:00
|
|
|
"webpack": "^4.44.2",
|
2020-09-20 20:42:16 +09:00
|
|
|
"webpack-stream": "~6.1.0",
|
2018-11-25 05:00:22 +09:00
|
|
|
"wintersmith": "^2.5.0",
|
2019-10-18 23:42:02 +09:00
|
|
|
"yargs": "^11.1.1"
|
2014-04-11 02:01:51 +09:00
|
|
|
},
|
2013-02-02 01:36:58 +09:00
|
|
|
"scripts": {
|
2020-10-04 06:06:31 +09:00
|
|
|
"postinstall": "cross-env PUPPETEER_PRODUCT=firefox node node_modules/puppeteer/install.js",
|
2019-10-15 04:19:31 +09:00
|
|
|
"test": "gulp npm-test"
|
2013-02-02 01:36:58 +09:00
|
|
|
},
|
|
|
|
"repository": {
|
|
|
|
"type": "git",
|
|
|
|
"url": "git://github.com/mozilla/pdf.js.git"
|
2013-03-27 17:16:40 +09:00
|
|
|
},
|
2015-07-01 12:20:48 +09:00
|
|
|
"license": "Apache-2.0"
|
2013-02-02 01:36:58 +09:00
|
|
|
}
|