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-01-31 22:04:49 +09:00
|
|
|
"@babel/core": "^7.8.4",
|
|
|
|
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
|
|
|
|
"@babel/plugin-transform-runtime": "^7.8.3",
|
|
|
|
"@babel/preset-env": "^7.8.4",
|
|
|
|
"@babel/runtime": "^7.8.4",
|
2019-12-19 19:28:13 +09:00
|
|
|
"acorn": "^6.4.0",
|
2020-01-31 22:04:49 +09:00
|
|
|
"autoprefixer": "^9.7.4",
|
2019-05-25 23:36:42 +09:00
|
|
|
"babel-loader": "^8.0.6",
|
2019-12-29 03:57:25 +09:00
|
|
|
"canvas": "^2.6.1",
|
2020-01-31 22:04:49 +09:00
|
|
|
"core-js": "^3.6.4",
|
|
|
|
"escodegen": "^1.13.0",
|
2019-12-29 03:57:25 +09:00
|
|
|
"eslint": "^6.8.0",
|
2020-01-31 22:04:49 +09:00
|
|
|
"eslint-config-prettier": "^6.10.0",
|
2019-09-07 19:37:13 +09:00
|
|
|
"eslint-plugin-fetch-options": "^0.0.5",
|
|
|
|
"eslint-plugin-html": "^6.0.0",
|
2020-01-31 22:04:49 +09:00
|
|
|
"eslint-plugin-import": "^2.20.0",
|
2019-12-19 19:28:13 +09:00
|
|
|
"eslint-plugin-mozilla": "^2.3.1",
|
2018-05-20 21:21:08 +09:00
|
|
|
"eslint-plugin-no-unsanitized": "^3.0.2",
|
2019-12-19 19:28:13 +09:00
|
|
|
"eslint-plugin-prettier": "^3.1.2",
|
2019-08-25 03:21:10 +09:00
|
|
|
"eslint-plugin-unicorn": "^10.0.0",
|
2018-12-23 00:00:53 +09:00
|
|
|
"fancy-log": "^1.3.3",
|
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",
|
2019-09-21 20:41:59 +09:00
|
|
|
"jasmine": "^3.5.0",
|
|
|
|
"jasmine-core": "^3.5.0",
|
2019-08-25 03:08:09 +09:00
|
|
|
"jsdoc": "^3.6.3",
|
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",
|
2016-10-16 23:06:37 +09:00
|
|
|
"mkdirp": "^0.5.1",
|
2020-02-05 08:34:44 +09:00
|
|
|
"postcss-calc": "^7.0.1",
|
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",
|
2019-11-11 19:22:03 +09:00
|
|
|
"prettier": "^1.19.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",
|
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-01-31 22:04:49 +09:00
|
|
|
"terser": "^4.6.3",
|
2019-11-13 11:51:31 +09:00
|
|
|
"through2": "^3.0.1",
|
2019-12-29 03:57:25 +09:00
|
|
|
"ttest": "^2.1.1",
|
2018-07-01 03:39:31 +09:00
|
|
|
"typogr": "^0.6.8",
|
|
|
|
"vinyl": "^2.2.0",
|
2018-05-20 21:21:08 +09:00
|
|
|
"vinyl-fs": "^3.0.3",
|
2019-11-11 19:22:03 +09:00
|
|
|
"web-streams-polyfill": "^2.0.6",
|
2019-12-29 03:57:25 +09:00
|
|
|
"webpack": "^4.41.5",
|
2019-12-23 02:36:06 +09:00
|
|
|
"webpack-stream": "~5.0.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": {
|
2019-12-19 05:26:44 +09:00
|
|
|
"test": "env SKIP_BABEL=true 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
|
|
|
}
|